Method Signature
Parameters
Source chain index identifier (e.g., “1” for Ethereum, “501” for Solana)
Destination chain index identifier
Source chain ID (e.g., “1” for Ethereum mainnet)
Destination chain ID
Contract address of the token to swap from
Contract address of the token to swap to
Amount to swap in the smallest unit (e.g., wei for ETH)
Maximum acceptable slippage as a decimal (e.g., “0.005” for 0.5%). Must be between 0.002 (0.2%) and 0.5 (50%)
Sort order for bridge options (e.g., “cost”, “time”)
Comma-separated list of DEX IDs to include in routing
Comma-separated list of bridge IDs to allow
Comma-separated list of bridge IDs to exclude
Maximum acceptable price impact percentage
Response
Response code (“0” indicates success)
Response message
Array of quote results
Routing information for the swap
Amount of source tokens to be swapped
Expected amount of destination tokens to receive
Estimated gas fee for the transaction
Expected price impact as a percentage
Trading fee amount
Code Example
Error Handling
The method validates slippage parameters and throws an error if slippage is outside the acceptable range:Validation Rules
- Slippage must be between 0.002 (0.2%) and 0.5 (50%)
- All required chain and token parameters must be provided
- Amount must be specified in the token’s smallest unit