👾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

Name
Type
Description

toChainID*

integer

chainID for cross to chain

decimal0

integer

Decimals of the token0

token0*

string

Contract address of a token on fromChain

fromChainID*

integer

chainID for cross from chain

to

string

Recipient token1 on toChain

amountIn

integer

Amount of a token to cross swap

bridge*

string

Use bridge of cross

token1*

string

Contract address of a token on toChain

decimal1

integer

Decimals of the token1

channel

string

"default"、"web"、"android"、"ios"、"extension"

issuer

string

Sender of transaction push

{
    "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

Name
Type
Description

bridge*

String

fromChainID*

String

toChainID*

String

token0*

String

token1*

String

to*

String

amountIn*

String

channel*

String

hash*

String

the hash of from chain's transaction

amountOutMin*

String

use the result data 'amountOut' of swap api

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

Last updated