@leofcoin/messages 1.1.0 → 1.1.3
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.
- package/dist/messages.esm +1531 -1677
- package/dist/messages.js +65 -55
- package/package.json +21 -21
- package/src/messages/bw-request.js +1 -1
- package/src/messages/bw.js +1 -1
- package/src/messages/contract.js +1 -1
- package/src/messages/last-block-request.js +1 -1
- package/src/messages/last-block.js +1 -1
- package/src/messages/transaction.js +2 -2
- package/src/messages.js +5 -5
- package/src/protos/transaction.proto.js +1 -0
package/dist/messages.esm
CHANGED
|
@@ -1,599 +1,1377 @@
|
|
|
1
1
|
/******/ var __webpack_modules__ = ({
|
|
2
2
|
|
|
3
|
-
/***/
|
|
4
|
-
/***/ ((
|
|
5
|
-
|
|
6
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
7
|
-
//
|
|
8
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
9
|
-
// copy of this software and associated documentation files (the
|
|
10
|
-
// "Software"), to deal in the Software without restriction, including
|
|
11
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
12
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
13
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
14
|
-
// following conditions:
|
|
15
|
-
//
|
|
16
|
-
// The above copyright notice and this permission notice shall be included
|
|
17
|
-
// in all copies or substantial portions of the Software.
|
|
18
|
-
//
|
|
19
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
20
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
21
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
22
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
23
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
24
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
25
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var R = typeof Reflect === 'object' ? Reflect : null
|
|
30
|
-
var ReflectApply = R && typeof R.apply === 'function'
|
|
31
|
-
? R.apply
|
|
32
|
-
: function ReflectApply(target, receiver, args) {
|
|
33
|
-
return Function.prototype.apply.call(target, receiver, args);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var ReflectOwnKeys
|
|
37
|
-
if (R && typeof R.ownKeys === 'function') {
|
|
38
|
-
ReflectOwnKeys = R.ownKeys
|
|
39
|
-
} else if (Object.getOwnPropertySymbols) {
|
|
40
|
-
ReflectOwnKeys = function ReflectOwnKeys(target) {
|
|
41
|
-
return Object.getOwnPropertyNames(target)
|
|
42
|
-
.concat(Object.getOwnPropertySymbols(target));
|
|
43
|
-
};
|
|
44
|
-
} else {
|
|
45
|
-
ReflectOwnKeys = function ReflectOwnKeys(target) {
|
|
46
|
-
return Object.getOwnPropertyNames(target);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
3
|
+
/***/ 427:
|
|
4
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
49
5
|
|
|
50
|
-
|
|
51
|
-
if (console && console.warn) console.warn(warning);
|
|
52
|
-
}
|
|
6
|
+
var __webpack_unused_export__;
|
|
53
7
|
|
|
54
|
-
var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
|
|
55
|
-
return value !== value;
|
|
56
|
-
}
|
|
57
8
|
|
|
58
|
-
|
|
59
|
-
EventEmitter.init.call(this);
|
|
60
|
-
}
|
|
61
|
-
module.exports = EventEmitter;
|
|
62
|
-
module.exports.once = once;
|
|
9
|
+
__webpack_unused_export__ = ({ value: true });
|
|
63
10
|
|
|
64
|
-
|
|
65
|
-
|
|
11
|
+
var bs32 = __webpack_require__(894);
|
|
12
|
+
var bs58 = __webpack_require__(158);
|
|
13
|
+
var isHex = __webpack_require__(187);
|
|
14
|
+
var varint = __webpack_require__(676);
|
|
15
|
+
var createKeccakHash = __webpack_require__(811);
|
|
66
16
|
|
|
67
|
-
|
|
68
|
-
EventEmitter.prototype._eventsCount = 0;
|
|
69
|
-
EventEmitter.prototype._maxListeners = undefined;
|
|
17
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
70
18
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var
|
|
19
|
+
var bs32__default = /*#__PURE__*/_interopDefaultLegacy(bs32);
|
|
20
|
+
var bs58__default = /*#__PURE__*/_interopDefaultLegacy(bs58);
|
|
21
|
+
var isHex__default = /*#__PURE__*/_interopDefaultLegacy(isHex);
|
|
22
|
+
var varint__default = /*#__PURE__*/_interopDefaultLegacy(varint);
|
|
23
|
+
var createKeccakHash__default = /*#__PURE__*/_interopDefaultLegacy(createKeccakHash);
|
|
74
24
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
throw new
|
|
78
|
-
|
|
25
|
+
class BasicInterface$1 {
|
|
26
|
+
handleDecode() {
|
|
27
|
+
if (!this.decode) throw new Error('bad implementation: needs decode func')
|
|
28
|
+
return this.decode()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
handleEncode() {
|
|
32
|
+
if (!this.encode) throw new Error('bad implementation: needs encode func')
|
|
33
|
+
return this.encode()
|
|
34
|
+
}
|
|
35
|
+
isHex(string) {
|
|
36
|
+
return isHex__default["default"](string)
|
|
37
|
+
}
|
|
38
|
+
isBase32(string) {
|
|
39
|
+
return bs32__default["default"].isBase32(string)
|
|
40
|
+
}
|
|
41
|
+
isBase58(string) {
|
|
42
|
+
return bs58__default["default"].isBase58(string)
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @param {String} encoded
|
|
46
|
+
*/
|
|
47
|
+
fromBs32(encoded) {
|
|
48
|
+
this.encoded = bs32__default["default"].decode(encoded);
|
|
49
|
+
return this.handleDecode()
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @param {String} encoded
|
|
54
|
+
*/
|
|
55
|
+
fromBs58(encoded) {
|
|
56
|
+
this.encoded = bs58__default["default"].decode(encoded);
|
|
57
|
+
return this.handleDecode()
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async toArray() {
|
|
61
|
+
const array = [];
|
|
62
|
+
for await (const value of this.encoded.values()) {
|
|
63
|
+
array.push(value);
|
|
64
|
+
}
|
|
65
|
+
return array
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
fromString(string) {
|
|
69
|
+
this.encoded = new Uint8Array(string.split(','));
|
|
70
|
+
return this.handleDecode()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
fromArray(array) {
|
|
74
|
+
this.encoded = new Uint8Array([...array]);
|
|
75
|
+
return this.handleDecode()
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @param {Buffer} encoded
|
|
80
|
+
*/
|
|
81
|
+
fromEncoded(encoded) {
|
|
82
|
+
this.encoded = encoded;
|
|
83
|
+
return this.handleDecode()
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @param {String} encoded
|
|
88
|
+
*/
|
|
89
|
+
fromHex(encoded) {
|
|
90
|
+
this.encoded = Buffer.from(encoded, 'hex');
|
|
91
|
+
return this.handleDecode()
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async toString(encoding = 'utf8') {
|
|
95
|
+
if (!this.encoded) await this.handleEncode();
|
|
96
|
+
return this.encoded.toString(encoding)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @return {String} encoded
|
|
101
|
+
*/
|
|
102
|
+
toHex() {
|
|
103
|
+
return this.toString('hex')
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @return {String} encoded
|
|
108
|
+
*/
|
|
109
|
+
async toBs32() {
|
|
110
|
+
if (!this.encoded) await this.handleEncode();
|
|
111
|
+
return bs32__default["default"].encode(this.encoded)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @return {String} encoded
|
|
116
|
+
*/
|
|
117
|
+
async toBs58() {
|
|
118
|
+
if (!this.encoded) await this.handleEncode();
|
|
119
|
+
return bs58__default["default"].encode(this.encoded)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @param {Object} data
|
|
124
|
+
*/
|
|
125
|
+
create(data) {
|
|
126
|
+
const decoded = {};
|
|
127
|
+
if (this.keys?.length > 0) {
|
|
128
|
+
for (const key of this.keys) {
|
|
129
|
+
Object.defineProperties(decoded, {
|
|
130
|
+
[key]: {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
configurable: true,
|
|
133
|
+
set: (val) => value = data[key],
|
|
134
|
+
get: () => data[key]
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
this.decoded = decoded;
|
|
140
|
+
return this.encode()
|
|
141
|
+
}
|
|
142
|
+
}
|
|
79
143
|
}
|
|
80
144
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
145
|
+
var codecs = {
|
|
146
|
+
// just a hash
|
|
147
|
+
'disco-hash': {
|
|
148
|
+
codec: parseInt('30', 16),
|
|
149
|
+
hashAlg: 'dbl-keccak-256', // ,
|
|
150
|
+
// testnet: 'olivia'
|
|
151
|
+
},
|
|
152
|
+
'peernet-peer-response': {
|
|
153
|
+
codec: parseInt('707072', 16),
|
|
154
|
+
hashAlg: 'keccak-256',
|
|
155
|
+
},
|
|
156
|
+
'peernet-peer': {
|
|
157
|
+
codec: parseInt('7070', 16),
|
|
158
|
+
hashAlg: 'keccak-256',
|
|
159
|
+
},
|
|
160
|
+
'peernet-dht': {
|
|
161
|
+
codec: parseInt('706468', 16),
|
|
162
|
+
hashAlg: 'keccak-256',
|
|
163
|
+
},
|
|
164
|
+
'peernet-dht-response': {
|
|
165
|
+
codec: parseInt('706472', 16),
|
|
166
|
+
hashAlg: 'keccak-256',
|
|
167
|
+
},
|
|
168
|
+
// data
|
|
169
|
+
'peernet-data': {
|
|
170
|
+
codec: parseInt('706461', 16),
|
|
171
|
+
hashAlg: 'keccak-256',
|
|
172
|
+
},
|
|
173
|
+
'peernet-data-response': {
|
|
174
|
+
codec: parseInt('70646172', 16),
|
|
175
|
+
hashAlg: 'keccak-256',
|
|
176
|
+
},
|
|
177
|
+
// message
|
|
178
|
+
'peernet-message': {
|
|
179
|
+
codec: parseInt('706d65', 16),
|
|
180
|
+
hashAlg: 'keccak-256',
|
|
181
|
+
},
|
|
182
|
+
// pubsub
|
|
183
|
+
'peernet-ps': {
|
|
184
|
+
codec: parseInt('707073', 16),
|
|
185
|
+
hashAlg: 'keccak-256',
|
|
186
|
+
},
|
|
187
|
+
'peernet-response': {
|
|
188
|
+
codec: parseInt('7072', 16),
|
|
189
|
+
hashAlg: 'keccak-256',
|
|
190
|
+
},
|
|
191
|
+
'peernet-request': {
|
|
192
|
+
codec: parseInt('707271', 16),
|
|
193
|
+
hashAlg: 'keccak-256',
|
|
194
|
+
},
|
|
195
|
+
// normal block
|
|
196
|
+
'leofcoin-block': {
|
|
197
|
+
codec: parseInt('6c62', 16),
|
|
198
|
+
hashAlg: 'dbl-keccak-512', // ,
|
|
199
|
+
// testnet: 'olivia'
|
|
200
|
+
},
|
|
201
|
+
'leofcoin-tx': {
|
|
202
|
+
codec: parseInt('6c74', 16),
|
|
203
|
+
hashAlg: 'dbl-keccak-512', // ,
|
|
204
|
+
// testnet: 'olivia'
|
|
205
|
+
},
|
|
206
|
+
// itx
|
|
207
|
+
'leofcoin-itx': {
|
|
208
|
+
codec: parseInt('6c69', 16),
|
|
209
|
+
hashAlg: 'keccak-512', // ,
|
|
210
|
+
// testnet: 'olivia'
|
|
211
|
+
},
|
|
212
|
+
// peer reputation
|
|
213
|
+
'leofcoin-pr': {
|
|
214
|
+
codec: parseInt('6c70', 16),
|
|
215
|
+
hashAlg: 'keccak-256', // ,
|
|
216
|
+
// testnet: 'olivia'
|
|
217
|
+
},
|
|
218
|
+
// chat message
|
|
219
|
+
'chat-message': {
|
|
220
|
+
codec: parseInt('636d', 16),
|
|
221
|
+
hashAlg: 'dbl-keccak-256',
|
|
222
|
+
},
|
|
223
|
+
'peernet-file' : {
|
|
224
|
+
codec: parseInt('7066', 16),
|
|
225
|
+
hashAlg: 'keccak-256',
|
|
226
|
+
},
|
|
227
|
+
'peernet-file-response' : {
|
|
228
|
+
codec: parseInt('706672', 16),
|
|
229
|
+
hashAlg: 'keccak-256',
|
|
230
|
+
}
|
|
231
|
+
};
|
|
95
232
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
233
|
+
class PeernetCodec extends BasicInterface$1 {
|
|
234
|
+
get codecs() {
|
|
235
|
+
return {...globalThis.peernet.codecs, ...codecs}
|
|
236
|
+
}
|
|
237
|
+
constructor(buffer) {
|
|
238
|
+
super();
|
|
239
|
+
if (buffer) {
|
|
240
|
+
if (buffer instanceof Uint8Array) {
|
|
241
|
+
const codec = varint__default["default"].decode(buffer);
|
|
242
|
+
const name = this.getCodecName(codec);
|
|
243
|
+
if (name) {
|
|
244
|
+
this.name = name;
|
|
245
|
+
this.encoded = buffer;
|
|
246
|
+
this.decode(buffer);
|
|
247
|
+
} else {
|
|
248
|
+
this.encode(buffer);
|
|
249
|
+
}
|
|
250
|
+
} else if (buffer instanceof ArrayBuffer) {
|
|
251
|
+
const encoded = new Uint8Array(buffer.byteLength);
|
|
252
|
+
|
|
253
|
+
for (let i = 0; i < buffer.byteLength; i++) {
|
|
254
|
+
encoded[i] = buffer[i];
|
|
255
|
+
}
|
|
256
|
+
this.encoded = encoded;
|
|
257
|
+
// this.encoded = new Uint8Array(buffer, buffer.byteOffset, buffer.byteLength)
|
|
258
|
+
this.decode(buffer);
|
|
259
|
+
return
|
|
260
|
+
}
|
|
261
|
+
if (typeof buffer === 'string') {
|
|
262
|
+
if (this.codecs[buffer]) this.fromName(buffer);
|
|
263
|
+
else if (this.isHex(buffer)) this.fromHex(buffer);
|
|
264
|
+
else if (this.isBase32(buffer)) this.fromBs32(buffer);
|
|
265
|
+
else if (this.isBase58(buffer)) this.fromBs58(buffer);
|
|
266
|
+
else throw new Error(`unsupported string ${buffer}`)
|
|
267
|
+
}
|
|
268
|
+
if (!isNaN(buffer)) if (this.codecs[this.getCodecName(buffer)]) this.fromCodec(buffer);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
fromEncoded(encoded) {
|
|
273
|
+
const codec = varint__default["default"].decode(encoded);
|
|
274
|
+
const name = this.getCodecName(codec);
|
|
275
|
+
this.name = name;
|
|
276
|
+
this.encoded = encoded;
|
|
277
|
+
this.decode(encoded);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
getCodec(name) {
|
|
281
|
+
return this.codecs[name].codec
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
getCodecName(codec) {
|
|
285
|
+
return Object.keys(this.codecs).reduce((p, c) => {
|
|
286
|
+
const item = this.codecs[c];
|
|
287
|
+
if (item.codec === codec) return c;
|
|
288
|
+
else return p;
|
|
289
|
+
}, undefined)
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
getHashAlg(name) {
|
|
293
|
+
return this.codecs[name].hashAlg
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
fromCodec(codec) {
|
|
297
|
+
this.name = this.getCodecName(codec);
|
|
298
|
+
this.hashAlg = this.getHashAlg(this.name);
|
|
299
|
+
|
|
300
|
+
this.codec = this.getCodec(this.name);
|
|
301
|
+
this.codecBuffer = varint__default["default"].encode(codec);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
fromName(name) {
|
|
305
|
+
const codec = this.getCodec(name);
|
|
306
|
+
this.name = name;
|
|
307
|
+
this.codec = codec;
|
|
308
|
+
this.hashAlg = this.getHashAlg(name);
|
|
309
|
+
this.codecBuffer = varint__default["default"].encode(codec);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
decode() {
|
|
313
|
+
const codec = varint__default["default"].decode(this.encoded);
|
|
314
|
+
this.fromCodec(codec);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
encode() {
|
|
318
|
+
const codec = varint__default["default"].encode(this.decoded);
|
|
319
|
+
this.encoded = codec;
|
|
320
|
+
return this.encoded
|
|
321
|
+
}
|
|
322
|
+
}
|
|
114
323
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
324
|
+
class CodecHash$1 extends BasicInterface$1 {
|
|
325
|
+
constructor(buffer, options = {}) {
|
|
326
|
+
super();
|
|
327
|
+
if (options.name) this.name = options.name;
|
|
328
|
+
else this.name = 'disco-hash';
|
|
329
|
+
if (options.codecs) this.codecs = options.codecs;
|
|
330
|
+
if (buffer) {
|
|
331
|
+
if (buffer instanceof Uint8Array) {
|
|
332
|
+
this.discoCodec = new PeernetCodec(buffer, this.codecs);
|
|
333
|
+
const name = this.discoCodec.name;
|
|
334
|
+
|
|
335
|
+
if (name) {
|
|
336
|
+
this.name = name;
|
|
337
|
+
this.decode(buffer);
|
|
338
|
+
} else {
|
|
339
|
+
this.encode(buffer);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
if (typeof buffer === 'string') {
|
|
344
|
+
if (this.isHex(buffer)) this.fromHex(buffer);
|
|
345
|
+
if (this.isBase32(buffer)) this.fromBs32(buffer);
|
|
346
|
+
else if (this.isBase58(buffer)) this.fromBs58(buffer);
|
|
347
|
+
else throw new Error(`unsupported string ${buffer}`)
|
|
348
|
+
} else if (typeof buffer === 'object') this.fromJSON(buffer);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
get prefix() {
|
|
353
|
+
const length = this.length;
|
|
354
|
+
const uint8Array = new Uint8Array(length.length + this.discoCodec.codecBuffer.length);
|
|
355
|
+
uint8Array.set(length);
|
|
356
|
+
uint8Array.set(this.discoCodec.codecBuffer, length.length);
|
|
357
|
+
|
|
358
|
+
return uint8Array
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
get length() {
|
|
362
|
+
return varint__default["default"].encode(this.size)
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
get buffer() {
|
|
366
|
+
return this.encoded
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
get hash() {
|
|
370
|
+
return this.encoded
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
fromJSON(json) {
|
|
374
|
+
return this.encode(Buffer.from(JSON.stringify(json)))
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
encode(buffer, name) {
|
|
378
|
+
if (!this.name && name) this.name = name;
|
|
379
|
+
if (!buffer) buffer = this.buffer;
|
|
380
|
+
this.discoCodec = new PeernetCodec(this.name, this.codecs);
|
|
381
|
+
this.discoCodec.fromName(this.name);
|
|
382
|
+
let hashAlg = this.discoCodec.hashAlg;
|
|
383
|
+
if (hashAlg.includes('dbl')) {
|
|
384
|
+
hashAlg = hashAlg.replace('dbl-', '');
|
|
385
|
+
buffer = createKeccakHash__default["default"](hashAlg.replace('-', '')).update(buffer).digest();
|
|
386
|
+
}
|
|
387
|
+
this.digest = createKeccakHash__default["default"](hashAlg.replace('-', '')).update(buffer).digest();
|
|
388
|
+
this.size = this.digest.length;
|
|
389
|
+
|
|
390
|
+
this.codec = this.discoCodec.encode();
|
|
391
|
+
this.codec = this.discoCodec.codecBuffer;
|
|
392
|
+
const uint8Array = new Uint8Array(this.digest.length + this.prefix.length);
|
|
393
|
+
uint8Array.set(this.prefix);
|
|
394
|
+
uint8Array.set(this.digest, this.prefix.length);
|
|
395
|
+
|
|
396
|
+
this.encoded = uint8Array;
|
|
397
|
+
|
|
398
|
+
return this.encoded
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
validate(buffer) {
|
|
402
|
+
if (Buffer.isBuffer(buffer)) {
|
|
403
|
+
const codec = varint__default["default"].decode(buffer);
|
|
404
|
+
if (this.codecs[codec]) {
|
|
405
|
+
this.decode(buffer);
|
|
406
|
+
} else {
|
|
407
|
+
this.encode(buffer);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
if (typeof buffer === 'string') {
|
|
411
|
+
if (this.isHex(buffer)) this.fromHex(buffer);
|
|
412
|
+
if (this.isBase32(buffer)) this.fromBs32(buffer);
|
|
413
|
+
}
|
|
414
|
+
if (typeof buffer === 'object') this.fromJSON(buffer);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
decode(buffer) {
|
|
418
|
+
this.encoded = buffer;
|
|
419
|
+
const codec = varint__default["default"].decode(buffer);
|
|
420
|
+
|
|
421
|
+
this.discoCodec = new PeernetCodec(codec, this.codecs);
|
|
422
|
+
// TODO: validate codec
|
|
423
|
+
buffer = buffer.slice(varint__default["default"].decode.bytes);
|
|
424
|
+
this.size = varint__default["default"].decode(buffer);
|
|
425
|
+
this.digest = buffer.slice(varint__default["default"].decode.bytes);
|
|
426
|
+
if (this.digest.length !== this.size) {
|
|
427
|
+
throw new Error(`hash length inconsistent: 0x${this.encoded.toString('hex')}`)
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// const discoCodec = new Codec(codec, this.codecs)
|
|
431
|
+
|
|
432
|
+
this.name = this.discoCodec.name;
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
this.size = this.digest.length;
|
|
436
|
+
|
|
437
|
+
return {
|
|
438
|
+
codec: this.codec,
|
|
439
|
+
name: this.name,
|
|
440
|
+
size: this.size,
|
|
441
|
+
length: this.length,
|
|
442
|
+
digest: this.digest,
|
|
443
|
+
}
|
|
444
|
+
}
|
|
119
445
|
}
|
|
120
446
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
447
|
+
class FormatInterface$1 extends BasicInterface$1 {
|
|
448
|
+
|
|
449
|
+
async protoEncode(data) {
|
|
450
|
+
// check schema
|
|
451
|
+
return new TextEncoder().encode(data)
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
async protoDecode(data) {
|
|
455
|
+
// check schema
|
|
456
|
+
return new TextDecoder().decode(data)
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
async init(buffer) {
|
|
460
|
+
if (buffer instanceof Uint8Array) await this.fromUint8Array(buffer);
|
|
461
|
+
else if (buffer instanceof ArrayBuffer) await this.fromArrayBuffer(buffer);
|
|
462
|
+
else if (buffer?.name === this.name) return buffer
|
|
463
|
+
else if (buffer instanceof String) {
|
|
464
|
+
if (this.isHex(buffer)) await this.fromHex(buffer);
|
|
465
|
+
else if (this.isBase32(buffer)) await this.fromBs32(buffer);
|
|
466
|
+
else if (this.isBase58(buffer)) await this.fromBs58(buffer);
|
|
467
|
+
else throw new Error(`unsupported string ${buffer}`)
|
|
468
|
+
} else {
|
|
469
|
+
await this.create(buffer);
|
|
470
|
+
}
|
|
471
|
+
return this
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* @param {Buffer|String|Object} buffer - data - The data needed to create the desired message
|
|
476
|
+
* @param {Object} proto - {encode, decode}
|
|
477
|
+
* @param {Object} options - {hashFormat, name}
|
|
478
|
+
*/
|
|
479
|
+
constructor(buffer, proto, options = {}) {
|
|
480
|
+
super();
|
|
481
|
+
this.proto = proto;
|
|
482
|
+
this.hashFormat = options.hashFormat || 'bs32';
|
|
483
|
+
if (options.name) this.name = options.name;
|
|
484
|
+
return this.init(buffer)
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* @return {PeernetHash}
|
|
489
|
+
*/
|
|
490
|
+
get peernetHash() {
|
|
491
|
+
return new CodecHash$1(this.decoded, {name: this.name})
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* @return {peernetHash}
|
|
496
|
+
*/
|
|
497
|
+
get hash() {
|
|
498
|
+
const upper = this.hashFormat.charAt(0).toUpperCase();
|
|
499
|
+
const format = `${upper}${this.hashFormat.substring(1, this.hashFormat.length)}`;
|
|
500
|
+
return this.peernetHash[`to${format}`]()
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* @return {Object}
|
|
505
|
+
*/
|
|
506
|
+
async decode() {
|
|
507
|
+
let encoded = this.encoded;
|
|
508
|
+
const discoCodec = new PeernetCodec(this.encoded);
|
|
509
|
+
encoded = encoded.slice(discoCodec.codecBuffer.length);
|
|
510
|
+
this.name = discoCodec.name;
|
|
511
|
+
this.decoded = await this.protoDecode(encoded);
|
|
512
|
+
try {
|
|
513
|
+
this.decoded = JSON.parse(this.decoded);
|
|
514
|
+
} catch {
|
|
515
|
+
|
|
516
|
+
}
|
|
517
|
+
return this.decoded
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* @return {Buffer}
|
|
522
|
+
*/
|
|
523
|
+
async encode(decoded) {
|
|
524
|
+
if (!decoded) decoded = this.decoded;
|
|
525
|
+
const codec = new PeernetCodec(this.name);
|
|
526
|
+
const encoded = await this.protoEncode(typeof decoded === 'object' ? JSON.stringify(decoded) : decoded);
|
|
527
|
+
const uint8Array = new Uint8Array(encoded.length + codec.codecBuffer.length);
|
|
528
|
+
uint8Array.set(codec.codecBuffer);
|
|
529
|
+
uint8Array.set(encoded, codec.codecBuffer.length);
|
|
530
|
+
this.encoded = uint8Array;
|
|
531
|
+
return this.encoded
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
hasCodec() {
|
|
535
|
+
if (!this.encoded) return false
|
|
536
|
+
const codec = new PeernetCodec(this.encoded);
|
|
537
|
+
if (codec.name) return true
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
fromUint8Array(buffer) {
|
|
541
|
+
this.encoded = buffer;
|
|
542
|
+
return this.hasCodec() ? this.decode() : this.create(
|
|
543
|
+
JSON.parse(new TextDecoder().decode(this.encoded))
|
|
544
|
+
)
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
fromArrayBuffer(buffer) {
|
|
548
|
+
this.encoded = new Uint8Array(buffer, buffer.byteOffset, buffer.byteLength);
|
|
549
|
+
return this.hasCodec() ? this.decode() : this.create(
|
|
550
|
+
JSON.parse(new TextDecoder().decode(this.encoded))
|
|
551
|
+
)
|
|
552
|
+
}
|
|
553
|
+
}
|
|
124
554
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
555
|
+
const BasicInterface = BasicInterface$1;
|
|
556
|
+
const FormatInterface = FormatInterface$1;
|
|
557
|
+
const CodecHash = CodecHash$1;
|
|
558
|
+
const Codec = PeernetCodec;
|
|
559
|
+
const Codecs = codecs;
|
|
129
560
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
561
|
+
__webpack_unused_export__ = BasicInterface;
|
|
562
|
+
__webpack_unused_export__ = Codec;
|
|
563
|
+
__webpack_unused_export__ = CodecHash;
|
|
564
|
+
__webpack_unused_export__ = Codecs;
|
|
565
|
+
exports.L1 = FormatInterface;
|
|
135
566
|
|
|
136
|
-
// If there is no 'error' event listener then throw.
|
|
137
|
-
if (doError) {
|
|
138
|
-
var er;
|
|
139
|
-
if (args.length > 0)
|
|
140
|
-
er = args[0];
|
|
141
|
-
if (er instanceof Error) {
|
|
142
|
-
// Note: The comments on the `throw` lines are intentional, they show
|
|
143
|
-
// up in Node's output if this results in an unhandled exception.
|
|
144
|
-
throw er; // Unhandled 'error' event
|
|
145
|
-
}
|
|
146
|
-
// At least give some kind of context to the user
|
|
147
|
-
var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
|
|
148
|
-
err.context = er;
|
|
149
|
-
throw err; // Unhandled 'error' event
|
|
150
|
-
}
|
|
151
567
|
|
|
152
|
-
|
|
568
|
+
/***/ }),
|
|
153
569
|
|
|
154
|
-
|
|
155
|
-
|
|
570
|
+
/***/ 353:
|
|
571
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
156
572
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
573
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
574
|
+
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
575
|
+
/* harmony export */ });
|
|
576
|
+
// base-x encoding / decoding
|
|
577
|
+
// Copyright (c) 2018 base-x contributors
|
|
578
|
+
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
579
|
+
// Distributed under the MIT software license, see the accompanying
|
|
580
|
+
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
581
|
+
const base = ALPHABET => {
|
|
582
|
+
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
583
|
+
const BASE_MAP = new Uint8Array(256)
|
|
584
|
+
for (let j = 0; j < BASE_MAP.length; j++) {
|
|
585
|
+
BASE_MAP[j] = 255
|
|
586
|
+
}
|
|
587
|
+
for (let i = 0; i < ALPHABET.length; i++) {
|
|
588
|
+
const x = ALPHABET.charAt(i)
|
|
589
|
+
const xc = x.charCodeAt(0)
|
|
590
|
+
if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
|
|
591
|
+
BASE_MAP[xc] = i
|
|
592
|
+
}
|
|
593
|
+
const BASE = ALPHABET.length
|
|
594
|
+
const LEADER = ALPHABET.charAt(0)
|
|
595
|
+
const FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up
|
|
596
|
+
const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up
|
|
597
|
+
|
|
598
|
+
const encode = source => {
|
|
599
|
+
if (source instanceof Uint8Array) {
|
|
600
|
+
} else if (ArrayBuffer.isView(source)) {
|
|
601
|
+
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)
|
|
602
|
+
} else if (Array.isArray(source)) {
|
|
603
|
+
source = Uint8Array.from(source)
|
|
604
|
+
}
|
|
605
|
+
if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
|
|
606
|
+
if (source.length === 0) { return '' }
|
|
607
|
+
// Skip & count leading zeroes.
|
|
608
|
+
let zeroes = 0
|
|
609
|
+
let length = 0
|
|
610
|
+
let pbegin = 0
|
|
611
|
+
const pend = source.length
|
|
612
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
613
|
+
pbegin++
|
|
614
|
+
zeroes++
|
|
615
|
+
}
|
|
616
|
+
// Allocate enough space in big-endian base58 representation.
|
|
617
|
+
const size = ((pend - pbegin) * iFACTOR + 1) >>> 0
|
|
618
|
+
const b58 = new Uint8Array(size)
|
|
619
|
+
// Process the bytes.
|
|
620
|
+
while (pbegin !== pend) {
|
|
621
|
+
let carry = source[pbegin]
|
|
622
|
+
// Apply "b58 = b58 * 256 + ch".
|
|
623
|
+
let i = 0
|
|
624
|
+
for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
625
|
+
carry += (256 * b58[it1]) >>> 0
|
|
626
|
+
b58[it1] = (carry % BASE) >>> 0
|
|
627
|
+
carry = (carry / BASE) >>> 0
|
|
628
|
+
}
|
|
629
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
630
|
+
length = i
|
|
631
|
+
pbegin++
|
|
632
|
+
}
|
|
633
|
+
// Skip leading zeroes in base58 result.
|
|
634
|
+
let it2 = size - length
|
|
635
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
636
|
+
it2++
|
|
637
|
+
}
|
|
638
|
+
// Translate the result into a string.
|
|
639
|
+
let str = LEADER.repeat(zeroes)
|
|
640
|
+
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }
|
|
641
|
+
return str
|
|
642
|
+
}
|
|
643
|
+
const decodeUnsafe = source => {
|
|
644
|
+
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
645
|
+
if (source.length === 0) { return new Uint8Array() }
|
|
646
|
+
let psz = 0
|
|
647
|
+
// Skip and count leading '1's.
|
|
648
|
+
let zeroes = 0
|
|
649
|
+
let length = 0
|
|
650
|
+
while (source[psz] === LEADER) {
|
|
651
|
+
zeroes++
|
|
652
|
+
psz++
|
|
653
|
+
}
|
|
654
|
+
// Allocate enough space in big-endian base256 representation.
|
|
655
|
+
const size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.
|
|
656
|
+
let b256 = new Uint8Array(size)
|
|
657
|
+
// Process the characters.
|
|
658
|
+
while (source[psz]) {
|
|
659
|
+
// Decode character
|
|
660
|
+
let carry = BASE_MAP[source.charCodeAt(psz)]
|
|
661
|
+
// Invalid character
|
|
662
|
+
if (carry === 255) { return }
|
|
663
|
+
let i = 0
|
|
664
|
+
for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
665
|
+
carry += (BASE * b256[it3]) >>> 0
|
|
666
|
+
b256[it3] = (carry % 256) >>> 0
|
|
667
|
+
carry = (carry / 256) >>> 0
|
|
668
|
+
}
|
|
669
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
670
|
+
length = i
|
|
671
|
+
psz++
|
|
672
|
+
}
|
|
673
|
+
// Skip leading zeroes in b256.
|
|
674
|
+
let it4 = size - length
|
|
675
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
676
|
+
it4++
|
|
677
|
+
}
|
|
678
|
+
let vch = new Uint8Array(zeroes + (size - it4))
|
|
679
|
+
let j = zeroes
|
|
680
|
+
while (it4 !== size) {
|
|
681
|
+
vch[j++] = b256[it4++]
|
|
682
|
+
}
|
|
683
|
+
return vch
|
|
684
|
+
}
|
|
685
|
+
const decode = string => {
|
|
686
|
+
const buffer = decodeUnsafe(string)
|
|
687
|
+
if (buffer) { return buffer }
|
|
688
|
+
throw new Error('Non-base' + BASE + ' character')
|
|
689
|
+
}
|
|
690
|
+
return {
|
|
691
|
+
encode: encode,
|
|
692
|
+
decodeUnsafe: decodeUnsafe,
|
|
693
|
+
decode: decode
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (base);
|
|
165
698
|
|
|
166
|
-
return true;
|
|
167
|
-
};
|
|
168
699
|
|
|
169
|
-
|
|
170
|
-
var m;
|
|
171
|
-
var events;
|
|
172
|
-
var existing;
|
|
700
|
+
/***/ }),
|
|
173
701
|
|
|
174
|
-
|
|
702
|
+
/***/ 894:
|
|
703
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
175
704
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
// To avoid recursion in the case that type === "newListener"! Before
|
|
182
|
-
// adding it to the listeners, first emit "newListener".
|
|
183
|
-
if (events.newListener !== undefined) {
|
|
184
|
-
target.emit('newListener', type,
|
|
185
|
-
listener.listener ? listener.listener : listener);
|
|
705
|
+
__webpack_require__.r(__webpack_exports__);
|
|
706
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
707
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
708
|
+
/* harmony export */ });
|
|
709
|
+
/* harmony import */ var _vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(353);
|
|
186
710
|
|
|
187
|
-
// Re-assign `events` because a newListener handler could have caused the
|
|
188
|
-
// this._events to be assigned to a new object
|
|
189
|
-
events = target._events;
|
|
190
|
-
}
|
|
191
|
-
existing = events[type];
|
|
192
|
-
}
|
|
193
711
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
existing = events[type] = listener;
|
|
197
|
-
++target._eventsCount;
|
|
198
|
-
} else {
|
|
199
|
-
if (typeof existing === 'function') {
|
|
200
|
-
// Adding the second element, need to change to array.
|
|
201
|
-
existing = events[type] =
|
|
202
|
-
prepend ? [listener, existing] : [existing, listener];
|
|
203
|
-
// If we've already got an array, just append.
|
|
204
|
-
} else if (prepend) {
|
|
205
|
-
existing.unshift(listener);
|
|
206
|
-
} else {
|
|
207
|
-
existing.push(listener);
|
|
208
|
-
}
|
|
712
|
+
const base32 = 'abcdefghijklmnopqrstuvwxyz234567'
|
|
713
|
+
const base32Hex = '0123456789abcdefghijklmnopqrstuv'
|
|
209
714
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
715
|
+
const decode = (uint8Array, hex = false) => {
|
|
716
|
+
const decoder = hex ? (0,_vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(base32Hex) : (0,_vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(base32)
|
|
717
|
+
return decoder.decode(uint8Array)
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
|
721
|
+
encode: (uint8Array, hex = false) => {
|
|
722
|
+
const encoder = hex ? (0,_vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(base32Hex) : (0,_vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(base32)
|
|
723
|
+
return encoder.encode(uint8Array)
|
|
724
|
+
},
|
|
725
|
+
decode,
|
|
726
|
+
isBase32: (uint8Array, hex = false) => {
|
|
727
|
+
try {
|
|
728
|
+
decode(uint8Array, hex)
|
|
729
|
+
return true;
|
|
730
|
+
} catch (e) {
|
|
731
|
+
return false;
|
|
225
732
|
}
|
|
226
733
|
}
|
|
734
|
+
});
|
|
227
735
|
|
|
228
|
-
return target;
|
|
229
|
-
}
|
|
230
736
|
|
|
231
|
-
|
|
232
|
-
return _addListener(this, type, listener, false);
|
|
233
|
-
};
|
|
737
|
+
/***/ }),
|
|
234
738
|
|
|
235
|
-
|
|
739
|
+
/***/ 158:
|
|
740
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
236
741
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
742
|
+
__webpack_require__.r(__webpack_exports__);
|
|
743
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
744
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
745
|
+
/* harmony export */ });
|
|
746
|
+
/* harmony import */ var _vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(353);
|
|
241
747
|
|
|
242
|
-
function onceWrapper() {
|
|
243
|
-
if (!this.fired) {
|
|
244
|
-
this.target.removeListener(this.type, this.wrapFn);
|
|
245
|
-
this.fired = true;
|
|
246
|
-
if (arguments.length === 0)
|
|
247
|
-
return this.listener.call(this.target);
|
|
248
|
-
return this.listener.apply(this.target, arguments);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
748
|
|
|
252
|
-
|
|
253
|
-
var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
|
|
254
|
-
var wrapped = onceWrapper.bind(state);
|
|
255
|
-
wrapped.listener = listener;
|
|
256
|
-
state.wrapFn = wrapped;
|
|
257
|
-
return wrapped;
|
|
258
|
-
}
|
|
749
|
+
const base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
|
|
259
750
|
|
|
260
|
-
|
|
261
|
-
checkListener(listener);
|
|
262
|
-
this.on(type, _onceWrap(this, type, listener));
|
|
263
|
-
return this;
|
|
264
|
-
};
|
|
751
|
+
const decode = uint8Array => (0,_vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(base58).decode(uint8Array)
|
|
265
752
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
753
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
|
754
|
+
encode: uint8Array => (0,_vandeurenglenn_base_x__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(base58).encode(uint8Array),
|
|
755
|
+
decode,
|
|
756
|
+
isBase58: uint8Array => {
|
|
757
|
+
try {
|
|
758
|
+
decode(uint8Array)
|
|
759
|
+
return true
|
|
760
|
+
} catch (e) {
|
|
761
|
+
return false
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
});
|
|
272
765
|
|
|
273
|
-
// Emits a 'removeListener' event if and only if the listener was removed.
|
|
274
|
-
EventEmitter.prototype.removeListener =
|
|
275
|
-
function removeListener(type, listener) {
|
|
276
|
-
var list, events, position, i, originalListener;
|
|
277
766
|
|
|
278
|
-
|
|
767
|
+
/***/ }),
|
|
279
768
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return this;
|
|
769
|
+
/***/ 187:
|
|
770
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
283
771
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
772
|
+
__webpack_require__.r(__webpack_exports__);
|
|
773
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
774
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
775
|
+
/* harmony export */ });
|
|
776
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (string => /^[A-F0-9]+$/i.test(string));
|
|
287
777
|
|
|
288
|
-
if (list === listener || list.listener === listener) {
|
|
289
|
-
if (--this._eventsCount === 0)
|
|
290
|
-
this._events = Object.create(null);
|
|
291
|
-
else {
|
|
292
|
-
delete events[type];
|
|
293
|
-
if (events.removeListener)
|
|
294
|
-
this.emit('removeListener', type, list.listener || listener);
|
|
295
|
-
}
|
|
296
|
-
} else if (typeof list !== 'function') {
|
|
297
|
-
position = -1;
|
|
298
|
-
|
|
299
|
-
for (i = list.length - 1; i >= 0; i--) {
|
|
300
|
-
if (list[i] === listener || list[i].listener === listener) {
|
|
301
|
-
originalListener = list[i].listener;
|
|
302
|
-
position = i;
|
|
303
|
-
break;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
778
|
|
|
307
|
-
|
|
308
|
-
return this;
|
|
309
|
-
|
|
310
|
-
if (position === 0)
|
|
311
|
-
list.shift();
|
|
312
|
-
else {
|
|
313
|
-
spliceOne(list, position);
|
|
314
|
-
}
|
|
779
|
+
/***/ }),
|
|
315
780
|
|
|
316
|
-
|
|
317
|
-
|
|
781
|
+
/***/ 370:
|
|
782
|
+
/***/ ((module) => {
|
|
318
783
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
784
|
+
// Copyright Joyent, Inc. and other Node contributors.
|
|
785
|
+
//
|
|
786
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
787
|
+
// copy of this software and associated documentation files (the
|
|
788
|
+
// "Software"), to deal in the Software without restriction, including
|
|
789
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
790
|
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
791
|
+
// persons to whom the Software is furnished to do so, subject to the
|
|
792
|
+
// following conditions:
|
|
793
|
+
//
|
|
794
|
+
// The above copyright notice and this permission notice shall be included
|
|
795
|
+
// in all copies or substantial portions of the Software.
|
|
796
|
+
//
|
|
797
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
798
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
799
|
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
800
|
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
801
|
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
802
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
803
|
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
322
804
|
|
|
323
|
-
return this;
|
|
324
|
-
};
|
|
325
805
|
|
|
326
|
-
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
|
327
806
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
807
|
+
var R = typeof Reflect === 'object' ? Reflect : null
|
|
808
|
+
var ReflectApply = R && typeof R.apply === 'function'
|
|
809
|
+
? R.apply
|
|
810
|
+
: function ReflectApply(target, receiver, args) {
|
|
811
|
+
return Function.prototype.apply.call(target, receiver, args);
|
|
812
|
+
}
|
|
331
813
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
814
|
+
var ReflectOwnKeys
|
|
815
|
+
if (R && typeof R.ownKeys === 'function') {
|
|
816
|
+
ReflectOwnKeys = R.ownKeys
|
|
817
|
+
} else if (Object.getOwnPropertySymbols) {
|
|
818
|
+
ReflectOwnKeys = function ReflectOwnKeys(target) {
|
|
819
|
+
return Object.getOwnPropertyNames(target)
|
|
820
|
+
.concat(Object.getOwnPropertySymbols(target));
|
|
821
|
+
};
|
|
822
|
+
} else {
|
|
823
|
+
ReflectOwnKeys = function ReflectOwnKeys(target) {
|
|
824
|
+
return Object.getOwnPropertyNames(target);
|
|
825
|
+
};
|
|
826
|
+
}
|
|
335
827
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
this._events = Object.create(null);
|
|
340
|
-
this._eventsCount = 0;
|
|
341
|
-
} else if (events[type] !== undefined) {
|
|
342
|
-
if (--this._eventsCount === 0)
|
|
343
|
-
this._events = Object.create(null);
|
|
344
|
-
else
|
|
345
|
-
delete events[type];
|
|
346
|
-
}
|
|
347
|
-
return this;
|
|
348
|
-
}
|
|
828
|
+
function ProcessEmitWarning(warning) {
|
|
829
|
+
if (console && console.warn) console.warn(warning);
|
|
830
|
+
}
|
|
349
831
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
var key;
|
|
354
|
-
for (i = 0; i < keys.length; ++i) {
|
|
355
|
-
key = keys[i];
|
|
356
|
-
if (key === 'removeListener') continue;
|
|
357
|
-
this.removeAllListeners(key);
|
|
358
|
-
}
|
|
359
|
-
this.removeAllListeners('removeListener');
|
|
360
|
-
this._events = Object.create(null);
|
|
361
|
-
this._eventsCount = 0;
|
|
362
|
-
return this;
|
|
363
|
-
}
|
|
832
|
+
var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
|
|
833
|
+
return value !== value;
|
|
834
|
+
}
|
|
364
835
|
|
|
365
|
-
|
|
836
|
+
function EventEmitter() {
|
|
837
|
+
EventEmitter.init.call(this);
|
|
838
|
+
}
|
|
839
|
+
module.exports = EventEmitter;
|
|
840
|
+
module.exports.once = once;
|
|
366
841
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
} else if (listeners !== undefined) {
|
|
370
|
-
// LIFO order
|
|
371
|
-
for (i = listeners.length - 1; i >= 0; i--) {
|
|
372
|
-
this.removeListener(type, listeners[i]);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
842
|
+
// Backwards-compat with node 0.10.x
|
|
843
|
+
EventEmitter.EventEmitter = EventEmitter;
|
|
375
844
|
|
|
376
|
-
|
|
377
|
-
|
|
845
|
+
EventEmitter.prototype._events = undefined;
|
|
846
|
+
EventEmitter.prototype._eventsCount = 0;
|
|
847
|
+
EventEmitter.prototype._maxListeners = undefined;
|
|
378
848
|
|
|
379
|
-
|
|
380
|
-
|
|
849
|
+
// By default EventEmitters will print a warning if more than 10 listeners are
|
|
850
|
+
// added to it. This is a useful default which helps finding memory leaks.
|
|
851
|
+
var defaultMaxListeners = 10;
|
|
381
852
|
|
|
382
|
-
|
|
383
|
-
|
|
853
|
+
function checkListener(listener) {
|
|
854
|
+
if (typeof listener !== 'function') {
|
|
855
|
+
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
|
|
856
|
+
}
|
|
857
|
+
}
|
|
384
858
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
859
|
+
Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
|
|
860
|
+
enumerable: true,
|
|
861
|
+
get: function() {
|
|
862
|
+
return defaultMaxListeners;
|
|
863
|
+
},
|
|
864
|
+
set: function(arg) {
|
|
865
|
+
if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
|
|
866
|
+
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
|
|
867
|
+
}
|
|
868
|
+
defaultMaxListeners = arg;
|
|
869
|
+
}
|
|
870
|
+
});
|
|
388
871
|
|
|
389
|
-
|
|
390
|
-
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
|
|
872
|
+
EventEmitter.init = function() {
|
|
391
873
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
874
|
+
if (this._events === undefined ||
|
|
875
|
+
this._events === Object.getPrototypeOf(this)._events) {
|
|
876
|
+
this._events = Object.create(null);
|
|
877
|
+
this._eventsCount = 0;
|
|
878
|
+
}
|
|
395
879
|
|
|
396
|
-
|
|
397
|
-
return _listeners(this, type, true);
|
|
880
|
+
this._maxListeners = this._maxListeners || undefined;
|
|
398
881
|
};
|
|
399
882
|
|
|
400
|
-
|
|
401
|
-
|
|
883
|
+
// Obviously not all Emitters should be limited to 10. This function allows
|
|
884
|
+
// that to be increased. Set to zero for unlimited.
|
|
885
|
+
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
|
|
886
|
+
if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
|
|
887
|
+
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
|
|
888
|
+
}
|
|
889
|
+
this._maxListeners = n;
|
|
890
|
+
return this;
|
|
402
891
|
};
|
|
403
892
|
|
|
404
|
-
|
|
405
|
-
if (
|
|
406
|
-
return
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
893
|
+
function _getMaxListeners(that) {
|
|
894
|
+
if (that._maxListeners === undefined)
|
|
895
|
+
return EventEmitter.defaultMaxListeners;
|
|
896
|
+
return that._maxListeners;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
|
|
900
|
+
return _getMaxListeners(this);
|
|
410
901
|
};
|
|
411
902
|
|
|
412
|
-
EventEmitter.prototype.
|
|
413
|
-
|
|
414
|
-
var
|
|
903
|
+
EventEmitter.prototype.emit = function emit(type) {
|
|
904
|
+
var args = [];
|
|
905
|
+
for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
|
|
906
|
+
var doError = (type === 'error');
|
|
415
907
|
|
|
416
|
-
|
|
417
|
-
|
|
908
|
+
var events = this._events;
|
|
909
|
+
if (events !== undefined)
|
|
910
|
+
doError = (doError && events.error === undefined);
|
|
911
|
+
else if (!doError)
|
|
912
|
+
return false;
|
|
418
913
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
914
|
+
// If there is no 'error' event listener then throw.
|
|
915
|
+
if (doError) {
|
|
916
|
+
var er;
|
|
917
|
+
if (args.length > 0)
|
|
918
|
+
er = args[0];
|
|
919
|
+
if (er instanceof Error) {
|
|
920
|
+
// Note: The comments on the `throw` lines are intentional, they show
|
|
921
|
+
// up in Node's output if this results in an unhandled exception.
|
|
922
|
+
throw er; // Unhandled 'error' event
|
|
423
923
|
}
|
|
924
|
+
// At least give some kind of context to the user
|
|
925
|
+
var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
|
|
926
|
+
err.context = er;
|
|
927
|
+
throw err; // Unhandled 'error' event
|
|
424
928
|
}
|
|
425
929
|
|
|
426
|
-
|
|
427
|
-
}
|
|
930
|
+
var handler = events[type];
|
|
428
931
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
};
|
|
932
|
+
if (handler === undefined)
|
|
933
|
+
return false;
|
|
432
934
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
935
|
+
if (typeof handler === 'function') {
|
|
936
|
+
ReflectApply(handler, this, args);
|
|
937
|
+
} else {
|
|
938
|
+
var len = handler.length;
|
|
939
|
+
var listeners = arrayClone(handler, len);
|
|
940
|
+
for (var i = 0; i < len; ++i)
|
|
941
|
+
ReflectApply(listeners[i], this, args);
|
|
942
|
+
}
|
|
439
943
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
list[index] = list[index + 1];
|
|
443
|
-
list.pop();
|
|
444
|
-
}
|
|
944
|
+
return true;
|
|
945
|
+
};
|
|
445
946
|
|
|
446
|
-
function
|
|
447
|
-
var
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
return ret;
|
|
452
|
-
}
|
|
947
|
+
function _addListener(target, type, listener, prepend) {
|
|
948
|
+
var m;
|
|
949
|
+
var events;
|
|
950
|
+
var existing;
|
|
453
951
|
|
|
454
|
-
|
|
455
|
-
return new Promise(function (resolve, reject) {
|
|
456
|
-
function errorListener(err) {
|
|
457
|
-
emitter.removeListener(name, resolver);
|
|
458
|
-
reject(err);
|
|
459
|
-
}
|
|
952
|
+
checkListener(listener);
|
|
460
953
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
954
|
+
events = target._events;
|
|
955
|
+
if (events === undefined) {
|
|
956
|
+
events = target._events = Object.create(null);
|
|
957
|
+
target._eventsCount = 0;
|
|
958
|
+
} else {
|
|
959
|
+
// To avoid recursion in the case that type === "newListener"! Before
|
|
960
|
+
// adding it to the listeners, first emit "newListener".
|
|
961
|
+
if (events.newListener !== undefined) {
|
|
962
|
+
target.emit('newListener', type,
|
|
963
|
+
listener.listener ? listener.listener : listener);
|
|
467
964
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
965
|
+
// Re-assign `events` because a newListener handler could have caused the
|
|
966
|
+
// this._events to be assigned to a new object
|
|
967
|
+
events = target._events;
|
|
471
968
|
}
|
|
472
|
-
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
|
|
476
|
-
if (typeof emitter.on === 'function') {
|
|
477
|
-
eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
|
|
969
|
+
existing = events[type];
|
|
478
970
|
}
|
|
479
|
-
}
|
|
480
971
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
972
|
+
if (existing === undefined) {
|
|
973
|
+
// Optimize the case of one listener. Don't need the extra array object.
|
|
974
|
+
existing = events[type] = listener;
|
|
975
|
+
++target._eventsCount;
|
|
976
|
+
} else {
|
|
977
|
+
if (typeof existing === 'function') {
|
|
978
|
+
// Adding the second element, need to change to array.
|
|
979
|
+
existing = events[type] =
|
|
980
|
+
prepend ? [listener, existing] : [existing, listener];
|
|
981
|
+
// If we've already got an array, just append.
|
|
982
|
+
} else if (prepend) {
|
|
983
|
+
existing.unshift(listener);
|
|
485
984
|
} else {
|
|
486
|
-
|
|
985
|
+
existing.push(listener);
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
// Check for listener leak
|
|
989
|
+
m = _getMaxListeners(target);
|
|
990
|
+
if (m > 0 && existing.length > m && !existing.warned) {
|
|
991
|
+
existing.warned = true;
|
|
992
|
+
// No error code for this since it is a Warning
|
|
993
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
994
|
+
var w = new Error('Possible EventEmitter memory leak detected. ' +
|
|
995
|
+
existing.length + ' ' + String(type) + ' listeners ' +
|
|
996
|
+
'added. Use emitter.setMaxListeners() to ' +
|
|
997
|
+
'increase limit');
|
|
998
|
+
w.name = 'MaxListenersExceededWarning';
|
|
999
|
+
w.emitter = target;
|
|
1000
|
+
w.type = type;
|
|
1001
|
+
w.count = existing.length;
|
|
1002
|
+
ProcessEmitWarning(w);
|
|
487
1003
|
}
|
|
488
|
-
} else if (typeof emitter.addEventListener === 'function') {
|
|
489
|
-
// EventTarget does not have `error` event semantics like Node
|
|
490
|
-
// EventEmitters, we do not listen for `error` events here.
|
|
491
|
-
emitter.addEventListener(name, function wrapListener(arg) {
|
|
492
|
-
// IE does not have builtin `{ once: true }` support so we
|
|
493
|
-
// have to do it manually.
|
|
494
|
-
if (flags.once) {
|
|
495
|
-
emitter.removeEventListener(name, wrapListener);
|
|
496
|
-
}
|
|
497
|
-
listener(arg);
|
|
498
|
-
});
|
|
499
|
-
} else {
|
|
500
|
-
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
|
|
501
1004
|
}
|
|
1005
|
+
|
|
1006
|
+
return target;
|
|
502
1007
|
}
|
|
503
1008
|
|
|
1009
|
+
EventEmitter.prototype.addListener = function addListener(type, listener) {
|
|
1010
|
+
return _addListener(this, type, listener, false);
|
|
1011
|
+
};
|
|
504
1012
|
|
|
505
|
-
|
|
1013
|
+
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
|
506
1014
|
|
|
507
|
-
|
|
508
|
-
|
|
1015
|
+
EventEmitter.prototype.prependListener =
|
|
1016
|
+
function prependListener(type, listener) {
|
|
1017
|
+
return _addListener(this, type, listener, true);
|
|
1018
|
+
};
|
|
509
1019
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
value: ctor,
|
|
518
|
-
enumerable: false,
|
|
519
|
-
writable: true,
|
|
520
|
-
configurable: true
|
|
521
|
-
}
|
|
522
|
-
})
|
|
523
|
-
}
|
|
524
|
-
};
|
|
525
|
-
} else {
|
|
526
|
-
// old school shim for old browsers
|
|
527
|
-
module.exports = function inherits(ctor, superCtor) {
|
|
528
|
-
if (superCtor) {
|
|
529
|
-
ctor.super_ = superCtor
|
|
530
|
-
var TempCtor = function () {}
|
|
531
|
-
TempCtor.prototype = superCtor.prototype
|
|
532
|
-
ctor.prototype = new TempCtor()
|
|
533
|
-
ctor.prototype.constructor = ctor
|
|
534
|
-
}
|
|
1020
|
+
function onceWrapper() {
|
|
1021
|
+
if (!this.fired) {
|
|
1022
|
+
this.target.removeListener(this.type, this.wrapFn);
|
|
1023
|
+
this.fired = true;
|
|
1024
|
+
if (arguments.length === 0)
|
|
1025
|
+
return this.listener.call(this.target);
|
|
1026
|
+
return this.listener.apply(this.target, arguments);
|
|
535
1027
|
}
|
|
536
1028
|
}
|
|
537
1029
|
|
|
1030
|
+
function _onceWrap(target, type, listener) {
|
|
1031
|
+
var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
|
|
1032
|
+
var wrapped = onceWrapper.bind(state);
|
|
1033
|
+
wrapped.listener = listener;
|
|
1034
|
+
state.wrapFn = wrapped;
|
|
1035
|
+
return wrapped;
|
|
1036
|
+
}
|
|
538
1037
|
|
|
539
|
-
|
|
1038
|
+
EventEmitter.prototype.once = function once(type, listener) {
|
|
1039
|
+
checkListener(listener);
|
|
1040
|
+
this.on(type, _onceWrap(this, type, listener));
|
|
1041
|
+
return this;
|
|
1042
|
+
};
|
|
540
1043
|
|
|
541
|
-
|
|
542
|
-
|
|
1044
|
+
EventEmitter.prototype.prependOnceListener =
|
|
1045
|
+
function prependOnceListener(type, listener) {
|
|
1046
|
+
checkListener(listener);
|
|
1047
|
+
this.prependListener(type, _onceWrap(this, type, listener));
|
|
1048
|
+
return this;
|
|
1049
|
+
};
|
|
543
1050
|
|
|
544
|
-
|
|
1051
|
+
// Emits a 'removeListener' event if and only if the listener was removed.
|
|
1052
|
+
EventEmitter.prototype.removeListener =
|
|
1053
|
+
function removeListener(type, listener) {
|
|
1054
|
+
var list, events, position, i, originalListener;
|
|
545
1055
|
|
|
1056
|
+
checkListener(listener);
|
|
546
1057
|
|
|
547
|
-
|
|
1058
|
+
events = this._events;
|
|
1059
|
+
if (events === undefined)
|
|
1060
|
+
return this;
|
|
548
1061
|
|
|
549
|
-
|
|
550
|
-
|
|
1062
|
+
list = events[type];
|
|
1063
|
+
if (list === undefined)
|
|
1064
|
+
return this;
|
|
551
1065
|
|
|
552
|
-
|
|
553
|
-
|
|
1066
|
+
if (list === listener || list.listener === listener) {
|
|
1067
|
+
if (--this._eventsCount === 0)
|
|
1068
|
+
this._events = Object.create(null);
|
|
1069
|
+
else {
|
|
1070
|
+
delete events[type];
|
|
1071
|
+
if (events.removeListener)
|
|
1072
|
+
this.emit('removeListener', type, list.listener || listener);
|
|
1073
|
+
}
|
|
1074
|
+
} else if (typeof list !== 'function') {
|
|
1075
|
+
position = -1;
|
|
554
1076
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
1077
|
+
for (i = list.length - 1; i >= 0; i--) {
|
|
1078
|
+
if (list[i] === listener || list[i].listener === listener) {
|
|
1079
|
+
originalListener = list[i].listener;
|
|
1080
|
+
position = i;
|
|
1081
|
+
break;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
558
1084
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
switch (hash) {
|
|
562
|
-
case 'keccak224': return new Keccak(1152, 448, null, 224, options)
|
|
563
|
-
case 'keccak256': return new Keccak(1088, 512, null, 256, options)
|
|
564
|
-
case 'keccak384': return new Keccak(832, 768, null, 384, options)
|
|
565
|
-
case 'keccak512': return new Keccak(576, 1024, null, 512, options)
|
|
1085
|
+
if (position < 0)
|
|
1086
|
+
return this;
|
|
566
1087
|
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
1088
|
+
if (position === 0)
|
|
1089
|
+
list.shift();
|
|
1090
|
+
else {
|
|
1091
|
+
spliceOne(list, position);
|
|
1092
|
+
}
|
|
571
1093
|
|
|
572
|
-
|
|
573
|
-
|
|
1094
|
+
if (list.length === 1)
|
|
1095
|
+
events[type] = list[0];
|
|
574
1096
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
}
|
|
1097
|
+
if (events.removeListener !== undefined)
|
|
1098
|
+
this.emit('removeListener', type, originalListener || listener);
|
|
1099
|
+
}
|
|
579
1100
|
|
|
1101
|
+
return this;
|
|
1102
|
+
};
|
|
580
1103
|
|
|
581
|
-
|
|
1104
|
+
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
|
582
1105
|
|
|
583
|
-
|
|
584
|
-
|
|
1106
|
+
EventEmitter.prototype.removeAllListeners =
|
|
1107
|
+
function removeAllListeners(type) {
|
|
1108
|
+
var listeners, events, i;
|
|
585
1109
|
|
|
586
|
-
|
|
1110
|
+
events = this._events;
|
|
1111
|
+
if (events === undefined)
|
|
1112
|
+
return this;
|
|
587
1113
|
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
1114
|
+
// not listening for removeListener, no need to emit
|
|
1115
|
+
if (events.removeListener === undefined) {
|
|
1116
|
+
if (arguments.length === 0) {
|
|
1117
|
+
this._events = Object.create(null);
|
|
1118
|
+
this._eventsCount = 0;
|
|
1119
|
+
} else if (events[type] !== undefined) {
|
|
1120
|
+
if (--this._eventsCount === 0)
|
|
1121
|
+
this._events = Object.create(null);
|
|
1122
|
+
else
|
|
1123
|
+
delete events[type];
|
|
1124
|
+
}
|
|
1125
|
+
return this;
|
|
1126
|
+
}
|
|
591
1127
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
1128
|
+
// emit removeListener for all listeners on all events
|
|
1129
|
+
if (arguments.length === 0) {
|
|
1130
|
+
var keys = Object.keys(events);
|
|
1131
|
+
var key;
|
|
1132
|
+
for (i = 0; i < keys.length; ++i) {
|
|
1133
|
+
key = keys[i];
|
|
1134
|
+
if (key === 'removeListener') continue;
|
|
1135
|
+
this.removeAllListeners(key);
|
|
1136
|
+
}
|
|
1137
|
+
this.removeAllListeners('removeListener');
|
|
1138
|
+
this._events = Object.create(null);
|
|
1139
|
+
this._eventsCount = 0;
|
|
1140
|
+
return this;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
listeners = events[type];
|
|
1144
|
+
|
|
1145
|
+
if (typeof listeners === 'function') {
|
|
1146
|
+
this.removeListener(type, listeners);
|
|
1147
|
+
} else if (listeners !== undefined) {
|
|
1148
|
+
// LIFO order
|
|
1149
|
+
for (i = listeners.length - 1; i >= 0; i--) {
|
|
1150
|
+
this.removeListener(type, listeners[i]);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
return this;
|
|
1155
|
+
};
|
|
1156
|
+
|
|
1157
|
+
function _listeners(target, type, unwrap) {
|
|
1158
|
+
var events = target._events;
|
|
1159
|
+
|
|
1160
|
+
if (events === undefined)
|
|
1161
|
+
return [];
|
|
1162
|
+
|
|
1163
|
+
var evlistener = events[type];
|
|
1164
|
+
if (evlistener === undefined)
|
|
1165
|
+
return [];
|
|
1166
|
+
|
|
1167
|
+
if (typeof evlistener === 'function')
|
|
1168
|
+
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
|
|
1169
|
+
|
|
1170
|
+
return unwrap ?
|
|
1171
|
+
unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
EventEmitter.prototype.listeners = function listeners(type) {
|
|
1175
|
+
return _listeners(this, type, true);
|
|
1176
|
+
};
|
|
1177
|
+
|
|
1178
|
+
EventEmitter.prototype.rawListeners = function rawListeners(type) {
|
|
1179
|
+
return _listeners(this, type, false);
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1182
|
+
EventEmitter.listenerCount = function(emitter, type) {
|
|
1183
|
+
if (typeof emitter.listenerCount === 'function') {
|
|
1184
|
+
return emitter.listenerCount(type);
|
|
1185
|
+
} else {
|
|
1186
|
+
return listenerCount.call(emitter, type);
|
|
1187
|
+
}
|
|
1188
|
+
};
|
|
1189
|
+
|
|
1190
|
+
EventEmitter.prototype.listenerCount = listenerCount;
|
|
1191
|
+
function listenerCount(type) {
|
|
1192
|
+
var events = this._events;
|
|
1193
|
+
|
|
1194
|
+
if (events !== undefined) {
|
|
1195
|
+
var evlistener = events[type];
|
|
1196
|
+
|
|
1197
|
+
if (typeof evlistener === 'function') {
|
|
1198
|
+
return 1;
|
|
1199
|
+
} else if (evlistener !== undefined) {
|
|
1200
|
+
return evlistener.length;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
return 0;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
EventEmitter.prototype.eventNames = function eventNames() {
|
|
1208
|
+
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1211
|
+
function arrayClone(arr, n) {
|
|
1212
|
+
var copy = new Array(n);
|
|
1213
|
+
for (var i = 0; i < n; ++i)
|
|
1214
|
+
copy[i] = arr[i];
|
|
1215
|
+
return copy;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
function spliceOne(list, index) {
|
|
1219
|
+
for (; index + 1 < list.length; index++)
|
|
1220
|
+
list[index] = list[index + 1];
|
|
1221
|
+
list.pop();
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
function unwrapListeners(arr) {
|
|
1225
|
+
var ret = new Array(arr.length);
|
|
1226
|
+
for (var i = 0; i < ret.length; ++i) {
|
|
1227
|
+
ret[i] = arr[i].listener || arr[i];
|
|
1228
|
+
}
|
|
1229
|
+
return ret;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
function once(emitter, name) {
|
|
1233
|
+
return new Promise(function (resolve, reject) {
|
|
1234
|
+
function errorListener(err) {
|
|
1235
|
+
emitter.removeListener(name, resolver);
|
|
1236
|
+
reject(err);
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
function resolver() {
|
|
1240
|
+
if (typeof emitter.removeListener === 'function') {
|
|
1241
|
+
emitter.removeListener('error', errorListener);
|
|
1242
|
+
}
|
|
1243
|
+
resolve([].slice.call(arguments));
|
|
1244
|
+
};
|
|
1245
|
+
|
|
1246
|
+
eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
|
|
1247
|
+
if (name !== 'error') {
|
|
1248
|
+
addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
|
|
1249
|
+
}
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
|
|
1254
|
+
if (typeof emitter.on === 'function') {
|
|
1255
|
+
eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
|
|
1260
|
+
if (typeof emitter.on === 'function') {
|
|
1261
|
+
if (flags.once) {
|
|
1262
|
+
emitter.once(name, listener);
|
|
1263
|
+
} else {
|
|
1264
|
+
emitter.on(name, listener);
|
|
1265
|
+
}
|
|
1266
|
+
} else if (typeof emitter.addEventListener === 'function') {
|
|
1267
|
+
// EventTarget does not have `error` event semantics like Node
|
|
1268
|
+
// EventEmitters, we do not listen for `error` events here.
|
|
1269
|
+
emitter.addEventListener(name, function wrapListener(arg) {
|
|
1270
|
+
// IE does not have builtin `{ once: true }` support so we
|
|
1271
|
+
// have to do it manually.
|
|
1272
|
+
if (flags.once) {
|
|
1273
|
+
emitter.removeEventListener(name, wrapListener);
|
|
1274
|
+
}
|
|
1275
|
+
listener(arg);
|
|
1276
|
+
});
|
|
1277
|
+
} else {
|
|
1278
|
+
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
/***/ }),
|
|
1284
|
+
|
|
1285
|
+
/***/ 717:
|
|
1286
|
+
/***/ ((module) => {
|
|
1287
|
+
|
|
1288
|
+
if (typeof Object.create === 'function') {
|
|
1289
|
+
// implementation from standard node.js 'util' module
|
|
1290
|
+
module.exports = function inherits(ctor, superCtor) {
|
|
1291
|
+
if (superCtor) {
|
|
1292
|
+
ctor.super_ = superCtor
|
|
1293
|
+
ctor.prototype = Object.create(superCtor.prototype, {
|
|
1294
|
+
constructor: {
|
|
1295
|
+
value: ctor,
|
|
1296
|
+
enumerable: false,
|
|
1297
|
+
writable: true,
|
|
1298
|
+
configurable: true
|
|
1299
|
+
}
|
|
1300
|
+
})
|
|
1301
|
+
}
|
|
1302
|
+
};
|
|
1303
|
+
} else {
|
|
1304
|
+
// old school shim for old browsers
|
|
1305
|
+
module.exports = function inherits(ctor, superCtor) {
|
|
1306
|
+
if (superCtor) {
|
|
1307
|
+
ctor.super_ = superCtor
|
|
1308
|
+
var TempCtor = function () {}
|
|
1309
|
+
TempCtor.prototype = superCtor.prototype
|
|
1310
|
+
ctor.prototype = new TempCtor()
|
|
1311
|
+
ctor.prototype.constructor = ctor
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
/***/ }),
|
|
1318
|
+
|
|
1319
|
+
/***/ 811:
|
|
1320
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1321
|
+
|
|
1322
|
+
module.exports = __webpack_require__(66)(__webpack_require__(653))
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
/***/ }),
|
|
1326
|
+
|
|
1327
|
+
/***/ 66:
|
|
1328
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1329
|
+
|
|
1330
|
+
const createKeccak = __webpack_require__(16)
|
|
1331
|
+
const createShake = __webpack_require__(675)
|
|
1332
|
+
|
|
1333
|
+
module.exports = function (KeccakState) {
|
|
1334
|
+
const Keccak = createKeccak(KeccakState)
|
|
1335
|
+
const Shake = createShake(KeccakState)
|
|
1336
|
+
|
|
1337
|
+
return function (algorithm, options) {
|
|
1338
|
+
const hash = typeof algorithm === 'string' ? algorithm.toLowerCase() : algorithm
|
|
1339
|
+
switch (hash) {
|
|
1340
|
+
case 'keccak224': return new Keccak(1152, 448, null, 224, options)
|
|
1341
|
+
case 'keccak256': return new Keccak(1088, 512, null, 256, options)
|
|
1342
|
+
case 'keccak384': return new Keccak(832, 768, null, 384, options)
|
|
1343
|
+
case 'keccak512': return new Keccak(576, 1024, null, 512, options)
|
|
1344
|
+
|
|
1345
|
+
case 'sha3-224': return new Keccak(1152, 448, 0x06, 224, options)
|
|
1346
|
+
case 'sha3-256': return new Keccak(1088, 512, 0x06, 256, options)
|
|
1347
|
+
case 'sha3-384': return new Keccak(832, 768, 0x06, 384, options)
|
|
1348
|
+
case 'sha3-512': return new Keccak(576, 1024, 0x06, 512, options)
|
|
1349
|
+
|
|
1350
|
+
case 'shake128': return new Shake(1344, 256, 0x1f, options)
|
|
1351
|
+
case 'shake256': return new Shake(1088, 512, 0x1f, options)
|
|
1352
|
+
|
|
1353
|
+
default: throw new Error('Invald algorithm: ' + algorithm)
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
/***/ }),
|
|
1360
|
+
|
|
1361
|
+
/***/ 16:
|
|
1362
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1363
|
+
|
|
1364
|
+
const { Transform } = __webpack_require__(473)
|
|
1365
|
+
|
|
1366
|
+
module.exports = (KeccakState) => class Keccak extends Transform {
|
|
1367
|
+
constructor (rate, capacity, delimitedSuffix, hashBitLength, options) {
|
|
1368
|
+
super(options)
|
|
1369
|
+
|
|
1370
|
+
this._rate = rate
|
|
1371
|
+
this._capacity = capacity
|
|
1372
|
+
this._delimitedSuffix = delimitedSuffix
|
|
1373
|
+
this._hashBitLength = hashBitLength
|
|
1374
|
+
this._options = options
|
|
597
1375
|
|
|
598
1376
|
this._state = new KeccakState()
|
|
599
1377
|
this._state.initialize(rate, capacity)
|
|
@@ -664,10 +1442,10 @@ module.exports = (KeccakState) => class Keccak extends Transform {
|
|
|
664
1442
|
|
|
665
1443
|
/***/ }),
|
|
666
1444
|
|
|
667
|
-
/***/
|
|
1445
|
+
/***/ 675:
|
|
668
1446
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
669
1447
|
|
|
670
|
-
const { Transform } = __webpack_require__(
|
|
1448
|
+
const { Transform } = __webpack_require__(473)
|
|
671
1449
|
|
|
672
1450
|
module.exports = (KeccakState) => class Shake extends Transform {
|
|
673
1451
|
constructor (rate, capacity, delimitedSuffix, options) {
|
|
@@ -739,7 +1517,7 @@ module.exports = (KeccakState) => class Shake extends Transform {
|
|
|
739
1517
|
|
|
740
1518
|
/***/ }),
|
|
741
1519
|
|
|
742
|
-
/***/
|
|
1520
|
+
/***/ 40:
|
|
743
1521
|
/***/ ((__unused_webpack_module, exports) => {
|
|
744
1522
|
|
|
745
1523
|
const P1600_ROUND_CONSTANTS = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648]
|
|
@@ -932,10 +1710,10 @@ exports.p1600 = function (s) {
|
|
|
932
1710
|
|
|
933
1711
|
/***/ }),
|
|
934
1712
|
|
|
935
|
-
/***/
|
|
1713
|
+
/***/ 653:
|
|
936
1714
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
937
1715
|
|
|
938
|
-
const keccakState = __webpack_require__(
|
|
1716
|
+
const keccakState = __webpack_require__(40)
|
|
939
1717
|
|
|
940
1718
|
function Keccak () {
|
|
941
1719
|
// much faster than `new Array(50)`
|
|
@@ -1007,7 +1785,7 @@ module.exports = Keccak
|
|
|
1007
1785
|
|
|
1008
1786
|
/***/ }),
|
|
1009
1787
|
|
|
1010
|
-
/***/
|
|
1788
|
+
/***/ 281:
|
|
1011
1789
|
/***/ ((module) => {
|
|
1012
1790
|
|
|
1013
1791
|
|
|
@@ -1141,7 +1919,7 @@ module.exports.q = codes;
|
|
|
1141
1919
|
|
|
1142
1920
|
/***/ }),
|
|
1143
1921
|
|
|
1144
|
-
/***/
|
|
1922
|
+
/***/ 753:
|
|
1145
1923
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1146
1924
|
|
|
1147
1925
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
@@ -1185,11 +1963,11 @@ var objectKeys = Object.keys || function (obj) {
|
|
|
1185
1963
|
|
|
1186
1964
|
module.exports = Duplex;
|
|
1187
1965
|
|
|
1188
|
-
var Readable = __webpack_require__(
|
|
1966
|
+
var Readable = __webpack_require__(481);
|
|
1189
1967
|
|
|
1190
|
-
var Writable = __webpack_require__(
|
|
1968
|
+
var Writable = __webpack_require__(229);
|
|
1191
1969
|
|
|
1192
|
-
__webpack_require__(
|
|
1970
|
+
__webpack_require__(717)(Duplex, Readable);
|
|
1193
1971
|
|
|
1194
1972
|
{
|
|
1195
1973
|
// Allow the keys array to be GC'ed.
|
|
@@ -1286,7 +2064,7 @@ Object.defineProperty(Duplex.prototype, 'destroyed', {
|
|
|
1286
2064
|
|
|
1287
2065
|
/***/ }),
|
|
1288
2066
|
|
|
1289
|
-
/***/
|
|
2067
|
+
/***/ 725:
|
|
1290
2068
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1291
2069
|
|
|
1292
2070
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
@@ -1316,9 +2094,9 @@ Object.defineProperty(Duplex.prototype, 'destroyed', {
|
|
|
1316
2094
|
|
|
1317
2095
|
module.exports = PassThrough;
|
|
1318
2096
|
|
|
1319
|
-
var Transform = __webpack_require__(
|
|
2097
|
+
var Transform = __webpack_require__(605);
|
|
1320
2098
|
|
|
1321
|
-
__webpack_require__(
|
|
2099
|
+
__webpack_require__(717)(PassThrough, Transform);
|
|
1322
2100
|
|
|
1323
2101
|
function PassThrough(options) {
|
|
1324
2102
|
if (!(this instanceof PassThrough)) return new PassThrough(options);
|
|
@@ -1331,7 +2109,7 @@ PassThrough.prototype._transform = function (chunk, encoding, cb) {
|
|
|
1331
2109
|
|
|
1332
2110
|
/***/ }),
|
|
1333
2111
|
|
|
1334
|
-
/***/
|
|
2112
|
+
/***/ 481:
|
|
1335
2113
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1336
2114
|
|
|
1337
2115
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
@@ -1365,7 +2143,7 @@ var Duplex;
|
|
|
1365
2143
|
Readable.ReadableState = ReadableState;
|
|
1366
2144
|
/*<replacement>*/
|
|
1367
2145
|
|
|
1368
|
-
var EE = (__webpack_require__(
|
|
2146
|
+
var EE = (__webpack_require__(370).EventEmitter);
|
|
1369
2147
|
|
|
1370
2148
|
var EElistenerCount = function EElistenerCount(emitter, type) {
|
|
1371
2149
|
return emitter.listeners(type).length;
|
|
@@ -1375,11 +2153,11 @@ var EElistenerCount = function EElistenerCount(emitter, type) {
|
|
|
1375
2153
|
/*<replacement>*/
|
|
1376
2154
|
|
|
1377
2155
|
|
|
1378
|
-
var Stream = __webpack_require__(
|
|
2156
|
+
var Stream = __webpack_require__(503);
|
|
1379
2157
|
/*</replacement>*/
|
|
1380
2158
|
|
|
1381
2159
|
|
|
1382
|
-
var Buffer = (__webpack_require__(
|
|
2160
|
+
var Buffer = (__webpack_require__(291).Buffer);
|
|
1383
2161
|
|
|
1384
2162
|
var OurUint8Array = __webpack_require__.g.Uint8Array || function () {};
|
|
1385
2163
|
|
|
@@ -1393,7 +2171,7 @@ function _isUint8Array(obj) {
|
|
|
1393
2171
|
/*<replacement>*/
|
|
1394
2172
|
|
|
1395
2173
|
|
|
1396
|
-
var debugUtil = __webpack_require__(
|
|
2174
|
+
var debugUtil = __webpack_require__(616);
|
|
1397
2175
|
|
|
1398
2176
|
var debug;
|
|
1399
2177
|
|
|
@@ -1405,14 +2183,14 @@ if (debugUtil && debugUtil.debuglog) {
|
|
|
1405
2183
|
/*</replacement>*/
|
|
1406
2184
|
|
|
1407
2185
|
|
|
1408
|
-
var BufferList = __webpack_require__(
|
|
2186
|
+
var BufferList = __webpack_require__(327);
|
|
1409
2187
|
|
|
1410
|
-
var destroyImpl = __webpack_require__(
|
|
2188
|
+
var destroyImpl = __webpack_require__(195);
|
|
1411
2189
|
|
|
1412
|
-
var _require = __webpack_require__(
|
|
2190
|
+
var _require = __webpack_require__(457),
|
|
1413
2191
|
getHighWaterMark = _require.getHighWaterMark;
|
|
1414
2192
|
|
|
1415
|
-
var _require$codes = (__webpack_require__(
|
|
2193
|
+
var _require$codes = (__webpack_require__(281)/* .codes */ .q),
|
|
1416
2194
|
ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
|
|
1417
2195
|
ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
|
|
1418
2196
|
ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
|
|
@@ -1423,7 +2201,7 @@ var StringDecoder;
|
|
|
1423
2201
|
var createReadableStreamAsyncIterator;
|
|
1424
2202
|
var from;
|
|
1425
2203
|
|
|
1426
|
-
__webpack_require__(
|
|
2204
|
+
__webpack_require__(717)(Readable, Stream);
|
|
1427
2205
|
|
|
1428
2206
|
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
1429
2207
|
var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
|
|
@@ -1440,7 +2218,7 @@ function prependListener(emitter, event, fn) {
|
|
|
1440
2218
|
}
|
|
1441
2219
|
|
|
1442
2220
|
function ReadableState(options, stream, isDuplex) {
|
|
1443
|
-
Duplex = Duplex || __webpack_require__(
|
|
2221
|
+
Duplex = Duplex || __webpack_require__(753);
|
|
1444
2222
|
options = options || {}; // Duplex streams are both readable and writable, but share
|
|
1445
2223
|
// the same options object.
|
|
1446
2224
|
// However, some cases require setting options to different
|
|
@@ -1496,14 +2274,14 @@ function ReadableState(options, stream, isDuplex) {
|
|
|
1496
2274
|
this.encoding = null;
|
|
1497
2275
|
|
|
1498
2276
|
if (options.encoding) {
|
|
1499
|
-
if (!StringDecoder) StringDecoder = (__webpack_require__(
|
|
2277
|
+
if (!StringDecoder) StringDecoder = (__webpack_require__(553)/* .StringDecoder */ .s);
|
|
1500
2278
|
this.decoder = new StringDecoder(options.encoding);
|
|
1501
2279
|
this.encoding = options.encoding;
|
|
1502
2280
|
}
|
|
1503
2281
|
}
|
|
1504
2282
|
|
|
1505
2283
|
function Readable(options) {
|
|
1506
|
-
Duplex = Duplex || __webpack_require__(
|
|
2284
|
+
Duplex = Duplex || __webpack_require__(753);
|
|
1507
2285
|
if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside
|
|
1508
2286
|
// the ReadableState constructor, at least with V8 6.5
|
|
1509
2287
|
|
|
@@ -1658,7 +2436,7 @@ Readable.prototype.isPaused = function () {
|
|
|
1658
2436
|
|
|
1659
2437
|
|
|
1660
2438
|
Readable.prototype.setEncoding = function (enc) {
|
|
1661
|
-
if (!StringDecoder) StringDecoder = (__webpack_require__(
|
|
2439
|
+
if (!StringDecoder) StringDecoder = (__webpack_require__(553)/* .StringDecoder */ .s);
|
|
1662
2440
|
var decoder = new StringDecoder(enc);
|
|
1663
2441
|
this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8
|
|
1664
2442
|
|
|
@@ -2342,7 +3120,7 @@ Readable.prototype.wrap = function (stream) {
|
|
|
2342
3120
|
if (typeof Symbol === 'function') {
|
|
2343
3121
|
Readable.prototype[Symbol.asyncIterator] = function () {
|
|
2344
3122
|
if (createReadableStreamAsyncIterator === undefined) {
|
|
2345
|
-
createReadableStreamAsyncIterator = __webpack_require__(
|
|
3123
|
+
createReadableStreamAsyncIterator = __webpack_require__(850);
|
|
2346
3124
|
}
|
|
2347
3125
|
|
|
2348
3126
|
return createReadableStreamAsyncIterator(this);
|
|
@@ -2444,7 +3222,7 @@ function endReadableNT(state, stream) {
|
|
|
2444
3222
|
if (typeof Symbol === 'function') {
|
|
2445
3223
|
Readable.from = function (iterable, opts) {
|
|
2446
3224
|
if (from === undefined) {
|
|
2447
|
-
from = __webpack_require__(
|
|
3225
|
+
from = __webpack_require__(167);
|
|
2448
3226
|
}
|
|
2449
3227
|
|
|
2450
3228
|
return from(Readable, iterable, opts);
|
|
@@ -2461,7 +3239,7 @@ function indexOf(xs, x) {
|
|
|
2461
3239
|
|
|
2462
3240
|
/***/ }),
|
|
2463
3241
|
|
|
2464
|
-
/***/
|
|
3242
|
+
/***/ 605:
|
|
2465
3243
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2466
3244
|
|
|
2467
3245
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
@@ -2529,15 +3307,15 @@ function indexOf(xs, x) {
|
|
|
2529
3307
|
|
|
2530
3308
|
module.exports = Transform;
|
|
2531
3309
|
|
|
2532
|
-
var _require$codes = (__webpack_require__(
|
|
3310
|
+
var _require$codes = (__webpack_require__(281)/* .codes */ .q),
|
|
2533
3311
|
ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
|
|
2534
3312
|
ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
|
|
2535
3313
|
ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,
|
|
2536
3314
|
ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
|
|
2537
3315
|
|
|
2538
|
-
var Duplex = __webpack_require__(
|
|
3316
|
+
var Duplex = __webpack_require__(753);
|
|
2539
3317
|
|
|
2540
|
-
__webpack_require__(
|
|
3318
|
+
__webpack_require__(717)(Transform, Duplex);
|
|
2541
3319
|
|
|
2542
3320
|
function afterTransform(er, data) {
|
|
2543
3321
|
var ts = this._transformState;
|
|
@@ -2668,7 +3446,7 @@ function done(stream, er, data) {
|
|
|
2668
3446
|
|
|
2669
3447
|
/***/ }),
|
|
2670
3448
|
|
|
2671
|
-
/***/
|
|
3449
|
+
/***/ 229:
|
|
2672
3450
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2673
3451
|
|
|
2674
3452
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
@@ -2730,17 +3508,17 @@ Writable.WritableState = WritableState;
|
|
|
2730
3508
|
/*<replacement>*/
|
|
2731
3509
|
|
|
2732
3510
|
var internalUtil = {
|
|
2733
|
-
deprecate: __webpack_require__(
|
|
3511
|
+
deprecate: __webpack_require__(927)
|
|
2734
3512
|
};
|
|
2735
3513
|
/*</replacement>*/
|
|
2736
3514
|
|
|
2737
3515
|
/*<replacement>*/
|
|
2738
3516
|
|
|
2739
|
-
var Stream = __webpack_require__(
|
|
3517
|
+
var Stream = __webpack_require__(503);
|
|
2740
3518
|
/*</replacement>*/
|
|
2741
3519
|
|
|
2742
3520
|
|
|
2743
|
-
var Buffer = (__webpack_require__(
|
|
3521
|
+
var Buffer = (__webpack_require__(291).Buffer);
|
|
2744
3522
|
|
|
2745
3523
|
var OurUint8Array = __webpack_require__.g.Uint8Array || function () {};
|
|
2746
3524
|
|
|
@@ -2752,12 +3530,12 @@ function _isUint8Array(obj) {
|
|
|
2752
3530
|
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
2753
3531
|
}
|
|
2754
3532
|
|
|
2755
|
-
var destroyImpl = __webpack_require__(
|
|
3533
|
+
var destroyImpl = __webpack_require__(195);
|
|
2756
3534
|
|
|
2757
|
-
var _require = __webpack_require__(
|
|
3535
|
+
var _require = __webpack_require__(457),
|
|
2758
3536
|
getHighWaterMark = _require.getHighWaterMark;
|
|
2759
3537
|
|
|
2760
|
-
var _require$codes = (__webpack_require__(
|
|
3538
|
+
var _require$codes = (__webpack_require__(281)/* .codes */ .q),
|
|
2761
3539
|
ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
|
|
2762
3540
|
ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
|
|
2763
3541
|
ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
|
|
@@ -2769,12 +3547,12 @@ var _require$codes = (__webpack_require__(4281)/* .codes */ .q),
|
|
|
2769
3547
|
|
|
2770
3548
|
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
2771
3549
|
|
|
2772
|
-
__webpack_require__(
|
|
3550
|
+
__webpack_require__(717)(Writable, Stream);
|
|
2773
3551
|
|
|
2774
3552
|
function nop() {}
|
|
2775
3553
|
|
|
2776
3554
|
function WritableState(options, stream, isDuplex) {
|
|
2777
|
-
Duplex = Duplex || __webpack_require__(
|
|
3555
|
+
Duplex = Duplex || __webpack_require__(753);
|
|
2778
3556
|
options = options || {}; // Duplex streams are both readable and writable, but share
|
|
2779
3557
|
// the same options object.
|
|
2780
3558
|
// However, some cases require setting options to different
|
|
@@ -2900,7 +3678,7 @@ if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.protot
|
|
|
2900
3678
|
}
|
|
2901
3679
|
|
|
2902
3680
|
function Writable(options) {
|
|
2903
|
-
Duplex = Duplex || __webpack_require__(
|
|
3681
|
+
Duplex = Duplex || __webpack_require__(753); // Writable ctor is applied to Duplexes, too.
|
|
2904
3682
|
// `realHasInstance` is necessary because using plain `instanceof`
|
|
2905
3683
|
// would return false, as no `_writableState` property is attached.
|
|
2906
3684
|
// Trying to use the custom `instanceof` for Writable here will also break the
|
|
@@ -3371,7 +4149,7 @@ Writable.prototype._destroy = function (err, cb) {
|
|
|
3371
4149
|
|
|
3372
4150
|
/***/ }),
|
|
3373
4151
|
|
|
3374
|
-
/***/
|
|
4152
|
+
/***/ 850:
|
|
3375
4153
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
3376
4154
|
|
|
3377
4155
|
|
|
@@ -3380,7 +4158,7 @@ var _Object$setPrototypeO;
|
|
|
3380
4158
|
|
|
3381
4159
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3382
4160
|
|
|
3383
|
-
var finished = __webpack_require__(
|
|
4161
|
+
var finished = __webpack_require__(610);
|
|
3384
4162
|
|
|
3385
4163
|
var kLastResolve = Symbol('lastResolve');
|
|
3386
4164
|
var kLastReject = Symbol('lastReject');
|
|
@@ -3584,7 +4362,7 @@ module.exports = createReadableStreamAsyncIterator;
|
|
|
3584
4362
|
|
|
3585
4363
|
/***/ }),
|
|
3586
4364
|
|
|
3587
|
-
/***/
|
|
4365
|
+
/***/ 327:
|
|
3588
4366
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
3589
4367
|
|
|
3590
4368
|
|
|
@@ -3601,10 +4379,10 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
3601
4379
|
|
|
3602
4380
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
3603
4381
|
|
|
3604
|
-
var _require = __webpack_require__(
|
|
4382
|
+
var _require = __webpack_require__(291),
|
|
3605
4383
|
Buffer = _require.Buffer;
|
|
3606
4384
|
|
|
3607
|
-
var _require2 = __webpack_require__(
|
|
4385
|
+
var _require2 = __webpack_require__(361),
|
|
3608
4386
|
inspect = _require2.inspect;
|
|
3609
4387
|
|
|
3610
4388
|
var custom = inspect && inspect.custom || 'inspect';
|
|
@@ -3800,7 +4578,7 @@ function () {
|
|
|
3800
4578
|
|
|
3801
4579
|
/***/ }),
|
|
3802
4580
|
|
|
3803
|
-
/***/
|
|
4581
|
+
/***/ 195:
|
|
3804
4582
|
/***/ ((module) => {
|
|
3805
4583
|
|
|
3806
4584
|
// undocumented cb() API, needed for core, not for public API
|
|
@@ -3911,14 +4689,14 @@ module.exports = {
|
|
|
3911
4689
|
|
|
3912
4690
|
/***/ }),
|
|
3913
4691
|
|
|
3914
|
-
/***/
|
|
4692
|
+
/***/ 610:
|
|
3915
4693
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
3916
4694
|
|
|
3917
4695
|
// Ported from https://github.com/mafintosh/end-of-stream with
|
|
3918
4696
|
// permission from the author, Mathias Buus (@mafintosh).
|
|
3919
4697
|
|
|
3920
4698
|
|
|
3921
|
-
var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(
|
|
4699
|
+
var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(281)/* .codes.ERR_STREAM_PREMATURE_CLOSE */ .q.ERR_STREAM_PREMATURE_CLOSE);
|
|
3922
4700
|
|
|
3923
4701
|
function once(callback) {
|
|
3924
4702
|
var called = false;
|
|
@@ -4021,7 +4799,7 @@ module.exports = eos;
|
|
|
4021
4799
|
|
|
4022
4800
|
/***/ }),
|
|
4023
4801
|
|
|
4024
|
-
/***/
|
|
4802
|
+
/***/ 167:
|
|
4025
4803
|
/***/ ((module) => {
|
|
4026
4804
|
|
|
4027
4805
|
module.exports = function () {
|
|
@@ -4031,7 +4809,7 @@ module.exports = function () {
|
|
|
4031
4809
|
|
|
4032
4810
|
/***/ }),
|
|
4033
4811
|
|
|
4034
|
-
/***/
|
|
4812
|
+
/***/ 946:
|
|
4035
4813
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
4036
4814
|
|
|
4037
4815
|
// Ported from https://github.com/mafintosh/pump with
|
|
@@ -4049,7 +4827,7 @@ function once(callback) {
|
|
|
4049
4827
|
};
|
|
4050
4828
|
}
|
|
4051
4829
|
|
|
4052
|
-
var _require$codes = (__webpack_require__(
|
|
4830
|
+
var _require$codes = (__webpack_require__(281)/* .codes */ .q),
|
|
4053
4831
|
ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
|
|
4054
4832
|
ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
|
|
4055
4833
|
|
|
@@ -4068,7 +4846,7 @@ function destroyer(stream, reading, writing, callback) {
|
|
|
4068
4846
|
stream.on('close', function () {
|
|
4069
4847
|
closed = true;
|
|
4070
4848
|
});
|
|
4071
|
-
if (eos === undefined) eos = __webpack_require__(
|
|
4849
|
+
if (eos === undefined) eos = __webpack_require__(610);
|
|
4072
4850
|
eos(stream, {
|
|
4073
4851
|
readable: reading,
|
|
4074
4852
|
writable: writing
|
|
@@ -4134,12 +4912,12 @@ module.exports = pipeline;
|
|
|
4134
4912
|
|
|
4135
4913
|
/***/ }),
|
|
4136
4914
|
|
|
4137
|
-
/***/
|
|
4915
|
+
/***/ 457:
|
|
4138
4916
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
4139
4917
|
|
|
4140
4918
|
|
|
4141
4919
|
|
|
4142
|
-
var ERR_INVALID_OPT_VALUE = (__webpack_require__(
|
|
4920
|
+
var ERR_INVALID_OPT_VALUE = (__webpack_require__(281)/* .codes.ERR_INVALID_OPT_VALUE */ .q.ERR_INVALID_OPT_VALUE);
|
|
4143
4921
|
|
|
4144
4922
|
function highWaterMarkFrom(options, isDuplex, duplexKey) {
|
|
4145
4923
|
return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
|
|
@@ -4167,36 +4945,36 @@ module.exports = {
|
|
|
4167
4945
|
|
|
4168
4946
|
/***/ }),
|
|
4169
4947
|
|
|
4170
|
-
/***/
|
|
4948
|
+
/***/ 503:
|
|
4171
4949
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
4172
4950
|
|
|
4173
|
-
module.exports = __webpack_require__(
|
|
4951
|
+
module.exports = __webpack_require__(370).EventEmitter;
|
|
4174
4952
|
|
|
4175
4953
|
|
|
4176
4954
|
/***/ }),
|
|
4177
4955
|
|
|
4178
|
-
/***/
|
|
4956
|
+
/***/ 473:
|
|
4179
4957
|
/***/ ((module, exports, __webpack_require__) => {
|
|
4180
4958
|
|
|
4181
|
-
exports = module.exports = __webpack_require__(
|
|
4959
|
+
exports = module.exports = __webpack_require__(481);
|
|
4182
4960
|
exports.Stream = exports;
|
|
4183
4961
|
exports.Readable = exports;
|
|
4184
|
-
exports.Writable = __webpack_require__(
|
|
4185
|
-
exports.Duplex = __webpack_require__(
|
|
4186
|
-
exports.Transform = __webpack_require__(
|
|
4187
|
-
exports.PassThrough = __webpack_require__(
|
|
4188
|
-
exports.finished = __webpack_require__(
|
|
4189
|
-
exports.pipeline = __webpack_require__(
|
|
4962
|
+
exports.Writable = __webpack_require__(229);
|
|
4963
|
+
exports.Duplex = __webpack_require__(753);
|
|
4964
|
+
exports.Transform = __webpack_require__(605);
|
|
4965
|
+
exports.PassThrough = __webpack_require__(725);
|
|
4966
|
+
exports.finished = __webpack_require__(610);
|
|
4967
|
+
exports.pipeline = __webpack_require__(946);
|
|
4190
4968
|
|
|
4191
4969
|
|
|
4192
4970
|
/***/ }),
|
|
4193
4971
|
|
|
4194
|
-
/***/
|
|
4972
|
+
/***/ 509:
|
|
4195
4973
|
/***/ ((module, exports, __webpack_require__) => {
|
|
4196
4974
|
|
|
4197
4975
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
4198
4976
|
/* eslint-disable node/no-deprecated-api */
|
|
4199
|
-
var buffer = __webpack_require__(
|
|
4977
|
+
var buffer = __webpack_require__(291)
|
|
4200
4978
|
var Buffer = buffer.Buffer
|
|
4201
4979
|
|
|
4202
4980
|
// alternative to using Object.keys for old browsers
|
|
@@ -4263,7 +5041,7 @@ SafeBuffer.allocUnsafeSlow = function (size) {
|
|
|
4263
5041
|
|
|
4264
5042
|
/***/ }),
|
|
4265
5043
|
|
|
4266
|
-
/***/
|
|
5044
|
+
/***/ 553:
|
|
4267
5045
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4268
5046
|
|
|
4269
5047
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
@@ -4291,7 +5069,7 @@ SafeBuffer.allocUnsafeSlow = function (size) {
|
|
|
4291
5069
|
|
|
4292
5070
|
/*<replacement>*/
|
|
4293
5071
|
|
|
4294
|
-
var Buffer = (__webpack_require__(
|
|
5072
|
+
var Buffer = (__webpack_require__(509).Buffer);
|
|
4295
5073
|
/*</replacement>*/
|
|
4296
5074
|
|
|
4297
5075
|
var isEncoding = Buffer.isEncoding || function (encoding) {
|
|
@@ -4565,7 +5343,7 @@ function simpleEnd(buf) {
|
|
|
4565
5343
|
|
|
4566
5344
|
/***/ }),
|
|
4567
5345
|
|
|
4568
|
-
/***/
|
|
5346
|
+
/***/ 927:
|
|
4569
5347
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
4570
5348
|
|
|
4571
5349
|
|
|
@@ -4639,7 +5417,7 @@ function config (name) {
|
|
|
4639
5417
|
|
|
4640
5418
|
/***/ }),
|
|
4641
5419
|
|
|
4642
|
-
/***/
|
|
5420
|
+
/***/ 988:
|
|
4643
5421
|
/***/ ((module) => {
|
|
4644
5422
|
|
|
4645
5423
|
module.exports = read
|
|
@@ -4675,7 +5453,7 @@ function read(buf, offset) {
|
|
|
4675
5453
|
|
|
4676
5454
|
/***/ }),
|
|
4677
5455
|
|
|
4678
|
-
/***/
|
|
5456
|
+
/***/ 312:
|
|
4679
5457
|
/***/ ((module) => {
|
|
4680
5458
|
|
|
4681
5459
|
module.exports = encode
|
|
@@ -4712,12 +5490,12 @@ function encode(num, out, offset) {
|
|
|
4712
5490
|
|
|
4713
5491
|
/***/ }),
|
|
4714
5492
|
|
|
4715
|
-
/***/
|
|
5493
|
+
/***/ 676:
|
|
4716
5494
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
4717
5495
|
|
|
4718
5496
|
module.exports = {
|
|
4719
|
-
encode: __webpack_require__(
|
|
4720
|
-
, decode: __webpack_require__(
|
|
5497
|
+
encode: __webpack_require__(312)
|
|
5498
|
+
, decode: __webpack_require__(988)
|
|
4721
5499
|
, encodingLength: __webpack_require__(82)
|
|
4722
5500
|
}
|
|
4723
5501
|
|
|
@@ -4756,7 +5534,7 @@ module.exports = function (value) {
|
|
|
4756
5534
|
|
|
4757
5535
|
/***/ }),
|
|
4758
5536
|
|
|
4759
|
-
/***/
|
|
5537
|
+
/***/ 277:
|
|
4760
5538
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4761
5539
|
|
|
4762
5540
|
|
|
@@ -4886,9 +5664,7 @@ function fromByteArray (uint8) {
|
|
|
4886
5664
|
|
|
4887
5665
|
// go through the array every three bytes, we'll deal with trailing stuff later
|
|
4888
5666
|
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
|
4889
|
-
parts.push(encodeChunk(
|
|
4890
|
-
uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
|
|
4891
|
-
))
|
|
5667
|
+
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
|
|
4892
5668
|
}
|
|
4893
5669
|
|
|
4894
5670
|
// pad the end with zeros, but make sure to not forget the extra bytes
|
|
@@ -4915,7 +5691,7 @@ function fromByteArray (uint8) {
|
|
|
4915
5691
|
|
|
4916
5692
|
/***/ }),
|
|
4917
5693
|
|
|
4918
|
-
/***/
|
|
5694
|
+
/***/ 291:
|
|
4919
5695
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4920
5696
|
|
|
4921
5697
|
/*!
|
|
@@ -4928,11 +5704,11 @@ function fromByteArray (uint8) {
|
|
|
4928
5704
|
|
|
4929
5705
|
|
|
4930
5706
|
|
|
4931
|
-
var base64 = __webpack_require__(
|
|
4932
|
-
var ieee754 = __webpack_require__(
|
|
5707
|
+
var base64 = __webpack_require__(277)
|
|
5708
|
+
var ieee754 = __webpack_require__(608)
|
|
4933
5709
|
var customInspectSymbol =
|
|
4934
|
-
(typeof Symbol === 'function' && typeof Symbol
|
|
4935
|
-
? Symbol
|
|
5710
|
+
(typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
|
|
5711
|
+
? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
|
|
4936
5712
|
: null
|
|
4937
5713
|
|
|
4938
5714
|
exports.Buffer = Buffer
|
|
@@ -5036,7 +5812,7 @@ function from (value, encodingOrOffset, length) {
|
|
|
5036
5812
|
}
|
|
5037
5813
|
|
|
5038
5814
|
if (ArrayBuffer.isView(value)) {
|
|
5039
|
-
return
|
|
5815
|
+
return fromArrayView(value)
|
|
5040
5816
|
}
|
|
5041
5817
|
|
|
5042
5818
|
if (value == null) {
|
|
@@ -5117,7 +5893,7 @@ function alloc (size, fill, encoding) {
|
|
|
5117
5893
|
if (fill !== undefined) {
|
|
5118
5894
|
// Only pay attention to encoding if it's a string. This
|
|
5119
5895
|
// prevents accidentally sending in a number that would
|
|
5120
|
-
// be
|
|
5896
|
+
// be interpreted as a start offset.
|
|
5121
5897
|
return typeof encoding === 'string'
|
|
5122
5898
|
? createBuffer(size).fill(fill, encoding)
|
|
5123
5899
|
: createBuffer(size).fill(fill)
|
|
@@ -5184,6 +5960,14 @@ function fromArrayLike (array) {
|
|
|
5184
5960
|
return buf
|
|
5185
5961
|
}
|
|
5186
5962
|
|
|
5963
|
+
function fromArrayView (arrayView) {
|
|
5964
|
+
if (isInstance(arrayView, Uint8Array)) {
|
|
5965
|
+
var copy = new Uint8Array(arrayView)
|
|
5966
|
+
return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)
|
|
5967
|
+
}
|
|
5968
|
+
return fromArrayLike(arrayView)
|
|
5969
|
+
}
|
|
5970
|
+
|
|
5187
5971
|
function fromArrayBuffer (array, byteOffset, length) {
|
|
5188
5972
|
if (byteOffset < 0 || array.byteLength < byteOffset) {
|
|
5189
5973
|
throw new RangeError('"offset" is outside of buffer bounds')
|
|
@@ -5323,12 +6107,20 @@ Buffer.concat = function concat (list, length) {
|
|
|
5323
6107
|
for (i = 0; i < list.length; ++i) {
|
|
5324
6108
|
var buf = list[i]
|
|
5325
6109
|
if (isInstance(buf, Uint8Array)) {
|
|
5326
|
-
buf
|
|
5327
|
-
|
|
5328
|
-
|
|
6110
|
+
if (pos + buf.length > buffer.length) {
|
|
6111
|
+
Buffer.from(buf).copy(buffer, pos)
|
|
6112
|
+
} else {
|
|
6113
|
+
Uint8Array.prototype.set.call(
|
|
6114
|
+
buffer,
|
|
6115
|
+
buf,
|
|
6116
|
+
pos
|
|
6117
|
+
)
|
|
6118
|
+
}
|
|
6119
|
+
} else if (!Buffer.isBuffer(buf)) {
|
|
5329
6120
|
throw new TypeError('"list" argument must be an Array of Buffers')
|
|
6121
|
+
} else {
|
|
6122
|
+
buf.copy(buffer, pos)
|
|
5330
6123
|
}
|
|
5331
|
-
buf.copy(buffer, pos)
|
|
5332
6124
|
pos += buf.length
|
|
5333
6125
|
}
|
|
5334
6126
|
return buffer
|
|
@@ -5410,7 +6202,7 @@ function slowToString (encoding, start, end) {
|
|
|
5410
6202
|
return ''
|
|
5411
6203
|
}
|
|
5412
6204
|
|
|
5413
|
-
// Force
|
|
6205
|
+
// Force coercion to uint32. This will also coerce falsey/NaN values to 0.
|
|
5414
6206
|
end >>>= 0
|
|
5415
6207
|
start >>>= 0
|
|
5416
6208
|
|
|
@@ -5761,10 +6553,6 @@ function asciiWrite (buf, string, offset, length) {
|
|
|
5761
6553
|
return blitBuffer(asciiToBytes(string), buf, offset, length)
|
|
5762
6554
|
}
|
|
5763
6555
|
|
|
5764
|
-
function latin1Write (buf, string, offset, length) {
|
|
5765
|
-
return asciiWrite(buf, string, offset, length)
|
|
5766
|
-
}
|
|
5767
|
-
|
|
5768
6556
|
function base64Write (buf, string, offset, length) {
|
|
5769
6557
|
return blitBuffer(base64ToBytes(string), buf, offset, length)
|
|
5770
6558
|
}
|
|
@@ -5820,11 +6608,9 @@ Buffer.prototype.write = function write (string, offset, length, encoding) {
|
|
|
5820
6608
|
return utf8Write(this, string, offset, length)
|
|
5821
6609
|
|
|
5822
6610
|
case 'ascii':
|
|
5823
|
-
return asciiWrite(this, string, offset, length)
|
|
5824
|
-
|
|
5825
6611
|
case 'latin1':
|
|
5826
6612
|
case 'binary':
|
|
5827
|
-
return
|
|
6613
|
+
return asciiWrite(this, string, offset, length)
|
|
5828
6614
|
|
|
5829
6615
|
case 'base64':
|
|
5830
6616
|
// Warning: maxLength not taken into account in base64Write
|
|
@@ -5867,10 +6653,13 @@ function utf8Slice (buf, start, end) {
|
|
|
5867
6653
|
while (i < end) {
|
|
5868
6654
|
var firstByte = buf[i]
|
|
5869
6655
|
var codePoint = null
|
|
5870
|
-
var bytesPerSequence = (firstByte > 0xEF)
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
6656
|
+
var bytesPerSequence = (firstByte > 0xEF)
|
|
6657
|
+
? 4
|
|
6658
|
+
: (firstByte > 0xDF)
|
|
6659
|
+
? 3
|
|
6660
|
+
: (firstByte > 0xBF)
|
|
6661
|
+
? 2
|
|
6662
|
+
: 1
|
|
5874
6663
|
|
|
5875
6664
|
if (i + bytesPerSequence <= end) {
|
|
5876
6665
|
var secondByte, thirdByte, fourthByte, tempCodePoint
|
|
@@ -5991,7 +6780,8 @@ function hexSlice (buf, start, end) {
|
|
|
5991
6780
|
function utf16leSlice (buf, start, end) {
|
|
5992
6781
|
var bytes = buf.slice(start, end)
|
|
5993
6782
|
var res = ''
|
|
5994
|
-
|
|
6783
|
+
// If bytes.length is odd, the last 8 bits must be ignored (same as node.js)
|
|
6784
|
+
for (var i = 0; i < bytes.length - 1; i += 2) {
|
|
5995
6785
|
res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
|
|
5996
6786
|
}
|
|
5997
6787
|
return res
|
|
@@ -6033,6 +6823,7 @@ function checkOffset (offset, ext, length) {
|
|
|
6033
6823
|
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
|
|
6034
6824
|
}
|
|
6035
6825
|
|
|
6826
|
+
Buffer.prototype.readUintLE =
|
|
6036
6827
|
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
|
|
6037
6828
|
offset = offset >>> 0
|
|
6038
6829
|
byteLength = byteLength >>> 0
|
|
@@ -6048,6 +6839,7 @@ Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert)
|
|
|
6048
6839
|
return val
|
|
6049
6840
|
}
|
|
6050
6841
|
|
|
6842
|
+
Buffer.prototype.readUintBE =
|
|
6051
6843
|
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
|
|
6052
6844
|
offset = offset >>> 0
|
|
6053
6845
|
byteLength = byteLength >>> 0
|
|
@@ -6064,24 +6856,28 @@ Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert)
|
|
|
6064
6856
|
return val
|
|
6065
6857
|
}
|
|
6066
6858
|
|
|
6859
|
+
Buffer.prototype.readUint8 =
|
|
6067
6860
|
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
|
|
6068
6861
|
offset = offset >>> 0
|
|
6069
6862
|
if (!noAssert) checkOffset(offset, 1, this.length)
|
|
6070
6863
|
return this[offset]
|
|
6071
6864
|
}
|
|
6072
6865
|
|
|
6866
|
+
Buffer.prototype.readUint16LE =
|
|
6073
6867
|
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
|
|
6074
6868
|
offset = offset >>> 0
|
|
6075
6869
|
if (!noAssert) checkOffset(offset, 2, this.length)
|
|
6076
6870
|
return this[offset] | (this[offset + 1] << 8)
|
|
6077
6871
|
}
|
|
6078
6872
|
|
|
6873
|
+
Buffer.prototype.readUint16BE =
|
|
6079
6874
|
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
|
|
6080
6875
|
offset = offset >>> 0
|
|
6081
6876
|
if (!noAssert) checkOffset(offset, 2, this.length)
|
|
6082
6877
|
return (this[offset] << 8) | this[offset + 1]
|
|
6083
6878
|
}
|
|
6084
6879
|
|
|
6880
|
+
Buffer.prototype.readUint32LE =
|
|
6085
6881
|
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
|
|
6086
6882
|
offset = offset >>> 0
|
|
6087
6883
|
if (!noAssert) checkOffset(offset, 4, this.length)
|
|
@@ -6092,6 +6888,7 @@ Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
|
|
|
6092
6888
|
(this[offset + 3] * 0x1000000)
|
|
6093
6889
|
}
|
|
6094
6890
|
|
|
6891
|
+
Buffer.prototype.readUint32BE =
|
|
6095
6892
|
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
|
|
6096
6893
|
offset = offset >>> 0
|
|
6097
6894
|
if (!noAssert) checkOffset(offset, 4, this.length)
|
|
@@ -6209,6 +7006,7 @@ function checkInt (buf, value, offset, ext, max, min) {
|
|
|
6209
7006
|
if (offset + ext > buf.length) throw new RangeError('Index out of range')
|
|
6210
7007
|
}
|
|
6211
7008
|
|
|
7009
|
+
Buffer.prototype.writeUintLE =
|
|
6212
7010
|
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
|
|
6213
7011
|
value = +value
|
|
6214
7012
|
offset = offset >>> 0
|
|
@@ -6228,6 +7026,7 @@ Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength,
|
|
|
6228
7026
|
return offset + byteLength
|
|
6229
7027
|
}
|
|
6230
7028
|
|
|
7029
|
+
Buffer.prototype.writeUintBE =
|
|
6231
7030
|
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
|
|
6232
7031
|
value = +value
|
|
6233
7032
|
offset = offset >>> 0
|
|
@@ -6247,6 +7046,7 @@ Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength,
|
|
|
6247
7046
|
return offset + byteLength
|
|
6248
7047
|
}
|
|
6249
7048
|
|
|
7049
|
+
Buffer.prototype.writeUint8 =
|
|
6250
7050
|
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
|
|
6251
7051
|
value = +value
|
|
6252
7052
|
offset = offset >>> 0
|
|
@@ -6255,6 +7055,7 @@ Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
|
|
|
6255
7055
|
return offset + 1
|
|
6256
7056
|
}
|
|
6257
7057
|
|
|
7058
|
+
Buffer.prototype.writeUint16LE =
|
|
6258
7059
|
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
|
|
6259
7060
|
value = +value
|
|
6260
7061
|
offset = offset >>> 0
|
|
@@ -6264,6 +7065,7 @@ Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert
|
|
|
6264
7065
|
return offset + 2
|
|
6265
7066
|
}
|
|
6266
7067
|
|
|
7068
|
+
Buffer.prototype.writeUint16BE =
|
|
6267
7069
|
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
|
|
6268
7070
|
value = +value
|
|
6269
7071
|
offset = offset >>> 0
|
|
@@ -6273,6 +7075,7 @@ Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert
|
|
|
6273
7075
|
return offset + 2
|
|
6274
7076
|
}
|
|
6275
7077
|
|
|
7078
|
+
Buffer.prototype.writeUint32LE =
|
|
6276
7079
|
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
|
|
6277
7080
|
value = +value
|
|
6278
7081
|
offset = offset >>> 0
|
|
@@ -6284,6 +7087,7 @@ Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert
|
|
|
6284
7087
|
return offset + 4
|
|
6285
7088
|
}
|
|
6286
7089
|
|
|
7090
|
+
Buffer.prototype.writeUint32BE =
|
|
6287
7091
|
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
|
|
6288
7092
|
value = +value
|
|
6289
7093
|
offset = offset >>> 0
|
|
@@ -6463,11 +7267,6 @@ Buffer.prototype.copy = function copy (target, targetStart, start, end) {
|
|
|
6463
7267
|
if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
|
|
6464
7268
|
// Use built-in when available, missing from IE11
|
|
6465
7269
|
this.copyWithin(targetStart, start, end)
|
|
6466
|
-
} else if (this === target && start < targetStart && targetStart < end) {
|
|
6467
|
-
// descending copy from end
|
|
6468
|
-
for (var i = len - 1; i >= 0; --i) {
|
|
6469
|
-
target[i + targetStart] = this[i + start]
|
|
6470
|
-
}
|
|
6471
7270
|
} else {
|
|
6472
7271
|
Uint8Array.prototype.set.call(
|
|
6473
7272
|
target,
|
|
@@ -6716,9 +7515,10 @@ var hexSliceLookupTable = (function () {
|
|
|
6716
7515
|
|
|
6717
7516
|
/***/ }),
|
|
6718
7517
|
|
|
6719
|
-
/***/
|
|
7518
|
+
/***/ 608:
|
|
6720
7519
|
/***/ ((__unused_webpack_module, exports) => {
|
|
6721
7520
|
|
|
7521
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
6722
7522
|
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
|
|
6723
7523
|
var e, m
|
|
6724
7524
|
var eLen = (nBytes * 8) - mLen - 1
|
|
@@ -6807,14 +7607,14 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
|
|
6807
7607
|
|
|
6808
7608
|
/***/ }),
|
|
6809
7609
|
|
|
6810
|
-
/***/
|
|
7610
|
+
/***/ 361:
|
|
6811
7611
|
/***/ (() => {
|
|
6812
7612
|
|
|
6813
7613
|
/* (ignored) */
|
|
6814
7614
|
|
|
6815
7615
|
/***/ }),
|
|
6816
7616
|
|
|
6817
|
-
/***/
|
|
7617
|
+
/***/ 616:
|
|
6818
7618
|
/***/ (() => {
|
|
6819
7619
|
|
|
6820
7620
|
/* (ignored) */
|
|
@@ -6844,1084 +7644,80 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
|
|
6844
7644
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
6845
7645
|
/******/
|
|
6846
7646
|
/******/ // Return the exports of the module
|
|
6847
|
-
/******/ return module.exports;
|
|
6848
|
-
/******/ }
|
|
6849
|
-
/******/
|
|
6850
|
-
|
|
6851
|
-
/******/
|
|
6852
|
-
/******/
|
|
6853
|
-
|
|
6854
|
-
/******/
|
|
6855
|
-
/******/
|
|
6856
|
-
/******/
|
|
6857
|
-
/******/
|
|
6858
|
-
/******/
|
|
6859
|
-
/******/
|
|
6860
|
-
/******/
|
|
6861
|
-
/******/
|
|
6862
|
-
/******/
|
|
6863
|
-
/******/
|
|
6864
|
-
/******/
|
|
6865
|
-
/******/
|
|
6866
|
-
/******/
|
|
6867
|
-
/******/
|
|
6868
|
-
/******/
|
|
6869
|
-
/******/
|
|
6870
|
-
/******/
|
|
6871
|
-
/******/
|
|
6872
|
-
/******/
|
|
6873
|
-
/******/
|
|
6874
|
-
/******/
|
|
6875
|
-
/******/
|
|
6876
|
-
/******/
|
|
6877
|
-
/******/
|
|
6878
|
-
/******/
|
|
6879
|
-
/******/
|
|
6880
|
-
/******/
|
|
6881
|
-
/******/
|
|
6882
|
-
/******/
|
|
6883
|
-
/******/
|
|
6884
|
-
/******/
|
|
6885
|
-
/******/
|
|
6886
|
-
/******/
|
|
6887
|
-
/******/
|
|
6888
|
-
/******/
|
|
6889
|
-
/******/
|
|
6890
|
-
/******/
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
/******/
|
|
6896
|
-
/******/ /* webpack/runtime/define property getters */
|
|
6897
|
-
/******/ (() => {
|
|
6898
|
-
/******/ // define getter functions for harmony exports
|
|
6899
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
|
6900
|
-
/******/ for(var key in definition) {
|
|
6901
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
6902
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
6903
|
-
/******/ }
|
|
6904
|
-
/******/ }
|
|
6905
|
-
/******/ };
|
|
6906
|
-
/******/ })();
|
|
6907
|
-
/******/
|
|
6908
|
-
/******/ /* webpack/runtime/ensure chunk */
|
|
6909
|
-
/******/ (() => {
|
|
6910
|
-
/******/ __webpack_require__.f = {};
|
|
6911
|
-
/******/ // This file contains only the entry chunk.
|
|
6912
|
-
/******/ // The chunk loading function for additional chunks
|
|
6913
|
-
/******/ __webpack_require__.e = (chunkId) => {
|
|
6914
|
-
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
|
|
6915
|
-
/******/ __webpack_require__.f[key](chunkId, promises);
|
|
6916
|
-
/******/ return promises;
|
|
6917
|
-
/******/ }, []));
|
|
6918
|
-
/******/ };
|
|
6919
|
-
/******/ })();
|
|
6920
|
-
/******/
|
|
6921
|
-
/******/ /* webpack/runtime/get javascript chunk filename */
|
|
6922
|
-
/******/ (() => {
|
|
6923
|
-
/******/ // This function allow to reference async chunks
|
|
6924
|
-
/******/ __webpack_require__.u = (chunkId) => {
|
|
6925
|
-
/******/ // return url for filenames based on template
|
|
6926
|
-
/******/ return "" + "protons" + ".esm";
|
|
6927
|
-
/******/ };
|
|
6928
|
-
/******/ })();
|
|
6929
|
-
/******/
|
|
6930
|
-
/******/ /* webpack/runtime/global */
|
|
6931
|
-
/******/ (() => {
|
|
6932
|
-
/******/ __webpack_require__.g = (function() {
|
|
6933
|
-
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
6934
|
-
/******/ try {
|
|
6935
|
-
/******/ return this || new Function('return this')();
|
|
6936
|
-
/******/ } catch (e) {
|
|
6937
|
-
/******/ if (typeof window === 'object') return window;
|
|
6938
|
-
/******/ }
|
|
6939
|
-
/******/ })();
|
|
6940
|
-
/******/ })();
|
|
6941
|
-
/******/
|
|
6942
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
6943
|
-
/******/ (() => {
|
|
6944
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
6945
|
-
/******/ })();
|
|
6946
|
-
/******/
|
|
6947
|
-
/******/ /* webpack/runtime/load script */
|
|
6948
|
-
/******/ (() => {
|
|
6949
|
-
/******/ var inProgress = {};
|
|
6950
|
-
/******/ var dataWebpackPrefix = "@leofcoin/messages:";
|
|
6951
|
-
/******/ // loadScript function to load a script via script tag
|
|
6952
|
-
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
|
|
6953
|
-
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
|
|
6954
|
-
/******/ var script, needAttach;
|
|
6955
|
-
/******/ if(key !== undefined) {
|
|
6956
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
6957
|
-
/******/ for(var i = 0; i < scripts.length; i++) {
|
|
6958
|
-
/******/ var s = scripts[i];
|
|
6959
|
-
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
|
|
6960
|
-
/******/ }
|
|
6961
|
-
/******/ }
|
|
6962
|
-
/******/ if(!script) {
|
|
6963
|
-
/******/ needAttach = true;
|
|
6964
|
-
/******/ script = document.createElement('script');
|
|
6965
|
-
/******/ script.type = "module";
|
|
6966
|
-
/******/ script.charset = 'utf-8';
|
|
6967
|
-
/******/ script.timeout = 120;
|
|
6968
|
-
/******/ if (__webpack_require__.nc) {
|
|
6969
|
-
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
|
6970
|
-
/******/ }
|
|
6971
|
-
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
|
|
6972
|
-
/******/ script.src = url;
|
|
6973
|
-
/******/ }
|
|
6974
|
-
/******/ inProgress[url] = [done];
|
|
6975
|
-
/******/ var onScriptComplete = (prev, event) => {
|
|
6976
|
-
/******/ // avoid mem leaks in IE.
|
|
6977
|
-
/******/ script.onerror = script.onload = null;
|
|
6978
|
-
/******/ clearTimeout(timeout);
|
|
6979
|
-
/******/ var doneFns = inProgress[url];
|
|
6980
|
-
/******/ delete inProgress[url];
|
|
6981
|
-
/******/ script.parentNode && script.parentNode.removeChild(script);
|
|
6982
|
-
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
|
|
6983
|
-
/******/ if(prev) return prev(event);
|
|
6984
|
-
/******/ }
|
|
6985
|
-
/******/ ;
|
|
6986
|
-
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
|
|
6987
|
-
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
|
|
6988
|
-
/******/ script.onload = onScriptComplete.bind(null, script.onload);
|
|
6989
|
-
/******/ needAttach && document.head.appendChild(script);
|
|
6990
|
-
/******/ };
|
|
6991
|
-
/******/ })();
|
|
6992
|
-
/******/
|
|
6993
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
6994
|
-
/******/ (() => {
|
|
6995
|
-
/******/ // define __esModule on exports
|
|
6996
|
-
/******/ __webpack_require__.r = (exports) => {
|
|
6997
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
6998
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
6999
|
-
/******/ }
|
|
7000
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
7001
|
-
/******/ };
|
|
7002
|
-
/******/ })();
|
|
7003
|
-
/******/
|
|
7004
|
-
/******/ /* webpack/runtime/publicPath */
|
|
7005
|
-
/******/ (() => {
|
|
7006
|
-
/******/ var scriptUrl;
|
|
7007
|
-
/******/ if (typeof import.meta.url === "string") scriptUrl = import.meta.url
|
|
7008
|
-
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
|
|
7009
|
-
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
|
|
7010
|
-
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
|
|
7011
|
-
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
7012
|
-
/******/ __webpack_require__.p = scriptUrl;
|
|
7013
|
-
/******/ })();
|
|
7014
|
-
/******/
|
|
7015
|
-
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
7016
|
-
/******/ (() => {
|
|
7017
|
-
/******/ // no baseURI
|
|
7018
|
-
/******/
|
|
7019
|
-
/******/ // object to store loaded and loading chunks
|
|
7020
|
-
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
|
7021
|
-
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
|
7022
|
-
/******/ var installedChunks = {
|
|
7023
|
-
/******/ 158: 0
|
|
7024
|
-
/******/ };
|
|
7025
|
-
/******/
|
|
7026
|
-
/******/ __webpack_require__.f.j = (chunkId, promises) => {
|
|
7027
|
-
/******/ // JSONP chunk loading for javascript
|
|
7028
|
-
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
|
|
7029
|
-
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
|
7030
|
-
/******/
|
|
7031
|
-
/******/ // a Promise means "currently loading".
|
|
7032
|
-
/******/ if(installedChunkData) {
|
|
7033
|
-
/******/ promises.push(installedChunkData[2]);
|
|
7034
|
-
/******/ } else {
|
|
7035
|
-
/******/ if(true) { // all chunks have JS
|
|
7036
|
-
/******/ // setup Promise in chunk cache
|
|
7037
|
-
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
|
|
7038
|
-
/******/ promises.push(installedChunkData[2] = promise);
|
|
7039
|
-
/******/
|
|
7040
|
-
/******/ // start chunk loading
|
|
7041
|
-
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
|
|
7042
|
-
/******/ // create error before stack unwound to get useful stacktrace later
|
|
7043
|
-
/******/ var error = new Error();
|
|
7044
|
-
/******/ var loadingEnded = (event) => {
|
|
7045
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
7046
|
-
/******/ installedChunkData = installedChunks[chunkId];
|
|
7047
|
-
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
7048
|
-
/******/ if(installedChunkData) {
|
|
7049
|
-
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
7050
|
-
/******/ var realSrc = event && event.target && event.target.src;
|
|
7051
|
-
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
7052
|
-
/******/ error.name = 'ChunkLoadError';
|
|
7053
|
-
/******/ error.type = errorType;
|
|
7054
|
-
/******/ error.request = realSrc;
|
|
7055
|
-
/******/ installedChunkData[1](error);
|
|
7056
|
-
/******/ }
|
|
7057
|
-
/******/ }
|
|
7058
|
-
/******/ };
|
|
7059
|
-
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
7060
|
-
/******/ } else installedChunks[chunkId] = 0;
|
|
7061
|
-
/******/ }
|
|
7062
|
-
/******/ }
|
|
7063
|
-
/******/ };
|
|
7064
|
-
/******/
|
|
7065
|
-
/******/ // no prefetching
|
|
7066
|
-
/******/
|
|
7067
|
-
/******/ // no preloaded
|
|
7068
|
-
/******/
|
|
7069
|
-
/******/ // no HMR
|
|
7070
|
-
/******/
|
|
7071
|
-
/******/ // no HMR manifest
|
|
7072
|
-
/******/
|
|
7073
|
-
/******/ // no on chunks loaded
|
|
7074
|
-
/******/
|
|
7075
|
-
/******/ // install a JSONP callback for chunk loading
|
|
7076
|
-
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
7077
|
-
/******/ var [chunkIds, moreModules, runtime] = data;
|
|
7078
|
-
/******/ // add "moreModules" to the modules object,
|
|
7079
|
-
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
7080
|
-
/******/ var moduleId, chunkId, i = 0;
|
|
7081
|
-
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
7082
|
-
/******/ for(moduleId in moreModules) {
|
|
7083
|
-
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
7084
|
-
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
7085
|
-
/******/ }
|
|
7086
|
-
/******/ }
|
|
7087
|
-
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
7088
|
-
/******/ }
|
|
7089
|
-
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
7090
|
-
/******/ for(;i < chunkIds.length; i++) {
|
|
7091
|
-
/******/ chunkId = chunkIds[i];
|
|
7092
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
7093
|
-
/******/ installedChunks[chunkId][0]();
|
|
7094
|
-
/******/ }
|
|
7095
|
-
/******/ installedChunks[chunkId] = 0;
|
|
7096
|
-
/******/ }
|
|
7097
|
-
/******/
|
|
7098
|
-
/******/ }
|
|
7099
|
-
/******/
|
|
7100
|
-
/******/ var chunkLoadingGlobal = self["webpackChunk_leofcoin_messages"] = self["webpackChunk_leofcoin_messages"] || [];
|
|
7101
|
-
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
7102
|
-
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
7103
|
-
/******/ })();
|
|
7104
|
-
/******/
|
|
7105
|
-
/************************************************************************/
|
|
7106
|
-
var __webpack_exports__ = {};
|
|
7107
|
-
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
7108
|
-
(() => {
|
|
7109
|
-
|
|
7110
|
-
// EXPORTS
|
|
7111
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
7112
|
-
"pK": () => (/* reexport */ bw_namespaceObject),
|
|
7113
|
-
"iP": () => (/* reexport */ bw_request_namespaceObject),
|
|
7114
|
-
"NH": () => (/* reexport */ block_namespaceObject),
|
|
7115
|
-
"VJ": () => (/* reexport */ contract_namespaceObject),
|
|
7116
|
-
"$Z": () => (/* reexport */ transaction_namespaceObject)
|
|
7117
|
-
});
|
|
7118
|
-
|
|
7119
|
-
// NAMESPACE OBJECT: ./node_modules/@leofcoin/codec-format-interface/src/codec-format-interface.js
|
|
7120
|
-
var codec_format_interface_namespaceObject = {};
|
|
7121
|
-
__webpack_require__.r(codec_format_interface_namespaceObject);
|
|
7122
|
-
__webpack_require__.d(codec_format_interface_namespaceObject, {
|
|
7123
|
-
"default": () => (FormatInterface)
|
|
7124
|
-
});
|
|
7125
|
-
|
|
7126
|
-
// NAMESPACE OBJECT: ./src/messages/contract.js
|
|
7127
|
-
var contract_namespaceObject = {};
|
|
7128
|
-
__webpack_require__.r(contract_namespaceObject);
|
|
7129
|
-
__webpack_require__.d(contract_namespaceObject, {
|
|
7130
|
-
"default": () => (ContractMessage)
|
|
7131
|
-
});
|
|
7132
|
-
|
|
7133
|
-
// NAMESPACE OBJECT: ./src/messages/transaction.js
|
|
7134
|
-
var transaction_namespaceObject = {};
|
|
7135
|
-
__webpack_require__.r(transaction_namespaceObject);
|
|
7136
|
-
__webpack_require__.d(transaction_namespaceObject, {
|
|
7137
|
-
"default": () => (TransactionMessage)
|
|
7138
|
-
});
|
|
7139
|
-
|
|
7140
|
-
// NAMESPACE OBJECT: ./src/messages/block.js
|
|
7141
|
-
var block_namespaceObject = {};
|
|
7142
|
-
__webpack_require__.r(block_namespaceObject);
|
|
7143
|
-
__webpack_require__.d(block_namespaceObject, {
|
|
7144
|
-
"default": () => (BlockMessage)
|
|
7145
|
-
});
|
|
7146
|
-
|
|
7147
|
-
// NAMESPACE OBJECT: ./src/messages/bw.js
|
|
7148
|
-
var bw_namespaceObject = {};
|
|
7149
|
-
__webpack_require__.r(bw_namespaceObject);
|
|
7150
|
-
__webpack_require__.d(bw_namespaceObject, {
|
|
7151
|
-
"default": () => (BWMessage)
|
|
7152
|
-
});
|
|
7153
|
-
|
|
7154
|
-
// NAMESPACE OBJECT: ./src/messages/bw-request.js
|
|
7155
|
-
var bw_request_namespaceObject = {};
|
|
7156
|
-
__webpack_require__.r(bw_request_namespaceObject);
|
|
7157
|
-
__webpack_require__.d(bw_request_namespaceObject, {
|
|
7158
|
-
"default": () => (BWRequestMessage)
|
|
7159
|
-
});
|
|
7160
|
-
|
|
7161
|
-
;// CONCATENATED MODULE: ./src/protos/block.proto.js
|
|
7162
|
-
/* harmony default export */ const block_proto = (`
|
|
7163
|
-
message ValidatorMessage {
|
|
7164
|
-
required string address = 1;
|
|
7165
|
-
required string reward = 2;
|
|
7166
|
-
}
|
|
7167
|
-
|
|
7168
|
-
message Transaction {
|
|
7169
|
-
required string hash = 1;
|
|
7170
|
-
required uint64 timestamp = 2;
|
|
7171
|
-
required string from = 3;
|
|
7172
|
-
required string to = 4;
|
|
7173
|
-
required uint64 nonce = 5;
|
|
7174
|
-
required string method = 6;
|
|
7175
|
-
repeated string params = 7;
|
|
7176
|
-
}
|
|
7177
|
-
|
|
7178
|
-
message BlockMessage {
|
|
7179
|
-
required uint64 index = 1;
|
|
7180
|
-
required string previousHash = 3;
|
|
7181
|
-
required uint64 timestamp = 4;
|
|
7182
|
-
required uint64 reward = 5;
|
|
7183
|
-
required string fees = 6;
|
|
7184
|
-
repeated Transaction transactions = 7;
|
|
7185
|
-
repeated ValidatorMessage validators = 8;
|
|
7186
|
-
}
|
|
7187
|
-
`);
|
|
7188
|
-
|
|
7189
|
-
;// CONCATENATED MODULE: ./node_modules/@vandeurenglenn/base-x/src/base-x.js
|
|
7190
|
-
// base-x encoding / decoding
|
|
7191
|
-
// Copyright (c) 2018 base-x contributors
|
|
7192
|
-
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
7193
|
-
// Distributed under the MIT software license, see the accompanying
|
|
7194
|
-
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
7195
|
-
const base = ALPHABET => {
|
|
7196
|
-
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
7197
|
-
const BASE_MAP = new Uint8Array(256)
|
|
7198
|
-
for (let j = 0; j < BASE_MAP.length; j++) {
|
|
7199
|
-
BASE_MAP[j] = 255
|
|
7200
|
-
}
|
|
7201
|
-
for (let i = 0; i < ALPHABET.length; i++) {
|
|
7202
|
-
const x = ALPHABET.charAt(i)
|
|
7203
|
-
const xc = x.charCodeAt(0)
|
|
7204
|
-
if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
|
|
7205
|
-
BASE_MAP[xc] = i
|
|
7206
|
-
}
|
|
7207
|
-
const BASE = ALPHABET.length
|
|
7208
|
-
const LEADER = ALPHABET.charAt(0)
|
|
7209
|
-
const FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up
|
|
7210
|
-
const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up
|
|
7211
|
-
|
|
7212
|
-
const encode = source => {
|
|
7213
|
-
if (source instanceof Uint8Array) {
|
|
7214
|
-
} else if (ArrayBuffer.isView(source)) {
|
|
7215
|
-
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)
|
|
7216
|
-
} else if (Array.isArray(source)) {
|
|
7217
|
-
source = Uint8Array.from(source)
|
|
7218
|
-
}
|
|
7219
|
-
if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
|
|
7220
|
-
if (source.length === 0) { return '' }
|
|
7221
|
-
// Skip & count leading zeroes.
|
|
7222
|
-
let zeroes = 0
|
|
7223
|
-
let length = 0
|
|
7224
|
-
let pbegin = 0
|
|
7225
|
-
const pend = source.length
|
|
7226
|
-
while (pbegin !== pend && source[pbegin] === 0) {
|
|
7227
|
-
pbegin++
|
|
7228
|
-
zeroes++
|
|
7229
|
-
}
|
|
7230
|
-
// Allocate enough space in big-endian base58 representation.
|
|
7231
|
-
const size = ((pend - pbegin) * iFACTOR + 1) >>> 0
|
|
7232
|
-
const b58 = new Uint8Array(size)
|
|
7233
|
-
// Process the bytes.
|
|
7234
|
-
while (pbegin !== pend) {
|
|
7235
|
-
let carry = source[pbegin]
|
|
7236
|
-
// Apply "b58 = b58 * 256 + ch".
|
|
7237
|
-
let i = 0
|
|
7238
|
-
for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
7239
|
-
carry += (256 * b58[it1]) >>> 0
|
|
7240
|
-
b58[it1] = (carry % BASE) >>> 0
|
|
7241
|
-
carry = (carry / BASE) >>> 0
|
|
7242
|
-
}
|
|
7243
|
-
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
7244
|
-
length = i
|
|
7245
|
-
pbegin++
|
|
7246
|
-
}
|
|
7247
|
-
// Skip leading zeroes in base58 result.
|
|
7248
|
-
let it2 = size - length
|
|
7249
|
-
while (it2 !== size && b58[it2] === 0) {
|
|
7250
|
-
it2++
|
|
7251
|
-
}
|
|
7252
|
-
// Translate the result into a string.
|
|
7253
|
-
let str = LEADER.repeat(zeroes)
|
|
7254
|
-
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }
|
|
7255
|
-
return str
|
|
7256
|
-
}
|
|
7257
|
-
const decodeUnsafe = source => {
|
|
7258
|
-
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
7259
|
-
if (source.length === 0) { return new Uint8Array() }
|
|
7260
|
-
let psz = 0
|
|
7261
|
-
// Skip and count leading '1's.
|
|
7262
|
-
let zeroes = 0
|
|
7263
|
-
let length = 0
|
|
7264
|
-
while (source[psz] === LEADER) {
|
|
7265
|
-
zeroes++
|
|
7266
|
-
psz++
|
|
7267
|
-
}
|
|
7268
|
-
// Allocate enough space in big-endian base256 representation.
|
|
7269
|
-
const size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.
|
|
7270
|
-
let b256 = new Uint8Array(size)
|
|
7271
|
-
// Process the characters.
|
|
7272
|
-
while (source[psz]) {
|
|
7273
|
-
// Decode character
|
|
7274
|
-
let carry = BASE_MAP[source.charCodeAt(psz)]
|
|
7275
|
-
// Invalid character
|
|
7276
|
-
if (carry === 255) { return }
|
|
7277
|
-
let i = 0
|
|
7278
|
-
for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
7279
|
-
carry += (BASE * b256[it3]) >>> 0
|
|
7280
|
-
b256[it3] = (carry % 256) >>> 0
|
|
7281
|
-
carry = (carry / 256) >>> 0
|
|
7282
|
-
}
|
|
7283
|
-
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
7284
|
-
length = i
|
|
7285
|
-
psz++
|
|
7286
|
-
}
|
|
7287
|
-
// Skip leading zeroes in b256.
|
|
7288
|
-
let it4 = size - length
|
|
7289
|
-
while (it4 !== size && b256[it4] === 0) {
|
|
7290
|
-
it4++
|
|
7291
|
-
}
|
|
7292
|
-
let vch = new Uint8Array(zeroes + (size - it4))
|
|
7293
|
-
let j = zeroes
|
|
7294
|
-
while (it4 !== size) {
|
|
7295
|
-
vch[j++] = b256[it4++]
|
|
7296
|
-
}
|
|
7297
|
-
return vch
|
|
7298
|
-
}
|
|
7299
|
-
const decode = string => {
|
|
7300
|
-
const buffer = decodeUnsafe(string)
|
|
7301
|
-
if (buffer) { return buffer }
|
|
7302
|
-
throw new Error('Non-base' + BASE + ' character')
|
|
7303
|
-
}
|
|
7304
|
-
return {
|
|
7305
|
-
encode: encode,
|
|
7306
|
-
decodeUnsafe: decodeUnsafe,
|
|
7307
|
-
decode: decode
|
|
7308
|
-
}
|
|
7309
|
-
}
|
|
7310
|
-
|
|
7311
|
-
/* harmony default export */ const base_x = (base);
|
|
7312
|
-
|
|
7313
|
-
;// CONCATENATED MODULE: ./node_modules/@vandeurenglenn/base32/src/base32.js
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
const base32_base32 = 'abcdefghijklmnopqrstuvwxyz234567'
|
|
7317
|
-
const base32Hex = '0123456789abcdefghijklmnopqrstuv'
|
|
7318
|
-
|
|
7319
|
-
const decode = (uint8Array, hex = false) => {
|
|
7320
|
-
const decoder = hex ? base_x(base32Hex) : base_x(base32_base32)
|
|
7321
|
-
return decoder.decode(uint8Array)
|
|
7322
|
-
}
|
|
7323
|
-
|
|
7324
|
-
/* harmony default export */ const src_base32 = ({
|
|
7325
|
-
encode: (uint8Array, hex = false) => {
|
|
7326
|
-
const encoder = hex ? base_x(base32Hex) : base_x(base32_base32)
|
|
7327
|
-
return encoder.encode(uint8Array)
|
|
7328
|
-
},
|
|
7329
|
-
decode,
|
|
7330
|
-
isBase32: (uint8Array, hex = false) => {
|
|
7331
|
-
try {
|
|
7332
|
-
decode(uint8Array, hex)
|
|
7333
|
-
return true;
|
|
7334
|
-
} catch (e) {
|
|
7335
|
-
return false;
|
|
7336
|
-
}
|
|
7337
|
-
}
|
|
7338
|
-
});
|
|
7339
|
-
|
|
7340
|
-
;// CONCATENATED MODULE: ./node_modules/@vandeurenglenn/base58/src/base58.js
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
const base58_base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
|
|
7344
|
-
|
|
7345
|
-
const base58_decode = uint8Array => base_x(base58_base58).decode(uint8Array)
|
|
7346
|
-
|
|
7347
|
-
/* harmony default export */ const src_base58 = ({
|
|
7348
|
-
encode: uint8Array => base_x(base58_base58).encode(uint8Array),
|
|
7349
|
-
decode: base58_decode,
|
|
7350
|
-
isBase58: uint8Array => {
|
|
7351
|
-
try {
|
|
7352
|
-
base58_decode(uint8Array)
|
|
7353
|
-
return true
|
|
7354
|
-
} catch (e) {
|
|
7355
|
-
return false
|
|
7356
|
-
}
|
|
7357
|
-
}
|
|
7358
|
-
});
|
|
7359
|
-
|
|
7360
|
-
;// CONCATENATED MODULE: ./node_modules/@vandeurenglenn/is-hex/is-hex.js
|
|
7361
|
-
/* harmony default export */ const is_hex = (string => /^[A-F0-9]+$/i.test(string));
|
|
7362
|
-
|
|
7363
|
-
;// CONCATENATED MODULE: ./node_modules/@leofcoin/codec-format-interface/src/basic-interface.js
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
class BasicInterface {
|
|
7369
|
-
#handleDecode() {
|
|
7370
|
-
if (!this.decode) throw new Error('bad implementation: needs decode func')
|
|
7371
|
-
return this.decode()
|
|
7372
|
-
}
|
|
7373
|
-
|
|
7374
|
-
#handleEncode() {
|
|
7375
|
-
if (!this.encode) throw new Error('bad implementation: needs encode func')
|
|
7376
|
-
return this.encode()
|
|
7377
|
-
}
|
|
7378
|
-
isHex(string) {
|
|
7379
|
-
return is_hex(string)
|
|
7380
|
-
}
|
|
7381
|
-
isBase32(string) {
|
|
7382
|
-
return base32.isBase32(string)
|
|
7383
|
-
}
|
|
7384
|
-
isBase58(string) {
|
|
7385
|
-
return base58.isBase32(string)
|
|
7386
|
-
}
|
|
7387
|
-
/**
|
|
7388
|
-
* @param {String} encoded
|
|
7389
|
-
*/
|
|
7390
|
-
fromBs32(encoded) {
|
|
7391
|
-
this.encoded = src_base32.decode(encoded)
|
|
7392
|
-
return this.#handleDecode()
|
|
7393
|
-
}
|
|
7394
|
-
|
|
7395
|
-
/**
|
|
7396
|
-
* @param {String} encoded
|
|
7397
|
-
*/
|
|
7398
|
-
fromBs58(encoded) {
|
|
7399
|
-
this.encoded = src_base58.decode(encoded)
|
|
7400
|
-
return this.#handleDecode()
|
|
7401
|
-
}
|
|
7402
|
-
|
|
7403
|
-
async toArray() {
|
|
7404
|
-
const array = []
|
|
7405
|
-
for await (const value of this.encoded.values()) {
|
|
7406
|
-
array.push(value)
|
|
7407
|
-
}
|
|
7408
|
-
return array
|
|
7409
|
-
}
|
|
7410
|
-
|
|
7411
|
-
fromString(string) {
|
|
7412
|
-
this.encoded = new Uint8Array(string.split(','))
|
|
7413
|
-
return this.#handleDecode()
|
|
7414
|
-
}
|
|
7415
|
-
|
|
7416
|
-
fromArray(array) {
|
|
7417
|
-
this.encoded = new Uint8Array([...array])
|
|
7418
|
-
return this.#handleDecode()
|
|
7419
|
-
}
|
|
7420
|
-
|
|
7421
|
-
/**
|
|
7422
|
-
* @param {Buffer} encoded
|
|
7423
|
-
*/
|
|
7424
|
-
fromEncoded(encoded) {
|
|
7425
|
-
this.encoded = encoded
|
|
7426
|
-
return this.#handleDecode()
|
|
7427
|
-
}
|
|
7428
|
-
|
|
7429
|
-
/**
|
|
7430
|
-
* @param {String} encoded
|
|
7431
|
-
*/
|
|
7432
|
-
fromHex(encoded) {
|
|
7433
|
-
this.encoded = Buffer.from(encoded, 'hex')
|
|
7434
|
-
return this.#handleDecode()
|
|
7435
|
-
}
|
|
7436
|
-
|
|
7437
|
-
async toString(encoding = 'utf8') {
|
|
7438
|
-
if (!this.encoded) await this.#handleEncode()
|
|
7439
|
-
return this.encoded.toString(encoding)
|
|
7440
|
-
}
|
|
7441
|
-
|
|
7442
|
-
/**
|
|
7443
|
-
* @return {String} encoded
|
|
7444
|
-
*/
|
|
7445
|
-
toHex() {
|
|
7446
|
-
return this.toString('hex')
|
|
7447
|
-
}
|
|
7448
|
-
|
|
7449
|
-
/**
|
|
7450
|
-
* @return {String} encoded
|
|
7451
|
-
*/
|
|
7452
|
-
async toBs32() {
|
|
7453
|
-
if (!this.encoded) await this.#handleEncode()
|
|
7454
|
-
return src_base32.encode(this.encoded)
|
|
7455
|
-
}
|
|
7456
|
-
|
|
7457
|
-
/**
|
|
7458
|
-
* @return {String} encoded
|
|
7459
|
-
*/
|
|
7460
|
-
async toBs58() {
|
|
7461
|
-
if (!this.encoded) await this.#handleEncode()
|
|
7462
|
-
return src_base58.encode(this.encoded)
|
|
7463
|
-
}
|
|
7464
|
-
|
|
7465
|
-
/**
|
|
7466
|
-
* @param {Object} data
|
|
7467
|
-
*/
|
|
7468
|
-
create(data) {
|
|
7469
|
-
const decoded = {}
|
|
7470
|
-
if (this.keys?.length > 0) {
|
|
7471
|
-
for (const key of this.keys) {
|
|
7472
|
-
Object.defineProperties(decoded, {
|
|
7473
|
-
[key]: {
|
|
7474
|
-
enumerable: true,
|
|
7475
|
-
configurable: true,
|
|
7476
|
-
set: (val) => value = data[key],
|
|
7477
|
-
get: () => data[key]
|
|
7478
|
-
}
|
|
7479
|
-
})
|
|
7480
|
-
}
|
|
7481
|
-
|
|
7482
|
-
this.decoded = decoded
|
|
7483
|
-
return this.encode()
|
|
7484
|
-
}
|
|
7485
|
-
}
|
|
7486
|
-
}
|
|
7487
|
-
|
|
7488
|
-
// EXTERNAL MODULE: ./node_modules/varint/index.js
|
|
7489
|
-
var varint = __webpack_require__(4676);
|
|
7490
|
-
var varint_default = /*#__PURE__*/__webpack_require__.n(varint);
|
|
7491
|
-
;// CONCATENATED MODULE: ./node_modules/@leofcoin/codec-format-interface/src/codecs.js
|
|
7492
|
-
/* harmony default export */ const codecs = ({
|
|
7493
|
-
// just a hash
|
|
7494
|
-
'disco-hash': {
|
|
7495
|
-
codec: parseInt('30', 16),
|
|
7496
|
-
hashAlg: 'dbl-keccak-256', // ,
|
|
7497
|
-
// testnet: 'olivia'
|
|
7498
|
-
},
|
|
7499
|
-
'peernet-peer-response': {
|
|
7500
|
-
codec: parseInt('707072', 16),
|
|
7501
|
-
hashAlg: 'keccak-256',
|
|
7502
|
-
},
|
|
7503
|
-
'peernet-peer': {
|
|
7504
|
-
codec: parseInt('7070', 16),
|
|
7505
|
-
hashAlg: 'keccak-256',
|
|
7506
|
-
},
|
|
7507
|
-
'peernet-dht': {
|
|
7508
|
-
codec: parseInt('706468', 16),
|
|
7509
|
-
hashAlg: 'keccak-256',
|
|
7510
|
-
},
|
|
7511
|
-
'peernet-dht-response': {
|
|
7512
|
-
codec: parseInt('706472', 16),
|
|
7513
|
-
hashAlg: 'keccak-256',
|
|
7514
|
-
},
|
|
7515
|
-
// data
|
|
7516
|
-
'peernet-data': {
|
|
7517
|
-
codec: parseInt('706461', 16),
|
|
7518
|
-
hashAlg: 'keccak-256',
|
|
7519
|
-
},
|
|
7520
|
-
'peernet-data-response': {
|
|
7521
|
-
codec: parseInt('70646172', 16),
|
|
7522
|
-
hashAlg: 'keccak-256',
|
|
7523
|
-
},
|
|
7524
|
-
// message
|
|
7525
|
-
'peernet-message': {
|
|
7526
|
-
codec: parseInt('706d65', 16),
|
|
7527
|
-
hashAlg: 'keccak-256',
|
|
7528
|
-
},
|
|
7529
|
-
// pubsub
|
|
7530
|
-
'peernet-ps': {
|
|
7531
|
-
codec: parseInt('707073', 16),
|
|
7532
|
-
hashAlg: 'keccak-256',
|
|
7533
|
-
},
|
|
7534
|
-
'peernet-response': {
|
|
7535
|
-
codec: parseInt('7072', 16),
|
|
7536
|
-
hashAlg: 'keccak-256',
|
|
7537
|
-
},
|
|
7538
|
-
'peernet-request': {
|
|
7539
|
-
codec: parseInt('707271', 16),
|
|
7540
|
-
hashAlg: 'keccak-256',
|
|
7541
|
-
},
|
|
7542
|
-
// normal block
|
|
7543
|
-
'leofcoin-block': {
|
|
7544
|
-
codec: parseInt('6c62', 16),
|
|
7545
|
-
hashAlg: 'dbl-keccak-512', // ,
|
|
7546
|
-
// testnet: 'olivia'
|
|
7547
|
-
},
|
|
7548
|
-
'leofcoin-tx': {
|
|
7549
|
-
codec: parseInt('6c74', 16),
|
|
7550
|
-
hashAlg: 'dbl-keccak-512', // ,
|
|
7551
|
-
// testnet: 'olivia'
|
|
7552
|
-
},
|
|
7553
|
-
// itx
|
|
7554
|
-
'leofcoin-itx': {
|
|
7555
|
-
codec: parseInt('6c69', 16),
|
|
7556
|
-
hashAlg: 'keccak-512', // ,
|
|
7557
|
-
// testnet: 'olivia'
|
|
7558
|
-
},
|
|
7559
|
-
// peer reputation
|
|
7560
|
-
'leofcoin-pr': {
|
|
7561
|
-
codec: parseInt('6c70', 16),
|
|
7562
|
-
hashAlg: 'keccak-256', // ,
|
|
7563
|
-
// testnet: 'olivia'
|
|
7564
|
-
},
|
|
7565
|
-
// chat message
|
|
7566
|
-
'chat-message': {
|
|
7567
|
-
codec: parseInt('636d', 16),
|
|
7568
|
-
hashAlg: 'dbl-keccak-256',
|
|
7569
|
-
},
|
|
7570
|
-
});
|
|
7571
|
-
|
|
7572
|
-
;// CONCATENATED MODULE: ./node_modules/@leofcoin/codec-format-interface/src/codec.js
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
class PeernetCodec extends BasicInterface {
|
|
7578
|
-
get codecs() {
|
|
7579
|
-
return {...globalThis.peernet.codecs, ...codecs}
|
|
7580
|
-
}
|
|
7581
|
-
constructor(buffer) {
|
|
7582
|
-
super()
|
|
7583
|
-
if (buffer) {
|
|
7584
|
-
if (buffer instanceof Uint8Array) {
|
|
7585
|
-
const codec = varint_default().decode(buffer);
|
|
7586
|
-
const name = this.getCodecName(codec)
|
|
7587
|
-
if (name) {
|
|
7588
|
-
this.name = name
|
|
7589
|
-
this.encoded = buffer
|
|
7590
|
-
this.decode(buffer)
|
|
7591
|
-
} else {
|
|
7592
|
-
this.encode(buffer)
|
|
7593
|
-
}
|
|
7594
|
-
} else if (buffer instanceof ArrayBuffer) {
|
|
7595
|
-
const encoded = new Uint8Array(buffer.byteLength)
|
|
7596
|
-
|
|
7597
|
-
for (let i = 0; i < buffer.byteLength; i++) {
|
|
7598
|
-
encoded[i] = buffer[i]
|
|
7599
|
-
}
|
|
7600
|
-
this.encoded = encoded
|
|
7601
|
-
// this.encoded = new Uint8Array(buffer, buffer.byteOffset, buffer.byteLength)
|
|
7602
|
-
this.decode(buffer)
|
|
7603
|
-
return
|
|
7604
|
-
}
|
|
7605
|
-
if (typeof buffer === 'string') {
|
|
7606
|
-
if (this.codecs[buffer]) this.fromName(buffer)
|
|
7607
|
-
else if (this.isHex(buffer)) this.fromHex(buffer)
|
|
7608
|
-
else if (this.isBase32(buffer)) this.fromBs32(buffer)
|
|
7609
|
-
else if (this.isBase58(buffer)) this.fromBs58(buffer)
|
|
7610
|
-
else throw new Error(`unsupported string ${buffer}`)
|
|
7611
|
-
}
|
|
7612
|
-
if (!isNaN(buffer)) if (this.codecs[this.getCodecName(buffer)]) this.fromCodec(buffer)
|
|
7613
|
-
}
|
|
7614
|
-
}
|
|
7615
|
-
|
|
7616
|
-
fromEncoded(encoded) {
|
|
7617
|
-
const codec = varint_default().decode(encoded);
|
|
7618
|
-
const name = this.getCodecName(codec)
|
|
7619
|
-
this.name = name
|
|
7620
|
-
this.encoded = encoded
|
|
7621
|
-
this.decode(encoded)
|
|
7622
|
-
}
|
|
7623
|
-
|
|
7624
|
-
getCodec(name) {
|
|
7625
|
-
return this.codecs[name].codec
|
|
7626
|
-
}
|
|
7627
|
-
|
|
7628
|
-
getCodecName(codec) {
|
|
7629
|
-
return Object.keys(this.codecs).reduce((p, c) => {
|
|
7630
|
-
const item = this.codecs[c]
|
|
7631
|
-
if (item.codec === codec) return c;
|
|
7632
|
-
else return p;
|
|
7633
|
-
}, undefined)
|
|
7634
|
-
}
|
|
7635
|
-
|
|
7636
|
-
getHashAlg(name) {
|
|
7637
|
-
return this.codecs[name].hashAlg
|
|
7638
|
-
}
|
|
7639
|
-
|
|
7640
|
-
fromCodec(codec) {
|
|
7641
|
-
this.name = this.getCodecName(codec)
|
|
7642
|
-
this.hashAlg = this.getHashAlg(this.name)
|
|
7643
|
-
|
|
7644
|
-
this.codec = this.getCodec(this.name)
|
|
7645
|
-
this.codecBuffer = varint_default().encode(codec)
|
|
7646
|
-
}
|
|
7647
|
-
|
|
7648
|
-
fromName(name) {
|
|
7649
|
-
const codec = this.getCodec(name)
|
|
7650
|
-
this.name = name
|
|
7651
|
-
this.codec = codec
|
|
7652
|
-
this.hashAlg = this.getHashAlg(name)
|
|
7653
|
-
this.codecBuffer = varint_default().encode(codec)
|
|
7654
|
-
}
|
|
7655
|
-
|
|
7656
|
-
decode() {
|
|
7657
|
-
const codec = varint_default().decode(this.encoded);
|
|
7658
|
-
this.fromCodec(codec)
|
|
7659
|
-
}
|
|
7660
|
-
|
|
7661
|
-
encode() {
|
|
7662
|
-
const codec = varint_default().encode(this.decoded)
|
|
7663
|
-
this.encoded = codec
|
|
7664
|
-
return this.encoded
|
|
7665
|
-
}
|
|
7666
|
-
}
|
|
7647
|
+
/******/ return module.exports;
|
|
7648
|
+
/******/ }
|
|
7649
|
+
/******/
|
|
7650
|
+
/************************************************************************/
|
|
7651
|
+
/******/ /* webpack/runtime/define property getters */
|
|
7652
|
+
/******/ (() => {
|
|
7653
|
+
/******/ // define getter functions for harmony exports
|
|
7654
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
7655
|
+
/******/ for(var key in definition) {
|
|
7656
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
7657
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
7658
|
+
/******/ }
|
|
7659
|
+
/******/ }
|
|
7660
|
+
/******/ };
|
|
7661
|
+
/******/ })();
|
|
7662
|
+
/******/
|
|
7663
|
+
/******/ /* webpack/runtime/global */
|
|
7664
|
+
/******/ (() => {
|
|
7665
|
+
/******/ __webpack_require__.g = (function() {
|
|
7666
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
7667
|
+
/******/ try {
|
|
7668
|
+
/******/ return this || new Function('return this')();
|
|
7669
|
+
/******/ } catch (e) {
|
|
7670
|
+
/******/ if (typeof window === 'object') return window;
|
|
7671
|
+
/******/ }
|
|
7672
|
+
/******/ })();
|
|
7673
|
+
/******/ })();
|
|
7674
|
+
/******/
|
|
7675
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
7676
|
+
/******/ (() => {
|
|
7677
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
7678
|
+
/******/ })();
|
|
7679
|
+
/******/
|
|
7680
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
7681
|
+
/******/ (() => {
|
|
7682
|
+
/******/ // define __esModule on exports
|
|
7683
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
7684
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
7685
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
7686
|
+
/******/ }
|
|
7687
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
7688
|
+
/******/ };
|
|
7689
|
+
/******/ })();
|
|
7690
|
+
/******/
|
|
7691
|
+
/************************************************************************/
|
|
7692
|
+
var __webpack_exports__ = {};
|
|
7693
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
7694
|
+
(() => {
|
|
7667
7695
|
|
|
7668
|
-
//
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
class CodecHash extends BasicInterface {
|
|
7678
|
-
constructor(buffer, options = {}) {
|
|
7679
|
-
super()
|
|
7680
|
-
if (options.name) this.name = options.name
|
|
7681
|
-
else this.name = 'disco-hash'
|
|
7682
|
-
if (options.codecs) this.codecs = options.codecs
|
|
7683
|
-
if (buffer) {
|
|
7684
|
-
if (buffer instanceof Uint8Array) {
|
|
7685
|
-
this.discoCodec = new PeernetCodec(buffer, this.codecs)
|
|
7686
|
-
const name = this.discoCodec.name
|
|
7687
|
-
|
|
7688
|
-
if (name) {
|
|
7689
|
-
this.name = name
|
|
7690
|
-
this.decode(buffer)
|
|
7691
|
-
} else {
|
|
7692
|
-
this.encode(buffer)
|
|
7693
|
-
}
|
|
7694
|
-
}
|
|
7695
|
-
|
|
7696
|
-
if (typeof buffer === 'string') {
|
|
7697
|
-
if (this.isHex(buffer)) this.fromHex(buffer)
|
|
7698
|
-
if (this.isBase32(buffer)) this.fromBs32(buffer)
|
|
7699
|
-
else if (this.isBase58(buffer)) this.fromBs58(buffer)
|
|
7700
|
-
else throw new Error(`unsupported string ${buffer}`)
|
|
7701
|
-
} else if (typeof buffer === 'object') this.fromJSON(buffer)
|
|
7702
|
-
}
|
|
7703
|
-
}
|
|
7704
|
-
|
|
7705
|
-
get prefix() {
|
|
7706
|
-
const length = this.length
|
|
7707
|
-
const uint8Array = new Uint8Array(length.length + this.discoCodec.codecBuffer.length)
|
|
7708
|
-
uint8Array.set(length)
|
|
7709
|
-
uint8Array.set(this.discoCodec.codecBuffer, length.length)
|
|
7710
|
-
|
|
7711
|
-
return uint8Array
|
|
7712
|
-
}
|
|
7713
|
-
|
|
7714
|
-
get length() {
|
|
7715
|
-
return varint_default().encode(this.size)
|
|
7716
|
-
}
|
|
7717
|
-
|
|
7718
|
-
get buffer() {
|
|
7719
|
-
return this.encoded
|
|
7720
|
-
}
|
|
7721
|
-
|
|
7722
|
-
get hash() {
|
|
7723
|
-
return this.encoded
|
|
7724
|
-
}
|
|
7725
|
-
|
|
7726
|
-
fromJSON(json) {
|
|
7727
|
-
return this.encode(Buffer.from(JSON.stringify(json)))
|
|
7728
|
-
}
|
|
7729
|
-
|
|
7730
|
-
encode(buffer, name) {
|
|
7731
|
-
if (!this.name && name) this.name = name;
|
|
7732
|
-
if (!buffer) buffer = this.buffer;
|
|
7733
|
-
this.discoCodec = new PeernetCodec(this.name, this.codecs)
|
|
7734
|
-
this.discoCodec.fromName(this.name)
|
|
7735
|
-
let hashAlg = this.discoCodec.hashAlg
|
|
7736
|
-
if (hashAlg.includes('dbl')) {
|
|
7737
|
-
hashAlg = hashAlg.replace('dbl-', '')
|
|
7738
|
-
buffer = js_default()(hashAlg.replace('-', '')).update(buffer).digest()
|
|
7739
|
-
}
|
|
7740
|
-
this.digest = js_default()(hashAlg.replace('-', '')).update(buffer).digest()
|
|
7741
|
-
this.size = this.digest.length
|
|
7742
|
-
|
|
7743
|
-
this.codec = this.discoCodec.encode();
|
|
7744
|
-
this.codec = this.discoCodec.codecBuffer
|
|
7745
|
-
const uint8Array = new Uint8Array(this.digest.length + this.prefix.length)
|
|
7746
|
-
uint8Array.set(this.prefix)
|
|
7747
|
-
uint8Array.set(this.digest, this.prefix.length)
|
|
7748
|
-
|
|
7749
|
-
this.encoded = uint8Array
|
|
7750
|
-
|
|
7751
|
-
return this.encoded
|
|
7752
|
-
}
|
|
7753
|
-
|
|
7754
|
-
validate(buffer) {
|
|
7755
|
-
if (Buffer.isBuffer(buffer)) {
|
|
7756
|
-
const codec = varint_default().decode(buffer);
|
|
7757
|
-
if (this.codecs[codec]) {
|
|
7758
|
-
this.decode(buffer)
|
|
7759
|
-
} else {
|
|
7760
|
-
this.encode(buffer)
|
|
7761
|
-
}
|
|
7762
|
-
}
|
|
7763
|
-
if (typeof buffer === 'string') {
|
|
7764
|
-
if (this.isHex(buffer)) this.fromHex(buffer)
|
|
7765
|
-
if (this.isBase32(buffer)) this.fromBs32(buffer)
|
|
7766
|
-
}
|
|
7767
|
-
if (typeof buffer === 'object') this.fromJSON(buffer)
|
|
7768
|
-
}
|
|
7769
|
-
|
|
7770
|
-
decode(buffer) {
|
|
7771
|
-
this.encoded = buffer
|
|
7772
|
-
const codec = varint_default().decode(buffer);
|
|
7773
|
-
|
|
7774
|
-
this.discoCodec = new PeernetCodec(codec, this.codecs)
|
|
7775
|
-
// TODO: validate codec
|
|
7776
|
-
buffer = buffer.slice((varint_default()).decode.bytes);
|
|
7777
|
-
this.size = varint_default().decode(buffer);
|
|
7778
|
-
this.digest = buffer.slice((varint_default()).decode.bytes);
|
|
7779
|
-
if (this.digest.length !== this.size) {
|
|
7780
|
-
throw new Error(`hash length inconsistent: 0x${this.encoded.toString('hex')}`)
|
|
7781
|
-
}
|
|
7782
|
-
|
|
7783
|
-
// const discoCodec = new Codec(codec, this.codecs)
|
|
7784
|
-
|
|
7785
|
-
this.name = this.discoCodec.name
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
this.size = this.digest.length
|
|
7789
|
-
|
|
7790
|
-
return {
|
|
7791
|
-
codec: this.codec,
|
|
7792
|
-
name: this.name,
|
|
7793
|
-
size: this.size,
|
|
7794
|
-
length: this.length,
|
|
7795
|
-
digest: this.digest,
|
|
7796
|
-
}
|
|
7797
|
-
}
|
|
7798
|
-
}
|
|
7696
|
+
// EXPORTS
|
|
7697
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
7698
|
+
"pK": () => (/* reexport */ BWMessage),
|
|
7699
|
+
"iP": () => (/* reexport */ BWRequestMessage),
|
|
7700
|
+
"NH": () => (/* reexport */ BlockMessage),
|
|
7701
|
+
"VJ": () => (/* reexport */ ContractMessage),
|
|
7702
|
+
"$Z": () => (/* reexport */ TransactionMessage)
|
|
7703
|
+
});
|
|
7799
7704
|
|
|
7800
|
-
;// CONCATENATED MODULE: ./
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
class FormatInterface extends BasicInterface {
|
|
7807
|
-
async #importProtons() {
|
|
7808
|
-
let importee = await __webpack_require__.e(/* import() | protons */ 397).then(__webpack_require__.t.bind(__webpack_require__, 7160, 23))
|
|
7809
|
-
return importee.default
|
|
7810
|
-
}
|
|
7811
|
-
|
|
7812
|
-
async protoEncode(data) {
|
|
7813
|
-
if (!protons) protons = await this.#importProtons()
|
|
7814
|
-
return protons(this.proto)[this.messageName].encode(data)
|
|
7815
|
-
}
|
|
7816
|
-
|
|
7817
|
-
async protoDecode(data) {
|
|
7818
|
-
if (!protons) protons = await this.#importProtons()
|
|
7819
|
-
return protons(this.proto)[this.messageName].decode(data)
|
|
7820
|
-
}
|
|
7821
|
-
|
|
7822
|
-
async #init(buffer) {
|
|
7823
|
-
if (buffer instanceof Uint8Array) await this.fromUint8Array(buffer)
|
|
7824
|
-
else if (buffer instanceof ArrayBuffer) await this.fromArrayBuffer(buffer)
|
|
7825
|
-
else if (buffer?.name === this.name) return buffer
|
|
7826
|
-
else if (buffer instanceof String) {
|
|
7827
|
-
if (this.isHex(buffer)) await this.fromHex(buffer)
|
|
7828
|
-
else if (this.isBase32(buffer)) await this.fromBs32(buffer)
|
|
7829
|
-
else if (this.isBase58(buffer)) await this.fromBs58(buffer)
|
|
7830
|
-
else throw new Error(`unsupported string ${buffer}`)
|
|
7831
|
-
} else {
|
|
7832
|
-
await this.create(buffer)
|
|
7833
|
-
}
|
|
7834
|
-
return this
|
|
7835
|
-
}
|
|
7836
|
-
|
|
7837
|
-
/**
|
|
7838
|
-
* @param {Buffer|String|Object} buffer - data - The data needed to create the desired message
|
|
7839
|
-
* @param {Object} proto - {encode, decode}
|
|
7840
|
-
* @param {Object} options - {hashFormat, name}
|
|
7841
|
-
*/
|
|
7842
|
-
constructor(buffer, proto, options = {}) {
|
|
7843
|
-
super()
|
|
7844
|
-
this.proto = proto
|
|
7845
|
-
this.hashFormat = options.hashFormat || 'bs32'
|
|
7846
|
-
if (options.name) this.name = options.name
|
|
7847
|
-
return this.#init(buffer)
|
|
7848
|
-
}
|
|
7849
|
-
|
|
7850
|
-
/**
|
|
7851
|
-
* @return {PeernetHash}
|
|
7852
|
-
*/
|
|
7853
|
-
get peernetHash() {
|
|
7854
|
-
return new CodecHash(this.decoded, {name: this.name})
|
|
7855
|
-
}
|
|
7856
|
-
|
|
7857
|
-
/**
|
|
7858
|
-
* @return {peernetHash}
|
|
7859
|
-
*/
|
|
7860
|
-
get hash() {
|
|
7861
|
-
const upper = this.hashFormat.charAt(0).toUpperCase()
|
|
7862
|
-
const format = `${upper}${this.hashFormat.substring(1, this.hashFormat.length)}`
|
|
7863
|
-
return this.peernetHash[`to${format}`]()
|
|
7864
|
-
}
|
|
7865
|
-
|
|
7866
|
-
/**
|
|
7867
|
-
* @return {Object}
|
|
7868
|
-
*/
|
|
7869
|
-
async decode() {
|
|
7870
|
-
let encoded = this.encoded;
|
|
7871
|
-
const discoCodec = new PeernetCodec(this.encoded)
|
|
7872
|
-
encoded = encoded.slice(discoCodec.codecBuffer.length)
|
|
7873
|
-
this.name = discoCodec.name
|
|
7874
|
-
this.decoded = await this.protoDecode(encoded)
|
|
7875
|
-
return this.decoded
|
|
7876
|
-
}
|
|
7877
|
-
|
|
7878
|
-
/**
|
|
7879
|
-
* @return {Buffer}
|
|
7880
|
-
*/
|
|
7881
|
-
async encode(decoded) {
|
|
7882
|
-
if (!decoded) decoded = this.decoded;
|
|
7883
|
-
const codec = new PeernetCodec(this.name)
|
|
7884
|
-
const encoded = await this.protoEncode(decoded)
|
|
7885
|
-
const uint8Array = new Uint8Array(encoded.length + codec.codecBuffer.length)
|
|
7886
|
-
uint8Array.set(codec.codecBuffer)
|
|
7887
|
-
uint8Array.set(encoded, codec.codecBuffer.length)
|
|
7888
|
-
this.encoded = uint8Array
|
|
7889
|
-
return this.encoded
|
|
7890
|
-
}
|
|
7891
|
-
|
|
7892
|
-
hasCodec() {
|
|
7893
|
-
if (!this.encoded) return false
|
|
7894
|
-
const codec = new PeernetCodec(this.encoded)
|
|
7895
|
-
if (codec.name) return true
|
|
7896
|
-
}
|
|
7897
|
-
|
|
7898
|
-
fromUint8Array(buffer) {
|
|
7899
|
-
this.encoded = buffer
|
|
7900
|
-
return this.hasCodec() ? this.decode() : this.create(
|
|
7901
|
-
JSON.parse(new TextDecoder().decode(this.encoded))
|
|
7902
|
-
)
|
|
7903
|
-
}
|
|
7904
|
-
|
|
7905
|
-
fromArrayBuffer(buffer) {
|
|
7906
|
-
this.encoded = new Uint8Array(buffer, buffer.byteOffset, buffer.byteLength)
|
|
7907
|
-
return this.hasCodec() ? this.decode() : this.create(
|
|
7908
|
-
JSON.parse(new TextDecoder().decode(this.encoded))
|
|
7909
|
-
)
|
|
7910
|
-
}
|
|
7705
|
+
;// CONCATENATED MODULE: ./src/protos/contract.proto.js
|
|
7706
|
+
/* harmony default export */ const contract_proto = (`
|
|
7707
|
+
message ContractMessage {
|
|
7708
|
+
required string creator = 1;
|
|
7709
|
+
required bytes contract = 2;
|
|
7710
|
+
repeated string constructorParameters = 3;
|
|
7911
7711
|
}
|
|
7712
|
+
`);
|
|
7912
7713
|
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7714
|
+
// EXTERNAL MODULE: ./node_modules/@leofcoin/codec-format-interface/dist/index.js
|
|
7715
|
+
var dist = __webpack_require__(427);
|
|
7920
7716
|
;// CONCATENATED MODULE: ./src/messages/contract.js
|
|
7921
7717
|
|
|
7922
7718
|
|
|
7923
7719
|
|
|
7924
|
-
class ContractMessage extends
|
|
7720
|
+
class ContractMessage extends dist/* FormatInterface */.L1 {
|
|
7925
7721
|
get keys() {
|
|
7926
7722
|
return ['creator', 'contract', 'constructorParameters']
|
|
7927
7723
|
}
|
|
@@ -7931,17 +7727,31 @@ class ContractMessage extends codec_format_interface_namespaceObject {
|
|
|
7931
7727
|
}
|
|
7932
7728
|
|
|
7933
7729
|
constructor(buffer) {
|
|
7934
|
-
super(buffer,
|
|
7730
|
+
super(buffer, contract_proto, {name: 'contract-message'})
|
|
7935
7731
|
}
|
|
7936
7732
|
}
|
|
7937
7733
|
|
|
7734
|
+
;// CONCATENATED MODULE: ./src/protos/transaction.proto.js
|
|
7735
|
+
/* harmony default export */ const transaction_proto = (`
|
|
7736
|
+
|
|
7737
|
+
message TransactionMessage {
|
|
7738
|
+
required uint64 timestamp = 1;
|
|
7739
|
+
required string from = 2;
|
|
7740
|
+
required string to = 3;
|
|
7741
|
+
required uint64 nonce = 4;
|
|
7742
|
+
required string method = 5;
|
|
7743
|
+
repeated string params = 6;
|
|
7744
|
+
required string signature = 7;
|
|
7745
|
+
}
|
|
7746
|
+
`);
|
|
7747
|
+
|
|
7938
7748
|
;// CONCATENATED MODULE: ./src/messages/transaction.js
|
|
7939
7749
|
|
|
7940
7750
|
|
|
7941
7751
|
|
|
7942
|
-
class TransactionMessage extends
|
|
7752
|
+
class TransactionMessage extends dist/* FormatInterface */.L1 {
|
|
7943
7753
|
get keys() {
|
|
7944
|
-
return ['timestamp', 'from', 'to', 'nonce', 'method', 'params']
|
|
7754
|
+
return ['timestamp', 'from', 'to', 'nonce', 'method', 'params', 'signature']
|
|
7945
7755
|
}
|
|
7946
7756
|
|
|
7947
7757
|
get messageName() {
|
|
@@ -7950,15 +7760,43 @@ class TransactionMessage extends codec_format_interface_namespaceObject {
|
|
|
7950
7760
|
|
|
7951
7761
|
constructor(buffer) {
|
|
7952
7762
|
const name = 'transaction-message'
|
|
7953
|
-
super(buffer,
|
|
7763
|
+
super(buffer, transaction_proto, {name})
|
|
7954
7764
|
}
|
|
7955
7765
|
}
|
|
7956
7766
|
|
|
7767
|
+
;// CONCATENATED MODULE: ./src/protos/block.proto.js
|
|
7768
|
+
/* harmony default export */ const block_proto = (`
|
|
7769
|
+
message ValidatorMessage {
|
|
7770
|
+
required string address = 1;
|
|
7771
|
+
required string reward = 2;
|
|
7772
|
+
}
|
|
7773
|
+
|
|
7774
|
+
message Transaction {
|
|
7775
|
+
required string hash = 1;
|
|
7776
|
+
required uint64 timestamp = 2;
|
|
7777
|
+
required string from = 3;
|
|
7778
|
+
required string to = 4;
|
|
7779
|
+
required uint64 nonce = 5;
|
|
7780
|
+
required string method = 6;
|
|
7781
|
+
repeated string params = 7;
|
|
7782
|
+
}
|
|
7783
|
+
|
|
7784
|
+
message BlockMessage {
|
|
7785
|
+
required uint64 index = 1;
|
|
7786
|
+
required string previousHash = 3;
|
|
7787
|
+
required uint64 timestamp = 4;
|
|
7788
|
+
required uint64 reward = 5;
|
|
7789
|
+
required string fees = 6;
|
|
7790
|
+
repeated Transaction transactions = 7;
|
|
7791
|
+
repeated ValidatorMessage validators = 8;
|
|
7792
|
+
}
|
|
7793
|
+
`);
|
|
7794
|
+
|
|
7957
7795
|
;// CONCATENATED MODULE: ./src/messages/block.js
|
|
7958
7796
|
|
|
7959
7797
|
|
|
7960
7798
|
|
|
7961
|
-
class BlockMessage extends
|
|
7799
|
+
class BlockMessage extends dist/* FormatInterface */.L1 {
|
|
7962
7800
|
get keys() {
|
|
7963
7801
|
return ['index', 'previousHash', 'timestamp', 'reward', 'fees', 'transactions', 'validators']
|
|
7964
7802
|
}
|
|
@@ -7973,11 +7811,20 @@ class BlockMessage extends codec_format_interface_namespaceObject {
|
|
|
7973
7811
|
}
|
|
7974
7812
|
}
|
|
7975
7813
|
|
|
7814
|
+
;// CONCATENATED MODULE: ./src/protos/bw.proto.js
|
|
7815
|
+
/* harmony default export */ const bw_proto = (`
|
|
7816
|
+
|
|
7817
|
+
message BWMessage {
|
|
7818
|
+
required uint64 up = 1;
|
|
7819
|
+
required uint64 down = 2;
|
|
7820
|
+
}
|
|
7821
|
+
`);
|
|
7822
|
+
|
|
7976
7823
|
;// CONCATENATED MODULE: ./src/messages/bw.js
|
|
7977
7824
|
|
|
7978
7825
|
|
|
7979
7826
|
|
|
7980
|
-
class BWMessage extends
|
|
7827
|
+
class BWMessage extends dist/* FormatInterface */.L1 {
|
|
7981
7828
|
get keys() {
|
|
7982
7829
|
return ['up', 'down']
|
|
7983
7830
|
}
|
|
@@ -7988,15 +7835,22 @@ class BWMessage extends codec_format_interface_namespaceObject {
|
|
|
7988
7835
|
|
|
7989
7836
|
constructor(buffer) {
|
|
7990
7837
|
const name = 'bw-message'
|
|
7991
|
-
super(buffer,
|
|
7838
|
+
super(buffer, bw_proto, {name})
|
|
7992
7839
|
}
|
|
7993
7840
|
}
|
|
7994
7841
|
|
|
7842
|
+
;// CONCATENATED MODULE: ./src/protos/bw-request.proto.js
|
|
7843
|
+
/* harmony default export */ const bw_request_proto = (`
|
|
7844
|
+
|
|
7845
|
+
message BWRequestMessage {
|
|
7846
|
+
}
|
|
7847
|
+
`);
|
|
7848
|
+
|
|
7995
7849
|
;// CONCATENATED MODULE: ./src/messages/bw-request.js
|
|
7996
7850
|
|
|
7997
7851
|
|
|
7998
7852
|
|
|
7999
|
-
class BWRequestMessage extends
|
|
7853
|
+
class BWRequestMessage extends dist/* FormatInterface */.L1 {
|
|
8000
7854
|
get keys() {
|
|
8001
7855
|
return []
|
|
8002
7856
|
}
|
|
@@ -8007,7 +7861,7 @@ class BWRequestMessage extends codec_format_interface_namespaceObject {
|
|
|
8007
7861
|
|
|
8008
7862
|
constructor(buffer) {
|
|
8009
7863
|
const name = 'bw-request-message'
|
|
8010
|
-
super(buffer,
|
|
7864
|
+
super(buffer, bw_request_proto, {name})
|
|
8011
7865
|
}
|
|
8012
7866
|
}
|
|
8013
7867
|
|