Parameters
- transactionobjectREQUIRED
The transaction call object:
- fromstring
The address from which the transaction is sent
- tostring
The address to which the transaction is addressed
- gasstring
The integer of gas provided for the transaction execution
- gasPricestring
The integer of gasPrice used for each paid gas encoded as hexadecimal
- maxPriorityFeePerGasstring
The maximum fee, in wei, the sender is willing to pay per gas above the base fee
- maxFeePerGasstring
The maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas
- valuestring
The integer of value sent with this transaction encoded as hexadecimal
- datastring
The hash of the method signature and encoded parameters. For more information, see the Contract ABI documentation.
- stateOverrideobject
(Optional) Address-to-state mapping to override account state before estimating gas. Each key is a 20-byte address; each value may include balance, nonce, code, and/or stateDiff fields.
- balancestring
The fake balance to set for the account before executing the call
- noncestring
The fake nonce to set for the account before executing the call
- codestring
The fake EVM bytecode to inject into the account before executing the call
- stateDiffobject
The fake key-value mapping to override individual slots in the account storage before executing the call
Returns
- gasLimitstring
The estimated maximum gas that the transaction may consume
- baseFeePerGasstring
The minimum required fee per gas unit in the network
- priorityFeePerGasstring
The suggested tip for miners to prioritize the transaction
1{2"jsonrpc": "2.0",3"id": 1,4"result": {5"gasLimit": "0xd221",6"baseFeePerGas": "0x7",7"priorityFeePerGas": "0x245fe65"8}9}
1{2"jsonrpc": "2.0",3"id": 1,4"result": {5"gasLimit": "0xd221",6"baseFeePerGas": "0x7",7"priorityFeePerGas": "0x245fe65"8}9}