Gas Price

Returns the gas prices for the specified chain

/v2/gas-price

How this endpoint is to be used :

  • Returns the gas prices for the specified chain in terms of price for slow, normal and fast transactions.

  • This endpoint can be used to estimate gas fees for the bridging transaction and display the estimated cost to the user

GET https://api.socket.tech/v2/gas-price

Returns the gas prices for the specified chain in terms of price for slow, normal and fast transactions.

Path Parameters

NameTypeDescription

chainId*

string

ID of chain, for example Ethereum Mainnet is 1

{
  "success": true,
  "result": {
    "chainId": 1,
    "txType": 0,
    "fast": {
      "gasPrice": 29000000000,
      "estimatedSeconds": 0
    },
    "normal": {
      "gasPrice": 24000000000,
      "estimatedSeconds": 0
    },
    "slow": {
      "gasPrice": 19000000000,
      "estimatedSeconds": 0
    }
  }
}

Description of response parameters

ParameterDescription

chainId

ID of chain, for example Ethereum is 1

txType

Returns 0 for legacy transaction type (Currently the API does not support EIP-1559 enabled transactions)

fast

Returns the gasPrice in wei and the estimatedSeconds in seconds for fast transaction

normal

Returns the gasPrice in wei and the estimatedSeconds in seconds for normal transaction

slow

Returns the gasPrice in wei and the estimatedSeconds in seconds for slow transaction

TEST QUERY :

https://api.socket.tech/v2/swagger/#/App/AppController_getGasPrice

Last updated