eth_createAccessList
Ethereum API - Creates an EIP2930 type accessList
based on a given Transaction object. Returns list of addresses and storage keys that are read and written by the transaction (except the sender account and precompiles), plus the estimated gas consumed when the access list is added.
Parameters
TRANSACTION CALL OBJECT
[required]from
: [optional] 20 Bytes - The address of the sender.to
: 20 Bytes - The address the transaction is directed to.gas
: [optional] Hexadecimal value of the gas provided for the transaction execution.gasPrice
: [optional] Hexadecimal value gas price, in Wei, provided by the sender. The default is0
. Used only in non-EIP1559 transactions.maxPriorityFeePerGas
: [optional] Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. See EIP-1559 transactions. If used, must specifymaxFeePerGas
.maxFeePerGas
: [optional] Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. See EIP-1559 transactions. If used, must specifymaxPriorityFeePerGas
.value
: [optional] hexadecimal value transferred, in Wei.data
: [optional] Hash of the method signature and encoded parameters. See the Ethereum contract ABI specification.
BLOCK NUMBER
orBLOCK HASH
: [required] string representing a block number, block hash, or one of the string tagslatest
,earliest
, orpending
.
Returns
access list object with the following fields:
accessList
: list of objects with the following fields:address
: addresses to be accessed by the transactionstorageKeys
: storage keys to be accessed by the transaction
gasUsed
: string - approximate gas cost for the transaction if the access list is included
Example
NOTE: In this example we are using public Ethereum endpoint. Ideally, for your own projects, you should use your own endpoint, which you can generate for free by connecting to your wallet here.
Last updated