LogoLogo
  • Introduction
  • Radius testnet access
  • Quickstart
    • Command line
    • Go
    • JavaScript
    • Postman
    • Python
    • Rust
    • TypeScript
  • How to
    • Create a Private Key
    • Get testnet ETH tokens
    • Deploy a smart contract
  • Concepts
    • Ethereum transaction types
  • Tutorials
  • Radius SDKs
  • API Reference
    • eth_blockNumber
    • eth_call
    • eth_chainId
    • eth_createAccessList
    • eth_estimateGas
    • eth_feeHistory
    • eth_gasPrice
    • eth_getBalance
    • eth_getBlock
    • eth_getBlockByHash
    • eth_getBlockByNumber
    • eth_getBlockTransactionCountByHash
    • eth_getBlockTransactionCountByNumber
    • eth_getCode
    • eth_getLogs
    • eth_getStorageAt
    • eth_getTransactionByBlockHashAndIndex
    • eth_getTransactionByBlockNumberAndIndex
    • eth_getTransactionByHash
    • eth_getTransactionCount
    • eth_getTransactionReceipt
    • eth_sendRawTransaction
    • eth_sendTransaction
    • net_version
    • web3_clientVersion
    • web3_sha3
    • web3_getTransactionCount
  • Release Notes
  • Whitepaper
  • Radius Discord
Powered by GitBook
On this page
  • Parameters
  • Returns
  • Example

Was this helpful?

Edit on GitHub
  1. API Reference

eth_estimateGas

Previouseth_createAccessListNexteth_feeHistory

Last updated 1 month ago

Was this helpful?

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be processed in Radius.

NOTE

The gas estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and system performance.

Parameters

  • from: 20 bytes - Address the transaction is sent from.

  • to: 20 bytes - Address the transaction is directed to.

  • gas: Hexadecimal value of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.

  • gasPrice: Hexadecimal value of the gasPrice used for each paid gas.

  • maxPriorityFeePerGas: Maximum fee (in wei) the sender is willing to pay per gas above the base fee. See .

  • maxFeePerGas: Maximum total fee (base fee + priority fee, in wei), the sender is willing to pay per gas. See .

  • value: Hexadecimal of the value sent with this transaction.

  • data: Hash of the method signature and encoded parameters. See .

  • block parameter: A string representing a block number, block hash, or one of the string tags latest, earliest, pending, safe, or finalized. See the .

Returns

A hexadecimal of the estimate of the gas for the given transaction.

Example

Request

curl https://rpc.testnet.tryradi.us/<YOUR-RPC-ENDPOINT> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '
{
  "jsonrpc": "2.0",
  "method": "eth_estimateGas",
  "params": [
    {
      "type": "0x1",
      "chainId": "0x12ad11",
      "nonce": "0x0",
      "to": "0xcae4d474a43b186606bb836f463d4b4072b7fbe3",
      "gas": "0x493e0",
      "gasPrice": "0x0",
      "maxPriorityFeePerGas": null,
      "maxFeePerGas": null,
      "value": "0x0",
      "input": "0x60fe47b1000000000000000000000000000000000000000000000000000000000000002a",
      "v": "0x255a45",
      "r": "0xd7f188ccfd0223e68c6b300a63c43269beff1ff7d6c9aa257f77e943d7640f4",
      "s": "0x24fe69e4849797afb156c3fc11ac273d03c04846e6128fc2c412646326f02b95"
    }
  ],
  "id": 1
}
'

Response

{"jsonrpc":"2.0","id":1,"result":"0x5406"}

Request

cast estimate \
  0xcae4d474a43b186606bb836f463d4b4072b7fbe3 \
  "set(uint256)" \
  42 \
  --rpc-url https://rpc.testnet.tryradi.us/<YOUR-RPC-ENDPOINT>

Response

1099511627775
Ethereum contract ABI specification
default block parameter
EIP-1559 transactions
EIP-1559 transactions