Skip to main content

eth_createAccessList

Overview

The 'eth_createAccessList' method Creates an EIP-2930 access list that can be included in a transaction. This method is essential for optimizing your smart contract interactions. Access lists are a part of Ethereum's EIP-2930, aiming to enhance the network's scalability and reduce gas costs by specifying an explicit list of addresses and storage keys that a transaction intends to access.

curl --request POST \
--url https://ethereum-mainnet-geth-archive.node.coinapi.io \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'X-CoinAPI-Key: 73034021-THIS-IS-SAMPLE-KEY' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_createAccessList",
"params": [
{
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
"gas": "0x00",
"gasPrice": "0x09184e72a000",
"value": "0x00",
"data": "0x"
}
]
}
'

Request Parameters

  1. Transaction call object:
  • 'from' [optional]: 20 bytes. The address of the sender.
  • 'to': 20 bytes. 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 is '0'. Used only in non-EIP-1559 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 specify maxFeePerGas.
  • '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 specify maxPriorityFeePerGas.
  • 'value' [optional]: Hexadecimal of the value transferred, in Wei.
  • 'data' [optional]: Hash of the method signature and encoded parameters. See Ethereum contract ABI specification.
  1. Block number or block hash [required]: A string representing a block number, block hash, or one of the string tags latest, earliest, or pending. Refer to the default block parameter.

  2. Access list object:

  • 'accessList': A list of objects with the following fields:
  • 'address': Addresses to be accessed by the transaction.
  • 'storageKeys': Storage keys to be accessed by the transaction.
  • 'gasUsed': A hexadecimal string representing the approximate gas cost for the transaction if the access list is included.

Response

{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32602,
"message": "invalid argument 0: json: cannot unmarshal hex number with leading zero digits into Go struct field TransactionArgs.gas of type hexutil.Uint64"
}
}