@ethereumjs/util / Account
• 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.
Name | Type | Default value |
---|---|---|
nonce |
bigint |
BIGINT_0 |
balance |
bigint |
BIGINT_0 |
storageRoot |
Uint8Array |
KECCAK256_RLP |
codeHash |
Uint8Array |
KECCAK256_NULL |
packages/util/src/account.ts:68
• balance: bigint
packages/util/src/account.ts:33
• codeHash: Uint8Array
packages/util/src/account.ts:35
• nonce: bigint
packages/util/src/account.ts:32
• storageRoot: Uint8Array
packages/util/src/account.ts:34
▸ isContract(): boolean
Returns a Boolean
determining if the account is a contract.
boolean
packages/util/src/account.ts:119
▸ 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.”
boolean
packages/util/src/account.ts:128
▸ raw(): Uint8Array
[]
Returns an array of Uint8Arrays of the raw bytes for the account, in order.
Uint8Array
[]
packages/util/src/account.ts:100
▸ serialize(): Uint8Array
Returns the RLP serialization of the account as a Uint8Array
.
Uint8Array
packages/util/src/account.ts:112
▸ Static
fromAccountData(accountData
): Account
Name | Type |
---|---|
accountData |
AccountData |
packages/util/src/account.ts:37
▸ Static
fromRlpSerializedAccount(serialized
): Account
Name | Type |
---|---|
serialized |
Uint8Array |
packages/util/src/account.ts:48
▸ Static
fromValuesArray(values
): Account
Name | Type |
---|---|
values |
Uint8Array [] |