> For the complete documentation index, see [llms.txt](https://docs-sdk.crypto-chief.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-sdk.crypto-chief.com/processing/dotnet.md).

# .NET / C# SDK

The official .NET / C# SDK for the Crypto Chief crypto processing API — accept payments, send payouts, sign transactions, and verify webhooks across 25+ chains.

The official .NET / C# client for the [Crypto Chief](https://crypto-chief.com/processing/) crypto processing API. One NuGet package gives you fully typed access to payments, payouts, on-chain transactions, wallets, and webhooks across 25+ chains.

[![NuGet](https://img.shields.io/nuget/v/CryptoChief.Processing.svg)](https://www.nuget.org/packages/CryptoChief.Processing)

## Requirements

* **.NET 8.0** or **.NET 6.0** (both LTS)
* A Crypto Chief **Merchant ID** and **API key** (Dashboard → Integration)

## Installation

```bash
dotnet add package CryptoChief.Processing
```

```csharp
using CryptoChief.Processing;
using CryptoChief.Processing.Chains;
using CryptoChief.Processing.Models;
```

The root namespace is `CryptoChief.Processing`. The main client type is `CryptoChiefClient`.

## Quickstart

```csharp
var client = new CryptoChiefClient(
    Environment.GetEnvironmentVariable("MERCHANT_ID")!,
    Environment.GetEnvironmentVariable("API_KEY")!);

var est = await client.Payouts.EstimateAsync(new EstimatePayoutRequest
{
    Network   = Chain.EthSepolia,
    Coin      = "ETH",
    Amount    = "0.0001",
    ToAddress = "0xRecipient...",
});
Console.WriteLine($"amount to receive: {est.AmountToReceive}");
```

{% hint style="success" %}
If `EstimateAsync` returns without throwing, your credentials and request signing are working end-to-end.
{% endhint %}

## Dependency injection (ASP.NET Core / Worker)

Register the client with the host's `IHttpClientFactory`:

```csharp
using Microsoft.Extensions.DependencyInjection;

builder.Services.AddCryptoChief(o =>
{
    o.MerchantId = builder.Configuration["CryptoChief:MerchantId"]!;
    o.ApiKey     = builder.Configuration["CryptoChief:ApiKey"]!;
});
```

Or bind from `IConfiguration`:

```csharp
builder.Services.AddCryptoChief(builder.Configuration.GetSection("CryptoChief"));
```

`CryptoChiefClient` resolves as a transient and reuses a pooled `HttpClient` from the factory, so it cooperates with `IHttpClientBuilder` policies (Polly, custom handlers, logging).

## What you can do

| Domain                        | Service                                       | Key methods                                                                                                                                   |
| ----------------------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Single & batch payouts        | `client.Payouts`                              | `EstimateAsync`, `ExecuteAsync`, `BatchExecuteAsync`, `InfoAsync`, `HistoryAsync`                                                             |
| Sign / execute arbitrary txs  | `client.Transactions`                         | `SignAsync`, `ExecuteAsync`, `SignEvmCallAsync`, `JettonTransferAsync`                                                                        |
| Accept payments               | `client.PayIns`                               | `CreateAsync`, `SelectAssetAsync`, `CancelAsync`, `InfoAsync`, `HistoryAsync`                                                                 |
| Wallets + RSA decrypt         | `client.Wallets`                              | `GenerateAsync`, `ListAsync`, `FreezeAsync`, `HistoryAsync`, `RebindMasterAsync`, `SetCallbackUrlAsync`, `SetLabelAsync`, `DecryptPrivateKey` |
| Treasury sweeps               | `client.Sweeps`                               | `ForceAsync`, `HistoryAsync`, `WalletHistoryAsync`, `SettingsAsync`, `UpdateSettingsAsync`                                                    |
| Static deposits & withdrawals | `client.StaticDeposits`, `client.Withdrawals` | `InfoAsync`, `HistoryAsync`                                                                                                                   |
| API credits                   | `client.Credits`                              | `BalanceAsync`, `TopupAsync`                                                                                                                  |
| On-chain queries & catalogues | `client.Blockchain`                           | `ContractsAvailableAsync`, `ContractsListAsync`, `BlockchainsListAsync`, `WalletBalanceAsync`, `TransactionStatusAsync`                       |
| Rates & currency lists        | `client.Currencies`                           | `FiatToCryptoAsync`, `CryptoToFiatAsync`, `FiatsAsync`, `CryptosAsync`                                                                        |

## Explore the guides

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>🔑 Authentication</strong></td><td>Credentials, client setup, and request signing.</td><td><a href="/processing/dotnet/authentication.md">Authentication</a></td></tr><tr><td><strong>💸 Send a payout</strong></td><td>Estimate, execute idempotently, and confirm.</td><td><a href="/processing/dotnet/guides/payouts.md">Send a payout</a></td></tr><tr><td><strong>📥 Accept payments</strong></td><td>Create PayIn invoices and read deposits.</td><td><a href="/processing/dotnet/guides/accept-payments.md">Accept crypto payments</a></td></tr><tr><td><strong>📡 Webhooks</strong></td><td>Verify signatures and handle typed events.</td><td><a href="/processing/dotnet/guides/webhooks.md">Webhooks</a></td></tr><tr><td><strong>🧩 Contract calls</strong></td><td>EVM / TRON ABI calls with no hand-encoded calldata.</td><td><a href="/processing/dotnet/guides/contract-calls.md">Contract calls (EVM / TRON)</a></td></tr><tr><td><strong>💎 TON transfers</strong></td><td>Jetton, NFT, and comment transfers in one call.</td><td><a href="/processing/dotnet/guides/ton.md">TON: Jetton, NFT &amp; comments</a></td></tr></tbody></table>
