👾Transit Swap Cross

Transit cross-chain swap api

chains supported (fromChainID & toChainID):

  • Ethereum: 1

  • BSC: 56

  • OkExchain: 66

  • HECO: 128

  • Matic: 137

  • Fantom: 250

  • KCC: 321

  • AVAX: 43114

  • TRON: 95500

bridge supported:

  • ANYSWAP

  • METAPATH

  • CBRIDGE

Tokens API

Cross Tokens List

GET https://aggserver.transit.finance/v3/cross/common/list

{
    "result": 0,
    "message": "success",
    "data": {
        "bridgers": [
            "ISWAP",
            "METAPATH"
        ],
        "chains": {
            "ISWAP":[],
            "METAPATH":[]
        },
        "tokens":{
            "ISWAP":[],
            "METAPATH":[]
        }
    }
}

Swap API

Transit Swap API for Cross

GET https://aggserver.transit.finance/v3/cross/swap

Query Parameters

{
    "result": 0,
    "message": "success",
    "data": {
        "token0": "",
        "token1": "",
        "chainID": "",
        "destChainID": "",
        "amountIn": "",
        "to": "",
        "price": ,
        "fee": "",
        "relayerFee":"",
        "feeRate": "",
        "amountOut": "",
        "crossPool": "",
        "router": "",
        "exchange": "",
        "data": ""
    }
    
}

Responses Details

  • amountOut: cross-swap amountOut on toChain for token1

  • router: Transit swap Router v3

  • exchange: use bridge (anySwap or MetaPath)

  • data: ABI data can be sent directly to router contract

  • about 'relayerFee': if exchange is MetaPath, it'll be the number of token1

Cross Order Callback API

If use 'MetaPath' to cross swap, it's better to request this api to speed up transactions.

Order Callback

GET https://aggserver.transit.finance/v3/cross/order

Query Parameters

{
    "result": 0,
    "message": "success",
    "data": "" //order id
}

Last updated