NEAR Protocol RPC: Gas Price By Block (1.0.0)

Retrieve gas price information for a specific block

Languages
Servers
Mainnet
https://rpc.mainnet.fastnear.com/
Testnet
https://rpc.testnet.fastnear.com/

Get gas price by block

Request

Retrieves gas price information for a specific block

Bodyapplication/jsonrequired
jsonrpcstringrequired
Value"2.0"
idstringrequired
Example: "fastnear"
methodstringrequired
Value"gas_price"
paramsobjectrequired
params.​block_idinteger or stringrequired

Block height (integer) or block hash (string)

One of:

Block height (integer) or block hash (string)

integer

Block height (integer) or block hash (string)

curl -i -X POST \
  https://rpc.mainnet.fastnear.com/ \
  -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "id": "fastnear",
    "method": "gas_price",
    "params": {
      "block_id": "BnHU4MCqsNVgLRCiZteef85VYxCbNzwkWEo1cEG8Z6VX"
    }
  }'

Responses

Successful response

Bodyapplication/json
jsonrpcstringrequired
Value"2.0"
idstring or numberrequired
One of:
string
resultobject
errorobject
Response
application/json
{ "jsonrpc": "2.0", "id": "string", "result": { "gas_price": "string" }, "error": { "code": 0, "message": "string", "data": {} } }