Links
Comment on page

Cross-Chain API

Get Allowance
get
https://open-api.openocean.finance/v1/cross/
getAllowance
Get Allowance
Get MinSend
get
https://open-api.openocean.finance/cross_chain/v1/cross/
getMinSend
Get MinSend
Get Cross Status
get
https://open-api.openocean.finance/cross_chain/v1/cross/
getCrossStatus
Get Cross Status
Quote Route
get
https://open-api.openocean.finance/cross_chain/v1/cross/
quoteByOO
Quote Route

Swap

post
https://open-api.openocean.finance/cross_chain/v1/cross/:plat/swap
Cross Swap
  • Example:
request:
https://open-api.openocean.finance/cross_chain/v1/cross/stargate/swap
Request Body:
{
"account": "0x2132b141D19D7563e686Bb6f4764C7cE9097D514",
"route": {
"isApprovalRequired": true,
"allowanceTarget": "0x018fEADD83a8f2ad4d2508469a3a3215483C4377",
"middlewareRoute": [
{
"137": {
"middlewareId": 7,
"middlewareName": "OpenOcean",
"middlewareInfo": {
"displayName": "OpenOcean",
"icon": "https://ethapi.openocean.finance/logos/bsc/0x9029fdfae9a03135846381c7ce16595c3554e10a.png"
},
"fromAsset": {
"ids": "tether",
"name": "Tether USD",
"address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
"decimals": 6,
"symbol": "USDT",
"chain": "polygon",
"chainId": "137",
"icon": "https://s3.openocean.finance/images/1640831384587_011475796734160326.png"
},
"toAsset": {
"ids": "usd-coin",
"name": "USD Coin",
"address": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
"decimals": 6,
"symbol": "USDC",
"chain": "polygon",
"chainId": "137",
"icon": "https://ethapi.openocean.finance/logos/polygon/0x2791bca1f2de4661ed88a30c99a7a9449aa84174.png"
},
"inputAmount": "29670300",
"outputAmount": "29757056",
"value": 0
}
}
],
"bridgeRoute": {
"bridgeId": 23,
"messageBus": "0x4a364f8c717cAAD9A442737Eb7b8A55cc6cf18D8",
"tokenReceiver": "0x04954F93D189c9aFB6E09c47a55d9A124537aB08",
"bridgeInfo": {
"serviceTime": 600000,
"displayName": "Stargate Bridge",
"icon": "https://cloudstorage.openocean.finance/static/stargate.svg",
"code": "stargate"
},
"fromAsset": {
"ids": "tether",
"name": "Binance-Peg USD (T)",
"address": "0x55d398326f99059ff775485246999027b3197955",
"decimals": 18,
"symbol": "USDT",
"chain": "bsc",
"chainId": "56",
"icon": "https://ethapi.openocean.finance/logos/bsc/0x55d398326f99059ff775485246999027b3197955.png",
"cross": "0xedf0c420bc3b92b961c6ec411cc810ca81f5f21a"
},
"fromChainId": "56",
"toAsset": {
"ids": "tether",
"name": "Tether USD",
"address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
"decimals": 6,
"symbol": "USDT",
"chain": "polygon",
"chainId": "137",
"icon": "https://s3.openocean.finance/images/1640831384587_011475796734160326.png",
"cross": "0xedf0c420bc3b92b961c6ec411cc810ca81f5f21a"
},
"toChainId": "137",
"value": 0,
"inputAmount": "30000000000000000000",
"outputAmount": "29670300"
},
"fees": {
"gasLimit": [
{
"chainId": 137,
"address": "0x0000000000000000000000000000000000001010",
"icon": "https://s3.openocean.finance/images/1637561049975_1903381661429342.png",
"name": "Matic",
"symbol": "MATIC",
"decimals": 18,
"ids": "matic-network",
"assetAddress": "0x0000000000000000000000000000000000001010",
"amount": 465385,
"value": 0.05403689156807064
}
],
"middlewareFee": {
"chainId": 56,
"address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"name": "Binance Chain Native Token",
"symbol": "BNB",
"decimals": 18,
"icon": "https://ethapi.openocean.finance/logos/bsc/0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.png",
"ids": "binancecoin",
"assetAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"amount": 0
},
"bridgeFee": {
"ids": "tether",
"name": "Binance-Peg USD (T)",
"address": "0x55d398326f99059ff775485246999027b3197955",
"decimals": 18,
"symbol": "USDT",
"chain": "bsc",
"chainId": "56",
"icon": "https://ethapi.openocean.finance/logos/bsc/0x55d398326f99059ff775485246999027b3197955.png",
"amount": "329699999999999000",
"assetAddress": "0x55d398326f99059ff775485246999027b3197955"
}
},
"type": 1,
"src_poolId": 2,
"dst_poolId": 1,
"src_chainId": 102,
"dst_chainId": 109
}
}
response:
{
"code": 200,
"data": {
"from": "0x2132b141D19D7563e686Bb6f4764C7cE9097D514",
"to": "0x43c47B76D24Ad1F73f5Ab12442A016397A5ae9F6",
"data": "0xa44bbb150000000000000000...", // input data
"value": "3041816680838351"
}
}