Technical Documentation
  • Technical Documentation
  • Nodes
  • Wallet
    • Wallets
    • MetaMask
  • Smart Contract
    • Deploying Contracts
    • Using Remix
    • Using Hardhat
  • Cross-Chain Bridge
    • Cross-Chain Bridge
    • Calling APIs
  • Blockchain Data Query
    • Blockchain Data Query
    • Verify & Publish Contract Source Code
  • Oracle
    • Oracle
  • Grand Guard
    • Grand Guard
Powered by GitBook
On this page
  • getcrosslist
  • getcrosscontract
  • getpoolsize
  • getfee
  • getbridgeinfo
  • getcrossstatus
  1. Cross-Chain Bridge

Calling APIs

PreviousCross-Chain BridgeNextBlockchain Data Query

Last updated 2 years ago

Note : Before the assets are transferred across the chain, The Rangers Protocol team would need to review these assets. If the transferred assets are FT, the quantity approved in the contract address must be larger than or equal to the quantity of cross-chain FTs.

The cross-chain smart contract of Rangers Protocol can support cross-chain operations under . Additionally, any person or organization can invoke an interface to perform cross-chain operations as long as it meets the cross-chain specification:

getcrosslist

Get all cross-chain pairs

{"type": "erc20"} or {"type": "erc721"}
[{
    "Name": "RPG",
    "Nodes": [{
            "FromChain": "ETH",
            "FromContract": "0x0a98D1304c2DAD3c85EA06588996CeBB63Efb403",
            "ToChain": "BSC",
            "ToContract":
                "0x440dAcfd04e058c730C4B0fBc63BDDB0CA6e4F81"
        },
        {
            "FromChain": "ETH",
            "FromContract": "0x0a98D1304c2DAD3c85EA06588996CeBB63Efb403",
            "ToChain": "Rangers",
            "ToContract": "0x71d9CFd1b7AdB1E8eb4c193CE6FFbe19B4aeE0dB"
        },
        {
            "FromC
            hain": "BSC",
            "FromContract": "0x440dAcfd04e058c730C4B0fBc63BDDB0CA6e4F81",
            "ToChain": "ETH",
            "ToContract": "0x0a98D1304c2DAD3c85EA06588996CeBB63Efb403"
        },
        {
            "FromChain": "BSC",
            "FromContract":
                "0x440dAcfd04e058c730C4B0fBc63BDDB0CA6e4F81",
            "ToChain": "Rangers",
            "ToContract": "0x71d9CFd1b7AdB1E8eb4c193CE6FFbe19B4aeE0dB"
        },
        {
            "FromChain": "Rangers",
            "FromContract":
                "0x71d9CFd1b7AdB1E8eb4c193CE6FFbe19B4aeE0dB",
            "ToChain": "ETH",
            "ToContract": "0x0a98D1304c2DAD3c85EA06588996CeBB63Efb403"
        },
        {
            "FromChain": "Rangers",
            "FromContract": "0x71d9CFd1b7AdB1E8eb4c193CE6FFbe19B4aeE0dB",
            "ToChain": "BSC"
            ,
            "ToContract": "0x440dAcfd04e058c730C4B0fBc63BDDB0CA6e4F81"
        }
    ]
},
    {
        "Name": "MIX",
        "Nodes": [{
            "FromChain": "ETH",
            "FromContract": "0xa0087DE524CC951c80e2eb474C260C66Bba19ebE",
            "ToChain": "BSC",
            "ToContract": "0xB91c861Fb61
            f9bD8Da3eBAC25ed391e5da7Bb4Ad"
        },
            {
                "FromChain": "ETH",
                "FromContract": "0xa0087DE524CC951c80e2eb474C260C66Bba19ebE",
                "ToChain": "Rangers",
                "ToContract":
                    "0xB895607BEe24aA62ca090ce0445A1893e70ee5a0"
            },
            {
                "FromChain": "BSC",
                "FromContract": "0xB91c861Fb61f9bD8Da3eBAC25ed391e5da7Bb4Ad",
                "ToChain": "Rangers",
                "ToContract": "0xB895607BEe24aA62ca090ce0445A1893e70ee5a0"
            },
            {
                "FromC
                hain": "BSC",
                "FromContract": "0xB91c861Fb61f9bD8Da3eBAC25ed391e5da7Bb4Ad",
                "ToChain": "ETH",
                "ToContract": "0xa0087DE524CC951c80e2eb474C260C66Bba19ebE"
            },
            {
                "FromChain": "Rangers",
                "FromContract":
                    "0xB895607BEe24aA62ca090ce0445A1893e70ee5a0",
                "ToChain": "ETH",
                "ToContract": "0xa0087DE524CC951c80e2eb474C260C66Bba19ebE"
            },
            {
                "FromChain": "Rangers",
                "FromContract": "0xB895607BEe24aA62ca090ce0445A1893e70ee5a0",
                "ToChain": "BSC"
                ,
                "ToContract": "0xB91c861Fb61f9bD8Da3eBAC25ed391e5da7Bb4Ad"
            }
        ]
    },
    {
        "Name": "USDT",
        "Nodes": [{
            "FromChain": "BSC",
            "FromContract": "0xef59010466e924E23ac7a76296fF3b8Ba2FaF0d3",
            "ToChain": "Rangers",
            "ToContract": "0x0F3A62dB02F743b549053cc8d538C65aB01E3618"
        },
            {
                "FromChain": "Rangers",
                "FromContract": "0x0F3A62dB02F743b549053cc8d538C65aB01E3618",
                "ToChain": "BSC",
                "ToContract": "0xef59010466e924E23ac7a76296fF3b8Ba2FaF0d3"
            }
        ]
    },
    {
        "Name": "ETH",
        "Nodes": [{
            "FromChain": "BSC",
            "FromContract": "0xc2B8d0a60D2158fa09869571B52C8C96cE1F8537",
            "ToChain": "Rangers",
            "ToContract":
                "0x049891B7e5a1E886aBe5cA71a40A79fBBd2dcC87"
        },
            {
                "FromChain": "Rangers",
                "FromContract": "0x049891B7e5a1E886aBe5cA71a40A79fBBd2dcC87",
                "ToChain": "BSC",
                "ToContract":
                    "0xc2B8d0a60D2158fa09869571B52C8C96cE1F8537"
            }
        ]
    }
]

