yativo / crypto-sdk
Official Yativo Crypto SDK for PHP
1.0.0
2026-04-06 22:25 UTC
Requires
- php: >=7.4
- ext-json: *
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.6
README
Official PHP SDK for the Yativo Crypto Platform. Accept and move USDC on Solana and USDC on XDC with a few lines of PHP.
Requirements
- PHP >= 7.4
- Composer
- Guzzle HTTP Client
Installation
composer require yativo/crypto-sdk
Quick Start
<?php require_once 'vendor/autoload.php'; use Yativo\YativoSDK; // Initialize SDK $yativo = new YativoSDK([ 'base_url' => 'https://crypto-api.yativo.com', ]); // --- Authentication (passwordless) --- // Step 1: Request OTP — sends a one-time code to the user's email $yativo->auth->login('user@example.com'); // Step 2: Verify OTP — returns access token (no password needed) $response = $yativo->auth->verifyOtp('123456', 'user@example.com'); // If the account has 2FA enabled, verify the authenticator code instead $response = $yativo->auth->verify2fa('654321', 'user@example.com'); // Alternatively, authenticate with API key + secret (server-to-server) $response = $yativo->auth->getToken('yat_your_api_key', 'your_api_secret'); // --- USDC on Solana --- $account = $yativo->accounts->create('My Account'); $accountId = $account['account']['account_id']; $solWallet = $yativo->assets->create($accountId, 'solana', 'USDC_SOL'); echo "Solana deposit address: " . $solWallet['asset']['wallet_address'] . "\n"; // Send USDC on Solana (~2-5 second finality) $yativo->transactions->send([ 'from_asset_id' => $solWallet['asset']['asset_id'], 'to_address' => 'RecipientSolanaAddressHere', 'amount' => '10.00', 'chain' => 'solana', 'ticker' => 'USDC_SOL', ]); // --- USDC on XDC --- $xdcWallet = $yativo->assets->create($accountId, 'xdc', 'USDC_XDC'); echo "XDC deposit address: " . $xdcWallet['asset']['wallet_address'] . "\n"; // Send USDC on XDC (~2 second finality, ultra-low fees) $transaction = $yativo->transactions->send([ 'from_asset_id' => $xdcWallet['asset']['asset_id'], 'to_address' => 'xdcRecipientAddressHere', 'amount' => '50.00', 'chain' => 'xdc', 'ticker' => 'USDC_XDC', ]); echo "Transaction hash: " . $transaction['transaction']['tx_hash'] . "\n";
Supported Assets
| Asset | Chain | Use case |
|---|---|---|
| USDC_SOL | Solana | Fast consumer payments, ~2–5 sec finality |
| USDC_XDC | XDC Network | Enterprise payments, ~2 sec finality, near-zero fees |
Features
- ✅ PSR-4 autoloading
- ✅ Passwordless auth — OTP, 2FA (TOTP), and API key
- ✅ USDC on Solana and XDC
- ✅ Comprehensive error handling
- ✅ Webhook verification
- ✅ Idempotent transactions
Documentation
See the Yativo API docs for the full API reference.