多链支持
HashNut 支持 164+ 区块链网络,使商户能够通过统一的 API 接受整个 Web3 生态系统的支付。
支持的网络
EVM 兼容链 (150+)
热门 EVM 链:
- Ethereum (主网和测试网)
- Polygon (主网和 Mumbai)
- Binance Smart Chain (BSC)
- Arbitrum One
- Optimism
- Base
- Avalanche C-Chain
- Fantom
- 以及 140+ 更多...
TRON 网络
TRON 支持:
- TRON 主网
- TRON 测试网 (Shasta)
- TRC-20 代币 (USDT、USDC 等)
其他网络 (12+)
统一 API 接口
关键优势: 对所有链使用相同的 API - 无需链特定代码!
链代码
每个链由唯一的 chainCode 标识:
| 链类型 | chainCode 格式 | 示例 |
|---|---|---|
| EVM ERC-20 | erc20, {chain}-erc20 | erc20, polygon-erc20, bsc-erc20 |
| TRON TRC-20 | tron-trc20 | tron-trc20 |
常见链代码
// Ethereum
chainCode: "erc20"
// Polygon
chainCode: "polygon-erc20"
// Binance Smart Chain
chainCode: "bsc-erc20"
// TRON
chainCode: "tron-trc20"
链选择
查询支持的链
// Query all supported chains
const response = await fetch(
'https://testnet.hashnut.io/api/v2.0.0/config/queryAllChainInfo',
{ method: 'POST' }
);
const chains = await response.json();
// Returns array of all supported chains with details
响应包括:
- 链名称和代码
- 网络 ID (chainId)
- 确认要求
- WalletConnect 支持
- Bridge 服务器地址
查询支持的代币
// Query tokens for a specific chain
const response = await fetch(
'https://testnet.hashnut.io/api/v2.0.0/config/querySupportCoinsByChainCode',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ chainCode: 'erc20' })
}
);
const tokens = await response.json();
// Returns all supported tokens for that chain
多链支付流程
链特定功能
EVM 链
功能:
- ERC-20 代币支持
- WalletConnect 协议
- EIP-712 签名支持
- EIP-1559 费用支持
- MetaMask 集成
钱包支持:
- MetaMask
- WalletConnect
- imToken
- Trust Wallet
- Token Pocket
TRON 网络
功能:
- TRC-20 代币支持
- TronLink 集成
- 原生 TRX 支持
- TRON 特定优化
钱包支持:
- TronLink (扩展和移动端)
- TronLink Pro
网络配置
链特定设置
每个链都有可配置的设置: