PHPackages                             crypto-chiefs/cryptochief-crypto-processing-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. crypto-chiefs/cryptochief-crypto-processing-php

ActiveLibrary[Payment Processing](/categories/payments)

crypto-chiefs/cryptochief-crypto-processing-php
===============================================

Official PHP SDK for the Crypto Chief crypto processing API. Accept crypto payments, send payouts and mass payouts, sign and broadcast EVM/TRON/Solana/TON/XRP transactions, encode contract calls, and verify webhooks.

v0.1.0(2d ago)10MITPHPPHP ^8.1CI passing

Since Jun 7Pushed 2d agoCompare

[ Source](https://github.com/crypto-chiefs/cryptochief-crypto-processing-php)[ Packagist](https://packagist.org/packages/crypto-chiefs/cryptochief-crypto-processing-php)[ Docs](https://crypto-chief.com/processing/)[ RSS](/packages/crypto-chiefs-cryptochief-crypto-processing-php/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Crypto Chief PHP SDK — Crypto Processing API Client
===================================================

[](#crypto-chief-php-sdk--crypto-processing-api-client)

[![Packagist Version](https://camo.githubusercontent.com/21a358e896b204c3c962adbc372e6e300c67270033ab41557430780bb865c68c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63727970746f2d6368696566732f63727970746f63686965662d63727970746f2d70726f63657373696e672d7068702e737667)](https://packagist.org/packages/crypto-chiefs/cryptochief-crypto-processing-php)[![PHP Version](https://camo.githubusercontent.com/f8cb5637cad95278929a594c54034b6f1724341476e543887137c05a95f403a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f63727970746f2d6368696566732f63727970746f63686965662d63727970746f2d70726f63657373696e672d7068702e737667)](https://packagist.org/packages/crypto-chiefs/cryptochief-crypto-processing-php)[![CI](https://github.com/crypto-chiefs/cryptochief-crypto-processing-php/actions/workflows/ci.yml/badge.svg)](https://github.com/crypto-chiefs/cryptochief-crypto-processing-php/actions/workflows/ci.yml)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![SDK Docs](https://camo.githubusercontent.com/3b9837b19146ef6f033229b0fd8493e12a1c58e9a08626c8aa65390429d6de56/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53444b253230446f63732d646f63732d2d73646b2e63727970746f2d2d63686965662e636f6d2d626c7565)](https://docs-sdk.crypto-chief.com/processing/php)

Official PHP SDK for the [Crypto Chief](https://crypto-chief.com/processing/) crypto processing API. Accept crypto payments, send single and mass payouts, sign and broadcast EVM / TRON / Solana / TON / XRP transactions, encode contract calls, manage wallets, and verify webhooks.

- 25 chains across EVM, TRON, Solana, TON, XRP, and the BTC family
- Single + batch payouts, auto-convert swaps, two-phase sign / execute, static deposits, pay-ins, sweeps, withdrawals, fiat ↔ crypto conversion
- High-level helpers: ERC-20 / TRC-20 transfers, ABI-encoded EVM calls, Solana Anchor instructions, TON Jetton / NFT / text-comment transfers
- Local RSA-OAEP / SHA-256 decryption of generated wallet private keys
- Webhook verification + typed event parsing (framework-agnostic)
- PSR-18 HTTP client support (Guzzle by default), strict types, readonly DTOs, backed enums

Installation
------------

[](#installation)

```
composer require crypto-chiefs/cryptochief-crypto-processing-php
```

Requires PHP 8.1+ with the `bcmath`, `mbstring`, `openssl`, and `json` extensions.

Quickstart
----------

[](#quickstart)

```
use CryptoChief\Processing\Chain;
use CryptoChief\Processing\Client;
use CryptoChief\Processing\Dto\EstimatePayoutRequest;
use CryptoChief\Processing\Dto\ExecutePayoutRequest;

$client = new Client(
    merchantId: 'YOUR_MERCHANT_ID',
    apiKey:     'YOUR_API_KEY',
);

// 1. Preview fees
$estimate = $client->payouts()->estimate(new EstimatePayoutRequest(
    network:   Chain::EthSepolia->value,
    coin:      'ETH',
    amount:    '0.0001',
    toAddress: '0xRecipient...',
));
echo "Will receive: {$estimate->amountToReceive}\n";

// 2. Execute - idempotent on orderId
$payout = $client->payouts()->execute(new ExecutePayoutRequest(
    network:     Chain::EthSepolia->value,
    coin:        'ETH',
    amount:      '0.0001',
    toAddress:   '0xRecipient...',
    orderId:     'order-1234',
    userId:      'user-42',
    urlCallback: 'https://example.com/webhook',
));

// 3. Poll until terminal (or rely on the webhook)
$final = $client->payouts()->waitFor($payout->uuid);
echo "Status: {$final->status}, tx: {$final->txid}\n";
```

Mass payout
-----------

[](#mass-payout)

```
use CryptoChief\Processing\Dto\BatchPayoutRequest;

$items = [];
foreach ($recipients as $i => [$to, $amount]) {
    $items[] = new ExecutePayoutRequest(
        network:     Chain::EthSepolia->value,
        coin:        'ETH',
        amount:      $amount,
        toAddress:   $to,
        orderId:     "batch-{$i}",
        userId:      "user-{$i}",
        urlCallback: 'https://example.com/webhook',
    );
}

$result = $client->payouts()->batchExecute(new BatchPayoutRequest(items: $items));
foreach ($result->items ?? [] as $row) {
    echo $row->uuid ? "OK {$row->uuid}\n" : "FAIL {$row->error}\n";
}
```

Funds lock sequentially inside a batch — an intra-batch double-spend cannot occur, even when the total exceeds your balance partway through. Max 50 items per call.

Accept payments (pay-ins / invoices)
------------------------------------

[](#accept-payments-pay-ins--invoices)

A pay-in is an invoice that gives your customer a deposit address (or hosted payment page) and notifies you over webhook when it's paid. Two modes:

- **FIAT** — you fix the price in fiat (`amountFiat` + `currency`); the SDK locks the crypto rate at confirmation time. The customer picks a coin/network at checkout (filter the menu with `assets`).
- **CRYPTO** — you fix the crypto amount and the asset up front (`amountCrypto` + `asset`).

### FIAT invoice ($25 USD, customer picks USDT on any supported network)

[](#fiat-invoice-25-usd-customer-picks-usdt-on-any-supported-network)

```
use CryptoChief\Processing\Client;
use CryptoChief\Processing\Dto\Asset;
use CryptoChief\Processing\Dto\AssetsPolicy;
use CryptoChief\Processing\Dto\CreatePayInRequest;

$invoice = $client->payIns()->create(new CreatePayInRequest(
    orderId:      'order-' . bin2hex(random_bytes(6)),
    userId:       'customer-42',
    mode:         'fiat',
    amountFiat:   '25.00',
    currency:     'USD',
    lifetimeSec:  3600,           // expires after 1 hour
    urlCallback:  'https://example.com/cryptochief/webhook',
    urlSuccess:   'https://example.com/thanks',
    urlError:     'https://example.com/oops',
    assets: new AssetsPolicy(
        allow: [
            new Asset(coin: 'USDT'),  // any network
        ],
    ),
));

echo "Invoice: {$invoice->uuid}\n";
echo "Payment link: {$invoice->paymentLink}\n";
```

The customer opens `paymentLink` and picks a coin. Once they do, the invoice transitions out of `waiting_asset_select` and exposes `toAddress` + `paymentCoin` + `paymentNetwork`.

### CRYPTO invoice (exact 0.01 ETH on Sepolia)

[](#crypto-invoice-exact-001-eth-on-sepolia)

```
use CryptoChief\Processing\Chain;
use CryptoChief\Processing\Dto\Asset;

$invoice = $client->payIns()->create(new CreatePayInRequest(
    orderId:      'order-' . bin2hex(random_bytes(6)),
    userId:       'customer-42',
    mode:         'crypto',
    amountCrypto: '0.01',
    asset: new Asset(
        network: Chain::EthSepolia->value,
        coin:    'ETH',
    ),
    lifetimeSec: 1800,
    urlCallback: 'https://example.com/cryptochief/webhook',
));

echo "Send {$invoice->amountCrypto} {$invoice->paymentCoin} to {$invoice->toAddress}\n";
```

### Lifecycle

[](#lifecycle)

```
use CryptoChief\Processing\Dto\SelectAssetRequest;

// H2H integrations: commit the asset choice server-side.
$client->payIns()->selectAsset(new SelectAssetRequest(
    uuid:    $invoice->uuid,
    coin:    'USDT',
    network: Chain::TronMainnet->value,
));

// Poll until terminal (paid / cancel / expired) - or rely on the invoice.* webhook.
$final = $client->payIns()->waitFor($invoice->uuid, intervalSec: 5.0, timeoutSec: 1800.0);
echo "Status: {$final->status}\n";

// Cancel an open order before it's paid.
$client->payIns()->cancel($invoice->uuid);
```

Contract calls
--------------

[](#contract-calls)

The SDK ABI-encodes calldata for you. No more `0xa9059cbb...` by hand.

```
use CryptoChief\Processing\Amount;
use CryptoChief\Processing\Dto\Erc20TransferRequest;

// ERC-20 / TRC-20 one-liner
$signed = $client->transactions()->erc20Transfer(new Erc20TransferRequest(
    network:       Chain::TronMainnet->value,
    fromAddress:   'TYourWallet...',
    tokenContract: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', // USDT on TRON
    recipient:     'TRecipient...',
    amount:        Amount::humanToBase('1.23', 6),
));
```

Arbitrary Solidity calls — the SDK reads the signature, computes the Keccak-256 selector, encodes head + tail, and hands you the bytes:

```
use CryptoChief\Processing\Dto\EvmCallRequest;

$client->transactions()->signEvmCall(new EvmCallRequest(
    network:     Chain::EthMainnet->value,
    fromAddress: '0xMerchantWallet',
    contract:    '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D', // Uniswap V2
    method:      'swapExactTokensForTokens(uint256,uint256,address[],address,uint256)',
    args:        [$amountIn, $minOut, [$dai, $weth], $to, $deadline],
));
```

Solana Anchor programs — Borsh has no on-wire type tags, so the SDK forces explicit typing through `Borsh::*` constructors:

```
use CryptoChief\Processing\Contract\Borsh;
use CryptoChief\Processing\Dto\AnchorCallRequest;
use CryptoChief\Processing\Dto\SolanaAccount;

$client->transactions()->signAnchorCall(new AnchorCallRequest(
    network:     Chain::SolanaMainnet->value,
    fromAddress: 'YourMerchantOwnedSolanaWallet',
    program:     'YourAnchorProgramId',
    method:      'initialize',
    args: [
        Borsh::u64(1_000_000),
        Borsh::string('hello'),
    ],
    accounts: [
        new SolanaAccount(pubkey: $from, isSigner: true, isWritable: true),
    ],
));
```

### TON — Jetton / NFT / text comment

[](#ton--jetton--nft--text-comment)

High-level helpers build the standard TEP-74 / TEP-62 / text-comment bodies. The underlying BoC encoding is delegated to `olifanton/interop`. For arbitrary contracts use `signTonCall(TonCallRequest)` with raw BoC bytes.

```
use CryptoChief\Processing\Amount;
use CryptoChief\Processing\Chain;
use CryptoChief\Processing\Dto\JettonTransferRequest;
use CryptoChief\Processing\Dto\NftTransferRequest;
use CryptoChief\Processing\Dto\TonCommentRequest;

// USDT on TON — auto-resolves the sender's jetton wallet, picks gas (0.07 or 0.15 TON).
$client->transactions()->jettonTransfer(new JettonTransferRequest(
    network:      Chain::TonMainnet->value,
    fromAddress:  'EQYourTonWallet...',
    recipient:    'EQRecipientMainWallet...',
    amount:       Amount::humanToBase('1.5', 6),   // 1.5 USDT
    jettonMaster: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs', // USDT jetton master
    memo:         'invoice #1234',                  // shown by every wallet
));

// NFT transfer (TEP-62)
$client->transactions()->nftTransfer(new NftTransferRequest(
    network:     Chain::TonMainnet->value,
    fromAddress: 'EQYourTonWallet...',
    nftItem:     'EQNftItemAddress...',
    newOwner:    'EQNewOwnerAddress...',
));

// Send TON with a text comment
$client->transactions()->sendTonComment(new TonCommentRequest(
    network:     Chain::TonMainnet->value,
    fromAddress: 'EQYourTonWallet...',
    recipient:   'EQRecipient...',
    text:        'thanks!',
    amountTon:   Amount::nanoTon('0.5'),
));
```

For a pre-built BoC body (custom contracts), use `signTonCall(TonCallRequest)` directly with raw bytes.

Wallets
-------

[](#wallets)

```
use CryptoChief\Processing\ChainFamily;
use CryptoChief\Processing\Dto\GenerateWalletRequest;

$client = new Client(
    merchantId:    'M',
    apiKey:        'K',
    rsaPrivateKey: '/path/to/private.pem',   // PEM string or path
);

$wallet = $client->wallets()->generate(new GenerateWalletRequest(
    walletType:  'transit',
    chainFamily: ChainFamily::Evm->value,
));

if ($wallet->privateKeyEncrypted !== null) {
    // Decryption is local - the plaintext private key never leaves the process.
    $key = $client->wallets()->decryptPrivateKey($wallet->privateKeyEncrypted);
}
```

Webhooks
--------

[](#webhooks)

```
use CryptoChief\Processing\Exception\WebhookSignatureException;
use CryptoChief\Processing\Webhook;
use CryptoChief\Processing\Webhook\PayoutEvent;

$raw       = file_get_contents('php://input') ?: '';   // raw bytes - never re-encode
$signature = $_SERVER['HTTP_SIGNATURE'] ?? null;

try {
    $event = Webhook::parseEvent($apiKey, $raw, $signature);
} catch (WebhookSignatureException) {
    http_response_code(401);
    return;
}

if ($event instanceof PayoutEvent) {
    // typed access: $event->uuid, $event->status, $event->amountToReceive, ...
}
```

Laravel / Symfony are the same shape — pass the request's raw body to `Webhook::parseEvent()`. Optionally restrict by source IP: `Webhook::SENDER_IPS` lists the production webhook IP addresses.

Errors
------

[](#errors)

Every SDK error extends `CryptoChiefException`, so a single catch covers the library. API failures arrive as `ApiException` with a stable `$errorCode` you can branch on:

```
use CryptoChief\Processing\ErrorCode;
use CryptoChief\Processing\Exception\ApiException;

try {
    $client->payouts()->execute($req);
} catch (ApiException $e) {
    if ($e->errorCode === ErrorCode::InsufficientFunds->value) {
        // top up and retry
    }
}
```

Only 5xx and network failures retry; 4xx is the caller's fault and surfaces immediately.

Amount precision
----------------

[](#amount-precision)

Crypto amounts are decimal strings end-to-end. `float` loses precision past 2^53 and binary rounding bites large token values, so the SDK never uses it for amounts. Convert between human and base units with `Amount::humanToBase()` / `Amount::baseToHuman()`:

```
use CryptoChief\Processing\Amount;

Amount::humanToBase('1.5', 18);    // "1500000000000000000"
Amount::baseToHuman('10000', 8);   // "0.0001"
Amount::nanoTon('0.05');           // "50000000"
```

Configuration
-------------

[](#configuration)

```
$client = new Client(
    merchantId:    'M',
    apiKey:        'K',
    baseUrl:       Client::DEFAULT_BASE_URL,    // override for staging
    userAgent:     'my-app/1.0',
    retries:       3,
    timeoutSec:    60.0,
    retryBaseMs:   200.0,
    retryMaxMs:    5000.0,
    httpClient:    $myPsr18Client,              // bring your own
    rsaPrivateKey: '/path/to/private.pem',
);
```

`httpClient` accepts any `Psr\Http\Client\ClientInterface`. The default is Guzzle 7.

Documentation
-------------

[](#documentation)

- SDK docs:
- REST API reference:
- Product page:

SDKs for other languages live under the [crypto-chiefs](https://github.com/crypto-chiefs)GitHub organization.

FAQ — common crypto-processing tasks in PHP
-------------------------------------------

[](#faq--common-crypto-processing-tasks-in-php)

- **How do I accept crypto payments in PHP?** Open a pay-in via `$client->payIns()->create(new CreatePayInRequest(...))`. The response carries the `paymentLink` (and the address once the customer picks a coin).
- **How do I send mass payouts in PHP?** Call `$client->payouts()->batchExecute(new BatchPayoutRequest(items: $items))` with up to 50 recipients. Each item idempotent on its `orderId`.
- **How do I send USDT (TRC-20 / ERC-20 / BEP-20) from PHP?** `erc20Transfer()` — the SDK encodes `transfer(address,uint256)` and handles TRON base58 addresses transparently.
- **How do I send Jettons (USDT on TON, etc.) from PHP?** `jettonTransfer()` — the SDK builds the TEP-74 body, auto-resolves the sender's Jetton wallet via the gateway's TON RPC proxy, and picks the gas budget.
- **How do I verify Crypto Chief webhooks in PHP?** `Webhook::parseEvent($apiKey, $rawBody, $signature)` — re-canonicalizes the body, MD5-verifies, and returns a typed event.
- **Does it work with Laravel / Symfony?** Yes — the HTTP client is PSR-18 compatible and the webhook verifier takes raw bytes, so it slots into any framework's request body.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance99

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18123233?v=4)[fropsas](/maintainers/fropsas)[@fropsas](https://github.com/fropsas)

---

Top Contributors

[![fropsas](https://avatars.githubusercontent.com/u/18123233?v=4)](https://github.com/fropsas "fropsas (1 commits)")

---

Tags

crypto-paymentscrypto-processingcryptochieferc20ethereumevmjettonmass-payoutpackagistpayment-gatewaypayoutphpphp-sdksolanatontrc20tronusdcusdtwebhooksdkcryptopayment processingwebhookbitcoinREST APIlitecoindogecoincryptocurrencypayment gatewayanchorPolygonethereumxrptronbitcoin-cashpayouttonBEP20solanacrypto paymentstrc20erc20stablecoinUSDCUSDTevmarbitrumavalancheaccept-crypto-paymentscryptochiefcrypto-chiefcrypto-processingmass-payoutoptimismjetton

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/crypto-chiefs-cryptochief-crypto-processing-php/health.svg)

```
[![Health](https://phpackages.com/badges/crypto-chiefs-cryptochief-crypto-processing-php/health.svg)](https://phpackages.com/packages/crypto-chiefs-cryptochief-crypto-processing-php)
```

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

42.9k337.6k1](/packages/ccxt-ccxt)[kornrunner/ccxt

A PHP cryptocurrency trading library with support for more than 90 bitcoin/altcoin exchanges

371.6k](/packages/kornrunner-ccxt)[hardcastle/xrpl_php

PHP SDK / Client for the XRP Ledger

1210.4k6](/packages/hardcastle-xrpl-php)[plisio/plisio-api-php

156.4k](/packages/plisio-plisio-api-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
