ethereumjs-util › "account" › Account
- Account
+ 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
• balance: BN
Defined in account.ts:27
• codeHash: Buffer
Defined in account.ts:29
• nonce: BN
Defined in account.ts:26
• stateRoot: Buffer
Defined in account.ts:28
▸ isContract(): boolean
Defined in account.ts:106
Returns a Boolean
determining if the account is a contract.
Returns: boolean
▸ 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(): Buffer
Defined in account.ts:99
Returns the RLP serialization of the account as a Buffer
.
Returns: Buffer
▸ fromAccountData(accountData
: AccountData): Account‹›
Defined in account.ts:31
Parameters:
Name | Type |
---|---|
accountData |
AccountData |
Returns: Account‹›
▸ fromRlpSerializedAccount(serialized
: Buffer): Account‹›
Defined in account.ts:42
Parameters:
Name | Type |
---|---|
serialized |
Buffer |
Returns: Account‹›
▸ fromValuesArray(values
: Buffer[]): Account‹›
Defined in account.ts:52
Parameters:
Name | Type |
---|---|
values |
Buffer[] |
Returns: Account‹›