Kkhay 1.0.4

Prefix Reserved
dotnet add package Kkhay --version 1.0.4
                    
NuGet\Install-Package Kkhay -Version 1.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Kkhay" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Kkhay" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Kkhay" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Kkhay --version 1.0.4
                    
#r "nuget: Kkhay, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Kkhay@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Kkhay&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Kkhay&version=1.0.4
                    
Install as a Cake Tool

K Khay .NET SDK 🔷

Official C# and .NET SDK for K Khay — The Non-Custodial Crypto Payment Gateway

NuGet version CI License: MIT .NET

Accept cryptocurrency payments across 190+ blockchain networks and 500+ tokens (EVM, Bitcoin, Solana, TON, Tron, and XRPL) with zero custody and automatic direct-to-wallet settlement in ASP.NET Core, Blazor, and .NET applications.

Gateway Dashboard • API Keys • Website


⚡ Highlights

  • 🛡️ 100% Non-Custodial: Payments settle directly to your destination blockchain address in seconds. K Khay never holds your private keys or customer funds.
  • 🌐 190+ Networks Supported:
    • EVM Networks: Ethereum, BNB Smart Chain, Polygon, Arbitrum, Base, Optimism, Avalanche, and 180+ more.
    • UTXO Chains: Bitcoin (btc), Dogecoin (doge), Litecoin (ltc), Bitcoin Cash (bch).
    • High-Throughput Chains: Solana (sol), TON (ton), Tron (trx), XRP Ledger (xrp).
  • 🪙 500+ Tokens: Native coins and tokens (USDT, USDC, BTC, ETH, SOL, TON, BNB, DOGE, XRP, TRX, LTC, and all major tokens).
  • 🔗 Branded Hosted Checkouts: Automatic payment links with dynamic QR codes, live blockchain polling, and wallet deep linking.
  • 🔔 HMAC-SHA256 Cryptographic Webhooks: Timing-safe verification matching x-kkhay-signature.
  • 📦 Dual Target: Supports .NET 8.0 and .NET Standard 2.1 with System.Text.Json serialization.

📦 Installation

Add the official package to your .NET project via the .NET CLI:

dotnet add package Kkhay

Or via Package Manager:

Install-Package Kkhay

🚀 Quick Start

1. Initialize the Client

Generate your API key in the K Khay Gateway Dashboard.

using Kkhay;
using Kkhay.Models;

using var client = new KkhayClient("kkhay_live_your_api_key_here");
In ASP.NET Core (Dependency Injection):
// Program.cs
builder.Services.AddHttpClient<KkhayClient>((sp, httpClient) =>
{
    var apiKey = builder.Configuration["Kkhay:ApiKey"]!;
    return new KkhayClient(httpClient, apiKey);
});

2. Create a Crypto Payment Invoice

Accept stablecoins, native coins, or let the customer choose their preferred token and chain on checkout:

// Example: USDT on BNB Smart Chain (BSC)
var response = await client.CreateInvoiceAsync(new CreateInvoiceRequest
{
    Amount = 49.99m,
    Currency = "USD",
    PayNetwork = "bsc",       // "bsc" | "polygon" | "base" | "arbitrum" | "ethereum" | "solana" | "bitcoin" | "ton"
    PayToken = "USDT",        // "USDT" | "USDC" | "BTC" | "ETH" | "SOL" | "TON"
    OrderId = "ORD-4491",     // Your internal order ID
    Title = "Pro Subscription",
    CustomerEmail = "customer@example.com",
    RedirectUrl = "https://myshop.com/success",
    CancelUrl = "https://myshop.com/cart"
});

Console.WriteLine($"Invoice ID: {response.Invoice.Id}");
Console.WriteLine($"Gateway ID: {response.Invoice.GatewayId}");
Console.WriteLine($"Deposit Address: {response.Invoice.DepositAddress}");
Console.WriteLine($"Hosted Checkout URL: {response.Invoice.HostedUrl}");

// Redirect customer to the checkout page:
// return Results.Redirect(response.Invoice.HostedUrl);

3. Fetch & List Invoices

// Retrieve single invoice with blockchain transaction history
var invoiceDetails = await client.GetInvoiceAsync("01940000-0000-7000-8000-000000000001");

Console.WriteLine($"Status: {invoiceDetails.Invoice.Status}"); // WAITING | PAID | EXPIRED | CANCELED
foreach (var payment in invoiceDetails.Payments)
{
    Console.WriteLine($"Received {payment.AmountReceived} on Tx: {payment.TxHash} (Confirms: {payment.Confirmations})");
}

// List invoices with pagination and filters
var list = await client.ListInvoicesAsync(
    page: 1,
    limit: 20,
    status: GatewayInvoiceStatus.Paid
);

Console.WriteLine($"Total Paid Invoices: {list.TotalCount}");

4. Verify Incoming Webhooks (ASP.NET Core Minimal API)

When a customer pays and the blockchain confirms the transaction, K Khay sends a cryptographically signed POST webhook to your server:

app.MapPost("/api/webhooks/kkhay", async (HttpRequest request) =>
{
    using var reader = new StreamReader(request.Body);
    var rawBody = await reader.ReadToEndAsync();
    var signature = request.Headers["x-kkhay-signature"].ToString();
    var webhookSecret = Environment.GetEnvironmentVariable("KKHAY_WEBHOOK_SECRET")!;

    try
    {
        var evt = Webhook.ParseEvent(rawBody, signature, webhookSecret);

        if (evt.Event == "payment.paid")
        {
            Console.WriteLine($"Payment confirmed for Order: {evt.OrderId}");
            Console.WriteLine($"Tx Hash: {evt.TxHash}");
            Console.WriteLine($"Received: {evt.PayAmount} {evt.PayToken} on {evt.PayNetwork}");
            // Fulfill customer order in database
        }

        return Results.Ok(new { ok = true });
    }
    catch (SignatureVerificationException)
    {
        return Results.Unauthorized();
    }
});

🌐 Supported Networks & Families

Network Family Popular Chains Supported Tokens
EVM (180+ Chains) Ethereum, BNB Smart Chain, Polygon, Arbitrum, Base, Optimism, Avalanche USDT, USDC, ETH, BNB, POL, AVAX, DAI, ERC-20s
UTXO Bitcoin, Dogecoin, Litecoin, Bitcoin Cash BTC, DOGE, LTC, BCH
Solana Solana Mainnet SOL, USDT, USDC
TON The Open Network TON, USDT
Tron (TVM) Tron Mainnet TRX, USDT
XRPL XRP Ledger XRP

📄 License

MIT © K Khay

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 80 10/25/2026
1.0.0 103 10/6/2026