🛡️TransitSwap Contracts

Query the Transit Swap Contracts of all chains

Query contracts of all chains including router & approve

Return all chains contracts

GET https://aggserver.transit.finance/v4/common/contracts

{
    "result": 0,
    "message": "success",
    "data": {
        "contracts": {
            "router": {
                "ETH": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "OP": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "BSC": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "OEC": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "HECO": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "MATIC": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "FTM": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "KCC": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "ARB": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "AVAX": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "CFX": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "GLMR": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "ETC": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "KLAY": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "TRON": "TKqQ7zuL7yKp1NWuhGpoXTDiE3j2qiAbRE"
            },
            "approve": {
                "ETH": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "OP": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "BSC": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "OEC": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "HECO": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "MATIC": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "FTM": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "KCC": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "ARB": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "AVAX": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "CFX": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "GLMR": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "ETC": "0xb45A2DDA996C32E93B8c47098E90Ed0E7ab18E39",
                "KLAY": "0x4517F5065C2f1c5508DD67dd1db95227cA87Abe8",
                "TRON": "TKqQ7zuL7yKp1NWuhGpoXTDiE3j2qiAbRE"
            }
        },
        "timestamp": 1667394094096,
        "hash":"0x70e430bca6ba4f60c6ac5fcf6a07942132f9d84b8b265fbb220285c53589b8c4",
        "signature": "0x991dbfd5226d65d209d9a934787e27e5b159619578b34e31a4122514b10e9358124b77ae2b266f0100bc1b91470ffe063ac4495fd243526495a2be1008c6633a1c"
    }
}

⚠️⚠️⚠️ Notice ⚠️⚠️⚠️

signer: 0x6eef5ad82cf83f9e60d2e96ee2029dc17c7b6612

signature data: Access TransitSwap for a trusted data: + hash

eg:

Access TransitSwap for a trusted data:0x9e30f587c47c65791cd58fe4d6f2e889a13d6d8f22623c65960fb625f95e13c2

Verifiable signature to ensure data is TransitSwap returned. Also can check if time is within range(eg: 30s).

sign utils 👉 https://www.npmjs.com/package/@metamask/eth-sig-util

hash utils 👉 https://www.npmjs.com/package/ethers

const sigUtils = require("@metamask/eth-sig-util")
const ethers = require("ethers")
const routers = [..data.contracts.Router]
const approves = [..data.contracts.Approve]
//if TRON,need convert base58 to hex
const hash = ethers.utils.solidityKeccak256(["address[]", "address[]", "uint256"], [routers, approves, timestamp])
const data = "Access TransitSwap for a trusted data:" + hash
const signer = sigUtils.recoverPersonalSignature({data:data,signature:signature})
if (signer == "0x6eef5ad82cf83f9e60d2e96ee2029dc17c7b6612") {
    //code
}

Last updated