ethereumjs-monorepo

@ethereumjs/util / Account

Class: Account

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Account(nonce?, balance?, storageRoot?, codeHash?)

This constructor assigns and validates the values. Use the static factory methods to assist in creating an Account from varying data types.

Parameters

Name Type Default value
nonce bigint BIGINT_0
balance bigint BIGINT_0
storageRoot Uint8Array KECCAK256_RLP
codeHash Uint8Array KECCAK256_NULL

Defined in

packages/util/src/account.ts:68

Properties

balance

balance: bigint

Defined in

packages/util/src/account.ts:33


codeHash

codeHash: Uint8Array

Defined in

packages/util/src/account.ts:35


nonce

nonce: bigint

Defined in

packages/util/src/account.ts:32


storageRoot

storageRoot: Uint8Array

Defined in

packages/util/src/account.ts:34

Methods

isContract

isContract(): boolean

Returns a Boolean determining if the account is a contract.

Returns

boolean

Defined in

packages/util/src/account.ts:119


isEmpty

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

Defined in

packages/util/src/account.ts:128


raw

raw(): Uint8Array[]

Returns an array of Uint8Arrays of the raw bytes for the account, in order.

Returns

Uint8Array[]

Defined in

packages/util/src/account.ts:100


serialize

serialize(): Uint8Array

Returns the RLP serialization of the account as a Uint8Array.

Returns

Uint8Array

Defined in

packages/util/src/account.ts:112


fromAccountData

Static fromAccountData(accountData): Account

Parameters

Name Type
accountData AccountData

Returns

Account

Defined in

packages/util/src/account.ts:37


fromRlpSerializedAccount

Static fromRlpSerializedAccount(serialized): Account

Parameters

Name Type
serialized Uint8Array

Returns

Account

Defined in

packages/util/src/account.ts:48


fromValuesArray

Static fromValuesArray(values): Account

Parameters

Name Type
values Uint8Array[]

Returns

Account

Defined in

packages/util/src/account.ts:58