Cross chain route
Generate data for calling the swap router for cross chain exchange:
baseUrl/{chainId}/swap/calculateCrossTrade
Parameters
Name | Description |
---|---|
fromTokenAddress * string(query) | 0xc2132D05D31c914a87C6611C10748AEb04B58e8F |
toTokenAddress * string (query) | 0x524bC91Dc82d6b90EF29F76A3ECAaBAffFD490Bc |
amount * string (query) | 20000000 |
fromAddress * string (query) | The address that calls the swap contract |
receiverAddress * string (query) | The address that receive the toToken |
toChainId * int (query) | The chainId to cross chain |
feeType * string (query) | pay fees with: stableToken: 0; fromToken: 1 |
slippageTolerance * string (query) | slippageTolerance min: 0; max: 1; |
example:
{
"errno": 0,
"message": "success",
"data": {
"bridger": "BUTTER",
"from": {
"blackchain": "ETH",
"address": "0x0000000000000000000000000000000000000000",
"name": "ETH",
"symbol": "ETH",
"decimals": 18,
"_weiAmount": "2000000000000000000"
},
"to": {
"blackchain": "MATIC",
"address": "0x0000000000000000000000000000000000000000",
"name": "MATIC",
"symbol": "MATIC",
"decimals": 18,
"_weiAmount": "5866263749699626032100"
},
"protocolFee": "14000000000000000",
"toTokenAmount": "5866263749699626032100",
"timeEstimated": 260,
"tx": {
"to": "0x47BE4C04c91d4897F8F27D32C7D79357B0939a91",
"data": "0xecc847d3333038363764646162343130656433666564633832383939343637626537313800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001bf3841691d9a6cd000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000009a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000880000000000000000000000000000000000000000000000000000000000000002000000000000000000000000063212c5f70d1b374a023950a96be3506779cae2400000000000000000000000063212c5f70d1b374a023950a96be3506779cae240000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000644a66b76e740d98f0d23c3ae942163bb43078c100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000764480a341100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000740000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000644a66b76e740d98f0d23c3ae942163bb43078c1000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000004d0e30db000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000089000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000014644a66b76e740d98f0d23c3ae942163bb43078c100000000000000000000000000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000042000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035d0679243fd8addd4f34d14443981f74e826f1a00000000000000000000000035d0679243fd8addd4f34d14443981f74e826f1a000000000000000000000000644a66b76e740d98f0d23c3ae942163bb43078c1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013ad4a7e98f1142721800000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000284efa0646500000000000000000000000000000000000000000000000000000000000000200000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f61900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000644a66b76e740d98f0d23c3ae942163bb43078c100000000000000000000000000000000000000000000013ad4a7e98f1142721800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc4500000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc450000000000000000000000000000000000000000000000001bbfa6a7fc64c00000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000013ad4a7e98f114272180000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002b7ceb23fd6bc0add59e62ac25578270cff1b9f6190001f40d500b1d8e8ef31e21c99d1db9a6444d3adf12700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"value": "2014098690835850957",
"chainId": "1",
"gas": "37800",
"gasPrice": "12309675006"
},
"slippageTolerance": 0.01,
"moreTrades": [
{
"from": {
"blockchain": "ETH",
"address": "0x0000000000000000000000000000000000000000",
"name": "Ethereum",
"symbol": "ETH",
"decimals": 18,
"chainId": 1,
"_weiAmount": "2000000000000000000"
},
"to": {
"blockchain": "POLYGON",
"address": "0x0000000000000000000000000000000000000000",
"name": "Matic Network",
"symbol": "MATIC",
"decimals": 18,
"chainId": 137,
"_weiAmount": "5865539595308702000000"
},
"type": "xy",
"bridger": "xy",
"steps": [],
"amountOut": "5806.88419935561498",
"time": 4282,
"tx": {
"to": "0x47BE4C04c91d4897F8F27D32C7D79357B0939a91",
"data": "0xecc847d3323739633466666236353166616331383832616238306265303230633232326100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001bf3841691d9a6cd000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000200000000000000000000000004315f344a905dc21a08189a117efd6e1fca37d570000000000000000000000004315f344a905dc21a08189a117efd6e1fca37d570000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000644a66b76e740d98f0d23c3ae942163bb43078c100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001c42aac3cac0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000644a66b76e740d98f0d23c3ae942163bb43078c10000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000089000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000013df8b6c0f8fba3c3fa00000000000000000000000000000000000000000000000000000000000000640000000000000000000000004a53841b9b16182f996a65aab407e7622cbcf96600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"value": "2014098690835850957",
"gas": "37800",
"gasPrice": "12309675006"
},
"toTokenAmount": "5865539595308702000000",
"routeFee": "0",
"routeFeeSymbol": "ETH",
"slippageTolerance": 0.01,
"protocolFee": "14000000000000000",
"timeEstimated": 400
},
{
"from": {
"blockchain": "ETH",
"address": "0x0000000000000000000000000000000000000000",
"name": "Ethereum",
"symbol": "ETH",
"decimals": 18,
"chainId": 1,
"_weiAmount": "2000000000000000000"
},
"to": {
"blockchain": "POLYGON",
"address": "0x0000000000000000000000000000000000000000",
"name": "Matic Network",
"symbol": "MATIC",
"decimals": 18,
"chainId": 137,
"_weiAmount": "5863454904689543028027"
},
"type": "squidrouter",
"bridger": "squidrouter",
"steps": [],
"amountOut": "5804.82035564264759774673",
"time": 4044,
"tx": {
"to": "0x47BE4C04c91d4897F8F27D32C7D79357B0939a91",
"value": "2014098690835850957",
"data": "0xecc847d3636261663162643261313762623164393235613566313535313236306666333400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001bf3ffdbe21c360f000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000001260000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000ce16f69375520ab01377ce7b88f5ba8c48f8d666000000000000000000000000ce16f69375520ab01377ce7b88f5ba8c48f8d6660000000000000000000000000000000000000000000000001bc1e84ed2f59d1a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000644a66b76e740d98f0d23c3ae942163bb43078c100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000001024846a1bc6000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000000000420000000000000000000000000644a66b76e740d98f0d23c3ae942163bb43078c1000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc45000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000e404e45aaf000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000ce16f69375520ab01377ce7b88f5ba8c48f8d6660000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000000000000000c1a1f5b90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000455534443000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007506f6c79676f6e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a307863653136463639333735353230616230313337376365374238386635424138433438463844363636000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000be00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000644a66b76e740d98f0d23c3ae942163bb43078c1000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000005a0000000000000000000000000000000000000000000000000000000000000072000000000000000000000000000000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000aa000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000750e4c4984a9e0f12978ea6742bc1c5d248f40ed0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000750e4c4984a9e0f12978ea6742bc1c5d248f40ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000f9c2b5746c946ef883ab2660bbbb1f10a5bdeab40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000750e4c4984a9e0f12978ea6742bc1c5d248f40ed00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f9c2b5746c946ef883ab2660bbbb1f10a5bdeab4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000104a8c9ed67000000000000000000000000750e4c4984a9e0f12978ea6742bc1c5d248f40ed0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa8417400000000000000000000000000000000000000000000000000000000000000080000000000000000000000004fd39c9e151e50580779bd04b1f7ecc310079fd30000000000000000000000000000000000000000000000000000018a69fc2a4000000000000000000000000000000000000000000000000000000000c269d6ec00000000000000000000000000000000000000000000000000000000c13cbc2d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000750e4c4984a9e0f12978ea6742bc1c5d248f40ed000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000010000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000f5b509bb0909a69b1c207e495f687a596c168e1200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa8417400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f5b509bb0909a69b1c207e495f687a596c168e12000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000e4bc6511880000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa841740000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf12700000000000000000000000004fd39c9e151e50580779bd04b1f7ecc310079fd30000000000000000000000000000000000000000000000000000018a69fc2a4100000000000000000000000000000000000000000000000000000000c26824ec00000000000000000000000000000000000000000000013aae10ae335caf52b300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000242e1a7d4d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf127000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000644a66b76e740d98f0d23c3ae942163bb43078c1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gas": "37800",
"gasPrice": "12309675006"
},
"toTokenAmount": "5863454904689543028027",
"routeFee": "135134773615898",
"routeFeeSymbol": "ETH",
"slippageTolerance": 0.01,
"protocolFee": "14000000000000000",
"timeEstimated": 240
}
]
}
}