getcrosscontract

Get the cross-chain contract address

/


{
    "BSC": "0x861C24230140194F43Df1c2a164F1C4071487FBA",
    "ETH": "0xc7f7BD8E994feD967ED995Ae27D1b45c93c31a80",
    "Rangers": "0x9c1CbFE5328DFB1733d59a7652D0A49228c7E12C"
}

getpoolsize

Get cross-chain pool size

{
    "Chain": "ETH",
    "FromContract":"0x0a98D1304c2DAD3c85EA06588996CeBB63Efb403",
    "ToChain": "BSC",
    "ToContract":"0x440dAcfd04e058c730C4B0fBc63BDDB0CA6e4F81"
}
{
    "Chain": "ETH",
    "FromContract":
    "0x0a98D1304c2DAD3c85EA06588996CeBB63Efb403",
        "ToChain": "BSC",
    "ToContract": "0x440dAcfd04e058c730C4B0fBc63BDDB0CA6e4F81",
    "PoolSize": "1008073432698151994932744",
    "Decimal": "18"
}

getfee

Get the cross-chain gas fee, and then when initiating a cross-chain transaction, the amount of coins to be traded needs to be filled in.

{
    "Chain":"Rangers",
    "FromContract":"0x71d9CFd1b7AdB1E8eb4c193CE6FFbe19B4aeE0dB",
    "ToChain":"BSC",
    "ToContract":"0xc2098a8938119A52B1F7661893c0153A6CB116d5"
}
{
    "FromContract": "0x71d9CFd1b7AdB1E8eb4c193CE6FFbe19B4aeE0dB",
    "ToContract": "0xc2098a8938119A52B1F7661893c0153A6CB116d5",
    "Fee": "93160766660714182",
    "Decimal": "18"
}

getbridgeinfo

Get cross-chain record

{
    "Chain":"RPG",
    "Type":"erc20",
    "Addr":"0xf44ce46191380afb962460d3db9417d7d70e0dd6"
}
[{
    "F_Chain": "Rangers",
    "F_Contract": "0x71d9CFd1b7AdB1E8eb4c193CE6FFbe19B4aeE0dB",
    "F_From": "0xF44Ce46191380AFB962460D3db9417d7d70E0Dd6",
    "F_To": "0xF44Ce46191380AFB96
    2460D3db9417d7d70E0Dd6",
    "F_AmountOrNftid": "1035000000000000000000",
    "F_Hash":
        "0x4d3603c2ee7cdacf883b477f0c2c26e1d8dd965d3768711cdc686125569f9e76",
    "URI": "",
    "T_Chain": "BSC",
    "T_Contract":
        "0xc2098a8938119A52B1F7661893c0153A6CB116d5",
    "T_Status": "success",
    "T_Hash":
        "0x01c21034a7c8d4a98ec98f446656c9e646868ef7fd5d6d55d7d91bac8cbbf2cb",
    "Tm": "1640678800",
    "Dec": "18",
    "Fee": "0.022350586154170202",
    "TokenName": "RPG"
}]

getcrossstatus

Get cross-chain status

{
    "Hash":"0x7993c254a4fcbc3c7823cbb97e0fdea319c9ff0793d9661894942f84a66f1457"
}
{
    "Hash": "0x7993c254a4fcbc3c7823cbb97e0fdea319c9ff0793d9661894942f84a66f1457",
    "THash": "0xd2422805686cc9da4815e98128a162951923e329765a8d634e65c2999fa74c82",
    "Status": "success"
}

Rangers Bridge