Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Latest commit

 

History

History
169 lines (96 loc) · 4.27 KB

_account_.account.md

File metadata and controls

169 lines (96 loc) · 4.27 KB

ethereumjs-util"account"Account

Class: Account

Hierarchy

  • Account

Index

Constructors

Properties

Methods

Constructors

constructor

+ new Account(nonce: BN‹›, balance: BN‹›, stateRoot: Buffer‹›, codeHash: Buffer‹›): Account

Defined in account.ts:61

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
nonce BN‹› new BN(0)
balance BN‹› new BN(0)
stateRoot Buffer‹› KECCAK256_RLP
codeHash Buffer‹› KECCAK256_NULL

Returns: Account

Properties

balance

balance: BN

Defined in account.ts:27


codeHash

codeHash: Buffer

Defined in account.ts:29


nonce

nonce: BN

Defined in account.ts:26


stateRoot

stateRoot: Buffer

Defined in account.ts:28

Methods

isContract

isContract(): boolean

Defined in account.ts:106

Returns a Boolean determining if the account is a contract.

Returns: boolean


isEmpty

isEmpty(): boolean

Defined in account.ts:115

Returns a Boolean determining if the account is empty. For more details about account emptiness see EIP-161. Note: The stateRoot is also checked to be empty since in Frontier it was possible to create a contract with no code where nonce remained 0 but some values were written to storage in the constructor (thus stateRoot is not KECCAK256_RLP).

Returns: boolean


serialize

serialize(): Buffer

Defined in account.ts:99

Returns the RLP serialization of the account as a Buffer.

Returns: Buffer


Static fromAccountData

fromAccountData(accountData: AccountData): Account‹›

Defined in account.ts:31

Parameters:

Name Type
accountData AccountData

Returns: Account‹›


Static fromRlpSerializedAccount

fromRlpSerializedAccount(serialized: Buffer): Account‹›

Defined in account.ts:42

Parameters:

Name Type
serialized Buffer

Returns: Account‹›


Static fromValuesArray

fromValuesArray(values: Buffer[]): Account‹›

Defined in account.ts:52

Parameters:

Name Type
values Buffer[]

Returns: Account‹›