Dynamically get the gas price to reduce errors and increase the success rate of on-chain transactions. Supports 1559 protocol.
GET https://www.okx.com/api/v5/waas/transaction/get-gas-price
Parameter | Type | Required | Description |
---|---|---|---|
chainId | String | Yes | Unique identifier of the chain |
Parameter | Type | Description |
---|---|---|
normal | String | Medium gasPrice |
min | String | Low gasPrice |
max | String | High gasPrice |
supportEip1559 | Boolean | Whether to support 1559 |
erc1559Protocol | Object | 1559 protocol |
erc1559Protocol
Parameter | Type | Description |
---|---|---|
erc1559Protocol | Object | 1559 protocol |
suggestBaseFee | String | Suggested base fee |
baseFee | String | Base fee |
proposePriorityFee | String | Medium tip |
safePriorityFee | String | Low tip |
fastPriorityFee | String | High tip |
curl --location --request GET 'https://www.okx.com/api/v5/waas/transaction/get-gas-price?chainId=1' \
--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'
{
"code": 0,
"msg": "success",
"data": [{
"normal": "24956500000",
"min": "18490000000",
"max": "33683000000",
"supportEip1559": true,
"erc1599Protocol": {
"suggestBaseFee": "17990000000",
"proposePriorityFee": "670000000",
"safePriorityFee": "500000000",
"fastPriorityFee": "3100000000",
"baseFee": "17990000000"
}
}]
}