@leofcoin/chain 1.0.10 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/node.browser.js +1055 -1047
  2. package/dist/node.browser.min.js +1 -1
  3. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/chain.js.html +0 -0
  4. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/contracts_factory.js.html +0 -0
  5. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/contracts_nameService.js.html +0 -0
  6. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/contracts_proxies_factoryProxy.js.html +0 -0
  7. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/contracts_proxies_nameServiceProxy.js.html +0 -0
  8. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/contracts_proxies_nativeTokenProxy.js.html +0 -0
  9. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/contracts_proxies_validatorsProxy.js.html +0 -0
  10. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/contracts_proxies_votingProxy.js.html +0 -0
  11. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/contracts_validators.js.html +0 -0
  12. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Bold-webfont.eot +0 -0
  13. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Bold-webfont.svg +0 -0
  14. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Bold-webfont.woff +0 -0
  15. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  16. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-BoldItalic-webfont.svg +0 -0
  17. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  18. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Italic-webfont.eot +0 -0
  19. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Italic-webfont.svg +0 -0
  20. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Italic-webfont.woff +0 -0
  21. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Light-webfont.eot +0 -0
  22. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Light-webfont.svg +0 -0
  23. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Light-webfont.woff +0 -0
  24. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  25. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-LightItalic-webfont.svg +0 -0
  26. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  27. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Regular-webfont.eot +0 -0
  28. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Regular-webfont.svg +0 -0
  29. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Regular-webfont.woff +0 -0
  30. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Semibold-webfont.eot +0 -0
  31. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Semibold-webfont.svg +0 -0
  32. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  33. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-Semibold-webfont.woff +0 -0
  34. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  35. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -0
  36. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  37. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  38. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/global.html +0 -0
  39. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/icons/home.svg +0 -0
  40. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/icons/search.svg +0 -0
  41. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/index.html +0 -0
  42. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/machine.js.html +0 -0
  43. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/scripts/linenumber.js +0 -0
  44. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/scripts/pagelocation.js +0 -0
  45. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/standards_roles.js.html +0 -0
  46. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/standards_token.js.html +0 -0
  47. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/styles/collapse.css +0 -0
  48. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/styles/jsdoc-default.css +0 -0
  49. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/styles/prettify-jsdoc.css +0 -0
  50. package/docs/@leofcoin/chain/{1.0.7 → 1.0.12}/styles/prettify-tomorrow.css +0 -0
  51. package/package.json +2 -2
  52. package/rollup.config.js +0 -42
  53. package/_node.js +0 -1
  54. package/chain.js +0 -938
  55. package/docs/@leofcoin/chain/1.0.8/chain.js.html +0 -738
  56. package/docs/@leofcoin/chain/1.0.8/contracts_factory.js.html +0 -182
  57. package/docs/@leofcoin/chain/1.0.8/contracts_nameService.js.html +0 -231
  58. package/docs/@leofcoin/chain/1.0.8/contracts_proxies_factoryProxy.js.html +0 -135
  59. package/docs/@leofcoin/chain/1.0.8/contracts_proxies_nameServiceProxy.js.html +0 -135
  60. package/docs/@leofcoin/chain/1.0.8/contracts_proxies_nativeTokenProxy.js.html +0 -135
  61. package/docs/@leofcoin/chain/1.0.8/contracts_proxies_validatorsProxy.js.html +0 -135
  62. package/docs/@leofcoin/chain/1.0.8/contracts_proxies_votingProxy.js.html +0 -135
  63. package/docs/@leofcoin/chain/1.0.8/contracts_validators.js.html +0 -242
  64. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Bold-webfont.eot +0 -0
  65. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Bold-webfont.svg +0 -1830
  66. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Bold-webfont.woff +0 -0
  67. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  68. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  69. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  70. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Italic-webfont.eot +0 -0
  71. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Italic-webfont.svg +0 -1830
  72. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Italic-webfont.woff +0 -0
  73. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Light-webfont.eot +0 -0
  74. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Light-webfont.svg +0 -1831
  75. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Light-webfont.woff +0 -0
  76. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  77. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  78. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  79. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Regular-webfont.eot +0 -0
  80. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Regular-webfont.svg +0 -1831
  81. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Regular-webfont.woff +0 -0
  82. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Semibold-webfont.eot +0 -0
  83. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Semibold-webfont.svg +0 -1830
  84. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  85. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Semibold-webfont.woff +0 -0
  86. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  87. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
  88. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  89. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  90. package/docs/@leofcoin/chain/1.0.8/global.html +0 -1153
  91. package/docs/@leofcoin/chain/1.0.8/icons/home.svg +0 -4
  92. package/docs/@leofcoin/chain/1.0.8/icons/search.svg +0 -4
  93. package/docs/@leofcoin/chain/1.0.8/index.html +0 -125
  94. package/docs/@leofcoin/chain/1.0.8/machine.js.html +0 -252
  95. package/docs/@leofcoin/chain/1.0.8/scripts/linenumber.js +0 -23
  96. package/docs/@leofcoin/chain/1.0.8/scripts/pagelocation.js +0 -89
  97. package/docs/@leofcoin/chain/1.0.8/standards_roles.js.html +0 -188
  98. package/docs/@leofcoin/chain/1.0.8/standards_token.js.html +0 -260
  99. package/docs/@leofcoin/chain/1.0.8/styles/collapse.css +0 -27
  100. package/docs/@leofcoin/chain/1.0.8/styles/jsdoc-default.css +0 -953
  101. package/docs/@leofcoin/chain/1.0.8/styles/prettify-jsdoc.css +0 -111
  102. package/docs/@leofcoin/chain/1.0.8/styles/prettify-tomorrow.css +0 -138
  103. package/lib.js +0 -1
  104. package/out/@leofcoin/chain/1.0.7/chain.js.html +0 -645
  105. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Bold-webfont.eot +0 -0
  106. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Bold-webfont.svg +0 -1830
  107. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Bold-webfont.woff +0 -0
  108. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  109. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  110. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  111. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Italic-webfont.eot +0 -0
  112. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Italic-webfont.svg +0 -1830
  113. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Italic-webfont.woff +0 -0
  114. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Light-webfont.eot +0 -0
  115. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Light-webfont.svg +0 -1831
  116. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Light-webfont.woff +0 -0
  117. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  118. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  119. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  120. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Regular-webfont.eot +0 -0
  121. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Regular-webfont.svg +0 -1831
  122. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Regular-webfont.woff +0 -0
  123. package/out/@leofcoin/chain/1.0.7/global.html +0 -477
  124. package/out/@leofcoin/chain/1.0.7/index.html +0 -69
  125. package/out/@leofcoin/chain/1.0.7/machine.js.html +0 -180
  126. package/out/@leofcoin/chain/1.0.7/scripts/linenumber.js +0 -25
  127. package/out/@leofcoin/chain/1.0.7/scripts/prettify/Apache-License-2.0.txt +0 -202
  128. package/out/@leofcoin/chain/1.0.7/scripts/prettify/lang-css.js +0 -2
  129. package/out/@leofcoin/chain/1.0.7/scripts/prettify/prettify.js +0 -28
  130. package/out/@leofcoin/chain/1.0.7/styles/jsdoc-default.css +0 -358
  131. package/out/@leofcoin/chain/1.0.7/styles/prettify-jsdoc.css +0 -111
  132. package/out/@leofcoin/chain/1.0.7/styles/prettify-tomorrow.css +0 -132
