Wallet API
Get Chain Gas Price

Get Chain Gas Price#

Dynamically obtain the estimated gas price for various chains, supporting EIP-1559, covering EVM and UTXO model networks.

Request Path#

GET https://www.okx.com/api/waas/wallet/pre-transaction/gas-price

Request Parameters#

ParameterTypeRequiredDescription
chainIndexStringYesUnique chain identifier

Response Parameters#

EVM#

ParameterTypeDescription
normalStringMedium gas price, in wei
minStringLow gas price, in wei
maxStringHigh gas price, in wei
supportEip1559BooleanWhether supports 1559
eip1559ProtocolObject1559 protocol structure
eip1559 Protocol
ParameterTypeDescription
eip1559ProtocolObject1559 protocol structure
>suggestBaseFeeStringSuggested base fee = base fee * 1.25, in wei
>baseFeeStringBase fee, in wei
>proposePriorityFeeStringMedium priority fee, in wei
>safePriorityFeeStringLow priority fee, in wei
>fastPriorityFeeStringHigh priority fee, in wei

BRC-20/UTXO#

ParameterTypeDescription
normalFeeRateStringMedium fee rate
maxFeeRateStringHigh fee rate
minFeeRateObjectLow fee rate
inscriptionOutputStringInscription output size
minOutputStringMinimum output size, in satoshi (typically 546 satoshi)
normalCostStringConsumption of a single inscription transaction, in satoshi
maxCostStringMaximum consumption of a single inscription transaction, in satoshi
minCostStringMinimum consumption of a single inscription transaction, in satoshi

Request Example#

shell
curl --location --request GET 'https://www.okx.com/api/v5/waas/wallet/pre-transaction/gas-price?chainIndex=1' \
--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'

Response Example#

200
// EVM
{
    "code": "0",
    "data": [
        {
            "normal" : "21289500000", // Medium gas price
            "min" : "15670000000",// Low gas price
            "max" : "29149000000", // High gas price            
            "supportEip1559" : true,// Whether supports 1559
            "erc1599Protocol": {
                "suggestBaseFee" : "15170000000",// Suggested base fee
                "baseFee" : "15170000000",// Base fee
                "proposePriorityFee" : "810000000",// Medium priority fee
                "safePriorityFee" : "500000000",// Low priority fee
                "fastPriorityFee" : "3360000000"// High priority fee
            }
       }     
    ],
    "msg": ""
}

// UTXO
{
    "code": "0",
    "data": [
        {
          "normalFeeRate": "27",
          "maxFeeRate": "35",
          "minFeeRate": "22",
          "inscriptionOutput": "546",
          "minOutput": "1500",
          "normalCost": "1800",
          "maxCost": "3600",
          "minCost": "600"
        }
    ],
    "msg": ""
}