getRoutes
function to fetch routes/quotes from the Keygate API. Here is a simple example of how to request routes to bridge 10 USDC on Optimism to the maximum amount of ckUSDC on Internet Computer Protocol
Routes request parameters
Below are the parameters for thegetRoutes
function along with their descriptions:
fromChainId number
required
The ID of the source chain.
Chain Name | Chain ID |
---|---|
Ethereum | 1 |
Arbitrum | 42161 |
Internet Computer Protocol | 121171651099711 |
Base | 8453 |
string
required
The contract address of the token on the source chain. Ensure this address corresponds to the specified fromChainId.
fromAmount string
required
The amount to be transferred from the source chain, specified in the smallest unit of the token (e.g., wei for ETH).
fromAddress string
optional
The address from which the tokens are being transferred.
toChainId number
required
The ID of the destination chain.
Chain Name | Chain ID |
---|---|
Ethereum | 1 |
Arbitrum | 42161 |
Internet Computer Protocol | 121171651099711 |
Base | 8453 |
string
required
The contract address of the token on the destination chain. Ensure this address corresponds to the specified toChainId.