To obtain a more accurate gas limit, we suggest calling the ââest_gasââ function from a reliable RPC before submitting the transaction on chain.
Also, try to call 'eth.estamiteGas()' before sendTransaction and renew the estimatedGas to ensure the transaction can be done successfully.
Note that, 'estimatedGas' is only a reference provided, please adjust by your need.
The'estimatedGas'in the returned response is only a reference. When sending transactions on-chain, use eth_estimateGas * 1.25 -1.5 as needed. If the âestmateGasâ fails, we don't recommend submitting the tx on-chain.
We also recommend updating the 'gasprice' parameter to avoid future failures due to the fluctuations of the on-chain gas price.
{
code: 200,
data: [
{
"symbol": "QUICK", // token symbol
"allowance": "79228162514.26434", // without decimals
"raw": "79228162514264340000000000000" // with decimals
}
]
}
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
chain*
string
Please refer to "supported chains" for the corresponding chain codes/chain ID
inTokenAddress*
string
in token address
outTokenAddress*
string
out token address
amount*
string
Please set token amount without decimals.
e.g.
1.00 ETH set as 1
1.23 USDC set as 1.23
gasPrice*
string
Please set the gas price in GWEI without decimals
e.g. 14 GWEI set as 14
slippage
string
Define the acceptable slippage level by inputting a percentage value within the range of 0.05 to 50.
e.g. 1% slippage set as 1
default value 1
disabledDexIds
string
Enter the 'index' number of dexs through dexList endpoint to disable single or multiple dexs separated by commas, e.g. disabledDexIds: "2,6,9".
enabledDexIds
string
Enter the 'index' number of dexs through dexList.
P.S. enableDexIds has higher priority compared with disabledDexIds
chain*
string
Please refer to "supported chains" for the corresponding chain codes/chain ID
inTokenAddress*
string
in token address
outTokenAddress*
string
out token address
disabledDexIds
string?
ID of dexes could be access through dexList endpoint
slippage*
number
Define the acceptable slippage level by inputting a percentage value within the range of 0.05 to 50.
e.g. 1% slippage set as 1
gasPrice*
string
Please set the gas price in GWEI without decimals
e.g. 14 GWEI set as 14
amount*
string
Please set token amount without decimals.
e.g.
1.00 ETH set as 1
1.23 USDC set as 1.23
account*
string
seller's address, please ensure that it has been approved to spend the necessary amount of inTokenAddress
referrer
string?
The wallet address used to be mark as partners and receive an extra referrerFee from user.
referrerFee
number?
Specify the percentage of in-token you wish to receive from the transaction, within the range of 0% to 3%, with 1% represented as '1', in the range of 0.01 to 3.
e.g. 1.2% fee set as 1.2
By default, OpenOcean shares 15% of the fee. Please contact us if you wish to modify this rate."
enabledDexIds
string
Enter the 'index' number of dexs through dexList endpoint to enable the dexs to access.
P.S. enableDexIds has higher priority compare with disabledDexIds
sender
string
The caller address.
Token Delivery Logic
If a sender address is specified, the sender address will be set as sender(caller), and account address will be set as receiver.
If no sender address is specified, the account address will automatically be set as the sender(caller) and receiver.
chain*
string
Please refer to "supported chains" for the corresponding chain codes/chain ID
hash*
string
transaction hash
chain*
string
Please refer to "supported chains" for the corresponding chain codes/chain ID
chain*
string
Please refer to "supported chains" for the corresponding chain codes/chain ID
chain*
string
Please refer to "supported chains" for the corresponding chain codes/chain ID
account*
string
user's wallet address
pageSize*
number
The amount of tx hash you wish to receive
inTokenAddress*
string
Please enter the token addresses, separating each address with a comma. You may enter up to five tokens.
account*
string
user's wallet address
chain*
string
Please refer to "supported chains" for the corresponding chain codes/chain ID
chain*
string
Please refer to "supported chains" for the corresponding chain codes/chain ID
chain*
string
Please refer to "supported chains" for the corresponding chain codes/chain ID
chain*
string
Please refer to "supported chains" for the corresponding chain codes/chain ID