@leofcoin/chain 1.0.24 → 1.0.26

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/demo/151.browser.js +271 -0
  2. package/demo/205.browser.js +215 -0
  3. package/demo/427.browser.js +8092 -0
  4. package/demo/560.browser.js +3 -0
  5. package/demo/911.browser.js +11024 -0
  6. package/{dist → demo}/chain.browser.js +6765 -24164
  7. package/demo/index.html +4 -4
  8. package/demo/main.browser.js +8163 -0
  9. package/{dist → demo}/node.browser.js +3157 -2582
  10. package/{dist → demo}/pako.browser.js +0 -0
  11. package/demo/peernet-worker.browser.js +11330 -0
  12. package/demo/workers/machine-worker.js +12544 -0
  13. package/{dist → demo}/wrtc.browser.js +0 -0
  14. package/dist/chain.js +235 -143
  15. package/dist/module/chain.js +1189 -0
  16. package/dist/module/node.js +1 -0
  17. package/dist/module/workers/machine-worker.js +491 -0
  18. package/dist/node.js +1 -1
  19. package/package.json +11 -19
  20. package/rollup.config.js +87 -3
  21. package/src/chain.js +94 -61
  22. package/src/config/config.js +11 -16
  23. package/src/machine.js +96 -57
  24. package/src/node.js +2 -1
  25. package/src/workers/block-worker.js +71 -0
  26. package/src/workers/machine-worker.js +160 -0
  27. package/src/workers/pool-worker.js +37 -0
  28. package/src/workers/transaction-worker.js +26 -0
  29. package/test/chain.js +14 -14
  30. package/test/create-genesis.js +13 -5
  31. package/webpack.config.js +49 -6
  32. package/workers/block-worker.js +1 -0
  33. package/workers/machine-worker.js +1 -0
  34. package/workers/pool-worker.js +1 -0
  35. package/workers/transaction-worker.js +1 -0
  36. package/dist/protons.browser.js +0 -11429
  37. package/docs/@leofcoin/chain/1.0.22/chain.js.html +0 -891
  38. package/docs/@leofcoin/chain/1.0.22/contracts_factory.js.html +0 -182
  39. package/docs/@leofcoin/chain/1.0.22/contracts_nameService.js.html +0 -231
  40. package/docs/@leofcoin/chain/1.0.22/contracts_proxies_factoryProxy.js.html +0 -135
  41. package/docs/@leofcoin/chain/1.0.22/contracts_proxies_nameServiceProxy.js.html +0 -135
  42. package/docs/@leofcoin/chain/1.0.22/contracts_proxies_nativeTokenProxy.js.html +0 -135
  43. package/docs/@leofcoin/chain/1.0.22/contracts_proxies_validatorsProxy.js.html +0 -135
  44. package/docs/@leofcoin/chain/1.0.22/contracts_proxies_votingProxy.js.html +0 -135
  45. package/docs/@leofcoin/chain/1.0.22/contracts_validators.js.html +0 -242
  46. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Bold-webfont.eot +0 -0
  47. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Bold-webfont.svg +0 -1830
  48. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Bold-webfont.woff +0 -0
  49. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  50. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  51. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  52. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Italic-webfont.eot +0 -0
  53. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Italic-webfont.svg +0 -1830
  54. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Italic-webfont.woff +0 -0
  55. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Light-webfont.eot +0 -0
  56. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Light-webfont.svg +0 -1831
  57. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Light-webfont.woff +0 -0
  58. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  59. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  60. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  61. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Regular-webfont.eot +0 -0
  62. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Regular-webfont.svg +0 -1831
  63. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Regular-webfont.woff +0 -0
  64. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Semibold-webfont.eot +0 -0
  65. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Semibold-webfont.svg +0 -1830
  66. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  67. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-Semibold-webfont.woff +0 -0
  68. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  69. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
  70. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  71. package/docs/@leofcoin/chain/1.0.22/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  72. package/docs/@leofcoin/chain/1.0.22/global.html +0 -1805
  73. package/docs/@leofcoin/chain/1.0.22/icons/home.svg +0 -4
  74. package/docs/@leofcoin/chain/1.0.22/icons/search.svg +0 -4
  75. package/docs/@leofcoin/chain/1.0.22/index.html +0 -125
  76. package/docs/@leofcoin/chain/1.0.22/machine.js.html +0 -255
  77. package/docs/@leofcoin/chain/1.0.22/scripts/linenumber.js +0 -23
  78. package/docs/@leofcoin/chain/1.0.22/scripts/pagelocation.js +0 -89
  79. package/docs/@leofcoin/chain/1.0.22/standards_roles.js.html +0 -188
  80. package/docs/@leofcoin/chain/1.0.22/standards_token.js.html +0 -260
  81. package/docs/@leofcoin/chain/1.0.22/styles/collapse.css +0 -27
  82. package/docs/@leofcoin/chain/1.0.22/styles/jsdoc-default.css +0 -953
  83. package/docs/@leofcoin/chain/1.0.22/styles/prettify-jsdoc.css +0 -111
  84. package/docs/@leofcoin/chain/1.0.22/styles/prettify-tomorrow.css +0 -138
  85. package/docs/@leofcoin/chain/1.0.24/chain.js.html +0 -891
  86. package/docs/@leofcoin/chain/1.0.24/contracts_factory.js.html +0 -182
  87. package/docs/@leofcoin/chain/1.0.24/contracts_nameService.js.html +0 -231
  88. package/docs/@leofcoin/chain/1.0.24/contracts_proxies_factoryProxy.js.html +0 -135
  89. package/docs/@leofcoin/chain/1.0.24/contracts_proxies_nameServiceProxy.js.html +0 -135
  90. package/docs/@leofcoin/chain/1.0.24/contracts_proxies_nativeTokenProxy.js.html +0 -135
  91. package/docs/@leofcoin/chain/1.0.24/contracts_proxies_validatorsProxy.js.html +0 -135
  92. package/docs/@leofcoin/chain/1.0.24/contracts_proxies_votingProxy.js.html +0 -135
  93. package/docs/@leofcoin/chain/1.0.24/contracts_validators.js.html +0 -242
  94. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Bold-webfont.eot +0 -0
  95. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Bold-webfont.svg +0 -1830
  96. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Bold-webfont.woff +0 -0
  97. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  98. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  99. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  100. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Italic-webfont.eot +0 -0
  101. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Italic-webfont.svg +0 -1830
  102. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Italic-webfont.woff +0 -0
  103. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Light-webfont.eot +0 -0
  104. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Light-webfont.svg +0 -1831
  105. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Light-webfont.woff +0 -0
  106. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  107. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  108. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  109. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Regular-webfont.eot +0 -0
  110. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Regular-webfont.svg +0 -1831
  111. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Regular-webfont.woff +0 -0
  112. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Semibold-webfont.eot +0 -0
  113. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Semibold-webfont.svg +0 -1830
  114. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  115. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-Semibold-webfont.woff +0 -0
  116. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  117. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
  118. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  119. package/docs/@leofcoin/chain/1.0.24/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  120. package/docs/@leofcoin/chain/1.0.24/global.html +0 -1805
  121. package/docs/@leofcoin/chain/1.0.24/icons/home.svg +0 -4
  122. package/docs/@leofcoin/chain/1.0.24/icons/search.svg +0 -4
  123. package/docs/@leofcoin/chain/1.0.24/index.html +0 -125
  124. package/docs/@leofcoin/chain/1.0.24/machine.js.html +0 -255
  125. package/docs/@leofcoin/chain/1.0.24/scripts/linenumber.js +0 -23
  126. package/docs/@leofcoin/chain/1.0.24/scripts/pagelocation.js +0 -89
  127. package/docs/@leofcoin/chain/1.0.24/standards_roles.js.html +0 -188
  128. package/docs/@leofcoin/chain/1.0.24/standards_token.js.html +0 -260
  129. package/docs/@leofcoin/chain/1.0.24/styles/collapse.css +0 -27
  130. package/docs/@leofcoin/chain/1.0.24/styles/jsdoc-default.css +0 -953
  131. package/docs/@leofcoin/chain/1.0.24/styles/prettify-jsdoc.css +0 -111
  132. package/docs/@leofcoin/chain/1.0.24/styles/prettify-tomorrow.css +0 -138
