Skip to content

Latest commit

 

History

History
214 lines (119 loc) · 4.41 KB

File metadata and controls

214 lines (119 loc) · 4.41 KB

@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 _0n
balance bigint _0n
storageRoot Buffer KECCAK256_RLP
codeHash Buffer KECCAK256_NULL

Defined in

packages/util/src/account.ts:69

Properties

balance

balance: bigint

Defined in

packages/util/src/account.ts:34


codeHash

codeHash: Buffer

Defined in

packages/util/src/account.ts:36


nonce

nonce: bigint

Defined in

packages/util/src/account.ts:33


storageRoot

storageRoot: Buffer

Defined in

packages/util/src/account.ts:35

Methods

isContract

isContract(): boolean

Returns a Boolean determining if the account is a contract.

Returns

boolean

Defined in

packages/util/src/account.ts:115


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:124


raw

raw(): Buffer[]

Returns a Buffer Array of the raw Buffers for the account, in order.

Returns

Buffer[]

Defined in

packages/util/src/account.ts:96


serialize

serialize(): Buffer

Returns the RLP serialization of the account as a Buffer.

Returns

Buffer

Defined in

packages/util/src/account.ts:108


fromAccountData

Static fromAccountData(accountData): Account

Parameters

Name Type
accountData AccountData

Returns

Account

Defined in

packages/util/src/account.ts:38


fromRlpSerializedAccount

Static fromRlpSerializedAccount(serialized): Account

Parameters

Name Type
serialized Buffer

Returns

Account

Defined in

packages/util/src/account.ts:49


fromValuesArray

Static fromValuesArray(values): Account

Parameters

Name Type
values Buffer[]

Returns

Account

Defined in

packages/util/src/account.ts:59