动态获取 Gas 价格,支持 1559 协议,当前仅支持 EVM 系网络,其他网络陆续支持中。
GET https://www.okx.com/api/v5/waas/transaction/get-gas-price
Parameter | Type | Required | Description |
---|---|---|---|
chainId | String | Yes | 链唯一标识 |
Parameter | Type | Description |
---|---|---|
normal | String | 中档 gas 价格 |
min | String | 低档 gas 价格 |
max | String | 高档 gas 价格 |
supportEip1559 | Boolean | 是否支持 1559 |
erc1559Protocol | Object | 1559 协议 |
erc1559Protocol
Parameter | Type | Description |
---|---|---|
erc1559Protocol | Object | 1559 协议 |
suggestBaseFee | String | 建议基础费用 |
baseFee | String | 基础费用 |
proposePriorityFee | String | 中档小费 |
safePriorityFee | String | 低档小费 |
fastPriorityFee | String | 高档小费 |
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"
}
}]
}