Best Practice
Transferring token example
Last updated
Transferring token example
Last updated
You can call the get Token List API to get all the available tokens we have on the blockchain you choose.
Method: Get
Parameters:
Your request will look like this:
And your response will look like this:
Then you pick up the token you choose in the specific chain which is included. You need to save the token information you need for further operations
You can obtain quotes from different platforms.
Method: Get
Parameters:
Your request will be like this
And your response will look like this:
You can obtain the on-chain transaction data from a specified platform.
Method: Get
Parameters:
For example, you want to use openocean to obtain the on-chain transaction data;
response:
If you call it right, you will get a result like this:
Here is a case for you to make a transaction on BNB Chain.
parameter
type
example
description
chain
string
bsc
eth, bsc, polygon, avax, arbitrum, fantom, xdai, moonriver, aurora, cronos, harmony, solana, sifchain, osmosis, optimism, ont, tron, okex, zksync, linea, scroll
parameter
type
example
description
chain
string
bsc
eth, bsc, polygon, avax, arbitrum, fantom, xdai, moonriver, aurora, cronos, harmony, solana, sifchain, osmosis, optimism, ont, tron, okex, zksync, linea, scroll
inTokenAddress
string
0x783C08b5F26E3daf8C4681F3bf49844e425b6393
token address
outTokenAddress
string
0xD81D45E7635400dDD9c028839e9a9eF479006B28
out token address
amount
string
5
token amount(without decimals)
gasPrice
string
1
without decimals
parameter
type
example
description
chain
string
bsc
eth, bsc, polygon, avax, arbitrum, fantom, xdai, moonriver, aurora, cronos, harmony, solana, sifchain, osmosis, optimism, ont, tron, okex, zksync, linea, scroll
dex
string
openOcean
openOcean, 1inch, paraSwap, matcha, jupiter, 1sol
inTokenAddress
string
0x783C08b5F26E3daf8C4681F3bf49844e425b6393
token address
outTokenAddress
string
0xD81D45E7635400dDD9c028839e9a9eF479006B28
out token address
amount
string
5
token amount(without decimals)
gasPrice
string
5
without decimals
slippage
number
1
1 equals 1%, 1%-100%
account
string
user's address
disableEstimate
boolean
true
true/false(check balance and allowance)
referrer
string?
0x0000000000000000000000000000000000000000
Please contact us for a unique referrer parameter