@wishknish/knishio-client-js 0.9.0 → 0.9.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/client.cjs.js +29 -29
- package/dist/client.cjs.js.map +1 -1
- package/dist/client.es.mjs +738 -721
- package/dist/client.es.mjs.map +1 -1
- package/dist/client.iife.js +29 -29
- package/dist/client.iife.js.map +1 -1
- package/package.json +9 -13
- package/src/Wallet.js +26 -1
- package/src/libraries/array.js +6 -4
- package/src/libraries/strings.js +33 -7
- package/src/types/index.js +0 -2
package/dist/client.es.mjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import { gql as E, cacheExchange as sn, fetchExchange as rn, subscriptionExchange as on, createClient as an } from "@urql/core";
|
|
6
|
-
import { createClient as ln } from "graphql-ws";
|
|
7
|
-
import { pipe as cn, map as un, subscribe as hn } from "wonka";
|
|
1
|
+
import F from "jssha";
|
|
2
|
+
import { gql as E, cacheExchange as tn, fetchExchange as nn, subscriptionExchange as sn, createClient as rn } from "@urql/core";
|
|
3
|
+
import { createClient as on } from "graphql-ws";
|
|
4
|
+
import { pipe as an, map as ln, subscribe as cn } from "wonka";
|
|
8
5
|
typeof self > "u" && (global.self = global);
|
|
9
6
|
class Wt {
|
|
10
7
|
/**
|
|
@@ -75,17 +72,21 @@ String.prototype.toCamelCase || (String.prototype.toCamelCase = function() {
|
|
|
75
72
|
String.prototype.toSnakeCase || (String.prototype.toSnakeCase = function() {
|
|
76
73
|
return this.replace(/[A-Z]/g, (o) => `_${o.toLowerCase()}`);
|
|
77
74
|
});
|
|
78
|
-
function
|
|
75
|
+
function Ue(o, e) {
|
|
79
76
|
const t = Math.ceil(o.length / e), n = [];
|
|
80
77
|
for (let s = 0, r = 0; s < t; ++s, r += e)
|
|
81
78
|
n[s] = o.substr(r, e);
|
|
82
79
|
return n;
|
|
83
80
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
function nt(o = 256, e = "abcdef0123456789") {
|
|
82
|
+
const t = new Uint8Array(o);
|
|
83
|
+
crypto.getRandomValues(t);
|
|
84
|
+
let n = "";
|
|
85
|
+
for (let s = 0; s < o; s++)
|
|
86
|
+
n += e.charAt(t[s] % e.length);
|
|
87
|
+
return n;
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
+
function un(o, e, t, n, s) {
|
|
89
90
|
if (n = n || "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~`!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?¿¡", s = s || n, e > n.length || t > s.length)
|
|
90
91
|
return console.warn("Strings::charsetBaseConvert() - Can't convert", o, "to base", t, "greater than symbol table length. src-table:", n.length, "dest-table:", s.length), !1;
|
|
91
92
|
let i = BigInt(0);
|
|
@@ -98,27 +99,37 @@ function dn(o, e, t, n, s) {
|
|
|
98
99
|
}
|
|
99
100
|
return a || "0";
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
+
function at(o) {
|
|
102
103
|
return Wt.toHex(o, {});
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
+
function hn(o) {
|
|
105
106
|
return Wt.toUint8Array(o);
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
-
const e =
|
|
109
|
-
|
|
108
|
+
function dn(o) {
|
|
109
|
+
const e = hn(o);
|
|
110
|
+
if (typeof Buffer < "u")
|
|
111
|
+
return Buffer.from(e).toString("base64");
|
|
112
|
+
let t = "";
|
|
113
|
+
const n = 32768;
|
|
114
|
+
for (let s = 0; s < e.length; s += n)
|
|
115
|
+
t += String.fromCharCode(...e.subarray(s, s + n));
|
|
116
|
+
return btoa(t);
|
|
110
117
|
}
|
|
111
|
-
function
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
function pn(o) {
|
|
119
|
+
if (typeof Buffer < "u")
|
|
120
|
+
return at(new Uint8Array(Buffer.from(o, "base64")));
|
|
121
|
+
const e = atob(o), t = new Uint8Array(e.length);
|
|
122
|
+
for (let n = 0; n < e.length; n++)
|
|
123
|
+
t[n] = e.charCodeAt(n);
|
|
124
|
+
return at(t);
|
|
125
|
+
}
|
|
126
|
+
function De(o) {
|
|
116
127
|
return /^[A-F0-9]+$/i.test(o);
|
|
117
128
|
}
|
|
118
|
-
function
|
|
129
|
+
function fn(o) {
|
|
119
130
|
return (typeof o == "number" || typeof o == "string" && o.trim() !== "") && !isNaN(o);
|
|
120
131
|
}
|
|
121
|
-
let
|
|
132
|
+
let he = class {
|
|
122
133
|
/**
|
|
123
134
|
* Normalizes the meta array into the standard {key: ..., value: ...} format
|
|
124
135
|
*
|
|
@@ -155,10 +166,13 @@ let de = class {
|
|
|
155
166
|
return t;
|
|
156
167
|
}
|
|
157
168
|
};
|
|
158
|
-
function
|
|
159
|
-
|
|
169
|
+
function Cr(o, e) {
|
|
170
|
+
const t = [];
|
|
171
|
+
for (let n = 0; n < o.length; n += e)
|
|
172
|
+
t.push(o.slice(n, n + e));
|
|
173
|
+
return t;
|
|
160
174
|
}
|
|
161
|
-
function
|
|
175
|
+
function mn(o, e) {
|
|
162
176
|
let t, n, s;
|
|
163
177
|
const r = [Array, Date, Number, String, Boolean], i = Object.prototype.toString;
|
|
164
178
|
for (e = e || [], t = 0; t < e.length; t += 2)
|
|
@@ -168,11 +182,11 @@ function wn(o, e) {
|
|
|
168
182
|
i.call(o) === i.call(s = new r[t](o)) && (n = t ? s : []);
|
|
169
183
|
e.push(o, n);
|
|
170
184
|
for (t in o)
|
|
171
|
-
e.hasOwnProperty.call(o, t) && (n[t] =
|
|
185
|
+
e.hasOwnProperty.call(o, t) && (n[t] = mn(o[t], e));
|
|
172
186
|
}
|
|
173
187
|
return n || o;
|
|
174
188
|
}
|
|
175
|
-
function
|
|
189
|
+
function yn(...o) {
|
|
176
190
|
return [].concat(...o.map((e, t) => {
|
|
177
191
|
const n = o.slice(0);
|
|
178
192
|
n.splice(t, 1);
|
|
@@ -180,17 +194,17 @@ function kn(...o) {
|
|
|
180
194
|
return e.filter((r) => !s.includes(r));
|
|
181
195
|
}));
|
|
182
196
|
}
|
|
183
|
-
function
|
|
197
|
+
function fe(...o) {
|
|
184
198
|
return o.reduce((e, t) => e.filter((n) => t.includes(n)));
|
|
185
199
|
}
|
|
186
|
-
class
|
|
200
|
+
class st {
|
|
187
201
|
/**
|
|
188
202
|
*
|
|
189
203
|
* @param policy
|
|
190
204
|
* @param metaKeys
|
|
191
205
|
*/
|
|
192
206
|
constructor(e = {}, t = {}) {
|
|
193
|
-
this.policy =
|
|
207
|
+
this.policy = st.normalizePolicy(e), this.fillDefault(t);
|
|
194
208
|
}
|
|
195
209
|
/**
|
|
196
210
|
*
|
|
@@ -218,7 +232,7 @@ class rt {
|
|
|
218
232
|
})) {
|
|
219
233
|
const i = r.map((a) => a.key);
|
|
220
234
|
this.policy[s] || (this.policy[s] = {});
|
|
221
|
-
for (const a of
|
|
235
|
+
for (const a of yn(e, i))
|
|
222
236
|
this.policy[s][a] || (this.policy[s][a] = s === "write" && !["characters", "pubkey"].includes(a) ? ["self"] : ["all"]);
|
|
223
237
|
}
|
|
224
238
|
}
|
|
@@ -243,7 +257,7 @@ class P {
|
|
|
243
257
|
* @param {object|array} meta
|
|
244
258
|
*/
|
|
245
259
|
constructor(e = []) {
|
|
246
|
-
this.meta =
|
|
260
|
+
this.meta = he.normalizeMeta(e);
|
|
247
261
|
}
|
|
248
262
|
/**
|
|
249
263
|
*
|
|
@@ -251,7 +265,7 @@ class P {
|
|
|
251
265
|
* @returns {AtomMeta}
|
|
252
266
|
*/
|
|
253
267
|
merge(e) {
|
|
254
|
-
return this.meta = Array.from(/* @__PURE__ */ new Set([...this.meta, ...
|
|
268
|
+
return this.meta = Array.from(/* @__PURE__ */ new Set([...this.meta, ...he.normalizeMeta(e)])), this;
|
|
255
269
|
}
|
|
256
270
|
/**
|
|
257
271
|
*
|
|
@@ -320,7 +334,7 @@ class P {
|
|
|
320
334
|
* @returns {AtomMeta}
|
|
321
335
|
*/
|
|
322
336
|
addPolicy(e) {
|
|
323
|
-
const t = new
|
|
337
|
+
const t = new st(e, Object.keys(this.meta));
|
|
324
338
|
return this.merge({
|
|
325
339
|
policy: t.toJson()
|
|
326
340
|
}), this;
|
|
@@ -353,7 +367,7 @@ Stack:
|
|
|
353
367
|
${this.stack}`;
|
|
354
368
|
}
|
|
355
369
|
}
|
|
356
|
-
class
|
|
370
|
+
class oe extends x {
|
|
357
371
|
/**
|
|
358
372
|
* Class constructor
|
|
359
373
|
*
|
|
@@ -365,7 +379,7 @@ class ae extends x {
|
|
|
365
379
|
super(e, t, n), this.name = "AtomsMissingException";
|
|
366
380
|
}
|
|
367
381
|
}
|
|
368
|
-
class
|
|
382
|
+
class ie {
|
|
369
383
|
/**
|
|
370
384
|
*
|
|
371
385
|
* @param {Atom} atom
|
|
@@ -386,7 +400,7 @@ class oe {
|
|
|
386
400
|
case "[object Array]": {
|
|
387
401
|
const t = [];
|
|
388
402
|
for (const n in e)
|
|
389
|
-
t.push(
|
|
403
|
+
t.push(ie.isStructure(e[n]) ? ie.structure(e[n]) : e[n]);
|
|
390
404
|
return t;
|
|
391
405
|
}
|
|
392
406
|
case "[object Object]": {
|
|
@@ -394,7 +408,7 @@ class oe {
|
|
|
394
408
|
for (const s of n)
|
|
395
409
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
396
410
|
const r = {};
|
|
397
|
-
r[s] =
|
|
411
|
+
r[s] = ie.isStructure(e[s]) ? ie.structure(e[s]) : e[s], t.push(r);
|
|
398
412
|
}
|
|
399
413
|
if (t.length > 0)
|
|
400
414
|
return t;
|
|
@@ -416,10 +430,10 @@ class oe {
|
|
|
416
430
|
* @returns {Object[]}
|
|
417
431
|
*/
|
|
418
432
|
view() {
|
|
419
|
-
return
|
|
433
|
+
return ie.structure(this);
|
|
420
434
|
}
|
|
421
435
|
}
|
|
422
|
-
class
|
|
436
|
+
class gn extends ie {
|
|
423
437
|
constructor({
|
|
424
438
|
position: e = null,
|
|
425
439
|
walletAddress: t = null,
|
|
@@ -437,8 +451,8 @@ class _n extends oe {
|
|
|
437
451
|
super(), this.position = e, this.walletAddress = t, this.isotope = n, this.token = s, this.value = r, this.batchId = i, this.metaType = a, this.metaId = c, this.meta = u, this.index = l, this.createdAt = h, this.version = p;
|
|
438
452
|
}
|
|
439
453
|
}
|
|
440
|
-
const
|
|
441
|
-
4:
|
|
454
|
+
const Re = {
|
|
455
|
+
4: gn
|
|
442
456
|
};
|
|
443
457
|
class g {
|
|
444
458
|
/**
|
|
@@ -471,7 +485,7 @@ class g {
|
|
|
471
485
|
index: h = null,
|
|
472
486
|
version: p = null
|
|
473
487
|
}) {
|
|
474
|
-
this.position = e, this.walletAddress = t, this.isotope = n, this.token = s, this.value = r !== null ? String(r) : null, this.batchId = i, this.metaType = a, this.metaId = c, this.meta = u ?
|
|
488
|
+
this.position = e, this.walletAddress = t, this.isotope = n, this.token = s, this.value = r !== null ? String(r) : null, this.batchId = i, this.metaType = a, this.metaId = c, this.meta = u ? he.normalizeMeta(u) : [], this.index = h, this.otsFragment = l, this.createdAt = String(+/* @__PURE__ */ new Date()), p !== null && Object.prototype.hasOwnProperty.call(Re, p) && (this.version = String(p));
|
|
475
489
|
}
|
|
476
490
|
/**
|
|
477
491
|
*
|
|
@@ -643,15 +657,15 @@ class g {
|
|
|
643
657
|
atoms: e,
|
|
644
658
|
output: t = "base17"
|
|
645
659
|
}) {
|
|
646
|
-
const n = new
|
|
660
|
+
const n = new F("SHAKE256", "TEXT"), s = g.sortAtoms(e);
|
|
647
661
|
if (s.length === 0)
|
|
648
|
-
throw new
|
|
662
|
+
throw new oe();
|
|
649
663
|
if (s.map((r) => {
|
|
650
664
|
if (!(r instanceof g))
|
|
651
|
-
throw new
|
|
665
|
+
throw new oe();
|
|
652
666
|
return r;
|
|
653
|
-
}), s.every((r) => r.version && Object.prototype.hasOwnProperty.call(
|
|
654
|
-
n.update(JSON.stringify(s.map((r) =>
|
|
667
|
+
}), s.every((r) => r.version && Object.prototype.hasOwnProperty.call(Re, r.version)))
|
|
668
|
+
n.update(JSON.stringify(s.map((r) => Re[r.version].create(r).view())));
|
|
655
669
|
else {
|
|
656
670
|
const r = String(e.length);
|
|
657
671
|
let i = [];
|
|
@@ -666,7 +680,7 @@ class g {
|
|
|
666
680
|
case "array":
|
|
667
681
|
return n.getHash("ARRAYBUFFER", { outputLen: 256 });
|
|
668
682
|
default:
|
|
669
|
-
return
|
|
683
|
+
return un(n.getHash("HEX", { outputLen: 256 }), 16, 17, "0123456789abcdef", "0123456789abcdefg").padStart(64, "0");
|
|
670
684
|
}
|
|
671
685
|
}
|
|
672
686
|
static jsonSerialization(e, t) {
|
|
@@ -687,7 +701,7 @@ class g {
|
|
|
687
701
|
* Get aggregated meta from stored normalized ones
|
|
688
702
|
*/
|
|
689
703
|
aggregatedMeta() {
|
|
690
|
-
return
|
|
704
|
+
return he.aggregateMeta(this.meta);
|
|
691
705
|
}
|
|
692
706
|
/**
|
|
693
707
|
*
|
|
@@ -707,28 +721,28 @@ class g {
|
|
|
707
721
|
return e;
|
|
708
722
|
}
|
|
709
723
|
}
|
|
710
|
-
function
|
|
724
|
+
function tt(o = null, e = 2048) {
|
|
711
725
|
if (o) {
|
|
712
|
-
const t = new
|
|
726
|
+
const t = new F("SHAKE256", "TEXT");
|
|
713
727
|
return t.update(o), t.getHash("HEX", { outputLen: e * 4 });
|
|
714
728
|
} else
|
|
715
|
-
return
|
|
729
|
+
return nt(e);
|
|
716
730
|
}
|
|
717
|
-
function
|
|
718
|
-
const t = new
|
|
731
|
+
function de(o, e = null) {
|
|
732
|
+
const t = new F("SHAKE256", "TEXT");
|
|
719
733
|
return t.update(o), t.getHash("HEX", { outputLen: 256 });
|
|
720
734
|
}
|
|
721
|
-
function
|
|
722
|
-
const t = new
|
|
735
|
+
function Ve(o, e) {
|
|
736
|
+
const t = new F("SHAKE256", "TEXT");
|
|
723
737
|
return t.update(o), t.getHash("HEX", { outputLen: e });
|
|
724
738
|
}
|
|
725
|
-
function
|
|
739
|
+
function Be({
|
|
726
740
|
molecularHash: o = null,
|
|
727
741
|
index: e = null
|
|
728
742
|
}) {
|
|
729
|
-
return o !== null && e !== null ?
|
|
743
|
+
return o !== null && e !== null ? de(String(o) + String(e), "generateBatchId") : nt(64);
|
|
730
744
|
}
|
|
731
|
-
class
|
|
745
|
+
class pe {
|
|
732
746
|
/**
|
|
733
747
|
*
|
|
734
748
|
* @param id
|
|
@@ -745,7 +759,7 @@ class fe {
|
|
|
745
759
|
*/
|
|
746
760
|
static createFromGraphQL(e) {
|
|
747
761
|
let t = e.metas || {};
|
|
748
|
-
return t.length && (t = JSON.parse(t), t || (t = {})), new
|
|
762
|
+
return t.length && (t = JSON.parse(t), t || (t = {})), new pe(
|
|
749
763
|
e.id,
|
|
750
764
|
e.name,
|
|
751
765
|
t
|
|
@@ -757,7 +771,7 @@ class fe {
|
|
|
757
771
|
* @returns {TokenUnit}
|
|
758
772
|
*/
|
|
759
773
|
static createFromDB(e) {
|
|
760
|
-
return new
|
|
774
|
+
return new pe(
|
|
761
775
|
e[0],
|
|
762
776
|
e[1],
|
|
763
777
|
e.length > 2 ? e[2] : {}
|
|
@@ -795,7 +809,7 @@ class fe {
|
|
|
795
809
|
};
|
|
796
810
|
}
|
|
797
811
|
}
|
|
798
|
-
class
|
|
812
|
+
class ze extends x {
|
|
799
813
|
/**
|
|
800
814
|
* Class constructor
|
|
801
815
|
*
|
|
@@ -807,22 +821,21 @@ class Je extends x {
|
|
|
807
821
|
super(e, t, n), this.name = "WalletCredentialException";
|
|
808
822
|
}
|
|
809
823
|
}
|
|
810
|
-
const
|
|
811
|
-
function
|
|
812
|
-
return e ? { h: Number(o &
|
|
824
|
+
const Te = /* @__PURE__ */ BigInt(2 ** 32 - 1), lt = /* @__PURE__ */ BigInt(32);
|
|
825
|
+
function bn(o, e = !1) {
|
|
826
|
+
return e ? { h: Number(o & Te), l: Number(o >> lt & Te) } : { h: Number(o >> lt & Te) | 0, l: Number(o & Te) | 0 };
|
|
813
827
|
}
|
|
814
|
-
function
|
|
828
|
+
function wn(o, e = !1) {
|
|
815
829
|
const t = o.length;
|
|
816
830
|
let n = new Uint32Array(t), s = new Uint32Array(t);
|
|
817
831
|
for (let r = 0; r < t; r++) {
|
|
818
|
-
const { h: i, l: a } =
|
|
832
|
+
const { h: i, l: a } = bn(o[r], e);
|
|
819
833
|
[n[r], s[r]] = [i, a];
|
|
820
834
|
}
|
|
821
835
|
return [n, s];
|
|
822
836
|
}
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
function Mn(o) {
|
|
837
|
+
const kn = (o, e, t) => o << t | e >>> 32 - t, _n = (o, e, t) => e << t | o >>> 32 - t, Sn = (o, e, t) => e << t - 32 | o >>> 64 - t, $n = (o, e, t) => o << t - 32 | e >>> 64 - t;
|
|
838
|
+
function An(o) {
|
|
826
839
|
return o instanceof Uint8Array || ArrayBuffer.isView(o) && o.constructor.name === "Uint8Array";
|
|
827
840
|
}
|
|
828
841
|
function ct(o, e = "") {
|
|
@@ -831,8 +844,8 @@ function ct(o, e = "") {
|
|
|
831
844
|
throw new Error(`${t}expected integer >= 0, got ${o}`);
|
|
832
845
|
}
|
|
833
846
|
}
|
|
834
|
-
function
|
|
835
|
-
const n =
|
|
847
|
+
function j(o, e, t = "") {
|
|
848
|
+
const n = An(o), s = o?.length, r = e !== void 0;
|
|
836
849
|
if (!n || r && s !== e) {
|
|
837
850
|
const i = t && `"${t}" `, a = r ? ` of length ${e}` : "", c = n ? `length=${s}` : `type=${typeof o}`;
|
|
838
851
|
throw new Error(i + "expected Uint8Array" + a + ", got " + c);
|
|
@@ -845,8 +858,8 @@ function ut(o, e = !0) {
|
|
|
845
858
|
if (e && o.finished)
|
|
846
859
|
throw new Error("Hash#digest() has already been called");
|
|
847
860
|
}
|
|
848
|
-
function
|
|
849
|
-
|
|
861
|
+
function vn(o, e) {
|
|
862
|
+
j(o, void 0, "digestInto() output");
|
|
850
863
|
const t = e.outputLen;
|
|
851
864
|
if (o.length < t)
|
|
852
865
|
throw new Error('"digestInto() output" expected to be of length >=' + t);
|
|
@@ -858,38 +871,38 @@ function Bt(...o) {
|
|
|
858
871
|
for (let e = 0; e < o.length; e++)
|
|
859
872
|
o[e].fill(0);
|
|
860
873
|
}
|
|
861
|
-
const
|
|
862
|
-
function
|
|
874
|
+
const xn = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
875
|
+
function In(o) {
|
|
863
876
|
return o << 24 & 4278190080 | o << 8 & 16711680 | o >>> 8 & 65280 | o >>> 24 & 255;
|
|
864
877
|
}
|
|
865
|
-
function
|
|
878
|
+
function Mn(o) {
|
|
866
879
|
for (let e = 0; e < o.length; e++)
|
|
867
|
-
o[e] =
|
|
880
|
+
o[e] = In(o[e]);
|
|
868
881
|
return o;
|
|
869
882
|
}
|
|
870
|
-
const ht =
|
|
883
|
+
const ht = xn ? (o) => o : Mn;
|
|
871
884
|
function Ht(o, e = {}) {
|
|
872
885
|
const t = (s, r) => o(r).update(s).digest(), n = o(void 0);
|
|
873
886
|
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = (s) => o(s), Object.assign(t, e), Object.freeze(t);
|
|
874
887
|
}
|
|
875
|
-
function
|
|
888
|
+
function Tn(o = 32) {
|
|
876
889
|
const e = typeof globalThis == "object" ? globalThis.crypto : null;
|
|
877
|
-
if (typeof
|
|
890
|
+
if (typeof e?.getRandomValues != "function")
|
|
878
891
|
throw new Error("crypto.getRandomValues must be defined");
|
|
879
892
|
return e.getRandomValues(new Uint8Array(o));
|
|
880
893
|
}
|
|
881
|
-
const
|
|
894
|
+
const Ke = (o) => ({
|
|
882
895
|
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, o])
|
|
883
|
-
}),
|
|
884
|
-
for (let o = 0, e =
|
|
896
|
+
}), Cn = BigInt(0), me = BigInt(1), En = BigInt(2), On = BigInt(7), Rn = BigInt(256), qn = BigInt(113), Pt = [], Kt = [], Nt = [];
|
|
897
|
+
for (let o = 0, e = me, t = 1, n = 0; o < 24; o++) {
|
|
885
898
|
[t, n] = [n, (2 * t + 3 * n) % 5], Pt.push(2 * (5 * n + t)), Kt.push((o + 1) * (o + 2) / 2 % 64);
|
|
886
|
-
let s =
|
|
899
|
+
let s = Cn;
|
|
887
900
|
for (let r = 0; r < 7; r++)
|
|
888
|
-
e = (e <<
|
|
901
|
+
e = (e << me ^ (e >> On) * qn) % Rn, e & En && (s ^= me << (me << BigInt(r)) - me);
|
|
889
902
|
Nt.push(s);
|
|
890
903
|
}
|
|
891
|
-
const
|
|
892
|
-
function
|
|
904
|
+
const Lt = wn(Nt, !0), Wn = Lt[0], Un = Lt[1], dt = (o, e, t) => t > 32 ? Sn(o, e, t) : kn(o, e, t), pt = (o, e, t) => t > 32 ? $n(o, e, t) : _n(o, e, t);
|
|
905
|
+
function Bn(o, e = 24) {
|
|
893
906
|
const t = new Uint32Array(10);
|
|
894
907
|
for (let n = 24 - e; n < 24; n++) {
|
|
895
908
|
for (let i = 0; i < 10; i++)
|
|
@@ -910,24 +923,24 @@ function Nn(o, e = 24) {
|
|
|
910
923
|
for (let a = 0; a < 10; a++)
|
|
911
924
|
o[i + a] ^= ~t[(a + 2) % 10] & t[(a + 4) % 10];
|
|
912
925
|
}
|
|
913
|
-
o[0] ^=
|
|
926
|
+
o[0] ^= Wn[n], o[1] ^= Un[n];
|
|
914
927
|
}
|
|
915
928
|
Bt(t);
|
|
916
929
|
}
|
|
917
|
-
class
|
|
930
|
+
class Ne {
|
|
931
|
+
state;
|
|
932
|
+
pos = 0;
|
|
933
|
+
posOut = 0;
|
|
934
|
+
finished = !1;
|
|
935
|
+
state32;
|
|
936
|
+
destroyed = !1;
|
|
937
|
+
blockLen;
|
|
938
|
+
suffix;
|
|
939
|
+
outputLen;
|
|
940
|
+
enableXOF = !1;
|
|
941
|
+
rounds;
|
|
918
942
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
919
943
|
constructor(e, t, n, s = !1, r = 24) {
|
|
920
|
-
Q(this, "state");
|
|
921
|
-
Q(this, "pos", 0);
|
|
922
|
-
Q(this, "posOut", 0);
|
|
923
|
-
Q(this, "finished", !1);
|
|
924
|
-
Q(this, "state32");
|
|
925
|
-
Q(this, "destroyed", !1);
|
|
926
|
-
Q(this, "blockLen");
|
|
927
|
-
Q(this, "suffix");
|
|
928
|
-
Q(this, "outputLen");
|
|
929
|
-
Q(this, "enableXOF", !1);
|
|
930
|
-
Q(this, "rounds");
|
|
931
944
|
if (this.blockLen = e, this.suffix = t, this.outputLen = n, this.enableXOF = s, this.rounds = r, ct(n, "outputLen"), !(0 < e && e < 200))
|
|
932
945
|
throw new Error("only keccak-f1600 function is supported");
|
|
933
946
|
this.state = new Uint8Array(200), this.state32 = Ut(this.state);
|
|
@@ -936,10 +949,10 @@ class Fe {
|
|
|
936
949
|
return this._cloneInto();
|
|
937
950
|
}
|
|
938
951
|
keccak() {
|
|
939
|
-
ht(this.state32),
|
|
952
|
+
ht(this.state32), Bn(this.state32, this.rounds), ht(this.state32), this.posOut = 0, this.pos = 0;
|
|
940
953
|
}
|
|
941
954
|
update(e) {
|
|
942
|
-
ut(this),
|
|
955
|
+
ut(this), j(e);
|
|
943
956
|
const { blockLen: t, state: n } = this, s = e.length;
|
|
944
957
|
for (let r = 0; r < s; ) {
|
|
945
958
|
const i = Math.min(t - this.pos, s - r);
|
|
@@ -957,7 +970,7 @@ class Fe {
|
|
|
957
970
|
e[n] ^= t, (t & 128) !== 0 && n === s - 1 && this.keccak(), e[s - 1] ^= 128, this.keccak();
|
|
958
971
|
}
|
|
959
972
|
writeInto(e) {
|
|
960
|
-
ut(this, !1),
|
|
973
|
+
ut(this, !1), j(e), this.finish();
|
|
961
974
|
const t = this.state, { blockLen: n } = this;
|
|
962
975
|
for (let s = 0, r = e.length; s < r; ) {
|
|
963
976
|
this.posOut >= n && this.keccak();
|
|
@@ -975,7 +988,7 @@ class Fe {
|
|
|
975
988
|
return ct(e), this.xofInto(new Uint8Array(e));
|
|
976
989
|
}
|
|
977
990
|
digestInto(e) {
|
|
978
|
-
if (
|
|
991
|
+
if (vn(e, this), this.finished)
|
|
979
992
|
throw new Error("digest() was already called");
|
|
980
993
|
return this.writeInto(e), this.destroy(), e;
|
|
981
994
|
}
|
|
@@ -987,37 +1000,37 @@ class Fe {
|
|
|
987
1000
|
}
|
|
988
1001
|
_cloneInto(e) {
|
|
989
1002
|
const { blockLen: t, suffix: n, outputLen: s, rounds: r, enableXOF: i } = this;
|
|
990
|
-
return e
|
|
1003
|
+
return e ||= new Ne(t, n, s, i, r), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = r, e.suffix = n, e.outputLen = s, e.enableXOF = i, e.destroyed = this.destroyed, e;
|
|
991
1004
|
}
|
|
992
1005
|
}
|
|
993
|
-
const
|
|
1006
|
+
const Ft = (o, e, t, n = {}) => Ht(() => new Ne(e, o, t), n), Hn = /* @__PURE__ */ Ft(
|
|
994
1007
|
6,
|
|
995
1008
|
136,
|
|
996
1009
|
32,
|
|
997
|
-
/* @__PURE__ */
|
|
998
|
-
),
|
|
1010
|
+
/* @__PURE__ */ Ke(8)
|
|
1011
|
+
), Pn = /* @__PURE__ */ Ft(
|
|
999
1012
|
6,
|
|
1000
1013
|
72,
|
|
1001
1014
|
64,
|
|
1002
|
-
/* @__PURE__ */
|
|
1003
|
-
), Qt = (o, e, t, n = {}) => Ht((s = {}) => new
|
|
1004
|
-
function
|
|
1015
|
+
/* @__PURE__ */ Ke(10)
|
|
1016
|
+
), Qt = (o, e, t, n = {}) => Ht((s = {}) => new Ne(e, o, s.dkLen === void 0 ? t : s.dkLen, !0), n), Kn = /* @__PURE__ */ Qt(31, 168, 16, /* @__PURE__ */ Ke(11)), jt = /* @__PURE__ */ Qt(31, 136, 32, /* @__PURE__ */ Ke(12));
|
|
1017
|
+
function rt(o) {
|
|
1005
1018
|
if (!Number.isSafeInteger(o) || o < 0 || o > 4294967295)
|
|
1006
1019
|
throw new Error("wrong u32 integer:" + o);
|
|
1007
1020
|
return o;
|
|
1008
1021
|
}
|
|
1009
1022
|
function Dt(o) {
|
|
1010
|
-
return
|
|
1023
|
+
return rt(o), (o & o - 1) === 0 && o !== 0;
|
|
1011
1024
|
}
|
|
1012
1025
|
function Vt(o, e) {
|
|
1013
|
-
|
|
1026
|
+
rt(o);
|
|
1014
1027
|
let t = 0;
|
|
1015
1028
|
for (let n = 0; n < e; n++, o >>>= 1)
|
|
1016
1029
|
t = t << 1 | o & 1;
|
|
1017
1030
|
return t;
|
|
1018
1031
|
}
|
|
1019
1032
|
function zt(o) {
|
|
1020
|
-
return
|
|
1033
|
+
return rt(o), 31 - Math.clz32(o);
|
|
1021
1034
|
}
|
|
1022
1035
|
function ft(o) {
|
|
1023
1036
|
const e = o.length;
|
|
@@ -1056,9 +1069,8 @@ const mt = (o, e) => {
|
|
|
1056
1069
|
return !s && a && ft(l), l;
|
|
1057
1070
|
};
|
|
1058
1071
|
};
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
function Ge(o, e) {
|
|
1072
|
+
const yt = Tn;
|
|
1073
|
+
function Je(o, e) {
|
|
1062
1074
|
if (o.length !== e.length)
|
|
1063
1075
|
return !1;
|
|
1064
1076
|
let t = 0;
|
|
@@ -1066,10 +1078,10 @@ function Ge(o, e) {
|
|
|
1066
1078
|
t |= o[n] ^ e[n];
|
|
1067
1079
|
return t === 0;
|
|
1068
1080
|
}
|
|
1069
|
-
function
|
|
1081
|
+
function Nn(o) {
|
|
1070
1082
|
return Uint8Array.from(o);
|
|
1071
1083
|
}
|
|
1072
|
-
function
|
|
1084
|
+
function qe(o, ...e) {
|
|
1073
1085
|
const t = (s) => typeof s == "number" ? s : s.bytesLen, n = e.reduce((s, r) => s + t(r), 0);
|
|
1074
1086
|
return {
|
|
1075
1087
|
bytesLen: n,
|
|
@@ -1077,12 +1089,12 @@ function We(o, ...e) {
|
|
|
1077
1089
|
const r = new Uint8Array(n);
|
|
1078
1090
|
for (let i = 0, a = 0; i < e.length; i++) {
|
|
1079
1091
|
const c = e[i], u = t(c), l = typeof c == "number" ? s[i] : c.encode(s[i]);
|
|
1080
|
-
|
|
1092
|
+
j(l, u, o), r.set(l, a), typeof c != "number" && l.fill(0), a += u;
|
|
1081
1093
|
}
|
|
1082
1094
|
return r;
|
|
1083
1095
|
},
|
|
1084
1096
|
decode: (s) => {
|
|
1085
|
-
|
|
1097
|
+
j(s, n, o);
|
|
1086
1098
|
const r = [];
|
|
1087
1099
|
for (const i of e) {
|
|
1088
1100
|
const a = t(i), c = s.subarray(0, a);
|
|
@@ -1092,7 +1104,7 @@ function We(o, ...e) {
|
|
|
1092
1104
|
}
|
|
1093
1105
|
};
|
|
1094
1106
|
}
|
|
1095
|
-
function
|
|
1107
|
+
function Ge(o, e) {
|
|
1096
1108
|
const t = e * o.bytesLen;
|
|
1097
1109
|
return {
|
|
1098
1110
|
bytesLen: t,
|
|
@@ -1107,7 +1119,7 @@ function Xe(o, e) {
|
|
|
1107
1119
|
return s;
|
|
1108
1120
|
},
|
|
1109
1121
|
decode: (n) => {
|
|
1110
|
-
|
|
1122
|
+
j(n, t);
|
|
1111
1123
|
const s = [];
|
|
1112
1124
|
for (let r = 0; r < n.length; r += o.bytesLen)
|
|
1113
1125
|
s.push(o.decode(n.subarray(r, r + o.bytesLen)));
|
|
@@ -1115,7 +1127,7 @@ function Xe(o, e) {
|
|
|
1115
1127
|
}
|
|
1116
1128
|
};
|
|
1117
1129
|
}
|
|
1118
|
-
function
|
|
1130
|
+
function G(...o) {
|
|
1119
1131
|
for (const e of o)
|
|
1120
1132
|
if (Array.isArray(e))
|
|
1121
1133
|
for (const t of e)
|
|
@@ -1126,8 +1138,7 @@ function X(...o) {
|
|
|
1126
1138
|
function gt(o) {
|
|
1127
1139
|
return (1 << o) - 1;
|
|
1128
1140
|
}
|
|
1129
|
-
|
|
1130
|
-
const Dn = (o) => {
|
|
1141
|
+
const Ln = (o) => {
|
|
1131
1142
|
const { newPoly: e, N: t, Q: n, F: s, ROOT_OF_UNITY: r, brvBits: i } = o, a = (f, m = n) => {
|
|
1132
1143
|
const w = f % m | 0;
|
|
1133
1144
|
return (w >= 0 ? w | 0 : m + w | 0) | 0;
|
|
@@ -1185,7 +1196,7 @@ const Dn = (o) => {
|
|
|
1185
1196
|
}
|
|
1186
1197
|
};
|
|
1187
1198
|
} };
|
|
1188
|
-
},
|
|
1199
|
+
}, Fn = (o) => (e, t) => {
|
|
1189
1200
|
t || (t = o.blockLen);
|
|
1190
1201
|
const n = new Uint8Array(e.length + 2);
|
|
1191
1202
|
n.set(e);
|
|
@@ -1195,79 +1206,78 @@ const Dn = (o) => {
|
|
|
1195
1206
|
stats: () => ({ calls: a, xofs: c }),
|
|
1196
1207
|
get: (u, l) => (n[s + 0] = u, n[s + 1] = l, i.destroy(), i = o.create({}).update(n), a++, () => (c++, i.xofInto(r))),
|
|
1197
1208
|
clean: () => {
|
|
1198
|
-
i.destroy(),
|
|
1209
|
+
i.destroy(), G(r, n);
|
|
1199
1210
|
}
|
|
1200
1211
|
};
|
|
1201
|
-
},
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
ROOT_OF_UNITY: Gn,
|
|
1212
|
+
}, Qn = /* @__PURE__ */ Fn(Kn);
|
|
1213
|
+
const L = 256, ae = 3329, jn = 3303, Dn = 17, { mod: Se, nttZetas: Vn, NTT: te, bitsCoder: zn } = Ln({
|
|
1214
|
+
N: L,
|
|
1215
|
+
Q: ae,
|
|
1216
|
+
F: jn,
|
|
1217
|
+
ROOT_OF_UNITY: Dn,
|
|
1208
1218
|
newPoly: (o) => new Uint16Array(o),
|
|
1209
1219
|
brvBits: 7
|
|
1210
|
-
}),
|
|
1211
|
-
768: { N:
|
|
1212
|
-
},
|
|
1220
|
+
}), Jn = {
|
|
1221
|
+
768: { N: L, Q: ae, K: 3, ETA1: 2, ETA2: 2, du: 10, dv: 4, RBGstrength: 192 }
|
|
1222
|
+
}, Gn = (o) => {
|
|
1213
1223
|
if (o >= 12)
|
|
1214
1224
|
return { encode: (t) => t, decode: (t) => t };
|
|
1215
1225
|
const e = 2 ** (o - 1);
|
|
1216
1226
|
return {
|
|
1217
1227
|
// const compress = (i: number) => round((2 ** d / Q) * i) % 2 ** d;
|
|
1218
|
-
encode: (t) => ((t << o) +
|
|
1228
|
+
encode: (t) => ((t << o) + ae / 2) / ae,
|
|
1219
1229
|
// const decompress = (i: number) => round((Q / 2 ** d) * i);
|
|
1220
|
-
decode: (t) => t *
|
|
1230
|
+
decode: (t) => t * ae + e >>> o
|
|
1221
1231
|
};
|
|
1222
|
-
},
|
|
1223
|
-
function
|
|
1224
|
-
for (let t = 0; t <
|
|
1225
|
-
o[t] =
|
|
1232
|
+
}, ye = (o) => zn(o, Gn(o));
|
|
1233
|
+
function ne(o, e) {
|
|
1234
|
+
for (let t = 0; t < L; t++)
|
|
1235
|
+
o[t] = Se(o[t] + e[t]);
|
|
1226
1236
|
}
|
|
1227
|
-
function
|
|
1228
|
-
for (let t = 0; t <
|
|
1229
|
-
o[t] =
|
|
1237
|
+
function Xn(o, e) {
|
|
1238
|
+
for (let t = 0; t < L; t++)
|
|
1239
|
+
o[t] = Se(o[t] - e[t]);
|
|
1230
1240
|
}
|
|
1231
|
-
function
|
|
1232
|
-
const r =
|
|
1241
|
+
function Zn(o, e, t, n, s) {
|
|
1242
|
+
const r = Se(e * n * s + o * t), i = Se(o * n + e * t);
|
|
1233
1243
|
return { c0: r, c1: i };
|
|
1234
1244
|
}
|
|
1235
|
-
function
|
|
1236
|
-
for (let t = 0; t <
|
|
1237
|
-
let n =
|
|
1245
|
+
function Ce(o, e) {
|
|
1246
|
+
for (let t = 0; t < L / 2; t++) {
|
|
1247
|
+
let n = Vn[64 + (t >> 1)];
|
|
1238
1248
|
t & 1 && (n = -n);
|
|
1239
|
-
const { c0: s, c1: r } =
|
|
1249
|
+
const { c0: s, c1: r } = Zn(o[2 * t + 0], o[2 * t + 1], e[2 * t + 0], e[2 * t + 1], n);
|
|
1240
1250
|
o[2 * t + 0] = s, o[2 * t + 1] = r;
|
|
1241
1251
|
}
|
|
1242
1252
|
return o;
|
|
1243
1253
|
}
|
|
1244
1254
|
function bt(o) {
|
|
1245
|
-
const e = new Uint16Array(
|
|
1246
|
-
for (let t = 0; t <
|
|
1255
|
+
const e = new Uint16Array(L);
|
|
1256
|
+
for (let t = 0; t < L; ) {
|
|
1247
1257
|
const n = o();
|
|
1248
1258
|
if (n.length % 3)
|
|
1249
1259
|
throw new Error("SampleNTT: unaligned block");
|
|
1250
|
-
for (let s = 0; t <
|
|
1260
|
+
for (let s = 0; t < L && s + 3 <= n.length; s += 3) {
|
|
1251
1261
|
const r = (n[s + 0] >> 0 | n[s + 1] << 8) & 4095, i = (n[s + 1] >> 4 | n[s + 2] << 4) & 4095;
|
|
1252
|
-
r <
|
|
1262
|
+
r < ae && (e[t++] = r), t < L && i < ae && (e[t++] = i);
|
|
1253
1263
|
}
|
|
1254
1264
|
}
|
|
1255
1265
|
return e;
|
|
1256
1266
|
}
|
|
1257
|
-
function
|
|
1258
|
-
const s = o(n *
|
|
1267
|
+
function ge(o, e, t, n) {
|
|
1268
|
+
const s = o(n * L / 4, e, t), r = new Uint16Array(L), i = Ut(s);
|
|
1259
1269
|
let a = 0;
|
|
1260
1270
|
for (let c = 0, u = 0, l = 0, h = 0; c < i.length; c++) {
|
|
1261
1271
|
let p = i[c];
|
|
1262
1272
|
for (let d = 0; d < 32; d++)
|
|
1263
|
-
l += p & 1, p >>= 1, a += 1, a === n ? (h = l, l = 0) : a === 2 * n && (r[u++] =
|
|
1273
|
+
l += p & 1, p >>= 1, a += 1, a === n ? (h = l, l = 0) : a === 2 * n && (r[u++] = Se(h - l), l = 0, a = 0);
|
|
1264
1274
|
}
|
|
1265
1275
|
if (a)
|
|
1266
1276
|
throw new Error(`sampleCBD: leftover bits: ${a}`);
|
|
1267
1277
|
return r;
|
|
1268
1278
|
}
|
|
1269
|
-
const
|
|
1270
|
-
const { K: e, PRF: t, XOF: n, HASH512: s, ETA1: r, ETA2: i, du: a, dv: c } = o, u =
|
|
1279
|
+
const Yn = (o) => {
|
|
1280
|
+
const { K: e, PRF: t, XOF: n, HASH512: s, ETA1: r, ETA2: i, du: a, dv: c } = o, u = ye(1), l = ye(c), h = ye(a), p = qe("publicKey", Ge(ye(12), e), 32), d = Ge(ye(12), e), b = qe("ciphertext", Ge(h, e), l), A = qe("seed", 32, 32);
|
|
1271
1281
|
return {
|
|
1272
1282
|
secretCoder: d,
|
|
1273
1283
|
lengths: {
|
|
@@ -1276,18 +1286,18 @@ const ss = (o) => {
|
|
|
1276
1286
|
cipherText: b.bytesLen
|
|
1277
1287
|
},
|
|
1278
1288
|
keygen: (O) => {
|
|
1279
|
-
|
|
1289
|
+
j(O, 32, "seed");
|
|
1280
1290
|
const f = new Uint8Array(33);
|
|
1281
1291
|
f.set(O), f[32] = e;
|
|
1282
1292
|
const m = s(f), [w, T] = A.decode(m), k = [], $ = [];
|
|
1283
1293
|
for (let _ = 0; _ < e; _++)
|
|
1284
|
-
k.push(
|
|
1294
|
+
k.push(te.encode(ge(t, T, _, r)));
|
|
1285
1295
|
const v = n(w);
|
|
1286
1296
|
for (let _ = 0; _ < e; _++) {
|
|
1287
|
-
const U =
|
|
1297
|
+
const U = te.encode(ge(t, T, e + _, r));
|
|
1288
1298
|
for (let R = 0; R < e; R++) {
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1299
|
+
const ce = bt(v.get(R, _));
|
|
1300
|
+
ne(U, Ce(ce, k[R]));
|
|
1291
1301
|
}
|
|
1292
1302
|
$.push(U);
|
|
1293
1303
|
}
|
|
@@ -1296,37 +1306,37 @@ const ss = (o) => {
|
|
|
1296
1306
|
publicKey: p.encode([$, w]),
|
|
1297
1307
|
secretKey: d.encode(k)
|
|
1298
1308
|
};
|
|
1299
|
-
return
|
|
1309
|
+
return G(w, T, k, $, f, m), I;
|
|
1300
1310
|
},
|
|
1301
1311
|
encrypt: (O, f, m) => {
|
|
1302
1312
|
const [w, T] = p.decode(O), k = [];
|
|
1303
1313
|
for (let R = 0; R < e; R++)
|
|
1304
|
-
k.push(
|
|
1305
|
-
const $ = n(T), v = new Uint16Array(
|
|
1314
|
+
k.push(te.encode(ge(t, m, R, r)));
|
|
1315
|
+
const $ = n(T), v = new Uint16Array(L), I = [];
|
|
1306
1316
|
for (let R = 0; R < e; R++) {
|
|
1307
|
-
const
|
|
1308
|
-
for (let
|
|
1309
|
-
const en = bt($.get(R,
|
|
1310
|
-
|
|
1317
|
+
const ce = ge(t, m, e + R, i), je = new Uint16Array(L);
|
|
1318
|
+
for (let Me = 0; Me < e; Me++) {
|
|
1319
|
+
const en = bt($.get(R, Me));
|
|
1320
|
+
ne(je, Ce(en, k[Me]));
|
|
1311
1321
|
}
|
|
1312
|
-
|
|
1322
|
+
ne(ce, te.decode(je)), I.push(ce), ne(v, Ce(w[R], k[R])), G(je);
|
|
1313
1323
|
}
|
|
1314
1324
|
$.clean();
|
|
1315
|
-
const _ =
|
|
1316
|
-
|
|
1325
|
+
const _ = ge(t, m, 2 * e, i);
|
|
1326
|
+
ne(_, te.decode(v));
|
|
1317
1327
|
const U = u.decode(f);
|
|
1318
|
-
return
|
|
1328
|
+
return ne(U, _), G(w, k, v, _), b.encode([I, U]);
|
|
1319
1329
|
},
|
|
1320
1330
|
decrypt: (O, f) => {
|
|
1321
|
-
const [m, w] = b.decode(O), T = d.decode(f), k = new Uint16Array(
|
|
1331
|
+
const [m, w] = b.decode(O), T = d.decode(f), k = new Uint16Array(L);
|
|
1322
1332
|
for (let $ = 0; $ < e; $++)
|
|
1323
|
-
|
|
1324
|
-
return
|
|
1333
|
+
ne(k, Ce(T[$], te.encode(m[$])));
|
|
1334
|
+
return Xn(w, te.decode(k)), G(k, T, m), u.encode(w);
|
|
1325
1335
|
}
|
|
1326
1336
|
};
|
|
1327
1337
|
};
|
|
1328
|
-
function
|
|
1329
|
-
const e =
|
|
1338
|
+
function es(o) {
|
|
1339
|
+
const e = Yn(o), { HASH256: t, HASH512: n, KDF: s } = o, { secretCoder: r, lengths: i } = e, a = qe("secretKey", i.secretKey, i.publicKey, 32, 32), c = 32, u = 64;
|
|
1330
1340
|
return {
|
|
1331
1341
|
info: { type: "ml-kem" },
|
|
1332
1342
|
lengths: {
|
|
@@ -1337,45 +1347,45 @@ function rs(o) {
|
|
|
1337
1347
|
secretKey: a.bytesLen
|
|
1338
1348
|
},
|
|
1339
1349
|
keygen: (l = yt(u)) => {
|
|
1340
|
-
|
|
1350
|
+
j(l, u, "seed");
|
|
1341
1351
|
const { publicKey: h, secretKey: p } = e.keygen(l.subarray(0, 32)), d = t(h), b = a.encode([p, h, d, l.subarray(32)]);
|
|
1342
|
-
return
|
|
1352
|
+
return G(p, d), { publicKey: h, secretKey: b };
|
|
1343
1353
|
},
|
|
1344
1354
|
getPublicKey: (l) => {
|
|
1345
1355
|
const [h, p] = a.decode(l);
|
|
1346
1356
|
return Uint8Array.from(p);
|
|
1347
1357
|
},
|
|
1348
1358
|
encapsulate: (l, h = yt(c)) => {
|
|
1349
|
-
|
|
1350
|
-
const p = l.subarray(0, 384 * o.K), d = r.encode(r.decode(
|
|
1351
|
-
if (!
|
|
1352
|
-
throw
|
|
1353
|
-
|
|
1359
|
+
j(l, i.publicKey, "publicKey"), j(h, c, "message");
|
|
1360
|
+
const p = l.subarray(0, 384 * o.K), d = r.encode(r.decode(Nn(p)));
|
|
1361
|
+
if (!Je(d, p))
|
|
1362
|
+
throw G(d), new Error("ML-KEM.encapsulate: wrong publicKey modulus");
|
|
1363
|
+
G(d);
|
|
1354
1364
|
const b = n.create().update(h).update(t(l)).digest(), A = e.encrypt(l, h, b.subarray(32, 64));
|
|
1355
|
-
return
|
|
1365
|
+
return G(b.subarray(32)), { cipherText: A, sharedSecret: b.subarray(0, 32) };
|
|
1356
1366
|
},
|
|
1357
1367
|
decapsulate: (l, h) => {
|
|
1358
|
-
|
|
1368
|
+
j(h, a.bytesLen, "secretKey"), j(l, i.cipherText, "cipherText");
|
|
1359
1369
|
const p = a.bytesLen - 96, d = p + 32, b = t(h.subarray(p / 2, d));
|
|
1360
|
-
if (!
|
|
1370
|
+
if (!Je(b, h.subarray(d, d + 32)))
|
|
1361
1371
|
throw new Error("invalid secretKey: hash check failed");
|
|
1362
|
-
const [A, O, f, m] = a.decode(h), w = e.decrypt(l, A), T = n.create().update(w).update(f).digest(), k = T.subarray(0, 32), $ = e.encrypt(O, w, T.subarray(32, 64)), v =
|
|
1363
|
-
return
|
|
1372
|
+
const [A, O, f, m] = a.decode(h), w = e.decrypt(l, A), T = n.create().update(w).update(f).digest(), k = T.subarray(0, 32), $ = e.encrypt(O, w, T.subarray(32, 64)), v = Je(l, $), I = s.create({ dkLen: 32 }).update(m).update(l).digest();
|
|
1373
|
+
return G(w, $, v ? I : k), v ? k : I;
|
|
1364
1374
|
}
|
|
1365
1375
|
};
|
|
1366
1376
|
}
|
|
1367
|
-
function
|
|
1377
|
+
function ts(o, e, t) {
|
|
1368
1378
|
return jt.create({ dkLen: o }).update(e).update(new Uint8Array([t])).digest();
|
|
1369
1379
|
}
|
|
1370
|
-
const
|
|
1371
|
-
HASH256:
|
|
1372
|
-
HASH512:
|
|
1380
|
+
const ns = {
|
|
1381
|
+
HASH256: Hn,
|
|
1382
|
+
HASH512: Pn,
|
|
1373
1383
|
KDF: jt,
|
|
1374
|
-
XOF:
|
|
1375
|
-
PRF:
|
|
1376
|
-
},
|
|
1377
|
-
...
|
|
1378
|
-
...
|
|
1384
|
+
XOF: Qn,
|
|
1385
|
+
PRF: ts
|
|
1386
|
+
}, Xe = /* @__PURE__ */ es({
|
|
1387
|
+
...ns,
|
|
1388
|
+
...Jn[768]
|
|
1379
1389
|
});
|
|
1380
1390
|
class S {
|
|
1381
1391
|
/**
|
|
@@ -1398,7 +1408,7 @@ class S {
|
|
|
1398
1408
|
batchId: i = null,
|
|
1399
1409
|
characters: a = null
|
|
1400
1410
|
}) {
|
|
1401
|
-
this.token = n, this.balance = "0", this.molecules = {}, this.key = null, this.privkey = null, this.pubkey = null, this.tokenUnits = [], this.tradeRates = {}, this.address = s, this.position = r, this.bundle = t, this.batchId = i, this.characters = a, e && (this.bundle = this.bundle ||
|
|
1411
|
+
this.token = n, this.balance = "0", this.molecules = {}, this.key = null, this.privkey = null, this.pubkey = null, this.tokenUnits = [], this.tradeRates = {}, this.address = s, this.position = r, this.bundle = t, this.batchId = i, this.characters = a, e && (this.bundle = this.bundle || de(e, "Wallet::constructor"), this.position = this.position || S.generatePosition(), this.key = S.generateKey({
|
|
1402
1412
|
secret: e,
|
|
1403
1413
|
token: this.token,
|
|
1404
1414
|
position: this.position
|
|
@@ -1423,8 +1433,8 @@ class S {
|
|
|
1423
1433
|
}) {
|
|
1424
1434
|
let i = null;
|
|
1425
1435
|
if (!e && !t)
|
|
1426
|
-
throw new
|
|
1427
|
-
return e && !t && (i = S.generatePosition(), t =
|
|
1436
|
+
throw new ze();
|
|
1437
|
+
return e && !t && (i = S.generatePosition(), t = de(e, "Wallet::create")), new S({
|
|
1428
1438
|
secret: e,
|
|
1429
1439
|
bundle: t,
|
|
1430
1440
|
token: n,
|
|
@@ -1440,7 +1450,7 @@ class S {
|
|
|
1440
1450
|
* @return {boolean}
|
|
1441
1451
|
*/
|
|
1442
1452
|
static isBundleHash(e) {
|
|
1443
|
-
return typeof e != "string" ? !1 : e.length === 64 &&
|
|
1453
|
+
return typeof e != "string" ? !1 : e.length === 64 && De(e);
|
|
1444
1454
|
}
|
|
1445
1455
|
/**
|
|
1446
1456
|
* Get formatted token units from the raw data
|
|
@@ -1451,7 +1461,7 @@ class S {
|
|
|
1451
1461
|
static getTokenUnits(e) {
|
|
1452
1462
|
const t = [];
|
|
1453
1463
|
return e.forEach((n) => {
|
|
1454
|
-
t.push(
|
|
1464
|
+
t.push(pe.createFromDB(n));
|
|
1455
1465
|
}), t;
|
|
1456
1466
|
}
|
|
1457
1467
|
/**
|
|
@@ -1468,12 +1478,12 @@ class S {
|
|
|
1468
1478
|
position: n
|
|
1469
1479
|
}) {
|
|
1470
1480
|
if (!e)
|
|
1471
|
-
throw new
|
|
1481
|
+
throw new ze("Wallet::generateKey() - Secret is required!");
|
|
1472
1482
|
if (!n)
|
|
1473
|
-
throw new
|
|
1474
|
-
const s =
|
|
1483
|
+
throw new ze("Wallet::generateKey() - Position is required!");
|
|
1484
|
+
const s = De(e) ? e : Ve(e, 1024), r = De(n) ? n : Ve(n, 256), a = BigInt(`0x${s}`) + BigInt(`0x${r}`), c = new F("SHAKE256", "TEXT");
|
|
1475
1485
|
c.update(a.toString(16)), t && c.update(t);
|
|
1476
|
-
const u = new
|
|
1486
|
+
const u = new F("SHAKE256", "TEXT");
|
|
1477
1487
|
return u.update(c.getHash("HEX", { outputLen: 8192 })), u.getHash("HEX", { outputLen: 8192 });
|
|
1478
1488
|
}
|
|
1479
1489
|
/**
|
|
@@ -1483,16 +1493,16 @@ class S {
|
|
|
1483
1493
|
* @return {string}
|
|
1484
1494
|
*/
|
|
1485
1495
|
static generateAddress(e) {
|
|
1486
|
-
const t =
|
|
1496
|
+
const t = Ue(e, 128), n = new F("SHAKE256", "TEXT");
|
|
1487
1497
|
for (const r in t) {
|
|
1488
1498
|
let i = t[r];
|
|
1489
1499
|
for (let a = 1; a <= 16; a++) {
|
|
1490
|
-
const c = new
|
|
1500
|
+
const c = new F("SHAKE256", "TEXT");
|
|
1491
1501
|
c.update(i), i = c.getHash("HEX", { outputLen: 512 });
|
|
1492
1502
|
}
|
|
1493
1503
|
n.update(i);
|
|
1494
1504
|
}
|
|
1495
|
-
const s = new
|
|
1505
|
+
const s = new F("SHAKE256", "TEXT");
|
|
1496
1506
|
return s.update(n.getHash("HEX", { outputLen: 8192 })), s.getHash("HEX", { outputLen: 256 });
|
|
1497
1507
|
}
|
|
1498
1508
|
/**
|
|
@@ -1501,22 +1511,30 @@ class S {
|
|
|
1501
1511
|
* @returns {string}
|
|
1502
1512
|
*/
|
|
1503
1513
|
static generatePosition(e = 64) {
|
|
1504
|
-
return
|
|
1514
|
+
return nt(e, "abcdef0123456789");
|
|
1505
1515
|
}
|
|
1506
1516
|
/**
|
|
1507
1517
|
* Initializes the ML-KEM key pair
|
|
1508
1518
|
*/
|
|
1509
1519
|
initializeMLKEM() {
|
|
1510
|
-
const e =
|
|
1520
|
+
const e = tt(this.key, 128), t = new Uint8Array(64);
|
|
1511
1521
|
for (let r = 0; r < 64; r++)
|
|
1512
1522
|
t[r] = parseInt(e.substr(r * 2, 2), 16);
|
|
1513
|
-
const { publicKey: n, secretKey: s } =
|
|
1523
|
+
const { publicKey: n, secretKey: s } = Xe.keygen(t);
|
|
1514
1524
|
this.pubkey = this.serializeKey(n), this.privkey = s;
|
|
1515
1525
|
}
|
|
1516
1526
|
serializeKey(e) {
|
|
1517
|
-
|
|
1527
|
+
if (typeof Buffer < "u")
|
|
1528
|
+
return Buffer.from(e).toString("base64");
|
|
1529
|
+
let t = "";
|
|
1530
|
+
const n = 32768;
|
|
1531
|
+
for (let s = 0; s < e.length; s += n)
|
|
1532
|
+
t += String.fromCharCode(...e.subarray(s, s + n));
|
|
1533
|
+
return btoa(t);
|
|
1518
1534
|
}
|
|
1519
1535
|
deserializeKey(e) {
|
|
1536
|
+
if (typeof Buffer < "u")
|
|
1537
|
+
return new Uint8Array(Buffer.from(e, "base64"));
|
|
1520
1538
|
const t = atob(e);
|
|
1521
1539
|
return new Uint8Array(t.length).map((n, s) => t.charCodeAt(s));
|
|
1522
1540
|
}
|
|
@@ -1633,13 +1651,18 @@ class S {
|
|
|
1633
1651
|
sourceWallet: e,
|
|
1634
1652
|
isRemainder: t = !1
|
|
1635
1653
|
}) {
|
|
1636
|
-
e.batchId && (this.batchId = t ? e.batchId :
|
|
1654
|
+
e.batchId && (this.batchId = t ? e.batchId : Be({}));
|
|
1637
1655
|
}
|
|
1638
1656
|
async encryptMessage(e, t) {
|
|
1639
|
-
const n = JSON.stringify(e), s = new TextEncoder().encode(n), r = this.deserializeKey(t),
|
|
1657
|
+
const n = JSON.stringify(e), s = new TextEncoder().encode(n), r = this.deserializeKey(t), i = 1184;
|
|
1658
|
+
if (r.length !== i)
|
|
1659
|
+
throw new Error(
|
|
1660
|
+
`KnishIO: cannot ML-KEM-encrypt — recipient public key is ${r.length} bytes, expected ${i} (ML-KEM-768). The node likely did not advertise an ML-KEM public key (upgrade the validator to a PQ-transport build), or authenticate with { encrypt: false }.`
|
|
1661
|
+
);
|
|
1662
|
+
const { cipherText: a, sharedSecret: c } = Xe.encapsulate(r), u = await this.encryptWithSharedSecret(s, c);
|
|
1640
1663
|
return {
|
|
1641
|
-
cipherText: this.serializeKey(
|
|
1642
|
-
encryptedMessage: this.serializeKey(
|
|
1664
|
+
cipherText: this.serializeKey(a),
|
|
1665
|
+
encryptedMessage: this.serializeKey(u)
|
|
1643
1666
|
};
|
|
1644
1667
|
}
|
|
1645
1668
|
async decryptMessage(e) {
|
|
@@ -1656,7 +1679,7 @@ class S {
|
|
|
1656
1679
|
const { cipherText: t, encryptedMessage: n } = e;
|
|
1657
1680
|
let s;
|
|
1658
1681
|
try {
|
|
1659
|
-
s =
|
|
1682
|
+
s = Xe.decapsulate(this.deserializeKey(t), this.privkey);
|
|
1660
1683
|
} catch (a) {
|
|
1661
1684
|
return console.error("Wallet::decryptMessage() - Decapsulation failed", a), console.info("Wallet::decryptMessage() - my public key", this.pubkey), null;
|
|
1662
1685
|
}
|
|
@@ -1684,7 +1707,7 @@ class S {
|
|
|
1684
1707
|
* `shake256(pubkey, 64)` = 64 bits = 8 bytes, hex; hex-decode → standard base64. PQ Phase E.
|
|
1685
1708
|
*/
|
|
1686
1709
|
hashShare(e) {
|
|
1687
|
-
const t =
|
|
1710
|
+
const t = Ve(e, 64), n = Uint8Array.from(t.match(/.{2}/g).map((s) => parseInt(s, 16)));
|
|
1688
1711
|
return this.serializeKey(n);
|
|
1689
1712
|
}
|
|
1690
1713
|
/**
|
|
@@ -1740,7 +1763,7 @@ class S {
|
|
|
1740
1763
|
return new Uint8Array(i);
|
|
1741
1764
|
}
|
|
1742
1765
|
}
|
|
1743
|
-
class
|
|
1766
|
+
class be extends x {
|
|
1744
1767
|
/**
|
|
1745
1768
|
* Class constructor
|
|
1746
1769
|
*
|
|
@@ -1752,7 +1775,7 @@ class we extends x {
|
|
|
1752
1775
|
super(e, t, n), this.name = "AtomIndexException";
|
|
1753
1776
|
}
|
|
1754
1777
|
}
|
|
1755
|
-
class
|
|
1778
|
+
class ss extends x {
|
|
1756
1779
|
/**
|
|
1757
1780
|
* Class constructor
|
|
1758
1781
|
*
|
|
@@ -1764,7 +1787,7 @@ class as extends x {
|
|
|
1764
1787
|
super(e, t, n), this.name = "MolecularHashMismatchException";
|
|
1765
1788
|
}
|
|
1766
1789
|
}
|
|
1767
|
-
class
|
|
1790
|
+
class rs extends x {
|
|
1768
1791
|
/**
|
|
1769
1792
|
* Class constructor
|
|
1770
1793
|
*
|
|
@@ -1800,7 +1823,7 @@ class Jt extends x {
|
|
|
1800
1823
|
super(e, t, n), this.name = "SignatureMalformedException";
|
|
1801
1824
|
}
|
|
1802
1825
|
}
|
|
1803
|
-
class
|
|
1826
|
+
class is extends x {
|
|
1804
1827
|
/**
|
|
1805
1828
|
* Class constructor
|
|
1806
1829
|
*
|
|
@@ -1812,7 +1835,7 @@ class cs extends x {
|
|
|
1812
1835
|
super(e, t, n), this.name = "SignatureMismatchException";
|
|
1813
1836
|
}
|
|
1814
1837
|
}
|
|
1815
|
-
class
|
|
1838
|
+
class J extends x {
|
|
1816
1839
|
/**
|
|
1817
1840
|
* Class constructor
|
|
1818
1841
|
*
|
|
@@ -1824,7 +1847,7 @@ class G extends x {
|
|
|
1824
1847
|
super(e, t, n), this.name = "TransferBalanceException";
|
|
1825
1848
|
}
|
|
1826
1849
|
}
|
|
1827
|
-
class
|
|
1850
|
+
class we extends x {
|
|
1828
1851
|
/**
|
|
1829
1852
|
* Class constructor
|
|
1830
1853
|
*
|
|
@@ -1858,7 +1881,7 @@ class _t extends x {
|
|
|
1858
1881
|
super(e, t, n), this.name = "TransferRemainderException";
|
|
1859
1882
|
}
|
|
1860
1883
|
}
|
|
1861
|
-
class
|
|
1884
|
+
class os extends x {
|
|
1862
1885
|
/**
|
|
1863
1886
|
* Class constructor
|
|
1864
1887
|
*
|
|
@@ -1870,7 +1893,7 @@ class us extends x {
|
|
|
1870
1893
|
super(e, t, n), this.name = "TransferToSelfException";
|
|
1871
1894
|
}
|
|
1872
1895
|
}
|
|
1873
|
-
class
|
|
1896
|
+
class Ee extends x {
|
|
1874
1897
|
/**
|
|
1875
1898
|
* Class constructor
|
|
1876
1899
|
*
|
|
@@ -1894,7 +1917,7 @@ class H extends x {
|
|
|
1894
1917
|
super(e, t, n), this.name = "MetaMissingException";
|
|
1895
1918
|
}
|
|
1896
1919
|
}
|
|
1897
|
-
class
|
|
1920
|
+
class se extends x {
|
|
1898
1921
|
/**
|
|
1899
1922
|
* Class constructor
|
|
1900
1923
|
*
|
|
@@ -1906,7 +1929,7 @@ class re extends x {
|
|
|
1906
1929
|
super(e, t, n), this.name = "WrongTokenTypeException";
|
|
1907
1930
|
}
|
|
1908
1931
|
}
|
|
1909
|
-
class
|
|
1932
|
+
class We extends x {
|
|
1910
1933
|
/**
|
|
1911
1934
|
* @param {string|null} message
|
|
1912
1935
|
* @param {string|null} fileName
|
|
@@ -1935,7 +1958,7 @@ class St {
|
|
|
1935
1958
|
return e;
|
|
1936
1959
|
}
|
|
1937
1960
|
}
|
|
1938
|
-
class
|
|
1961
|
+
class He extends x {
|
|
1939
1962
|
/**
|
|
1940
1963
|
* Class constructor
|
|
1941
1964
|
*
|
|
@@ -1947,7 +1970,7 @@ class Pe extends x {
|
|
|
1947
1970
|
super(e, t, n), this.name = "RuleArgumentException";
|
|
1948
1971
|
}
|
|
1949
1972
|
}
|
|
1950
|
-
class
|
|
1973
|
+
class Y extends x {
|
|
1951
1974
|
/**
|
|
1952
1975
|
* @param {string|null} message
|
|
1953
1976
|
* @param {string|null} fileName
|
|
@@ -1957,7 +1980,7 @@ class ee extends x {
|
|
|
1957
1980
|
super(e, t, n), this.name = "CodeException";
|
|
1958
1981
|
}
|
|
1959
1982
|
}
|
|
1960
|
-
class
|
|
1983
|
+
class _e {
|
|
1961
1984
|
/**
|
|
1962
1985
|
*
|
|
1963
1986
|
* @param {string} action
|
|
@@ -1980,7 +2003,7 @@ class Se {
|
|
|
1980
2003
|
comparison: c = null
|
|
1981
2004
|
}) {
|
|
1982
2005
|
if (s && (this.meta = s), !e)
|
|
1983
|
-
throw new
|
|
2006
|
+
throw new He('Callback structure violated, missing mandatory "action" parameter.');
|
|
1984
2007
|
this.__metaId = n, this.__metaType = t, this.__action = e, this.__address = r, this.__token = i, this.__amount = a, this.__comparison = c;
|
|
1985
2008
|
}
|
|
1986
2009
|
/**
|
|
@@ -1995,8 +2018,8 @@ class Se {
|
|
|
1995
2018
|
* @param {string} amount
|
|
1996
2019
|
*/
|
|
1997
2020
|
set amount(e) {
|
|
1998
|
-
if (!
|
|
1999
|
-
throw new
|
|
2021
|
+
if (!fn(e))
|
|
2022
|
+
throw new Y("Parameter amount should be a string containing numbers");
|
|
2000
2023
|
this.__amount = e;
|
|
2001
2024
|
}
|
|
2002
2025
|
/**
|
|
@@ -2041,7 +2064,7 @@ class Se {
|
|
|
2041
2064
|
* @return Callback
|
|
2042
2065
|
*/
|
|
2043
2066
|
static toObject(e) {
|
|
2044
|
-
const t = new
|
|
2067
|
+
const t = new _e({
|
|
2045
2068
|
action: e.action
|
|
2046
2069
|
});
|
|
2047
2070
|
return e.metaType && (t.metaType = e.metaType), e.metaId && (t.metaId = e.metaId), e.meta && (t.meta = e.meta), e.address && (t.address = e.address), e.token && (t.token = e.token), e.amount && (t.amount = e.amount), e.comparison && (t.comparison = e.comparison), t;
|
|
@@ -2066,31 +2089,31 @@ class Se {
|
|
|
2066
2089
|
* @return {boolean}
|
|
2067
2090
|
*/
|
|
2068
2091
|
isMeta() {
|
|
2069
|
-
return
|
|
2092
|
+
return fe(Object.keys(this.toJSON()), ["action", "metaId", "metaType", "meta"]).length === 4 && this._is("meta");
|
|
2070
2093
|
}
|
|
2071
2094
|
/**
|
|
2072
2095
|
* @return {boolean}
|
|
2073
2096
|
*/
|
|
2074
2097
|
isCollect() {
|
|
2075
|
-
return
|
|
2098
|
+
return fe(Object.keys(this.toJSON()), ["action", "address", "token", "amount", "comparison"]).length === 5 && this._is("collect");
|
|
2076
2099
|
}
|
|
2077
2100
|
/**
|
|
2078
2101
|
* @return {boolean}
|
|
2079
2102
|
*/
|
|
2080
2103
|
isBuffer() {
|
|
2081
|
-
return
|
|
2104
|
+
return fe(Object.keys(this.toJSON()), ["action", "address", "token", "amount", "comparison"]).length === 5 && this._is("buffer");
|
|
2082
2105
|
}
|
|
2083
2106
|
/**
|
|
2084
2107
|
* @return {boolean}
|
|
2085
2108
|
*/
|
|
2086
2109
|
isRemit() {
|
|
2087
|
-
return
|
|
2110
|
+
return fe(Object.keys(this.toJSON()), ["action", "token", "amount"]).length === 3 && this._is("remit");
|
|
2088
2111
|
}
|
|
2089
2112
|
/**
|
|
2090
2113
|
* @return {boolean}
|
|
2091
2114
|
*/
|
|
2092
2115
|
isBurn() {
|
|
2093
|
-
return
|
|
2116
|
+
return fe(Object.keys(this.toJSON()), ["action", "token", "amount", "comparison"]).length === 4 && this._is("burn");
|
|
2094
2117
|
}
|
|
2095
2118
|
/**
|
|
2096
2119
|
* @param {string} type
|
|
@@ -2102,7 +2125,7 @@ class Se {
|
|
|
2102
2125
|
return this.__action.toLowerCase() === e.toLowerCase();
|
|
2103
2126
|
}
|
|
2104
2127
|
}
|
|
2105
|
-
class
|
|
2128
|
+
class Ze {
|
|
2106
2129
|
/**
|
|
2107
2130
|
*
|
|
2108
2131
|
* @param key
|
|
@@ -2115,7 +2138,7 @@ class Ye {
|
|
|
2115
2138
|
comparison: n
|
|
2116
2139
|
}) {
|
|
2117
2140
|
if ([e, t, n].some((s) => !s))
|
|
2118
|
-
throw new
|
|
2141
|
+
throw new He("Condition::constructor( { key, value, comparison } ) - not all class parameters are initialised!");
|
|
2119
2142
|
this.__key = e, this.__value = t, this.__comparison = n;
|
|
2120
2143
|
}
|
|
2121
2144
|
/**
|
|
@@ -2140,7 +2163,7 @@ class Ye {
|
|
|
2140
2163
|
};
|
|
2141
2164
|
}
|
|
2142
2165
|
}
|
|
2143
|
-
class
|
|
2166
|
+
class $e {
|
|
2144
2167
|
/**
|
|
2145
2168
|
*
|
|
2146
2169
|
* @param {Condition[]} condition
|
|
@@ -2151,11 +2174,11 @@ class Ae {
|
|
|
2151
2174
|
callback: t = []
|
|
2152
2175
|
}) {
|
|
2153
2176
|
for (const n of e)
|
|
2154
|
-
if (!(n instanceof
|
|
2155
|
-
throw new
|
|
2177
|
+
if (!(n instanceof Ze))
|
|
2178
|
+
throw new He();
|
|
2156
2179
|
for (const n of t)
|
|
2157
|
-
if (!(n instanceof
|
|
2158
|
-
throw new
|
|
2180
|
+
if (!(n instanceof _e))
|
|
2181
|
+
throw new He();
|
|
2159
2182
|
this.__condition = e, this.__callback = t;
|
|
2160
2183
|
}
|
|
2161
2184
|
/**
|
|
@@ -2163,13 +2186,13 @@ class Ae {
|
|
|
2163
2186
|
* @param {Condition[]|{}} condition
|
|
2164
2187
|
*/
|
|
2165
2188
|
set comparison(e) {
|
|
2166
|
-
this.__condition.push(e instanceof
|
|
2189
|
+
this.__condition.push(e instanceof Ze ? e : Ze.toObject(e));
|
|
2167
2190
|
}
|
|
2168
2191
|
/**
|
|
2169
2192
|
* @param {Callback[]|{}} callback
|
|
2170
2193
|
*/
|
|
2171
2194
|
set callback(e) {
|
|
2172
|
-
this.__callback.push(e instanceof
|
|
2195
|
+
this.__callback.push(e instanceof _e ? e : _e.toObject(e));
|
|
2173
2196
|
}
|
|
2174
2197
|
/**
|
|
2175
2198
|
*
|
|
@@ -2182,7 +2205,7 @@ class Ae {
|
|
|
2182
2205
|
throw new H("Rule::toObject() - Incorrect rule format! There is no condition field.");
|
|
2183
2206
|
if (!e.callback)
|
|
2184
2207
|
throw new H("Rule::toObject() - Incorrect rule format! There is no callback field.");
|
|
2185
|
-
const t = new
|
|
2208
|
+
const t = new $e({});
|
|
2186
2209
|
for (const n of e.condition)
|
|
2187
2210
|
t.comparison = n;
|
|
2188
2211
|
for (const n of e.callback)
|
|
@@ -2258,19 +2281,19 @@ class M {
|
|
|
2258
2281
|
return r[Number.isInteger(c) ? c : a] = n, e;
|
|
2259
2282
|
}
|
|
2260
2283
|
}
|
|
2261
|
-
class
|
|
2284
|
+
class Ae {
|
|
2262
2285
|
/**
|
|
2263
2286
|
*
|
|
2264
2287
|
* @param molecule
|
|
2265
2288
|
*/
|
|
2266
2289
|
constructor(e) {
|
|
2267
2290
|
if (e.molecularHash === null)
|
|
2268
|
-
throw new
|
|
2291
|
+
throw new rs();
|
|
2269
2292
|
if (!e.atoms.length)
|
|
2270
|
-
throw new
|
|
2293
|
+
throw new oe();
|
|
2271
2294
|
for (const t of e.atoms)
|
|
2272
2295
|
if (t.index === null)
|
|
2273
|
-
throw new
|
|
2296
|
+
throw new be();
|
|
2274
2297
|
this.molecule = e;
|
|
2275
2298
|
}
|
|
2276
2299
|
/**
|
|
@@ -2287,7 +2310,7 @@ class ve {
|
|
|
2287
2310
|
*/
|
|
2288
2311
|
continuId() {
|
|
2289
2312
|
if (this.molecule.atoms[0].token === "USER" && this.molecule.getIsotopes("I").length < 1)
|
|
2290
|
-
throw new
|
|
2313
|
+
throw new oe("Check::continuId() - Molecule is missing required ContinuID Atom!");
|
|
2291
2314
|
return !0;
|
|
2292
2315
|
}
|
|
2293
2316
|
/**
|
|
@@ -2300,14 +2323,14 @@ class ve {
|
|
|
2300
2323
|
if (e.isotope === "V" && e.batchId !== null) {
|
|
2301
2324
|
const t = this.molecule.getIsotopes("V"), n = t[t.length - 1];
|
|
2302
2325
|
if (e.batchId !== n.batchId)
|
|
2303
|
-
throw new
|
|
2326
|
+
throw new We();
|
|
2304
2327
|
for (const s of t)
|
|
2305
2328
|
if (s.batchId === null)
|
|
2306
|
-
throw new
|
|
2329
|
+
throw new We();
|
|
2307
2330
|
}
|
|
2308
2331
|
return !0;
|
|
2309
2332
|
}
|
|
2310
|
-
throw new
|
|
2333
|
+
throw new We();
|
|
2311
2334
|
}
|
|
2312
2335
|
/**
|
|
2313
2336
|
*
|
|
@@ -2316,9 +2339,9 @@ class ve {
|
|
|
2316
2339
|
isotopeI() {
|
|
2317
2340
|
for (const e of this.molecule.getIsotopes("I")) {
|
|
2318
2341
|
if (e.token !== "USER")
|
|
2319
|
-
throw new
|
|
2342
|
+
throw new se(`Check::isotopeI() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2320
2343
|
if (e.index === 0)
|
|
2321
|
-
throw new
|
|
2344
|
+
throw new be(`Check::isotopeI() - Isotope "${e.isotope}" Atoms must have a non-zero index!`);
|
|
2322
2345
|
}
|
|
2323
2346
|
return !0;
|
|
2324
2347
|
}
|
|
@@ -2329,9 +2352,9 @@ class ve {
|
|
|
2329
2352
|
isotopeU() {
|
|
2330
2353
|
for (const e of this.molecule.getIsotopes("U")) {
|
|
2331
2354
|
if (e.token !== "AUTH")
|
|
2332
|
-
throw new
|
|
2355
|
+
throw new se(`Check::isotopeU() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2333
2356
|
if (e.index !== 0)
|
|
2334
|
-
throw new
|
|
2357
|
+
throw new be(`Check::isotopeU() - Isotope "${e.isotope}" Atoms must have an index equal to 0!`);
|
|
2335
2358
|
}
|
|
2336
2359
|
return !0;
|
|
2337
2360
|
}
|
|
@@ -2345,8 +2368,8 @@ class ve {
|
|
|
2345
2368
|
if (t.meta.length < 1)
|
|
2346
2369
|
throw new H();
|
|
2347
2370
|
if (t.token !== "USER")
|
|
2348
|
-
throw new
|
|
2349
|
-
const n =
|
|
2371
|
+
throw new se(`Check::isotopeM() - "${t.token}" is not a valid Token slug for "${t.isotope}" isotope Atoms!`);
|
|
2372
|
+
const n = he.aggregateMeta(t.meta);
|
|
2350
2373
|
for (const s of e) {
|
|
2351
2374
|
let r = n[s];
|
|
2352
2375
|
if (r) {
|
|
@@ -2371,9 +2394,9 @@ class ve {
|
|
|
2371
2394
|
isotopeC() {
|
|
2372
2395
|
for (const e of this.molecule.getIsotopes("C")) {
|
|
2373
2396
|
if (e.token !== "USER")
|
|
2374
|
-
throw new
|
|
2397
|
+
throw new se(`Check::isotopeC() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2375
2398
|
if (e.index !== 0)
|
|
2376
|
-
throw new
|
|
2399
|
+
throw new be(`Check::isotopeC() - Isotope "${e.isotope}" Atoms must have an index equal to 0!`);
|
|
2377
2400
|
}
|
|
2378
2401
|
return !0;
|
|
2379
2402
|
}
|
|
@@ -2393,9 +2416,9 @@ class ve {
|
|
|
2393
2416
|
if (!Object.prototype.hasOwnProperty.call(t, s) || !t[s])
|
|
2394
2417
|
throw new H(`Check::isotopeT() - Required meta field "${s}" is missing!`);
|
|
2395
2418
|
if (e.token !== "USER")
|
|
2396
|
-
throw new
|
|
2419
|
+
throw new se(`Check::isotopeT() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2397
2420
|
if (e.index !== 0)
|
|
2398
|
-
throw new
|
|
2421
|
+
throw new be(`Check::isotopeT() - Isotope "${e.isotope}" Atoms must have an index equal to 0!`);
|
|
2399
2422
|
}
|
|
2400
2423
|
return !0;
|
|
2401
2424
|
}
|
|
@@ -2416,7 +2439,7 @@ class ve {
|
|
|
2416
2439
|
if (!Array.isArray(n))
|
|
2417
2440
|
throw new H("Check::isotopeR() - Incorrect rule format!");
|
|
2418
2441
|
for (const s of n)
|
|
2419
|
-
|
|
2442
|
+
$e.toObject(s);
|
|
2420
2443
|
if (n.length < 1)
|
|
2421
2444
|
throw new H("Check::isotopeR() - No rules!");
|
|
2422
2445
|
}
|
|
@@ -2431,7 +2454,7 @@ class ve {
|
|
|
2431
2454
|
isotopeP() {
|
|
2432
2455
|
for (const e of this.molecule.getIsotopes("P")) {
|
|
2433
2456
|
if (e.token !== "USER")
|
|
2434
|
-
throw new
|
|
2457
|
+
throw new se(`Check::isotopeP() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2435
2458
|
const t = e.aggregatedMeta();
|
|
2436
2459
|
if (!Object.prototype.hasOwnProperty.call(t, "peerHost") || !t.peerHost)
|
|
2437
2460
|
throw new H('Check::isotopeP() - Required meta field "peerHost" is missing!');
|
|
@@ -2446,7 +2469,7 @@ class ve {
|
|
|
2446
2469
|
isotopeA() {
|
|
2447
2470
|
for (const e of this.molecule.getIsotopes("A")) {
|
|
2448
2471
|
if (e.token !== "USER")
|
|
2449
|
-
throw new
|
|
2472
|
+
throw new se(`Check::isotopeA() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2450
2473
|
if (!e.metaType)
|
|
2451
2474
|
throw new H('Check::isotopeA() - Required field "metaType" is missing!');
|
|
2452
2475
|
if (!e.metaId)
|
|
@@ -2473,7 +2496,7 @@ class ve {
|
|
|
2473
2496
|
throw new H("Check::isotopeB() - B-isotope atoms must have a metaId!");
|
|
2474
2497
|
const s = Number(n.value);
|
|
2475
2498
|
if (Number.isNaN(s))
|
|
2476
|
-
throw new
|
|
2499
|
+
throw new we("Check::isotopeB() - B-isotope atom value is not a valid number!");
|
|
2477
2500
|
}
|
|
2478
2501
|
const t = this.molecule.getIsotopes("V");
|
|
2479
2502
|
if (t.length > 0) {
|
|
@@ -2483,7 +2506,7 @@ class ve {
|
|
|
2483
2506
|
Number.isNaN(r) || (n += r);
|
|
2484
2507
|
}
|
|
2485
2508
|
if (n !== 0)
|
|
2486
|
-
throw new
|
|
2509
|
+
throw new Ee("Check::isotopeB() - V+B atom values do not balance to zero!");
|
|
2487
2510
|
}
|
|
2488
2511
|
return !0;
|
|
2489
2512
|
}
|
|
@@ -2503,9 +2526,9 @@ class ve {
|
|
|
2503
2526
|
throw new H("Check::isotopeF() - F-isotope atoms must have a metaId!");
|
|
2504
2527
|
const s = Number(n.value);
|
|
2505
2528
|
if (Number.isNaN(s))
|
|
2506
|
-
throw new
|
|
2529
|
+
throw new we("Check::isotopeF() - F-isotope atom value is not a valid number!");
|
|
2507
2530
|
if (s < 0)
|
|
2508
|
-
throw new
|
|
2531
|
+
throw new we("Check::isotopeF() - F-isotope atom value must not be negative!");
|
|
2509
2532
|
}
|
|
2510
2533
|
const t = this.molecule.getIsotopes("V");
|
|
2511
2534
|
if (t.length > 0) {
|
|
@@ -2515,7 +2538,7 @@ class ve {
|
|
|
2515
2538
|
Number.isNaN(r) || (n += r);
|
|
2516
2539
|
}
|
|
2517
2540
|
if (n !== 0)
|
|
2518
|
-
throw new
|
|
2541
|
+
throw new Ee("Check::isotopeF() - V+F atom values do not balance to zero!");
|
|
2519
2542
|
}
|
|
2520
2543
|
return !0;
|
|
2521
2544
|
}
|
|
@@ -2534,9 +2557,9 @@ class ve {
|
|
|
2534
2557
|
if (s.token !== a.token)
|
|
2535
2558
|
throw new kt();
|
|
2536
2559
|
if (a.value < 0)
|
|
2537
|
-
throw new
|
|
2560
|
+
throw new we();
|
|
2538
2561
|
if (Number(s.value) + Number(a.value) !== 0)
|
|
2539
|
-
throw new
|
|
2562
|
+
throw new Ee();
|
|
2540
2563
|
return !0;
|
|
2541
2564
|
}
|
|
2542
2565
|
let r = 0, i = 0;
|
|
@@ -2551,20 +2574,20 @@ class ve {
|
|
|
2551
2574
|
throw new kt();
|
|
2552
2575
|
if (a > 0) {
|
|
2553
2576
|
if (i < 0)
|
|
2554
|
-
throw new
|
|
2577
|
+
throw new we();
|
|
2555
2578
|
if (c.walletAddress === s.walletAddress)
|
|
2556
|
-
throw new
|
|
2579
|
+
throw new os();
|
|
2557
2580
|
}
|
|
2558
2581
|
r += i;
|
|
2559
2582
|
}
|
|
2560
2583
|
if (!n && r !== 0)
|
|
2561
|
-
throw new
|
|
2584
|
+
throw new Ee();
|
|
2562
2585
|
if (e) {
|
|
2563
2586
|
if (i = s.value * 1, Number.isNaN(i))
|
|
2564
2587
|
throw new TypeError('Invalid isotope "V" values');
|
|
2565
2588
|
const a = Number(e.balance) + i;
|
|
2566
2589
|
if (a < 0)
|
|
2567
|
-
throw new
|
|
2590
|
+
throw new J();
|
|
2568
2591
|
if (!n && a !== r)
|
|
2569
2592
|
throw new _t();
|
|
2570
2593
|
} else if (i !== 0)
|
|
@@ -2580,7 +2603,7 @@ class ve {
|
|
|
2580
2603
|
if (this.molecule.molecularHash !== g.hashAtoms({
|
|
2581
2604
|
atoms: this.molecule.atoms
|
|
2582
2605
|
}))
|
|
2583
|
-
throw new
|
|
2606
|
+
throw new ss();
|
|
2584
2607
|
return !0;
|
|
2585
2608
|
}
|
|
2586
2609
|
/**
|
|
@@ -2597,25 +2620,25 @@ class ve {
|
|
|
2597
2620
|
).reduce(
|
|
2598
2621
|
(p, d) => p + d
|
|
2599
2622
|
);
|
|
2600
|
-
if (t.length !== 2048 && (t =
|
|
2623
|
+
if (t.length !== 2048 && (t = pn(t), t.length !== 2048))
|
|
2601
2624
|
throw new Jt();
|
|
2602
|
-
const n =
|
|
2625
|
+
const n = Ue(t, 128);
|
|
2603
2626
|
let s = "";
|
|
2604
2627
|
for (const p in n) {
|
|
2605
2628
|
let d = n[p];
|
|
2606
2629
|
for (let b = 0, A = 8 + e[p]; b < A; b++)
|
|
2607
|
-
d = new
|
|
2630
|
+
d = new F("SHAKE256", "TEXT").update(d).getHash("HEX", { outputLen: 512 });
|
|
2608
2631
|
s += d;
|
|
2609
2632
|
}
|
|
2610
|
-
const r = new
|
|
2633
|
+
const r = new F("SHAKE256", "TEXT");
|
|
2611
2634
|
r.update(s);
|
|
2612
|
-
const i = r.getHash("HEX", { outputLen: 8192 }), a = new
|
|
2635
|
+
const i = r.getHash("HEX", { outputLen: 8192 }), a = new F("SHAKE256", "TEXT");
|
|
2613
2636
|
a.update(i);
|
|
2614
2637
|
const c = a.getHash("HEX", { outputLen: 256 }), u = this.molecule.atoms[0];
|
|
2615
2638
|
let l = u.walletAddress;
|
|
2616
2639
|
const h = M.get(u.aggregatedMeta(), "signingWallet");
|
|
2617
2640
|
if (h && (l = M.get(JSON.parse(h), "address")), c !== l)
|
|
2618
|
-
throw new
|
|
2641
|
+
throw new is();
|
|
2619
2642
|
return !0;
|
|
2620
2643
|
}
|
|
2621
2644
|
/**
|
|
@@ -2668,7 +2691,7 @@ class ve {
|
|
|
2668
2691
|
createdAt: c.createdAt || null
|
|
2669
2692
|
};
|
|
2670
2693
|
});
|
|
2671
|
-
return
|
|
2694
|
+
return V.fromJSON({
|
|
2672
2695
|
molecularHash: e,
|
|
2673
2696
|
bundle: t,
|
|
2674
2697
|
cellSlug: n,
|
|
@@ -2686,8 +2709,8 @@ class ve {
|
|
|
2686
2709
|
*/
|
|
2687
2710
|
static verifyFromServerData(e) {
|
|
2688
2711
|
try {
|
|
2689
|
-
const t =
|
|
2690
|
-
return new
|
|
2712
|
+
const t = Ae.fromServerData(e);
|
|
2713
|
+
return new Ae(t).verify(), {
|
|
2691
2714
|
molecularHash: e.molecularHash,
|
|
2692
2715
|
verified: !0,
|
|
2693
2716
|
error: null
|
|
@@ -2701,7 +2724,7 @@ class ve {
|
|
|
2701
2724
|
}
|
|
2702
2725
|
}
|
|
2703
2726
|
}
|
|
2704
|
-
class
|
|
2727
|
+
class ue extends x {
|
|
2705
2728
|
/**
|
|
2706
2729
|
* Class constructor
|
|
2707
2730
|
*
|
|
@@ -2725,7 +2748,7 @@ class $t extends x {
|
|
|
2725
2748
|
super(e, t, n), this.name = "NegativeAmountException";
|
|
2726
2749
|
}
|
|
2727
2750
|
}
|
|
2728
|
-
class
|
|
2751
|
+
class V {
|
|
2729
2752
|
/**
|
|
2730
2753
|
* Class constructor
|
|
2731
2754
|
*
|
|
@@ -2745,7 +2768,7 @@ class z {
|
|
|
2745
2768
|
version: i = null,
|
|
2746
2769
|
continuIdPosition: a = null
|
|
2747
2770
|
}) {
|
|
2748
|
-
this.status = null, this.molecularHash = null, this.createdAt = String(+/* @__PURE__ */ new Date()), this.cellSlugOrigin = this.cellSlug = r, this.secret = e, this.bundle = t, this.sourceWallet = n, this.continuIdPosition = a, this.atoms = [], this.parentHashes = [], i !== null && Object.prototype.hasOwnProperty.call(
|
|
2771
|
+
this.status = null, this.molecularHash = null, this.createdAt = String(+/* @__PURE__ */ new Date()), this.cellSlugOrigin = this.cellSlug = r, this.secret = e, this.bundle = t, this.sourceWallet = n, this.continuIdPosition = a, this.atoms = [], this.parentHashes = [], i !== null && Object.prototype.hasOwnProperty.call(Re, i) && (this.version = String(i)), (s || n) && (this.remainderWallet = s || S.create({
|
|
2749
2772
|
secret: e,
|
|
2750
2773
|
bundle: t,
|
|
2751
2774
|
token: n.token,
|
|
@@ -2797,14 +2820,14 @@ class z {
|
|
|
2797
2820
|
* @throws {AtomsMissingException}
|
|
2798
2821
|
*/
|
|
2799
2822
|
static jsonToObject(e) {
|
|
2800
|
-
const t = Object.assign(new
|
|
2823
|
+
const t = Object.assign(new V({}), JSON.parse(e)), n = Object.keys(new V({}));
|
|
2801
2824
|
if (!Array.isArray(t.atoms))
|
|
2802
|
-
throw new
|
|
2825
|
+
throw new oe();
|
|
2803
2826
|
for (const s in Object.keys(t.atoms)) {
|
|
2804
2827
|
t.atoms[s] = g.jsonToObject(JSON.stringify(t.atoms[s]));
|
|
2805
2828
|
for (const r of ["position", "walletAddress", "isotope"])
|
|
2806
2829
|
if (t.atoms[s].isotope.toLowerCase() !== "r" && (typeof t.atoms[s][r] > "u" || t.atoms[s][r] === null))
|
|
2807
|
-
throw new
|
|
2830
|
+
throw new oe("MolecularStructure::jsonToObject() - Required Atom properties are missing!");
|
|
2808
2831
|
}
|
|
2809
2832
|
for (const s in t)
|
|
2810
2833
|
Object.prototype.hasOwnProperty.call(t, s) && !n.includes(s) && delete t[s];
|
|
@@ -2876,7 +2899,7 @@ class z {
|
|
|
2876
2899
|
* @returns {*[]}
|
|
2877
2900
|
*/
|
|
2878
2901
|
getIsotopes(e) {
|
|
2879
|
-
return
|
|
2902
|
+
return V.isotopeFilter(e, this.atoms);
|
|
2880
2903
|
}
|
|
2881
2904
|
/**
|
|
2882
2905
|
* Generates the next atomic index
|
|
@@ -2884,7 +2907,7 @@ class z {
|
|
|
2884
2907
|
* @return {number}
|
|
2885
2908
|
*/
|
|
2886
2909
|
generateIndex() {
|
|
2887
|
-
return
|
|
2910
|
+
return V.generateNextAtomIndex(this.atoms);
|
|
2888
2911
|
}
|
|
2889
2912
|
/**
|
|
2890
2913
|
* Fills a Molecule's properties with the provided object
|
|
@@ -2955,7 +2978,7 @@ class z {
|
|
|
2955
2978
|
fuseToken(e, t) {
|
|
2956
2979
|
const n = e.length;
|
|
2957
2980
|
if (this.sourceWallet.balance - n < 0)
|
|
2958
|
-
throw new
|
|
2981
|
+
throw new ue();
|
|
2959
2982
|
return this.addAtom(g.create({
|
|
2960
2983
|
isotope: "V",
|
|
2961
2984
|
wallet: this.sourceWallet,
|
|
@@ -2988,7 +3011,7 @@ class z {
|
|
|
2988
3011
|
if (e < 0)
|
|
2989
3012
|
throw new $t("Molecule::burnToken() - Amount to burn must be positive!");
|
|
2990
3013
|
if (this.sourceWallet.balance - e < 0)
|
|
2991
|
-
throw new
|
|
3014
|
+
throw new ue();
|
|
2992
3015
|
const n = new S({
|
|
2993
3016
|
bundle: "0000000000000000000000000000000000000000000000000000000000000000",
|
|
2994
3017
|
token: this.sourceWallet.token
|
|
@@ -3057,7 +3080,7 @@ class z {
|
|
|
3057
3080
|
amount: t
|
|
3058
3081
|
}) {
|
|
3059
3082
|
if (this.sourceWallet.balance - t < 0)
|
|
3060
|
-
throw new
|
|
3083
|
+
throw new ue();
|
|
3061
3084
|
return this.addAtom(g.create({
|
|
3062
3085
|
isotope: "V",
|
|
3063
3086
|
wallet: this.sourceWallet,
|
|
@@ -3097,7 +3120,7 @@ class z {
|
|
|
3097
3120
|
}) {
|
|
3098
3121
|
const n = t.reduce((s, r) => s + Number(r), 0);
|
|
3099
3122
|
if (this.sourceWallet.balance - n < 0)
|
|
3100
|
-
throw new
|
|
3123
|
+
throw new ue();
|
|
3101
3124
|
return this.addAtom(g.create({
|
|
3102
3125
|
isotope: "V",
|
|
3103
3126
|
wallet: this.sourceWallet,
|
|
@@ -3128,7 +3151,7 @@ class z {
|
|
|
3128
3151
|
tradeRates: t
|
|
3129
3152
|
}) {
|
|
3130
3153
|
if (this.sourceWallet.balance - e < 0)
|
|
3131
|
-
throw new
|
|
3154
|
+
throw new ue();
|
|
3132
3155
|
const n = S.create({
|
|
3133
3156
|
secret: this.secret,
|
|
3134
3157
|
bundle: this.bundle,
|
|
@@ -3167,7 +3190,7 @@ class z {
|
|
|
3167
3190
|
for (const r of Object.values(e || {}))
|
|
3168
3191
|
n += r;
|
|
3169
3192
|
if (this.sourceWallet.balance - n < 0)
|
|
3170
|
-
throw new
|
|
3193
|
+
throw new ue();
|
|
3171
3194
|
const s = new P();
|
|
3172
3195
|
t && s.setSigningWallet(t), this.addAtom(g.create({
|
|
3173
3196
|
isotope: "B",
|
|
@@ -3182,7 +3205,7 @@ class z {
|
|
|
3182
3205
|
isotope: "V",
|
|
3183
3206
|
token: this.sourceWallet.token,
|
|
3184
3207
|
value: i,
|
|
3185
|
-
batchId: this.sourceWallet.batchId ?
|
|
3208
|
+
batchId: this.sourceWallet.batchId ? Be({}) : null,
|
|
3186
3209
|
metaType: "walletBundle",
|
|
3187
3210
|
metaId: r
|
|
3188
3211
|
}));
|
|
@@ -3234,7 +3257,7 @@ class z {
|
|
|
3234
3257
|
}) {
|
|
3235
3258
|
const r = [];
|
|
3236
3259
|
for (const a of n)
|
|
3237
|
-
r.push(a instanceof
|
|
3260
|
+
r.push(a instanceof $e ? a : $e.toObject(a));
|
|
3238
3261
|
const i = new P({
|
|
3239
3262
|
rule: JSON.stringify(r)
|
|
3240
3263
|
});
|
|
@@ -3290,7 +3313,7 @@ class z {
|
|
|
3290
3313
|
}) {
|
|
3291
3314
|
const s = {
|
|
3292
3315
|
code: n,
|
|
3293
|
-
hash:
|
|
3316
|
+
hash: de(t.trim(), "Molecule::initIdentifierCreation")
|
|
3294
3317
|
};
|
|
3295
3318
|
return this.addAtom(g.create({
|
|
3296
3319
|
isotope: "C",
|
|
@@ -3428,8 +3451,8 @@ class z {
|
|
|
3428
3451
|
compressed: n = !0
|
|
3429
3452
|
}) {
|
|
3430
3453
|
if (this.atoms.length === 0 || this.atoms.filter((d) => !(d instanceof g)).length !== 0)
|
|
3431
|
-
throw new
|
|
3432
|
-
!t && !this.bundle && (this.bundle = e ||
|
|
3454
|
+
throw new oe();
|
|
3455
|
+
!t && !this.bundle && (this.bundle = e || de(this.secret, "Molecule::sign")), this.molecularHash = g.hashAtoms({
|
|
3433
3456
|
atoms: this.atoms
|
|
3434
3457
|
});
|
|
3435
3458
|
const s = this.atoms[0];
|
|
@@ -3441,16 +3464,16 @@ class z {
|
|
|
3441
3464
|
secret: this.secret,
|
|
3442
3465
|
token: s.token,
|
|
3443
3466
|
position: s.position
|
|
3444
|
-
}), c =
|
|
3467
|
+
}), c = Ue(a, 128), u = this.normalizedHash();
|
|
3445
3468
|
let l = "";
|
|
3446
3469
|
for (const d in c) {
|
|
3447
3470
|
let b = c[d];
|
|
3448
3471
|
for (let A = 0, O = 8 - u[d]; A < O; A++)
|
|
3449
|
-
b = new
|
|
3472
|
+
b = new F("SHAKE256", "TEXT").update(b).getHash("HEX", { outputLen: 512 });
|
|
3450
3473
|
l += b;
|
|
3451
3474
|
}
|
|
3452
|
-
n && (l =
|
|
3453
|
-
const h =
|
|
3475
|
+
n && (l = dn(l));
|
|
3476
|
+
const h = Ue(l, Math.ceil(l.length / this.atoms.length));
|
|
3454
3477
|
let p = null;
|
|
3455
3478
|
for (let d = 0, b = h.length; d < b; d++)
|
|
3456
3479
|
this.atoms[d].otsFragment = h[d], p = this.atoms[d].position;
|
|
@@ -3558,7 +3581,7 @@ class z {
|
|
|
3558
3581
|
const r = typeof e == "string" ? JSON.parse(e) : e;
|
|
3559
3582
|
if (s && (!r.molecularHash || !Array.isArray(r.atoms)))
|
|
3560
3583
|
throw new Error("Invalid molecule data: missing molecularHash or atoms array");
|
|
3561
|
-
const i = new
|
|
3584
|
+
const i = new V({
|
|
3562
3585
|
secret: null,
|
|
3563
3586
|
bundle: r.bundle || null,
|
|
3564
3587
|
cellSlug: r.cellSlug || null,
|
|
@@ -3595,7 +3618,7 @@ class z {
|
|
|
3595
3618
|
* @param senderWallet
|
|
3596
3619
|
*/
|
|
3597
3620
|
check(e = null) {
|
|
3598
|
-
return new
|
|
3621
|
+
return new Ae(this).verify(e);
|
|
3599
3622
|
}
|
|
3600
3623
|
/**
|
|
3601
3624
|
* Convert Hm to numeric notation via EnumerateMolecule(Hm)
|
|
@@ -3603,10 +3626,10 @@ class z {
|
|
|
3603
3626
|
* @returns {Array}
|
|
3604
3627
|
*/
|
|
3605
3628
|
normalizedHash() {
|
|
3606
|
-
return
|
|
3629
|
+
return V.normalize(V.enumerate(this.molecularHash));
|
|
3607
3630
|
}
|
|
3608
3631
|
}
|
|
3609
|
-
class
|
|
3632
|
+
class ve {
|
|
3610
3633
|
/**
|
|
3611
3634
|
*
|
|
3612
3635
|
* @param {string} token
|
|
@@ -3629,7 +3652,7 @@ class xe {
|
|
|
3629
3652
|
* @returns {AuthToken}
|
|
3630
3653
|
*/
|
|
3631
3654
|
static create(e, t) {
|
|
3632
|
-
const n = new
|
|
3655
|
+
const n = new ve(e);
|
|
3633
3656
|
return n.setWallet(t), n;
|
|
3634
3657
|
}
|
|
3635
3658
|
/**
|
|
@@ -3645,7 +3668,7 @@ class xe {
|
|
|
3645
3668
|
position: e.wallet.position,
|
|
3646
3669
|
characters: e.wallet.characters
|
|
3647
3670
|
});
|
|
3648
|
-
return
|
|
3671
|
+
return ve.create({
|
|
3649
3672
|
token: e.token,
|
|
3650
3673
|
expiresAt: e.expiresAt,
|
|
3651
3674
|
pubkey: e.pubkey,
|
|
@@ -3722,14 +3745,14 @@ class xe {
|
|
|
3722
3745
|
};
|
|
3723
3746
|
}
|
|
3724
3747
|
}
|
|
3725
|
-
const
|
|
3726
|
-
class
|
|
3748
|
+
const Ye = 10 ** 18;
|
|
3749
|
+
class le {
|
|
3727
3750
|
/**
|
|
3728
3751
|
* @param {number} value
|
|
3729
3752
|
* @return {number}
|
|
3730
3753
|
*/
|
|
3731
3754
|
static val(e) {
|
|
3732
|
-
return Math.abs(e *
|
|
3755
|
+
return Math.abs(e * Ye) < 1 ? 0 : e;
|
|
3733
3756
|
}
|
|
3734
3757
|
/**
|
|
3735
3758
|
* @param {number} value1
|
|
@@ -3738,7 +3761,7 @@ class ce {
|
|
|
3738
3761
|
* @return {number}
|
|
3739
3762
|
*/
|
|
3740
3763
|
static cmp(e, t, n = !1) {
|
|
3741
|
-
const s =
|
|
3764
|
+
const s = le.val(e) * Ye, r = le.val(t) * Ye;
|
|
3742
3765
|
return Math.abs(s - r) < 1 ? 0 : s > r ? 1 : -1;
|
|
3743
3766
|
}
|
|
3744
3767
|
/**
|
|
@@ -3747,10 +3770,10 @@ class ce {
|
|
|
3747
3770
|
* @return {boolean}
|
|
3748
3771
|
*/
|
|
3749
3772
|
static equal(e, t) {
|
|
3750
|
-
return
|
|
3773
|
+
return le.cmp(e, t) === 0;
|
|
3751
3774
|
}
|
|
3752
3775
|
}
|
|
3753
|
-
class
|
|
3776
|
+
class ee extends x {
|
|
3754
3777
|
/**
|
|
3755
3778
|
* Class constructor
|
|
3756
3779
|
*
|
|
@@ -3762,7 +3785,7 @@ class te extends x {
|
|
|
3762
3785
|
super(e, t, n), this.name = "InvalidResponseException";
|
|
3763
3786
|
}
|
|
3764
3787
|
}
|
|
3765
|
-
class
|
|
3788
|
+
class Pe extends x {
|
|
3766
3789
|
/**
|
|
3767
3790
|
* Class constructor
|
|
3768
3791
|
*
|
|
@@ -3788,14 +3811,14 @@ let C = class {
|
|
|
3788
3811
|
dataKey: n = null
|
|
3789
3812
|
}) {
|
|
3790
3813
|
if (this.dataKey = n, this.errorKey = "exception", this.$__payload = null, this.$__query = e, this.$__originResponse = t, this.$__response = t, typeof this.$__response > "u" || this.$__response === null)
|
|
3791
|
-
throw new
|
|
3814
|
+
throw new ee();
|
|
3792
3815
|
if (M.has(this.$__response, this.errorKey)) {
|
|
3793
3816
|
const s = M.get(this.$__response, this.errorKey);
|
|
3794
|
-
throw String(s).includes("Unauthenticated") ? new
|
|
3817
|
+
throw String(s).includes("Unauthenticated") ? new Pe() : new ee();
|
|
3795
3818
|
}
|
|
3796
3819
|
if (this.$__response.errors && Array.isArray(this.$__response.errors) && this.$__response.errors.length > 0) {
|
|
3797
3820
|
const s = this.$__response.errors[0].message || "Unknown GraphQL error";
|
|
3798
|
-
throw s.includes("Unauthenticated") ? new
|
|
3821
|
+
throw s.includes("Unauthenticated") ? new Pe() : new ee(`GraphQL Error: ${s}`);
|
|
3799
3822
|
}
|
|
3800
3823
|
this.init();
|
|
3801
3824
|
}
|
|
@@ -3811,9 +3834,9 @@ let C = class {
|
|
|
3811
3834
|
if (!this.dataKey)
|
|
3812
3835
|
return this.response();
|
|
3813
3836
|
if (!this.response().data)
|
|
3814
|
-
throw new
|
|
3837
|
+
throw new ee("Response has no data field");
|
|
3815
3838
|
if (!M.has(this.response(), this.dataKey))
|
|
3816
|
-
throw new
|
|
3839
|
+
throw new ee(`Missing expected field: ${this.dataKey}`);
|
|
3817
3840
|
return M.get(this.response(), this.dataKey);
|
|
3818
3841
|
}
|
|
3819
3842
|
/**
|
|
@@ -3845,8 +3868,7 @@ let C = class {
|
|
|
3845
3868
|
* @return {boolean}
|
|
3846
3869
|
*/
|
|
3847
3870
|
success() {
|
|
3848
|
-
|
|
3849
|
-
return !((t = (e = this.$__response) == null ? void 0 : e.errors) != null && t.length);
|
|
3871
|
+
return !this.$__response?.errors?.length;
|
|
3850
3872
|
}
|
|
3851
3873
|
/**
|
|
3852
3874
|
* Get error message if any
|
|
@@ -3854,8 +3876,7 @@ let C = class {
|
|
|
3854
3876
|
* @return {string|null}
|
|
3855
3877
|
*/
|
|
3856
3878
|
error() {
|
|
3857
|
-
|
|
3858
|
-
return (t = (e = this.$__response) == null ? void 0 : e.errors) != null && t.length ? this.$__response.errors[0].message || "Unknown error" : null;
|
|
3879
|
+
return this.$__response?.errors?.length ? this.$__response.errors[0].message || "Unknown error" : null;
|
|
3859
3880
|
}
|
|
3860
3881
|
/**
|
|
3861
3882
|
* Enhanced interface methods for standardized response handling
|
|
@@ -3872,7 +3893,6 @@ let C = class {
|
|
|
3872
3893
|
* @return {object}
|
|
3873
3894
|
*/
|
|
3874
3895
|
toValidationResult() {
|
|
3875
|
-
var e;
|
|
3876
3896
|
return this.success() && this.payload() !== null ? {
|
|
3877
3897
|
success: !0,
|
|
3878
3898
|
data: this.payload(),
|
|
@@ -3882,7 +3902,7 @@ let C = class {
|
|
|
3882
3902
|
error: {
|
|
3883
3903
|
message: this.reason() || "Unknown error",
|
|
3884
3904
|
context: this.constructor.name,
|
|
3885
|
-
details:
|
|
3905
|
+
details: this.$__response?.errors || []
|
|
3886
3906
|
}
|
|
3887
3907
|
};
|
|
3888
3908
|
}
|
|
@@ -3920,15 +3940,14 @@ let C = class {
|
|
|
3920
3940
|
* @return {Response}
|
|
3921
3941
|
*/
|
|
3922
3942
|
debug(e = null) {
|
|
3923
|
-
var n, s, r;
|
|
3924
3943
|
const t = e ? `[${e}]` : `[${this.constructor.name}]`;
|
|
3925
3944
|
return this.success() ? console.debug(`${t} Success:`, {
|
|
3926
3945
|
payload: this.payload(),
|
|
3927
|
-
query:
|
|
3946
|
+
query: this.$__query?.constructor?.name,
|
|
3928
3947
|
dataKey: this.dataKey
|
|
3929
3948
|
}) : console.debug(`${t} Failure:`, {
|
|
3930
3949
|
error: this.reason(),
|
|
3931
|
-
errors:
|
|
3950
|
+
errors: this.$__response?.errors,
|
|
3932
3951
|
rawData: this.$__response
|
|
3933
3952
|
}), this;
|
|
3934
3953
|
}
|
|
@@ -4002,9 +4021,9 @@ class N {
|
|
|
4002
4021
|
*/
|
|
4003
4022
|
createQuery({ variables: e = null }) {
|
|
4004
4023
|
if (this.$__variables = this.compiledVariables(e), !this.uri())
|
|
4005
|
-
throw new
|
|
4024
|
+
throw new Y("Query::createQuery() - Node URI was not initialized for this client instance!");
|
|
4006
4025
|
if (this.$__query === null)
|
|
4007
|
-
throw new
|
|
4026
|
+
throw new Y("Query::createQuery() - GraphQL subscription was not initialized!");
|
|
4008
4027
|
return {
|
|
4009
4028
|
query: this.$__query,
|
|
4010
4029
|
variables: this.variables()
|
|
@@ -4067,7 +4086,7 @@ class N {
|
|
|
4067
4086
|
return {};
|
|
4068
4087
|
}
|
|
4069
4088
|
}
|
|
4070
|
-
class
|
|
4089
|
+
class as extends C {
|
|
4071
4090
|
/**
|
|
4072
4091
|
* Class constructor
|
|
4073
4092
|
*
|
|
@@ -4098,7 +4117,7 @@ class hs extends C {
|
|
|
4098
4117
|
}), e.address = t.address, e.position = t.position, e.bundle = t.bundleHash, e.batchId = t.batchId, e.characters = t.characters, e.pubkey = t.pubkey, e.balance = String(t.amount != null ? t.amount : 0)), e;
|
|
4099
4118
|
}
|
|
4100
4119
|
}
|
|
4101
|
-
class
|
|
4120
|
+
class ls extends N {
|
|
4102
4121
|
/**
|
|
4103
4122
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4104
4123
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4132,13 +4151,13 @@ class ds extends N {
|
|
|
4132
4151
|
* @return {ResponseContinuId}
|
|
4133
4152
|
*/
|
|
4134
4153
|
createResponse(e) {
|
|
4135
|
-
return new
|
|
4154
|
+
return new as({
|
|
4136
4155
|
query: this,
|
|
4137
4156
|
json: e
|
|
4138
4157
|
});
|
|
4139
4158
|
}
|
|
4140
4159
|
}
|
|
4141
|
-
class
|
|
4160
|
+
class cs extends C {
|
|
4142
4161
|
/**
|
|
4143
4162
|
* Class constructor
|
|
4144
4163
|
*
|
|
@@ -4166,11 +4185,11 @@ class ps extends C {
|
|
|
4166
4185
|
return null;
|
|
4167
4186
|
const t = {};
|
|
4168
4187
|
return e.forEach((n) => {
|
|
4169
|
-
n.metas =
|
|
4188
|
+
n.metas = he.aggregateMeta(n.metas), t[n.bundleHash] = n;
|
|
4170
4189
|
}), t;
|
|
4171
4190
|
}
|
|
4172
4191
|
}
|
|
4173
|
-
class
|
|
4192
|
+
class us extends N {
|
|
4174
4193
|
/**
|
|
4175
4194
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4176
4195
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4197,7 +4216,7 @@ class fs extends N {
|
|
|
4197
4216
|
* @return {ResponseWalletBundle}
|
|
4198
4217
|
*/
|
|
4199
4218
|
createResponse(e) {
|
|
4200
|
-
return new
|
|
4219
|
+
return new cs({
|
|
4201
4220
|
query: this,
|
|
4202
4221
|
json: e
|
|
4203
4222
|
});
|
|
@@ -4245,7 +4264,7 @@ class Le extends C {
|
|
|
4245
4264
|
characters: e.characters
|
|
4246
4265
|
}), n.address = e.address, n.bundle = e.bundleHash), e.token && (n.tokenName = e.token.name, n.tokenAmount = e.token.amount, n.tokenSupply = e.token.supply, n.tokenFungibility = e.token.fungibility), e.tokenUnits.length)
|
|
4247
4266
|
for (const s of e.tokenUnits)
|
|
4248
|
-
n.tokenUnits.push(
|
|
4267
|
+
n.tokenUnits.push(pe.createFromGraphQL(s));
|
|
4249
4268
|
if (e.tradeRates.length)
|
|
4250
4269
|
for (const s of e.tradeRates)
|
|
4251
4270
|
n.tradeRates[s.tokenSlug] = s.amount;
|
|
@@ -4278,7 +4297,7 @@ class Le extends C {
|
|
|
4278
4297
|
return this.getWallets();
|
|
4279
4298
|
}
|
|
4280
4299
|
}
|
|
4281
|
-
class
|
|
4300
|
+
class hs extends N {
|
|
4282
4301
|
/**
|
|
4283
4302
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4284
4303
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4326,7 +4345,7 @@ class ms extends N {
|
|
|
4326
4345
|
});
|
|
4327
4346
|
}
|
|
4328
4347
|
}
|
|
4329
|
-
class
|
|
4348
|
+
class ds extends C {
|
|
4330
4349
|
/**
|
|
4331
4350
|
* Class constructor
|
|
4332
4351
|
*
|
|
@@ -4355,7 +4374,7 @@ class ys extends C {
|
|
|
4355
4374
|
});
|
|
4356
4375
|
}
|
|
4357
4376
|
}
|
|
4358
|
-
class
|
|
4377
|
+
class ps extends N {
|
|
4359
4378
|
/**
|
|
4360
4379
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4361
4380
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4390,13 +4409,13 @@ class gs extends N {
|
|
|
4390
4409
|
* @return {ResponseBalance}
|
|
4391
4410
|
*/
|
|
4392
4411
|
createResponse(e) {
|
|
4393
|
-
return new
|
|
4412
|
+
return new ds({
|
|
4394
4413
|
query: this,
|
|
4395
4414
|
json: e
|
|
4396
4415
|
});
|
|
4397
4416
|
}
|
|
4398
4417
|
}
|
|
4399
|
-
class
|
|
4418
|
+
class fs extends C {
|
|
4400
4419
|
/**
|
|
4401
4420
|
* Class constructor
|
|
4402
4421
|
*
|
|
@@ -4499,13 +4518,13 @@ class At extends N {
|
|
|
4499
4518
|
* @return {ResponseMetaType}
|
|
4500
4519
|
*/
|
|
4501
4520
|
createResponse(e) {
|
|
4502
|
-
return new
|
|
4521
|
+
return new fs({
|
|
4503
4522
|
query: this,
|
|
4504
4523
|
json: e
|
|
4505
4524
|
});
|
|
4506
4525
|
}
|
|
4507
4526
|
}
|
|
4508
|
-
class
|
|
4527
|
+
class xe extends N {
|
|
4509
4528
|
/**
|
|
4510
4529
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4511
4530
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4513,9 +4532,9 @@ class Ie extends N {
|
|
|
4513
4532
|
constructor(e, t) {
|
|
4514
4533
|
super(e, t), this.$__query = E`query( $batchId: String ) {
|
|
4515
4534
|
Batch( batchId: $batchId ) {
|
|
4516
|
-
${
|
|
4535
|
+
${xe.getFields()},
|
|
4517
4536
|
children {
|
|
4518
|
-
${
|
|
4537
|
+
${xe.getFields()}
|
|
4519
4538
|
}
|
|
4520
4539
|
}
|
|
4521
4540
|
}`;
|
|
@@ -4586,7 +4605,7 @@ class Ie extends N {
|
|
|
4586
4605
|
return t.dataKey = "data.Batch", t;
|
|
4587
4606
|
}
|
|
4588
4607
|
}
|
|
4589
|
-
class
|
|
4608
|
+
class ms extends N {
|
|
4590
4609
|
/**
|
|
4591
4610
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4592
4611
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4594,7 +4613,7 @@ class ws extends N {
|
|
|
4594
4613
|
constructor(e, t) {
|
|
4595
4614
|
super(e, t), this.$__query = E`query( $batchId: String ) {
|
|
4596
4615
|
BatchHistory( batchId: $batchId ) {
|
|
4597
|
-
${
|
|
4616
|
+
${xe.getFields()}
|
|
4598
4617
|
}
|
|
4599
4618
|
}`;
|
|
4600
4619
|
}
|
|
@@ -4612,7 +4631,7 @@ class ws extends N {
|
|
|
4612
4631
|
return t.dataKey = "data.BatchHistory", t;
|
|
4613
4632
|
}
|
|
4614
4633
|
}
|
|
4615
|
-
class
|
|
4634
|
+
class D extends C {
|
|
4616
4635
|
/**
|
|
4617
4636
|
* Class constructor
|
|
4618
4637
|
*
|
|
@@ -4655,7 +4674,7 @@ class V extends C {
|
|
|
4655
4674
|
const e = this.data();
|
|
4656
4675
|
if (!e)
|
|
4657
4676
|
return null;
|
|
4658
|
-
const t = new
|
|
4677
|
+
const t = new V({});
|
|
4659
4678
|
return t.molecularHash = M.get(e, "molecularHash"), t.status = M.get(e, "status"), t.createdAt = M.get(e, "createdAt"), t;
|
|
4660
4679
|
}
|
|
4661
4680
|
/**
|
|
@@ -4691,7 +4710,7 @@ class V extends C {
|
|
|
4691
4710
|
return this.$__payload;
|
|
4692
4711
|
}
|
|
4693
4712
|
}
|
|
4694
|
-
class
|
|
4713
|
+
class Fe extends N {
|
|
4695
4714
|
/**
|
|
4696
4715
|
* Creates a new Request for the given parameters
|
|
4697
4716
|
*
|
|
@@ -4735,7 +4754,7 @@ class Qe extends N {
|
|
|
4735
4754
|
return {};
|
|
4736
4755
|
}
|
|
4737
4756
|
}
|
|
4738
|
-
class W extends
|
|
4757
|
+
class W extends Fe {
|
|
4739
4758
|
/**
|
|
4740
4759
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4741
4760
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4773,7 +4792,7 @@ class W extends Qe {
|
|
|
4773
4792
|
* @return {ResponseProposeMolecule}
|
|
4774
4793
|
*/
|
|
4775
4794
|
createResponse(e) {
|
|
4776
|
-
return new
|
|
4795
|
+
return new D({
|
|
4777
4796
|
query: this,
|
|
4778
4797
|
json: e
|
|
4779
4798
|
});
|
|
@@ -4806,7 +4825,7 @@ class W extends Qe {
|
|
|
4806
4825
|
return this.$__molecule;
|
|
4807
4826
|
}
|
|
4808
4827
|
}
|
|
4809
|
-
class
|
|
4828
|
+
class ys extends D {
|
|
4810
4829
|
/**
|
|
4811
4830
|
* return the authorization key
|
|
4812
4831
|
*
|
|
@@ -4815,7 +4834,7 @@ class ks extends V {
|
|
|
4815
4834
|
*/
|
|
4816
4835
|
payloadKey(e) {
|
|
4817
4836
|
if (!M.has(this.payload(), e))
|
|
4818
|
-
throw new
|
|
4837
|
+
throw new ee(`ResponseRequestAuthorization::payloadKey() - '${e}' key was not found in the payload!`);
|
|
4819
4838
|
return M.get(this.payload(), e);
|
|
4820
4839
|
}
|
|
4821
4840
|
/**
|
|
@@ -4867,7 +4886,7 @@ class ks extends V {
|
|
|
4867
4886
|
return this.payloadKey("key");
|
|
4868
4887
|
}
|
|
4869
4888
|
}
|
|
4870
|
-
class
|
|
4889
|
+
class gs extends W {
|
|
4871
4890
|
/**
|
|
4872
4891
|
*
|
|
4873
4892
|
* @param {object} meta
|
|
@@ -4882,15 +4901,15 @@ class _s extends W {
|
|
|
4882
4901
|
* @return {ResponseRequestAuthorization}
|
|
4883
4902
|
*/
|
|
4884
4903
|
createResponse(e) {
|
|
4885
|
-
return new
|
|
4904
|
+
return new ys({
|
|
4886
4905
|
query: this,
|
|
4887
4906
|
json: e
|
|
4888
4907
|
});
|
|
4889
4908
|
}
|
|
4890
4909
|
}
|
|
4891
|
-
class
|
|
4910
|
+
class bs extends D {
|
|
4892
4911
|
}
|
|
4893
|
-
class
|
|
4912
|
+
class ws extends W {
|
|
4894
4913
|
/**
|
|
4895
4914
|
* @param {Wallet|null} recipientWallet
|
|
4896
4915
|
* @param {number|null} amount
|
|
@@ -4916,15 +4935,15 @@ class $s extends W {
|
|
|
4916
4935
|
* @return {ResponseCreateToken}
|
|
4917
4936
|
*/
|
|
4918
4937
|
createResponse(e) {
|
|
4919
|
-
return new
|
|
4938
|
+
return new bs({
|
|
4920
4939
|
query: this,
|
|
4921
4940
|
json: e
|
|
4922
4941
|
});
|
|
4923
4942
|
}
|
|
4924
4943
|
}
|
|
4925
|
-
class
|
|
4944
|
+
class ks extends D {
|
|
4926
4945
|
}
|
|
4927
|
-
class
|
|
4946
|
+
class _s extends W {
|
|
4928
4947
|
/**
|
|
4929
4948
|
* Fills a Molecule with the appropriate atoms and prepares for broadcast
|
|
4930
4949
|
*
|
|
@@ -4959,13 +4978,13 @@ class vs extends W {
|
|
|
4959
4978
|
* @return {ResponseRequestTokens}
|
|
4960
4979
|
*/
|
|
4961
4980
|
createResponse(e) {
|
|
4962
|
-
return new
|
|
4981
|
+
return new ks({
|
|
4963
4982
|
query: this,
|
|
4964
4983
|
json: e
|
|
4965
4984
|
});
|
|
4966
4985
|
}
|
|
4967
4986
|
}
|
|
4968
|
-
class
|
|
4987
|
+
class Ss extends D {
|
|
4969
4988
|
/**
|
|
4970
4989
|
* Returns result of the transfer
|
|
4971
4990
|
*
|
|
@@ -5017,15 +5036,15 @@ class vt extends W {
|
|
|
5017
5036
|
* @return {ResponseTransferTokens}
|
|
5018
5037
|
*/
|
|
5019
5038
|
createResponse(e) {
|
|
5020
|
-
return new
|
|
5039
|
+
return new Ss({
|
|
5021
5040
|
query: this,
|
|
5022
5041
|
json: e
|
|
5023
5042
|
});
|
|
5024
5043
|
}
|
|
5025
5044
|
}
|
|
5026
|
-
class
|
|
5045
|
+
class $s extends D {
|
|
5027
5046
|
}
|
|
5028
|
-
class
|
|
5047
|
+
class As extends W {
|
|
5029
5048
|
fillMolecule({
|
|
5030
5049
|
type: e,
|
|
5031
5050
|
contact: t,
|
|
@@ -5044,15 +5063,15 @@ class Ms extends W {
|
|
|
5044
5063
|
* @return {ResponseCreateIdentifier}
|
|
5045
5064
|
*/
|
|
5046
5065
|
createResponse(e) {
|
|
5047
|
-
return new
|
|
5066
|
+
return new $s({
|
|
5048
5067
|
query: this,
|
|
5049
5068
|
json: e
|
|
5050
5069
|
});
|
|
5051
5070
|
}
|
|
5052
5071
|
}
|
|
5053
|
-
class
|
|
5072
|
+
class vs extends D {
|
|
5054
5073
|
}
|
|
5055
|
-
class
|
|
5074
|
+
class xs extends W {
|
|
5056
5075
|
/**
|
|
5057
5076
|
* Class constructor
|
|
5058
5077
|
*
|
|
@@ -5078,15 +5097,15 @@ class Cs extends W {
|
|
|
5078
5097
|
* @return {ResponseClaimShadowWallet}
|
|
5079
5098
|
*/
|
|
5080
5099
|
createResponse(e) {
|
|
5081
|
-
return new
|
|
5100
|
+
return new vs({
|
|
5082
5101
|
query: this,
|
|
5083
5102
|
json: e
|
|
5084
5103
|
});
|
|
5085
5104
|
}
|
|
5086
5105
|
}
|
|
5087
|
-
class
|
|
5106
|
+
class Is extends D {
|
|
5088
5107
|
}
|
|
5089
|
-
class
|
|
5108
|
+
class Ms extends W {
|
|
5090
5109
|
/**
|
|
5091
5110
|
* Fills a molecule with an appropriate metadata atom
|
|
5092
5111
|
*
|
|
@@ -5115,15 +5134,15 @@ class Os extends W {
|
|
|
5115
5134
|
* @return {ResponseCreateMeta}
|
|
5116
5135
|
*/
|
|
5117
5136
|
createResponse(e) {
|
|
5118
|
-
return new
|
|
5137
|
+
return new Is({
|
|
5119
5138
|
query: this,
|
|
5120
5139
|
json: e
|
|
5121
5140
|
});
|
|
5122
5141
|
}
|
|
5123
5142
|
}
|
|
5124
|
-
class
|
|
5143
|
+
class Ts extends D {
|
|
5125
5144
|
}
|
|
5126
|
-
class
|
|
5145
|
+
class Cs extends W {
|
|
5127
5146
|
/**
|
|
5128
5147
|
* Fills a molecule with a P-isotope peering atom
|
|
5129
5148
|
*
|
|
@@ -5143,15 +5162,15 @@ class qs extends W {
|
|
|
5143
5162
|
* @return {ResponsePeering}
|
|
5144
5163
|
*/
|
|
5145
5164
|
createResponse(e) {
|
|
5146
|
-
return new
|
|
5165
|
+
return new Ts({
|
|
5147
5166
|
query: this,
|
|
5148
5167
|
json: e
|
|
5149
5168
|
});
|
|
5150
5169
|
}
|
|
5151
5170
|
}
|
|
5152
|
-
class
|
|
5171
|
+
class Es extends D {
|
|
5153
5172
|
}
|
|
5154
|
-
class
|
|
5173
|
+
class Os extends W {
|
|
5155
5174
|
/**
|
|
5156
5175
|
* Fills a molecule with an A-isotope append request atom
|
|
5157
5176
|
*
|
|
@@ -5180,13 +5199,13 @@ class Us extends W {
|
|
|
5180
5199
|
* @return {ResponseAppendRequest}
|
|
5181
5200
|
*/
|
|
5182
5201
|
createResponse(e) {
|
|
5183
|
-
return new
|
|
5202
|
+
return new Es({
|
|
5184
5203
|
query: this,
|
|
5185
5204
|
json: e
|
|
5186
5205
|
});
|
|
5187
5206
|
}
|
|
5188
5207
|
}
|
|
5189
|
-
class
|
|
5208
|
+
class Rs extends C {
|
|
5190
5209
|
/**
|
|
5191
5210
|
* Class constructor
|
|
5192
5211
|
*
|
|
@@ -5220,7 +5239,7 @@ class Bs extends C {
|
|
|
5220
5239
|
return M.get(this.data(), "message");
|
|
5221
5240
|
}
|
|
5222
5241
|
}
|
|
5223
|
-
class
|
|
5242
|
+
class qs extends Fe {
|
|
5224
5243
|
/**
|
|
5225
5244
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5226
5245
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -5243,15 +5262,15 @@ class Hs extends Qe {
|
|
|
5243
5262
|
* @return {ResponseLinkIdentifier}
|
|
5244
5263
|
*/
|
|
5245
5264
|
createResponse(e) {
|
|
5246
|
-
return new
|
|
5265
|
+
return new Rs({
|
|
5247
5266
|
query: this,
|
|
5248
5267
|
json: e
|
|
5249
5268
|
});
|
|
5250
5269
|
}
|
|
5251
5270
|
}
|
|
5252
|
-
class
|
|
5271
|
+
class Ws extends D {
|
|
5253
5272
|
}
|
|
5254
|
-
class
|
|
5273
|
+
class Us extends W {
|
|
5255
5274
|
fillMolecule(e) {
|
|
5256
5275
|
this.$__molecule.initWalletCreation(e), this.$__molecule.sign({}), this.$__molecule.check();
|
|
5257
5276
|
}
|
|
@@ -5262,13 +5281,13 @@ class Ks extends W {
|
|
|
5262
5281
|
* @return {ResponseCreateWallet}
|
|
5263
5282
|
*/
|
|
5264
5283
|
createResponse(e) {
|
|
5265
|
-
return new
|
|
5284
|
+
return new Ws({
|
|
5266
5285
|
query: this,
|
|
5267
5286
|
json: e
|
|
5268
5287
|
});
|
|
5269
5288
|
}
|
|
5270
5289
|
}
|
|
5271
|
-
class
|
|
5290
|
+
class Bs extends C {
|
|
5272
5291
|
/**
|
|
5273
5292
|
* Class constructor
|
|
5274
5293
|
*
|
|
@@ -5317,7 +5336,7 @@ class Ns extends C {
|
|
|
5317
5336
|
*/
|
|
5318
5337
|
payloadKey(e) {
|
|
5319
5338
|
if (!M.has(this.payload(), e))
|
|
5320
|
-
throw new
|
|
5339
|
+
throw new ee(`ResponseAuthorizationGuest::payloadKey() - '${e}' key is not found in the payload!`);
|
|
5321
5340
|
return M.get(this.payload(), e);
|
|
5322
5341
|
}
|
|
5323
5342
|
/**
|
|
@@ -5370,7 +5389,7 @@ class Ns extends C {
|
|
|
5370
5389
|
return this.payloadKey("encrypt");
|
|
5371
5390
|
}
|
|
5372
5391
|
}
|
|
5373
|
-
class
|
|
5392
|
+
class Hs extends Fe {
|
|
5374
5393
|
/**
|
|
5375
5394
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5376
5395
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -5391,7 +5410,7 @@ class Fs extends Qe {
|
|
|
5391
5410
|
* @return {ResponseRequestAuthorizationGuest}
|
|
5392
5411
|
*/
|
|
5393
5412
|
createResponse(e) {
|
|
5394
|
-
return new
|
|
5413
|
+
return new Bs({
|
|
5395
5414
|
query: this,
|
|
5396
5415
|
json: e
|
|
5397
5416
|
});
|
|
@@ -5409,7 +5428,7 @@ class xt extends x {
|
|
|
5409
5428
|
super(e, t, n), this.name = "WalletShadowException";
|
|
5410
5429
|
}
|
|
5411
5430
|
}
|
|
5412
|
-
class
|
|
5431
|
+
class Ps extends x {
|
|
5413
5432
|
/**
|
|
5414
5433
|
* Class constructor
|
|
5415
5434
|
*
|
|
@@ -5421,7 +5440,7 @@ class Ls extends x {
|
|
|
5421
5440
|
super(e, t, n), this.name = "StackableUnitDecimalsException";
|
|
5422
5441
|
}
|
|
5423
5442
|
}
|
|
5424
|
-
class
|
|
5443
|
+
class ke extends x {
|
|
5425
5444
|
/**
|
|
5426
5445
|
* Class constructor
|
|
5427
5446
|
*
|
|
@@ -5433,7 +5452,7 @@ class _e extends x {
|
|
|
5433
5452
|
super(e, t, n), this.name = "StackableUnitAmountException";
|
|
5434
5453
|
}
|
|
5435
5454
|
}
|
|
5436
|
-
class
|
|
5455
|
+
class Qe {
|
|
5437
5456
|
/**
|
|
5438
5457
|
*
|
|
5439
5458
|
* @param {UrqlClientWrapper} graphQLClient
|
|
@@ -5451,9 +5470,9 @@ class je {
|
|
|
5451
5470
|
variables: e = null
|
|
5452
5471
|
}) {
|
|
5453
5472
|
if (this.$__variables = this.compiledVariables(e), !this.uri())
|
|
5454
|
-
throw new
|
|
5473
|
+
throw new Y("Subscribe::createSubscribe() - Node URI was not initialized for this client instance!");
|
|
5455
5474
|
if (this.$__subscribe === null)
|
|
5456
|
-
throw new
|
|
5475
|
+
throw new Y("Subscribe::createSubscribe() - GraphQL subscription was not initialized!");
|
|
5457
5476
|
return {
|
|
5458
5477
|
query: this.$__subscribe,
|
|
5459
5478
|
variables: this.variables(),
|
|
@@ -5472,7 +5491,7 @@ class je {
|
|
|
5472
5491
|
closure: t
|
|
5473
5492
|
}) {
|
|
5474
5493
|
if (!t)
|
|
5475
|
-
throw new
|
|
5494
|
+
throw new Y(`${this.constructor.name}::execute() - closure parameter is required!`);
|
|
5476
5495
|
return this.$__request = this.createSubscribe({
|
|
5477
5496
|
variables: e
|
|
5478
5497
|
}), this.client.subscribe(this.$__request, t);
|
|
@@ -5503,7 +5522,7 @@ class je {
|
|
|
5503
5522
|
return this.$__variables;
|
|
5504
5523
|
}
|
|
5505
5524
|
}
|
|
5506
|
-
class
|
|
5525
|
+
class Ks extends Qe {
|
|
5507
5526
|
constructor(e) {
|
|
5508
5527
|
super(e), this.$__subscribe = E`
|
|
5509
5528
|
subscription onCreateMolecule ( $bundle: String! ) {
|
|
@@ -5553,7 +5572,7 @@ class Qs extends je {
|
|
|
5553
5572
|
`;
|
|
5554
5573
|
}
|
|
5555
5574
|
}
|
|
5556
|
-
class
|
|
5575
|
+
class Ns extends Qe {
|
|
5557
5576
|
constructor(e) {
|
|
5558
5577
|
super(e), this.$__subscribe = E`
|
|
5559
5578
|
subscription onWalletStatus ( $bundle: String!, $token: String! ) {
|
|
@@ -5567,7 +5586,7 @@ class js extends je {
|
|
|
5567
5586
|
`;
|
|
5568
5587
|
}
|
|
5569
5588
|
}
|
|
5570
|
-
class
|
|
5589
|
+
class Ls extends Qe {
|
|
5571
5590
|
constructor(e) {
|
|
5572
5591
|
super(e), this.$__subscribe = E`
|
|
5573
5592
|
subscription onActiveWallet ( $bundle: String! ) {
|
|
@@ -5610,7 +5629,7 @@ class Ds extends je {
|
|
|
5610
5629
|
`;
|
|
5611
5630
|
}
|
|
5612
5631
|
}
|
|
5613
|
-
class
|
|
5632
|
+
class Fs extends Qe {
|
|
5614
5633
|
constructor(e) {
|
|
5615
5634
|
super(e), this.$__subscribe = E`
|
|
5616
5635
|
subscription onActiveUser ( $metaType: String!, $metaId: String! ) {
|
|
@@ -5625,7 +5644,7 @@ class Vs extends je {
|
|
|
5625
5644
|
}`;
|
|
5626
5645
|
}
|
|
5627
5646
|
}
|
|
5628
|
-
class
|
|
5647
|
+
class Qs extends C {
|
|
5629
5648
|
/**
|
|
5630
5649
|
* Class constructor
|
|
5631
5650
|
*
|
|
@@ -5643,7 +5662,7 @@ class zs extends C {
|
|
|
5643
5662
|
});
|
|
5644
5663
|
}
|
|
5645
5664
|
}
|
|
5646
|
-
class
|
|
5665
|
+
class js extends Fe {
|
|
5647
5666
|
/**
|
|
5648
5667
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5649
5668
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -5686,13 +5705,13 @@ class Js extends Qe {
|
|
|
5686
5705
|
* @return {ResponseActiveSession}
|
|
5687
5706
|
*/
|
|
5688
5707
|
createResponse(e) {
|
|
5689
|
-
return new
|
|
5708
|
+
return new Qs({
|
|
5690
5709
|
query: this,
|
|
5691
5710
|
json: e
|
|
5692
5711
|
});
|
|
5693
5712
|
}
|
|
5694
5713
|
}
|
|
5695
|
-
class
|
|
5714
|
+
class Ds extends C {
|
|
5696
5715
|
/**
|
|
5697
5716
|
* Class constructor
|
|
5698
5717
|
*
|
|
@@ -5721,7 +5740,7 @@ class Gs extends C {
|
|
|
5721
5740
|
return t;
|
|
5722
5741
|
}
|
|
5723
5742
|
}
|
|
5724
|
-
class
|
|
5743
|
+
class Vs extends N {
|
|
5725
5744
|
/**
|
|
5726
5745
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5727
5746
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -5743,13 +5762,13 @@ class Xs extends N {
|
|
|
5743
5762
|
* @return {ResponseQueryActiveSession}
|
|
5744
5763
|
*/
|
|
5745
5764
|
createResponse(e) {
|
|
5746
|
-
return new
|
|
5765
|
+
return new Ds({
|
|
5747
5766
|
query: this,
|
|
5748
5767
|
json: e
|
|
5749
5768
|
});
|
|
5750
5769
|
}
|
|
5751
5770
|
}
|
|
5752
|
-
class
|
|
5771
|
+
class zs extends N {
|
|
5753
5772
|
/**
|
|
5754
5773
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5755
5774
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -5792,7 +5811,7 @@ class It extends x {
|
|
|
5792
5811
|
super(e, t, n), this.name = "AuthorizationRejectedException";
|
|
5793
5812
|
}
|
|
5794
5813
|
}
|
|
5795
|
-
class
|
|
5814
|
+
class Js extends C {
|
|
5796
5815
|
/**
|
|
5797
5816
|
* Class constructor
|
|
5798
5817
|
*
|
|
@@ -5990,13 +6009,13 @@ class Mt extends N {
|
|
|
5990
6009
|
* @return {ResponseAtom}
|
|
5991
6010
|
*/
|
|
5992
6011
|
createResponse(e) {
|
|
5993
|
-
return new
|
|
6012
|
+
return new Js({
|
|
5994
6013
|
query: this,
|
|
5995
6014
|
json: e
|
|
5996
6015
|
});
|
|
5997
6016
|
}
|
|
5998
6017
|
}
|
|
5999
|
-
class
|
|
6018
|
+
class Gs extends C {
|
|
6000
6019
|
/**
|
|
6001
6020
|
* Class constructor
|
|
6002
6021
|
*
|
|
@@ -6021,7 +6040,7 @@ class er extends C {
|
|
|
6021
6040
|
return e && e.callback ? JSON.parse(e.callback) : null;
|
|
6022
6041
|
}
|
|
6023
6042
|
}
|
|
6024
|
-
class
|
|
6043
|
+
class Xs extends N {
|
|
6025
6044
|
/**
|
|
6026
6045
|
* @param {UrqlClientWrapper} graphQLClient
|
|
6027
6046
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -6047,13 +6066,13 @@ class tr extends N {
|
|
|
6047
6066
|
* @return {ResponsePolicy}
|
|
6048
6067
|
*/
|
|
6049
6068
|
createResponse(e) {
|
|
6050
|
-
return new
|
|
6069
|
+
return new Gs({
|
|
6051
6070
|
query: this,
|
|
6052
6071
|
json: e
|
|
6053
6072
|
});
|
|
6054
6073
|
}
|
|
6055
6074
|
}
|
|
6056
|
-
class
|
|
6075
|
+
class Zs extends C {
|
|
6057
6076
|
/**
|
|
6058
6077
|
* Class constructor
|
|
6059
6078
|
*
|
|
@@ -6168,13 +6187,13 @@ class Tt extends N {
|
|
|
6168
6187
|
* @return {ResponseMetaTypeViaAtom}
|
|
6169
6188
|
*/
|
|
6170
6189
|
createResponse(e) {
|
|
6171
|
-
return new
|
|
6190
|
+
return new Zs({
|
|
6172
6191
|
query: this,
|
|
6173
6192
|
json: e
|
|
6174
6193
|
});
|
|
6175
6194
|
}
|
|
6176
6195
|
}
|
|
6177
|
-
class
|
|
6196
|
+
class it extends C {
|
|
6178
6197
|
/**
|
|
6179
6198
|
* Class constructor
|
|
6180
6199
|
*
|
|
@@ -6243,7 +6262,7 @@ class ot extends C {
|
|
|
6243
6262
|
}, n = e.pop();
|
|
6244
6263
|
return n.instances && (t.instances = n.instances.map((s) => {
|
|
6245
6264
|
let r = s.metas;
|
|
6246
|
-
return (!r || r.length === 0) && (r =
|
|
6265
|
+
return (!r || r.length === 0) && (r = it.extractMetasFromMolecule(
|
|
6247
6266
|
s.molecule,
|
|
6248
6267
|
s.metaType,
|
|
6249
6268
|
s.metaId
|
|
@@ -6262,15 +6281,14 @@ class ot extends C {
|
|
|
6262
6281
|
* @return {{ verified: boolean, molecules: Array<{ molecularHash: string, verified: boolean, error: string|null }> }}
|
|
6263
6282
|
*/
|
|
6264
6283
|
verifyIntegrity() {
|
|
6265
|
-
var s;
|
|
6266
6284
|
const e = [], t = this.data();
|
|
6267
6285
|
if (!t || t.length === 0)
|
|
6268
6286
|
return { verified: !0, molecules: e };
|
|
6269
|
-
const n =
|
|
6270
|
-
for (const
|
|
6271
|
-
|
|
6287
|
+
const n = t[t.length - 1]?.instances || [];
|
|
6288
|
+
for (const s of n)
|
|
6289
|
+
s.molecule && e.push(Ae.verifyFromServerData(s.molecule));
|
|
6272
6290
|
return {
|
|
6273
|
-
verified: e.length === 0 || e.every((
|
|
6291
|
+
verified: e.length === 0 || e.every((s) => s.verified),
|
|
6274
6292
|
molecules: e
|
|
6275
6293
|
};
|
|
6276
6294
|
}
|
|
@@ -6382,13 +6400,13 @@ class Ct extends N {
|
|
|
6382
6400
|
* @return {ResponseMetaTypeViaMolecule}
|
|
6383
6401
|
*/
|
|
6384
6402
|
createResponse(e) {
|
|
6385
|
-
return new
|
|
6403
|
+
return new it({
|
|
6386
6404
|
query: this,
|
|
6387
6405
|
json: e
|
|
6388
6406
|
});
|
|
6389
6407
|
}
|
|
6390
6408
|
}
|
|
6391
|
-
class
|
|
6409
|
+
class Ys extends C {
|
|
6392
6410
|
/**
|
|
6393
6411
|
* Class constructor
|
|
6394
6412
|
*
|
|
@@ -6468,15 +6486,15 @@ class Et extends N {
|
|
|
6468
6486
|
* @return {ResponseEmbeddingStatus}
|
|
6469
6487
|
*/
|
|
6470
6488
|
createResponse(e) {
|
|
6471
|
-
return new
|
|
6489
|
+
return new Ys({
|
|
6472
6490
|
query: this,
|
|
6473
6491
|
json: e
|
|
6474
6492
|
});
|
|
6475
6493
|
}
|
|
6476
6494
|
}
|
|
6477
|
-
class
|
|
6495
|
+
class er extends D {
|
|
6478
6496
|
}
|
|
6479
|
-
class
|
|
6497
|
+
class tr extends W {
|
|
6480
6498
|
/**
|
|
6481
6499
|
*
|
|
6482
6500
|
* @param {string} metaType
|
|
@@ -6504,13 +6522,13 @@ class ir extends W {
|
|
|
6504
6522
|
* @return {ResponseCreateRule}
|
|
6505
6523
|
*/
|
|
6506
6524
|
createResponse(e) {
|
|
6507
|
-
return new
|
|
6525
|
+
return new er({
|
|
6508
6526
|
query: this,
|
|
6509
6527
|
json: e
|
|
6510
6528
|
});
|
|
6511
6529
|
}
|
|
6512
6530
|
}
|
|
6513
|
-
class
|
|
6531
|
+
class nr extends W {
|
|
6514
6532
|
/**
|
|
6515
6533
|
* Fills the Molecule with provided wallet and amount data
|
|
6516
6534
|
*
|
|
@@ -6527,7 +6545,7 @@ class or extends W {
|
|
|
6527
6545
|
}), this.$__molecule.sign({}), this.$__molecule.check(this.$__molecule.sourceWallet);
|
|
6528
6546
|
}
|
|
6529
6547
|
}
|
|
6530
|
-
class
|
|
6548
|
+
class sr extends W {
|
|
6531
6549
|
/**
|
|
6532
6550
|
*
|
|
6533
6551
|
* @param recipients
|
|
@@ -6543,7 +6561,7 @@ class ar extends W {
|
|
|
6543
6561
|
}), this.$__molecule.sign({}), this.$__molecule.check(this.$__molecule.sourceWallet);
|
|
6544
6562
|
}
|
|
6545
6563
|
}
|
|
6546
|
-
function
|
|
6564
|
+
function X(o, e, t, n) {
|
|
6547
6565
|
return new (t || (t = Promise))((function(s, r) {
|
|
6548
6566
|
function i(u) {
|
|
6549
6567
|
try {
|
|
@@ -6568,7 +6586,7 @@ function Z(o, e, t, n) {
|
|
|
6568
6586
|
c((n = n.apply(o, [])).next());
|
|
6569
6587
|
}));
|
|
6570
6588
|
}
|
|
6571
|
-
function
|
|
6589
|
+
function Z(o, e) {
|
|
6572
6590
|
var t, n, s, r, i = { label: 0, sent: function() {
|
|
6573
6591
|
if (1 & s[0]) throw s[1];
|
|
6574
6592
|
return s[1];
|
|
@@ -6627,38 +6645,38 @@ function Y(o, e) {
|
|
|
6627
6645
|
};
|
|
6628
6646
|
}
|
|
6629
6647
|
}
|
|
6630
|
-
var q = { exclude: [], include: [], logging: !0 }, Gt = {},
|
|
6648
|
+
var q = { exclude: [], include: [], logging: !0 }, Gt = {}, rr = { timeout: "true" }, z = function(o, e) {
|
|
6631
6649
|
typeof window < "u" && (Gt[o] = e);
|
|
6632
|
-
},
|
|
6650
|
+
}, ir = function() {
|
|
6633
6651
|
return Object.fromEntries(Object.entries(Gt).filter((function(o) {
|
|
6634
6652
|
var e, t = o[0];
|
|
6635
|
-
return !(!((e = q
|
|
6653
|
+
return !(!((e = q?.exclude) === null || e === void 0) && e.includes(t));
|
|
6636
6654
|
})).filter((function(o) {
|
|
6637
6655
|
var e, t, n, s, r = o[0];
|
|
6638
|
-
return !((e = q
|
|
6656
|
+
return !((e = q?.include) === null || e === void 0) && e.some((function(i) {
|
|
6639
6657
|
return i.includes(".");
|
|
6640
|
-
})) ? (t = q
|
|
6658
|
+
})) ? (t = q?.include) === null || t === void 0 ? void 0 : t.some((function(i) {
|
|
6641
6659
|
return i.startsWith(r);
|
|
6642
|
-
})) : ((n = q
|
|
6660
|
+
})) : ((n = q?.include) === null || n === void 0 ? void 0 : n.length) === 0 || ((s = q?.include) === null || s === void 0 ? void 0 : s.includes(r));
|
|
6643
6661
|
})).map((function(o) {
|
|
6644
6662
|
return [o[0], (0, o[1])()];
|
|
6645
6663
|
})));
|
|
6646
6664
|
};
|
|
6647
|
-
function
|
|
6665
|
+
function Oe(o) {
|
|
6648
6666
|
return o ^= o >>> 16, o = Math.imul(o, 2246822507), o ^= o >>> 13, o = Math.imul(o, 3266489909), (o ^= o >>> 16) >>> 0;
|
|
6649
6667
|
}
|
|
6650
6668
|
var B = new Uint32Array([597399067, 2869860233, 951274213, 2716044179]);
|
|
6651
|
-
function
|
|
6669
|
+
function Q(o, e) {
|
|
6652
6670
|
return o << e | o >>> 32 - e;
|
|
6653
6671
|
}
|
|
6654
|
-
function
|
|
6672
|
+
function ot(o, e) {
|
|
6655
6673
|
var t;
|
|
6656
6674
|
if (e === void 0 && (e = 0), e = e ? 0 | e : 0, typeof o == "string" && (t = o, o = new TextEncoder().encode(t).buffer), !(o instanceof ArrayBuffer)) throw new TypeError("Expected key to be ArrayBuffer or string");
|
|
6657
6675
|
var n = new Uint32Array([e, e, e, e]);
|
|
6658
6676
|
(function(r, i) {
|
|
6659
6677
|
for (var a = r.byteLength / 16 | 0, c = new Uint32Array(r, 0, 4 * a), u = 0; u < a; u++) {
|
|
6660
6678
|
var l = c.subarray(4 * u, 4 * (u + 1));
|
|
6661
|
-
l[0] = Math.imul(l[0], B[0]), l[0] =
|
|
6679
|
+
l[0] = Math.imul(l[0], B[0]), l[0] = Q(l[0], 15), l[0] = Math.imul(l[0], B[1]), i[0] = i[0] ^ l[0], i[0] = Q(i[0], 19), i[0] = i[0] + i[1], i[0] = Math.imul(i[0], 5) + 1444728091, l[1] = Math.imul(l[1], B[1]), l[1] = Q(l[1], 16), l[1] = Math.imul(l[1], B[2]), i[1] = i[1] ^ l[1], i[1] = Q(i[1], 17), i[1] = i[1] + i[2], i[1] = Math.imul(i[1], 5) + 197830471, l[2] = Math.imul(l[2], B[2]), l[2] = Q(l[2], 17), l[2] = Math.imul(l[2], B[3]), i[2] = i[2] ^ l[2], i[2] = Q(i[2], 15), i[2] = i[2] + i[3], i[2] = Math.imul(i[2], 5) + 2530024501, l[3] = Math.imul(l[3], B[3]), l[3] = Q(l[3], 18), l[3] = Math.imul(l[3], B[0]), i[3] = i[3] ^ l[3], i[3] = Q(i[3], 13), i[3] = i[3] + i[0], i[3] = Math.imul(i[3], 5) + 850148119;
|
|
6662
6680
|
}
|
|
6663
6681
|
})(o, n), (function(r, i) {
|
|
6664
6682
|
var a = r.byteLength / 16 | 0, c = r.byteLength % 16, u = new Uint32Array(4), l = new Uint8Array(r, 16 * a, c);
|
|
@@ -6668,7 +6686,7 @@ function at(o, e) {
|
|
|
6668
6686
|
case 14:
|
|
6669
6687
|
u[3] = u[3] ^ l[13] << 8;
|
|
6670
6688
|
case 13:
|
|
6671
|
-
u[3] = u[3] ^ l[12] << 0, u[3] = Math.imul(u[3], B[3]), u[3] =
|
|
6689
|
+
u[3] = u[3] ^ l[12] << 0, u[3] = Math.imul(u[3], B[3]), u[3] = Q(u[3], 18), u[3] = Math.imul(u[3], B[0]), i[3] = i[3] ^ u[3];
|
|
6672
6690
|
case 12:
|
|
6673
6691
|
u[2] = u[2] ^ l[11] << 24;
|
|
6674
6692
|
case 11:
|
|
@@ -6676,7 +6694,7 @@ function at(o, e) {
|
|
|
6676
6694
|
case 10:
|
|
6677
6695
|
u[2] = u[2] ^ l[9] << 8;
|
|
6678
6696
|
case 9:
|
|
6679
|
-
u[2] = u[2] ^ l[8] << 0, u[2] = Math.imul(u[2], B[2]), u[2] =
|
|
6697
|
+
u[2] = u[2] ^ l[8] << 0, u[2] = Math.imul(u[2], B[2]), u[2] = Q(u[2], 17), u[2] = Math.imul(u[2], B[3]), i[2] = i[2] ^ u[2];
|
|
6680
6698
|
case 8:
|
|
6681
6699
|
u[1] = u[1] ^ l[7] << 24;
|
|
6682
6700
|
case 7:
|
|
@@ -6684,7 +6702,7 @@ function at(o, e) {
|
|
|
6684
6702
|
case 6:
|
|
6685
6703
|
u[1] = u[1] ^ l[5] << 8;
|
|
6686
6704
|
case 5:
|
|
6687
|
-
u[1] = u[1] ^ l[4] << 0, u[1] = Math.imul(u[1], B[1]), u[1] =
|
|
6705
|
+
u[1] = u[1] ^ l[4] << 0, u[1] = Math.imul(u[1], B[1]), u[1] = Q(u[1], 16), u[1] = Math.imul(u[1], B[2]), i[1] = i[1] ^ u[1];
|
|
6688
6706
|
case 4:
|
|
6689
6707
|
u[0] = u[0] ^ l[3] << 24;
|
|
6690
6708
|
case 3:
|
|
@@ -6692,39 +6710,39 @@ function at(o, e) {
|
|
|
6692
6710
|
case 2:
|
|
6693
6711
|
u[0] = u[0] ^ l[1] << 8;
|
|
6694
6712
|
case 1:
|
|
6695
|
-
u[0] = u[0] ^ l[0] << 0, u[0] = Math.imul(u[0], B[0]), u[0] =
|
|
6713
|
+
u[0] = u[0] ^ l[0] << 0, u[0] = Math.imul(u[0], B[0]), u[0] = Q(u[0], 15), u[0] = Math.imul(u[0], B[1]), i[0] = i[0] ^ u[0];
|
|
6696
6714
|
}
|
|
6697
6715
|
})(o, n), (function(r, i) {
|
|
6698
|
-
i[0] = i[0] ^ r.byteLength, i[1] = i[1] ^ r.byteLength, i[2] = i[2] ^ r.byteLength, i[3] = i[3] ^ r.byteLength, i[0] = i[0] + i[1] | 0, i[0] = i[0] + i[2] | 0, i[0] = i[0] + i[3] | 0, i[1] = i[1] + i[0] | 0, i[2] = i[2] + i[0] | 0, i[3] = i[3] + i[0] | 0, i[0] =
|
|
6716
|
+
i[0] = i[0] ^ r.byteLength, i[1] = i[1] ^ r.byteLength, i[2] = i[2] ^ r.byteLength, i[3] = i[3] ^ r.byteLength, i[0] = i[0] + i[1] | 0, i[0] = i[0] + i[2] | 0, i[0] = i[0] + i[3] | 0, i[1] = i[1] + i[0] | 0, i[2] = i[2] + i[0] | 0, i[3] = i[3] + i[0] | 0, i[0] = Oe(i[0]), i[1] = Oe(i[1]), i[2] = Oe(i[2]), i[3] = Oe(i[3]), i[0] = i[0] + i[1] | 0, i[0] = i[0] + i[2] | 0, i[0] = i[0] + i[3] | 0, i[1] = i[1] + i[0] | 0, i[2] = i[2] + i[0] | 0, i[3] = i[3] + i[0] | 0;
|
|
6699
6717
|
})(o, n);
|
|
6700
6718
|
var s = new Uint8Array(n.buffer);
|
|
6701
6719
|
return Array.from(s).map((function(r) {
|
|
6702
6720
|
return r.toString(16).padStart(2, "0");
|
|
6703
6721
|
})).join("");
|
|
6704
6722
|
}
|
|
6705
|
-
function
|
|
6723
|
+
function or(o, e) {
|
|
6706
6724
|
return new Promise((function(t) {
|
|
6707
6725
|
setTimeout((function() {
|
|
6708
6726
|
return t(e);
|
|
6709
6727
|
}), o);
|
|
6710
6728
|
}));
|
|
6711
6729
|
}
|
|
6712
|
-
function
|
|
6730
|
+
function ar(o, e, t) {
|
|
6713
6731
|
return Promise.all(o.map((function(n) {
|
|
6714
|
-
return Promise.race([n,
|
|
6732
|
+
return Promise.race([n, or(e, t)]);
|
|
6715
6733
|
})));
|
|
6716
6734
|
}
|
|
6717
|
-
var
|
|
6718
|
-
function
|
|
6719
|
-
return
|
|
6735
|
+
var lr = "0.19.1";
|
|
6736
|
+
function cr() {
|
|
6737
|
+
return lr;
|
|
6720
6738
|
}
|
|
6721
6739
|
function Xt() {
|
|
6722
|
-
return
|
|
6740
|
+
return X(this, void 0, void 0, (function() {
|
|
6723
6741
|
var o, e, t, n, s;
|
|
6724
|
-
return
|
|
6742
|
+
return Z(this, (function(r) {
|
|
6725
6743
|
switch (r.label) {
|
|
6726
6744
|
case 0:
|
|
6727
|
-
return r.trys.push([0, 2, , 3]), o =
|
|
6745
|
+
return r.trys.push([0, 2, , 3]), o = ir(), e = Object.keys(o), [4, ar(Object.values(o), q?.timeout || 1e3, rr)];
|
|
6728
6746
|
case 1:
|
|
6729
6747
|
return t = r.sent(), n = t.filter((function(i) {
|
|
6730
6748
|
return i !== void 0;
|
|
@@ -6760,21 +6778,21 @@ function Zt(o, e, t, n) {
|
|
|
6760
6778
|
}
|
|
6761
6779
|
return s;
|
|
6762
6780
|
}
|
|
6763
|
-
function
|
|
6764
|
-
return
|
|
6781
|
+
function ur(o) {
|
|
6782
|
+
return X(this, void 0, void 0, (function() {
|
|
6765
6783
|
var e, t;
|
|
6766
|
-
return
|
|
6784
|
+
return Z(this, (function(n) {
|
|
6767
6785
|
switch (n.label) {
|
|
6768
6786
|
case 0:
|
|
6769
6787
|
return n.trys.push([0, 2, , 3]), [4, Xt()];
|
|
6770
6788
|
case 1:
|
|
6771
|
-
return e = n.sent(), t =
|
|
6772
|
-
|
|
6789
|
+
return e = n.sent(), t = ot(JSON.stringify(e)), Math.random() < 1e-3 && q.logging && (function(s, r) {
|
|
6790
|
+
X(this, void 0, void 0, (function() {
|
|
6773
6791
|
var i, a;
|
|
6774
|
-
return
|
|
6792
|
+
return Z(this, (function(c) {
|
|
6775
6793
|
switch (c.label) {
|
|
6776
6794
|
case 0:
|
|
6777
|
-
if (i = "https://logging.thumbmarkjs.com/v1/log", a = { thumbmark: s, components: r, version:
|
|
6795
|
+
if (i = "https://logging.thumbmarkjs.com/v1/log", a = { thumbmark: s, components: r, version: cr() }, sessionStorage.getItem("_tmjs_l")) return [3, 4];
|
|
6778
6796
|
sessionStorage.setItem("_tmjs_l", "1"), c.label = 1;
|
|
6779
6797
|
case 1:
|
|
6780
6798
|
return c.trys.push([1, 3, , 4]), [4, fetch(i, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(a) })];
|
|
@@ -6795,19 +6813,19 @@ function fr(o) {
|
|
|
6795
6813
|
}));
|
|
6796
6814
|
}));
|
|
6797
6815
|
}
|
|
6798
|
-
function
|
|
6816
|
+
function hr(o) {
|
|
6799
6817
|
for (var e = 0, t = 0; t < o.length; ++t) e += Math.abs(o[t]);
|
|
6800
6818
|
return e;
|
|
6801
6819
|
}
|
|
6802
6820
|
function Yt(o, e, t) {
|
|
6803
6821
|
for (var n = [], s = 0; s < o[0].data.length; s++) {
|
|
6804
6822
|
for (var r = [], i = 0; i < o.length; i++) r.push(o[i].data[s]);
|
|
6805
|
-
n.push(
|
|
6823
|
+
n.push(dr(r));
|
|
6806
6824
|
}
|
|
6807
6825
|
var a = new Uint8ClampedArray(n);
|
|
6808
6826
|
return new ImageData(a, e, t);
|
|
6809
6827
|
}
|
|
6810
|
-
function
|
|
6828
|
+
function dr(o) {
|
|
6811
6829
|
if (o.length === 0) return 0;
|
|
6812
6830
|
for (var e = {}, t = 0, n = o; t < n.length; t++)
|
|
6813
6831
|
e[r = n[t]] = (e[r] || 0) + 1;
|
|
@@ -6815,7 +6833,7 @@ function yr(o) {
|
|
|
6815
6833
|
for (var r in e) e[r] > e[s] && (s = parseInt(r, 10));
|
|
6816
6834
|
return s;
|
|
6817
6835
|
}
|
|
6818
|
-
function
|
|
6836
|
+
function Ie() {
|
|
6819
6837
|
if (typeof navigator > "u") return { name: "unknown", version: "unknown" };
|
|
6820
6838
|
for (var o = navigator.userAgent, e = { Edg: "Edge", OPR: "Opera" }, t = 0, n = [/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/, /(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/]; t < n.length; t++) {
|
|
6821
6839
|
var s = n[t], r = o.match(s);
|
|
@@ -6823,16 +6841,16 @@ function Me() {
|
|
|
6823
6841
|
}
|
|
6824
6842
|
return { name: "unknown", version: "unknown" };
|
|
6825
6843
|
}
|
|
6826
|
-
|
|
6827
|
-
return
|
|
6828
|
-
return
|
|
6844
|
+
z("audio", (function() {
|
|
6845
|
+
return X(this, void 0, void 0, (function() {
|
|
6846
|
+
return Z(this, (function(o) {
|
|
6829
6847
|
return [2, new Promise((function(e, t) {
|
|
6830
6848
|
try {
|
|
6831
6849
|
var n = new (window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, 5e3, 44100), s = n.createBufferSource(), r = n.createOscillator();
|
|
6832
6850
|
r.frequency.value = 1e3;
|
|
6833
6851
|
var i, a = n.createDynamicsCompressor();
|
|
6834
6852
|
a.threshold.value = -50, a.knee.value = 40, a.ratio.value = 12, a.attack.value = 0, a.release.value = 0.2, r.connect(a), a.connect(n.destination), r.start(), n.oncomplete = function(c) {
|
|
6835
|
-
i = c.renderedBuffer.getChannelData(0), e({ sampleHash:
|
|
6853
|
+
i = c.renderedBuffer.getChannelData(0), e({ sampleHash: hr(i), oscillator: r.type, maxChannels: n.destination.maxChannelCount, channelCountMode: s.channelCountMode });
|
|
6836
6854
|
}, n.startRendering();
|
|
6837
6855
|
} catch (c) {
|
|
6838
6856
|
console.error("Error creating audio fingerprint:", c), t(c);
|
|
@@ -6841,10 +6859,10 @@ J("audio", (function() {
|
|
|
6841
6859
|
}));
|
|
6842
6860
|
}));
|
|
6843
6861
|
}));
|
|
6844
|
-
var
|
|
6845
|
-
|
|
6862
|
+
var pr = Ie().name !== "SamsungBrowser" ? 1 : 3, Ot = 280, Rt = 20;
|
|
6863
|
+
Ie().name != "Firefox" && z("canvas", (function() {
|
|
6846
6864
|
return document.createElement("canvas").getContext("2d"), new Promise((function(o) {
|
|
6847
|
-
var e = Array.from({ length:
|
|
6865
|
+
var e = Array.from({ length: pr }, (function() {
|
|
6848
6866
|
return (function() {
|
|
6849
6867
|
var t = document.createElement("canvas"), n = t.getContext("2d");
|
|
6850
6868
|
if (!n) return new ImageData(1, 1);
|
|
@@ -6857,15 +6875,15 @@ Me().name != "Firefox" && J("canvas", (function() {
|
|
|
6857
6875
|
return i;
|
|
6858
6876
|
})();
|
|
6859
6877
|
}));
|
|
6860
|
-
o({ commonImageDataHash:
|
|
6878
|
+
o({ commonImageDataHash: ot(Yt(e, Ot, Rt).data.toString()).toString() });
|
|
6861
6879
|
}));
|
|
6862
6880
|
}));
|
|
6863
|
-
var
|
|
6881
|
+
var et, fr = ["Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT", "Arimo", "Archivo", "Barlow", "Bebas Neue", "Bitter", "Bookman", "Calibri", "Cabin", "Candara", "Century", "Century Gothic", "Comic Sans MS", "Constantia", "Courier", "Courier New", "Crimson Text", "DM Mono", "DM Sans", "DM Serif Display", "DM Serif Text", "Dosis", "Droid Sans", "Exo", "Fira Code", "Fira Sans", "Franklin Gothic Medium", "Garamond", "Geneva", "Georgia", "Gill Sans", "Helvetica", "Impact", "Inconsolata", "Indie Flower", "Inter", "Josefin Sans", "Karla", "Lato", "Lexend", "Lucida Bright", "Lucida Console", "Lucida Sans Unicode", "Manrope", "Merriweather", "Merriweather Sans", "Montserrat", "Myriad", "Noto Sans", "Nunito", "Nunito Sans", "Open Sans", "Optima", "Orbitron", "Oswald", "Pacifico", "Palatino", "Perpetua", "PT Sans", "PT Serif", "Poppins", "Prompt", "Public Sans", "Quicksand", "Rajdhani", "Recursive", "Roboto", "Roboto Condensed", "Rockwell", "Rubik", "Segoe Print", "Segoe Script", "Segoe UI", "Sora", "Source Sans Pro", "Space Mono", "Tahoma", "Taviraj", "Times", "Times New Roman", "Titillium Web", "Trebuchet MS", "Ubuntu", "Varela Round", "Verdana", "Work Sans"], mr = ["monospace", "sans-serif", "serif"];
|
|
6864
6882
|
function qt(o, e) {
|
|
6865
6883
|
if (!o) throw new Error("Canvas context not supported");
|
|
6866
6884
|
return o.font, o.font = "72px ".concat(e), o.measureText("WwMmLli0Oo").width;
|
|
6867
6885
|
}
|
|
6868
|
-
function
|
|
6886
|
+
function yr() {
|
|
6869
6887
|
var o, e = document.createElement("canvas"), t = (o = e.getContext("webgl")) !== null && o !== void 0 ? o : e.getContext("experimental-webgl");
|
|
6870
6888
|
if (t && "getParameter" in t) try {
|
|
6871
6889
|
var n = (t.getParameter(t.VENDOR) || "").toString(), s = (t.getParameter(t.RENDERER) || "").toString(), r = { vendor: n, renderer: s, version: (t.getParameter(t.VERSION) || "").toString(), shadingLanguageVersion: (t.getParameter(t.SHADING_LANGUAGE_VERSION) || "").toString() };
|
|
@@ -6881,11 +6899,11 @@ function kr() {
|
|
|
6881
6899
|
}
|
|
6882
6900
|
return "undefined";
|
|
6883
6901
|
}
|
|
6884
|
-
function
|
|
6902
|
+
function gr() {
|
|
6885
6903
|
var o = new Float32Array(1), e = new Uint8Array(o.buffer);
|
|
6886
6904
|
return o[0] = 1 / 0, o[0] = o[0] - o[0], e[3];
|
|
6887
6905
|
}
|
|
6888
|
-
function
|
|
6906
|
+
function br(o, e) {
|
|
6889
6907
|
var t = {};
|
|
6890
6908
|
return e.forEach((function(n) {
|
|
6891
6909
|
var s = (function(r) {
|
|
@@ -6907,7 +6925,7 @@ function Sr(o, e) {
|
|
|
6907
6925
|
s && (t[n] = s);
|
|
6908
6926
|
})), t;
|
|
6909
6927
|
}
|
|
6910
|
-
function
|
|
6928
|
+
function wr() {
|
|
6911
6929
|
var o = [], e = { "prefers-contrast": ["high", "more", "low", "less", "forced", "no-preference"], "any-hover": ["hover", "none"], "any-pointer": ["none", "coarse", "fine"], pointer: ["none", "coarse", "fine"], hover: ["hover", "none"], update: ["fast", "slow"], "inverted-colors": ["inverted", "none"], "prefers-reduced-motion": ["reduce", "no-preference"], "prefers-reduced-transparency": ["reduce", "no-preference"], scripting: ["none", "initial-only", "enabled"], "forced-colors": ["active", "none"] };
|
|
6912
6930
|
return Object.keys(e).forEach((function(t) {
|
|
6913
6931
|
e[t].forEach((function(n) {
|
|
@@ -6915,7 +6933,7 @@ function $r() {
|
|
|
6915
6933
|
}));
|
|
6916
6934
|
})), o;
|
|
6917
6935
|
}
|
|
6918
|
-
function
|
|
6936
|
+
function kr() {
|
|
6919
6937
|
if (window.location.protocol === "https:" && typeof window.ApplePaySession == "function") try {
|
|
6920
6938
|
for (var o = window.ApplePaySession.supportsVersion, e = 15; e > 0; e--) if (o(e)) return e;
|
|
6921
6939
|
} catch {
|
|
@@ -6923,15 +6941,15 @@ function Ar() {
|
|
|
6923
6941
|
}
|
|
6924
6942
|
return 0;
|
|
6925
6943
|
}
|
|
6926
|
-
|
|
6944
|
+
Ie().name != "Firefox" && z("fonts", (function() {
|
|
6927
6945
|
var o = this;
|
|
6928
6946
|
return new Promise((function(e, t) {
|
|
6929
6947
|
try {
|
|
6930
6948
|
(function(n) {
|
|
6931
6949
|
var s;
|
|
6932
|
-
|
|
6950
|
+
X(this, void 0, void 0, (function() {
|
|
6933
6951
|
var r, i, a;
|
|
6934
|
-
return
|
|
6952
|
+
return Z(this, (function(c) {
|
|
6935
6953
|
switch (c.label) {
|
|
6936
6954
|
case 0:
|
|
6937
6955
|
return document.body ? [3, 2] : [4, (u = 50, new Promise((function(h) {
|
|
@@ -6950,12 +6968,12 @@ Me().name != "Firefox" && J("fonts", (function() {
|
|
|
6950
6968
|
}));
|
|
6951
6969
|
})((function(n) {
|
|
6952
6970
|
var s = n.iframe;
|
|
6953
|
-
return
|
|
6971
|
+
return X(o, void 0, void 0, (function() {
|
|
6954
6972
|
var r, i, a, c;
|
|
6955
|
-
return
|
|
6956
|
-
return r = s.createElement("canvas"), i = r.getContext("2d"), a =
|
|
6973
|
+
return Z(this, (function(u) {
|
|
6974
|
+
return r = s.createElement("canvas"), i = r.getContext("2d"), a = mr.map((function(l) {
|
|
6957
6975
|
return qt(i, l);
|
|
6958
|
-
})), c = {},
|
|
6976
|
+
})), c = {}, fr.forEach((function(l) {
|
|
6959
6977
|
var h = qt(i, l);
|
|
6960
6978
|
a.includes(h) || (c[l] = h);
|
|
6961
6979
|
})), e(c), [2];
|
|
@@ -6966,27 +6984,27 @@ Me().name != "Firefox" && J("fonts", (function() {
|
|
|
6966
6984
|
t({ error: "unsupported" });
|
|
6967
6985
|
}
|
|
6968
6986
|
}));
|
|
6969
|
-
})),
|
|
6987
|
+
})), z("hardware", (function() {
|
|
6970
6988
|
return new Promise((function(o, e) {
|
|
6971
6989
|
var t = navigator.deviceMemory !== void 0 ? navigator.deviceMemory : 0, n = window.performance && window.performance.memory ? window.performance.memory : 0;
|
|
6972
|
-
o({ videocard:
|
|
6990
|
+
o({ videocard: yr(), architecture: gr(), deviceMemory: t.toString() || "undefined", jsHeapSizeLimit: n.jsHeapSizeLimit || 0 });
|
|
6973
6991
|
}));
|
|
6974
|
-
})),
|
|
6992
|
+
})), z("locales", (function() {
|
|
6975
6993
|
return new Promise((function(o) {
|
|
6976
6994
|
o({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
|
|
6977
6995
|
}));
|
|
6978
|
-
})),
|
|
6979
|
-
return
|
|
6996
|
+
})), z("permissions", (function() {
|
|
6997
|
+
return X(this, void 0, void 0, (function() {
|
|
6980
6998
|
var o;
|
|
6981
|
-
return
|
|
6982
|
-
return
|
|
6999
|
+
return Z(this, (function(e) {
|
|
7000
|
+
return et = q?.permissions_to_check || ["accelerometer", "accessibility", "accessibility-events", "ambient-light-sensor", "background-fetch", "background-sync", "bluetooth", "camera", "clipboard-read", "clipboard-write", "device-info", "display-capture", "gyroscope", "geolocation", "local-fonts", "magnetometer", "microphone", "midi", "nfc", "notifications", "payment-handler", "persistent-storage", "push", "speaker", "storage-access", "top-level-storage-access", "window-management", "query"], o = Array.from({ length: q?.retries || 3 }, (function() {
|
|
6983
7001
|
return (function() {
|
|
6984
|
-
return
|
|
7002
|
+
return X(this, void 0, void 0, (function() {
|
|
6985
7003
|
var t, n, s, r, i;
|
|
6986
|
-
return
|
|
7004
|
+
return Z(this, (function(a) {
|
|
6987
7005
|
switch (a.label) {
|
|
6988
7006
|
case 0:
|
|
6989
|
-
t = {}, n = 0, s =
|
|
7007
|
+
t = {}, n = 0, s = et, a.label = 1;
|
|
6990
7008
|
case 1:
|
|
6991
7009
|
if (!(n < s.length)) return [3, 6];
|
|
6992
7010
|
r = s[n], a.label = 2;
|
|
@@ -7005,11 +7023,11 @@ Me().name != "Firefox" && J("fonts", (function() {
|
|
|
7005
7023
|
}));
|
|
7006
7024
|
})();
|
|
7007
7025
|
})), [2, Promise.all(o).then((function(t) {
|
|
7008
|
-
return
|
|
7026
|
+
return br(t, et);
|
|
7009
7027
|
}))];
|
|
7010
7028
|
}));
|
|
7011
7029
|
}));
|
|
7012
|
-
})),
|
|
7030
|
+
})), z("plugins", (function() {
|
|
7013
7031
|
var o = [];
|
|
7014
7032
|
if (navigator.plugins) for (var e = 0; e < navigator.plugins.length; e++) {
|
|
7015
7033
|
var t = navigator.plugins[e];
|
|
@@ -7018,25 +7036,25 @@ Me().name != "Firefox" && J("fonts", (function() {
|
|
|
7018
7036
|
return new Promise((function(n) {
|
|
7019
7037
|
n({ plugins: o });
|
|
7020
7038
|
}));
|
|
7021
|
-
})),
|
|
7039
|
+
})), z("screen", (function() {
|
|
7022
7040
|
return new Promise((function(o) {
|
|
7023
|
-
o({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches:
|
|
7041
|
+
o({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: wr() });
|
|
7024
7042
|
}));
|
|
7025
|
-
})),
|
|
7043
|
+
})), z("system", (function() {
|
|
7026
7044
|
return new Promise((function(o) {
|
|
7027
|
-
var e =
|
|
7028
|
-
o({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: e.name, version: e.version }, applePayVersion:
|
|
7045
|
+
var e = Ie();
|
|
7046
|
+
o({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: e.name, version: e.version }, applePayVersion: kr() });
|
|
7029
7047
|
}));
|
|
7030
7048
|
}));
|
|
7031
|
-
var K,
|
|
7032
|
-
|
|
7033
|
-
return
|
|
7049
|
+
var K, _r = Ie().name !== "SamsungBrowser" ? 1 : 3, y = null;
|
|
7050
|
+
z("webgl", (function() {
|
|
7051
|
+
return X(this, void 0, void 0, (function() {
|
|
7034
7052
|
var o;
|
|
7035
|
-
return
|
|
7053
|
+
return Z(this, (function(e) {
|
|
7036
7054
|
typeof document < "u" && ((K = document.createElement("canvas")).width = 200, K.height = 100, y = K.getContext("webgl"));
|
|
7037
7055
|
try {
|
|
7038
7056
|
if (!y) throw new Error("WebGL not supported");
|
|
7039
|
-
return o = Array.from({ length:
|
|
7057
|
+
return o = Array.from({ length: _r }, (function() {
|
|
7040
7058
|
return (function() {
|
|
7041
7059
|
try {
|
|
7042
7060
|
if (!y) throw new Error("WebGL not supported");
|
|
@@ -7074,7 +7092,7 @@ J("webgl", (function() {
|
|
|
7074
7092
|
y && (y.bindBuffer(y.ARRAY_BUFFER, null), y.useProgram(null), y.viewport(0, 0, y.drawingBufferWidth, y.drawingBufferHeight), y.clearColor(0, 0, 0, 0));
|
|
7075
7093
|
}
|
|
7076
7094
|
})();
|
|
7077
|
-
})), [2, { commonImageHash:
|
|
7095
|
+
})), [2, { commonImageHash: ot(Yt(o, K.width, K.height).data.toString()).toString() }];
|
|
7078
7096
|
} catch {
|
|
7079
7097
|
return [2, { webgl: "unsupported" }];
|
|
7080
7098
|
}
|
|
@@ -7082,43 +7100,43 @@ J("webgl", (function() {
|
|
|
7082
7100
|
}));
|
|
7083
7101
|
}));
|
|
7084
7102
|
}));
|
|
7085
|
-
var
|
|
7103
|
+
var re = function(o, e, t, n) {
|
|
7086
7104
|
for (var s = (t - e) / n, r = 0, i = 0; i < n; i++)
|
|
7087
7105
|
r += o(e + (i + 0.5) * s);
|
|
7088
7106
|
return r * s;
|
|
7089
7107
|
};
|
|
7090
|
-
|
|
7091
|
-
return
|
|
7092
|
-
return
|
|
7093
|
-
return [2, { acos: Math.acos(0.5), asin:
|
|
7108
|
+
z("math", (function() {
|
|
7109
|
+
return X(void 0, void 0, void 0, (function() {
|
|
7110
|
+
return Z(this, (function(o) {
|
|
7111
|
+
return [2, { acos: Math.acos(0.5), asin: re(Math.asin, -1, 1, 97), atan: re(Math.atan, -1, 1, 97), cos: re(Math.cos, 0, Math.PI, 97), cosh: Math.cosh(9 / 7), e: Math.E, largeCos: Math.cos(1e20), largeSin: Math.sin(1e20), largeTan: Math.tan(1e20), log: Math.log(1e3), pi: Math.PI, sin: re(Math.sin, -Math.PI, Math.PI, 97), sinh: re(Math.sinh, -9 / 7, 7 / 9, 97), sqrt: Math.sqrt(2), tan: re(Math.tan, 0, 2 * Math.PI, 97), tanh: re(Math.tanh, -9 / 7, 7 / 9, 97) }];
|
|
7094
7112
|
}));
|
|
7095
7113
|
}));
|
|
7096
7114
|
}));
|
|
7097
|
-
const
|
|
7098
|
-
function
|
|
7115
|
+
const Sr = "query ( $Hash: String! ) { CipherHash ( Hash: $Hash ) { hash } }";
|
|
7116
|
+
function $r(o) {
|
|
7099
7117
|
const e = (o || "").match(/\b(query|mutation|subscription)\b/i), t = e ? e[1].toLowerCase() : "query", n = (o || "").indexOf("{"), s = n >= 0 ? o.slice(n + 1).match(/[A-Za-z_][A-Za-z0-9_]*/) : null;
|
|
7100
7118
|
return { type: t, name: s ? s[0] : "" };
|
|
7101
7119
|
}
|
|
7102
|
-
class
|
|
7120
|
+
class Ar {
|
|
7103
7121
|
constructor({ serverUri: e, socket: t = null, encrypt: n = !1 }) {
|
|
7104
7122
|
this.$__client = this.createUrqlClient({ serverUri: e, socket: t, encrypt: n }), this.$__authToken = "", this.$__pubkey = null, this.$__wallet = null, this.serverUri = e, this.soketi = t, this.cipherLink = !!n, this.$__subscriptionManager = /* @__PURE__ */ new Map();
|
|
7105
7123
|
}
|
|
7106
7124
|
createUrqlClient({ serverUri: e, socket: t, encrypt: n }) {
|
|
7107
|
-
const s = [
|
|
7125
|
+
const s = [tn, nn];
|
|
7108
7126
|
if (t && t.socketUri) {
|
|
7109
|
-
const r =
|
|
7127
|
+
const r = on({
|
|
7110
7128
|
url: t.socketUri,
|
|
7111
7129
|
connectionParams: () => ({
|
|
7112
7130
|
authToken: this.$__authToken
|
|
7113
7131
|
})
|
|
7114
7132
|
});
|
|
7115
|
-
s.push(
|
|
7133
|
+
s.push(sn({
|
|
7116
7134
|
forwardSubscription: (i) => ({
|
|
7117
7135
|
subscribe: (a) => ({ unsubscribe: r.subscribe(i, a) })
|
|
7118
7136
|
})
|
|
7119
7137
|
}));
|
|
7120
7138
|
}
|
|
7121
|
-
return
|
|
7139
|
+
return rn({
|
|
7122
7140
|
url: e,
|
|
7123
7141
|
exchanges: s,
|
|
7124
7142
|
// PQ-transport Phase E: when encryption is on, route fetch through the CipherHash
|
|
@@ -7147,7 +7165,7 @@ class Mr {
|
|
|
7147
7165
|
} catch {
|
|
7148
7166
|
return !1;
|
|
7149
7167
|
}
|
|
7150
|
-
const { type: n, name: s } =
|
|
7168
|
+
const { type: n, name: s } = $r(t.query);
|
|
7151
7169
|
return !(n === "query" && (s === "__schema" || s === "ContinuId") || n === "mutation" && s === "AccessToken" || n === "mutation" && s === "ProposeMolecule" && (t.variables && t.variables.molecule && t.variables.molecule.atoms && t.variables.molecule.atoms[0] && t.variables.molecule.atoms[0].isotope) === "U");
|
|
7152
7170
|
}
|
|
7153
7171
|
/**
|
|
@@ -7160,7 +7178,7 @@ class Mr {
|
|
|
7160
7178
|
let r = !1, i = t;
|
|
7161
7179
|
if (n && s && t && typeof t.body == "string" && this.shouldEncrypt(t.body)) {
|
|
7162
7180
|
const d = await n.encryptStringML768(t.body, s);
|
|
7163
|
-
i = { ...t, body: JSON.stringify({ query:
|
|
7181
|
+
i = { ...t, body: JSON.stringify({ query: Sr, variables: { Hash: d } }) }, r = !0;
|
|
7164
7182
|
}
|
|
7165
7183
|
const a = await fetch(e, i);
|
|
7166
7184
|
if (!r)
|
|
@@ -7224,12 +7242,12 @@ class Mr {
|
|
|
7224
7242
|
return this.formatResponse(i);
|
|
7225
7243
|
}
|
|
7226
7244
|
subscribe(e, t) {
|
|
7227
|
-
const { query: n, variables: s, operationName: r } = e, i =
|
|
7245
|
+
const { query: n, variables: s, operationName: r } = e, i = an(
|
|
7228
7246
|
this.$__client.subscription(n, s),
|
|
7229
|
-
|
|
7247
|
+
ln((a) => {
|
|
7230
7248
|
t(this.formatResponse(a));
|
|
7231
7249
|
}),
|
|
7232
|
-
|
|
7250
|
+
cn(() => {
|
|
7233
7251
|
})
|
|
7234
7252
|
);
|
|
7235
7253
|
return this.$__subscriptionManager.set(r, i), {
|
|
@@ -7297,7 +7315,7 @@ class Mr {
|
|
|
7297
7315
|
});
|
|
7298
7316
|
}
|
|
7299
7317
|
}
|
|
7300
|
-
class
|
|
7318
|
+
class Or {
|
|
7301
7319
|
/**
|
|
7302
7320
|
* Class constructor
|
|
7303
7321
|
*
|
|
@@ -7351,7 +7369,7 @@ class Ur {
|
|
|
7351
7369
|
const u = this.$__uris[c];
|
|
7352
7370
|
this.$__authTokenObjects[u] = null;
|
|
7353
7371
|
}
|
|
7354
|
-
this.log("info", `KnishIOClient::initialize() - Initializing new Knish.IO client session for SDK version ${r}...`), this.$__client = s || new
|
|
7372
|
+
this.log("info", `KnishIOClient::initialize() - Initializing new Knish.IO client session for SDK version ${r}...`), this.$__client = s || new Ar({
|
|
7355
7373
|
socket: {
|
|
7356
7374
|
socketUri: null,
|
|
7357
7375
|
appKey: "knishio",
|
|
@@ -7390,7 +7408,7 @@ class Ur {
|
|
|
7390
7408
|
*/
|
|
7391
7409
|
subscribe() {
|
|
7392
7410
|
if (!this.client().getSocketUri())
|
|
7393
|
-
throw new
|
|
7411
|
+
throw new Y("KnishIOClient::subscribe() - Socket client not initialized!");
|
|
7394
7412
|
return this.client();
|
|
7395
7413
|
}
|
|
7396
7414
|
/**
|
|
@@ -7514,7 +7532,7 @@ class Ur {
|
|
|
7514
7532
|
* @returns {string}
|
|
7515
7533
|
*/
|
|
7516
7534
|
hashSecret(e, t = null) {
|
|
7517
|
-
return this.log("info", `KnishIOClient::hashSecret(${t ? `source: ${t}` : ""}) - Computing wallet bundle from secret...`),
|
|
7535
|
+
return this.log("info", `KnishIOClient::hashSecret(${t ? `source: ${t}` : ""}) - Computing wallet bundle from secret...`), de(e);
|
|
7518
7536
|
}
|
|
7519
7537
|
/**
|
|
7520
7538
|
* Retrieves the stored secret for this session
|
|
@@ -7523,7 +7541,7 @@ class Ur {
|
|
|
7523
7541
|
*/
|
|
7524
7542
|
getSecret() {
|
|
7525
7543
|
if (!this.hasSecret())
|
|
7526
|
-
throw new
|
|
7544
|
+
throw new Pe("KnishIOClient::getSecret() - Unable to find a stored secret! Have you set a secret?");
|
|
7527
7545
|
return this.$__secret;
|
|
7528
7546
|
}
|
|
7529
7547
|
/**
|
|
@@ -7541,7 +7559,7 @@ class Ur {
|
|
|
7541
7559
|
*/
|
|
7542
7560
|
getBundle() {
|
|
7543
7561
|
if (!this.hasBundle())
|
|
7544
|
-
throw new
|
|
7562
|
+
throw new Pe("KnishIOClient::getBundle() - Unable to find a stored bundle! Have you set a secret?");
|
|
7545
7563
|
return this.$__bundle;
|
|
7546
7564
|
}
|
|
7547
7565
|
/**
|
|
@@ -7550,7 +7568,7 @@ class Ur {
|
|
|
7550
7568
|
* @returns {Promise<string>} A promise that resolves to the device fingerprint as a string.
|
|
7551
7569
|
*/
|
|
7552
7570
|
getFingerprint() {
|
|
7553
|
-
return
|
|
7571
|
+
return ur();
|
|
7554
7572
|
}
|
|
7555
7573
|
getFingerprintData() {
|
|
7556
7574
|
return Xt();
|
|
@@ -7610,7 +7628,7 @@ class Ur {
|
|
|
7610
7628
|
token: "USER",
|
|
7611
7629
|
batchId: n.batchId,
|
|
7612
7630
|
characters: n.characters
|
|
7613
|
-
}), new
|
|
7631
|
+
}), new V({
|
|
7614
7632
|
secret: e,
|
|
7615
7633
|
sourceWallet: n,
|
|
7616
7634
|
remainderWallet: this.getRemainderWallet(),
|
|
@@ -7650,7 +7668,7 @@ class Ur {
|
|
|
7650
7668
|
this.log("info", `KnishIOClient::createMoleculeQuery() - Creating a new ${e.name} query...`);
|
|
7651
7669
|
const n = t || await this.createMolecule({}), s = new e(this.client(), this, n);
|
|
7652
7670
|
if (!(s instanceof W))
|
|
7653
|
-
throw new
|
|
7671
|
+
throw new Y(`${this.constructor.name}::createMoleculeMutation() - This method only accepts MutationProposeMolecule!`);
|
|
7654
7672
|
return this.lastMoleculeQuery = s, s;
|
|
7655
7673
|
}
|
|
7656
7674
|
/**
|
|
@@ -7715,7 +7733,7 @@ class Ur {
|
|
|
7715
7733
|
bundle: t = null,
|
|
7716
7734
|
type: n = "regular"
|
|
7717
7735
|
}) {
|
|
7718
|
-
const s = this.createQuery(
|
|
7736
|
+
const s = this.createQuery(ps);
|
|
7719
7737
|
return this.executeQuery(s, {
|
|
7720
7738
|
bundleHash: t || this.getBundle(),
|
|
7721
7739
|
token: e,
|
|
@@ -7738,10 +7756,10 @@ class Ur {
|
|
|
7738
7756
|
token: e,
|
|
7739
7757
|
type: n
|
|
7740
7758
|
})).payload();
|
|
7741
|
-
if (s === null ||
|
|
7742
|
-
throw new
|
|
7759
|
+
if (s === null || le.cmp(s.balance, t) < 0)
|
|
7760
|
+
throw new J();
|
|
7743
7761
|
if (!s.position || !s.address)
|
|
7744
|
-
throw new
|
|
7762
|
+
throw new J("Source wallet can not be a shadow wallet.");
|
|
7745
7763
|
return s;
|
|
7746
7764
|
}
|
|
7747
7765
|
/**
|
|
@@ -7753,7 +7771,7 @@ class Ur {
|
|
|
7753
7771
|
bundle: e,
|
|
7754
7772
|
closure: t
|
|
7755
7773
|
}) {
|
|
7756
|
-
return await this.createSubscribe(
|
|
7774
|
+
return await this.createSubscribe(Ks).execute({
|
|
7757
7775
|
variables: {
|
|
7758
7776
|
bundle: e || this.getBundle()
|
|
7759
7777
|
},
|
|
@@ -7774,8 +7792,8 @@ class Ur {
|
|
|
7774
7792
|
closure: n
|
|
7775
7793
|
}) {
|
|
7776
7794
|
if (!t)
|
|
7777
|
-
throw new
|
|
7778
|
-
return this.createSubscribe(
|
|
7795
|
+
throw new Y(`${this.constructor.name}::subscribeWalletStatus() - Token parameter is required!`);
|
|
7796
|
+
return this.createSubscribe(Ns).execute({
|
|
7779
7797
|
variables: {
|
|
7780
7798
|
bundle: e || this.getBundle(),
|
|
7781
7799
|
token: t
|
|
@@ -7794,7 +7812,7 @@ class Ur {
|
|
|
7794
7812
|
bundle: e,
|
|
7795
7813
|
closure: t
|
|
7796
7814
|
}) {
|
|
7797
|
-
return this.createSubscribe(
|
|
7815
|
+
return this.createSubscribe(Ls).execute({
|
|
7798
7816
|
variables: {
|
|
7799
7817
|
bundle: e || this.getBundle()
|
|
7800
7818
|
},
|
|
@@ -7814,7 +7832,7 @@ class Ur {
|
|
|
7814
7832
|
metaId: t,
|
|
7815
7833
|
closure: n
|
|
7816
7834
|
}) {
|
|
7817
|
-
return this.createSubscribe(
|
|
7835
|
+
return this.createSubscribe(Fs).execute({
|
|
7818
7836
|
variables: {
|
|
7819
7837
|
metaType: e,
|
|
7820
7838
|
metaId: t
|
|
@@ -7934,18 +7952,17 @@ class Ur {
|
|
|
7934
7952
|
* @return {Promise<boolean>}
|
|
7935
7953
|
*/
|
|
7936
7954
|
async hasQueryField(e) {
|
|
7937
|
-
var s, r, i;
|
|
7938
7955
|
const n = `${this.getUri()}::${e}`;
|
|
7939
7956
|
if (typeof this.$__capabilityCache[n] == "boolean")
|
|
7940
7957
|
return this.$__capabilityCache[n];
|
|
7941
7958
|
try {
|
|
7942
|
-
const
|
|
7959
|
+
const i = ((await this.$__client.query({
|
|
7943
7960
|
query: "{ __schema { queryType { fields { name } } } }",
|
|
7944
7961
|
variables: {}
|
|
7945
|
-
})
|
|
7946
|
-
return this.$__capabilityCache[n] =
|
|
7947
|
-
} catch (
|
|
7948
|
-
return this.log("warn", `KnishIOClient::hasQueryField() - Capability probe for '${e}' failed: ${
|
|
7962
|
+
}))?.data?.__schema?.queryType?.fields || []).some((a) => a.name === e);
|
|
7963
|
+
return this.$__capabilityCache[n] = i, i;
|
|
7964
|
+
} catch (s) {
|
|
7965
|
+
return this.log("warn", `KnishIOClient::hasQueryField() - Capability probe for '${e}' failed: ${s.message}`), this.$__capabilityCache[n] = !1, !1;
|
|
7949
7966
|
}
|
|
7950
7967
|
}
|
|
7951
7968
|
/**
|
|
@@ -7982,7 +7999,7 @@ class Ur {
|
|
|
7982
7999
|
batchId: e
|
|
7983
8000
|
}) {
|
|
7984
8001
|
this.log("info", `KnishIOClient::queryBatch() - Querying cascading meta instances for batchId: ${e}...`);
|
|
7985
|
-
const t = this.createQuery(
|
|
8002
|
+
const t = this.createQuery(xe);
|
|
7986
8003
|
return await this.executeQuery(t, {
|
|
7987
8004
|
batchId: e
|
|
7988
8005
|
});
|
|
@@ -7997,7 +8014,7 @@ class Ur {
|
|
|
7997
8014
|
batchId: e
|
|
7998
8015
|
}) {
|
|
7999
8016
|
this.log("info", `KnishIOClient::queryBatchHistory() - Querying cascading meta instances for batchId: ${e}...`);
|
|
8000
|
-
const t = this.createQuery(
|
|
8017
|
+
const t = this.createQuery(ms);
|
|
8001
8018
|
return await this.executeQuery(t, {
|
|
8002
8019
|
batchId: e
|
|
8003
8020
|
});
|
|
@@ -8070,8 +8087,8 @@ class Ur {
|
|
|
8070
8087
|
}
|
|
8071
8088
|
}) {
|
|
8072
8089
|
this.log("info", "KnishIOClient::queryAtom() - Querying atom instances");
|
|
8073
|
-
const
|
|
8074
|
-
return await this.executeQuery(
|
|
8090
|
+
const ce = this.createQuery(Mt);
|
|
8091
|
+
return await this.executeQuery(ce, Mt.createVariables({
|
|
8075
8092
|
molecularHashes: e,
|
|
8076
8093
|
molecularHash: t,
|
|
8077
8094
|
bundleHashes: n,
|
|
@@ -8114,7 +8131,7 @@ class Ur {
|
|
|
8114
8131
|
secret: this.getSecret(),
|
|
8115
8132
|
token: e
|
|
8116
8133
|
}), n = await this.createMoleculeMutation({
|
|
8117
|
-
mutationClass:
|
|
8134
|
+
mutationClass: Us
|
|
8118
8135
|
});
|
|
8119
8136
|
return n.fillMolecule(t), await this.executeQuery(n);
|
|
8120
8137
|
}
|
|
@@ -8131,7 +8148,7 @@ class Ur {
|
|
|
8131
8148
|
metaType: t,
|
|
8132
8149
|
metaId: n
|
|
8133
8150
|
}) {
|
|
8134
|
-
const s = this.createQuery(
|
|
8151
|
+
const s = this.createQuery(Vs);
|
|
8135
8152
|
return await this.executeQuery(s, {
|
|
8136
8153
|
bundleHash: e,
|
|
8137
8154
|
metaType: t,
|
|
@@ -8164,7 +8181,7 @@ class Ur {
|
|
|
8164
8181
|
timeZone: c,
|
|
8165
8182
|
json: u = {}
|
|
8166
8183
|
}) {
|
|
8167
|
-
const l = this.createQuery(
|
|
8184
|
+
const l = this.createQuery(js);
|
|
8168
8185
|
return await this.executeQuery(l, {
|
|
8169
8186
|
bundleHash: e,
|
|
8170
8187
|
metaType: t,
|
|
@@ -8200,11 +8217,11 @@ class Ur {
|
|
|
8200
8217
|
units: r = []
|
|
8201
8218
|
}) {
|
|
8202
8219
|
const i = M.get(n || {}, "fungibility");
|
|
8203
|
-
if (i === "stackable" && (n.batchId = s ||
|
|
8220
|
+
if (i === "stackable" && (n.batchId = s || Be({})), ["nonfungible", "stackable"].includes(i) && r.length > 0) {
|
|
8204
8221
|
if (M.get(n || {}, "decimals") > 0)
|
|
8205
|
-
throw new
|
|
8222
|
+
throw new Ps();
|
|
8206
8223
|
if (t > 0)
|
|
8207
|
-
throw new
|
|
8224
|
+
throw new ke();
|
|
8208
8225
|
t = r.length, n.splittable = 1, n.decimals = 0, n.tokenUnits = JSON.stringify(r);
|
|
8209
8226
|
}
|
|
8210
8227
|
const a = new S({
|
|
@@ -8213,7 +8230,7 @@ class Ur {
|
|
|
8213
8230
|
token: e,
|
|
8214
8231
|
batchId: s
|
|
8215
8232
|
}), c = await this.createMoleculeMutation({
|
|
8216
|
-
mutationClass:
|
|
8233
|
+
mutationClass: ws
|
|
8217
8234
|
});
|
|
8218
8235
|
return c.fillMolecule({
|
|
8219
8236
|
recipientWallet: a,
|
|
@@ -8238,7 +8255,7 @@ class Ur {
|
|
|
8238
8255
|
}) {
|
|
8239
8256
|
const r = await this.createMoleculeMutation(
|
|
8240
8257
|
{
|
|
8241
|
-
mutationClass:
|
|
8258
|
+
mutationClass: tr,
|
|
8242
8259
|
molecule: await this.createMolecule({
|
|
8243
8260
|
secret: this.getSecret()
|
|
8244
8261
|
})
|
|
@@ -8268,7 +8285,7 @@ class Ur {
|
|
|
8268
8285
|
}) {
|
|
8269
8286
|
const r = await this.createMoleculeMutation(
|
|
8270
8287
|
{
|
|
8271
|
-
mutationClass:
|
|
8288
|
+
mutationClass: Ms,
|
|
8272
8289
|
molecule: await this.createMolecule({
|
|
8273
8290
|
secret: this.getSecret()
|
|
8274
8291
|
})
|
|
@@ -8291,7 +8308,7 @@ class Ur {
|
|
|
8291
8308
|
host: e
|
|
8292
8309
|
}) {
|
|
8293
8310
|
const t = await this.createMoleculeMutation({
|
|
8294
|
-
mutationClass:
|
|
8311
|
+
mutationClass: Cs,
|
|
8295
8312
|
molecule: await this.createMolecule({
|
|
8296
8313
|
secret: this.getSecret()
|
|
8297
8314
|
})
|
|
@@ -8316,7 +8333,7 @@ class Ur {
|
|
|
8316
8333
|
meta: s = {}
|
|
8317
8334
|
}) {
|
|
8318
8335
|
const r = await this.createMoleculeMutation({
|
|
8319
|
-
mutationClass:
|
|
8336
|
+
mutationClass: Os,
|
|
8320
8337
|
molecule: await this.createMolecule({
|
|
8321
8338
|
secret: this.getSecret()
|
|
8322
8339
|
})
|
|
@@ -8342,7 +8359,7 @@ class Ur {
|
|
|
8342
8359
|
code: n
|
|
8343
8360
|
}) {
|
|
8344
8361
|
const s = await this.createMoleculeMutation({
|
|
8345
|
-
mutationClass:
|
|
8362
|
+
mutationClass: As
|
|
8346
8363
|
});
|
|
8347
8364
|
return s.fillMolecule({
|
|
8348
8365
|
type: e,
|
|
@@ -8361,7 +8378,7 @@ class Ur {
|
|
|
8361
8378
|
type: e,
|
|
8362
8379
|
contact: t
|
|
8363
8380
|
}) {
|
|
8364
|
-
const n = this.createQuery(
|
|
8381
|
+
const n = this.createQuery(qs);
|
|
8365
8382
|
return await this.executeQuery(n, {
|
|
8366
8383
|
bundle: this.getBundle(),
|
|
8367
8384
|
type: e,
|
|
@@ -8408,7 +8425,7 @@ class Ur {
|
|
|
8408
8425
|
metaType: e,
|
|
8409
8426
|
metaId: t
|
|
8410
8427
|
}) {
|
|
8411
|
-
const n = this.createQuery(
|
|
8428
|
+
const n = this.createQuery(Xs);
|
|
8412
8429
|
return await this.executeQuery(n, {
|
|
8413
8430
|
metaType: e,
|
|
8414
8431
|
metaId: t
|
|
@@ -8430,7 +8447,7 @@ class Ur {
|
|
|
8430
8447
|
unspent: n = !0
|
|
8431
8448
|
}) {
|
|
8432
8449
|
this.log("info", `KnishIOClient::queryWallets() - Querying wallets${e ? ` for ${e}` : ""}...`);
|
|
8433
|
-
const s = this.createQuery(
|
|
8450
|
+
const s = this.createQuery(hs);
|
|
8434
8451
|
return this.executeQuery(s, {
|
|
8435
8452
|
bundleHash: e || this.getBundle(),
|
|
8436
8453
|
token: t,
|
|
@@ -8452,7 +8469,7 @@ class Ur {
|
|
|
8452
8469
|
raw: n = !1
|
|
8453
8470
|
}) {
|
|
8454
8471
|
this.log("info", `KnishIOClient::queryBundle() - Querying wallet bundle metadata${e ? ` for ${e}` : ""}...`), e || (e = this.getBundle()), typeof e == "string" && (e = [e]);
|
|
8455
|
-
const s = this.createQuery(
|
|
8472
|
+
const s = this.createQuery(us);
|
|
8456
8473
|
return this.executeQuery(s, { bundleHashes: e }).then((r) => n ? r : r.payload());
|
|
8457
8474
|
}
|
|
8458
8475
|
/**
|
|
@@ -8464,7 +8481,7 @@ class Ur {
|
|
|
8464
8481
|
async queryContinuId({
|
|
8465
8482
|
bundle: e
|
|
8466
8483
|
}) {
|
|
8467
|
-
const t = this.createQuery(
|
|
8484
|
+
const t = this.createQuery(ls);
|
|
8468
8485
|
return this.executeQuery(t, {
|
|
8469
8486
|
bundle: e
|
|
8470
8487
|
});
|
|
@@ -8496,14 +8513,14 @@ class Ur {
|
|
|
8496
8513
|
}) {
|
|
8497
8514
|
let a, c;
|
|
8498
8515
|
r = r || {};
|
|
8499
|
-
const u = this.createQuery(
|
|
8516
|
+
const u = this.createQuery(zs), l = await this.executeQuery(u, {
|
|
8500
8517
|
slug: e
|
|
8501
8518
|
}), h = M.get(l.data(), "0.fungibility") === "stackable";
|
|
8502
8519
|
if (!h && i !== null)
|
|
8503
|
-
throw new
|
|
8504
|
-
if (h && i === null && (i =
|
|
8520
|
+
throw new We("Expected Batch ID = null for non-stackable tokens.");
|
|
8521
|
+
if (h && i === null && (i = Be({})), s.length > 0) {
|
|
8505
8522
|
if (n > 0)
|
|
8506
|
-
throw new
|
|
8523
|
+
throw new ke();
|
|
8507
8524
|
n = s.length, r.tokenUnits = JSON.stringify(s);
|
|
8508
8525
|
}
|
|
8509
8526
|
t ? (Object.prototype.toString.call(t) === "[object String]" && (S.isBundleHash(t) ? (a = "walletBundle", c = t) : t = S.create({
|
|
@@ -8511,7 +8528,7 @@ class Ur {
|
|
|
8511
8528
|
token: e
|
|
8512
8529
|
})), t instanceof S && (a = "wallet", r.position = t.position, r.bundle = t.bundle, c = t.address)) : (a = "walletBundle", c = this.getBundle());
|
|
8513
8530
|
const p = await this.createMoleculeMutation({
|
|
8514
|
-
mutationClass:
|
|
8531
|
+
mutationClass: _s
|
|
8515
8532
|
});
|
|
8516
8533
|
return p.fillMolecule({
|
|
8517
8534
|
token: e,
|
|
@@ -8537,7 +8554,7 @@ class Ur {
|
|
|
8537
8554
|
molecule: n = null
|
|
8538
8555
|
}) {
|
|
8539
8556
|
const s = await this.createMoleculeMutation({
|
|
8540
|
-
mutationClass:
|
|
8557
|
+
mutationClass: xs,
|
|
8541
8558
|
molecule: n
|
|
8542
8559
|
});
|
|
8543
8560
|
return s.fillMolecule({
|
|
@@ -8597,14 +8614,14 @@ class Ur {
|
|
|
8597
8614
|
}) {
|
|
8598
8615
|
if (s.length > 0) {
|
|
8599
8616
|
if (n > 0)
|
|
8600
|
-
throw new
|
|
8617
|
+
throw new ke();
|
|
8601
8618
|
n = s.length;
|
|
8602
8619
|
}
|
|
8603
8620
|
if (i === null && (i = await this.querySourceWallet({
|
|
8604
8621
|
token: t,
|
|
8605
8622
|
amount: n
|
|
8606
|
-
})), i === null ||
|
|
8607
|
-
throw new
|
|
8623
|
+
})), i === null || le.cmp(i.balance, n) < 0)
|
|
8624
|
+
throw new J();
|
|
8608
8625
|
const a = S.create({
|
|
8609
8626
|
bundle: e,
|
|
8610
8627
|
token: t
|
|
@@ -8658,7 +8675,7 @@ class Ur {
|
|
|
8658
8675
|
const h = l.units || [];
|
|
8659
8676
|
if (h.length > 0) {
|
|
8660
8677
|
if (l.amount > 0)
|
|
8661
|
-
throw new
|
|
8678
|
+
throw new ke();
|
|
8662
8679
|
return h.length;
|
|
8663
8680
|
}
|
|
8664
8681
|
return l.amount || 0;
|
|
@@ -8666,8 +8683,8 @@ class Ur {
|
|
|
8666
8683
|
if (n === null && (n = await this.querySourceWallet({
|
|
8667
8684
|
token: e,
|
|
8668
8685
|
amount: r
|
|
8669
|
-
})), n === null ||
|
|
8670
|
-
throw new
|
|
8686
|
+
})), n === null || le.cmp(n.balance, r) < 0)
|
|
8687
|
+
throw new J();
|
|
8671
8688
|
const i = t.map((l) => {
|
|
8672
8689
|
const h = S.create({
|
|
8673
8690
|
bundle: l.bundleHash,
|
|
@@ -8719,7 +8736,7 @@ class Ur {
|
|
|
8719
8736
|
sourceWallet: s,
|
|
8720
8737
|
remainderWallet: r
|
|
8721
8738
|
}), a = await this.createMoleculeMutation({
|
|
8722
|
-
mutationClass:
|
|
8739
|
+
mutationClass: nr,
|
|
8723
8740
|
molecule: i
|
|
8724
8741
|
});
|
|
8725
8742
|
return a.fillMolecule({
|
|
@@ -8752,7 +8769,7 @@ class Ur {
|
|
|
8752
8769
|
sourceWallet: n,
|
|
8753
8770
|
remainderWallet: r
|
|
8754
8771
|
}), a = await this.createMoleculeMutation({
|
|
8755
|
-
mutationClass:
|
|
8772
|
+
mutationClass: sr,
|
|
8756
8773
|
molecule: i
|
|
8757
8774
|
}), c = {};
|
|
8758
8775
|
return c[this.getBundle()] = t, a.fillMolecule({
|
|
@@ -8782,7 +8799,7 @@ class Ur {
|
|
|
8782
8799
|
const r = s.createRemainder(this.getSecret());
|
|
8783
8800
|
if (n.length > 0) {
|
|
8784
8801
|
if (t > 0)
|
|
8785
|
-
throw new
|
|
8802
|
+
throw new ke();
|
|
8786
8803
|
t = n.length, s.splitUnits(
|
|
8787
8804
|
n,
|
|
8788
8805
|
r
|
|
@@ -8817,7 +8834,7 @@ class Ur {
|
|
|
8817
8834
|
sourceWallet: s = null
|
|
8818
8835
|
}) {
|
|
8819
8836
|
if (s === null && (s = (await this.queryBalance({ token: e })).payload()), !s)
|
|
8820
|
-
throw new
|
|
8837
|
+
throw new J("Source wallet is missing or invalid.");
|
|
8821
8838
|
const r = s.createRemainder(this.getSecret()), i = await this.createMolecule({
|
|
8822
8839
|
sourceWallet: s,
|
|
8823
8840
|
remainderWallet: r
|
|
@@ -8851,17 +8868,17 @@ class Ur {
|
|
|
8851
8868
|
sourceWallet: r = null
|
|
8852
8869
|
}) {
|
|
8853
8870
|
if (r === null && (r = (await this.queryBalance({ token: t })).payload()), r === null)
|
|
8854
|
-
throw new
|
|
8871
|
+
throw new J("Source wallet is missing or invalid.");
|
|
8855
8872
|
if (!r.tokenUnits || !r.tokenUnits.length)
|
|
8856
|
-
throw new
|
|
8873
|
+
throw new J("Source wallet does not have token units.");
|
|
8857
8874
|
if (!s.length)
|
|
8858
|
-
throw new
|
|
8875
|
+
throw new J("Fused token unit list is empty.");
|
|
8859
8876
|
const i = [];
|
|
8860
8877
|
r.tokenUnits.forEach((h) => {
|
|
8861
8878
|
i.push(h.id);
|
|
8862
8879
|
}), s.forEach((h) => {
|
|
8863
8880
|
if (!i.includes(h))
|
|
8864
|
-
throw new
|
|
8881
|
+
throw new J(`Fused token unit ID = ${h} does not found in the source wallet.`);
|
|
8865
8882
|
});
|
|
8866
8883
|
const a = S.create({
|
|
8867
8884
|
bundle: e,
|
|
@@ -8869,7 +8886,7 @@ class Ur {
|
|
|
8869
8886
|
});
|
|
8870
8887
|
a.initBatchId({ sourceWallet: r });
|
|
8871
8888
|
const c = r.createRemainder(this.getSecret());
|
|
8872
|
-
r.splitUnits(s, c), typeof n == "string" && (n = new
|
|
8889
|
+
r.splitUnits(s, c), typeof n == "string" && (n = new pe(n, n, {})), n.metas.fusedTokenUnits = r.getTokenUnitsData(), a.tokenUnits = [n];
|
|
8873
8890
|
const u = await this.createMolecule({
|
|
8874
8891
|
sourceWallet: r,
|
|
8875
8892
|
remainderWallet: c
|
|
@@ -8896,15 +8913,15 @@ class Ur {
|
|
|
8896
8913
|
}) {
|
|
8897
8914
|
this.setCellSlug(e);
|
|
8898
8915
|
const n = new S({
|
|
8899
|
-
secret:
|
|
8916
|
+
secret: tt(await this.getFingerprint()),
|
|
8900
8917
|
token: "AUTH"
|
|
8901
|
-
}), s = await this.createQuery(
|
|
8918
|
+
}), s = await this.createQuery(Hs), r = {
|
|
8902
8919
|
cellSlug: e,
|
|
8903
8920
|
pubkey: n.pubkey,
|
|
8904
8921
|
encrypt: t
|
|
8905
8922
|
}, i = await s.execute({ variables: r });
|
|
8906
8923
|
if (i.success()) {
|
|
8907
|
-
const a =
|
|
8924
|
+
const a = ve.create({
|
|
8908
8925
|
token: i.token(),
|
|
8909
8926
|
expiresAt: i.expiresAt(),
|
|
8910
8927
|
pubkey: i.pubKey(),
|
|
@@ -8934,13 +8951,13 @@ class Ur {
|
|
|
8934
8951
|
secret: e,
|
|
8935
8952
|
sourceWallet: n
|
|
8936
8953
|
}), r = await this.createMoleculeMutation({
|
|
8937
|
-
mutationClass:
|
|
8954
|
+
mutationClass: gs,
|
|
8938
8955
|
molecule: s
|
|
8939
8956
|
}), i = { encrypt: t ? "true" : "false" };
|
|
8940
8957
|
n.pubkey && (i.walletPubkey = n.pubkey), r.fillMolecule({ meta: i });
|
|
8941
8958
|
const a = await r.execute({});
|
|
8942
8959
|
if (a.success()) {
|
|
8943
|
-
const c =
|
|
8960
|
+
const c = ve.create({
|
|
8944
8961
|
token: a.token(),
|
|
8945
8962
|
expiresAt: a.expiresAt(),
|
|
8946
8963
|
pubkey: a.pubKey(),
|
|
@@ -8968,7 +8985,7 @@ class Ur {
|
|
|
8968
8985
|
}) {
|
|
8969
8986
|
if (this.$__serverSdkVersion < 3)
|
|
8970
8987
|
return this.log("warn", "KnishIOClient::authorize() - Server SDK version does not require an authorization..."), null;
|
|
8971
|
-
e === null && t && (e =
|
|
8988
|
+
e === null && t && (e = tt(t)), n && this.setCellSlug(n), this.$__authInProcess = !0;
|
|
8972
8989
|
let r;
|
|
8973
8990
|
return e ? r = await this.requestProfileAuthToken({
|
|
8974
8991
|
secret: e,
|
|
@@ -9020,7 +9037,7 @@ class Ur {
|
|
|
9020
9037
|
}
|
|
9021
9038
|
}
|
|
9022
9039
|
}
|
|
9023
|
-
class
|
|
9040
|
+
class Rr extends C {
|
|
9024
9041
|
/**
|
|
9025
9042
|
* Class constructor
|
|
9026
9043
|
*
|
|
@@ -9069,7 +9086,7 @@ class Br extends C {
|
|
|
9069
9086
|
*/
|
|
9070
9087
|
payloadKey(e) {
|
|
9071
9088
|
if (!M.has(this.payload(), e))
|
|
9072
|
-
throw new
|
|
9089
|
+
throw new ee(`ResponseAuthorizationGuest::payloadKey() - '${e}' key is not found in the payload!`);
|
|
9073
9090
|
return M.get(this.payload(), e);
|
|
9074
9091
|
}
|
|
9075
9092
|
/**
|
|
@@ -9091,119 +9108,119 @@ class Br extends C {
|
|
|
9091
9108
|
}
|
|
9092
9109
|
export {
|
|
9093
9110
|
g as Atom,
|
|
9094
|
-
|
|
9111
|
+
be as AtomIndexException,
|
|
9095
9112
|
P as AtomMeta,
|
|
9096
|
-
|
|
9097
|
-
|
|
9113
|
+
oe as AtomsMissingException,
|
|
9114
|
+
ve as AuthToken,
|
|
9098
9115
|
It as AuthorizationRejectedException,
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9116
|
+
ue as BalanceInsufficientException,
|
|
9117
|
+
We as BatchIdException,
|
|
9118
|
+
Ae as CheckMolecule,
|
|
9119
|
+
Y as CodeException,
|
|
9120
|
+
le as Decimal,
|
|
9104
9121
|
M as Dot,
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9122
|
+
ee as InvalidResponseException,
|
|
9123
|
+
Or as KnishIOClient,
|
|
9124
|
+
he as Meta,
|
|
9108
9125
|
H as MetaMissingException,
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9126
|
+
ss as MolecularHashMismatchException,
|
|
9127
|
+
rs as MolecularHashMissingException,
|
|
9128
|
+
V as Molecule,
|
|
9129
|
+
Fe as Mutation,
|
|
9130
|
+
js as MutationActiveSession,
|
|
9131
|
+
Os as MutationAppendRequest,
|
|
9132
|
+
xs as MutationClaimShadowWallet,
|
|
9133
|
+
As as MutationCreateIdentifier,
|
|
9134
|
+
Ms as MutationCreateMeta,
|
|
9135
|
+
tr as MutationCreateRule,
|
|
9136
|
+
ws as MutationCreateToken,
|
|
9137
|
+
Us as MutationCreateWallet,
|
|
9138
|
+
nr as MutationDepositBufferToken,
|
|
9139
|
+
qs as MutationLinkIdentifier,
|
|
9140
|
+
Cs as MutationPeering,
|
|
9124
9141
|
W as MutationProposeMolecule,
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9142
|
+
gs as MutationRequestAuthorization,
|
|
9143
|
+
Hs as MutationRequestAuthorizationGuest,
|
|
9144
|
+
_s as MutationRequestTokens,
|
|
9128
9145
|
vt as MutationTransferTokens,
|
|
9129
|
-
|
|
9146
|
+
sr as MutationWithdrawBufferToken,
|
|
9130
9147
|
$t as NegativeAmountException,
|
|
9131
9148
|
wt as PolicyInvalidException,
|
|
9132
|
-
|
|
9149
|
+
st as PolicyMeta,
|
|
9133
9150
|
N as Query,
|
|
9134
|
-
|
|
9151
|
+
Vs as QueryActiveSession,
|
|
9135
9152
|
Mt as QueryAtom,
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9153
|
+
ps as QueryBalance,
|
|
9154
|
+
xe as QueryBatch,
|
|
9155
|
+
ms as QueryBatchHistory,
|
|
9156
|
+
ls as QueryContinuId,
|
|
9140
9157
|
Et as QueryEmbeddingStatus,
|
|
9141
9158
|
At as QueryMetaType,
|
|
9142
9159
|
Tt as QueryMetaTypeViaAtom,
|
|
9143
9160
|
Ct as QueryMetaTypeViaMolecule,
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9161
|
+
Xs as QueryPolicy,
|
|
9162
|
+
zs as QueryToken,
|
|
9163
|
+
us as QueryWalletBundle,
|
|
9164
|
+
hs as QueryWalletList,
|
|
9148
9165
|
C as Response,
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9166
|
+
Qs as ResponseActiveSession,
|
|
9167
|
+
Es as ResponseAppendRequest,
|
|
9168
|
+
Js as ResponseAtom,
|
|
9169
|
+
Rr as ResponseAuthorizationGuest,
|
|
9170
|
+
ds as ResponseBalance,
|
|
9171
|
+
vs as ResponseClaimShadowWallet,
|
|
9172
|
+
as as ResponseContinuId,
|
|
9173
|
+
$s as ResponseCreateIdentifier,
|
|
9174
|
+
Is as ResponseCreateMeta,
|
|
9175
|
+
er as ResponseCreateRule,
|
|
9176
|
+
bs as ResponseCreateToken,
|
|
9177
|
+
Ws as ResponseCreateWallet,
|
|
9178
|
+
Ys as ResponseEmbeddingStatus,
|
|
9179
|
+
Rs as ResponseLinkIdentifier,
|
|
9180
|
+
fs as ResponseMetaType,
|
|
9181
|
+
Zs as ResponseMetaTypeViaAtom,
|
|
9182
|
+
it as ResponseMetaTypeViaMolecule,
|
|
9183
|
+
Ts as ResponsePeering,
|
|
9184
|
+
Gs as ResponsePolicy,
|
|
9185
|
+
D as ResponseProposeMolecule,
|
|
9186
|
+
Ds as ResponseQueryActiveSession,
|
|
9187
|
+
ys as ResponseRequestAuthorization,
|
|
9188
|
+
Bs as ResponseRequestAuthorizationGuest,
|
|
9189
|
+
ks as ResponseRequestTokens,
|
|
9190
|
+
Ss as ResponseTransferTokens,
|
|
9191
|
+
cs as ResponseWalletBundle,
|
|
9175
9192
|
Le as ResponseWalletList,
|
|
9176
9193
|
Jt as SignatureMalformedException,
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9194
|
+
is as SignatureMismatchException,
|
|
9195
|
+
ke as StackableUnitAmountException,
|
|
9196
|
+
Ps as StackableUnitDecimalsException,
|
|
9197
|
+
pe as TokenUnit,
|
|
9198
|
+
J as TransferBalanceException,
|
|
9199
|
+
we as TransferMalformedException,
|
|
9183
9200
|
kt as TransferMismatchedException,
|
|
9184
9201
|
_t as TransferRemainderException,
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9202
|
+
os as TransferToSelfException,
|
|
9203
|
+
Ee as TransferUnbalancedException,
|
|
9204
|
+
Pe as UnauthenticatedException,
|
|
9188
9205
|
S as Wallet,
|
|
9189
9206
|
xt as WalletShadowException,
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9207
|
+
se as WrongTokenTypeException,
|
|
9208
|
+
pn as base64ToHex,
|
|
9209
|
+
at as bufferToHexString,
|
|
9210
|
+
un as charsetBaseConvert,
|
|
9211
|
+
Cr as chunkArray,
|
|
9212
|
+
Ue as chunkSubstr,
|
|
9213
|
+
mn as deepCloning,
|
|
9214
|
+
yn as diff,
|
|
9215
|
+
Be as generateBatchId,
|
|
9216
|
+
de as generateBundleHash,
|
|
9217
|
+
tt as generateSecret,
|
|
9218
|
+
hn as hexStringToBuffer,
|
|
9219
|
+
dn as hexToBase64,
|
|
9220
|
+
fe as intersect,
|
|
9221
|
+
De as isHex,
|
|
9222
|
+
fn as isNumeric,
|
|
9223
|
+
nt as randomString,
|
|
9224
|
+
Ve as shake256
|
|
9208
9225
|
};
|
|
9209
9226
|
//# sourceMappingURL=client.es.mjs.map
|