Try it Live
Run AccessList examples in the interactive playground
Constructors
Methods for creating AccessList instances.AccessList.create()
Create empty access list.- Starting point for incremental building
- Default/empty state
- Conditional list building
AccessList()
Canonical constructor accepting items array or RLP bytes.value: Item array or RLP-encoded bytes
- Delegates to
fromBytesfor Uint8Array input - No validation - use
assertValidif needed
Alias: AccessList.from()
AccessList.from() is an alias for AccessList() for backward compatibility. Use AccessList() directly in new code.
AccessList.fromBytes()
Decode RLP bytes to access list.bytes: RLP-encoded access list
- Error if invalid RLP structure
- Error if addresses not 20 bytes
- Error if storage keys not 32 bytes
- Top level must be RLP list
- Each item must be [address, keys] pair
- Address must be 20 bytes
- Keys must be list of 32-byte hashes
Patterns
Empty List
From Transaction Data
From Items Array
Incremental Building
Safe Construction
Clone List
Best Practices
-
Use
create()for incremental building -
Validate untrusted bytes
-
Use factory for literal values
-
Deduplicate after construction

