> 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/js.md).

# Node.js / TypeScript SDK

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

[![npm](https://img.shields.io/npm/v/@cryptochiefs/cryptochief-crypto-processing-node.svg)](https://www.npmjs.com/package/@cryptochiefs/cryptochief-crypto-processing-node)

## Requirements

* Node.js **18+** (uses the built-in `fetch`)
* A Crypto Chief **Merchant ID** and **API key** (Dashboard → Integration)

## Installation

```bash
npm install @cryptochiefs/cryptochief-crypto-processing-node
```

```ts
// ESM / TypeScript
import { CryptoChiefClient, Chain } from '@cryptochiefs/cryptochief-crypto-processing-node';
// CommonJS
const { CryptoChiefClient, Chain } = require('@cryptochiefs/cryptochief-crypto-processing-node');
```

The package ships **ESM, CommonJS, and type definitions** — it works the same in TypeScript and plain JavaScript.

## Quickstart

```ts
const client = new CryptoChiefClient({
  merchantId: process.env.MERCHANT_ID!,
  apiKey: process.env.API_KEY!,
});

const est = await client.payouts.estimate({
  network: Chain.EthSepolia,
  coin: 'ETH',
  amount: '0.0001',
  toAddress: '0xRecipient...',
});
console.log('amount to receive:', est.amountToReceive);
```

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

## What you can do

| Domain                       | Service               | Key methods                                                         |
| ---------------------------- | --------------------- | ------------------------------------------------------------------- |
| Single & batch payouts       | `client.payouts`      | `estimate`, `execute`, `batchExecute`, `info`, `history`, `waitFor` |
| Sign / execute arbitrary txs | `client.transactions` | `sign`, `execute`, `signEvmCall`, `jettonTransfer`                  |
| Accept payments              | `client.payIns`       | `create`, `selectAsset`, `cancel`, `info`, `history`, `waitFor`     |
| Wallets + RSA decrypt        | `client.wallets`      | `generate`, `list`, `freeze`, `decryptPrivateKey`                   |
| Treasury sweeps              | `client.sweeps`       | `force`, `history`                                                  |
| On-chain queries             | `client.blockchain`   | `contractsAvailable`, `walletBalance`, `transactionStatus`          |
| Fiat ↔ crypto rates          | `client.currencies`   | `fiatToCrypto`, `cryptoToFiat`                                      |

## 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/2NWEMxRwiaQKIn2ILBlz">/pages/2NWEMxRwiaQKIn2ILBlz</a></td></tr><tr><td><strong>💸 Send a payout</strong></td><td>Estimate, execute idempotently, and confirm.</td><td><a href="/pages/9lTi2du3XQLYT5ZH5RBb">/pages/9lTi2du3XQLYT5ZH5RBb</a></td></tr><tr><td><strong>📥 Accept payments</strong></td><td>Create PayIn invoices and read deposits.</td><td><a href="/pages/mY0VOCZKkeor2hO3QemT">/pages/mY0VOCZKkeor2hO3QemT</a></td></tr><tr><td><strong>📡 Webhooks</strong></td><td>Verify signatures and handle typed events.</td><td><a href="/pages/PcJCWNcEw3oSRLwPJbQw">/pages/PcJCWNcEw3oSRLwPJbQw</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/iquDbxtTRBlQ0X3cn2su">/pages/iquDbxtTRBlQ0X3cn2su</a></td></tr><tr><td><strong>💎 TON transfers</strong></td><td>Jetton, NFT, and comment transfers in one call.</td><td><a href="/pages/dDMMof4yDnSo4omLXnFn">/pages/dDMMof4yDnSo4omLXnFn</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/js.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.
