Class AccessListItem

java.lang.Object
com.hedera.hashgraph.sdk.AccessListItem

public class AccessListItem extends Object
An EIP-2930 access list entry: an Ethereum address together with the storage keys of that account the transaction intends to access.
  • Constructor Details

    • AccessListItem

      public AccessListItem()
      Constructor.
  • Method Details

    • getAddress

      public byte[] getAddress()
      Returns:
      the address this entry refers to
    • setAddress

      public AccessListItem setAddress(byte[] address)
      Parameters:
      address - the address this entry refers to
      Returns:
      this
    • getStorageKeys

      public List<byte[]> getStorageKeys()
      Returns:
      the storage keys this entry refers to
    • setStorageKeys

      public AccessListItem setStorageKeys(List<byte[]> storageKeys)
      Parameters:
      storageKeys - the storage keys this entry refers to
      Returns:
      this
    • addStorageKey

      public AccessListItem addStorageKey(byte[] storageKey)
      Append a single storage key.
      Parameters:
      storageKey - the storage key to add
      Returns:
      this
    • toRlpObject

      Object toRlpObject()
      Build the nested RLP object representation of this item: [address, [storageKeys...]]. The returned value is suitable for inclusion in the object list passed to RLPEncoder.list/RLPEncoder.sequence.
    • accessListItemsToRlpObject

      static List<Object> accessListItemsToRlpObject(List<AccessListItem> items)
      Build the nested RLP object representation of an entire access list.
      Parameters:
      items - the access list items (may be null)
      Returns:
      a list of nested RLP objects, one per item
    • fromRlp

      static AccessListItem fromRlp(com.esaulpaugh.headlong.rlp.RLPItem item)
      Decode a single access list entry from its RLP representation.
      Parameters:
      item - the RLP item for a single entry
      Returns:
      the decoded item, or null if the entry is malformed
    • accessListItemsFromRlp

      static List<AccessListItem> accessListItemsFromRlp(com.esaulpaugh.headlong.rlp.RLPItem accessListItem)
      Decode an entire access list from the RLP item holding the list. Malformed entries are skipped.
      Parameters:
      accessListItem - the RLP item representing the whole access list
      Returns:
      the decoded access list items
    • encodeAccessList

      static byte[] encodeAccessList(List<AccessListItem> items)
      Encode a list of access list items to their canonical, self-contained RLP list bytes. An empty (or null) list encodes to an empty byte array so that the stored accessList field stays "" for the common empty case.
      Parameters:
      items - the access list items
      Returns:
      the RLP-encoded access list, or an empty byte array when there are no items
    • decodeAccessList

      static List<AccessListItem> decodeAccessList(byte[] accessList)
      Decode the stored accessList bytes (either empty or a self-contained RLP list) back into items.
      Parameters:
      accessList - the stored access list bytes
      Returns:
      the decoded items (empty when there are none)
    • toString

      public String toString()
      Overrides:
      toString in class Object