Skip to main content

eth_gasPrice

In this section, we will build a data stream that returns the gas fee of the latest transaction in WEI. Unlike any JSON RPC method like eht_gasPrice that returns the hexadecimal equivalent of an integer representing the current gas price in WEI, this returns the integer value itself.

This is the stream that returns the current gas price in WEI.


subscription {
EVM {
Transactions {
Transaction {
Gas
}
ChainId
}
}
}

The above stream returns the following response.


{
"EVM": {
"Transactions": [
{
"ChainId": "1",
"Transaction": {
"Gas": "100000"
}
},
]
}
}