Skip to main content

Account

Index

Constructors

publicconstructor

  • new Account(nonce?: bigint, balance?: bigint, storageRoot?: Buffer, codeHash?: Buffer): Account
  • This constructor assigns and validates the values. Use the static factory methods to assist in creating an Account from varying data types.


    Parameters

    • nonce: bigint = _0n
    • balance: bigint = _0n
    • storageRoot: Buffer = KECCAK256_RLP
    • codeHash: Buffer = KECCAK256_NULL

    Returns Account

Properties

publicbalance

balance: bigint

publiccodeHash

codeHash: Buffer

publicnonce

nonce: bigint

publicstorageRoot

storageRoot: Buffer

Methods

publicisContract

  • isContract(): boolean
  • Returns a Boolean determining if the account is a contract.


    Returns boolean

publicisEmpty

  • isEmpty(): boolean
  • Returns a Boolean determining if the account is empty complying to the definition of account emptiness in EIP-161: “An account is considered empty when it has no code and zero nonce and zero balance.”


    Returns boolean

publicraw

  • raw(): Buffer[]
  • Returns a Buffer Array of the raw Buffers for the account, in order.


    Returns Buffer[]

publicserialize

  • serialize(): Buffer
  • Returns the RLP serialization of the account as a Buffer.


    Returns Buffer

publicstaticfromAccountData

publicstaticfromRlpSerializedAccount

  • fromRlpSerializedAccount(serialized: Buffer): Account
  • Parameters

    • serialized: Buffer

    Returns Account

publicstaticfromValuesArray

  • fromValuesArray(values: Buffer[]): Account
  • Parameters

    • values: Buffer[]

    Returns Account