Share your GetBlock experience with other devs and get 5M RPCs

banner image
one

Harmony

ONE

POST

GET

eth_accounts
eth_blockNumber
eth_call
eth_chainId
eth_estimateGas
eth_gasPrice
eth_getBalance
eth_getBlockByHash
eth_getBlockByNumber
eth_getBlockReceipts
eth_getBlockTransactionCountByHash
eth_getBlockTransactionCountByNumber
eth_getCode
eth_getFilterChanges
eth_getLogs
eth_getProof
eth_getStorageAt
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
eth_getTransactionByHash
eth_getTransactionCount
eth_getTransactionReceipt
eth_newBlockFilter
eth_newFilter
eth_newPendingTransactionFilter
eth_syncing
eth_uninstallFilter
hmy_accounts
hmy_blockNumber
hmy_call
hmy_chainId
hmy_estimateGas
hmy_gasPrice
hmy_getBalance
hmy_getBlockByHash
hmy_getBlockByNumber
hmy_getBlockReceipts
hmy_getBlockTransactionCountByHash
hmy_getBlockTransactionCountByNumber
hmy_getCode
hmy_getFilterChanges
hmy_getLogs
hmy_getProof
hmy_getStorageAt
hmy_getTransactionByBlockHashAndIndex
hmy_getTransactionByBlockNumberAndIndex
hmy_getTransactionByHash
hmy_getTransactionCount
hmy_getTransactionReceipt
hmy_newBlockFilter
hmy_newFilter
hmy_newPendingTransactionFilter
hmy_syncing
hmy_uninstallFilter
hmyv2_accounts
hmyv2_blockNumber
hmyv2_call
hmyv2_chainId
hmyv2_estimateGas
hmyv2_gasPrice
hmyv2_getBalance
hmyv2_getBlockByHash
hmyv2_getBlockByNumber
hmyv2_getBlockReceipts
hmyv2_getBlockTransactionCountByHash
hmyv2_getBlockTransactionCountByNumber
hmyv2_getCode
hmyv2_getProof
hmyv2_getStorageAt
hmyv2_getTransactionByBlockHashAndIndex
hmyv2_getTransactionByBlockNumberAndIndex
hmyv2_getTransactionByHash
hmyv2_getTransactionCount
hmyv2_getTransactionReceipt
hmyv2_syncing
net_peerCount
net_version
web3_clientVersion
chevron-right

Last updated on January 1, 1970

1 min read

Method hmyv2_estimateGas Harmony (ONE)
connect with JSON-RPC protocol

hmyv2_estimateGas

info-circle-fill

Returns an estimate of the gas required for a transaction to complete.The estimation process does not use gas and the transaction is not addedto the blockchain. The resulting estimate can be greater than the amountof gas the transaction ends up using, for reasons including EVMmechanics and node performance.The hmyv2_estimateGas call does not send a transaction. You must callhmyv2_sendRawTransaction to execute the transaction.If revert reason is enabled with --revert-reason-enabled, thehmyv2_estimateGas error response will include the revert reason.

Parameters

object - object

Transaction call object.

Request

curl --location --request POST 'https://one.getblock.io/mainnet/' 
--header 'x-api-key: YOUR-API-KEY' 
--header 'Content-Type: application/json' 
--data-raw '{"jsonrpc": "2.0",
"method": "hmyv2_estimateGas",
"params": [{"from": "0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73", "to": "0x44Aa93095D6749A706051658B970b941c72c1D53", "value": "0x1"}],
"id": "getblock.io"}'

Response

{
    "id": "getblock.io",
    "jsonrpc": "2.0",
    "result": "0x5208"
}
banner icon

Start Building with GetBlock RPCs for Free