@chainflip/utils 0.11.3 → 2.1.0-beta.0
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/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/addresses.cjs +15 -40
- package/dist/addresses.d.ts +4 -3
- package/dist/addresses.js +14 -15
- package/dist/assertion.cjs +23 -82
- package/dist/assertion.d.ts +3 -2
- package/dist/assertion.js +32 -22
- package/dist/async.cjs +96 -115
- package/dist/async.d.ts +24 -21
- package/dist/async.js +92 -87
- package/dist/base58.cjs +9 -93
- package/dist/base58.d.ts +4 -4
- package/dist/base58.js +9 -13
- package/dist/bytes.cjs +49 -97
- package/dist/bytes.d.ts +4 -4
- package/dist/bytes.js +51 -15
- package/dist/chainflip.cjs +428 -327
- package/dist/chainflip.d.ts +188 -185
- package/dist/chainflip.js +425 -41
- package/dist/consts.cjs +306 -277
- package/dist/consts.d.ts +18 -17
- package/dist/consts.js +296 -243
- package/dist/date.cjs +74 -131
- package/dist/date.d.ts +9 -8
- package/dist/date.js +60 -95
- package/dist/guard.cjs +28 -63
- package/dist/guard.d.ts +10 -9
- package/dist/guard.js +17 -28
- package/dist/math.cjs +7 -32
- package/dist/math.d.ts +3 -2
- package/dist/math.js +6 -7
- package/dist/number.cjs +5 -29
- package/dist/number.d.ts +4 -4
- package/dist/number.js +5 -5
- package/dist/ss58.cjs +62 -794
- package/dist/ss58.d.ts +12 -9
- package/dist/ss58.js +59 -712
- package/dist/string.cjs +29 -66
- package/dist/string.d.ts +4 -4
- package/dist/string.js +20 -33
- package/dist/tickMath.cjs +32 -232
- package/dist/tickMath.d.ts +7 -6
- package/dist/tickMath.js +24 -29
- package/dist/types.cjs +0 -18
- package/dist/types.d.ts +35 -34
- package/dist/types.js +1 -0
- package/dist/url.cjs +16 -37
- package/dist/url.d.ts +5 -4
- package/dist/url.js +16 -13
- package/package.json +5 -5
- package/dist/addresses.d.cts +0 -6
- package/dist/assertion.d.cts +0 -11
- package/dist/async.d.cts +0 -33
- package/dist/base58.d.cts +0 -8
- package/dist/bytes.d.cts +0 -11
- package/dist/chainflip.d.cts +0 -236
- package/dist/chunk-3P6TXYEI.js +0 -15
- package/dist/chunk-HBIFE4XN.js +0 -29
- package/dist/chunk-LJJH7U4M.js +0 -302
- package/dist/chunk-XGNPN5CY.js +0 -61
- package/dist/chunk-ZHIKNZLU.js +0 -66
- package/dist/consts.d.cts +0 -33
- package/dist/date.d.cts +0 -26
- package/dist/guard.d.cts +0 -23
- package/dist/math.d.cts +0 -4
- package/dist/number.d.cts +0 -6
- package/dist/ss58.d.cts +0 -14
- package/dist/string.d.cts +0 -16
- package/dist/tickMath.d.cts +0 -15
- package/dist/types.d.cts +0 -41
- package/dist/url.d.cts +0 -6
package/dist/ss58.cjs
CHANGED
|
@@ -1,799 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/ss58.ts
|
|
21
|
-
var ss58_exports = {};
|
|
22
|
-
__export(ss58_exports, {
|
|
23
|
-
decode: () => decode2,
|
|
24
|
-
encode: () => encode2,
|
|
25
|
-
toPublicKey: () => toPublicKey
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(ss58_exports);
|
|
28
|
-
|
|
29
|
-
// ../../node_modules/.pnpm/@noble+hashes@2.0.1/node_modules/@noble/hashes/utils.js
|
|
30
|
-
function isBytes(a) {
|
|
31
|
-
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
32
|
-
}
|
|
33
|
-
function anumber(n, title = "") {
|
|
34
|
-
if (!Number.isSafeInteger(n) || n < 0) {
|
|
35
|
-
const prefix = title && `"${title}" `;
|
|
36
|
-
throw new Error(`${prefix}expected integer >= 0, got ${n}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
function abytes(value, length, title = "") {
|
|
40
|
-
const bytes = isBytes(value);
|
|
41
|
-
const len = value?.length;
|
|
42
|
-
const needsLen = length !== void 0;
|
|
43
|
-
if (!bytes || needsLen && len !== length) {
|
|
44
|
-
const prefix = title && `"${title}" `;
|
|
45
|
-
const ofLen = needsLen ? ` of length ${length}` : "";
|
|
46
|
-
const got = bytes ? `length=${len}` : `type=${typeof value}`;
|
|
47
|
-
throw new Error(prefix + "expected Uint8Array" + ofLen + ", got " + got);
|
|
48
|
-
}
|
|
49
|
-
return value;
|
|
50
|
-
}
|
|
51
|
-
function aexists(instance, checkFinished = true) {
|
|
52
|
-
if (instance.destroyed)
|
|
53
|
-
throw new Error("Hash instance has been destroyed");
|
|
54
|
-
if (checkFinished && instance.finished)
|
|
55
|
-
throw new Error("Hash#digest() has already been called");
|
|
56
|
-
}
|
|
57
|
-
function aoutput(out, instance) {
|
|
58
|
-
abytes(out, void 0, "digestInto() output");
|
|
59
|
-
const min = instance.outputLen;
|
|
60
|
-
if (out.length < min) {
|
|
61
|
-
throw new Error('"digestInto() output" expected to be of length >=' + min);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
function u32(arr) {
|
|
65
|
-
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
|
66
|
-
}
|
|
67
|
-
function clean(...arrays) {
|
|
68
|
-
for (let i = 0; i < arrays.length; i++) {
|
|
69
|
-
arrays[i].fill(0);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
var isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
|
|
73
|
-
function byteSwap(word) {
|
|
74
|
-
return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
|
|
75
|
-
}
|
|
76
|
-
var swap8IfBE = isLE ? (n) => n : (n) => byteSwap(n);
|
|
77
|
-
function byteSwap32(arr) {
|
|
78
|
-
for (let i = 0; i < arr.length; i++) {
|
|
79
|
-
arr[i] = byteSwap(arr[i]);
|
|
80
|
-
}
|
|
81
|
-
return arr;
|
|
82
|
-
}
|
|
83
|
-
var swap32IfBE = isLE ? (u) => u : byteSwap32;
|
|
84
|
-
function createHasher(hashCons, info = {}) {
|
|
85
|
-
const hashC = (msg, opts) => hashCons(opts).update(msg).digest();
|
|
86
|
-
const tmp = hashCons(void 0);
|
|
87
|
-
hashC.outputLen = tmp.outputLen;
|
|
88
|
-
hashC.blockLen = tmp.blockLen;
|
|
89
|
-
hashC.create = (opts) => hashCons(opts);
|
|
90
|
-
Object.assign(hashC, info);
|
|
91
|
-
return Object.freeze(hashC);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// ../../node_modules/.pnpm/@noble+hashes@2.0.1/node_modules/@noble/hashes/_blake.js
|
|
95
|
-
var BSIGMA = /* @__PURE__ */ Uint8Array.from([
|
|
96
|
-
0,
|
|
97
|
-
1,
|
|
98
|
-
2,
|
|
99
|
-
3,
|
|
100
|
-
4,
|
|
101
|
-
5,
|
|
102
|
-
6,
|
|
103
|
-
7,
|
|
104
|
-
8,
|
|
105
|
-
9,
|
|
106
|
-
10,
|
|
107
|
-
11,
|
|
108
|
-
12,
|
|
109
|
-
13,
|
|
110
|
-
14,
|
|
111
|
-
15,
|
|
112
|
-
14,
|
|
113
|
-
10,
|
|
114
|
-
4,
|
|
115
|
-
8,
|
|
116
|
-
9,
|
|
117
|
-
15,
|
|
118
|
-
13,
|
|
119
|
-
6,
|
|
120
|
-
1,
|
|
121
|
-
12,
|
|
122
|
-
0,
|
|
123
|
-
2,
|
|
124
|
-
11,
|
|
125
|
-
7,
|
|
126
|
-
5,
|
|
127
|
-
3,
|
|
128
|
-
11,
|
|
129
|
-
8,
|
|
130
|
-
12,
|
|
131
|
-
0,
|
|
132
|
-
5,
|
|
133
|
-
2,
|
|
134
|
-
15,
|
|
135
|
-
13,
|
|
136
|
-
10,
|
|
137
|
-
14,
|
|
138
|
-
3,
|
|
139
|
-
6,
|
|
140
|
-
7,
|
|
141
|
-
1,
|
|
142
|
-
9,
|
|
143
|
-
4,
|
|
144
|
-
7,
|
|
145
|
-
9,
|
|
146
|
-
3,
|
|
147
|
-
1,
|
|
148
|
-
13,
|
|
149
|
-
12,
|
|
150
|
-
11,
|
|
151
|
-
14,
|
|
152
|
-
2,
|
|
153
|
-
6,
|
|
154
|
-
5,
|
|
155
|
-
10,
|
|
156
|
-
4,
|
|
157
|
-
0,
|
|
158
|
-
15,
|
|
159
|
-
8,
|
|
160
|
-
9,
|
|
161
|
-
0,
|
|
162
|
-
5,
|
|
163
|
-
7,
|
|
164
|
-
2,
|
|
165
|
-
4,
|
|
166
|
-
10,
|
|
167
|
-
15,
|
|
168
|
-
14,
|
|
169
|
-
1,
|
|
170
|
-
11,
|
|
171
|
-
12,
|
|
172
|
-
6,
|
|
173
|
-
8,
|
|
174
|
-
3,
|
|
175
|
-
13,
|
|
176
|
-
2,
|
|
177
|
-
12,
|
|
178
|
-
6,
|
|
179
|
-
10,
|
|
180
|
-
0,
|
|
181
|
-
11,
|
|
182
|
-
8,
|
|
183
|
-
3,
|
|
184
|
-
4,
|
|
185
|
-
13,
|
|
186
|
-
7,
|
|
187
|
-
5,
|
|
188
|
-
15,
|
|
189
|
-
14,
|
|
190
|
-
1,
|
|
191
|
-
9,
|
|
192
|
-
12,
|
|
193
|
-
5,
|
|
194
|
-
1,
|
|
195
|
-
15,
|
|
196
|
-
14,
|
|
197
|
-
13,
|
|
198
|
-
4,
|
|
199
|
-
10,
|
|
200
|
-
0,
|
|
201
|
-
7,
|
|
202
|
-
6,
|
|
203
|
-
3,
|
|
204
|
-
9,
|
|
205
|
-
2,
|
|
206
|
-
8,
|
|
207
|
-
11,
|
|
208
|
-
13,
|
|
209
|
-
11,
|
|
210
|
-
7,
|
|
211
|
-
14,
|
|
212
|
-
12,
|
|
213
|
-
1,
|
|
214
|
-
3,
|
|
215
|
-
9,
|
|
216
|
-
5,
|
|
217
|
-
0,
|
|
218
|
-
15,
|
|
219
|
-
4,
|
|
220
|
-
8,
|
|
221
|
-
6,
|
|
222
|
-
2,
|
|
223
|
-
10,
|
|
224
|
-
6,
|
|
225
|
-
15,
|
|
226
|
-
14,
|
|
227
|
-
9,
|
|
228
|
-
11,
|
|
229
|
-
3,
|
|
230
|
-
0,
|
|
231
|
-
8,
|
|
232
|
-
12,
|
|
233
|
-
2,
|
|
234
|
-
13,
|
|
235
|
-
7,
|
|
236
|
-
1,
|
|
237
|
-
4,
|
|
238
|
-
10,
|
|
239
|
-
5,
|
|
240
|
-
10,
|
|
241
|
-
2,
|
|
242
|
-
8,
|
|
243
|
-
4,
|
|
244
|
-
7,
|
|
245
|
-
6,
|
|
246
|
-
1,
|
|
247
|
-
5,
|
|
248
|
-
15,
|
|
249
|
-
11,
|
|
250
|
-
9,
|
|
251
|
-
14,
|
|
252
|
-
3,
|
|
253
|
-
12,
|
|
254
|
-
13,
|
|
255
|
-
0,
|
|
256
|
-
0,
|
|
257
|
-
1,
|
|
258
|
-
2,
|
|
259
|
-
3,
|
|
260
|
-
4,
|
|
261
|
-
5,
|
|
262
|
-
6,
|
|
263
|
-
7,
|
|
264
|
-
8,
|
|
265
|
-
9,
|
|
266
|
-
10,
|
|
267
|
-
11,
|
|
268
|
-
12,
|
|
269
|
-
13,
|
|
270
|
-
14,
|
|
271
|
-
15,
|
|
272
|
-
14,
|
|
273
|
-
10,
|
|
274
|
-
4,
|
|
275
|
-
8,
|
|
276
|
-
9,
|
|
277
|
-
15,
|
|
278
|
-
13,
|
|
279
|
-
6,
|
|
280
|
-
1,
|
|
281
|
-
12,
|
|
282
|
-
0,
|
|
283
|
-
2,
|
|
284
|
-
11,
|
|
285
|
-
7,
|
|
286
|
-
5,
|
|
287
|
-
3,
|
|
288
|
-
// Blake1, unused in others
|
|
289
|
-
11,
|
|
290
|
-
8,
|
|
291
|
-
12,
|
|
292
|
-
0,
|
|
293
|
-
5,
|
|
294
|
-
2,
|
|
295
|
-
15,
|
|
296
|
-
13,
|
|
297
|
-
10,
|
|
298
|
-
14,
|
|
299
|
-
3,
|
|
300
|
-
6,
|
|
301
|
-
7,
|
|
302
|
-
1,
|
|
303
|
-
9,
|
|
304
|
-
4,
|
|
305
|
-
7,
|
|
306
|
-
9,
|
|
307
|
-
3,
|
|
308
|
-
1,
|
|
309
|
-
13,
|
|
310
|
-
12,
|
|
311
|
-
11,
|
|
312
|
-
14,
|
|
313
|
-
2,
|
|
314
|
-
6,
|
|
315
|
-
5,
|
|
316
|
-
10,
|
|
317
|
-
4,
|
|
318
|
-
0,
|
|
319
|
-
15,
|
|
320
|
-
8,
|
|
321
|
-
9,
|
|
322
|
-
0,
|
|
323
|
-
5,
|
|
324
|
-
7,
|
|
325
|
-
2,
|
|
326
|
-
4,
|
|
327
|
-
10,
|
|
328
|
-
15,
|
|
329
|
-
14,
|
|
330
|
-
1,
|
|
331
|
-
11,
|
|
332
|
-
12,
|
|
333
|
-
6,
|
|
334
|
-
8,
|
|
335
|
-
3,
|
|
336
|
-
13,
|
|
337
|
-
2,
|
|
338
|
-
12,
|
|
339
|
-
6,
|
|
340
|
-
10,
|
|
341
|
-
0,
|
|
342
|
-
11,
|
|
343
|
-
8,
|
|
344
|
-
3,
|
|
345
|
-
4,
|
|
346
|
-
13,
|
|
347
|
-
7,
|
|
348
|
-
5,
|
|
349
|
-
15,
|
|
350
|
-
14,
|
|
351
|
-
1,
|
|
352
|
-
9
|
|
353
|
-
]);
|
|
354
|
-
|
|
355
|
-
// ../../node_modules/.pnpm/@noble+hashes@2.0.1/node_modules/@noble/hashes/_u64.js
|
|
356
|
-
var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
357
|
-
var _32n = /* @__PURE__ */ BigInt(32);
|
|
358
|
-
function fromBig(n, le = false) {
|
|
359
|
-
if (le)
|
|
360
|
-
return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
|
|
361
|
-
return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
|
362
|
-
}
|
|
363
|
-
var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
|
|
364
|
-
var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
365
|
-
var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
|
|
366
|
-
var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
|
|
367
|
-
var rotr32H = (_h, l) => l;
|
|
368
|
-
var rotr32L = (h, _l) => h;
|
|
369
|
-
function add(Ah, Al, Bh, Bl) {
|
|
370
|
-
const l = (Al >>> 0) + (Bl >>> 0);
|
|
371
|
-
return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
|
|
372
|
-
}
|
|
373
|
-
var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
|
374
|
-
var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
|
|
375
|
-
|
|
376
|
-
// ../../node_modules/.pnpm/@noble+hashes@2.0.1/node_modules/@noble/hashes/blake2.js
|
|
377
|
-
var B2B_IV = /* @__PURE__ */ Uint32Array.from([
|
|
378
|
-
4089235720,
|
|
379
|
-
1779033703,
|
|
380
|
-
2227873595,
|
|
381
|
-
3144134277,
|
|
382
|
-
4271175723,
|
|
383
|
-
1013904242,
|
|
384
|
-
1595750129,
|
|
385
|
-
2773480762,
|
|
386
|
-
2917565137,
|
|
387
|
-
1359893119,
|
|
388
|
-
725511199,
|
|
389
|
-
2600822924,
|
|
390
|
-
4215389547,
|
|
391
|
-
528734635,
|
|
392
|
-
327033209,
|
|
393
|
-
1541459225
|
|
394
|
-
]);
|
|
395
|
-
var BBUF = /* @__PURE__ */ new Uint32Array(32);
|
|
396
|
-
function G1b(a, b, c, d, msg, x) {
|
|
397
|
-
const Xl = msg[x], Xh = msg[x + 1];
|
|
398
|
-
let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1];
|
|
399
|
-
let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1];
|
|
400
|
-
let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1];
|
|
401
|
-
let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1];
|
|
402
|
-
let ll = add3L(Al, Bl, Xl);
|
|
403
|
-
Ah = add3H(ll, Ah, Bh, Xh);
|
|
404
|
-
Al = ll | 0;
|
|
405
|
-
({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al });
|
|
406
|
-
({ Dh, Dl } = { Dh: rotr32H(Dh, Dl), Dl: rotr32L(Dh, Dl) });
|
|
407
|
-
({ h: Ch, l: Cl } = add(Ch, Cl, Dh, Dl));
|
|
408
|
-
({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl });
|
|
409
|
-
({ Bh, Bl } = { Bh: rotrSH(Bh, Bl, 24), Bl: rotrSL(Bh, Bl, 24) });
|
|
410
|
-
BBUF[2 * a] = Al, BBUF[2 * a + 1] = Ah;
|
|
411
|
-
BBUF[2 * b] = Bl, BBUF[2 * b + 1] = Bh;
|
|
412
|
-
BBUF[2 * c] = Cl, BBUF[2 * c + 1] = Ch;
|
|
413
|
-
BBUF[2 * d] = Dl, BBUF[2 * d + 1] = Dh;
|
|
414
|
-
}
|
|
415
|
-
function G2b(a, b, c, d, msg, x) {
|
|
416
|
-
const Xl = msg[x], Xh = msg[x + 1];
|
|
417
|
-
let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1];
|
|
418
|
-
let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1];
|
|
419
|
-
let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1];
|
|
420
|
-
let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1];
|
|
421
|
-
let ll = add3L(Al, Bl, Xl);
|
|
422
|
-
Ah = add3H(ll, Ah, Bh, Xh);
|
|
423
|
-
Al = ll | 0;
|
|
424
|
-
({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al });
|
|
425
|
-
({ Dh, Dl } = { Dh: rotrSH(Dh, Dl, 16), Dl: rotrSL(Dh, Dl, 16) });
|
|
426
|
-
({ h: Ch, l: Cl } = add(Ch, Cl, Dh, Dl));
|
|
427
|
-
({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl });
|
|
428
|
-
({ Bh, Bl } = { Bh: rotrBH(Bh, Bl, 63), Bl: rotrBL(Bh, Bl, 63) });
|
|
429
|
-
BBUF[2 * a] = Al, BBUF[2 * a + 1] = Ah;
|
|
430
|
-
BBUF[2 * b] = Bl, BBUF[2 * b + 1] = Bh;
|
|
431
|
-
BBUF[2 * c] = Cl, BBUF[2 * c + 1] = Ch;
|
|
432
|
-
BBUF[2 * d] = Dl, BBUF[2 * d + 1] = Dh;
|
|
433
|
-
}
|
|
434
|
-
function checkBlake2Opts(outputLen, opts = {}, keyLen, saltLen, persLen) {
|
|
435
|
-
anumber(keyLen);
|
|
436
|
-
if (outputLen < 0 || outputLen > keyLen)
|
|
437
|
-
throw new Error("outputLen bigger than keyLen");
|
|
438
|
-
const { key, salt, personalization } = opts;
|
|
439
|
-
if (key !== void 0 && (key.length < 1 || key.length > keyLen))
|
|
440
|
-
throw new Error('"key" expected to be undefined or of length=1..' + keyLen);
|
|
441
|
-
if (salt !== void 0)
|
|
442
|
-
abytes(salt, saltLen, "salt");
|
|
443
|
-
if (personalization !== void 0)
|
|
444
|
-
abytes(personalization, persLen, "personalization");
|
|
445
|
-
}
|
|
446
|
-
var _BLAKE2 = class {
|
|
447
|
-
buffer;
|
|
448
|
-
buffer32;
|
|
449
|
-
finished = false;
|
|
450
|
-
destroyed = false;
|
|
451
|
-
length = 0;
|
|
452
|
-
pos = 0;
|
|
453
|
-
blockLen;
|
|
454
|
-
outputLen;
|
|
455
|
-
constructor(blockLen, outputLen) {
|
|
456
|
-
anumber(blockLen);
|
|
457
|
-
anumber(outputLen);
|
|
458
|
-
this.blockLen = blockLen;
|
|
459
|
-
this.outputLen = outputLen;
|
|
460
|
-
this.buffer = new Uint8Array(blockLen);
|
|
461
|
-
this.buffer32 = u32(this.buffer);
|
|
462
|
-
}
|
|
463
|
-
update(data) {
|
|
464
|
-
aexists(this);
|
|
465
|
-
abytes(data);
|
|
466
|
-
const { blockLen, buffer, buffer32 } = this;
|
|
467
|
-
const len = data.length;
|
|
468
|
-
const offset = data.byteOffset;
|
|
469
|
-
const buf = data.buffer;
|
|
470
|
-
for (let pos = 0; pos < len; ) {
|
|
471
|
-
if (this.pos === blockLen) {
|
|
472
|
-
swap32IfBE(buffer32);
|
|
473
|
-
this.compress(buffer32, 0, false);
|
|
474
|
-
swap32IfBE(buffer32);
|
|
475
|
-
this.pos = 0;
|
|
476
|
-
}
|
|
477
|
-
const take = Math.min(blockLen - this.pos, len - pos);
|
|
478
|
-
const dataOffset = offset + pos;
|
|
479
|
-
if (take === blockLen && !(dataOffset % 4) && pos + take < len) {
|
|
480
|
-
const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4));
|
|
481
|
-
swap32IfBE(data32);
|
|
482
|
-
for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) {
|
|
483
|
-
this.length += blockLen;
|
|
484
|
-
this.compress(data32, pos32, false);
|
|
485
|
-
}
|
|
486
|
-
swap32IfBE(data32);
|
|
487
|
-
continue;
|
|
488
|
-
}
|
|
489
|
-
buffer.set(data.subarray(pos, pos + take), this.pos);
|
|
490
|
-
this.pos += take;
|
|
491
|
-
this.length += take;
|
|
492
|
-
pos += take;
|
|
493
|
-
}
|
|
494
|
-
return this;
|
|
495
|
-
}
|
|
496
|
-
digestInto(out) {
|
|
497
|
-
aexists(this);
|
|
498
|
-
aoutput(out, this);
|
|
499
|
-
const { pos, buffer32 } = this;
|
|
500
|
-
this.finished = true;
|
|
501
|
-
clean(this.buffer.subarray(pos));
|
|
502
|
-
swap32IfBE(buffer32);
|
|
503
|
-
this.compress(buffer32, 0, true);
|
|
504
|
-
swap32IfBE(buffer32);
|
|
505
|
-
const out32 = u32(out);
|
|
506
|
-
this.get().forEach((v, i) => out32[i] = swap8IfBE(v));
|
|
507
|
-
}
|
|
508
|
-
digest() {
|
|
509
|
-
const { buffer, outputLen } = this;
|
|
510
|
-
this.digestInto(buffer);
|
|
511
|
-
const res = buffer.slice(0, outputLen);
|
|
512
|
-
this.destroy();
|
|
513
|
-
return res;
|
|
514
|
-
}
|
|
515
|
-
_cloneInto(to) {
|
|
516
|
-
const { buffer, length, finished, destroyed, outputLen, pos } = this;
|
|
517
|
-
to ||= new this.constructor({ dkLen: outputLen });
|
|
518
|
-
to.set(...this.get());
|
|
519
|
-
to.buffer.set(buffer);
|
|
520
|
-
to.destroyed = destroyed;
|
|
521
|
-
to.finished = finished;
|
|
522
|
-
to.length = length;
|
|
523
|
-
to.pos = pos;
|
|
524
|
-
to.outputLen = outputLen;
|
|
525
|
-
return to;
|
|
526
|
-
}
|
|
527
|
-
clone() {
|
|
528
|
-
return this._cloneInto();
|
|
529
|
-
}
|
|
530
|
-
};
|
|
531
|
-
var _BLAKE2b = class extends _BLAKE2 {
|
|
532
|
-
// Same as SHA-512, but LE
|
|
533
|
-
v0l = B2B_IV[0] | 0;
|
|
534
|
-
v0h = B2B_IV[1] | 0;
|
|
535
|
-
v1l = B2B_IV[2] | 0;
|
|
536
|
-
v1h = B2B_IV[3] | 0;
|
|
537
|
-
v2l = B2B_IV[4] | 0;
|
|
538
|
-
v2h = B2B_IV[5] | 0;
|
|
539
|
-
v3l = B2B_IV[6] | 0;
|
|
540
|
-
v3h = B2B_IV[7] | 0;
|
|
541
|
-
v4l = B2B_IV[8] | 0;
|
|
542
|
-
v4h = B2B_IV[9] | 0;
|
|
543
|
-
v5l = B2B_IV[10] | 0;
|
|
544
|
-
v5h = B2B_IV[11] | 0;
|
|
545
|
-
v6l = B2B_IV[12] | 0;
|
|
546
|
-
v6h = B2B_IV[13] | 0;
|
|
547
|
-
v7l = B2B_IV[14] | 0;
|
|
548
|
-
v7h = B2B_IV[15] | 0;
|
|
549
|
-
constructor(opts = {}) {
|
|
550
|
-
const olen = opts.dkLen === void 0 ? 64 : opts.dkLen;
|
|
551
|
-
super(128, olen);
|
|
552
|
-
checkBlake2Opts(olen, opts, 64, 16, 16);
|
|
553
|
-
let { key, personalization, salt } = opts;
|
|
554
|
-
let keyLength = 0;
|
|
555
|
-
if (key !== void 0) {
|
|
556
|
-
abytes(key, void 0, "key");
|
|
557
|
-
keyLength = key.length;
|
|
558
|
-
}
|
|
559
|
-
this.v0l ^= this.outputLen | keyLength << 8 | 1 << 16 | 1 << 24;
|
|
560
|
-
if (salt !== void 0) {
|
|
561
|
-
abytes(salt, void 0, "salt");
|
|
562
|
-
const slt = u32(salt);
|
|
563
|
-
this.v4l ^= swap8IfBE(slt[0]);
|
|
564
|
-
this.v4h ^= swap8IfBE(slt[1]);
|
|
565
|
-
this.v5l ^= swap8IfBE(slt[2]);
|
|
566
|
-
this.v5h ^= swap8IfBE(slt[3]);
|
|
567
|
-
}
|
|
568
|
-
if (personalization !== void 0) {
|
|
569
|
-
abytes(personalization, void 0, "personalization");
|
|
570
|
-
const pers = u32(personalization);
|
|
571
|
-
this.v6l ^= swap8IfBE(pers[0]);
|
|
572
|
-
this.v6h ^= swap8IfBE(pers[1]);
|
|
573
|
-
this.v7l ^= swap8IfBE(pers[2]);
|
|
574
|
-
this.v7h ^= swap8IfBE(pers[3]);
|
|
575
|
-
}
|
|
576
|
-
if (key !== void 0) {
|
|
577
|
-
const tmp = new Uint8Array(this.blockLen);
|
|
578
|
-
tmp.set(key);
|
|
579
|
-
this.update(tmp);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
// prettier-ignore
|
|
583
|
-
get() {
|
|
584
|
-
let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this;
|
|
585
|
-
return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h];
|
|
586
|
-
}
|
|
587
|
-
// prettier-ignore
|
|
588
|
-
set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) {
|
|
589
|
-
this.v0l = v0l | 0;
|
|
590
|
-
this.v0h = v0h | 0;
|
|
591
|
-
this.v1l = v1l | 0;
|
|
592
|
-
this.v1h = v1h | 0;
|
|
593
|
-
this.v2l = v2l | 0;
|
|
594
|
-
this.v2h = v2h | 0;
|
|
595
|
-
this.v3l = v3l | 0;
|
|
596
|
-
this.v3h = v3h | 0;
|
|
597
|
-
this.v4l = v4l | 0;
|
|
598
|
-
this.v4h = v4h | 0;
|
|
599
|
-
this.v5l = v5l | 0;
|
|
600
|
-
this.v5h = v5h | 0;
|
|
601
|
-
this.v6l = v6l | 0;
|
|
602
|
-
this.v6h = v6h | 0;
|
|
603
|
-
this.v7l = v7l | 0;
|
|
604
|
-
this.v7h = v7h | 0;
|
|
605
|
-
}
|
|
606
|
-
compress(msg, offset, isLast) {
|
|
607
|
-
this.get().forEach((v, i) => BBUF[i] = v);
|
|
608
|
-
BBUF.set(B2B_IV, 16);
|
|
609
|
-
let { h, l } = fromBig(BigInt(this.length));
|
|
610
|
-
BBUF[24] = B2B_IV[8] ^ l;
|
|
611
|
-
BBUF[25] = B2B_IV[9] ^ h;
|
|
612
|
-
if (isLast) {
|
|
613
|
-
BBUF[28] = ~BBUF[28];
|
|
614
|
-
BBUF[29] = ~BBUF[29];
|
|
615
|
-
}
|
|
616
|
-
let j = 0;
|
|
617
|
-
const s = BSIGMA;
|
|
618
|
-
for (let i = 0; i < 12; i++) {
|
|
619
|
-
G1b(0, 4, 8, 12, msg, offset + 2 * s[j++]);
|
|
620
|
-
G2b(0, 4, 8, 12, msg, offset + 2 * s[j++]);
|
|
621
|
-
G1b(1, 5, 9, 13, msg, offset + 2 * s[j++]);
|
|
622
|
-
G2b(1, 5, 9, 13, msg, offset + 2 * s[j++]);
|
|
623
|
-
G1b(2, 6, 10, 14, msg, offset + 2 * s[j++]);
|
|
624
|
-
G2b(2, 6, 10, 14, msg, offset + 2 * s[j++]);
|
|
625
|
-
G1b(3, 7, 11, 15, msg, offset + 2 * s[j++]);
|
|
626
|
-
G2b(3, 7, 11, 15, msg, offset + 2 * s[j++]);
|
|
627
|
-
G1b(0, 5, 10, 15, msg, offset + 2 * s[j++]);
|
|
628
|
-
G2b(0, 5, 10, 15, msg, offset + 2 * s[j++]);
|
|
629
|
-
G1b(1, 6, 11, 12, msg, offset + 2 * s[j++]);
|
|
630
|
-
G2b(1, 6, 11, 12, msg, offset + 2 * s[j++]);
|
|
631
|
-
G1b(2, 7, 8, 13, msg, offset + 2 * s[j++]);
|
|
632
|
-
G2b(2, 7, 8, 13, msg, offset + 2 * s[j++]);
|
|
633
|
-
G1b(3, 4, 9, 14, msg, offset + 2 * s[j++]);
|
|
634
|
-
G2b(3, 4, 9, 14, msg, offset + 2 * s[j++]);
|
|
635
|
-
}
|
|
636
|
-
this.v0l ^= BBUF[0] ^ BBUF[16];
|
|
637
|
-
this.v0h ^= BBUF[1] ^ BBUF[17];
|
|
638
|
-
this.v1l ^= BBUF[2] ^ BBUF[18];
|
|
639
|
-
this.v1h ^= BBUF[3] ^ BBUF[19];
|
|
640
|
-
this.v2l ^= BBUF[4] ^ BBUF[20];
|
|
641
|
-
this.v2h ^= BBUF[5] ^ BBUF[21];
|
|
642
|
-
this.v3l ^= BBUF[6] ^ BBUF[22];
|
|
643
|
-
this.v3h ^= BBUF[7] ^ BBUF[23];
|
|
644
|
-
this.v4l ^= BBUF[8] ^ BBUF[24];
|
|
645
|
-
this.v4h ^= BBUF[9] ^ BBUF[25];
|
|
646
|
-
this.v5l ^= BBUF[10] ^ BBUF[26];
|
|
647
|
-
this.v5h ^= BBUF[11] ^ BBUF[27];
|
|
648
|
-
this.v6l ^= BBUF[12] ^ BBUF[28];
|
|
649
|
-
this.v6h ^= BBUF[13] ^ BBUF[29];
|
|
650
|
-
this.v7l ^= BBUF[14] ^ BBUF[30];
|
|
651
|
-
this.v7h ^= BBUF[15] ^ BBUF[31];
|
|
652
|
-
clean(BBUF);
|
|
653
|
-
}
|
|
654
|
-
destroy() {
|
|
655
|
-
this.destroyed = true;
|
|
656
|
-
clean(this.buffer32);
|
|
657
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
658
|
-
}
|
|
659
|
-
};
|
|
660
|
-
var blake2b = /* @__PURE__ */ createHasher((opts) => new _BLAKE2b(opts));
|
|
661
|
-
|
|
662
|
-
// src/guard.ts
|
|
663
|
-
var createIsGuard = (type) => (value) => typeof value === type;
|
|
664
|
-
var isString = createIsGuard("string");
|
|
665
|
-
var isNumber = createIsGuard("number");
|
|
666
|
-
var isBigInt = createIsGuard("bigint");
|
|
667
|
-
var isBoolean = createIsGuard("boolean");
|
|
668
|
-
var isSymbol = createIsGuard("symbol");
|
|
669
|
-
var isObject = createIsGuard("object");
|
|
670
|
-
var isUndefined = createIsGuard("undefined");
|
|
671
|
-
|
|
672
|
-
// src/assertion.ts
|
|
673
|
-
function assert(condition, message = "assertion failed", Constructor = Error) {
|
|
674
|
-
if (!condition) {
|
|
675
|
-
throw new Constructor(message);
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
// src/bytes.ts
|
|
680
|
-
var bytesToHex = (input) => {
|
|
681
|
-
const bytes = new Uint8Array(input);
|
|
682
|
-
return `0x${Array.from(bytes).map((byte) => byte.toString(16).padStart(2, "0")).join("")}`;
|
|
683
|
-
};
|
|
684
|
-
var hexToBytes = (input) => {
|
|
685
|
-
assert(/^0x[\da-f]*$/i.test(input) && input.length % 2 === 0, "Invalid hex string");
|
|
686
|
-
const hex = input.slice(2);
|
|
687
|
-
const bytes = new Uint8Array(hex.length / 2);
|
|
688
|
-
for (let i = 0; i < hex.length; i += 2) {
|
|
689
|
-
bytes[i / 2] = Number.parseInt(hex.slice(i, i + 2), 16);
|
|
690
|
-
}
|
|
691
|
-
return bytes;
|
|
692
|
-
};
|
|
693
|
-
var convertBase = (inputBytes, fromBase, toBase) => {
|
|
694
|
-
const bytes = typeof inputBytes === "string" ? hexToBytes(inputBytes) : new Uint8Array(inputBytes);
|
|
695
|
-
const result = [];
|
|
696
|
-
for (const byte of bytes) {
|
|
697
|
-
let carry = byte;
|
|
698
|
-
for (let i = 0; i < result.length; i += 1) {
|
|
699
|
-
carry += result[i] * fromBase;
|
|
700
|
-
result[i] = carry % toBase;
|
|
701
|
-
carry = Math.floor(carry / toBase);
|
|
702
|
-
}
|
|
703
|
-
while (carry !== 0) {
|
|
704
|
-
result.push(carry % toBase);
|
|
705
|
-
carry = Math.floor(carry / toBase);
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
let leadingZeros = 0;
|
|
709
|
-
while (bytes[leadingZeros] === 0) {
|
|
710
|
-
leadingZeros += 1;
|
|
711
|
-
result.push(0);
|
|
712
|
-
}
|
|
713
|
-
return result.reverse();
|
|
714
|
-
};
|
|
715
|
-
var encodeBytesWithCharset = (bytes, charset) => convertBase(bytes, 256, charset.length).map((charCode) => charset.charAt(charCode)).join("");
|
|
716
|
-
var decodeBytesWithCharset = (input, charset) => {
|
|
717
|
-
assert(new RegExp(`^[${charset}]*$`).test(input), "Invalid input");
|
|
718
|
-
const charMap = Object.fromEntries([...charset].map((char, index) => [char, index]));
|
|
719
|
-
const bytes = input.split("").map((char) => charMap[char]);
|
|
720
|
-
return new Uint8Array(convertBase(bytes, charset.length, 256));
|
|
721
|
-
};
|
|
722
|
-
|
|
723
|
-
// src/base58.ts
|
|
724
|
-
var CHARSET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
725
|
-
var encode = (bytes) => encodeBytesWithCharset(bytes, CHARSET);
|
|
726
|
-
var decode = (input) => decodeBytesWithCharset(input, CHARSET);
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_assertion = require('./assertion.cjs');
|
|
3
|
+
const require_bytes = require('./bytes.cjs');
|
|
4
|
+
const require_base58 = require('./base58.cjs');
|
|
5
|
+
let _noble_hashes_blake2_js = require("@noble/hashes/blake2.js");
|
|
727
6
|
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
7
|
+
//#region src/ss58.ts
|
|
8
|
+
const CHECKSUM_BYTE_LENGTH = 2;
|
|
9
|
+
const DATA_LENGTH = 32;
|
|
10
|
+
const MAX_SIMPLE_PREFIX = 63;
|
|
11
|
+
const MAX_PREFIX = 16383;
|
|
12
|
+
const RESERVED_PREFIXES = [46, 47];
|
|
13
|
+
const computeChecksum = (data) => {
|
|
14
|
+
return (0, _noble_hashes_blake2_js.blake2b)(new Uint8Array([...[
|
|
15
|
+
83,
|
|
16
|
+
83,
|
|
17
|
+
53,
|
|
18
|
+
56,
|
|
19
|
+
80,
|
|
20
|
+
82,
|
|
21
|
+
69
|
|
22
|
+
], ...data])).slice(0, CHECKSUM_BYTE_LENGTH);
|
|
738
23
|
};
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
`Invalid checksum: ${checksumBytes[1]} !== ${checksum[1]}`
|
|
762
|
-
);
|
|
763
|
-
return {
|
|
764
|
-
data: new Uint8Array(data),
|
|
765
|
-
ss58Format
|
|
766
|
-
};
|
|
24
|
+
const decode = (input) => {
|
|
25
|
+
const decodedBytes = require_base58.decode(input);
|
|
26
|
+
let ss58FormatLen;
|
|
27
|
+
let ss58Format;
|
|
28
|
+
if ((decodedBytes[0] & 64) !== 0) {
|
|
29
|
+
ss58FormatLen = 2;
|
|
30
|
+
ss58Format = (decodedBytes[0] & 63) << 2 | decodedBytes[1] >> 6 | (decodedBytes[1] & 63) << 8;
|
|
31
|
+
} else {
|
|
32
|
+
ss58FormatLen = 1;
|
|
33
|
+
[ss58Format] = decodedBytes;
|
|
34
|
+
}
|
|
35
|
+
require_assertion.assert(!RESERVED_PREFIXES.includes(ss58Format), `Reserved prefix: ${ss58Format}`);
|
|
36
|
+
const checksumBytes = decodedBytes.slice(-CHECKSUM_BYTE_LENGTH);
|
|
37
|
+
const data = decodedBytes.slice(ss58FormatLen, -CHECKSUM_BYTE_LENGTH);
|
|
38
|
+
require_assertion.assert(data.length === DATA_LENGTH, `Invalid data length: ${data.length}`);
|
|
39
|
+
const checksum = computeChecksum(decodedBytes.slice(0, -CHECKSUM_BYTE_LENGTH));
|
|
40
|
+
require_assertion.assert(checksumBytes[0] === checksum[0], `Invalid checksum: ${checksumBytes[0]} !== ${checksum[0]}`);
|
|
41
|
+
require_assertion.assert(checksumBytes[1] === checksum[1], `Invalid checksum: ${checksumBytes[1]} !== ${checksum[1]}`);
|
|
42
|
+
return {
|
|
43
|
+
data: new Uint8Array(data),
|
|
44
|
+
ss58Format
|
|
45
|
+
};
|
|
767
46
|
};
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
ss58Format >> 8 | (ss58Format & 3) << 6
|
|
783
|
-
];
|
|
784
|
-
}
|
|
785
|
-
const checksum = computeChecksum(new Uint8Array([...prefixBytes, ...data]));
|
|
786
|
-
return encode([...prefixBytes, ...data, ...checksum]);
|
|
47
|
+
const encode = ({ data: input, ss58Format }) => {
|
|
48
|
+
const data = typeof input === "string" ? require_bytes.hexToBytes(input) : input;
|
|
49
|
+
require_assertion.assert(data.length === DATA_LENGTH, `Invalid data length: ${data.length}`, RangeError);
|
|
50
|
+
require_assertion.assert(ss58Format >= 0 && ss58Format <= MAX_PREFIX, `Invalid prefix: ${ss58Format}`, RangeError);
|
|
51
|
+
require_assertion.assert(!RESERVED_PREFIXES.includes(ss58Format), `Reserved prefix: ${ss58Format}`);
|
|
52
|
+
let prefixBytes;
|
|
53
|
+
if (ss58Format <= MAX_SIMPLE_PREFIX) prefixBytes = [ss58Format];
|
|
54
|
+
else prefixBytes = [(ss58Format & 252) >> 2 | 64, ss58Format >> 8 | (ss58Format & 3) << 6];
|
|
55
|
+
const checksum = computeChecksum(new Uint8Array([...prefixBytes, ...data]));
|
|
56
|
+
return require_base58.encode([
|
|
57
|
+
...prefixBytes,
|
|
58
|
+
...data,
|
|
59
|
+
...checksum
|
|
60
|
+
]);
|
|
787
61
|
};
|
|
788
|
-
|
|
789
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
790
|
-
0 && (module.exports = {
|
|
791
|
-
decode,
|
|
792
|
-
encode,
|
|
793
|
-
toPublicKey
|
|
794
|
-
});
|
|
795
|
-
/*! Bundled license information:
|
|
62
|
+
const toPublicKey = (address) => require_bytes.bytesToHex(decode(address).data);
|
|
796
63
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
64
|
+
//#endregion
|
|
65
|
+
exports.decode = decode;
|
|
66
|
+
exports.encode = encode;
|
|
67
|
+
exports.toPublicKey = toPublicKey;
|