> 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# 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`, `DecryptPrivateKey`                  |
| Treasury sweeps              | `client.Sweeps`       | `ForceAsync`, `HistoryAsync`                                                      |
| On-chain queries             | `client.Blockchain`   | `ContractsAvailableAsync`, `WalletBalanceAsync`, `TransactionStatusAsync`         |
| Fiat ↔ crypto rates          | `client.Currencies`   | `FiatToCryptoAsync`, `CryptoToFiatAsync`                                          |

## 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="/pages/j3n0dzwBb1vQ3Y5FzRum">/pages/j3n0dzwBb1vQ3Y5FzRum</a></td></tr><tr><td><strong>💸 Send a payout</strong></td><td>Estimate, execute idempotently, and confirm.</td><td><a href="/pages/FsS7bKXqOfBpNkMwhXMV">/pages/FsS7bKXqOfBpNkMwhXMV</a></td></tr><tr><td><strong>📥 Accept payments</strong></td><td>Create PayIn invoices and read deposits.</td><td><a href="/pages/g044GBElArtrTnWvszEX">/pages/g044GBElArtrTnWvszEX</a></td></tr><tr><td><strong>📡 Webhooks</strong></td><td>Verify signatures and handle typed events.</td><td><a href="/pages/oBfc9yzurxFgEbpmOhBr">/pages/oBfc9yzurxFgEbpmOhBr</a></td></tr><tr><td><strong>🧩 Contract calls</strong></td><td>EVM / TRON ABI calls with no hand-encoded calldata.</td><td><a href="/pages/WLwJL88d4Q2D4tOekFlV">/pages/WLwJL88d4Q2D4tOekFlV</a></td></tr><tr><td><strong>💎 TON transfers</strong></td><td>Jetton, NFT, and comment transfers in one call.</td><td><a href="/pages/ZWiOPkhomTcr2BplREFM">/pages/ZWiOPkhomTcr2BplREFM</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-sdk.crypto-chief.com/processing/dotnet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
