4
4
5
5
## Hierarchy
6
6
7
- - ** Account**
7
+ * ** Account**
8
8
9
9
## Index
10
10
11
11
### Constructors
12
12
13
- - [ constructor] ( _index_.account.md#constructor )
13
+ * [ constructor] ( _index_.account.md#constructor )
14
14
15
15
### Properties
16
16
17
- - [ balance] ( _index_.account.md#balance )
18
- - [ codeHash] ( _index_.account.md#codehash )
19
- - [ nonce] ( _index_.account.md#nonce )
20
- - [ stateRoot] ( _index_.account.md#stateroot )
17
+ * [ balance] ( _index_.account.md#balance )
18
+ * [ codeHash] ( _index_.account.md#codehash )
19
+ * [ nonce] ( _index_.account.md#nonce )
20
+ * [ stateRoot] ( _index_.account.md#stateroot )
21
21
22
22
### Methods
23
23
24
- - [ getCode] ( _index_.account.md#getcode )
25
- - [ getStorage] ( _index_.account.md#getstorage )
26
- - [ isContract] ( _index_.account.md#iscontract )
27
- - [ isEmpty] ( _index_.account.md#isempty )
28
- - [ serialize] ( _index_.account.md#serialize )
29
- - [ setCode] ( _index_.account.md#setcode )
30
- - [ setStorage] ( _index_.account.md#setstorage )
24
+ * [ getCode] ( _index_.account.md#getcode )
25
+ * [ getStorage] ( _index_.account.md#getstorage )
26
+ * [ isContract] ( _index_.account.md#iscontract )
27
+ * [ isEmpty] ( _index_.account.md#isempty )
28
+ * [ serialize] ( _index_.account.md#serialize )
29
+ * [ setCode] ( _index_.account.md#setcode )
30
+ * [ setStorage] ( _index_.account.md#setstorage )
31
31
32
32
## Constructors
33
33
34
- ### constructor
34
+ ### constructor
35
35
36
- \+ ** new Account** (` data? ` : any): _ [ Account] ( \ _ index_.account.md) \_
36
+ \+ ** new Account** (` data? ` : any): * [ Account] ( _index_.account.md ) *
37
37
38
- _ Defined in [ index.ts:41] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L41 ) _
38
+ * Defined in [ index.ts:41] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L41 ) *
39
39
40
40
Creates a new account object
41
41
42
- ```
42
+ ~~~
43
43
var data = [
44
44
'0x02', //nonce
45
45
'0x0384', //balance
@@ -55,142 +55,142 @@ var data = {
55
55
}
56
56
57
57
const account = new Account(data)
58
- ```
58
+ ~~~
59
59
60
60
** Parameters:**
61
61
62
- | Name | Type | Description |
63
- | ------- | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------ |
64
- | ` data? ` | any | An account can be initialized with either a ` buffer ` containing the RLP serialized account. Or an ` Array ` of buffers relating to each of the account Properties, listed in order below. For ` Object ` and ` Array ` each of the elements can either be a ` Buffer ` , hex ` String ` , ` Number ` , or an object with a ` toBuffer ` method such as ` Bignum ` . |
62
+ Name | Type | Description |
63
+ ------ | ------ | ------ |
64
+ ` data? ` | any | An account can be initialized with either a ` buffer ` containing the RLP serialized account. Or an ` Array ` of buffers relating to each of the account Properties, listed in order below. For ` Object ` and ` Array ` each of the elements can either be a ` Buffer ` , hex ` String ` , ` Number ` , or an object with a ` toBuffer ` method such as ` Bignum ` . |
65
65
66
- ** Returns:** _ [ Account] ( \ _ index_.account.md) \_
66
+ ** Returns:** * [ Account] ( _index_.account.md ) *
67
67
68
68
## Properties
69
69
70
- ### balance
70
+ ### balance
71
71
72
- • ** balance** : _ Buffer _
72
+ • ** balance** : * Buffer *
73
73
74
- _ Defined in [ index.ts:31] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L31 ) _
74
+ * Defined in [ index.ts:31] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L31 ) *
75
75
76
76
The account's balance in wei.
77
77
78
- ---
78
+ ___
79
79
80
- ### codeHash
80
+ ### codeHash
81
81
82
- • ** codeHash** : _ Buffer _
82
+ • ** codeHash** : * Buffer *
83
83
84
- _ Defined in [ index.ts:41] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L41 ) _
84
+ * Defined in [ index.ts:41] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L41 ) *
85
85
86
86
The hash of the code of the contract.
87
87
88
- ---
88
+ ___
89
89
90
- ### nonce
90
+ ### nonce
91
91
92
- • ** nonce** : _ Buffer _
92
+ • ** nonce** : * Buffer *
93
93
94
- _ Defined in [ index.ts:26] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L26 ) _
94
+ * Defined in [ index.ts:26] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L26 ) *
95
95
96
96
The account's nonce.
97
97
98
- ---
98
+ ___
99
99
100
- ### stateRoot
100
+ ### stateRoot
101
101
102
- • ** stateRoot** : _ Buffer _
102
+ • ** stateRoot** : * Buffer *
103
103
104
- _ Defined in [ index.ts:36] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L36 ) _
104
+ * Defined in [ index.ts:36] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L36 ) *
105
105
106
106
The stateRoot for the storage of the contract.
107
107
108
108
## Methods
109
109
110
- ### getCode
110
+ ### getCode
111
111
112
- ▸ ** getCode** (` trie ` : Trie, ` cb ` : TrieGetCb): _ void _
112
+ ▸ ** getCode** (` trie ` : Trie, ` cb ` : TrieGetCb): * void *
113
113
114
- _ Defined in [ index.ts:116] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L116 ) _
114
+ * Defined in [ index.ts:116] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L116 ) *
115
115
116
116
Fetches the code from the trie.
117
117
118
118
** Parameters:**
119
119
120
- | Name | Type | Description |
121
- | ------ | --------- | ----------------------------------------------------------------------------- ------ |
122
- | ` trie ` | Trie | The [ trie] ( https://github.com/ethereumjs/merkle-patricia-tree ) storing the accounts |
123
- | ` cb ` | TrieGetCb | The callback |
120
+ Name | Type | Description |
121
+ ------ | ------ | ------ |
122
+ ` trie ` | Trie | The [ trie] ( https://github.com/ethereumjs/merkle-patricia-tree ) storing the accounts |
123
+ ` cb ` | TrieGetCb | The callback |
124
124
125
- ** Returns:** _ void _
125
+ ** Returns:** * void *
126
126
127
- ---
127
+ ___
128
128
129
- ### getStorage
129
+ ### getStorage
130
130
131
- ▸ ** getStorage** (` trie ` : Trie, ` key ` : Buffer | string, ` cb ` : TrieGetCb): _ void _
131
+ ▸ ** getStorage** (` trie ` : Trie, ` key ` : Buffer | string, ` cb ` : TrieGetCb): * void *
132
132
133
- _ Defined in [ index.ts:179] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L179 ) _
133
+ * Defined in [ index.ts:179] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L179 ) *
134
134
135
135
Fetches ` key ` from the account's storage.
136
136
137
137
** Parameters:**
138
138
139
- | Name | Type | Description |
140
- | ------ | -------------------- | ----- ------ |
141
- | ` trie ` | Trie | - |
142
- | ` key ` | Buffer | ; string | - |
143
- | ` cb ` | TrieGetCb | |
139
+ Name | Type | Description |
140
+ ------ | ------ | ------ |
141
+ ` trie ` | Trie | - |
142
+ ` key ` | Buffer | ; string | - |
143
+ ` cb ` | TrieGetCb | |
144
144
145
- ** Returns:** _ void _
145
+ ** Returns:** * void *
146
146
147
- ---
147
+ ___
148
148
149
- ### isContract
149
+ ### isContract
150
150
151
- ▸ ** isContract** (): _ boolean _
151
+ ▸ ** isContract** (): * boolean *
152
152
153
- _ Defined in [ index.ts:107] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L107 ) _
153
+ * Defined in [ index.ts:107] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L107 ) *
154
154
155
155
Returns a ` Boolean ` deteremining if the account is a contract.
156
156
157
- ** Returns:** _ boolean _
157
+ ** Returns:** * boolean *
158
158
159
- ---
159
+ ___
160
160
161
- ### isEmpty
161
+ ### isEmpty
162
162
163
- ▸ ** isEmpty** (): _ boolean _
163
+ ▸ ** isEmpty** (): * boolean *
164
164
165
- _ Defined in [ index.ts:232] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L232 ) _
165
+ * Defined in [ index.ts:232] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L232 ) *
166
166
167
167
Returns a ` Boolean ` determining if the account is empty.
168
168
169
- ** Returns:** _ boolean _
169
+ ** Returns:** * boolean *
170
170
171
- ---
171
+ ___
172
172
173
- ### serialize
173
+ ### serialize
174
174
175
- ▸ ** serialize** (): _ Buffer _
175
+ ▸ ** serialize** (): * Buffer *
176
176
177
- _ Defined in [ index.ts:99] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L99 ) _
177
+ * Defined in [ index.ts:99] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L99 ) *
178
178
179
179
Returns the RLP serialization of the account as a ` Buffer ` .
180
180
181
- ** Returns:** _ Buffer _
181
+ ** Returns:** * Buffer *
182
182
183
- ---
183
+ ___
184
184
185
- ### setCode
185
+ ### setCode
186
186
187
- ▸ ** setCode** (` trie ` : Trie, ` code ` : Buffer, ` cb ` : function): _ void _
187
+ ▸ ** setCode** (` trie ` : Trie, ` code ` : Buffer, ` cb ` : function): * void *
188
188
189
- _ Defined in [ index.ts:160] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L160 ) _
189
+ * Defined in [ index.ts:160] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L160 ) *
190
190
191
191
Stores the code in the trie.
192
192
193
- ```
193
+ ~~~
194
194
// Requires manual merkle-patricia-tree install
195
195
const SecureTrie = require('merkle-patricia-tree/secure')
196
196
const Account = require('./index.js').default
@@ -215,44 +215,44 @@ account.setCode(trie, code, function(err, codeHash) {
215
215
console.log(`Code ${code.toString('hex')} read from trie`)
216
216
})
217
217
})
218
- ```
218
+ ~~~
219
219
220
220
** Parameters:**
221
221
222
- ▪ ** trie** : _ Trie _
222
+ ▪ ** trie** : * Trie *
223
223
224
224
The [ trie] ( https://github.com/ethereumjs/merkle-patricia-tree ) storing the accounts.
225
225
226
- ▪ ** code** : _ Buffer _
226
+ ▪ ** code** : * Buffer *
227
227
228
- ▪ ** cb** : _ function _
228
+ ▪ ** cb** : * function *
229
229
230
230
The callback.
231
231
232
- ▸ (` err ` : any, ` codeHash ` : Buffer): _ void _
232
+ ▸ (` err ` : any, ` codeHash ` : Buffer): * void *
233
233
234
234
** Parameters:**
235
235
236
- | Name | Type |
237
- | ---- ------ | ------ |
238
- | ` err ` | any |
239
- | ` codeHash ` | Buffer |
236
+ Name | Type |
237
+ ------ | ------ |
238
+ ` err ` | any |
239
+ ` codeHash ` | Buffer |
240
240
241
- ** Returns:** _ void _
241
+ ** Returns:** * void *
242
242
243
- ---
243
+ ___
244
244
245
- ### setStorage
245
+ ### setStorage
246
246
247
- ▸ ** setStorage** (` trie ` : Trie, ` key ` : Buffer | string, ` val ` : Buffer | string, ` cb ` : TriePutCb): _ void _
247
+ ▸ ** setStorage** (` trie ` : Trie, ` key ` : Buffer | string, ` val ` : Buffer | string, ` cb ` : TriePutCb): * void *
248
248
249
- _ Defined in [ index.ts:218] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L218 ) _
249
+ * Defined in [ index.ts:218] ( https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/account/src/index.ts#L218 ) *
250
250
251
251
Stores a ` val ` at the ` key ` in the contract's storage.
252
252
253
253
Example for ` getStorage ` and ` setStorage ` :
254
254
255
- ```
255
+ ~~~
256
256
// Requires manual merkle-patricia-tree install
257
257
const SecureTrie = require('merkle-patricia-tree/secure')
258
258
const Account = require('./index.js').default
@@ -273,15 +273,15 @@ account.setStorage(trie, key, value, function(err) {
273
273
console.log(`Value ${value.toString('hex')} set and retrieved from trie.`)
274
274
})
275
275
})
276
- ```
276
+ ~~~
277
277
278
278
** Parameters:**
279
279
280
- | Name | Type | Description |
281
- | ------ | -------------------- | ----- ------ |
282
- | ` trie ` | Trie | - |
283
- | ` key ` | Buffer | ; string | - |
284
- | ` val ` | Buffer | ; string | - |
285
- | ` cb ` | TriePutCb | |
280
+ Name | Type | Description |
281
+ ------ | ------ | ------ |
282
+ ` trie ` | Trie | - |
283
+ ` key ` | Buffer | ; string | - |
284
+ ` val ` | Buffer | ; string | - |
285
+ ` cb ` | TriePutCb | |
286
286
287
- ** Returns:** _ void _
287
+ ** Returns:** * void *
0 commit comments