Data-Structures
1. Chain List Data Structure
Describes supported blockchain networks.
interface Chain {
id: string; // Chain ID, e.g. '1' (Ethereum)
chainName: string; // Chain name, e.g. 'Ethereum Mainnet'
imageUrl: string
}
Example
{
"id": "1",
"chainName": "Ethereum Mainnet",
"imageUrl": ""
}
2. Token List Data Structure
Describes token information on the chain.
interface Token {
address: string; // Token contract address, e.g. '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
chain_id: string; // Chain ID, e.g. '1'
name: string; // Token name, e.g. 'USD Coin'
symbol: string; // Token symbol, e.g. 'USDC'
decimals: number; // Decimals, e.g. 6
image_url?: string; // Token icon URL (alternative field)
mark: string; // Remark
recommend: string; // Commonly used (0: common, 1: not common)
}
Example
{
"address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",// Address
"chain_id": "1",// Chain ID
"name": "USD Coin",// Token name
"symbol": "USDC",// Symbol
"decimals": 6,// Decimals
"image_url": "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png",// Image URL
"mark": "USDC",// Remark
"recommend": "0"// Commonly used (0: common, 1: not common)
}
3. Swap Quote Data Structure
Describes quote information for token swaps.
interface SwapQuote {
amountOutFormatted: string; // Formatted output amount
minAmountOutFormatted: string; // Formatted minimum output amount
totalCostFormatted: string; // Formatted total cost
gasEstimate: bigint; // Gas estimate
gasPrice: bigint; // Gas price
priceImpact?: string; // Price impact (optional)
route?: string[]; // Swap route (optional)
}
Example
{
"amountOutFormatted": "99.5",
"minAmountOutFormatted": "99.0",
"totalCostFormatted": "100.0",
"gasEstimate": "210000",
"gasPrice": "20000000000",
"priceImpact": "0.1%",
"route": ["USDC", "ETH"]
}
4. Gas Estimate Data Structure
Describes gas estimation information for smart contract calls.
interface GasEstimate {
gasLimit: string; // Gas limit
gasCostETH: string; // Estimated ETH cost
gasPrice: string; // Gas price
}
Example
{
"gasLimit": "210000",
"gasCostETH": "0.0042",
"gasPrice": "20000000000"
}
5. Cross-Chain Transaction Data Structure
Describes detailed information of cross-chain transactions.
interface Transaction {
message_id: string; // Transaction ID, e.g. '0xabc123'
source_tx_hash: string; // Source chain transaction hash, e.g. '0xdef456'
dest_tx_hash?: string; // Destination chain transaction hash (optional)
source_chain_name: string; // Source chain name, e.g. 'Ethereum'
dest_chain_name: string; // Destination chain name, e.g. 'Polygon'
from_address: string; // Sender address, e.g. '0x123...'
to_address: string; // Recipient address, e.g. '0x456...'
status: string; // Transaction status, e.g. 'pending', 'completed'
send_amount: string; // Sent amount, e.g. '1000000' (Wei/token units)
receive_amount?: string; // Received amount (optional)
source_token_symbol: string; // Source token symbol, e.g. 'USDC'
dest_token_symbol?: string; // Destination token symbol (optional)
source_token_decimals: number; // Source token decimals, e.g. 6
dest_token_decimals?: number; // Destination token decimals (optional)
ccip_fee: string; // CCIP fee, e.g. '1000000000000000'
bridge_fee: string; // Bridge fee, e.g. '500000000000000'
fee_decimals: number; // Fee token decimals, e.g. 18
fee_symbol: string; // Fee token symbol, e.g. 'ETH'
start_time: string; // Start time, e.g. '2025-04-01T12:00:00Z'
end_time?: string; // Completion time (optional)
}
Example
{
"message_id": "0xabc123",
"source_tx_hash": "0xdef456",
"dest_tx_hash": "0xghi789",
"source_chain_name": "Ethereum",
"dest_chain_name": "Polygon",
"from_address": "0x1234567890abcdef1234567890abcdef12345678",
"to_address": "0x4567890abcdef1234567890abcdef1234567890",
"status": "completed",
"send_amount": "1000000",
"receive_amount": "995000",
"source_token_symbol": "USDC",
"dest_token_symbol": "USDC",
"source_token_decimals": 6,
"dest_token_decimals": 6,
"ccip_fee": "1000000000000000",
"bridge_fee": "500000000000000",
"fee_decimals": 18,
"fee_symbol": "ETH",
"start_time": "2025-04-01T12:00:00Z",
"end_time": "2025-04-01T12:05:00Z"
}