Chains
Gateway provides standardized access to multiple blockchain networks, enabling wallet management, transaction execution, and node RPC interactions. Each chain integration is customized to handle the specific requirements and features of that blockchain.
Supported Chains¶
Gateway currently supports two major blockchain architectures:
Base Chain | Architecture | Networks | Description |
---|---|---|---|
Ethereum | EVM | mainnet, arbitrum, optimism, base, sepolia, bsc, avalanche, celo, polygon | Ethereum and EVM-compatible chains |
Solana | SVM | mainnet-beta, devnet | Solana and SVM-compatible chains |
Ethereum¶
Gateway's Ethereum integration supports the Ethereum mainnet and all EVM-compatible Layer 1 and Layer 2 blockchains as networks. These networks share the same basic architecture, allowing for unified handling of wallets, transactions, and smart contract interactions.
Ethereum Mainnet¶
- Network ID: mainnet
- Chain ID: 1
- Native Token: ETH
Arbitrum¶
- Network ID: arbitrum
- Chain ID: 42161
- Native Token: ETH
Optimism¶
- Network ID: optimism
- Chain ID: 10
- Native Token: ETH
Base¶
- Network ID: base
- Chain ID: 8453
- Native Token: ETH
Polygon¶
- Network ID: polygon
- Chain ID: 137
- Native Token: MATIC
Binance Smart Chain (BSC)¶
- Network ID: bsc
- Chain ID: 56
- Native Token: BNB
Avalanche C-Chain¶
- Network ID: avalanche
- Chain ID: 43114
- Native Token: AVAX
Celo¶
- Network ID: celo
- Chain ID: 42220
- Native Token: CELO
Sepolia (Testnet)¶
- Network ID: sepolia
- Chain ID: 11155111
- Native Token: ETH
Chain Configuration¶
Each chain and network can be configured in Gateway through YAML configuration files:
- Template:
/src/templates/chains/ethereum.yml
- User Configs Location:
/conf/chains/ethereum.yml
Network Configuration¶
- Template:
/src/templates/chains/ethereum.yml
- User Configs :
/conf/chains/ethereum/mainnet.yml
API Endpoints¶
All EVM chains share the same API structure:
GET /chains/ethereum/status
- Chain connection and block statusGET /chains/ethereum/tokens
- Token informationPOST /chains/ethereum/balances
- Wallet balancesPOST /chains/ethereum/allowances
- Token allowancesPOST /chains/ethereum/approve
- Approve token spendingPOST /chains/ethereum/wrap
- Wrap native tokenPOST /chains/ethereum/unwrap
- Unwrap to native tokenPOST /chains/ethereum/poll
- Poll transaction statusPOST /chains/ethereum/estimate-gas
- Estimate transaction gas
Solana¶
Gateway's Solana integration provides access to the Solana blockchain and other networks that utilize the Solana Virtual Machine.
Mainnet Beta¶
- Network ID: mainnet-beta
- Native Token: SOL
Devnet (Testnet)¶
- Network ID: devnet
- Native Token: SOL
Chain Configuration¶
Each chain and network can be configured in Gateway through YAML configuration files:
- Template:
/src/templates/chains/solana.yml
- User Configs Location:
/conf/chains/solana.yml
Network Configuration¶
- Template:
/src/templates/chains/solana.yml
- User Configs:
/conf/chains/solana/mainnet-beta.yml
nodeURL: "https://api.mainnet-beta.solana.com"
commitment: "confirmed"
skipPreflight: false
preflightCommitment: "confirmed"
maxFee: 0.01
priorityFee: 0.00001
API Endpoints¶
All Solana networks share the same API structure:
GET /chains/solana/status
- Chain connection and slot statusGET /chains/solana/tokens
- SPL token informationPOST /chains/solana/balances
- Wallet SOL and token balancesPOST /chains/solana/poll
- Poll transaction statusPOST /chains/solana/estimate-gas
- Estimate transaction fees
Chain Schema¶
Gateway implements a standardized schema for chain operations across all supported blockchains. These schemas define the structure of requests and responses for common blockchain operations.
Status Check¶
Returns chain connection status and current block/slot information.
Request Schema:
Response Schema:
{
"chain": "string", // Chain name (e.g., "ethereum", "solana")
"network": "string", // Network identifier
"rpcUrl": "string", // Current RPC endpoint
"currentBlockNumber": 12345, // Current block number or slot
"nativeCurrency": "string" // Native token symbol (e.g., "ETH", "SOL")
}
Token Information¶
Retrieves token metadata including addresses and decimals.
Request Schema:
{
"network": "string (optional)", // Network identifier
"tokenSymbols": "string | string[] (optional)" // Single symbol or array of symbols/addresses
}
Response Schema:
{
"tokens": [
{
"symbol": "string", // Token symbol
"address": "string", // Token contract address
"decimals": 6, // Token decimals
"name": "string" // Token full name
}
]
}
Balance Query¶
Fetches wallet balances for native and specified tokens.
Request Schema:
{
"network": "string (optional)", // Network identifier
"address": "string (optional)", // Wallet address to query
"tokens": ["string"] (optional)", // Array of token symbols or addresses
"fetchAll": false // Fetch all tokens in wallet, not just those in token list
}
Response Schema:
Transaction Polling¶
Polls the status of a submitted transaction.
Request Schema:
{
"network": "string (optional)", // Network identifier
"signature": "string", // Transaction signature/hash
"tokens": ["string"] (optional)", // Token symbols/addresses for balance change calculation
"walletAddress": "string (optional)" // Wallet address for balance change calculation
}
Response Schema:
{
"currentBlock": 12345, // Current block number
"signature": "string", // Transaction signature
"txBlock": 12340 | null, // Block where transaction was included
"txStatus": 0 | 1 | -1, // 0=PENDING, 1=CONFIRMED, -1=FAILED
"fee": 0.001 | null, // Transaction fee paid
"tokenBalanceChanges": { // Optional: token balance changes
"TOKEN": 100.5 // Change amount for each token
},
"txData": {} | null, // Additional transaction data
"error": "string (optional)" // Error message if failed
}
Gas/Fee Estimation¶
Estimates transaction fees for the network.
Request Schema:
Response Schema:
{
"feePerComputeUnit": 0.000001, // Fee per compute unit or gas unit
"denomination": "string", // Unit denomination ("lamports" for Solana, "gwei" for Ethereum)
"computeUnits": 200000, // Default compute units/gas limit used for calculation
"feeAsset": "string", // Native currency symbol (ETH, SOL, etc.)
"fee": 0.002, // Total estimated fee using default limits
"timestamp": 1234567890 // Unix timestamp of estimate
}
Transaction Status Enum¶
All chains use a standardized transaction status enum:
0
= PENDING: Transaction submitted but not yet confirmed1
= CONFIRMED: Transaction successfully confirmed on-chain-1
= FAILED: Transaction failed or was rejected
Adding New Networks¶
Gateway's modular architecture makes it easy to add support for new EVM- and SVM-based blockchain networks.
-
Create network configuration file:
-
Add token list: Create
/conf/tokens/ethereum/mynetwork.json
with supported tokens -
Update connectors Update each supported connector's configuration file (i.e.
uniswap.config.ts
) to include the new network