Get Cross-chain Router
Endpoint: POST /api/oracle/router
Headers:
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | Yes | api-key |
Parameter | Type | Required | Description |
---|---|---|---|
sourceChain | string | Yes | Source chain ID |
sourceToken | string | Yes | Source token address |
destChain | string | Yes | Destination chain ID |
destToken | string | Yes | Destination token address |
amount | string | Yes | Amount (after decimals) |
to | string | Yes | Recipient wallet address |
Request Example:
{
"sourceChain": "42161",
"sourceToken": "0x0000000000000000000000000000000000000000",
"destChain": "1",
"destToken": "0x0000000000000000000000000000000000000000",
"amount": "100000000000000",
"to": "0x..."
}
Response:
Parameter Name | Type | Description |
---|---|---|
code | number | Status code |
data | object | Returned data |
msg | string | Return message |
destMaxAmount | string | Maximum exchangeable amount on destination |
destMinAmount | string | Minimum exchangeable amount on destination |
fee | string | Fee |
signData | object | Signature data |
`` amount | string | Exchange amount |
`` bridgeType | number | Bridge type (0:ccip, 1:cctp, 2:stargate) |
`` bridge | string | Bridge contract address |
`` chainName | string | Chain name |
`` params | string | Parameters (JSON string), structure below: |
params parameter structure:
Parameter Name | Type | Description |
---|---|---|
destChainId | string | Destination chain ID |
sourceToken | string | Source chain token address |
destToken | string | Destination chain token address |
amount | string | Exchange amount |
fee | string | Fee |
to | string | Wallet address |
sourceSwap | boolean | Whether to swap on source chain |
sourceSwapFee | string | Source chain swap fee |
sourceBridgeToken | string | Source chain bridge token address |
sourceMinAmount | string | Minimum swap amount on source chain |
destSwap | boolean | Whether to swap on destination chain |
destSwapFee | string | Destination chain swap fee |
destBridgeToken | string | Destination chain bridge token address |
destMinAmount | string | Minimum swap amount on destination chain |
{
"code": 0,
"data": {
"destMaxAmount": "100000000000000",
"destMinAmount": "100000000000000",
"fee": "2151673484790625",
"signData": {
"bridgeType": 0,
"amount": "100000000000000",
"bridge": "0x9f3c248a2C7abDeB379Da8536270B202c4B50D89",
"chainName": "Arbitrum One",
"params": "{\"destChainId\":\"5009297550715157269\",\"sourceToken\":\"0x0000000000000000000000000000000000000000\",\"destToken\":\"0x0000000000000000000000000000000000000000\",\"amount\":\"100000000000000\",\"fee\":\"2151673484790625\",\"to\":\"0x...\",\"sourceSwap\":false,\"sourceSwapFee\":\"0\",\"sourceBridgeToken\":\"0x82af49447d8a07e3bd95bd0d56f35241523fbab1\",\"sourceMinAmount\":\"100000000000000\",\"destSwap\":false,\"destSwapFee\":\"0\",\"destBridgeToken\":\"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\"destMinAmount\":\"100000000000000\"}"
}
},
"msg": "success"
}