yativo/crypto-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yativo/crypto-sdk

最新稳定版本:1.0.0

Composer 安装命令:

composer require yativo/crypto-sdk

包简介

Official Yativo Crypto SDK for PHP

README 文档

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.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-04-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固