Skip to main content

Don't have an RPC Node yet?

Start using RPC Nodes in your project today.

Get your free RPC Node

eth_createAccessList

Create Access List

POSThttps://site1.moralis-nodes.com/:chain/:apiKey

This example demonstrates generating an access list for a hypothetical transaction that interacts with a contract. The access list helps in optimizing gas costs for transactions by pre-specifying accounts and storage keys the transaction intends to access.

Note

Please refer to RPC schema page for more details on the RPC params and RPC response definitions of the RPC method.

PATH PARAMS
chainstringrequired
The blockchain to interact with. In this example, 'eth' is used to denote Ethereum Mainnet.
apiKeystringrequired
Your API key for authentication. Replace 'YOUR_API_KEY' with your actual Moralis API key.
BODY PARAM
Request Bodyobjectrequired
The request payload for generating an access list based on a transaction object.
Responses
200Successful response with the generated access list and gas used.
400Bad Request
404Not Found
429Too Many Requests
500Internal Server Error
curl --request POST \
--url 'https://site1.moralis-nodes.com/eth/YOUR_API_KEY' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_createAccessList"
}
'
Response Example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"accessList": [
""
],
"gasUsed": "0x5208"
}
}