@@ -1,477 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>JSDoc: Global</title>
6
-
7
- <script src="scripts/prettify/prettify.js"> </script>
8
- <script src="scripts/prettify/lang-css.js"> </script>
9
- <!--[if lt IE 9]>
10
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11
- <![endif]-->
12
- <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13
- <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14
- </head>
15
-
16
- <body>
17
-
18
- <div id="main">
19
-
20
- <h1 class="page-title">Global</h1>
21
-
22
-
23
-
24
-
25
-
26
-
27
- <section>
28
-
29
- <header>
30
-
31
- <h2></h2>
32
-
33
-
34
- </header>
35
-
36
- <article>
37
- <div class="container-overview">
38
-
39
-
40
-
41
-
42
-
43
-
44
- <dl class="details">
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
- </dl>
78
-
79
-
80
-
81
-
82
- </div>
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- <h3 class="subsection-title">Methods</h3>
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
- <h4 class="name" id="addContract"><span class="type-signature">(async) </span>addContract<span class="signature">()</span><span class="type-signature"></span></h4>
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
- <dl class="details">
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
- <dt class="tag-source">Source:</dt>
154
- <dd class="tag-source"><ul class="dummy"><li>
155
- <a href="machine.js.html">machine.js</a>, <a href="machine.js.html#line76">line 76</a>
156
- </li></ul></dd>
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
- </dl>
165
-
166
-
167
-
168
-
169
-
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
- <h4 class="name" id="createTransaction"><span class="type-signature"></span>createTransaction<span class="signature">()</span><span class="type-signature"></span></h4>
192
-
193
-
194
-
195
-
196
-
197
-
198
- <div class="description">
199
- <p>whenever method = createContract params should hold the contract hash</p>
200
- <p>example: [hash]
201
- createTransaction('0x0', 'createContract', [hash])</p>
202
- </div>
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
- <dl class="details">
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
-
237
-
238
-
239
-
240
-
241
-
242
-
243
- <dt class="tag-source">Source:</dt>
244
- <dd class="tag-source"><ul class="dummy"><li>
245
- <a href="chain.js.html">chain.js</a>, <a href="chain.js.html#line471">line 471</a>
246
- </li></ul></dd>
247
-
248
-
249
-
250
-
251
-
252
-
253
-
254
- </dl>
255
-
256
-
257
-
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
-
275
-
276
-
277
-
278
-
279
-
280
-
281
- <h4 class="name" id="createTransactionFrom"><span class="type-signature">(async) </span>createTransactionFrom<span class="signature">()</span><span class="type-signature"></span></h4>
282
-
283
-
284
-
285
-
286
-
287
-
288
- <div class="description">
289
- <p>every tx done is trough contracts so no need for amount
290
- data is undefined when nothing is returned
291
- error is thrown on error so undefined data doesn't mean there is an error...</p>
292
- </div>
293
-
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
-
305
-
306
- <dl class="details">
307
-
308
-
309
-
310
-
311
-
312
-
313
-
314
-
315
-
316
-
317
-
318
-
319
-
320
-
321
-
322
-
323
-
324
-
325
-
326
-
327
-
328
-
329
-
330
-
331
-
332
-
333
- <dt class="tag-source">Source:</dt>
334
- <dd class="tag-source"><ul class="dummy"><li>
335
- <a href="chain.js.html">chain.js</a>, <a href="chain.js.html#line479">line 479</a>
336
- </li></ul></dd>
337
-
338
-
339
-
340
-
341
-
342
-
343
-
344
- </dl>
345
-
346
-
347
-
348
-
349
-
350
-
351
-
352
-
353
-
354
-
355
-
356
-
357
-
358
-
359
-
360
-
361
-
362
-
363
-
364
-
365
-
366
-
367
-
368
-
369
-
370
-
371
- <h4 class="name" id="deployContract"><span class="type-signature">(async) </span>deployContract<span class="signature">()</span><span class="type-signature"></span></h4>
372
-
373
-
374
-
375
-
376
-
377
-
378
-
379
-
380
-
381
-
382
-
383
-
384
-
385
-
386
-
387
-
388
-
389
-
390
- <dl class="details">
391
-
392
-
393
-
394
-
395
-
396
-
397
-
398
-
399
-
400
-
401
-
402
-
403
-
404
-
405
-
406
-
407
-
408
-
409
-
410
-
411
-
412
-
413
-
414
-
415
-
416
-
417
- <dt class="tag-source">Source:</dt>
418
- <dd class="tag-source"><ul class="dummy"><li>
419
- <a href="chain.js.html">chain.js</a>, <a href="chain.js.html#line523">line 523</a>
420
- </li></ul></dd>
421
-
422
-
423
-
424
-
425
-
426
-
427
-
428
- </dl>
429
-
430
-
431
-
432
-
433
-
434
-
435
-
436
-
437
-
438
-
439
-
440
-
441
-
442
-
443
-
444
-
445
-
446
-
447
-
448
-
449
-
450
-
451
-
452
-
453
-
454
-
455
- </article>
456
-
457
- </section>
458
-
459
-
460
-
461
-
462
- </div>
463
-
464
- <nav>
465
- <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#addContract">addContract</a></li><li><a href="global.html#createTransaction">createTransaction</a></li><li><a href="global.html#createTransactionFrom">createTransactionFrom</a></li><li><a href="global.html#deployContract">deployContract</a></li></ul>
466
- </nav>
467
-
468
- <br class="clear">
469
-
470
- <footer>
471
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Thu May 26 2022 18:02:07 GMT+0200 (Midden-Europese zomertijd)
472
- </footer>
473
-
474
- <script> prettyPrint(); </script>
475
- <script src="scripts/linenumber.js"> </script>
476
- </body>
477
- </html>
@@ -1,69 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>JSDoc: Home</title>
6
-
7
- <script src="scripts/prettify/prettify.js"> </script>
8
- <script src="scripts/prettify/lang-css.js"> </script>
9
- <!--[if lt IE 9]>
10
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11
- <![endif]-->
12
- <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13
- <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14
- </head>
15
-
16
- <body>
17
-
18
- <div id="main">
19
-
20
- <h1 class="page-title">Home</h1>
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
- <h3>@leofcoin/chain 1.0.7</h3>
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
- <section>
46
- <article><p><a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/"><img alt="Creative Commons Licence" style="border-width:0" src="https://i.creativecommons.org/l/by-nc/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">Creative Commons Attribution-NonCommercial 4.0 International License</a>.</p></article>
47
- </section>
48
-
49
-
50
-
51
-
52
-
53
-
54
- </div>
55
-
56
- <nav>
57
- <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#addContract">addContract</a></li><li><a href="global.html#createTransaction">createTransaction</a></li><li><a href="global.html#createTransactionFrom">createTransactionFrom</a></li><li><a href="global.html#deployContract">deployContract</a></li></ul>
58
- </nav>
59
-
60
- <br class="clear">
61
-
62
- <footer>
63
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Thu May 26 2022 18:02:07 GMT+0200 (Midden-Europese zomertijd)
64
- </footer>
65
-
66
- <script> prettyPrint(); </script>
67
- <script src="scripts/linenumber.js"> </script>
68
- </body>
69
- </html>
@@ -1,180 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>JSDoc: Source: machine.js</title>
6
-
7
- <script src="scripts/prettify/prettify.js"> </script>
8
- <script src="scripts/prettify/lang-css.js"> </script>
9
- <!--[if lt IE 9]>
10
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11
- <![endif]-->
12
- <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13
- <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14
- </head>
15
-
16
- <body>
17
-
18
- <div id="main">
19
-
20
- <h1 class="page-title">Source: machine.js</h1>
21
-
22
-
23
-
24
-
25
-
26
-
27
- <section>
28
- <article>
29
- <pre class="prettyprint source linenums"><code>import vm from 'vm'
30
- import ContractMessage from './messages/contract'
31
- import TransactionMessage from './messages/transaction'
32
- import lib from './lib'
33
- // import State from './state'
34
-
35
- export default class Machine {
36
- #contracts = {}
37
- #nonces = {}
38
- constructor() {
39
- return this.#init()
40
- }
41
-
42
- #createMessage(sender = peernet.id) {
43
- return {
44
- sender,
45
- call: this.execute,
46
- staticCall: this.get.bind(this)
47
- }
48
- }
49
-
50
- async #init() {
51
- // return
52
- try {
53
- let contracts = [
54
- contractStore.get(lib.contractFactory),
55
- contractStore.get(lib.nativeToken),
56
- contractStore.get(lib.validators),
57
- contractStore.get(lib.nameService)
58
- ]
59
-
60
- contracts = await Promise.all(contracts)
61
- for (const contract of contracts) {
62
- const message = new ContractMessage(new Uint8Array(contract.buffer, contract.buffer.byteOffset, contract.buffer.byteLength))
63
- await this.#runContract(message)
64
- }
65
- } catch (e) {
66
- console.log(e);
67
- }
68
- // const transactions = await transactionStore.get()
69
- // console.log({transactions});
70
- // for (const key of Object.keys(transactions)) {
71
- // const message = new TransactionMessage(transactions[key])
72
- // console.log({message});
73
- // const {from, to, method, params} = message.decoded
74
- // globalThis.msg = this.#createMessage(from)
75
- //
76
- // console.log({from, to, method, params});
77
- // await this.execute(to, method, params)
78
- // }
79
- return this
80
- }
81
-
82
- async #runContract(contractMessage) {
83
- const params = contractMessage.decoded.constructorParameters
84
- try {
85
-
86
- const func = new Function(new TextDecoder().decode(contractMessage.decoded.contract))
87
- const Contract = func()
88
-
89
- globalThis.msg = this.#createMessage(contractMessage.decoded.creator)
90
- // globalThis.msg = {sender: contractMessage.decoded.creator}
91
- this.#contracts[contractMessage.hash] = new Contract(...params)
92
- debug(`loaded contract: ${contractMessage.hash}`);
93
- debug(`size: ${Math.round((contractMessage.encoded.length / 1024) * 100) / 100} kb`);
94
- } catch (e) {
95
- console.log(e);
96
- console.warn(`removing contract ${contractMessage.hash}`);
97
- await contractStore.delete(contractMessage.hash, contractMessage.encoded)
98
- }
99
- }
100
-
101
- /**
102
- * @params {ContractMessage} - contractMessage
103
- */
104
- async addContract(contractMessage) {
105
- if (!await contractStore.has(contractMessage.hash)) {
106
- await contractStore.put(contractMessage.hash, contractMessage.encoded)
107
- await this.#runContract(contractMessage)
108
- return contractMessage.hash
109
- }
110
- throw new Error('duplicate contract')
111
- }
112
-
113
- async execute(contract, method, params) {
114
- try {
115
- let result
116
- // don't execute the method on a proxy
117
- if (this.#contracts[contract].fallback) {
118
- result = this.#contracts[contract].fallback(method, params)
119
- } else {
120
- result = await this.#contracts[contract][method](...params)
121
- }
122
-
123
- // this.#state.put(result)
124
- return result
125
- } catch (e) {
126
- throw e
127
- }
128
- }
129
-
130
- addJob(contract, method, params, from, nonce) {
131
- if (!this.#nonces[from]) this.#nonces[from] = nonce
132
- if (nonce === this.#nonces[from] + 1) return this.#contracts[contract][method](...params)
133
- // return setTimeout(() => {
134
- // return this.addJob(contract, method, params, from, nonce)
135
- // }, 50)
136
- }
137
-
138
- get(contract, method, params) {
139
- let result
140
- if (params?.length > 0) {
141
- result = this.#contracts[contract][method](...params)
142
- } else {
143
- result = this.#contracts[contract][method]
144
- }
145
- return result
146
- }
147
-
148
- async delete(hash) {
149
- return contractStore.delete(hash)
150
- }
151
-
152
- async deleteAll() {
153
- let hashes = await contractStore.get()
154
- hashes = Object.keys(hashes).map(hash => this.delete(hash))
155
- return Promise.all(hashes)
156
- }
157
- }
158
- </code></pre>
159
- </article>
160
- </section>
161
-
162
-
163
-
164
-
165
- </div>
166
-
167
- <nav>
168
- <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#addContract">addContract</a></li><li><a href="global.html#createTransaction">createTransaction</a></li><li><a href="global.html#createTransactionFrom">createTransactionFrom</a></li><li><a href="global.html#deployContract">deployContract</a></li></ul>
169
- </nav>
170
-
171
- <br class="clear">
172
-
173
- <footer>
174
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Thu May 26 2022 18:02:07 GMT+0200 (Midden-Europese zomertijd)
175
- </footer>
176
-
177
- <script> prettyPrint(); </script>
178
- <script src="scripts/linenumber.js"> </script>
179
- </body>
180
- </html>