|
| 1 | +[ethereumjs-util](../README.md) › ["account"](../modules/_account_.md) › [Account](_account_.account.md) |
| 2 | + |
| 3 | +# Class: Account |
| 4 | + |
| 5 | +## Hierarchy |
| 6 | + |
| 7 | +* **Account** |
| 8 | + |
| 9 | +## Index |
| 10 | + |
| 11 | +### Constructors |
| 12 | + |
| 13 | +* [constructor](_account_.account.md#constructor) |
| 14 | + |
| 15 | +### Properties |
| 16 | + |
| 17 | +* [balance](_account_.account.md#balance) |
| 18 | +* [codeHash](_account_.account.md#codehash) |
| 19 | +* [nonce](_account_.account.md#nonce) |
| 20 | +* [stateRoot](_account_.account.md#stateroot) |
| 21 | + |
| 22 | +### Methods |
| 23 | + |
| 24 | +* [isContract](_account_.account.md#iscontract) |
| 25 | +* [isEmpty](_account_.account.md#isempty) |
| 26 | +* [serialize](_account_.account.md#serialize) |
| 27 | +* [fromAccountData](_account_.account.md#static-fromaccountdata) |
| 28 | +* [fromRlpSerializedAccount](_account_.account.md#static-fromrlpserializedaccount) |
| 29 | +* [fromValuesArray](_account_.account.md#static-fromvaluesarray) |
| 30 | + |
| 31 | +## Constructors |
| 32 | + |
| 33 | +### constructor |
| 34 | + |
| 35 | +\+ **new Account**(`nonce`: BN‹›, `balance`: BN‹›, `stateRoot`: Buffer‹›, `codeHash`: Buffer‹›): *[Account](_account_.account.md)* |
| 36 | + |
| 37 | +*Defined in [account.ts:61](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L61)* |
| 38 | + |
| 39 | +This constructor takes the values, validates and assigns them. |
| 40 | +Use the static factory methods to assist in creating an Account from varying data types. |
| 41 | + |
| 42 | +**Parameters:** |
| 43 | + |
| 44 | +Name | Type | Default | |
| 45 | +------ | ------ | ------ | |
| 46 | +`nonce` | BN‹› | new BN(0) | |
| 47 | +`balance` | BN‹› | new BN(0) | |
| 48 | +`stateRoot` | Buffer‹› | KECCAK256_RLP | |
| 49 | +`codeHash` | Buffer‹› | KECCAK256_NULL | |
| 50 | + |
| 51 | +**Returns:** *[Account](_account_.account.md)* |
| 52 | + |
| 53 | +## Properties |
| 54 | + |
| 55 | +### balance |
| 56 | + |
| 57 | +• **balance**: *BN* |
| 58 | + |
| 59 | +*Defined in [account.ts:27](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L27)* |
| 60 | + |
| 61 | +___ |
| 62 | + |
| 63 | +### codeHash |
| 64 | + |
| 65 | +• **codeHash**: *Buffer* |
| 66 | + |
| 67 | +*Defined in [account.ts:29](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L29)* |
| 68 | + |
| 69 | +___ |
| 70 | + |
| 71 | +### nonce |
| 72 | + |
| 73 | +• **nonce**: *BN* |
| 74 | + |
| 75 | +*Defined in [account.ts:26](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L26)* |
| 76 | + |
| 77 | +___ |
| 78 | + |
| 79 | +### stateRoot |
| 80 | + |
| 81 | +• **stateRoot**: *Buffer* |
| 82 | + |
| 83 | +*Defined in [account.ts:28](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L28)* |
| 84 | + |
| 85 | +## Methods |
| 86 | + |
| 87 | +### isContract |
| 88 | + |
| 89 | +▸ **isContract**(): *boolean* |
| 90 | + |
| 91 | +*Defined in [account.ts:96](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L96)* |
| 92 | + |
| 93 | +Returns a `Boolean` deteremining if the account is a contract. |
| 94 | + |
| 95 | +**Returns:** *boolean* |
| 96 | + |
| 97 | +___ |
| 98 | + |
| 99 | +### isEmpty |
| 100 | + |
| 101 | +▸ **isEmpty**(): *boolean* |
| 102 | + |
| 103 | +*Defined in [account.ts:103](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L103)* |
| 104 | + |
| 105 | +Returns a `Boolean` determining if the account is empty. |
| 106 | + |
| 107 | +**Returns:** *boolean* |
| 108 | + |
| 109 | +___ |
| 110 | + |
| 111 | +### serialize |
| 112 | + |
| 113 | +▸ **serialize**(): *Buffer* |
| 114 | + |
| 115 | +*Defined in [account.ts:89](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L89)* |
| 116 | + |
| 117 | +Returns the RLP serialization of the account as a `Buffer`. |
| 118 | + |
| 119 | +**Returns:** *Buffer* |
| 120 | + |
| 121 | +___ |
| 122 | + |
| 123 | +### `Static` fromAccountData |
| 124 | + |
| 125 | +▸ **fromAccountData**(`accountData`: [AccountData](../interfaces/_account_.accountdata.md)): *[Account](_account_.account.md)‹›* |
| 126 | + |
| 127 | +*Defined in [account.ts:31](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L31)* |
| 128 | + |
| 129 | +**Parameters:** |
| 130 | + |
| 131 | +Name | Type | |
| 132 | +------ | ------ | |
| 133 | +`accountData` | [AccountData](../interfaces/_account_.accountdata.md) | |
| 134 | + |
| 135 | +**Returns:** *[Account](_account_.account.md)‹›* |
| 136 | + |
| 137 | +___ |
| 138 | + |
| 139 | +### `Static` fromRlpSerializedAccount |
| 140 | + |
| 141 | +▸ **fromRlpSerializedAccount**(`serialized`: Buffer): *[Account](_account_.account.md)‹›* |
| 142 | + |
| 143 | +*Defined in [account.ts:42](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L42)* |
| 144 | + |
| 145 | +**Parameters:** |
| 146 | + |
| 147 | +Name | Type | |
| 148 | +------ | ------ | |
| 149 | +`serialized` | Buffer | |
| 150 | + |
| 151 | +**Returns:** *[Account](_account_.account.md)‹›* |
| 152 | + |
| 153 | +___ |
| 154 | + |
| 155 | +### `Static` fromValuesArray |
| 156 | + |
| 157 | +▸ **fromValuesArray**(`values`: Buffer[]): *[Account](_account_.account.md)‹›* |
| 158 | + |
| 159 | +*Defined in [account.ts:52](https://github.com/ethereumjs/ethereumjs-util/blob/master/src/account.ts#L52)* |
| 160 | + |
| 161 | +**Parameters:** |
| 162 | + |
| 163 | +Name | Type | |
| 164 | +------ | ------ | |
| 165 | +`values` | Buffer[] | |
| 166 | + |
| 167 | +**Returns:** *[Account](_account_.account.md)‹›* |
0 commit comments