[Only supports evm, cosmos] Get the estimated gasLimit based on the transaction information.
POST https://www.okx.com/api/v5/waas/transaction/get-estimate-gas
Parameter | Type | Required | Description |
---|---|---|---|
chainId | String | Yes | Unique identifier of the chain |
addrFrom | String | Yes | From address for fee estimation |
addrTo | String | Yes | To address for fee estimation |
txAmount | String | Yes | Amount for fee estimation |
extJson | Json Object | Yes | Extended parameters |
>inputdata | String | No | callData for making contract call |
Parameter | Type | Description |
---|---|---|
gasLimit | String | Estimated gas consumption |
curl --location --request POST 'https://www.okx.com/api/v5/waas/transaction/get-estimate-gas' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z' \
--data-raw '{
"addrFrom": "0x383c8208b4711256753b70729ba0cf0cda55efad",
"addrTo": "0x4ad041bbc6fa102394773c6d8f6d634320773af4",
"txAmount": "31600000000000000",
"chainId": "1",
"extJson": {
"inputData": "041bbc6fa102394773c6d8f6d634320773af4"
}
}'
{
"code": 0,
"msg": "success",
"data": [{
"gasLimit": "308781"
}]
}