@@ -0,0 +1,271 @@
1
+ /******/ var __webpack_modules__ = ({
2
+
3
+ /***/ 5602:
4
+ /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
5
+
6
+ /* harmony import */ var _leofcoin_peernet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7911);
7
+ /* harmony import */ var _leofcoin_peernet__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_leofcoin_peernet__WEBPACK_IMPORTED_MODULE_0__);
8
+ /* harmony import */ var _leofcoin_codec_format_interface__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3427);
9
+ class ContractMessage extends _leofcoin_codec_format_interface__WEBPACK_IMPORTED_MODULE_1__.FormatInterface{get keys(){return["creator","contract","constructorParameters"]}get messageName(){return"ContractMessage"}constructor(e){super(e,"\nmessage ContractMessage {\n required string creator = 1;\n required bytes contract = 2;\n repeated string constructorParameters = 3;\n}\n",{name:"contract-message"})}}class TransactionMessage extends _leofcoin_codec_format_interface__WEBPACK_IMPORTED_MODULE_1__.FormatInterface{get keys(){return["timestamp","from","to","nonce","method","params","signature"]}get messageName(){return"TransactionMessage"}constructor(e){super(e,"\n\nmessage TransactionMessage {\n required uint64 timestamp = 1;\n required string from = 2;\n required string to = 3;\n required uint64 nonce = 4;\n required string method = 5;\n repeated string params = 6;\n required string signature = 7;\n}\n",{name:"transaction-message"})}}class BlockMessage extends _leofcoin_codec_format_interface__WEBPACK_IMPORTED_MODULE_1__.FormatInterface{get keys(){return["index","previousHash","timestamp","reward","fees","transactions","validators"]}get messageName(){return"BlockMessage"}constructor(e){super(e,"\nmessage ValidatorMessage {\n required string address = 1;\n required string reward = 2;\n}\n\nmessage Transaction {\n required string hash = 1;\n required uint64 timestamp = 2;\n required string from = 3;\n required string to = 4;\n required uint64 nonce = 5;\n required string method = 6;\n repeated string params = 7;\n}\n\nmessage BlockMessage {\n required uint64 index = 1;\n required string previousHash = 3;\n required uint64 timestamp = 4;\n required uint64 reward = 5;\n required string fees = 6;\n repeated Transaction transactions = 7;\n repeated ValidatorMessage validators = 8;\n}\n",{name:"block-message"})}}class BWMessage extends _leofcoin_codec_format_interface__WEBPACK_IMPORTED_MODULE_1__.FormatInterface{get keys(){return["up","down"]}get messageName(){return"BWMessage"}constructor(e){super(e,"\n\nmessage BWMessage {\n required uint64 up = 1;\n required uint64 down = 2;\n}\n",{name:"bw-message"})}}class BWRequestMessage extends _leofcoin_codec_format_interface__WEBPACK_IMPORTED_MODULE_1__.FormatInterface{get keys(){return[]}get messageName(){return"BWRequestMessage"}constructor(e){super(e,"\n\nmessage BWRequestMessage {\n}\n",{name:"bw-request-message"})}}(async()=>{const s={network:"leofcoin",root:".leofcoin",networkName:"leofcoin:mandarine",networkVersion:"v0.1.0"};globalThis.Peernet?await new globalThis.Peernet(s):await new (_leofcoin_peernet__WEBPACK_IMPORTED_MODULE_0___default())(s),await(async()=>{await peernet.addProto("contract-message",ContractMessage),await peernet.addProto("transaction-message",TransactionMessage),await peernet.addProto("block-message",BlockMessage),await peernet.addProto("bw-message",BWMessage),await peernet.addProto("bw-request-message",BWRequestMessage),await peernet.addCodec("contract-message",{codec:parseInt("636d",16),hashAlg:"keccak-256"}),await peernet.addCodec("transaction-message",{codec:parseInt("746d",16),hashAlg:"keccak-256"}),await peernet.addCodec("block-message",{codec:parseInt("626d",16),hashAlg:"keccak-256"}),await peernet.addCodec("bw-message",{codec:parseInt("62776d",16),hashAlg:"keccak-256"}),await peernet.addCodec("bw-request-message",{codec:parseInt("6277726d",16),hashAlg:"keccak-256"}),await peernet.addStore("contract","art",".leofcoin",!1),await peernet.addStore("accounts","art",".leofcoin",!1),await peernet.addStore("transactionPool","art",".leofcoin",!1)})(),onmessage=function(e){console.log(e),postMessage("world")},postMessage("world")})();
10
+
11
+
12
+ /***/ }),
13
+
14
+ /***/ 2361:
15
+ /***/ (function() {
16
+
17
+ /* (ignored) */
18
+
19
+ /***/ }),
20
+
21
+ /***/ 4616:
22
+ /***/ (function() {
23
+
24
+ /* (ignored) */
25
+
26
+ /***/ })
27
+
28
+ /******/ });
29
+ /************************************************************************/
30
+ /******/ // The module cache
31
+ /******/ var __webpack_module_cache__ = {};
32
+ /******/
33
+ /******/ // The require function
34
+ /******/ function __webpack_require__(moduleId) {
35
+ /******/ // Check if module is in cache
36
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
37
+ /******/ if (cachedModule !== undefined) {
38
+ /******/ return cachedModule.exports;
39
+ /******/ }
40
+ /******/ // Create a new module (and put it into the cache)
41
+ /******/ var module = __webpack_module_cache__[moduleId] = {
42
+ /******/ // no module.id needed
43
+ /******/ // no module.loaded needed
44
+ /******/ exports: {}
45
+ /******/ };
46
+ /******/
47
+ /******/ // Execute the module function
48
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
49
+ /******/
50
+ /******/ // Return the exports of the module
51
+ /******/ return module.exports;
52
+ /******/ }
53
+ /******/
54
+ /******/ // expose the modules object (__webpack_modules__)
55
+ /******/ __webpack_require__.m = __webpack_modules__;
56
+ /******/
57
+ /******/ // the startup function
58
+ /******/ __webpack_require__.x = function() {
59
+ /******/ // Load entry module and return exports
60
+ /******/ // This entry module depends on other loaded chunks and execution need to be delayed
61
+ /******/ var __webpack_exports__ = __webpack_require__.O(undefined, [911], function() { return __webpack_require__(5602); })
62
+ /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
63
+ /******/ return __webpack_exports__;
64
+ /******/ };
65
+ /******/
66
+ /************************************************************************/
67
+ /******/ /* webpack/runtime/chunk loaded */
68
+ /******/ !function() {
69
+ /******/ var deferred = [];
70
+ /******/ __webpack_require__.O = function(result, chunkIds, fn, priority) {
71
+ /******/ if(chunkIds) {
72
+ /******/ priority = priority || 0;
73
+ /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
74
+ /******/ deferred[i] = [chunkIds, fn, priority];
75
+ /******/ return;
76
+ /******/ }
77
+ /******/ var notFulfilled = Infinity;
78
+ /******/ for (var i = 0; i < deferred.length; i++) {
79
+ /******/ var chunkIds = deferred[i][0];
80
+ /******/ var fn = deferred[i][1];
81
+ /******/ var priority = deferred[i][2];
82
+ /******/ var fulfilled = true;
83
+ /******/ for (var j = 0; j < chunkIds.length; j++) {
84
+ /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {
85
+ /******/ chunkIds.splice(j--, 1);
86
+ /******/ } else {
87
+ /******/ fulfilled = false;
88
+ /******/ if(priority < notFulfilled) notFulfilled = priority;
89
+ /******/ }
90
+ /******/ }
91
+ /******/ if(fulfilled) {
92
+ /******/ deferred.splice(i--, 1)
93
+ /******/ var r = fn();
94
+ /******/ if (r !== undefined) result = r;
95
+ /******/ }
96
+ /******/ }
97
+ /******/ return result;
98
+ /******/ };
99
+ /******/ }();
100
+ /******/
101
+ /******/ /* webpack/runtime/compat get default export */
102
+ /******/ !function() {
103
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
104
+ /******/ __webpack_require__.n = function(module) {
105
+ /******/ var getter = module && module.__esModule ?
106
+ /******/ function() { return module['default']; } :
107
+ /******/ function() { return module; };
108
+ /******/ __webpack_require__.d(getter, { a: getter });
109
+ /******/ return getter;
110
+ /******/ };
111
+ /******/ }();
112
+ /******/
113
+ /******/ /* webpack/runtime/create fake namespace object */
114
+ /******/ !function() {
115
+ /******/ var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; };
116
+ /******/ var leafPrototypes;
117
+ /******/ // create a fake namespace object
118
+ /******/ // mode & 1: value is a module id, require it
119
+ /******/ // mode & 2: merge all properties of value into the ns
120
+ /******/ // mode & 4: return value when already ns object
121
+ /******/ // mode & 16: return value when it's Promise-like
122
+ /******/ // mode & 8|1: behave like require
123
+ /******/ __webpack_require__.t = function(value, mode) {
124
+ /******/ if(mode & 1) value = this(value);
125
+ /******/ if(mode & 8) return value;
126
+ /******/ if(typeof value === 'object' && value) {
127
+ /******/ if((mode & 4) && value.__esModule) return value;
128
+ /******/ if((mode & 16) && typeof value.then === 'function') return value;
129
+ /******/ }
130
+ /******/ var ns = Object.create(null);
131
+ /******/ __webpack_require__.r(ns);
132
+ /******/ var def = {};
133
+ /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
134
+ /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
135
+ /******/ Object.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; });
136
+ /******/ }
137
+ /******/ def['default'] = function() { return value; };
138
+ /******/ __webpack_require__.d(ns, def);
139
+ /******/ return ns;
140
+ /******/ };
141
+ /******/ }();
142
+ /******/
143
+ /******/ /* webpack/runtime/define property getters */
144
+ /******/ !function() {
145
+ /******/ // define getter functions for harmony exports
146
+ /******/ __webpack_require__.d = function(exports, definition) {
147
+ /******/ for(var key in definition) {
148
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
149
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
150
+ /******/ }
151
+ /******/ }
152
+ /******/ };
153
+ /******/ }();
154
+ /******/
155
+ /******/ /* webpack/runtime/ensure chunk */
156
+ /******/ !function() {
157
+ /******/ __webpack_require__.f = {};
158
+ /******/ // This file contains only the entry chunk.
159
+ /******/ // The chunk loading function for additional chunks
160
+ /******/ __webpack_require__.e = function(chunkId) {
161
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {
162
+ /******/ __webpack_require__.f[key](chunkId, promises);
163
+ /******/ return promises;
164
+ /******/ }, []));
165
+ /******/ };
166
+ /******/ }();
167
+ /******/
168
+ /******/ /* webpack/runtime/get javascript chunk filename */
169
+ /******/ !function() {
170
+ /******/ // This function allow to reference async chunks and sibling chunks for the entrypoint
171
+ /******/ __webpack_require__.u = function(chunkId) {
172
+ /******/ // return url for filenames based on template
173
+ /******/ return "" + ({"228":"wrtc","682":"pako"}[chunkId] || chunkId) + ".browser.js";
174
+ /******/ };
175
+ /******/ }();
176
+ /******/
177
+ /******/ /* webpack/runtime/global */
178
+ /******/ !function() {
179
+ /******/ __webpack_require__.g = (function() {
180
+ /******/ if (typeof globalThis === 'object') return globalThis;
181
+ /******/ try {
182
+ /******/ return this || new Function('return this')();
183
+ /******/ } catch (e) {
184
+ /******/ if (typeof window === 'object') return window;
185
+ /******/ }
186
+ /******/ })();
187
+ /******/ }();
188
+ /******/
189
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
190
+ /******/ !function() {
191
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
192
+ /******/ }();
193
+ /******/
194
+ /******/ /* webpack/runtime/make namespace object */
195
+ /******/ !function() {
196
+ /******/ // define __esModule on exports
197
+ /******/ __webpack_require__.r = function(exports) {
198
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
199
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
200
+ /******/ }
201
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
202
+ /******/ };
203
+ /******/ }();
204
+ /******/
205
+ /******/ /* webpack/runtime/publicPath */
206
+ /******/ !function() {
207
+ /******/ var scriptUrl;
208
+ /******/ if (typeof import.meta.url === "string") scriptUrl = import.meta.url
209
+ /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
210
+ /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
211
+ /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
212
+ /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
213
+ /******/ __webpack_require__.p = scriptUrl;
214
+ /******/ }();
215
+ /******/
216
+ /******/ /* webpack/runtime/importScripts chunk loading */
217
+ /******/ !function() {
218
+ /******/ // no baseURI
219
+ /******/
220
+ /******/ // object to store loaded chunks
221
+ /******/ // "1" means "already loaded"
222
+ /******/ var installedChunks = {
223
+ /******/ 151: 1
224
+ /******/ };
225
+ /******/
226
+ /******/ // importScripts chunk loading
227
+ /******/ var installChunk = function(data) {
228
+ /******/ var chunkIds = data[0];
229
+ /******/ var moreModules = data[1];
230
+ /******/ var runtime = data[2];
231
+ /******/ for(var moduleId in moreModules) {
232
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
233
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
234
+ /******/ }
235
+ /******/ }
236
+ /******/ if(runtime) runtime(__webpack_require__);
237
+ /******/ while(chunkIds.length)
238
+ /******/ installedChunks[chunkIds.pop()] = 1;
239
+ /******/ parentChunkLoadingFunction(data);
240
+ /******/ };
241
+ /******/ __webpack_require__.f.i = function(chunkId, promises) {
242
+ /******/ // "1" is the signal for "already loaded"
243
+ /******/ if(!installedChunks[chunkId]) {
244
+ /******/ if(true) { // all chunks have JS
245
+ /******/ importScripts(__webpack_require__.p + __webpack_require__.u(chunkId));
246
+ /******/ }
247
+ /******/ }
248
+ /******/ };
249
+ /******/
250
+ /******/ var chunkLoadingGlobal = self["webpackChunk_leofcoin_chain"] = self["webpackChunk_leofcoin_chain"] || [];
251
+ /******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);
252
+ /******/ chunkLoadingGlobal.push = installChunk;
253
+ /******/
254
+ /******/ // no HMR
255
+ /******/
256
+ /******/ // no HMR manifest
257
+ /******/ }();
258
+ /******/
259
+ /******/ /* webpack/runtime/startup chunk dependencies */
260
+ /******/ !function() {
261
+ /******/ var next = __webpack_require__.x;
262
+ /******/ __webpack_require__.x = function() {
263
+ /******/ return __webpack_require__.e(911).then(next);
264
+ /******/ };
265
+ /******/ }();
266
+ /******/
267
+ /************************************************************************/
268
+ /******/
269
+ /******/ // run startup
270
+ /******/ var __webpack_exports__ = __webpack_require__.x();
271
+ /******/
@@ -0,0 +1,215 @@
1
+ /******/ var __webpack_modules__ = ({
2
+
3
+ /***/ 560:
4
+ /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
5
+
6
+ /* harmony import */ var _leofcoin_codec_format_interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3427);
7
+ class ContractMessage extends _leofcoin_codec_format_interface__WEBPACK_IMPORTED_MODULE_0__.FormatInterface{get keys(){return["creator","contract","constructorParameters"]}get messageName(){return"ContractMessage"}constructor(e){super(e,"\nmessage ContractMessage {\n required string creator = 1;\n required bytes contract = 2;\n repeated string constructorParameters = 3;\n}\n",{name:"contract-message"})}}class TransactionMessage extends _leofcoin_codec_format_interface__WEBPACK_IMPORTED_MODULE_0__.FormatInterface{get keys(){return["timestamp","from","to","nonce","method","params","signature"]}get messageName(){return"TransactionMessage"}constructor(e){super(e,"\n\nmessage TransactionMessage {\n required uint64 timestamp = 1;\n required string from = 2;\n required string to = 3;\n required uint64 nonce = 4;\n required string method = 5;\n repeated string params = 6;\n required string signature = 7;\n}\n",{name:"transaction-message"})}}class BlockMessage extends _leofcoin_codec_format_interface__WEBPACK_IMPORTED_MODULE_0__.FormatInterface{get keys(){return["index","previousHash","timestamp","reward","fees","transactions","validators"]}get messageName(){return"BlockMessage"}constructor(e){super(e,"\nmessage ValidatorMessage {\n required string address = 1;\n required string reward = 2;\n}\n\nmessage Transaction {\n required string hash = 1;\n required uint64 timestamp = 2;\n required string from = 3;\n required string to = 4;\n required uint64 nonce = 5;\n required string method = 6;\n repeated string params = 7;\n}\n\nmessage BlockMessage {\n required uint64 index = 1;\n required string previousHash = 3;\n required uint64 timestamp = 4;\n required uint64 reward = 5;\n required string fees = 6;\n repeated Transaction transactions = 7;\n repeated ValidatorMessage validators = 8;\n}\n",{name:"block-message"})}}const t={},a=(e=globalThis.peerid)=>({sender:e,call:(void 0).execute,staticCall:(void 0).get.bind(void 0)}),r=async e=>{const r=e.decoded.constructorParameters;try{const s=new Function(e.decoded.contract)();globalThis.msg=a(e.decoded.creator),t[await e.hash]=await new s(...r),debug(`loaded contract: ${await e.hash}`),debug(`size: ${formatBytes(e.encoded.length)}`)}catch(t){console.log(t),console.warn(`removing contract ${await e.hash}`),await contractStore.delete(await e.hash,e.encoded)}},s=async(e,a,r)=>{try{let s;return s=t[e].fallback?await t[e].fallback(a,r):await t[e][a](...r),s}catch(e){throw e}};onmessage=function(e){console.log(e.data),"init"===e.data.type&&(async({contracts:e,blocks:t,peerid:n})=>{globalThis.peerid=n;try{for(const t of e){const e=await new ContractMessage(t);await r(e)}}catch(e){console.log(e)}(t=(t=await Promise.all(t.map((e=>new BlockMessage(e))))).sort(((e,t)=>e.decoded.timestamp-t.decoded.timestamp))).forEach((async e=>{const t=e.encoded.length||e.encoded.byteLength;console.log(`loaded block: ${await e.hash} @${e.decoded.index} ${formatBytes(t)}`)}));const o=t.reduce(((e,t)=>[...e,...t.decoded.transactions]),[]);for(const e of o){const t=await new TransactionMessage(e),{from:r,to:n,method:o,params:i}=t.decoded;globalThis.msg=a(r),await s(n,o,i)}})(e.data.params),postMessage("world")},postMessage("world");
8
+
9
+
10
+ /***/ }),
11
+
12
+ /***/ 2361:
13
+ /***/ (function() {
14
+
15
+ /* (ignored) */
16
+
17
+ /***/ }),
18
+
19
+ /***/ 4616:
20
+ /***/ (function() {
21
+
22
+ /* (ignored) */
23
+
24
+ /***/ })
25
+
26
+ /******/ });
27
+ /************************************************************************/
28
+ /******/ // The module cache
29
+ /******/ var __webpack_module_cache__ = {};
30
+ /******/
31
+ /******/ // The require function
32
+ /******/ function __webpack_require__(moduleId) {
33
+ /******/ // Check if module is in cache
34
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
35
+ /******/ if (cachedModule !== undefined) {
36
+ /******/ return cachedModule.exports;
37
+ /******/ }
38
+ /******/ // Create a new module (and put it into the cache)
39
+ /******/ var module = __webpack_module_cache__[moduleId] = {
40
+ /******/ // no module.id needed
41
+ /******/ // no module.loaded needed
42
+ /******/ exports: {}
43
+ /******/ };
44
+ /******/
45
+ /******/ // Execute the module function
46
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
47
+ /******/
48
+ /******/ // Return the exports of the module
49
+ /******/ return module.exports;
50
+ /******/ }
51
+ /******/
52
+ /******/ // expose the modules object (__webpack_modules__)
53
+ /******/ __webpack_require__.m = __webpack_modules__;
54
+ /******/
55
+ /******/ // the startup function
56
+ /******/ __webpack_require__.x = function() {
57
+ /******/ // Load entry module and return exports
58
+ /******/ // This entry module depends on other loaded chunks and execution need to be delayed
59
+ /******/ var __webpack_exports__ = __webpack_require__.O(undefined, [427], function() { return __webpack_require__(560); })
60
+ /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
61
+ /******/ return __webpack_exports__;
62
+ /******/ };
63
+ /******/
64
+ /************************************************************************/
65
+ /******/ /* webpack/runtime/chunk loaded */
66
+ /******/ !function() {
67
+ /******/ var deferred = [];
68
+ /******/ __webpack_require__.O = function(result, chunkIds, fn, priority) {
69
+ /******/ if(chunkIds) {
70
+ /******/ priority = priority || 0;
71
+ /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
72
+ /******/ deferred[i] = [chunkIds, fn, priority];
73
+ /******/ return;
74
+ /******/ }
75
+ /******/ var notFulfilled = Infinity;
76
+ /******/ for (var i = 0; i < deferred.length; i++) {
77
+ /******/ var chunkIds = deferred[i][0];
78
+ /******/ var fn = deferred[i][1];
79
+ /******/ var priority = deferred[i][2];
80
+ /******/ var fulfilled = true;
81
+ /******/ for (var j = 0; j < chunkIds.length; j++) {
82
+ /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {
83
+ /******/ chunkIds.splice(j--, 1);
84
+ /******/ } else {
85
+ /******/ fulfilled = false;
86
+ /******/ if(priority < notFulfilled) notFulfilled = priority;
87
+ /******/ }
88
+ /******/ }
89
+ /******/ if(fulfilled) {
90
+ /******/ deferred.splice(i--, 1)
91
+ /******/ var r = fn();
92
+ /******/ if (r !== undefined) result = r;
93
+ /******/ }
94
+ /******/ }
95
+ /******/ return result;
96
+ /******/ };
97
+ /******/ }();
98
+ /******/
99
+ /******/ /* webpack/runtime/ensure chunk */
100
+ /******/ !function() {
101
+ /******/ __webpack_require__.f = {};
102
+ /******/ // This file contains only the entry chunk.
103
+ /******/ // The chunk loading function for additional chunks
104
+ /******/ __webpack_require__.e = function(chunkId) {
105
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {
106
+ /******/ __webpack_require__.f[key](chunkId, promises);
107
+ /******/ return promises;
108
+ /******/ }, []));
109
+ /******/ };
110
+ /******/ }();
111
+ /******/
112
+ /******/ /* webpack/runtime/get javascript chunk filename */
113
+ /******/ !function() {
114
+ /******/ // This function allow to reference async chunks and sibling chunks for the entrypoint
115
+ /******/ __webpack_require__.u = function(chunkId) {
116
+ /******/ // return url for filenames based on template
117
+ /******/ return "" + chunkId + ".browser.js";
118
+ /******/ };
119
+ /******/ }();
120
+ /******/
121
+ /******/ /* webpack/runtime/global */
122
+ /******/ !function() {
123
+ /******/ __webpack_require__.g = (function() {
124
+ /******/ if (typeof globalThis === 'object') return globalThis;
125
+ /******/ try {
126
+ /******/ return this || new Function('return this')();
127
+ /******/ } catch (e) {
128
+ /******/ if (typeof window === 'object') return window;
129
+ /******/ }
130
+ /******/ })();
131
+ /******/ }();
132
+ /******/
133
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
134
+ /******/ !function() {
135
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
136
+ /******/ }();
137
+ /******/
138
+ /******/ /* webpack/runtime/make namespace object */
139
+ /******/ !function() {
140
+ /******/ // define __esModule on exports
141
+ /******/ __webpack_require__.r = function(exports) {
142
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
143
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
144
+ /******/ }
145
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
146
+ /******/ };
147
+ /******/ }();
148
+ /******/
149
+ /******/ /* webpack/runtime/publicPath */
150
+ /******/ !function() {
151
+ /******/ var scriptUrl;
152
+ /******/ if (typeof import.meta.url === "string") scriptUrl = import.meta.url
153
+ /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
154
+ /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
155
+ /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
156
+ /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
157
+ /******/ __webpack_require__.p = scriptUrl;
158
+ /******/ }();
159
+ /******/
160
+ /******/ /* webpack/runtime/importScripts chunk loading */
161
+ /******/ !function() {
162
+ /******/ // no baseURI
163
+ /******/
164
+ /******/ // object to store loaded chunks
165
+ /******/ // "1" means "already loaded"
166
+ /******/ var installedChunks = {
167
+ /******/ 205: 1
168
+ /******/ };
169
+ /******/
170
+ /******/ // importScripts chunk loading
171
+ /******/ var installChunk = function(data) {
172
+ /******/ var chunkIds = data[0];
173
+ /******/ var moreModules = data[1];
174
+ /******/ var runtime = data[2];
175
+ /******/ for(var moduleId in moreModules) {
176
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
177
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
178
+ /******/ }
179
+ /******/ }
180
+ /******/ if(runtime) runtime(__webpack_require__);
181
+ /******/ while(chunkIds.length)
182
+ /******/ installedChunks[chunkIds.pop()] = 1;
183
+ /******/ parentChunkLoadingFunction(data);
184
+ /******/ };
185
+ /******/ __webpack_require__.f.i = function(chunkId, promises) {
186
+ /******/ // "1" is the signal for "already loaded"
187
+ /******/ if(!installedChunks[chunkId]) {
188
+ /******/ if(true) { // all chunks have JS
189
+ /******/ importScripts(__webpack_require__.p + __webpack_require__.u(chunkId));
190
+ /******/ }
191
+ /******/ }
192
+ /******/ };
193
+ /******/
194
+ /******/ var chunkLoadingGlobal = self["webpackChunk_leofcoin_chain"] = self["webpackChunk_leofcoin_chain"] || [];
195
+ /******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);
196
+ /******/ chunkLoadingGlobal.push = installChunk;
197
+ /******/
198
+ /******/ // no HMR
199
+ /******/
200
+ /******/ // no HMR manifest
201
+ /******/ }();
202
+ /******/
203
+ /******/ /* webpack/runtime/startup chunk dependencies */
204
+ /******/ !function() {
205
+ /******/ var next = __webpack_require__.x;
206
+ /******/ __webpack_require__.x = function() {
207
+ /******/ return __webpack_require__.e(427).then(next);
208
+ /******/ };
209
+ /******/ }();
210
+ /******/
211
+ /************************************************************************/
212
+ /******/
213
+ /******/ // run startup
214
+ /******/ var __webpack_exports__ = __webpack_require__.x();
215
+ /******/