@wishknish/knishio-client-js 0.8.2 → 0.9.2
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 -102
- package/dist/client.cjs.js.map +1 -1
- package/dist/client.es.mjs +978 -958
- package/dist/client.es.mjs.map +1 -1
- package/dist/client.iife.js +29 -102
- package/dist/client.iife.js.map +1 -1
- package/package.json +9 -13
- package/src/KnishIOClient.js +112 -46
- package/src/Molecule.js +36 -30
- package/src/Wallet.js +98 -3
- package/src/index.js +0 -4
- package/src/libraries/urql/UrqlClientWrapper.js +88 -0
- package/src/mutation/MutationTransferTokens.js +18 -0
- package/src/query/QueryUserActivity.js +0 -151
- package/src/response/ResponseQueryUserActivity.js +0 -79
package/dist/client.es.mjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import { gql as E, cacheExchange as nn, fetchExchange as sn, subscriptionExchange as rn, createClient as on } from "@urql/core";
|
|
6
|
-
import { createClient as an } from "graphql-ws";
|
|
7
|
-
import { pipe as ln, map as cn, subscribe as un } from "wonka";
|
|
1
|
+
import F from "jssha";
|
|
2
|
+
import { gql as E, cacheExchange as en, fetchExchange as tn, subscriptionExchange as nn, createClient as sn } from "@urql/core";
|
|
3
|
+
import { createClient as rn } from "graphql-ws";
|
|
4
|
+
import { pipe as on, map as an, subscribe as ln } from "wonka";
|
|
8
5
|
typeof self > "u" && (global.self = global);
|
|
9
6
|
class qt {
|
|
10
7
|
/**
|
|
@@ -75,17 +72,17 @@ 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
|
|
81
|
+
function nt(o = 256, e = "abcdef0123456789") {
|
|
85
82
|
let t = new Uint8Array(o);
|
|
86
83
|
return t = crypto.getRandomValues(t), t = t.map((n) => e.charCodeAt(n % e.length)), String.fromCharCode.apply(null, t);
|
|
87
84
|
}
|
|
88
|
-
function
|
|
85
|
+
function cn(o, e, t, n, s) {
|
|
89
86
|
if (n = n || "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~`!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?¿¡", s = s || n, e > n.length || t > s.length)
|
|
90
87
|
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
88
|
let i = BigInt(0);
|
|
@@ -98,27 +95,27 @@ function hn(o, e, t, n, s) {
|
|
|
98
95
|
}
|
|
99
96
|
return a || "0";
|
|
100
97
|
}
|
|
101
|
-
function
|
|
98
|
+
function un(o) {
|
|
102
99
|
return qt.toHex(o, {});
|
|
103
100
|
}
|
|
104
|
-
function
|
|
101
|
+
function hn(o) {
|
|
105
102
|
return qt.toUint8Array(o);
|
|
106
103
|
}
|
|
107
|
-
function
|
|
108
|
-
const e =
|
|
104
|
+
function dn(o) {
|
|
105
|
+
const e = hn(o);
|
|
109
106
|
return btoa(String.fromCharCode.apply(null, e));
|
|
110
107
|
}
|
|
111
|
-
function
|
|
108
|
+
function pn(o) {
|
|
112
109
|
const e = new Uint8Array(atob(o).split("").map((t) => t.charCodeAt(0)));
|
|
113
|
-
return
|
|
110
|
+
return un(e);
|
|
114
111
|
}
|
|
115
|
-
function
|
|
112
|
+
function De(o) {
|
|
116
113
|
return /^[A-F0-9]+$/i.test(o);
|
|
117
114
|
}
|
|
118
|
-
function
|
|
115
|
+
function fn(o) {
|
|
119
116
|
return (typeof o == "number" || typeof o == "string" && o.trim() !== "") && !isNaN(o);
|
|
120
117
|
}
|
|
121
|
-
let
|
|
118
|
+
let he = class {
|
|
122
119
|
/**
|
|
123
120
|
* Normalizes the meta array into the standard {key: ..., value: ...} format
|
|
124
121
|
*
|
|
@@ -155,10 +152,10 @@ let pe = class {
|
|
|
155
152
|
return t;
|
|
156
153
|
}
|
|
157
154
|
};
|
|
158
|
-
function
|
|
159
|
-
return o.length ? [o.slice(0, e)].concat(
|
|
155
|
+
function mn(o, e) {
|
|
156
|
+
return o.length ? [o.slice(0, e)].concat(mn(o.slice(e), e)) : [];
|
|
160
157
|
}
|
|
161
|
-
function
|
|
158
|
+
function yn(o, e) {
|
|
162
159
|
let t, n, s;
|
|
163
160
|
const r = [Array, Date, Number, String, Boolean], i = Object.prototype.toString;
|
|
164
161
|
for (e = e || [], t = 0; t < e.length; t += 2)
|
|
@@ -168,11 +165,11 @@ function bn(o, e) {
|
|
|
168
165
|
i.call(o) === i.call(s = new r[t](o)) && (n = t ? s : []);
|
|
169
166
|
e.push(o, n);
|
|
170
167
|
for (t in o)
|
|
171
|
-
e.hasOwnProperty.call(o, t) && (n[t] =
|
|
168
|
+
e.hasOwnProperty.call(o, t) && (n[t] = yn(o[t], e));
|
|
172
169
|
}
|
|
173
170
|
return n || o;
|
|
174
171
|
}
|
|
175
|
-
function
|
|
172
|
+
function gn(...o) {
|
|
176
173
|
return [].concat(...o.map((e, t) => {
|
|
177
174
|
const n = o.slice(0);
|
|
178
175
|
n.splice(t, 1);
|
|
@@ -180,17 +177,17 @@ function wn(...o) {
|
|
|
180
177
|
return e.filter((r) => !s.includes(r));
|
|
181
178
|
}));
|
|
182
179
|
}
|
|
183
|
-
function
|
|
180
|
+
function fe(...o) {
|
|
184
181
|
return o.reduce((e, t) => e.filter((n) => t.includes(n)));
|
|
185
182
|
}
|
|
186
|
-
class
|
|
183
|
+
class st {
|
|
187
184
|
/**
|
|
188
185
|
*
|
|
189
186
|
* @param policy
|
|
190
187
|
* @param metaKeys
|
|
191
188
|
*/
|
|
192
189
|
constructor(e = {}, t = {}) {
|
|
193
|
-
this.policy =
|
|
190
|
+
this.policy = st.normalizePolicy(e), this.fillDefault(t);
|
|
194
191
|
}
|
|
195
192
|
/**
|
|
196
193
|
*
|
|
@@ -218,7 +215,7 @@ class rt {
|
|
|
218
215
|
})) {
|
|
219
216
|
const i = r.map((a) => a.key);
|
|
220
217
|
this.policy[s] || (this.policy[s] = {});
|
|
221
|
-
for (const a of
|
|
218
|
+
for (const a of gn(e, i))
|
|
222
219
|
this.policy[s][a] || (this.policy[s][a] = s === "write" && !["characters", "pubkey"].includes(a) ? ["self"] : ["all"]);
|
|
223
220
|
}
|
|
224
221
|
}
|
|
@@ -243,7 +240,7 @@ class P {
|
|
|
243
240
|
* @param {object|array} meta
|
|
244
241
|
*/
|
|
245
242
|
constructor(e = []) {
|
|
246
|
-
this.meta =
|
|
243
|
+
this.meta = he.normalizeMeta(e);
|
|
247
244
|
}
|
|
248
245
|
/**
|
|
249
246
|
*
|
|
@@ -251,7 +248,7 @@ class P {
|
|
|
251
248
|
* @returns {AtomMeta}
|
|
252
249
|
*/
|
|
253
250
|
merge(e) {
|
|
254
|
-
return this.meta = Array.from(/* @__PURE__ */ new Set([...this.meta, ...
|
|
251
|
+
return this.meta = Array.from(/* @__PURE__ */ new Set([...this.meta, ...he.normalizeMeta(e)])), this;
|
|
255
252
|
}
|
|
256
253
|
/**
|
|
257
254
|
*
|
|
@@ -320,7 +317,7 @@ class P {
|
|
|
320
317
|
* @returns {AtomMeta}
|
|
321
318
|
*/
|
|
322
319
|
addPolicy(e) {
|
|
323
|
-
const t = new
|
|
320
|
+
const t = new st(e, Object.keys(this.meta));
|
|
324
321
|
return this.merge({
|
|
325
322
|
policy: t.toJson()
|
|
326
323
|
}), this;
|
|
@@ -353,7 +350,7 @@ Stack:
|
|
|
353
350
|
${this.stack}`;
|
|
354
351
|
}
|
|
355
352
|
}
|
|
356
|
-
class
|
|
353
|
+
class oe extends x {
|
|
357
354
|
/**
|
|
358
355
|
* Class constructor
|
|
359
356
|
*
|
|
@@ -365,7 +362,7 @@ class ae extends x {
|
|
|
365
362
|
super(e, t, n), this.name = "AtomsMissingException";
|
|
366
363
|
}
|
|
367
364
|
}
|
|
368
|
-
class
|
|
365
|
+
class ie {
|
|
369
366
|
/**
|
|
370
367
|
*
|
|
371
368
|
* @param {Atom} atom
|
|
@@ -386,7 +383,7 @@ class oe {
|
|
|
386
383
|
case "[object Array]": {
|
|
387
384
|
const t = [];
|
|
388
385
|
for (const n in e)
|
|
389
|
-
t.push(
|
|
386
|
+
t.push(ie.isStructure(e[n]) ? ie.structure(e[n]) : e[n]);
|
|
390
387
|
return t;
|
|
391
388
|
}
|
|
392
389
|
case "[object Object]": {
|
|
@@ -394,7 +391,7 @@ class oe {
|
|
|
394
391
|
for (const s of n)
|
|
395
392
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
396
393
|
const r = {};
|
|
397
|
-
r[s] =
|
|
394
|
+
r[s] = ie.isStructure(e[s]) ? ie.structure(e[s]) : e[s], t.push(r);
|
|
398
395
|
}
|
|
399
396
|
if (t.length > 0)
|
|
400
397
|
return t;
|
|
@@ -416,10 +413,10 @@ class oe {
|
|
|
416
413
|
* @returns {Object[]}
|
|
417
414
|
*/
|
|
418
415
|
view() {
|
|
419
|
-
return
|
|
416
|
+
return ie.structure(this);
|
|
420
417
|
}
|
|
421
418
|
}
|
|
422
|
-
class
|
|
419
|
+
class bn extends ie {
|
|
423
420
|
constructor({
|
|
424
421
|
position: e = null,
|
|
425
422
|
walletAddress: t = null,
|
|
@@ -437,8 +434,8 @@ class kn extends oe {
|
|
|
437
434
|
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
435
|
}
|
|
439
436
|
}
|
|
440
|
-
const
|
|
441
|
-
4:
|
|
437
|
+
const Re = {
|
|
438
|
+
4: bn
|
|
442
439
|
};
|
|
443
440
|
class g {
|
|
444
441
|
/**
|
|
@@ -471,7 +468,7 @@ class g {
|
|
|
471
468
|
index: h = null,
|
|
472
469
|
version: p = null
|
|
473
470
|
}) {
|
|
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 ?
|
|
471
|
+
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
472
|
}
|
|
476
473
|
/**
|
|
477
474
|
*
|
|
@@ -643,15 +640,15 @@ class g {
|
|
|
643
640
|
atoms: e,
|
|
644
641
|
output: t = "base17"
|
|
645
642
|
}) {
|
|
646
|
-
const n = new
|
|
643
|
+
const n = new F("SHAKE256", "TEXT"), s = g.sortAtoms(e);
|
|
647
644
|
if (s.length === 0)
|
|
648
|
-
throw new
|
|
645
|
+
throw new oe();
|
|
649
646
|
if (s.map((r) => {
|
|
650
647
|
if (!(r instanceof g))
|
|
651
|
-
throw new
|
|
648
|
+
throw new oe();
|
|
652
649
|
return r;
|
|
653
|
-
}), s.every((r) => r.version && Object.prototype.hasOwnProperty.call(
|
|
654
|
-
n.update(JSON.stringify(s.map((r) =>
|
|
650
|
+
}), s.every((r) => r.version && Object.prototype.hasOwnProperty.call(Re, r.version)))
|
|
651
|
+
n.update(JSON.stringify(s.map((r) => Re[r.version].create(r).view())));
|
|
655
652
|
else {
|
|
656
653
|
const r = String(e.length);
|
|
657
654
|
let i = [];
|
|
@@ -666,7 +663,7 @@ class g {
|
|
|
666
663
|
case "array":
|
|
667
664
|
return n.getHash("ARRAYBUFFER", { outputLen: 256 });
|
|
668
665
|
default:
|
|
669
|
-
return
|
|
666
|
+
return cn(n.getHash("HEX", { outputLen: 256 }), 16, 17, "0123456789abcdef", "0123456789abcdefg").padStart(64, "0");
|
|
670
667
|
}
|
|
671
668
|
}
|
|
672
669
|
static jsonSerialization(e, t) {
|
|
@@ -687,7 +684,7 @@ class g {
|
|
|
687
684
|
* Get aggregated meta from stored normalized ones
|
|
688
685
|
*/
|
|
689
686
|
aggregatedMeta() {
|
|
690
|
-
return
|
|
687
|
+
return he.aggregateMeta(this.meta);
|
|
691
688
|
}
|
|
692
689
|
/**
|
|
693
690
|
*
|
|
@@ -707,28 +704,28 @@ class g {
|
|
|
707
704
|
return e;
|
|
708
705
|
}
|
|
709
706
|
}
|
|
710
|
-
function
|
|
707
|
+
function tt(o = null, e = 2048) {
|
|
711
708
|
if (o) {
|
|
712
|
-
const t = new
|
|
709
|
+
const t = new F("SHAKE256", "TEXT");
|
|
713
710
|
return t.update(o), t.getHash("HEX", { outputLen: e * 4 });
|
|
714
711
|
} else
|
|
715
|
-
return
|
|
712
|
+
return nt(e);
|
|
716
713
|
}
|
|
717
|
-
function
|
|
718
|
-
const t = new
|
|
714
|
+
function de(o, e = null) {
|
|
715
|
+
const t = new F("SHAKE256", "TEXT");
|
|
719
716
|
return t.update(o), t.getHash("HEX", { outputLen: 256 });
|
|
720
717
|
}
|
|
721
|
-
function
|
|
722
|
-
const t = new
|
|
718
|
+
function Ve(o, e) {
|
|
719
|
+
const t = new F("SHAKE256", "TEXT");
|
|
723
720
|
return t.update(o), t.getHash("HEX", { outputLen: e });
|
|
724
721
|
}
|
|
725
|
-
function
|
|
722
|
+
function Be({
|
|
726
723
|
molecularHash: o = null,
|
|
727
724
|
index: e = null
|
|
728
725
|
}) {
|
|
729
|
-
return o !== null && e !== null ?
|
|
726
|
+
return o !== null && e !== null ? de(String(o) + String(e), "generateBatchId") : nt(64);
|
|
730
727
|
}
|
|
731
|
-
class
|
|
728
|
+
class pe {
|
|
732
729
|
/**
|
|
733
730
|
*
|
|
734
731
|
* @param id
|
|
@@ -745,7 +742,7 @@ class me {
|
|
|
745
742
|
*/
|
|
746
743
|
static createFromGraphQL(e) {
|
|
747
744
|
let t = e.metas || {};
|
|
748
|
-
return t.length && (t = JSON.parse(t), t || (t = {})), new
|
|
745
|
+
return t.length && (t = JSON.parse(t), t || (t = {})), new pe(
|
|
749
746
|
e.id,
|
|
750
747
|
e.name,
|
|
751
748
|
t
|
|
@@ -757,7 +754,7 @@ class me {
|
|
|
757
754
|
* @returns {TokenUnit}
|
|
758
755
|
*/
|
|
759
756
|
static createFromDB(e) {
|
|
760
|
-
return new
|
|
757
|
+
return new pe(
|
|
761
758
|
e[0],
|
|
762
759
|
e[1],
|
|
763
760
|
e.length > 2 ? e[2] : {}
|
|
@@ -807,46 +804,45 @@ class ze extends x {
|
|
|
807
804
|
super(e, t, n), this.name = "WalletCredentialException";
|
|
808
805
|
}
|
|
809
806
|
}
|
|
810
|
-
const
|
|
811
|
-
function
|
|
812
|
-
return e ? { h: Number(o &
|
|
807
|
+
const Te = /* @__PURE__ */ BigInt(2 ** 32 - 1), at = /* @__PURE__ */ BigInt(32);
|
|
808
|
+
function wn(o, e = !1) {
|
|
809
|
+
return e ? { h: Number(o & Te), l: Number(o >> at & Te) } : { h: Number(o >> at & Te) | 0, l: Number(o & Te) | 0 };
|
|
813
810
|
}
|
|
814
|
-
function
|
|
811
|
+
function kn(o, e = !1) {
|
|
815
812
|
const t = o.length;
|
|
816
813
|
let n = new Uint32Array(t), s = new Uint32Array(t);
|
|
817
814
|
for (let r = 0; r < t; r++) {
|
|
818
|
-
const { h: i, l: a } =
|
|
815
|
+
const { h: i, l: a } = wn(o[r], e);
|
|
819
816
|
[n[r], s[r]] = [i, a];
|
|
820
817
|
}
|
|
821
818
|
return [n, s];
|
|
822
819
|
}
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
function In(o) {
|
|
820
|
+
const _n = (o, e, t) => o << t | e >>> 32 - t, Sn = (o, e, t) => e << t | o >>> 32 - t, $n = (o, e, t) => e << t - 32 | o >>> 64 - t, An = (o, e, t) => o << t - 32 | e >>> 64 - t;
|
|
821
|
+
function vn(o) {
|
|
826
822
|
return o instanceof Uint8Array || ArrayBuffer.isView(o) && o.constructor.name === "Uint8Array";
|
|
827
823
|
}
|
|
828
|
-
function
|
|
824
|
+
function lt(o, e = "") {
|
|
829
825
|
if (!Number.isSafeInteger(o) || o < 0) {
|
|
830
826
|
const t = e && `"${e}" `;
|
|
831
827
|
throw new Error(`${t}expected integer >= 0, got ${o}`);
|
|
832
828
|
}
|
|
833
829
|
}
|
|
834
|
-
function
|
|
835
|
-
const n =
|
|
830
|
+
function j(o, e, t = "") {
|
|
831
|
+
const n = vn(o), s = o?.length, r = e !== void 0;
|
|
836
832
|
if (!n || r && s !== e) {
|
|
837
833
|
const i = t && `"${t}" `, a = r ? ` of length ${e}` : "", c = n ? `length=${s}` : `type=${typeof o}`;
|
|
838
834
|
throw new Error(i + "expected Uint8Array" + a + ", got " + c);
|
|
839
835
|
}
|
|
840
836
|
return o;
|
|
841
837
|
}
|
|
842
|
-
function
|
|
838
|
+
function ct(o, e = !0) {
|
|
843
839
|
if (o.destroyed)
|
|
844
840
|
throw new Error("Hash instance has been destroyed");
|
|
845
841
|
if (e && o.finished)
|
|
846
842
|
throw new Error("Hash#digest() has already been called");
|
|
847
843
|
}
|
|
848
|
-
function
|
|
849
|
-
|
|
844
|
+
function xn(o, e) {
|
|
845
|
+
j(o, void 0, "digestInto() output");
|
|
850
846
|
const t = e.outputLen;
|
|
851
847
|
if (o.length < t)
|
|
852
848
|
throw new Error('"digestInto() output" expected to be of length >=' + t);
|
|
@@ -858,50 +854,50 @@ function Ut(...o) {
|
|
|
858
854
|
for (let e = 0; e < o.length; e++)
|
|
859
855
|
o[e].fill(0);
|
|
860
856
|
}
|
|
861
|
-
const
|
|
862
|
-
function
|
|
857
|
+
const In = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
858
|
+
function Mn(o) {
|
|
863
859
|
return o << 24 & 4278190080 | o << 8 & 16711680 | o >>> 8 & 65280 | o >>> 24 & 255;
|
|
864
860
|
}
|
|
865
|
-
function
|
|
861
|
+
function Tn(o) {
|
|
866
862
|
for (let e = 0; e < o.length; e++)
|
|
867
|
-
o[e] =
|
|
863
|
+
o[e] = Mn(o[e]);
|
|
868
864
|
return o;
|
|
869
865
|
}
|
|
870
|
-
const
|
|
866
|
+
const ut = In ? (o) => o : Tn;
|
|
871
867
|
function Bt(o, e = {}) {
|
|
872
868
|
const t = (s, r) => o(r).update(s).digest(), n = o(void 0);
|
|
873
869
|
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = (s) => o(s), Object.assign(t, e), Object.freeze(t);
|
|
874
870
|
}
|
|
875
|
-
function
|
|
871
|
+
function Cn(o = 32) {
|
|
876
872
|
const e = typeof globalThis == "object" ? globalThis.crypto : null;
|
|
877
|
-
if (typeof
|
|
873
|
+
if (typeof e?.getRandomValues != "function")
|
|
878
874
|
throw new Error("crypto.getRandomValues must be defined");
|
|
879
875
|
return e.getRandomValues(new Uint8Array(o));
|
|
880
876
|
}
|
|
881
|
-
const
|
|
877
|
+
const Ke = (o) => ({
|
|
882
878
|
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, o])
|
|
883
|
-
}),
|
|
884
|
-
for (let o = 0, e =
|
|
879
|
+
}), En = BigInt(0), me = BigInt(1), On = BigInt(2), Rn = BigInt(7), qn = BigInt(256), Wn = BigInt(113), Ht = [], Pt = [], Kt = [];
|
|
880
|
+
for (let o = 0, e = me, t = 1, n = 0; o < 24; o++) {
|
|
885
881
|
[t, n] = [n, (2 * t + 3 * n) % 5], Ht.push(2 * (5 * n + t)), Pt.push((o + 1) * (o + 2) / 2 % 64);
|
|
886
|
-
let s =
|
|
882
|
+
let s = En;
|
|
887
883
|
for (let r = 0; r < 7; r++)
|
|
888
|
-
e = (e <<
|
|
884
|
+
e = (e << me ^ (e >> Rn) * Wn) % qn, e & On && (s ^= me << (me << BigInt(r)) - me);
|
|
889
885
|
Kt.push(s);
|
|
890
886
|
}
|
|
891
|
-
const Nt =
|
|
892
|
-
function
|
|
887
|
+
const Nt = kn(Kt, !0), Un = Nt[0], Bn = Nt[1], ht = (o, e, t) => t > 32 ? $n(o, e, t) : _n(o, e, t), dt = (o, e, t) => t > 32 ? An(o, e, t) : Sn(o, e, t);
|
|
888
|
+
function Hn(o, e = 24) {
|
|
893
889
|
const t = new Uint32Array(10);
|
|
894
890
|
for (let n = 24 - e; n < 24; n++) {
|
|
895
891
|
for (let i = 0; i < 10; i++)
|
|
896
892
|
t[i] = o[i] ^ o[i + 10] ^ o[i + 20] ^ o[i + 30] ^ o[i + 40];
|
|
897
893
|
for (let i = 0; i < 10; i += 2) {
|
|
898
|
-
const a = (i + 8) % 10, c = (i + 2) % 10, u = t[c], l = t[c + 1], h =
|
|
894
|
+
const a = (i + 8) % 10, c = (i + 2) % 10, u = t[c], l = t[c + 1], h = ht(u, l, 1) ^ t[a], p = dt(u, l, 1) ^ t[a + 1];
|
|
899
895
|
for (let d = 0; d < 50; d += 10)
|
|
900
896
|
o[i + d] ^= h, o[i + d + 1] ^= p;
|
|
901
897
|
}
|
|
902
898
|
let s = o[2], r = o[3];
|
|
903
899
|
for (let i = 0; i < 24; i++) {
|
|
904
|
-
const a = Pt[i], c =
|
|
900
|
+
const a = Pt[i], c = ht(s, r, a), u = dt(s, r, a), l = Ht[i];
|
|
905
901
|
s = o[l], r = o[l + 1], o[l] = c, o[l + 1] = u;
|
|
906
902
|
}
|
|
907
903
|
for (let i = 0; i < 50; i += 10) {
|
|
@@ -910,25 +906,25 @@ function Kn(o, e = 24) {
|
|
|
910
906
|
for (let a = 0; a < 10; a++)
|
|
911
907
|
o[i + a] ^= ~t[(a + 2) % 10] & t[(a + 4) % 10];
|
|
912
908
|
}
|
|
913
|
-
o[0] ^=
|
|
909
|
+
o[0] ^= Un[n], o[1] ^= Bn[n];
|
|
914
910
|
}
|
|
915
911
|
Ut(t);
|
|
916
912
|
}
|
|
917
|
-
class
|
|
913
|
+
class Ne {
|
|
914
|
+
state;
|
|
915
|
+
pos = 0;
|
|
916
|
+
posOut = 0;
|
|
917
|
+
finished = !1;
|
|
918
|
+
state32;
|
|
919
|
+
destroyed = !1;
|
|
920
|
+
blockLen;
|
|
921
|
+
suffix;
|
|
922
|
+
outputLen;
|
|
923
|
+
enableXOF = !1;
|
|
924
|
+
rounds;
|
|
918
925
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
919
926
|
constructor(e, t, n, s = !1, r = 24) {
|
|
920
|
-
|
|
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
|
-
if (this.blockLen = e, this.suffix = t, this.outputLen = n, this.enableXOF = s, this.rounds = r, ut(n, "outputLen"), !(0 < e && e < 200))
|
|
927
|
+
if (this.blockLen = e, this.suffix = t, this.outputLen = n, this.enableXOF = s, this.rounds = r, lt(n, "outputLen"), !(0 < e && e < 200))
|
|
932
928
|
throw new Error("only keccak-f1600 function is supported");
|
|
933
929
|
this.state = new Uint8Array(200), this.state32 = Wt(this.state);
|
|
934
930
|
}
|
|
@@ -936,10 +932,10 @@ class Fe {
|
|
|
936
932
|
return this._cloneInto();
|
|
937
933
|
}
|
|
938
934
|
keccak() {
|
|
939
|
-
|
|
935
|
+
ut(this.state32), Hn(this.state32, this.rounds), ut(this.state32), this.posOut = 0, this.pos = 0;
|
|
940
936
|
}
|
|
941
937
|
update(e) {
|
|
942
|
-
|
|
938
|
+
ct(this), j(e);
|
|
943
939
|
const { blockLen: t, state: n } = this, s = e.length;
|
|
944
940
|
for (let r = 0; r < s; ) {
|
|
945
941
|
const i = Math.min(t - this.pos, s - r);
|
|
@@ -957,7 +953,7 @@ class Fe {
|
|
|
957
953
|
e[n] ^= t, (t & 128) !== 0 && n === s - 1 && this.keccak(), e[s - 1] ^= 128, this.keccak();
|
|
958
954
|
}
|
|
959
955
|
writeInto(e) {
|
|
960
|
-
|
|
956
|
+
ct(this, !1), j(e), this.finish();
|
|
961
957
|
const t = this.state, { blockLen: n } = this;
|
|
962
958
|
for (let s = 0, r = e.length; s < r; ) {
|
|
963
959
|
this.posOut >= n && this.keccak();
|
|
@@ -972,10 +968,10 @@ class Fe {
|
|
|
972
968
|
return this.writeInto(e);
|
|
973
969
|
}
|
|
974
970
|
xof(e) {
|
|
975
|
-
return
|
|
971
|
+
return lt(e), this.xofInto(new Uint8Array(e));
|
|
976
972
|
}
|
|
977
973
|
digestInto(e) {
|
|
978
|
-
if (
|
|
974
|
+
if (xn(e, this), this.finished)
|
|
979
975
|
throw new Error("digest() was already called");
|
|
980
976
|
return this.writeInto(e), this.destroy(), e;
|
|
981
977
|
}
|
|
@@ -987,39 +983,39 @@ class Fe {
|
|
|
987
983
|
}
|
|
988
984
|
_cloneInto(e) {
|
|
989
985
|
const { blockLen: t, suffix: n, outputLen: s, rounds: r, enableXOF: i } = this;
|
|
990
|
-
return e
|
|
986
|
+
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
987
|
}
|
|
992
988
|
}
|
|
993
|
-
const
|
|
989
|
+
const Lt = (o, e, t, n = {}) => Bt(() => new Ne(e, o, t), n), Pn = /* @__PURE__ */ Lt(
|
|
994
990
|
6,
|
|
995
991
|
136,
|
|
996
992
|
32,
|
|
997
|
-
/* @__PURE__ */
|
|
998
|
-
),
|
|
993
|
+
/* @__PURE__ */ Ke(8)
|
|
994
|
+
), Kn = /* @__PURE__ */ Lt(
|
|
999
995
|
6,
|
|
1000
996
|
72,
|
|
1001
997
|
64,
|
|
1002
|
-
/* @__PURE__ */
|
|
1003
|
-
),
|
|
1004
|
-
function
|
|
998
|
+
/* @__PURE__ */ Ke(10)
|
|
999
|
+
), Ft = (o, e, t, n = {}) => Bt((s = {}) => new Ne(e, o, s.dkLen === void 0 ? t : s.dkLen, !0), n), Nn = /* @__PURE__ */ Ft(31, 168, 16, /* @__PURE__ */ Ke(11)), Qt = /* @__PURE__ */ Ft(31, 136, 32, /* @__PURE__ */ Ke(12));
|
|
1000
|
+
function rt(o) {
|
|
1005
1001
|
if (!Number.isSafeInteger(o) || o < 0 || o > 4294967295)
|
|
1006
1002
|
throw new Error("wrong u32 integer:" + o);
|
|
1007
1003
|
return o;
|
|
1008
1004
|
}
|
|
1009
1005
|
function jt(o) {
|
|
1010
|
-
return
|
|
1006
|
+
return rt(o), (o & o - 1) === 0 && o !== 0;
|
|
1011
1007
|
}
|
|
1012
1008
|
function Dt(o, e) {
|
|
1013
|
-
|
|
1009
|
+
rt(o);
|
|
1014
1010
|
let t = 0;
|
|
1015
1011
|
for (let n = 0; n < e; n++, o >>>= 1)
|
|
1016
1012
|
t = t << 1 | o & 1;
|
|
1017
1013
|
return t;
|
|
1018
1014
|
}
|
|
1019
1015
|
function Vt(o) {
|
|
1020
|
-
return
|
|
1016
|
+
return rt(o), 31 - Math.clz32(o);
|
|
1021
1017
|
}
|
|
1022
|
-
function
|
|
1018
|
+
function pt(o) {
|
|
1023
1019
|
const e = o.length;
|
|
1024
1020
|
if (e < 2 || !jt(e))
|
|
1025
1021
|
throw new Error("n must be a power of 2 and greater than 1. Got " + e);
|
|
@@ -1033,7 +1029,7 @@ function mt(o) {
|
|
|
1033
1029
|
}
|
|
1034
1030
|
return o;
|
|
1035
1031
|
}
|
|
1036
|
-
const
|
|
1032
|
+
const ft = (o, e) => {
|
|
1037
1033
|
const { N: t, roots: n, dit: s, invertButterflies: r = !1, skipStages: i = 0, brp: a = !0 } = e, c = Vt(t);
|
|
1038
1034
|
if (!jt(t))
|
|
1039
1035
|
throw new Error("FFT: Polynomial size should be power of two");
|
|
@@ -1041,23 +1037,22 @@ const yt = (o, e) => {
|
|
|
1041
1037
|
return (l) => {
|
|
1042
1038
|
if (l.length !== t)
|
|
1043
1039
|
throw new Error("FFT: wrong Polynomial length");
|
|
1044
|
-
s && a &&
|
|
1040
|
+
s && a && pt(l);
|
|
1045
1041
|
for (let h = 0, p = 1; h < c - i; h++) {
|
|
1046
1042
|
const d = s ? h + 1 + i : c - h, b = 1 << d, A = b >> 1, O = t >> d;
|
|
1047
1043
|
for (let f = 0; f < t; f += b)
|
|
1048
1044
|
for (let m = 0, w = p++; m < A; m++) {
|
|
1049
|
-
const
|
|
1045
|
+
const T = r ? s ? t - w : w : m * O, k = f + m, $ = f + m + A, v = n[T], I = l[$], _ = l[k];
|
|
1050
1046
|
if (u) {
|
|
1051
1047
|
const U = o.mul(I, v);
|
|
1052
1048
|
l[k] = o.add(_, U), l[$] = o.sub(_, U);
|
|
1053
1049
|
} else r ? (l[k] = o.add(I, _), l[$] = o.mul(o.sub(I, _), v)) : (l[k] = o.add(_, I), l[$] = o.mul(o.sub(_, I), v));
|
|
1054
1050
|
}
|
|
1055
1051
|
}
|
|
1056
|
-
return !s && a &&
|
|
1052
|
+
return !s && a && pt(l), l;
|
|
1057
1053
|
};
|
|
1058
1054
|
};
|
|
1059
|
-
|
|
1060
|
-
const gt = On;
|
|
1055
|
+
const mt = Cn;
|
|
1061
1056
|
function Je(o, e) {
|
|
1062
1057
|
if (o.length !== e.length)
|
|
1063
1058
|
return !1;
|
|
@@ -1066,10 +1061,10 @@ function Je(o, e) {
|
|
|
1066
1061
|
t |= o[n] ^ e[n];
|
|
1067
1062
|
return t === 0;
|
|
1068
1063
|
}
|
|
1069
|
-
function
|
|
1064
|
+
function Ln(o) {
|
|
1070
1065
|
return Uint8Array.from(o);
|
|
1071
1066
|
}
|
|
1072
|
-
function
|
|
1067
|
+
function qe(o, ...e) {
|
|
1073
1068
|
const t = (s) => typeof s == "number" ? s : s.bytesLen, n = e.reduce((s, r) => s + t(r), 0);
|
|
1074
1069
|
return {
|
|
1075
1070
|
bytesLen: n,
|
|
@@ -1077,12 +1072,12 @@ function Ue(o, ...e) {
|
|
|
1077
1072
|
const r = new Uint8Array(n);
|
|
1078
1073
|
for (let i = 0, a = 0; i < e.length; i++) {
|
|
1079
1074
|
const c = e[i], u = t(c), l = typeof c == "number" ? s[i] : c.encode(s[i]);
|
|
1080
|
-
|
|
1075
|
+
j(l, u, o), r.set(l, a), typeof c != "number" && l.fill(0), a += u;
|
|
1081
1076
|
}
|
|
1082
1077
|
return r;
|
|
1083
1078
|
},
|
|
1084
1079
|
decode: (s) => {
|
|
1085
|
-
|
|
1080
|
+
j(s, n, o);
|
|
1086
1081
|
const r = [];
|
|
1087
1082
|
for (const i of e) {
|
|
1088
1083
|
const a = t(i), c = s.subarray(0, a);
|
|
@@ -1107,7 +1102,7 @@ function Ge(o, e) {
|
|
|
1107
1102
|
return s;
|
|
1108
1103
|
},
|
|
1109
1104
|
decode: (n) => {
|
|
1110
|
-
|
|
1105
|
+
j(n, t);
|
|
1111
1106
|
const s = [];
|
|
1112
1107
|
for (let r = 0; r < n.length; r += o.bytesLen)
|
|
1113
1108
|
s.push(o.decode(n.subarray(r, r + o.bytesLen)));
|
|
@@ -1123,11 +1118,10 @@ function G(...o) {
|
|
|
1123
1118
|
else
|
|
1124
1119
|
e.fill(0);
|
|
1125
1120
|
}
|
|
1126
|
-
function
|
|
1121
|
+
function yt(o) {
|
|
1127
1122
|
return (1 << o) - 1;
|
|
1128
1123
|
}
|
|
1129
|
-
|
|
1130
|
-
const jn = (o) => {
|
|
1124
|
+
const Fn = (o) => {
|
|
1131
1125
|
const { newPoly: e, N: t, Q: n, F: s, ROOT_OF_UNITY: r, brvBits: i } = o, a = (f, m = n) => {
|
|
1132
1126
|
const w = f % m | 0;
|
|
1133
1127
|
return (w >= 0 ? w | 0 : m + w | 0) | 0;
|
|
@@ -1138,8 +1132,8 @@ const jn = (o) => {
|
|
|
1138
1132
|
function u() {
|
|
1139
1133
|
const f = e(t);
|
|
1140
1134
|
for (let m = 0; m < t; m++) {
|
|
1141
|
-
const w = Dt(m, i),
|
|
1142
|
-
f[m] = Number(
|
|
1135
|
+
const w = Dt(m, i), T = BigInt(r) ** BigInt(w) % BigInt(n);
|
|
1136
|
+
f[m] = Number(T) | 0;
|
|
1143
1137
|
}
|
|
1144
1138
|
return f;
|
|
1145
1139
|
}
|
|
@@ -1156,7 +1150,7 @@ const jn = (o) => {
|
|
|
1156
1150
|
invertButterflies: !0,
|
|
1157
1151
|
skipStages: 1,
|
|
1158
1152
|
brp: !1
|
|
1159
|
-
}, d =
|
|
1153
|
+
}, d = ft(h, { dit: !1, ...p }), b = ft(h, { dit: !0, ...p });
|
|
1160
1154
|
return { mod: a, smod: c, nttZetas: l, NTT: {
|
|
1161
1155
|
encode: (f) => d(f),
|
|
1162
1156
|
decode: (f) => {
|
|
@@ -1166,14 +1160,14 @@ const jn = (o) => {
|
|
|
1166
1160
|
return f;
|
|
1167
1161
|
}
|
|
1168
1162
|
}, bitsCoder: (f, m) => {
|
|
1169
|
-
const w =
|
|
1163
|
+
const w = yt(f), T = f * (t / 8);
|
|
1170
1164
|
return {
|
|
1171
|
-
bytesLen:
|
|
1165
|
+
bytesLen: T,
|
|
1172
1166
|
encode: (k) => {
|
|
1173
|
-
const $ = new Uint8Array(
|
|
1167
|
+
const $ = new Uint8Array(T);
|
|
1174
1168
|
for (let v = 0, I = 0, _ = 0, U = 0; v < k.length; v++)
|
|
1175
1169
|
for (I |= (m.encode(k[v]) & w) << _, _ += f; _ >= 8; _ -= 8, I >>= 8)
|
|
1176
|
-
$[U++] = I &
|
|
1170
|
+
$[U++] = I & yt(_);
|
|
1177
1171
|
return $;
|
|
1178
1172
|
},
|
|
1179
1173
|
decode: (k) => {
|
|
@@ -1185,7 +1179,7 @@ const jn = (o) => {
|
|
|
1185
1179
|
}
|
|
1186
1180
|
};
|
|
1187
1181
|
} };
|
|
1188
|
-
},
|
|
1182
|
+
}, Qn = (o) => (e, t) => {
|
|
1189
1183
|
t || (t = o.blockLen);
|
|
1190
1184
|
const n = new Uint8Array(e.length + 2);
|
|
1191
1185
|
n.set(e);
|
|
@@ -1198,76 +1192,75 @@ const jn = (o) => {
|
|
|
1198
1192
|
i.destroy(), G(r, n);
|
|
1199
1193
|
}
|
|
1200
1194
|
};
|
|
1201
|
-
},
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
ROOT_OF_UNITY: Jn,
|
|
1195
|
+
}, jn = /* @__PURE__ */ Qn(Nn);
|
|
1196
|
+
const L = 256, ae = 3329, Dn = 3303, Vn = 17, { mod: Se, nttZetas: zn, NTT: te, bitsCoder: Jn } = Fn({
|
|
1197
|
+
N: L,
|
|
1198
|
+
Q: ae,
|
|
1199
|
+
F: Dn,
|
|
1200
|
+
ROOT_OF_UNITY: Vn,
|
|
1208
1201
|
newPoly: (o) => new Uint16Array(o),
|
|
1209
1202
|
brvBits: 7
|
|
1210
|
-
}),
|
|
1211
|
-
768: { N:
|
|
1212
|
-
},
|
|
1203
|
+
}), Gn = {
|
|
1204
|
+
768: { N: L, Q: ae, K: 3, ETA1: 2, ETA2: 2, du: 10, dv: 4, RBGstrength: 192 }
|
|
1205
|
+
}, Xn = (o) => {
|
|
1213
1206
|
if (o >= 12)
|
|
1214
1207
|
return { encode: (t) => t, decode: (t) => t };
|
|
1215
1208
|
const e = 2 ** (o - 1);
|
|
1216
1209
|
return {
|
|
1217
1210
|
// const compress = (i: number) => round((2 ** d / Q) * i) % 2 ** d;
|
|
1218
|
-
encode: (t) => ((t << o) +
|
|
1211
|
+
encode: (t) => ((t << o) + ae / 2) / ae,
|
|
1219
1212
|
// const decompress = (i: number) => round((Q / 2 ** d) * i);
|
|
1220
|
-
decode: (t) => t *
|
|
1213
|
+
decode: (t) => t * ae + e >>> o
|
|
1221
1214
|
};
|
|
1222
|
-
},
|
|
1223
|
-
function
|
|
1224
|
-
for (let t = 0; t <
|
|
1225
|
-
o[t] =
|
|
1215
|
+
}, ye = (o) => Jn(o, Xn(o));
|
|
1216
|
+
function ne(o, e) {
|
|
1217
|
+
for (let t = 0; t < L; t++)
|
|
1218
|
+
o[t] = Se(o[t] + e[t]);
|
|
1226
1219
|
}
|
|
1227
|
-
function
|
|
1228
|
-
for (let t = 0; t <
|
|
1229
|
-
o[t] =
|
|
1220
|
+
function Zn(o, e) {
|
|
1221
|
+
for (let t = 0; t < L; t++)
|
|
1222
|
+
o[t] = Se(o[t] - e[t]);
|
|
1230
1223
|
}
|
|
1231
|
-
function
|
|
1232
|
-
const r =
|
|
1224
|
+
function Yn(o, e, t, n, s) {
|
|
1225
|
+
const r = Se(e * n * s + o * t), i = Se(o * n + e * t);
|
|
1233
1226
|
return { c0: r, c1: i };
|
|
1234
1227
|
}
|
|
1235
|
-
function
|
|
1236
|
-
for (let t = 0; t <
|
|
1237
|
-
let n =
|
|
1228
|
+
function Ce(o, e) {
|
|
1229
|
+
for (let t = 0; t < L / 2; t++) {
|
|
1230
|
+
let n = zn[64 + (t >> 1)];
|
|
1238
1231
|
t & 1 && (n = -n);
|
|
1239
|
-
const { c0: s, c1: r } =
|
|
1232
|
+
const { c0: s, c1: r } = Yn(o[2 * t + 0], o[2 * t + 1], e[2 * t + 0], e[2 * t + 1], n);
|
|
1240
1233
|
o[2 * t + 0] = s, o[2 * t + 1] = r;
|
|
1241
1234
|
}
|
|
1242
1235
|
return o;
|
|
1243
1236
|
}
|
|
1244
|
-
function
|
|
1245
|
-
const e = new Uint16Array(
|
|
1246
|
-
for (let t = 0; t <
|
|
1237
|
+
function gt(o) {
|
|
1238
|
+
const e = new Uint16Array(L);
|
|
1239
|
+
for (let t = 0; t < L; ) {
|
|
1247
1240
|
const n = o();
|
|
1248
1241
|
if (n.length % 3)
|
|
1249
1242
|
throw new Error("SampleNTT: unaligned block");
|
|
1250
|
-
for (let s = 0; t <
|
|
1243
|
+
for (let s = 0; t < L && s + 3 <= n.length; s += 3) {
|
|
1251
1244
|
const r = (n[s + 0] >> 0 | n[s + 1] << 8) & 4095, i = (n[s + 1] >> 4 | n[s + 2] << 4) & 4095;
|
|
1252
|
-
r <
|
|
1245
|
+
r < ae && (e[t++] = r), t < L && i < ae && (e[t++] = i);
|
|
1253
1246
|
}
|
|
1254
1247
|
}
|
|
1255
1248
|
return e;
|
|
1256
1249
|
}
|
|
1257
|
-
function
|
|
1258
|
-
const s = o(n *
|
|
1250
|
+
function ge(o, e, t, n) {
|
|
1251
|
+
const s = o(n * L / 4, e, t), r = new Uint16Array(L), i = Wt(s);
|
|
1259
1252
|
let a = 0;
|
|
1260
1253
|
for (let c = 0, u = 0, l = 0, h = 0; c < i.length; c++) {
|
|
1261
1254
|
let p = i[c];
|
|
1262
1255
|
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++] =
|
|
1256
|
+
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
1257
|
}
|
|
1265
1258
|
if (a)
|
|
1266
1259
|
throw new Error(`sampleCBD: leftover bits: ${a}`);
|
|
1267
1260
|
return r;
|
|
1268
1261
|
}
|
|
1269
|
-
const
|
|
1270
|
-
const { K: e, PRF: t, XOF: n, HASH512: s, ETA1: r, ETA2: i, du: a, dv: c } = o, u =
|
|
1262
|
+
const es = (o) => {
|
|
1263
|
+
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
1264
|
return {
|
|
1272
1265
|
secretCoder: d,
|
|
1273
1266
|
lengths: {
|
|
@@ -1276,18 +1269,18 @@ const ns = (o) => {
|
|
|
1276
1269
|
cipherText: b.bytesLen
|
|
1277
1270
|
},
|
|
1278
1271
|
keygen: (O) => {
|
|
1279
|
-
|
|
1272
|
+
j(O, 32, "seed");
|
|
1280
1273
|
const f = new Uint8Array(33);
|
|
1281
1274
|
f.set(O), f[32] = e;
|
|
1282
|
-
const m = s(f), [w,
|
|
1275
|
+
const m = s(f), [w, T] = A.decode(m), k = [], $ = [];
|
|
1283
1276
|
for (let _ = 0; _ < e; _++)
|
|
1284
|
-
k.push(
|
|
1277
|
+
k.push(te.encode(ge(t, T, _, r)));
|
|
1285
1278
|
const v = n(w);
|
|
1286
1279
|
for (let _ = 0; _ < e; _++) {
|
|
1287
|
-
const U =
|
|
1280
|
+
const U = te.encode(ge(t, T, e + _, r));
|
|
1288
1281
|
for (let R = 0; R < e; R++) {
|
|
1289
|
-
const ce =
|
|
1290
|
-
|
|
1282
|
+
const ce = gt(v.get(R, _));
|
|
1283
|
+
ne(U, Ce(ce, k[R]));
|
|
1291
1284
|
}
|
|
1292
1285
|
$.push(U);
|
|
1293
1286
|
}
|
|
@@ -1296,37 +1289,37 @@ const ns = (o) => {
|
|
|
1296
1289
|
publicKey: p.encode([$, w]),
|
|
1297
1290
|
secretKey: d.encode(k)
|
|
1298
1291
|
};
|
|
1299
|
-
return G(w,
|
|
1292
|
+
return G(w, T, k, $, f, m), I;
|
|
1300
1293
|
},
|
|
1301
1294
|
encrypt: (O, f, m) => {
|
|
1302
|
-
const [w,
|
|
1295
|
+
const [w, T] = p.decode(O), k = [];
|
|
1303
1296
|
for (let R = 0; R < e; R++)
|
|
1304
|
-
k.push(
|
|
1305
|
-
const $ = n(
|
|
1297
|
+
k.push(te.encode(ge(t, m, R, r)));
|
|
1298
|
+
const $ = n(T), v = new Uint16Array(L), I = [];
|
|
1306
1299
|
for (let R = 0; R < e; R++) {
|
|
1307
|
-
const ce =
|
|
1300
|
+
const ce = ge(t, m, e + R, i), je = new Uint16Array(L);
|
|
1308
1301
|
for (let Me = 0; Me < e; Me++) {
|
|
1309
|
-
const Yt =
|
|
1310
|
-
|
|
1302
|
+
const Yt = gt($.get(R, Me));
|
|
1303
|
+
ne(je, Ce(Yt, k[Me]));
|
|
1311
1304
|
}
|
|
1312
|
-
|
|
1305
|
+
ne(ce, te.decode(je)), I.push(ce), ne(v, Ce(w[R], k[R])), G(je);
|
|
1313
1306
|
}
|
|
1314
1307
|
$.clean();
|
|
1315
|
-
const _ =
|
|
1316
|
-
|
|
1308
|
+
const _ = ge(t, m, 2 * e, i);
|
|
1309
|
+
ne(_, te.decode(v));
|
|
1317
1310
|
const U = u.decode(f);
|
|
1318
|
-
return
|
|
1311
|
+
return ne(U, _), G(w, k, v, _), b.encode([I, U]);
|
|
1319
1312
|
},
|
|
1320
1313
|
decrypt: (O, f) => {
|
|
1321
|
-
const [m, w] = b.decode(O),
|
|
1314
|
+
const [m, w] = b.decode(O), T = d.decode(f), k = new Uint16Array(L);
|
|
1322
1315
|
for (let $ = 0; $ < e; $++)
|
|
1323
|
-
|
|
1324
|
-
return
|
|
1316
|
+
ne(k, Ce(T[$], te.encode(m[$])));
|
|
1317
|
+
return Zn(w, te.decode(k)), G(k, T, m), u.encode(w);
|
|
1325
1318
|
}
|
|
1326
1319
|
};
|
|
1327
1320
|
};
|
|
1328
|
-
function
|
|
1329
|
-
const e =
|
|
1321
|
+
function ts(o) {
|
|
1322
|
+
const e = es(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
1323
|
return {
|
|
1331
1324
|
info: { type: "ml-kem" },
|
|
1332
1325
|
lengths: {
|
|
@@ -1336,8 +1329,8 @@ function ss(o) {
|
|
|
1336
1329
|
msgRand: c,
|
|
1337
1330
|
secretKey: a.bytesLen
|
|
1338
1331
|
},
|
|
1339
|
-
keygen: (l =
|
|
1340
|
-
|
|
1332
|
+
keygen: (l = mt(u)) => {
|
|
1333
|
+
j(l, u, "seed");
|
|
1341
1334
|
const { publicKey: h, secretKey: p } = e.keygen(l.subarray(0, 32)), d = t(h), b = a.encode([p, h, d, l.subarray(32)]);
|
|
1342
1335
|
return G(p, d), { publicKey: h, secretKey: b };
|
|
1343
1336
|
},
|
|
@@ -1345,9 +1338,9 @@ function ss(o) {
|
|
|
1345
1338
|
const [h, p] = a.decode(l);
|
|
1346
1339
|
return Uint8Array.from(p);
|
|
1347
1340
|
},
|
|
1348
|
-
encapsulate: (l, h =
|
|
1349
|
-
|
|
1350
|
-
const p = l.subarray(0, 384 * o.K), d = r.encode(r.decode(
|
|
1341
|
+
encapsulate: (l, h = mt(c)) => {
|
|
1342
|
+
j(l, i.publicKey, "publicKey"), j(h, c, "message");
|
|
1343
|
+
const p = l.subarray(0, 384 * o.K), d = r.encode(r.decode(Ln(p)));
|
|
1351
1344
|
if (!Je(d, p))
|
|
1352
1345
|
throw G(d), new Error("ML-KEM.encapsulate: wrong publicKey modulus");
|
|
1353
1346
|
G(d);
|
|
@@ -1355,27 +1348,27 @@ function ss(o) {
|
|
|
1355
1348
|
return G(b.subarray(32)), { cipherText: A, sharedSecret: b.subarray(0, 32) };
|
|
1356
1349
|
},
|
|
1357
1350
|
decapsulate: (l, h) => {
|
|
1358
|
-
|
|
1351
|
+
j(h, a.bytesLen, "secretKey"), j(l, i.cipherText, "cipherText");
|
|
1359
1352
|
const p = a.bytesLen - 96, d = p + 32, b = t(h.subarray(p / 2, d));
|
|
1360
1353
|
if (!Je(b, h.subarray(d, d + 32)))
|
|
1361
1354
|
throw new Error("invalid secretKey: hash check failed");
|
|
1362
|
-
const [A, O, f, m] = a.decode(h), w = e.decrypt(l, A),
|
|
1355
|
+
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();
|
|
1363
1356
|
return G(w, $, v ? I : k), v ? k : I;
|
|
1364
1357
|
}
|
|
1365
1358
|
};
|
|
1366
1359
|
}
|
|
1367
|
-
function
|
|
1360
|
+
function ns(o, e, t) {
|
|
1368
1361
|
return Qt.create({ dkLen: o }).update(e).update(new Uint8Array([t])).digest();
|
|
1369
1362
|
}
|
|
1370
|
-
const
|
|
1371
|
-
HASH256:
|
|
1372
|
-
HASH512:
|
|
1363
|
+
const ss = {
|
|
1364
|
+
HASH256: Pn,
|
|
1365
|
+
HASH512: Kn,
|
|
1373
1366
|
KDF: Qt,
|
|
1374
|
-
XOF:
|
|
1375
|
-
PRF:
|
|
1376
|
-
}, Xe = /* @__PURE__ */
|
|
1377
|
-
...
|
|
1378
|
-
...
|
|
1367
|
+
XOF: jn,
|
|
1368
|
+
PRF: ns
|
|
1369
|
+
}, Xe = /* @__PURE__ */ ts({
|
|
1370
|
+
...ss,
|
|
1371
|
+
...Gn[768]
|
|
1379
1372
|
});
|
|
1380
1373
|
class S {
|
|
1381
1374
|
/**
|
|
@@ -1398,7 +1391,7 @@ class S {
|
|
|
1398
1391
|
batchId: i = null,
|
|
1399
1392
|
characters: a = null
|
|
1400
1393
|
}) {
|
|
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 ||
|
|
1394
|
+
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
1395
|
secret: e,
|
|
1403
1396
|
token: this.token,
|
|
1404
1397
|
position: this.position
|
|
@@ -1424,7 +1417,7 @@ class S {
|
|
|
1424
1417
|
let i = null;
|
|
1425
1418
|
if (!e && !t)
|
|
1426
1419
|
throw new ze();
|
|
1427
|
-
return e && !t && (i = S.generatePosition(), t =
|
|
1420
|
+
return e && !t && (i = S.generatePosition(), t = de(e, "Wallet::create")), new S({
|
|
1428
1421
|
secret: e,
|
|
1429
1422
|
bundle: t,
|
|
1430
1423
|
token: n,
|
|
@@ -1440,7 +1433,7 @@ class S {
|
|
|
1440
1433
|
* @return {boolean}
|
|
1441
1434
|
*/
|
|
1442
1435
|
static isBundleHash(e) {
|
|
1443
|
-
return typeof e != "string" ? !1 : e.length === 64 &&
|
|
1436
|
+
return typeof e != "string" ? !1 : e.length === 64 && De(e);
|
|
1444
1437
|
}
|
|
1445
1438
|
/**
|
|
1446
1439
|
* Get formatted token units from the raw data
|
|
@@ -1451,7 +1444,7 @@ class S {
|
|
|
1451
1444
|
static getTokenUnits(e) {
|
|
1452
1445
|
const t = [];
|
|
1453
1446
|
return e.forEach((n) => {
|
|
1454
|
-
t.push(
|
|
1447
|
+
t.push(pe.createFromDB(n));
|
|
1455
1448
|
}), t;
|
|
1456
1449
|
}
|
|
1457
1450
|
/**
|
|
@@ -1471,9 +1464,9 @@ class S {
|
|
|
1471
1464
|
throw new ze("Wallet::generateKey() - Secret is required!");
|
|
1472
1465
|
if (!n)
|
|
1473
1466
|
throw new ze("Wallet::generateKey() - Position is required!");
|
|
1474
|
-
const s =
|
|
1467
|
+
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
1468
|
c.update(a.toString(16)), t && c.update(t);
|
|
1476
|
-
const u = new
|
|
1469
|
+
const u = new F("SHAKE256", "TEXT");
|
|
1477
1470
|
return u.update(c.getHash("HEX", { outputLen: 8192 })), u.getHash("HEX", { outputLen: 8192 });
|
|
1478
1471
|
}
|
|
1479
1472
|
/**
|
|
@@ -1483,16 +1476,16 @@ class S {
|
|
|
1483
1476
|
* @return {string}
|
|
1484
1477
|
*/
|
|
1485
1478
|
static generateAddress(e) {
|
|
1486
|
-
const t =
|
|
1479
|
+
const t = Ue(e, 128), n = new F("SHAKE256", "TEXT");
|
|
1487
1480
|
for (const r in t) {
|
|
1488
1481
|
let i = t[r];
|
|
1489
1482
|
for (let a = 1; a <= 16; a++) {
|
|
1490
|
-
const c = new
|
|
1483
|
+
const c = new F("SHAKE256", "TEXT");
|
|
1491
1484
|
c.update(i), i = c.getHash("HEX", { outputLen: 512 });
|
|
1492
1485
|
}
|
|
1493
1486
|
n.update(i);
|
|
1494
1487
|
}
|
|
1495
|
-
const s = new
|
|
1488
|
+
const s = new F("SHAKE256", "TEXT");
|
|
1496
1489
|
return s.update(n.getHash("HEX", { outputLen: 8192 })), s.getHash("HEX", { outputLen: 256 });
|
|
1497
1490
|
}
|
|
1498
1491
|
/**
|
|
@@ -1501,13 +1494,13 @@ class S {
|
|
|
1501
1494
|
* @returns {string}
|
|
1502
1495
|
*/
|
|
1503
1496
|
static generatePosition(e = 64) {
|
|
1504
|
-
return
|
|
1497
|
+
return nt(e, "abcdef0123456789");
|
|
1505
1498
|
}
|
|
1506
1499
|
/**
|
|
1507
1500
|
* Initializes the ML-KEM key pair
|
|
1508
1501
|
*/
|
|
1509
1502
|
initializeMLKEM() {
|
|
1510
|
-
const e =
|
|
1503
|
+
const e = tt(this.key, 128), t = new Uint8Array(64);
|
|
1511
1504
|
for (let r = 0; r < 64; r++)
|
|
1512
1505
|
t[r] = parseInt(e.substr(r * 2, 2), 16);
|
|
1513
1506
|
const { publicKey: n, secretKey: s } = Xe.keygen(t);
|
|
@@ -1580,6 +1573,27 @@ class S {
|
|
|
1580
1573
|
e.includes(i.id) ? s.push(i) : r.push(i);
|
|
1581
1574
|
}), this.tokenUnits = s, n !== null && (n.tokenUnits = s), t.tokenUnits = r;
|
|
1582
1575
|
}
|
|
1576
|
+
/**
|
|
1577
|
+
* Split token units across MULTIPLE recipients (WP line 544).
|
|
1578
|
+
*
|
|
1579
|
+
* The source retains the SENT union (all units leaving), each recipient gets its own subset,
|
|
1580
|
+
* and the remainder gets the KEPT units (those not assigned to any recipient). Mirrors
|
|
1581
|
+
* splitUnits() but N-way: the source's tokenUnits become the union (not a single recipient's
|
|
1582
|
+
* subset) so the source atom carries the full SENT set the validator reads as the authority.
|
|
1583
|
+
*
|
|
1584
|
+
* @param {array[]} recipientUnitLists - array of unit-id arrays, parallel to recipientWallets
|
|
1585
|
+
* @param {Wallet[]} recipientWallets
|
|
1586
|
+
* @param {Wallet} remainderWallet
|
|
1587
|
+
*/
|
|
1588
|
+
splitUnitsMulti(e, t, n) {
|
|
1589
|
+
const s = /* @__PURE__ */ new Set();
|
|
1590
|
+
e.forEach((r) => {
|
|
1591
|
+
r.forEach((i) => s.add(i));
|
|
1592
|
+
}), s.size !== 0 && (t.forEach((r, i) => {
|
|
1593
|
+
const a = e[i];
|
|
1594
|
+
r.tokenUnits = this.tokenUnits.filter((c) => a.includes(c.id));
|
|
1595
|
+
}), n.tokenUnits = this.tokenUnits.filter((r) => !s.has(r.id)), this.tokenUnits = this.tokenUnits.filter((r) => s.has(r.id)));
|
|
1596
|
+
}
|
|
1583
1597
|
/**
|
|
1584
1598
|
* Create a remainder wallet from the source one
|
|
1585
1599
|
*
|
|
@@ -1612,42 +1626,82 @@ class S {
|
|
|
1612
1626
|
sourceWallet: e,
|
|
1613
1627
|
isRemainder: t = !1
|
|
1614
1628
|
}) {
|
|
1615
|
-
e.batchId && (this.batchId = t ? e.batchId :
|
|
1629
|
+
e.batchId && (this.batchId = t ? e.batchId : Be({}));
|
|
1616
1630
|
}
|
|
1617
1631
|
async encryptMessage(e, t) {
|
|
1618
|
-
const n = JSON.stringify(e), s = new TextEncoder().encode(n), r = this.deserializeKey(t),
|
|
1632
|
+
const n = JSON.stringify(e), s = new TextEncoder().encode(n), r = this.deserializeKey(t), i = 1184;
|
|
1633
|
+
if (r.length !== i)
|
|
1634
|
+
throw new Error(
|
|
1635
|
+
`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 }.`
|
|
1636
|
+
);
|
|
1637
|
+
const { cipherText: a, sharedSecret: c } = Xe.encapsulate(r), u = await this.encryptWithSharedSecret(s, c);
|
|
1619
1638
|
return {
|
|
1620
|
-
cipherText: this.serializeKey(
|
|
1621
|
-
encryptedMessage: this.serializeKey(
|
|
1639
|
+
cipherText: this.serializeKey(a),
|
|
1640
|
+
encryptedMessage: this.serializeKey(u)
|
|
1622
1641
|
};
|
|
1623
1642
|
}
|
|
1624
1643
|
async decryptMessage(e) {
|
|
1644
|
+
const t = await this._mlkemDecryptToString(e);
|
|
1645
|
+
return t === null ? null : JSON.parse(t);
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* ML-KEM768 decapsulate + AES-256-GCM decrypt → the RAW decrypted UTF-8 string
|
|
1649
|
+
* (no JSON.parse). Shared by {@link decryptMessage} (which JSON.parses the result)
|
|
1650
|
+
* and the PQ CipherHash transport ({@link decryptMyMessageML768}, which needs the raw
|
|
1651
|
+
* response JSON text). PQ-transport Phase E (cycle 163).
|
|
1652
|
+
*/
|
|
1653
|
+
async _mlkemDecryptToString(e) {
|
|
1625
1654
|
const { cipherText: t, encryptedMessage: n } = e;
|
|
1626
1655
|
let s;
|
|
1627
1656
|
try {
|
|
1628
1657
|
s = Xe.decapsulate(this.deserializeKey(t), this.privkey);
|
|
1629
|
-
} catch (
|
|
1630
|
-
return console.error("Wallet::decryptMessage() - Decapsulation failed",
|
|
1658
|
+
} catch (a) {
|
|
1659
|
+
return console.error("Wallet::decryptMessage() - Decapsulation failed", a), console.info("Wallet::decryptMessage() - my public key", this.pubkey), null;
|
|
1631
1660
|
}
|
|
1632
1661
|
let r;
|
|
1633
1662
|
try {
|
|
1634
1663
|
r = this.deserializeKey(n);
|
|
1635
|
-
} catch (
|
|
1636
|
-
return console.warn("Wallet::decryptMessage() - Deserialization failed",
|
|
1664
|
+
} catch (a) {
|
|
1665
|
+
return console.warn("Wallet::decryptMessage() - Deserialization failed", a), console.info("Wallet::decryptMessage() - my public key", this.pubkey), console.info("Wallet::decryptMessage() - our shared secret", s), null;
|
|
1637
1666
|
}
|
|
1638
1667
|
let i;
|
|
1639
1668
|
try {
|
|
1640
1669
|
i = await this.decryptWithSharedSecret(r, s);
|
|
1641
|
-
} catch (
|
|
1642
|
-
return console.warn("Wallet::decryptMessage() - Decryption failed",
|
|
1670
|
+
} catch (a) {
|
|
1671
|
+
return console.warn("Wallet::decryptMessage() - Decryption failed", a), console.info("Wallet::decryptMessage() - my public key", this.pubkey), console.info("Wallet::decryptMessage() - our shared secret", s), console.info("Wallet::decryptMessage() - deserialized encrypted message", r), null;
|
|
1643
1672
|
}
|
|
1644
|
-
let a;
|
|
1645
1673
|
try {
|
|
1646
|
-
|
|
1647
|
-
} catch (
|
|
1648
|
-
return console.warn("Wallet::decryptMessage() - Decoding failed",
|
|
1674
|
+
return new TextDecoder().decode(i);
|
|
1675
|
+
} catch (a) {
|
|
1676
|
+
return console.warn("Wallet::decryptMessage() - Decoding failed", a), console.info("Wallet::decryptMessage() - my public key", this.pubkey), console.info("Wallet::decryptMessage() - our shared secret", s), console.info("Wallet::decryptMessage() - deserialized encrypted message", r), console.info("Wallet::decryptMessage() - decrypted Uint8Array", i), null;
|
|
1649
1677
|
}
|
|
1650
|
-
|
|
1678
|
+
}
|
|
1679
|
+
/**
|
|
1680
|
+
* Multi-recipient map key for a public key: `Base64_standard(SHAKE256(pubkey_utf8, 8 bytes))`
|
|
1681
|
+
* — matches the validator's `hash_share` and the other SDKs' `hashShare`/`shortHash`.
|
|
1682
|
+
* `shake256(pubkey, 64)` = 64 bits = 8 bytes, hex; hex-decode → standard base64. PQ Phase E.
|
|
1683
|
+
*/
|
|
1684
|
+
hashShare(e) {
|
|
1685
|
+
const t = Ve(e, 64), n = Uint8Array.from(t.match(/.{2}/g).map((s) => parseInt(s, 16)));
|
|
1686
|
+
return this.serializeKey(n);
|
|
1687
|
+
}
|
|
1688
|
+
/**
|
|
1689
|
+
* Post-quantum (ML-KEM768) `CipherHash` request envelope: a stringified single-recipient
|
|
1690
|
+
* map `{ "<hashShare(recipientPubkey)>": {cipherText, encryptedMessage} }` (object-valued,
|
|
1691
|
+
* via {@link encryptMessage}). Matches the Rust validator's CipherHash handler. PQ Phase E.
|
|
1692
|
+
*/
|
|
1693
|
+
async encryptStringML768(e, t) {
|
|
1694
|
+
const n = await this.encryptMessage(e, t);
|
|
1695
|
+
return JSON.stringify({ [this.hashShare(t)]: n });
|
|
1696
|
+
}
|
|
1697
|
+
/**
|
|
1698
|
+
* Decrypt a `CipherHash` response map addressed to THIS wallet's ML-KEM pubkey
|
|
1699
|
+
* (`hashShare(this.pubkey)`) → the RAW decrypted GraphQL response JSON text (NOT JSON.parsed;
|
|
1700
|
+
* it replaces the HTTP response body for the normal parser). `null` if no entry / decrypt fails.
|
|
1701
|
+
*/
|
|
1702
|
+
async decryptMyMessageML768(e) {
|
|
1703
|
+
const t = e[this.hashShare(this.pubkey)];
|
|
1704
|
+
return t ? this._mlkemDecryptToString(t) : null;
|
|
1651
1705
|
}
|
|
1652
1706
|
async encryptWithSharedSecret(e, t) {
|
|
1653
1707
|
const n = crypto.getRandomValues(new Uint8Array(12)), s = { name: "AES-GCM", iv: n }, r = await crypto.subtle.importKey(
|
|
@@ -1684,7 +1738,7 @@ class S {
|
|
|
1684
1738
|
return new Uint8Array(i);
|
|
1685
1739
|
}
|
|
1686
1740
|
}
|
|
1687
|
-
class
|
|
1741
|
+
class be extends x {
|
|
1688
1742
|
/**
|
|
1689
1743
|
* Class constructor
|
|
1690
1744
|
*
|
|
@@ -1696,7 +1750,7 @@ class ke extends x {
|
|
|
1696
1750
|
super(e, t, n), this.name = "AtomIndexException";
|
|
1697
1751
|
}
|
|
1698
1752
|
}
|
|
1699
|
-
class
|
|
1753
|
+
class rs extends x {
|
|
1700
1754
|
/**
|
|
1701
1755
|
* Class constructor
|
|
1702
1756
|
*
|
|
@@ -1708,7 +1762,7 @@ class os extends x {
|
|
|
1708
1762
|
super(e, t, n), this.name = "MolecularHashMismatchException";
|
|
1709
1763
|
}
|
|
1710
1764
|
}
|
|
1711
|
-
class
|
|
1765
|
+
class is extends x {
|
|
1712
1766
|
/**
|
|
1713
1767
|
* Class constructor
|
|
1714
1768
|
*
|
|
@@ -1720,7 +1774,7 @@ class as extends x {
|
|
|
1720
1774
|
super(e, t, n), this.name = "MolecularHashMissingException";
|
|
1721
1775
|
}
|
|
1722
1776
|
}
|
|
1723
|
-
class
|
|
1777
|
+
class bt extends x {
|
|
1724
1778
|
/**
|
|
1725
1779
|
* Class constructor
|
|
1726
1780
|
*
|
|
@@ -1744,7 +1798,7 @@ class zt extends x {
|
|
|
1744
1798
|
super(e, t, n), this.name = "SignatureMalformedException";
|
|
1745
1799
|
}
|
|
1746
1800
|
}
|
|
1747
|
-
class
|
|
1801
|
+
class os extends x {
|
|
1748
1802
|
/**
|
|
1749
1803
|
* Class constructor
|
|
1750
1804
|
*
|
|
@@ -1756,7 +1810,7 @@ class ls extends x {
|
|
|
1756
1810
|
super(e, t, n), this.name = "SignatureMismatchException";
|
|
1757
1811
|
}
|
|
1758
1812
|
}
|
|
1759
|
-
class
|
|
1813
|
+
class J extends x {
|
|
1760
1814
|
/**
|
|
1761
1815
|
* Class constructor
|
|
1762
1816
|
*
|
|
@@ -1768,7 +1822,7 @@ class Y extends x {
|
|
|
1768
1822
|
super(e, t, n), this.name = "TransferBalanceException";
|
|
1769
1823
|
}
|
|
1770
1824
|
}
|
|
1771
|
-
class
|
|
1825
|
+
class we extends x {
|
|
1772
1826
|
/**
|
|
1773
1827
|
* Class constructor
|
|
1774
1828
|
*
|
|
@@ -1780,7 +1834,7 @@ class _e extends x {
|
|
|
1780
1834
|
super(e, t, n), this.name = "TransferMalformedException";
|
|
1781
1835
|
}
|
|
1782
1836
|
}
|
|
1783
|
-
class
|
|
1837
|
+
class wt extends x {
|
|
1784
1838
|
/**
|
|
1785
1839
|
* @param {string} message
|
|
1786
1840
|
* @param {string|null} fileName
|
|
@@ -1790,7 +1844,7 @@ class _t extends x {
|
|
|
1790
1844
|
super(e, t, n), this.name = "TransferMismatchedException";
|
|
1791
1845
|
}
|
|
1792
1846
|
}
|
|
1793
|
-
class
|
|
1847
|
+
class kt extends x {
|
|
1794
1848
|
/**
|
|
1795
1849
|
* Class constructor
|
|
1796
1850
|
*
|
|
@@ -1802,7 +1856,7 @@ class St extends x {
|
|
|
1802
1856
|
super(e, t, n), this.name = "TransferRemainderException";
|
|
1803
1857
|
}
|
|
1804
1858
|
}
|
|
1805
|
-
class
|
|
1859
|
+
class as extends x {
|
|
1806
1860
|
/**
|
|
1807
1861
|
* Class constructor
|
|
1808
1862
|
*
|
|
@@ -1814,7 +1868,7 @@ class cs extends x {
|
|
|
1814
1868
|
super(e, t, n), this.name = "TransferToSelfException";
|
|
1815
1869
|
}
|
|
1816
1870
|
}
|
|
1817
|
-
class
|
|
1871
|
+
class Ee extends x {
|
|
1818
1872
|
/**
|
|
1819
1873
|
* Class constructor
|
|
1820
1874
|
*
|
|
@@ -1838,7 +1892,7 @@ class H extends x {
|
|
|
1838
1892
|
super(e, t, n), this.name = "MetaMissingException";
|
|
1839
1893
|
}
|
|
1840
1894
|
}
|
|
1841
|
-
class
|
|
1895
|
+
class se extends x {
|
|
1842
1896
|
/**
|
|
1843
1897
|
* Class constructor
|
|
1844
1898
|
*
|
|
@@ -1850,7 +1904,7 @@ class re extends x {
|
|
|
1850
1904
|
super(e, t, n), this.name = "WrongTokenTypeException";
|
|
1851
1905
|
}
|
|
1852
1906
|
}
|
|
1853
|
-
class
|
|
1907
|
+
class We extends x {
|
|
1854
1908
|
/**
|
|
1855
1909
|
* @param {string|null} message
|
|
1856
1910
|
* @param {string|null} fileName
|
|
@@ -1860,7 +1914,7 @@ class Be extends x {
|
|
|
1860
1914
|
super(e, t, n), this.name = "BatchIdException";
|
|
1861
1915
|
}
|
|
1862
1916
|
}
|
|
1863
|
-
class
|
|
1917
|
+
class _t {
|
|
1864
1918
|
constructor(e = {}) {
|
|
1865
1919
|
for (const t in e)
|
|
1866
1920
|
this[`__${t}`] = e[t];
|
|
@@ -1879,7 +1933,7 @@ class $t {
|
|
|
1879
1933
|
return e;
|
|
1880
1934
|
}
|
|
1881
1935
|
}
|
|
1882
|
-
class
|
|
1936
|
+
class He extends x {
|
|
1883
1937
|
/**
|
|
1884
1938
|
* Class constructor
|
|
1885
1939
|
*
|
|
@@ -1891,7 +1945,7 @@ class Pe extends x {
|
|
|
1891
1945
|
super(e, t, n), this.name = "RuleArgumentException";
|
|
1892
1946
|
}
|
|
1893
1947
|
}
|
|
1894
|
-
class
|
|
1948
|
+
class Y extends x {
|
|
1895
1949
|
/**
|
|
1896
1950
|
* @param {string|null} message
|
|
1897
1951
|
* @param {string|null} fileName
|
|
@@ -1901,7 +1955,7 @@ class ee extends x {
|
|
|
1901
1955
|
super(e, t, n), this.name = "CodeException";
|
|
1902
1956
|
}
|
|
1903
1957
|
}
|
|
1904
|
-
class
|
|
1958
|
+
class _e {
|
|
1905
1959
|
/**
|
|
1906
1960
|
*
|
|
1907
1961
|
* @param {string} action
|
|
@@ -1924,7 +1978,7 @@ class Se {
|
|
|
1924
1978
|
comparison: c = null
|
|
1925
1979
|
}) {
|
|
1926
1980
|
if (s && (this.meta = s), !e)
|
|
1927
|
-
throw new
|
|
1981
|
+
throw new He('Callback structure violated, missing mandatory "action" parameter.');
|
|
1928
1982
|
this.__metaId = n, this.__metaType = t, this.__action = e, this.__address = r, this.__token = i, this.__amount = a, this.__comparison = c;
|
|
1929
1983
|
}
|
|
1930
1984
|
/**
|
|
@@ -1939,8 +1993,8 @@ class Se {
|
|
|
1939
1993
|
* @param {string} amount
|
|
1940
1994
|
*/
|
|
1941
1995
|
set amount(e) {
|
|
1942
|
-
if (!
|
|
1943
|
-
throw new
|
|
1996
|
+
if (!fn(e))
|
|
1997
|
+
throw new Y("Parameter amount should be a string containing numbers");
|
|
1944
1998
|
this.__amount = e;
|
|
1945
1999
|
}
|
|
1946
2000
|
/**
|
|
@@ -1962,7 +2016,7 @@ class Se {
|
|
|
1962
2016
|
* @param {Meta|object} meta
|
|
1963
2017
|
*/
|
|
1964
2018
|
set meta(e) {
|
|
1965
|
-
this.__meta = e instanceof
|
|
2019
|
+
this.__meta = e instanceof _t ? e : _t.toObject(e);
|
|
1966
2020
|
}
|
|
1967
2021
|
/**
|
|
1968
2022
|
*
|
|
@@ -1985,7 +2039,7 @@ class Se {
|
|
|
1985
2039
|
* @return Callback
|
|
1986
2040
|
*/
|
|
1987
2041
|
static toObject(e) {
|
|
1988
|
-
const t = new
|
|
2042
|
+
const t = new _e({
|
|
1989
2043
|
action: e.action
|
|
1990
2044
|
});
|
|
1991
2045
|
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;
|
|
@@ -2010,31 +2064,31 @@ class Se {
|
|
|
2010
2064
|
* @return {boolean}
|
|
2011
2065
|
*/
|
|
2012
2066
|
isMeta() {
|
|
2013
|
-
return
|
|
2067
|
+
return fe(Object.keys(this.toJSON()), ["action", "metaId", "metaType", "meta"]).length === 4 && this._is("meta");
|
|
2014
2068
|
}
|
|
2015
2069
|
/**
|
|
2016
2070
|
* @return {boolean}
|
|
2017
2071
|
*/
|
|
2018
2072
|
isCollect() {
|
|
2019
|
-
return
|
|
2073
|
+
return fe(Object.keys(this.toJSON()), ["action", "address", "token", "amount", "comparison"]).length === 5 && this._is("collect");
|
|
2020
2074
|
}
|
|
2021
2075
|
/**
|
|
2022
2076
|
* @return {boolean}
|
|
2023
2077
|
*/
|
|
2024
2078
|
isBuffer() {
|
|
2025
|
-
return
|
|
2079
|
+
return fe(Object.keys(this.toJSON()), ["action", "address", "token", "amount", "comparison"]).length === 5 && this._is("buffer");
|
|
2026
2080
|
}
|
|
2027
2081
|
/**
|
|
2028
2082
|
* @return {boolean}
|
|
2029
2083
|
*/
|
|
2030
2084
|
isRemit() {
|
|
2031
|
-
return
|
|
2085
|
+
return fe(Object.keys(this.toJSON()), ["action", "token", "amount"]).length === 3 && this._is("remit");
|
|
2032
2086
|
}
|
|
2033
2087
|
/**
|
|
2034
2088
|
* @return {boolean}
|
|
2035
2089
|
*/
|
|
2036
2090
|
isBurn() {
|
|
2037
|
-
return
|
|
2091
|
+
return fe(Object.keys(this.toJSON()), ["action", "token", "amount", "comparison"]).length === 4 && this._is("burn");
|
|
2038
2092
|
}
|
|
2039
2093
|
/**
|
|
2040
2094
|
* @param {string} type
|
|
@@ -2059,7 +2113,7 @@ class Ze {
|
|
|
2059
2113
|
comparison: n
|
|
2060
2114
|
}) {
|
|
2061
2115
|
if ([e, t, n].some((s) => !s))
|
|
2062
|
-
throw new
|
|
2116
|
+
throw new He("Condition::constructor( { key, value, comparison } ) - not all class parameters are initialised!");
|
|
2063
2117
|
this.__key = e, this.__value = t, this.__comparison = n;
|
|
2064
2118
|
}
|
|
2065
2119
|
/**
|
|
@@ -2084,7 +2138,7 @@ class Ze {
|
|
|
2084
2138
|
};
|
|
2085
2139
|
}
|
|
2086
2140
|
}
|
|
2087
|
-
class
|
|
2141
|
+
class $e {
|
|
2088
2142
|
/**
|
|
2089
2143
|
*
|
|
2090
2144
|
* @param {Condition[]} condition
|
|
@@ -2096,10 +2150,10 @@ class Ae {
|
|
|
2096
2150
|
}) {
|
|
2097
2151
|
for (const n of e)
|
|
2098
2152
|
if (!(n instanceof Ze))
|
|
2099
|
-
throw new
|
|
2153
|
+
throw new He();
|
|
2100
2154
|
for (const n of t)
|
|
2101
|
-
if (!(n instanceof
|
|
2102
|
-
throw new
|
|
2155
|
+
if (!(n instanceof _e))
|
|
2156
|
+
throw new He();
|
|
2103
2157
|
this.__condition = e, this.__callback = t;
|
|
2104
2158
|
}
|
|
2105
2159
|
/**
|
|
@@ -2113,7 +2167,7 @@ class Ae {
|
|
|
2113
2167
|
* @param {Callback[]|{}} callback
|
|
2114
2168
|
*/
|
|
2115
2169
|
set callback(e) {
|
|
2116
|
-
this.__callback.push(e instanceof
|
|
2170
|
+
this.__callback.push(e instanceof _e ? e : _e.toObject(e));
|
|
2117
2171
|
}
|
|
2118
2172
|
/**
|
|
2119
2173
|
*
|
|
@@ -2126,7 +2180,7 @@ class Ae {
|
|
|
2126
2180
|
throw new H("Rule::toObject() - Incorrect rule format! There is no condition field.");
|
|
2127
2181
|
if (!e.callback)
|
|
2128
2182
|
throw new H("Rule::toObject() - Incorrect rule format! There is no callback field.");
|
|
2129
|
-
const t = new
|
|
2183
|
+
const t = new $e({});
|
|
2130
2184
|
for (const n of e.condition)
|
|
2131
2185
|
t.comparison = n;
|
|
2132
2186
|
for (const n of e.callback)
|
|
@@ -2143,7 +2197,7 @@ class Ae {
|
|
|
2143
2197
|
};
|
|
2144
2198
|
}
|
|
2145
2199
|
}
|
|
2146
|
-
class
|
|
2200
|
+
class M {
|
|
2147
2201
|
/**
|
|
2148
2202
|
* Initialize the Dot utility with the given object and key path
|
|
2149
2203
|
* @param {object|array} obj - The object or array to traverse
|
|
@@ -2202,19 +2256,19 @@ class T {
|
|
|
2202
2256
|
return r[Number.isInteger(c) ? c : a] = n, e;
|
|
2203
2257
|
}
|
|
2204
2258
|
}
|
|
2205
|
-
class
|
|
2259
|
+
class Ae {
|
|
2206
2260
|
/**
|
|
2207
2261
|
*
|
|
2208
2262
|
* @param molecule
|
|
2209
2263
|
*/
|
|
2210
2264
|
constructor(e) {
|
|
2211
2265
|
if (e.molecularHash === null)
|
|
2212
|
-
throw new
|
|
2266
|
+
throw new is();
|
|
2213
2267
|
if (!e.atoms.length)
|
|
2214
|
-
throw new
|
|
2268
|
+
throw new oe();
|
|
2215
2269
|
for (const t of e.atoms)
|
|
2216
2270
|
if (t.index === null)
|
|
2217
|
-
throw new
|
|
2271
|
+
throw new be();
|
|
2218
2272
|
this.molecule = e;
|
|
2219
2273
|
}
|
|
2220
2274
|
/**
|
|
@@ -2231,7 +2285,7 @@ class ve {
|
|
|
2231
2285
|
*/
|
|
2232
2286
|
continuId() {
|
|
2233
2287
|
if (this.molecule.atoms[0].token === "USER" && this.molecule.getIsotopes("I").length < 1)
|
|
2234
|
-
throw new
|
|
2288
|
+
throw new oe("Check::continuId() - Molecule is missing required ContinuID Atom!");
|
|
2235
2289
|
return !0;
|
|
2236
2290
|
}
|
|
2237
2291
|
/**
|
|
@@ -2244,14 +2298,14 @@ class ve {
|
|
|
2244
2298
|
if (e.isotope === "V" && e.batchId !== null) {
|
|
2245
2299
|
const t = this.molecule.getIsotopes("V"), n = t[t.length - 1];
|
|
2246
2300
|
if (e.batchId !== n.batchId)
|
|
2247
|
-
throw new
|
|
2301
|
+
throw new We();
|
|
2248
2302
|
for (const s of t)
|
|
2249
2303
|
if (s.batchId === null)
|
|
2250
|
-
throw new
|
|
2304
|
+
throw new We();
|
|
2251
2305
|
}
|
|
2252
2306
|
return !0;
|
|
2253
2307
|
}
|
|
2254
|
-
throw new
|
|
2308
|
+
throw new We();
|
|
2255
2309
|
}
|
|
2256
2310
|
/**
|
|
2257
2311
|
*
|
|
@@ -2260,9 +2314,9 @@ class ve {
|
|
|
2260
2314
|
isotopeI() {
|
|
2261
2315
|
for (const e of this.molecule.getIsotopes("I")) {
|
|
2262
2316
|
if (e.token !== "USER")
|
|
2263
|
-
throw new
|
|
2317
|
+
throw new se(`Check::isotopeI() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2264
2318
|
if (e.index === 0)
|
|
2265
|
-
throw new
|
|
2319
|
+
throw new be(`Check::isotopeI() - Isotope "${e.isotope}" Atoms must have a non-zero index!`);
|
|
2266
2320
|
}
|
|
2267
2321
|
return !0;
|
|
2268
2322
|
}
|
|
@@ -2273,9 +2327,9 @@ class ve {
|
|
|
2273
2327
|
isotopeU() {
|
|
2274
2328
|
for (const e of this.molecule.getIsotopes("U")) {
|
|
2275
2329
|
if (e.token !== "AUTH")
|
|
2276
|
-
throw new
|
|
2330
|
+
throw new se(`Check::isotopeU() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2277
2331
|
if (e.index !== 0)
|
|
2278
|
-
throw new
|
|
2332
|
+
throw new be(`Check::isotopeU() - Isotope "${e.isotope}" Atoms must have an index equal to 0!`);
|
|
2279
2333
|
}
|
|
2280
2334
|
return !0;
|
|
2281
2335
|
}
|
|
@@ -2289,8 +2343,8 @@ class ve {
|
|
|
2289
2343
|
if (t.meta.length < 1)
|
|
2290
2344
|
throw new H();
|
|
2291
2345
|
if (t.token !== "USER")
|
|
2292
|
-
throw new
|
|
2293
|
-
const n =
|
|
2346
|
+
throw new se(`Check::isotopeM() - "${t.token}" is not a valid Token slug for "${t.isotope}" isotope Atoms!`);
|
|
2347
|
+
const n = he.aggregateMeta(t.meta);
|
|
2294
2348
|
for (const s of e) {
|
|
2295
2349
|
let r = n[s];
|
|
2296
2350
|
if (r) {
|
|
@@ -2298,10 +2352,10 @@ class ve {
|
|
|
2298
2352
|
for (const [i, a] of Object.entries(r))
|
|
2299
2353
|
if (!e.includes(i)) {
|
|
2300
2354
|
if (!Object.keys(n).includes(i))
|
|
2301
|
-
throw new
|
|
2355
|
+
throw new bt(`${i} is missing from the meta.`);
|
|
2302
2356
|
for (const c of a)
|
|
2303
2357
|
if (!S.isBundleHash(c) && !["all", "self"].includes(c))
|
|
2304
|
-
throw new
|
|
2358
|
+
throw new bt(`${c} does not correspond to the format of the policy.`);
|
|
2305
2359
|
}
|
|
2306
2360
|
}
|
|
2307
2361
|
}
|
|
@@ -2315,9 +2369,9 @@ class ve {
|
|
|
2315
2369
|
isotopeC() {
|
|
2316
2370
|
for (const e of this.molecule.getIsotopes("C")) {
|
|
2317
2371
|
if (e.token !== "USER")
|
|
2318
|
-
throw new
|
|
2372
|
+
throw new se(`Check::isotopeC() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2319
2373
|
if (e.index !== 0)
|
|
2320
|
-
throw new
|
|
2374
|
+
throw new be(`Check::isotopeC() - Isotope "${e.isotope}" Atoms must have an index equal to 0!`);
|
|
2321
2375
|
}
|
|
2322
2376
|
return !0;
|
|
2323
2377
|
}
|
|
@@ -2337,9 +2391,9 @@ class ve {
|
|
|
2337
2391
|
if (!Object.prototype.hasOwnProperty.call(t, s) || !t[s])
|
|
2338
2392
|
throw new H(`Check::isotopeT() - Required meta field "${s}" is missing!`);
|
|
2339
2393
|
if (e.token !== "USER")
|
|
2340
|
-
throw new
|
|
2394
|
+
throw new se(`Check::isotopeT() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2341
2395
|
if (e.index !== 0)
|
|
2342
|
-
throw new
|
|
2396
|
+
throw new be(`Check::isotopeT() - Isotope "${e.isotope}" Atoms must have an index equal to 0!`);
|
|
2343
2397
|
}
|
|
2344
2398
|
return !0;
|
|
2345
2399
|
}
|
|
@@ -2360,7 +2414,7 @@ class ve {
|
|
|
2360
2414
|
if (!Array.isArray(n))
|
|
2361
2415
|
throw new H("Check::isotopeR() - Incorrect rule format!");
|
|
2362
2416
|
for (const s of n)
|
|
2363
|
-
|
|
2417
|
+
$e.toObject(s);
|
|
2364
2418
|
if (n.length < 1)
|
|
2365
2419
|
throw new H("Check::isotopeR() - No rules!");
|
|
2366
2420
|
}
|
|
@@ -2375,7 +2429,7 @@ class ve {
|
|
|
2375
2429
|
isotopeP() {
|
|
2376
2430
|
for (const e of this.molecule.getIsotopes("P")) {
|
|
2377
2431
|
if (e.token !== "USER")
|
|
2378
|
-
throw new
|
|
2432
|
+
throw new se(`Check::isotopeP() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2379
2433
|
const t = e.aggregatedMeta();
|
|
2380
2434
|
if (!Object.prototype.hasOwnProperty.call(t, "peerHost") || !t.peerHost)
|
|
2381
2435
|
throw new H('Check::isotopeP() - Required meta field "peerHost" is missing!');
|
|
@@ -2390,7 +2444,7 @@ class ve {
|
|
|
2390
2444
|
isotopeA() {
|
|
2391
2445
|
for (const e of this.molecule.getIsotopes("A")) {
|
|
2392
2446
|
if (e.token !== "USER")
|
|
2393
|
-
throw new
|
|
2447
|
+
throw new se(`Check::isotopeA() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2394
2448
|
if (!e.metaType)
|
|
2395
2449
|
throw new H('Check::isotopeA() - Required field "metaType" is missing!');
|
|
2396
2450
|
if (!e.metaId)
|
|
@@ -2417,7 +2471,7 @@ class ve {
|
|
|
2417
2471
|
throw new H("Check::isotopeB() - B-isotope atoms must have a metaId!");
|
|
2418
2472
|
const s = Number(n.value);
|
|
2419
2473
|
if (Number.isNaN(s))
|
|
2420
|
-
throw new
|
|
2474
|
+
throw new we("Check::isotopeB() - B-isotope atom value is not a valid number!");
|
|
2421
2475
|
}
|
|
2422
2476
|
const t = this.molecule.getIsotopes("V");
|
|
2423
2477
|
if (t.length > 0) {
|
|
@@ -2427,7 +2481,7 @@ class ve {
|
|
|
2427
2481
|
Number.isNaN(r) || (n += r);
|
|
2428
2482
|
}
|
|
2429
2483
|
if (n !== 0)
|
|
2430
|
-
throw new
|
|
2484
|
+
throw new Ee("Check::isotopeB() - V+B atom values do not balance to zero!");
|
|
2431
2485
|
}
|
|
2432
2486
|
return !0;
|
|
2433
2487
|
}
|
|
@@ -2447,9 +2501,9 @@ class ve {
|
|
|
2447
2501
|
throw new H("Check::isotopeF() - F-isotope atoms must have a metaId!");
|
|
2448
2502
|
const s = Number(n.value);
|
|
2449
2503
|
if (Number.isNaN(s))
|
|
2450
|
-
throw new
|
|
2504
|
+
throw new we("Check::isotopeF() - F-isotope atom value is not a valid number!");
|
|
2451
2505
|
if (s < 0)
|
|
2452
|
-
throw new
|
|
2506
|
+
throw new we("Check::isotopeF() - F-isotope atom value must not be negative!");
|
|
2453
2507
|
}
|
|
2454
2508
|
const t = this.molecule.getIsotopes("V");
|
|
2455
2509
|
if (t.length > 0) {
|
|
@@ -2459,7 +2513,7 @@ class ve {
|
|
|
2459
2513
|
Number.isNaN(r) || (n += r);
|
|
2460
2514
|
}
|
|
2461
2515
|
if (n !== 0)
|
|
2462
|
-
throw new
|
|
2516
|
+
throw new Ee("Check::isotopeF() - V+F atom values do not balance to zero!");
|
|
2463
2517
|
}
|
|
2464
2518
|
return !0;
|
|
2465
2519
|
}
|
|
@@ -2476,11 +2530,11 @@ class ve {
|
|
|
2476
2530
|
if (!n && s.isotope === "V" && t.length === 2) {
|
|
2477
2531
|
const a = t[t.length - 1];
|
|
2478
2532
|
if (s.token !== a.token)
|
|
2479
|
-
throw new
|
|
2533
|
+
throw new wt();
|
|
2480
2534
|
if (a.value < 0)
|
|
2481
|
-
throw new
|
|
2535
|
+
throw new we();
|
|
2482
2536
|
if (Number(s.value) + Number(a.value) !== 0)
|
|
2483
|
-
throw new
|
|
2537
|
+
throw new Ee();
|
|
2484
2538
|
return !0;
|
|
2485
2539
|
}
|
|
2486
2540
|
let r = 0, i = 0;
|
|
@@ -2492,27 +2546,27 @@ class ve {
|
|
|
2492
2546
|
if (i = c.value * 1, Number.isNaN(i))
|
|
2493
2547
|
throw new TypeError('Invalid isotope "V" values');
|
|
2494
2548
|
if (c.token !== s.token)
|
|
2495
|
-
throw new
|
|
2549
|
+
throw new wt();
|
|
2496
2550
|
if (a > 0) {
|
|
2497
2551
|
if (i < 0)
|
|
2498
|
-
throw new
|
|
2552
|
+
throw new we();
|
|
2499
2553
|
if (c.walletAddress === s.walletAddress)
|
|
2500
|
-
throw new
|
|
2554
|
+
throw new as();
|
|
2501
2555
|
}
|
|
2502
2556
|
r += i;
|
|
2503
2557
|
}
|
|
2504
2558
|
if (!n && r !== 0)
|
|
2505
|
-
throw new
|
|
2559
|
+
throw new Ee();
|
|
2506
2560
|
if (e) {
|
|
2507
2561
|
if (i = s.value * 1, Number.isNaN(i))
|
|
2508
2562
|
throw new TypeError('Invalid isotope "V" values');
|
|
2509
2563
|
const a = Number(e.balance) + i;
|
|
2510
2564
|
if (a < 0)
|
|
2511
|
-
throw new
|
|
2565
|
+
throw new J();
|
|
2512
2566
|
if (!n && a !== r)
|
|
2513
|
-
throw new
|
|
2567
|
+
throw new kt();
|
|
2514
2568
|
} else if (i !== 0)
|
|
2515
|
-
throw new
|
|
2569
|
+
throw new kt();
|
|
2516
2570
|
return !0;
|
|
2517
2571
|
}
|
|
2518
2572
|
/**
|
|
@@ -2524,7 +2578,7 @@ class ve {
|
|
|
2524
2578
|
if (this.molecule.molecularHash !== g.hashAtoms({
|
|
2525
2579
|
atoms: this.molecule.atoms
|
|
2526
2580
|
}))
|
|
2527
|
-
throw new
|
|
2581
|
+
throw new rs();
|
|
2528
2582
|
return !0;
|
|
2529
2583
|
}
|
|
2530
2584
|
/**
|
|
@@ -2541,25 +2595,25 @@ class ve {
|
|
|
2541
2595
|
).reduce(
|
|
2542
2596
|
(p, d) => p + d
|
|
2543
2597
|
);
|
|
2544
|
-
if (t.length !== 2048 && (t =
|
|
2598
|
+
if (t.length !== 2048 && (t = pn(t), t.length !== 2048))
|
|
2545
2599
|
throw new zt();
|
|
2546
|
-
const n =
|
|
2600
|
+
const n = Ue(t, 128);
|
|
2547
2601
|
let s = "";
|
|
2548
2602
|
for (const p in n) {
|
|
2549
2603
|
let d = n[p];
|
|
2550
2604
|
for (let b = 0, A = 8 + e[p]; b < A; b++)
|
|
2551
|
-
d = new
|
|
2605
|
+
d = new F("SHAKE256", "TEXT").update(d).getHash("HEX", { outputLen: 512 });
|
|
2552
2606
|
s += d;
|
|
2553
2607
|
}
|
|
2554
|
-
const r = new
|
|
2608
|
+
const r = new F("SHAKE256", "TEXT");
|
|
2555
2609
|
r.update(s);
|
|
2556
|
-
const i = r.getHash("HEX", { outputLen: 8192 }), a = new
|
|
2610
|
+
const i = r.getHash("HEX", { outputLen: 8192 }), a = new F("SHAKE256", "TEXT");
|
|
2557
2611
|
a.update(i);
|
|
2558
2612
|
const c = a.getHash("HEX", { outputLen: 256 }), u = this.molecule.atoms[0];
|
|
2559
2613
|
let l = u.walletAddress;
|
|
2560
|
-
const h =
|
|
2561
|
-
if (h && (l =
|
|
2562
|
-
throw new
|
|
2614
|
+
const h = M.get(u.aggregatedMeta(), "signingWallet");
|
|
2615
|
+
if (h && (l = M.get(JSON.parse(h), "address")), c !== l)
|
|
2616
|
+
throw new os();
|
|
2563
2617
|
return !0;
|
|
2564
2618
|
}
|
|
2565
2619
|
/**
|
|
@@ -2612,7 +2666,7 @@ class ve {
|
|
|
2612
2666
|
createdAt: c.createdAt || null
|
|
2613
2667
|
};
|
|
2614
2668
|
});
|
|
2615
|
-
return
|
|
2669
|
+
return V.fromJSON({
|
|
2616
2670
|
molecularHash: e,
|
|
2617
2671
|
bundle: t,
|
|
2618
2672
|
cellSlug: n,
|
|
@@ -2630,8 +2684,8 @@ class ve {
|
|
|
2630
2684
|
*/
|
|
2631
2685
|
static verifyFromServerData(e) {
|
|
2632
2686
|
try {
|
|
2633
|
-
const t =
|
|
2634
|
-
return new
|
|
2687
|
+
const t = Ae.fromServerData(e);
|
|
2688
|
+
return new Ae(t).verify(), {
|
|
2635
2689
|
molecularHash: e.molecularHash,
|
|
2636
2690
|
verified: !0,
|
|
2637
2691
|
error: null
|
|
@@ -2657,7 +2711,7 @@ class ue extends x {
|
|
|
2657
2711
|
super(e, t, n), this.name = "BalanceInsufficientException";
|
|
2658
2712
|
}
|
|
2659
2713
|
}
|
|
2660
|
-
class
|
|
2714
|
+
class St extends x {
|
|
2661
2715
|
/**
|
|
2662
2716
|
* Class constructor
|
|
2663
2717
|
*
|
|
@@ -2669,7 +2723,7 @@ class Ye extends x {
|
|
|
2669
2723
|
super(e, t, n), this.name = "NegativeAmountException";
|
|
2670
2724
|
}
|
|
2671
2725
|
}
|
|
2672
|
-
class
|
|
2726
|
+
class V {
|
|
2673
2727
|
/**
|
|
2674
2728
|
* Class constructor
|
|
2675
2729
|
*
|
|
@@ -2689,7 +2743,7 @@ class z {
|
|
|
2689
2743
|
version: i = null,
|
|
2690
2744
|
continuIdPosition: a = null
|
|
2691
2745
|
}) {
|
|
2692
|
-
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(
|
|
2746
|
+
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({
|
|
2693
2747
|
secret: e,
|
|
2694
2748
|
bundle: t,
|
|
2695
2749
|
token: n.token,
|
|
@@ -2741,14 +2795,14 @@ class z {
|
|
|
2741
2795
|
* @throws {AtomsMissingException}
|
|
2742
2796
|
*/
|
|
2743
2797
|
static jsonToObject(e) {
|
|
2744
|
-
const t = Object.assign(new
|
|
2798
|
+
const t = Object.assign(new V({}), JSON.parse(e)), n = Object.keys(new V({}));
|
|
2745
2799
|
if (!Array.isArray(t.atoms))
|
|
2746
|
-
throw new
|
|
2800
|
+
throw new oe();
|
|
2747
2801
|
for (const s in Object.keys(t.atoms)) {
|
|
2748
2802
|
t.atoms[s] = g.jsonToObject(JSON.stringify(t.atoms[s]));
|
|
2749
2803
|
for (const r of ["position", "walletAddress", "isotope"])
|
|
2750
2804
|
if (t.atoms[s].isotope.toLowerCase() !== "r" && (typeof t.atoms[s][r] > "u" || t.atoms[s][r] === null))
|
|
2751
|
-
throw new
|
|
2805
|
+
throw new oe("MolecularStructure::jsonToObject() - Required Atom properties are missing!");
|
|
2752
2806
|
}
|
|
2753
2807
|
for (const s in t)
|
|
2754
2808
|
Object.prototype.hasOwnProperty.call(t, s) && !n.includes(s) && delete t[s];
|
|
@@ -2820,7 +2874,7 @@ class z {
|
|
|
2820
2874
|
* @returns {*[]}
|
|
2821
2875
|
*/
|
|
2822
2876
|
getIsotopes(e) {
|
|
2823
|
-
return
|
|
2877
|
+
return V.isotopeFilter(e, this.atoms);
|
|
2824
2878
|
}
|
|
2825
2879
|
/**
|
|
2826
2880
|
* Generates the next atomic index
|
|
@@ -2828,7 +2882,7 @@ class z {
|
|
|
2828
2882
|
* @return {number}
|
|
2829
2883
|
*/
|
|
2830
2884
|
generateIndex() {
|
|
2831
|
-
return
|
|
2885
|
+
return V.generateNextAtomIndex(this.atoms);
|
|
2832
2886
|
}
|
|
2833
2887
|
/**
|
|
2834
2888
|
* Fills a Molecule's properties with the provided object
|
|
@@ -2930,7 +2984,7 @@ class z {
|
|
|
2930
2984
|
walletBundle: t = null
|
|
2931
2985
|
}) {
|
|
2932
2986
|
if (e < 0)
|
|
2933
|
-
throw new
|
|
2987
|
+
throw new St("Molecule::burnToken() - Amount to burn must be positive!");
|
|
2934
2988
|
if (this.sourceWallet.balance - e < 0)
|
|
2935
2989
|
throw new ue();
|
|
2936
2990
|
const n = new S({
|
|
@@ -2968,7 +3022,7 @@ class z {
|
|
|
2968
3022
|
units: t = []
|
|
2969
3023
|
}) {
|
|
2970
3024
|
if (e < 0)
|
|
2971
|
-
throw new
|
|
3025
|
+
throw new St("Molecule::replenishToken() - Amount to replenish must be positive!");
|
|
2972
3026
|
if (t.length) {
|
|
2973
3027
|
t = S.getTokenUnits(t), this.remainderWallet.tokenUnits = this.sourceWallet.tokenUnits;
|
|
2974
3028
|
for (const n of t)
|
|
@@ -3021,42 +3075,45 @@ class z {
|
|
|
3021
3075
|
})), this;
|
|
3022
3076
|
}
|
|
3023
3077
|
/**
|
|
3024
|
-
*
|
|
3025
|
-
* source debit, recipient credit, remainder.
|
|
3026
|
-
* Propagates batchId from source wallet.
|
|
3078
|
+
* Multi-recipient value transfer (WP line 544: one molecule funds N recipients).
|
|
3027
3079
|
*
|
|
3028
|
-
*
|
|
3029
|
-
*
|
|
3080
|
+
* Builds 1 source atom (full-balance debit, carrying the SENT union of all units) + one atom
|
|
3081
|
+
* per recipient (its amount + its own units, walletBundle-bonded) + 1 remainder atom (the KEPT
|
|
3082
|
+
* change). Conservation: -balance + Σ amounts + (balance - Σ amounts) == 0.
|
|
3083
|
+
*
|
|
3084
|
+
* Per-unit (stackable) routing is layered by calling Wallet.splitUnitsMulti(...) BEFORE this —
|
|
3085
|
+
* it sets the source's tokenUnits to the union, each recipient's to its subset, and the
|
|
3086
|
+
* remainder's to the kept units. The single-recipient initValue() is the N=1 special case.
|
|
3087
|
+
*
|
|
3088
|
+
* @param {Wallet[]} recipientWallets
|
|
3089
|
+
* @param {number[]} amounts - parallel to recipientWallets
|
|
3030
3090
|
* @return {Molecule}
|
|
3031
3091
|
*/
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3092
|
+
initValues({
|
|
3093
|
+
recipientWallets: e,
|
|
3094
|
+
amounts: t
|
|
3035
3095
|
}) {
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
if (this.sourceWallet.balance - t < 0)
|
|
3096
|
+
const n = t.reduce((s, r) => s + Number(r), 0);
|
|
3097
|
+
if (this.sourceWallet.balance - n < 0)
|
|
3039
3098
|
throw new ue();
|
|
3040
|
-
const n = this.sourceWallet.batchId || he({});
|
|
3041
3099
|
return this.addAtom(g.create({
|
|
3042
3100
|
isotope: "V",
|
|
3043
3101
|
wallet: this.sourceWallet,
|
|
3044
|
-
value: -
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
})
|
|
3102
|
+
value: -this.sourceWallet.balance
|
|
3103
|
+
})), e.forEach((s, r) => {
|
|
3104
|
+
this.addAtom(g.create({
|
|
3105
|
+
isotope: "V",
|
|
3106
|
+
wallet: s,
|
|
3107
|
+
value: t[r],
|
|
3108
|
+
metaType: "walletBundle",
|
|
3109
|
+
metaId: s.bundle
|
|
3110
|
+
}));
|
|
3111
|
+
}), this.addAtom(g.create({
|
|
3054
3112
|
isotope: "V",
|
|
3055
3113
|
wallet: this.remainderWallet,
|
|
3056
|
-
value: this.sourceWallet.balance -
|
|
3114
|
+
value: this.sourceWallet.balance - n,
|
|
3057
3115
|
metaType: "walletBundle",
|
|
3058
|
-
metaId: this.remainderWallet.bundle
|
|
3059
|
-
batchId: n
|
|
3116
|
+
metaId: this.remainderWallet.bundle
|
|
3060
3117
|
})), this;
|
|
3061
3118
|
}
|
|
3062
3119
|
/**
|
|
@@ -3123,7 +3180,7 @@ class z {
|
|
|
3123
3180
|
isotope: "V",
|
|
3124
3181
|
token: this.sourceWallet.token,
|
|
3125
3182
|
value: i,
|
|
3126
|
-
batchId: this.sourceWallet.batchId ?
|
|
3183
|
+
batchId: this.sourceWallet.batchId ? Be({}) : null,
|
|
3127
3184
|
metaType: "walletBundle",
|
|
3128
3185
|
metaId: r
|
|
3129
3186
|
}));
|
|
@@ -3175,7 +3232,7 @@ class z {
|
|
|
3175
3232
|
}) {
|
|
3176
3233
|
const r = [];
|
|
3177
3234
|
for (const a of n)
|
|
3178
|
-
r.push(a instanceof
|
|
3235
|
+
r.push(a instanceof $e ? a : $e.toObject(a));
|
|
3179
3236
|
const i = new P({
|
|
3180
3237
|
rule: JSON.stringify(r)
|
|
3181
3238
|
});
|
|
@@ -3231,7 +3288,7 @@ class z {
|
|
|
3231
3288
|
}) {
|
|
3232
3289
|
const s = {
|
|
3233
3290
|
code: n,
|
|
3234
|
-
hash:
|
|
3291
|
+
hash: de(t.trim(), "Molecule::initIdentifierCreation")
|
|
3235
3292
|
};
|
|
3236
3293
|
return this.addAtom(g.create({
|
|
3237
3294
|
isotope: "C",
|
|
@@ -3369,29 +3426,29 @@ class z {
|
|
|
3369
3426
|
compressed: n = !0
|
|
3370
3427
|
}) {
|
|
3371
3428
|
if (this.atoms.length === 0 || this.atoms.filter((d) => !(d instanceof g)).length !== 0)
|
|
3372
|
-
throw new
|
|
3373
|
-
!t && !this.bundle && (this.bundle = e ||
|
|
3429
|
+
throw new oe();
|
|
3430
|
+
!t && !this.bundle && (this.bundle = e || de(this.secret, "Molecule::sign")), this.molecularHash = g.hashAtoms({
|
|
3374
3431
|
atoms: this.atoms
|
|
3375
3432
|
});
|
|
3376
3433
|
const s = this.atoms[0];
|
|
3377
3434
|
let r = s.position;
|
|
3378
|
-
const i =
|
|
3379
|
-
if (i && (r =
|
|
3435
|
+
const i = M.get(s.aggregatedMeta(), "signingWallet");
|
|
3436
|
+
if (i && (r = M.get(JSON.parse(i), "position")), !r)
|
|
3380
3437
|
throw new zt("Signing wallet must have a position!");
|
|
3381
3438
|
const a = S.generateKey({
|
|
3382
3439
|
secret: this.secret,
|
|
3383
3440
|
token: s.token,
|
|
3384
3441
|
position: s.position
|
|
3385
|
-
}), c =
|
|
3442
|
+
}), c = Ue(a, 128), u = this.normalizedHash();
|
|
3386
3443
|
let l = "";
|
|
3387
3444
|
for (const d in c) {
|
|
3388
3445
|
let b = c[d];
|
|
3389
3446
|
for (let A = 0, O = 8 - u[d]; A < O; A++)
|
|
3390
|
-
b = new
|
|
3447
|
+
b = new F("SHAKE256", "TEXT").update(b).getHash("HEX", { outputLen: 512 });
|
|
3391
3448
|
l += b;
|
|
3392
3449
|
}
|
|
3393
|
-
n && (l =
|
|
3394
|
-
const h =
|
|
3450
|
+
n && (l = dn(l));
|
|
3451
|
+
const h = Ue(l, Math.ceil(l.length / this.atoms.length));
|
|
3395
3452
|
let p = null;
|
|
3396
3453
|
for (let d = 0, b = h.length; d < b; d++)
|
|
3397
3454
|
this.atoms[d].otsFragment = h[d], p = this.atoms[d].position;
|
|
@@ -3499,7 +3556,7 @@ class z {
|
|
|
3499
3556
|
const r = typeof e == "string" ? JSON.parse(e) : e;
|
|
3500
3557
|
if (s && (!r.molecularHash || !Array.isArray(r.atoms)))
|
|
3501
3558
|
throw new Error("Invalid molecule data: missing molecularHash or atoms array");
|
|
3502
|
-
const i = new
|
|
3559
|
+
const i = new V({
|
|
3503
3560
|
secret: null,
|
|
3504
3561
|
bundle: r.bundle || null,
|
|
3505
3562
|
cellSlug: r.cellSlug || null,
|
|
@@ -3536,7 +3593,7 @@ class z {
|
|
|
3536
3593
|
* @param senderWallet
|
|
3537
3594
|
*/
|
|
3538
3595
|
check(e = null) {
|
|
3539
|
-
return new
|
|
3596
|
+
return new Ae(this).verify(e);
|
|
3540
3597
|
}
|
|
3541
3598
|
/**
|
|
3542
3599
|
* Convert Hm to numeric notation via EnumerateMolecule(Hm)
|
|
@@ -3544,10 +3601,10 @@ class z {
|
|
|
3544
3601
|
* @returns {Array}
|
|
3545
3602
|
*/
|
|
3546
3603
|
normalizedHash() {
|
|
3547
|
-
return
|
|
3604
|
+
return V.normalize(V.enumerate(this.molecularHash));
|
|
3548
3605
|
}
|
|
3549
3606
|
}
|
|
3550
|
-
class
|
|
3607
|
+
class ve {
|
|
3551
3608
|
/**
|
|
3552
3609
|
*
|
|
3553
3610
|
* @param {string} token
|
|
@@ -3570,7 +3627,7 @@ class xe {
|
|
|
3570
3627
|
* @returns {AuthToken}
|
|
3571
3628
|
*/
|
|
3572
3629
|
static create(e, t) {
|
|
3573
|
-
const n = new
|
|
3630
|
+
const n = new ve(e);
|
|
3574
3631
|
return n.setWallet(t), n;
|
|
3575
3632
|
}
|
|
3576
3633
|
/**
|
|
@@ -3586,7 +3643,7 @@ class xe {
|
|
|
3586
3643
|
position: e.wallet.position,
|
|
3587
3644
|
characters: e.wallet.characters
|
|
3588
3645
|
});
|
|
3589
|
-
return
|
|
3646
|
+
return ve.create({
|
|
3590
3647
|
token: e.token,
|
|
3591
3648
|
expiresAt: e.expiresAt,
|
|
3592
3649
|
pubkey: e.pubkey,
|
|
@@ -3663,14 +3720,14 @@ class xe {
|
|
|
3663
3720
|
};
|
|
3664
3721
|
}
|
|
3665
3722
|
}
|
|
3666
|
-
const
|
|
3667
|
-
class
|
|
3723
|
+
const Ye = 10 ** 18;
|
|
3724
|
+
class le {
|
|
3668
3725
|
/**
|
|
3669
3726
|
* @param {number} value
|
|
3670
3727
|
* @return {number}
|
|
3671
3728
|
*/
|
|
3672
3729
|
static val(e) {
|
|
3673
|
-
return Math.abs(e *
|
|
3730
|
+
return Math.abs(e * Ye) < 1 ? 0 : e;
|
|
3674
3731
|
}
|
|
3675
3732
|
/**
|
|
3676
3733
|
* @param {number} value1
|
|
@@ -3679,7 +3736,7 @@ class de {
|
|
|
3679
3736
|
* @return {number}
|
|
3680
3737
|
*/
|
|
3681
3738
|
static cmp(e, t, n = !1) {
|
|
3682
|
-
const s =
|
|
3739
|
+
const s = le.val(e) * Ye, r = le.val(t) * Ye;
|
|
3683
3740
|
return Math.abs(s - r) < 1 ? 0 : s > r ? 1 : -1;
|
|
3684
3741
|
}
|
|
3685
3742
|
/**
|
|
@@ -3688,10 +3745,10 @@ class de {
|
|
|
3688
3745
|
* @return {boolean}
|
|
3689
3746
|
*/
|
|
3690
3747
|
static equal(e, t) {
|
|
3691
|
-
return
|
|
3748
|
+
return le.cmp(e, t) === 0;
|
|
3692
3749
|
}
|
|
3693
3750
|
}
|
|
3694
|
-
class
|
|
3751
|
+
class ee extends x {
|
|
3695
3752
|
/**
|
|
3696
3753
|
* Class constructor
|
|
3697
3754
|
*
|
|
@@ -3703,7 +3760,7 @@ class te extends x {
|
|
|
3703
3760
|
super(e, t, n), this.name = "InvalidResponseException";
|
|
3704
3761
|
}
|
|
3705
3762
|
}
|
|
3706
|
-
class
|
|
3763
|
+
class Pe extends x {
|
|
3707
3764
|
/**
|
|
3708
3765
|
* Class constructor
|
|
3709
3766
|
*
|
|
@@ -3715,7 +3772,7 @@ class Ke extends x {
|
|
|
3715
3772
|
super(e, t, n), this.name = "UnauthenticatedException";
|
|
3716
3773
|
}
|
|
3717
3774
|
}
|
|
3718
|
-
|
|
3775
|
+
let C = class {
|
|
3719
3776
|
/**
|
|
3720
3777
|
* Class constructor
|
|
3721
3778
|
*
|
|
@@ -3729,14 +3786,14 @@ class C {
|
|
|
3729
3786
|
dataKey: n = null
|
|
3730
3787
|
}) {
|
|
3731
3788
|
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)
|
|
3732
|
-
throw new
|
|
3733
|
-
if (
|
|
3734
|
-
const s =
|
|
3735
|
-
throw String(s).includes("Unauthenticated") ? new
|
|
3789
|
+
throw new ee();
|
|
3790
|
+
if (M.has(this.$__response, this.errorKey)) {
|
|
3791
|
+
const s = M.get(this.$__response, this.errorKey);
|
|
3792
|
+
throw String(s).includes("Unauthenticated") ? new Pe() : new ee();
|
|
3736
3793
|
}
|
|
3737
3794
|
if (this.$__response.errors && Array.isArray(this.$__response.errors) && this.$__response.errors.length > 0) {
|
|
3738
3795
|
const s = this.$__response.errors[0].message || "Unknown GraphQL error";
|
|
3739
|
-
throw s.includes("Unauthenticated") ? new
|
|
3796
|
+
throw s.includes("Unauthenticated") ? new Pe() : new ee(`GraphQL Error: ${s}`);
|
|
3740
3797
|
}
|
|
3741
3798
|
this.init();
|
|
3742
3799
|
}
|
|
@@ -3752,10 +3809,10 @@ class C {
|
|
|
3752
3809
|
if (!this.dataKey)
|
|
3753
3810
|
return this.response();
|
|
3754
3811
|
if (!this.response().data)
|
|
3755
|
-
throw new
|
|
3756
|
-
if (!
|
|
3757
|
-
throw new
|
|
3758
|
-
return
|
|
3812
|
+
throw new ee("Response has no data field");
|
|
3813
|
+
if (!M.has(this.response(), this.dataKey))
|
|
3814
|
+
throw new ee(`Missing expected field: ${this.dataKey}`);
|
|
3815
|
+
return M.get(this.response(), this.dataKey);
|
|
3759
3816
|
}
|
|
3760
3817
|
/**
|
|
3761
3818
|
* @return {object}
|
|
@@ -3786,8 +3843,7 @@ class C {
|
|
|
3786
3843
|
* @return {boolean}
|
|
3787
3844
|
*/
|
|
3788
3845
|
success() {
|
|
3789
|
-
|
|
3790
|
-
return !((t = (e = this.$__response) == null ? void 0 : e.errors) != null && t.length);
|
|
3846
|
+
return !this.$__response?.errors?.length;
|
|
3791
3847
|
}
|
|
3792
3848
|
/**
|
|
3793
3849
|
* Get error message if any
|
|
@@ -3795,8 +3851,7 @@ class C {
|
|
|
3795
3851
|
* @return {string|null}
|
|
3796
3852
|
*/
|
|
3797
3853
|
error() {
|
|
3798
|
-
|
|
3799
|
-
return (t = (e = this.$__response) == null ? void 0 : e.errors) != null && t.length ? this.$__response.errors[0].message || "Unknown error" : null;
|
|
3854
|
+
return this.$__response?.errors?.length ? this.$__response.errors[0].message || "Unknown error" : null;
|
|
3800
3855
|
}
|
|
3801
3856
|
/**
|
|
3802
3857
|
* Enhanced interface methods for standardized response handling
|
|
@@ -3813,7 +3868,6 @@ class C {
|
|
|
3813
3868
|
* @return {object}
|
|
3814
3869
|
*/
|
|
3815
3870
|
toValidationResult() {
|
|
3816
|
-
var e;
|
|
3817
3871
|
return this.success() && this.payload() !== null ? {
|
|
3818
3872
|
success: !0,
|
|
3819
3873
|
data: this.payload(),
|
|
@@ -3823,7 +3877,7 @@ class C {
|
|
|
3823
3877
|
error: {
|
|
3824
3878
|
message: this.reason() || "Unknown error",
|
|
3825
3879
|
context: this.constructor.name,
|
|
3826
|
-
details:
|
|
3880
|
+
details: this.$__response?.errors || []
|
|
3827
3881
|
}
|
|
3828
3882
|
};
|
|
3829
3883
|
}
|
|
@@ -3861,15 +3915,14 @@ class C {
|
|
|
3861
3915
|
* @return {Response}
|
|
3862
3916
|
*/
|
|
3863
3917
|
debug(e = null) {
|
|
3864
|
-
var n, s, r;
|
|
3865
3918
|
const t = e ? `[${e}]` : `[${this.constructor.name}]`;
|
|
3866
3919
|
return this.success() ? console.debug(`${t} Success:`, {
|
|
3867
3920
|
payload: this.payload(),
|
|
3868
|
-
query:
|
|
3921
|
+
query: this.$__query?.constructor?.name,
|
|
3869
3922
|
dataKey: this.dataKey
|
|
3870
3923
|
}) : console.debug(`${t} Failure:`, {
|
|
3871
3924
|
error: this.reason(),
|
|
3872
|
-
errors:
|
|
3925
|
+
errors: this.$__response?.errors,
|
|
3873
3926
|
rawData: this.$__response
|
|
3874
3927
|
}), this;
|
|
3875
3928
|
}
|
|
@@ -3897,8 +3950,8 @@ class C {
|
|
|
3897
3950
|
else
|
|
3898
3951
|
return this;
|
|
3899
3952
|
}
|
|
3900
|
-
}
|
|
3901
|
-
class
|
|
3953
|
+
};
|
|
3954
|
+
class N {
|
|
3902
3955
|
/**
|
|
3903
3956
|
* @param {UrqlClientWrapper} graphQLClient
|
|
3904
3957
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -3943,9 +3996,9 @@ class K {
|
|
|
3943
3996
|
*/
|
|
3944
3997
|
createQuery({ variables: e = null }) {
|
|
3945
3998
|
if (this.$__variables = this.compiledVariables(e), !this.uri())
|
|
3946
|
-
throw new
|
|
3999
|
+
throw new Y("Query::createQuery() - Node URI was not initialized for this client instance!");
|
|
3947
4000
|
if (this.$__query === null)
|
|
3948
|
-
throw new
|
|
4001
|
+
throw new Y("Query::createQuery() - GraphQL subscription was not initialized!");
|
|
3949
4002
|
return {
|
|
3950
4003
|
query: this.$__query,
|
|
3951
4004
|
variables: this.variables()
|
|
@@ -4008,7 +4061,7 @@ class K {
|
|
|
4008
4061
|
return {};
|
|
4009
4062
|
}
|
|
4010
4063
|
}
|
|
4011
|
-
class
|
|
4064
|
+
class ls extends C {
|
|
4012
4065
|
/**
|
|
4013
4066
|
* Class constructor
|
|
4014
4067
|
*
|
|
@@ -4039,7 +4092,7 @@ class us extends C {
|
|
|
4039
4092
|
}), 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;
|
|
4040
4093
|
}
|
|
4041
4094
|
}
|
|
4042
|
-
class
|
|
4095
|
+
class cs extends N {
|
|
4043
4096
|
/**
|
|
4044
4097
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4045
4098
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4073,13 +4126,13 @@ class hs extends K {
|
|
|
4073
4126
|
* @return {ResponseContinuId}
|
|
4074
4127
|
*/
|
|
4075
4128
|
createResponse(e) {
|
|
4076
|
-
return new
|
|
4129
|
+
return new ls({
|
|
4077
4130
|
query: this,
|
|
4078
4131
|
json: e
|
|
4079
4132
|
});
|
|
4080
4133
|
}
|
|
4081
4134
|
}
|
|
4082
|
-
class
|
|
4135
|
+
class us extends C {
|
|
4083
4136
|
/**
|
|
4084
4137
|
* Class constructor
|
|
4085
4138
|
*
|
|
@@ -4107,11 +4160,11 @@ class ds extends C {
|
|
|
4107
4160
|
return null;
|
|
4108
4161
|
const t = {};
|
|
4109
4162
|
return e.forEach((n) => {
|
|
4110
|
-
n.metas =
|
|
4163
|
+
n.metas = he.aggregateMeta(n.metas), t[n.bundleHash] = n;
|
|
4111
4164
|
}), t;
|
|
4112
4165
|
}
|
|
4113
4166
|
}
|
|
4114
|
-
class
|
|
4167
|
+
class hs extends N {
|
|
4115
4168
|
/**
|
|
4116
4169
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4117
4170
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4138,7 +4191,7 @@ class ps extends K {
|
|
|
4138
4191
|
* @return {ResponseWalletBundle}
|
|
4139
4192
|
*/
|
|
4140
4193
|
createResponse(e) {
|
|
4141
|
-
return new
|
|
4194
|
+
return new us({
|
|
4142
4195
|
query: this,
|
|
4143
4196
|
json: e
|
|
4144
4197
|
});
|
|
@@ -4186,7 +4239,7 @@ class Le extends C {
|
|
|
4186
4239
|
characters: e.characters
|
|
4187
4240
|
}), 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)
|
|
4188
4241
|
for (const s of e.tokenUnits)
|
|
4189
|
-
n.tokenUnits.push(
|
|
4242
|
+
n.tokenUnits.push(pe.createFromGraphQL(s));
|
|
4190
4243
|
if (e.tradeRates.length)
|
|
4191
4244
|
for (const s of e.tradeRates)
|
|
4192
4245
|
n.tradeRates[s.tokenSlug] = s.amount;
|
|
@@ -4219,7 +4272,7 @@ class Le extends C {
|
|
|
4219
4272
|
return this.getWallets();
|
|
4220
4273
|
}
|
|
4221
4274
|
}
|
|
4222
|
-
class
|
|
4275
|
+
class ds extends N {
|
|
4223
4276
|
/**
|
|
4224
4277
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4225
4278
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4267,7 +4320,7 @@ class fs extends K {
|
|
|
4267
4320
|
});
|
|
4268
4321
|
}
|
|
4269
4322
|
}
|
|
4270
|
-
class
|
|
4323
|
+
class ps extends C {
|
|
4271
4324
|
/**
|
|
4272
4325
|
* Class constructor
|
|
4273
4326
|
*
|
|
@@ -4296,7 +4349,7 @@ class ms extends C {
|
|
|
4296
4349
|
});
|
|
4297
4350
|
}
|
|
4298
4351
|
}
|
|
4299
|
-
class
|
|
4352
|
+
class fs extends N {
|
|
4300
4353
|
/**
|
|
4301
4354
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4302
4355
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4331,13 +4384,13 @@ class ys extends K {
|
|
|
4331
4384
|
* @return {ResponseBalance}
|
|
4332
4385
|
*/
|
|
4333
4386
|
createResponse(e) {
|
|
4334
|
-
return new
|
|
4387
|
+
return new ps({
|
|
4335
4388
|
query: this,
|
|
4336
4389
|
json: e
|
|
4337
4390
|
});
|
|
4338
4391
|
}
|
|
4339
4392
|
}
|
|
4340
|
-
class
|
|
4393
|
+
class ms extends C {
|
|
4341
4394
|
/**
|
|
4342
4395
|
* Class constructor
|
|
4343
4396
|
*
|
|
@@ -4371,7 +4424,7 @@ class gs extends C {
|
|
|
4371
4424
|
return n.instances && (t.instances = n.instances), n.instanceCount && (t.instanceCount = n.instanceCount), n.paginatorInfo && (t.paginatorInfo = n.paginatorInfo), t;
|
|
4372
4425
|
}
|
|
4373
4426
|
}
|
|
4374
|
-
class
|
|
4427
|
+
class $t extends N {
|
|
4375
4428
|
/**
|
|
4376
4429
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4377
4430
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4440,13 +4493,13 @@ class At extends K {
|
|
|
4440
4493
|
* @return {ResponseMetaType}
|
|
4441
4494
|
*/
|
|
4442
4495
|
createResponse(e) {
|
|
4443
|
-
return new
|
|
4496
|
+
return new ms({
|
|
4444
4497
|
query: this,
|
|
4445
4498
|
json: e
|
|
4446
4499
|
});
|
|
4447
4500
|
}
|
|
4448
4501
|
}
|
|
4449
|
-
class
|
|
4502
|
+
class xe extends N {
|
|
4450
4503
|
/**
|
|
4451
4504
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4452
4505
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4454,9 +4507,9 @@ class Ie extends K {
|
|
|
4454
4507
|
constructor(e, t) {
|
|
4455
4508
|
super(e, t), this.$__query = E`query( $batchId: String ) {
|
|
4456
4509
|
Batch( batchId: $batchId ) {
|
|
4457
|
-
${
|
|
4510
|
+
${xe.getFields()},
|
|
4458
4511
|
children {
|
|
4459
|
-
${
|
|
4512
|
+
${xe.getFields()}
|
|
4460
4513
|
}
|
|
4461
4514
|
}
|
|
4462
4515
|
}`;
|
|
@@ -4527,7 +4580,7 @@ class Ie extends K {
|
|
|
4527
4580
|
return t.dataKey = "data.Batch", t;
|
|
4528
4581
|
}
|
|
4529
4582
|
}
|
|
4530
|
-
class
|
|
4583
|
+
class ys extends N {
|
|
4531
4584
|
/**
|
|
4532
4585
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4533
4586
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4535,7 +4588,7 @@ class bs extends K {
|
|
|
4535
4588
|
constructor(e, t) {
|
|
4536
4589
|
super(e, t), this.$__query = E`query( $batchId: String ) {
|
|
4537
4590
|
BatchHistory( batchId: $batchId ) {
|
|
4538
|
-
${
|
|
4591
|
+
${xe.getFields()}
|
|
4539
4592
|
}
|
|
4540
4593
|
}`;
|
|
4541
4594
|
}
|
|
@@ -4553,7 +4606,7 @@ class bs extends K {
|
|
|
4553
4606
|
return t.dataKey = "data.BatchHistory", t;
|
|
4554
4607
|
}
|
|
4555
4608
|
}
|
|
4556
|
-
class
|
|
4609
|
+
class D extends C {
|
|
4557
4610
|
/**
|
|
4558
4611
|
* Class constructor
|
|
4559
4612
|
*
|
|
@@ -4574,7 +4627,7 @@ class V extends C {
|
|
|
4574
4627
|
* Initialize response object with payload data
|
|
4575
4628
|
*/
|
|
4576
4629
|
init() {
|
|
4577
|
-
const e =
|
|
4630
|
+
const e = M.get(this.data(), "payload");
|
|
4578
4631
|
try {
|
|
4579
4632
|
this.$__payload = Object.prototype.toString.call(e) === "[object String]" ? JSON.parse(e) : e;
|
|
4580
4633
|
} catch {
|
|
@@ -4596,8 +4649,8 @@ class V extends C {
|
|
|
4596
4649
|
const e = this.data();
|
|
4597
4650
|
if (!e)
|
|
4598
4651
|
return null;
|
|
4599
|
-
const t = new
|
|
4600
|
-
return t.molecularHash =
|
|
4652
|
+
const t = new V({});
|
|
4653
|
+
return t.molecularHash = M.get(e, "molecularHash"), t.status = M.get(e, "status"), t.createdAt = M.get(e, "createdAt"), t;
|
|
4601
4654
|
}
|
|
4602
4655
|
/**
|
|
4603
4656
|
* Returns whether molecule was accepted or not
|
|
@@ -4613,7 +4666,7 @@ class V extends C {
|
|
|
4613
4666
|
* @return {string}
|
|
4614
4667
|
*/
|
|
4615
4668
|
status() {
|
|
4616
|
-
return
|
|
4669
|
+
return M.get(this.data(), "status", "rejected");
|
|
4617
4670
|
}
|
|
4618
4671
|
/**
|
|
4619
4672
|
* Returns the reason for rejection
|
|
@@ -4621,7 +4674,7 @@ class V extends C {
|
|
|
4621
4674
|
* @return {string}
|
|
4622
4675
|
*/
|
|
4623
4676
|
reason() {
|
|
4624
|
-
return
|
|
4677
|
+
return M.get(this.data(), "reason", "Invalid response from server");
|
|
4625
4678
|
}
|
|
4626
4679
|
/**
|
|
4627
4680
|
* Returns payload object
|
|
@@ -4632,7 +4685,7 @@ class V extends C {
|
|
|
4632
4685
|
return this.$__payload;
|
|
4633
4686
|
}
|
|
4634
4687
|
}
|
|
4635
|
-
class
|
|
4688
|
+
class Fe extends N {
|
|
4636
4689
|
/**
|
|
4637
4690
|
* Creates a new Request for the given parameters
|
|
4638
4691
|
*
|
|
@@ -4676,7 +4729,7 @@ class Qe extends K {
|
|
|
4676
4729
|
return {};
|
|
4677
4730
|
}
|
|
4678
4731
|
}
|
|
4679
|
-
class W extends
|
|
4732
|
+
class W extends Fe {
|
|
4680
4733
|
/**
|
|
4681
4734
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4682
4735
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4714,7 +4767,7 @@ class W extends Qe {
|
|
|
4714
4767
|
* @return {ResponseProposeMolecule}
|
|
4715
4768
|
*/
|
|
4716
4769
|
createResponse(e) {
|
|
4717
|
-
return new
|
|
4770
|
+
return new D({
|
|
4718
4771
|
query: this,
|
|
4719
4772
|
json: e
|
|
4720
4773
|
});
|
|
@@ -4747,7 +4800,7 @@ class W extends Qe {
|
|
|
4747
4800
|
return this.$__molecule;
|
|
4748
4801
|
}
|
|
4749
4802
|
}
|
|
4750
|
-
class
|
|
4803
|
+
class gs extends D {
|
|
4751
4804
|
/**
|
|
4752
4805
|
* return the authorization key
|
|
4753
4806
|
*
|
|
@@ -4755,9 +4808,9 @@ class ws extends V {
|
|
|
4755
4808
|
* @return {*}
|
|
4756
4809
|
*/
|
|
4757
4810
|
payloadKey(e) {
|
|
4758
|
-
if (!
|
|
4759
|
-
throw new
|
|
4760
|
-
return
|
|
4811
|
+
if (!M.has(this.payload(), e))
|
|
4812
|
+
throw new ee(`ResponseRequestAuthorization::payloadKey() - '${e}' key was not found in the payload!`);
|
|
4813
|
+
return M.get(this.payload(), e);
|
|
4761
4814
|
}
|
|
4762
4815
|
/**
|
|
4763
4816
|
* Returns the auth token
|
|
@@ -4808,7 +4861,7 @@ class ws extends V {
|
|
|
4808
4861
|
return this.payloadKey("key");
|
|
4809
4862
|
}
|
|
4810
4863
|
}
|
|
4811
|
-
class
|
|
4864
|
+
class bs extends W {
|
|
4812
4865
|
/**
|
|
4813
4866
|
*
|
|
4814
4867
|
* @param {object} meta
|
|
@@ -4823,15 +4876,15 @@ class ks extends W {
|
|
|
4823
4876
|
* @return {ResponseRequestAuthorization}
|
|
4824
4877
|
*/
|
|
4825
4878
|
createResponse(e) {
|
|
4826
|
-
return new
|
|
4879
|
+
return new gs({
|
|
4827
4880
|
query: this,
|
|
4828
4881
|
json: e
|
|
4829
4882
|
});
|
|
4830
4883
|
}
|
|
4831
4884
|
}
|
|
4832
|
-
class
|
|
4885
|
+
class ws extends D {
|
|
4833
4886
|
}
|
|
4834
|
-
class
|
|
4887
|
+
class ks extends W {
|
|
4835
4888
|
/**
|
|
4836
4889
|
* @param {Wallet|null} recipientWallet
|
|
4837
4890
|
* @param {number|null} amount
|
|
@@ -4857,15 +4910,15 @@ class Ss extends W {
|
|
|
4857
4910
|
* @return {ResponseCreateToken}
|
|
4858
4911
|
*/
|
|
4859
4912
|
createResponse(e) {
|
|
4860
|
-
return new
|
|
4913
|
+
return new ws({
|
|
4861
4914
|
query: this,
|
|
4862
4915
|
json: e
|
|
4863
4916
|
});
|
|
4864
4917
|
}
|
|
4865
4918
|
}
|
|
4866
|
-
class
|
|
4919
|
+
class _s extends D {
|
|
4867
4920
|
}
|
|
4868
|
-
class
|
|
4921
|
+
class Ss extends W {
|
|
4869
4922
|
/**
|
|
4870
4923
|
* Fills a Molecule with the appropriate atoms and prepares for broadcast
|
|
4871
4924
|
*
|
|
@@ -4900,13 +4953,13 @@ class As extends W {
|
|
|
4900
4953
|
* @return {ResponseRequestTokens}
|
|
4901
4954
|
*/
|
|
4902
4955
|
createResponse(e) {
|
|
4903
|
-
return new
|
|
4956
|
+
return new _s({
|
|
4904
4957
|
query: this,
|
|
4905
4958
|
json: e
|
|
4906
4959
|
});
|
|
4907
4960
|
}
|
|
4908
4961
|
}
|
|
4909
|
-
class
|
|
4962
|
+
class $s extends D {
|
|
4910
4963
|
/**
|
|
4911
4964
|
* Returns result of the transfer
|
|
4912
4965
|
*
|
|
@@ -4920,7 +4973,7 @@ class vs extends V {
|
|
|
4920
4973
|
return e.reason = typeof t.reason > "u" ? "Invalid response from server" : t.reason, e.status = typeof t.status > "u" ? "rejected" : t.status, e;
|
|
4921
4974
|
}
|
|
4922
4975
|
}
|
|
4923
|
-
class
|
|
4976
|
+
class At extends W {
|
|
4924
4977
|
/**
|
|
4925
4978
|
* Fills the Molecule with provided wallet and amount data
|
|
4926
4979
|
*
|
|
@@ -4936,6 +4989,21 @@ class xs extends W {
|
|
|
4936
4989
|
amount: t
|
|
4937
4990
|
}), this.$__molecule.sign({}), this.$__molecule.check(this.$__molecule.sourceWallet);
|
|
4938
4991
|
}
|
|
4992
|
+
/**
|
|
4993
|
+
* Fills the Molecule for a MULTI-recipient transfer (WP line 544)
|
|
4994
|
+
*
|
|
4995
|
+
* @param {Wallet[]} recipientWallets
|
|
4996
|
+
* @param {number[]} amounts - parallel to recipientWallets
|
|
4997
|
+
*/
|
|
4998
|
+
fillMoleculeMulti({
|
|
4999
|
+
recipientWallets: e,
|
|
5000
|
+
amounts: t
|
|
5001
|
+
}) {
|
|
5002
|
+
this.$__molecule.initValues({
|
|
5003
|
+
recipientWallets: e,
|
|
5004
|
+
amounts: t
|
|
5005
|
+
}), this.$__molecule.sign({}), this.$__molecule.check(this.$__molecule.sourceWallet);
|
|
5006
|
+
}
|
|
4939
5007
|
/**
|
|
4940
5008
|
* Builds a Response object out of a JSON string
|
|
4941
5009
|
*
|
|
@@ -4943,15 +5011,15 @@ class xs extends W {
|
|
|
4943
5011
|
* @return {ResponseTransferTokens}
|
|
4944
5012
|
*/
|
|
4945
5013
|
createResponse(e) {
|
|
4946
|
-
return new
|
|
5014
|
+
return new $s({
|
|
4947
5015
|
query: this,
|
|
4948
5016
|
json: e
|
|
4949
5017
|
});
|
|
4950
5018
|
}
|
|
4951
5019
|
}
|
|
4952
|
-
class
|
|
5020
|
+
class As extends D {
|
|
4953
5021
|
}
|
|
4954
|
-
class
|
|
5022
|
+
class vs extends W {
|
|
4955
5023
|
fillMolecule({
|
|
4956
5024
|
type: e,
|
|
4957
5025
|
contact: t,
|
|
@@ -4970,15 +5038,15 @@ class Ts extends W {
|
|
|
4970
5038
|
* @return {ResponseCreateIdentifier}
|
|
4971
5039
|
*/
|
|
4972
5040
|
createResponse(e) {
|
|
4973
|
-
return new
|
|
5041
|
+
return new As({
|
|
4974
5042
|
query: this,
|
|
4975
5043
|
json: e
|
|
4976
5044
|
});
|
|
4977
5045
|
}
|
|
4978
5046
|
}
|
|
4979
|
-
class
|
|
5047
|
+
class xs extends D {
|
|
4980
5048
|
}
|
|
4981
|
-
class
|
|
5049
|
+
class Is extends W {
|
|
4982
5050
|
/**
|
|
4983
5051
|
* Class constructor
|
|
4984
5052
|
*
|
|
@@ -5004,15 +5072,15 @@ class Cs extends W {
|
|
|
5004
5072
|
* @return {ResponseClaimShadowWallet}
|
|
5005
5073
|
*/
|
|
5006
5074
|
createResponse(e) {
|
|
5007
|
-
return new
|
|
5075
|
+
return new xs({
|
|
5008
5076
|
query: this,
|
|
5009
5077
|
json: e
|
|
5010
5078
|
});
|
|
5011
5079
|
}
|
|
5012
5080
|
}
|
|
5013
|
-
class
|
|
5081
|
+
class Ms extends D {
|
|
5014
5082
|
}
|
|
5015
|
-
class
|
|
5083
|
+
class Ts extends W {
|
|
5016
5084
|
/**
|
|
5017
5085
|
* Fills a molecule with an appropriate metadata atom
|
|
5018
5086
|
*
|
|
@@ -5041,15 +5109,15 @@ class Os extends W {
|
|
|
5041
5109
|
* @return {ResponseCreateMeta}
|
|
5042
5110
|
*/
|
|
5043
5111
|
createResponse(e) {
|
|
5044
|
-
return new
|
|
5112
|
+
return new Ms({
|
|
5045
5113
|
query: this,
|
|
5046
5114
|
json: e
|
|
5047
5115
|
});
|
|
5048
5116
|
}
|
|
5049
5117
|
}
|
|
5050
|
-
class
|
|
5118
|
+
class Cs extends D {
|
|
5051
5119
|
}
|
|
5052
|
-
class
|
|
5120
|
+
class Es extends W {
|
|
5053
5121
|
/**
|
|
5054
5122
|
* Fills a molecule with a P-isotope peering atom
|
|
5055
5123
|
*
|
|
@@ -5069,15 +5137,15 @@ class qs extends W {
|
|
|
5069
5137
|
* @return {ResponsePeering}
|
|
5070
5138
|
*/
|
|
5071
5139
|
createResponse(e) {
|
|
5072
|
-
return new
|
|
5140
|
+
return new Cs({
|
|
5073
5141
|
query: this,
|
|
5074
5142
|
json: e
|
|
5075
5143
|
});
|
|
5076
5144
|
}
|
|
5077
5145
|
}
|
|
5078
|
-
class
|
|
5146
|
+
class Os extends D {
|
|
5079
5147
|
}
|
|
5080
|
-
class
|
|
5148
|
+
class Rs extends W {
|
|
5081
5149
|
/**
|
|
5082
5150
|
* Fills a molecule with an A-isotope append request atom
|
|
5083
5151
|
*
|
|
@@ -5106,13 +5174,13 @@ class Us extends W {
|
|
|
5106
5174
|
* @return {ResponseAppendRequest}
|
|
5107
5175
|
*/
|
|
5108
5176
|
createResponse(e) {
|
|
5109
|
-
return new
|
|
5177
|
+
return new Os({
|
|
5110
5178
|
query: this,
|
|
5111
5179
|
json: e
|
|
5112
5180
|
});
|
|
5113
5181
|
}
|
|
5114
5182
|
}
|
|
5115
|
-
class
|
|
5183
|
+
class qs extends C {
|
|
5116
5184
|
/**
|
|
5117
5185
|
* Class constructor
|
|
5118
5186
|
*
|
|
@@ -5135,7 +5203,7 @@ class Bs extends C {
|
|
|
5135
5203
|
* @return {*}
|
|
5136
5204
|
*/
|
|
5137
5205
|
success() {
|
|
5138
|
-
return
|
|
5206
|
+
return M.get(this.data(), "set");
|
|
5139
5207
|
}
|
|
5140
5208
|
/**
|
|
5141
5209
|
* Returns message
|
|
@@ -5143,10 +5211,10 @@ class Bs extends C {
|
|
|
5143
5211
|
* @return {*}
|
|
5144
5212
|
*/
|
|
5145
5213
|
message() {
|
|
5146
|
-
return
|
|
5214
|
+
return M.get(this.data(), "message");
|
|
5147
5215
|
}
|
|
5148
5216
|
}
|
|
5149
|
-
class
|
|
5217
|
+
class Ws extends Fe {
|
|
5150
5218
|
/**
|
|
5151
5219
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5152
5220
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -5169,15 +5237,15 @@ class Hs extends Qe {
|
|
|
5169
5237
|
* @return {ResponseLinkIdentifier}
|
|
5170
5238
|
*/
|
|
5171
5239
|
createResponse(e) {
|
|
5172
|
-
return new
|
|
5240
|
+
return new qs({
|
|
5173
5241
|
query: this,
|
|
5174
5242
|
json: e
|
|
5175
5243
|
});
|
|
5176
5244
|
}
|
|
5177
5245
|
}
|
|
5178
|
-
class
|
|
5246
|
+
class Us extends D {
|
|
5179
5247
|
}
|
|
5180
|
-
class
|
|
5248
|
+
class Bs extends W {
|
|
5181
5249
|
fillMolecule(e) {
|
|
5182
5250
|
this.$__molecule.initWalletCreation(e), this.$__molecule.sign({}), this.$__molecule.check();
|
|
5183
5251
|
}
|
|
@@ -5188,13 +5256,13 @@ class Ks extends W {
|
|
|
5188
5256
|
* @return {ResponseCreateWallet}
|
|
5189
5257
|
*/
|
|
5190
5258
|
createResponse(e) {
|
|
5191
|
-
return new
|
|
5259
|
+
return new Us({
|
|
5192
5260
|
query: this,
|
|
5193
5261
|
json: e
|
|
5194
5262
|
});
|
|
5195
5263
|
}
|
|
5196
5264
|
}
|
|
5197
|
-
class
|
|
5265
|
+
class Hs extends C {
|
|
5198
5266
|
/**
|
|
5199
5267
|
* Class constructor
|
|
5200
5268
|
*
|
|
@@ -5242,9 +5310,9 @@ class Ns extends C {
|
|
|
5242
5310
|
* @return {*}
|
|
5243
5311
|
*/
|
|
5244
5312
|
payloadKey(e) {
|
|
5245
|
-
if (!
|
|
5246
|
-
throw new
|
|
5247
|
-
return
|
|
5313
|
+
if (!M.has(this.payload(), e))
|
|
5314
|
+
throw new ee(`ResponseAuthorizationGuest::payloadKey() - '${e}' key is not found in the payload!`);
|
|
5315
|
+
return M.get(this.payload(), e);
|
|
5248
5316
|
}
|
|
5249
5317
|
/**
|
|
5250
5318
|
* Returns the auth token
|
|
@@ -5296,7 +5364,7 @@ class Ns extends C {
|
|
|
5296
5364
|
return this.payloadKey("encrypt");
|
|
5297
5365
|
}
|
|
5298
5366
|
}
|
|
5299
|
-
class
|
|
5367
|
+
class Ps extends Fe {
|
|
5300
5368
|
/**
|
|
5301
5369
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5302
5370
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -5317,7 +5385,7 @@ class Fs extends Qe {
|
|
|
5317
5385
|
* @return {ResponseRequestAuthorizationGuest}
|
|
5318
5386
|
*/
|
|
5319
5387
|
createResponse(e) {
|
|
5320
|
-
return new
|
|
5388
|
+
return new Hs({
|
|
5321
5389
|
query: this,
|
|
5322
5390
|
json: e
|
|
5323
5391
|
});
|
|
@@ -5335,7 +5403,7 @@ class vt extends x {
|
|
|
5335
5403
|
super(e, t, n), this.name = "WalletShadowException";
|
|
5336
5404
|
}
|
|
5337
5405
|
}
|
|
5338
|
-
class
|
|
5406
|
+
class Ks extends x {
|
|
5339
5407
|
/**
|
|
5340
5408
|
* Class constructor
|
|
5341
5409
|
*
|
|
@@ -5347,7 +5415,7 @@ class Ls extends x {
|
|
|
5347
5415
|
super(e, t, n), this.name = "StackableUnitDecimalsException";
|
|
5348
5416
|
}
|
|
5349
5417
|
}
|
|
5350
|
-
class
|
|
5418
|
+
class ke extends x {
|
|
5351
5419
|
/**
|
|
5352
5420
|
* Class constructor
|
|
5353
5421
|
*
|
|
@@ -5359,7 +5427,7 @@ class Re extends x {
|
|
|
5359
5427
|
super(e, t, n), this.name = "StackableUnitAmountException";
|
|
5360
5428
|
}
|
|
5361
5429
|
}
|
|
5362
|
-
class
|
|
5430
|
+
class Qe {
|
|
5363
5431
|
/**
|
|
5364
5432
|
*
|
|
5365
5433
|
* @param {UrqlClientWrapper} graphQLClient
|
|
@@ -5377,9 +5445,9 @@ class je {
|
|
|
5377
5445
|
variables: e = null
|
|
5378
5446
|
}) {
|
|
5379
5447
|
if (this.$__variables = this.compiledVariables(e), !this.uri())
|
|
5380
|
-
throw new
|
|
5448
|
+
throw new Y("Subscribe::createSubscribe() - Node URI was not initialized for this client instance!");
|
|
5381
5449
|
if (this.$__subscribe === null)
|
|
5382
|
-
throw new
|
|
5450
|
+
throw new Y("Subscribe::createSubscribe() - GraphQL subscription was not initialized!");
|
|
5383
5451
|
return {
|
|
5384
5452
|
query: this.$__subscribe,
|
|
5385
5453
|
variables: this.variables(),
|
|
@@ -5398,7 +5466,7 @@ class je {
|
|
|
5398
5466
|
closure: t
|
|
5399
5467
|
}) {
|
|
5400
5468
|
if (!t)
|
|
5401
|
-
throw new
|
|
5469
|
+
throw new Y(`${this.constructor.name}::execute() - closure parameter is required!`);
|
|
5402
5470
|
return this.$__request = this.createSubscribe({
|
|
5403
5471
|
variables: e
|
|
5404
5472
|
}), this.client.subscribe(this.$__request, t);
|
|
@@ -5429,7 +5497,7 @@ class je {
|
|
|
5429
5497
|
return this.$__variables;
|
|
5430
5498
|
}
|
|
5431
5499
|
}
|
|
5432
|
-
class
|
|
5500
|
+
class Ns extends Qe {
|
|
5433
5501
|
constructor(e) {
|
|
5434
5502
|
super(e), this.$__subscribe = E`
|
|
5435
5503
|
subscription onCreateMolecule ( $bundle: String! ) {
|
|
@@ -5479,7 +5547,7 @@ class Qs extends je {
|
|
|
5479
5547
|
`;
|
|
5480
5548
|
}
|
|
5481
5549
|
}
|
|
5482
|
-
class
|
|
5550
|
+
class Ls extends Qe {
|
|
5483
5551
|
constructor(e) {
|
|
5484
5552
|
super(e), this.$__subscribe = E`
|
|
5485
5553
|
subscription onWalletStatus ( $bundle: String!, $token: String! ) {
|
|
@@ -5493,7 +5561,7 @@ class js extends je {
|
|
|
5493
5561
|
`;
|
|
5494
5562
|
}
|
|
5495
5563
|
}
|
|
5496
|
-
class
|
|
5564
|
+
class Fs extends Qe {
|
|
5497
5565
|
constructor(e) {
|
|
5498
5566
|
super(e), this.$__subscribe = E`
|
|
5499
5567
|
subscription onActiveWallet ( $bundle: String! ) {
|
|
@@ -5536,7 +5604,7 @@ class Ds extends je {
|
|
|
5536
5604
|
`;
|
|
5537
5605
|
}
|
|
5538
5606
|
}
|
|
5539
|
-
class
|
|
5607
|
+
class Qs extends Qe {
|
|
5540
5608
|
constructor(e) {
|
|
5541
5609
|
super(e), this.$__subscribe = E`
|
|
5542
5610
|
subscription onActiveUser ( $metaType: String!, $metaId: String! ) {
|
|
@@ -5551,7 +5619,7 @@ class Vs extends je {
|
|
|
5551
5619
|
}`;
|
|
5552
5620
|
}
|
|
5553
5621
|
}
|
|
5554
|
-
class
|
|
5622
|
+
class js extends C {
|
|
5555
5623
|
/**
|
|
5556
5624
|
* Class constructor
|
|
5557
5625
|
*
|
|
@@ -5569,7 +5637,7 @@ class zs extends C {
|
|
|
5569
5637
|
});
|
|
5570
5638
|
}
|
|
5571
5639
|
}
|
|
5572
|
-
class
|
|
5640
|
+
class Ds extends Fe {
|
|
5573
5641
|
/**
|
|
5574
5642
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5575
5643
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -5612,13 +5680,13 @@ class Js extends Qe {
|
|
|
5612
5680
|
* @return {ResponseActiveSession}
|
|
5613
5681
|
*/
|
|
5614
5682
|
createResponse(e) {
|
|
5615
|
-
return new
|
|
5683
|
+
return new js({
|
|
5616
5684
|
query: this,
|
|
5617
5685
|
json: e
|
|
5618
5686
|
});
|
|
5619
5687
|
}
|
|
5620
5688
|
}
|
|
5621
|
-
class
|
|
5689
|
+
class Vs extends C {
|
|
5622
5690
|
/**
|
|
5623
5691
|
* Class constructor
|
|
5624
5692
|
*
|
|
@@ -5647,7 +5715,7 @@ class Gs extends C {
|
|
|
5647
5715
|
return t;
|
|
5648
5716
|
}
|
|
5649
5717
|
}
|
|
5650
|
-
class
|
|
5718
|
+
class zs extends N {
|
|
5651
5719
|
/**
|
|
5652
5720
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5653
5721
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -5669,132 +5737,13 @@ class Xs extends K {
|
|
|
5669
5737
|
* @return {ResponseQueryActiveSession}
|
|
5670
5738
|
*/
|
|
5671
5739
|
createResponse(e) {
|
|
5672
|
-
return new
|
|
5740
|
+
return new Vs({
|
|
5673
5741
|
query: this,
|
|
5674
5742
|
json: e
|
|
5675
5743
|
});
|
|
5676
5744
|
}
|
|
5677
5745
|
}
|
|
5678
|
-
class
|
|
5679
|
-
/**
|
|
5680
|
-
* Class constructor
|
|
5681
|
-
*
|
|
5682
|
-
* @param {Query} query
|
|
5683
|
-
* @param {object} json
|
|
5684
|
-
*/
|
|
5685
|
-
constructor({
|
|
5686
|
-
query: e,
|
|
5687
|
-
json: t
|
|
5688
|
-
}) {
|
|
5689
|
-
super({
|
|
5690
|
-
query: e,
|
|
5691
|
-
json: t,
|
|
5692
|
-
dataKey: "data.UserActivity"
|
|
5693
|
-
});
|
|
5694
|
-
}
|
|
5695
|
-
payload() {
|
|
5696
|
-
const e = JSON.parse(JSON.stringify(this.data()));
|
|
5697
|
-
if (e.instances)
|
|
5698
|
-
for (const t of e.instances)
|
|
5699
|
-
t.jsonData = JSON.parse(t.jsonData);
|
|
5700
|
-
return e;
|
|
5701
|
-
}
|
|
5702
|
-
}
|
|
5703
|
-
class Ys extends K {
|
|
5704
|
-
/**
|
|
5705
|
-
* @param {UrqlClientWrapper} graphQLClient
|
|
5706
|
-
* @param {KnishIOClient} knishIOClient
|
|
5707
|
-
*/
|
|
5708
|
-
constructor(e, t) {
|
|
5709
|
-
super(e, t), this.$__query = E`query UserActivity (
|
|
5710
|
-
$bundleHash:String,
|
|
5711
|
-
$metaType: String,
|
|
5712
|
-
$metaId: String,
|
|
5713
|
-
$ipAddress: String,
|
|
5714
|
-
$browser: String,
|
|
5715
|
-
$osCpu: String,
|
|
5716
|
-
$resolution: String,
|
|
5717
|
-
$timeZone: String,
|
|
5718
|
-
$countBy: [CountByUserActivity],
|
|
5719
|
-
$interval: span
|
|
5720
|
-
) {
|
|
5721
|
-
UserActivity (
|
|
5722
|
-
bundleHash: $bundleHash,
|
|
5723
|
-
metaType: $metaType,
|
|
5724
|
-
metaId: $metaId,
|
|
5725
|
-
ipAddress: $ipAddress,
|
|
5726
|
-
browser: $browser,
|
|
5727
|
-
osCpu: $osCpu,
|
|
5728
|
-
resolution: $resolution,
|
|
5729
|
-
timeZone: $timeZone,
|
|
5730
|
-
countBy: $countBy,
|
|
5731
|
-
interval: $interval
|
|
5732
|
-
) {
|
|
5733
|
-
createdAt,
|
|
5734
|
-
bundleHash,
|
|
5735
|
-
metaType,
|
|
5736
|
-
metaId,
|
|
5737
|
-
instances {
|
|
5738
|
-
bundleHash,
|
|
5739
|
-
metaType,
|
|
5740
|
-
metaId,
|
|
5741
|
-
jsonData,
|
|
5742
|
-
createdAt,
|
|
5743
|
-
updatedAt
|
|
5744
|
-
},
|
|
5745
|
-
instanceCount {
|
|
5746
|
-
...SubFields,
|
|
5747
|
-
...Recursive
|
|
5748
|
-
}
|
|
5749
|
-
}
|
|
5750
|
-
}
|
|
5751
|
-
|
|
5752
|
-
fragment SubFields on InstanceCountType {
|
|
5753
|
-
id,
|
|
5754
|
-
count
|
|
5755
|
-
}
|
|
5756
|
-
|
|
5757
|
-
fragment Recursive on InstanceCountType {
|
|
5758
|
-
instances {
|
|
5759
|
-
...SubFields
|
|
5760
|
-
instances {
|
|
5761
|
-
...SubFields,
|
|
5762
|
-
instances {
|
|
5763
|
-
...SubFields
|
|
5764
|
-
instances {
|
|
5765
|
-
...SubFields
|
|
5766
|
-
instances {
|
|
5767
|
-
...SubFields
|
|
5768
|
-
instances {
|
|
5769
|
-
...SubFields
|
|
5770
|
-
instances {
|
|
5771
|
-
...SubFields
|
|
5772
|
-
instances {
|
|
5773
|
-
...SubFields
|
|
5774
|
-
}
|
|
5775
|
-
}
|
|
5776
|
-
}
|
|
5777
|
-
}
|
|
5778
|
-
}
|
|
5779
|
-
}
|
|
5780
|
-
}
|
|
5781
|
-
}
|
|
5782
|
-
}`;
|
|
5783
|
-
}
|
|
5784
|
-
/**
|
|
5785
|
-
* Returns a Response object
|
|
5786
|
-
*
|
|
5787
|
-
* @param {object} json
|
|
5788
|
-
* @return {ResponseQueryUserActivity}
|
|
5789
|
-
*/
|
|
5790
|
-
createResponse(e) {
|
|
5791
|
-
return new Zs({
|
|
5792
|
-
query: this,
|
|
5793
|
-
json: e
|
|
5794
|
-
});
|
|
5795
|
-
}
|
|
5796
|
-
}
|
|
5797
|
-
class er extends K {
|
|
5746
|
+
class Js extends N {
|
|
5798
5747
|
/**
|
|
5799
5748
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5800
5749
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -5837,7 +5786,7 @@ class xt extends x {
|
|
|
5837
5786
|
super(e, t, n), this.name = "AuthorizationRejectedException";
|
|
5838
5787
|
}
|
|
5839
5788
|
}
|
|
5840
|
-
class
|
|
5789
|
+
class Gs extends C {
|
|
5841
5790
|
/**
|
|
5842
5791
|
* Class constructor
|
|
5843
5792
|
*
|
|
@@ -5885,7 +5834,7 @@ class tr extends C {
|
|
|
5885
5834
|
return t;
|
|
5886
5835
|
}
|
|
5887
5836
|
}
|
|
5888
|
-
class It extends
|
|
5837
|
+
class It extends N {
|
|
5889
5838
|
/**
|
|
5890
5839
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5891
5840
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -6001,7 +5950,7 @@ class It extends K {
|
|
|
6001
5950
|
values: f,
|
|
6002
5951
|
value: m,
|
|
6003
5952
|
metaTypes: w,
|
|
6004
|
-
metaType:
|
|
5953
|
+
metaType: T,
|
|
6005
5954
|
metaIds: k,
|
|
6006
5955
|
metaId: $,
|
|
6007
5956
|
indexes: v,
|
|
@@ -6010,7 +5959,7 @@ class It extends K {
|
|
|
6010
5959
|
latest: U,
|
|
6011
5960
|
queryArgs: R
|
|
6012
5961
|
}) {
|
|
6013
|
-
return t && (e = e || [], e.push(t)), s && (n = n || [], n.push(s)), i && (r = r || [], r.push(i)), c && (a = a || [], a.push(c)), l && (u = u || [], u.push(l)), p && (h = h || [], h.push(p)), b && (d = d || [], d.push(b)), O && (A = A || [], A.push(O)), m && (f = f || [], f.push(m)),
|
|
5962
|
+
return t && (e = e || [], e.push(t)), s && (n = n || [], n.push(s)), i && (r = r || [], r.push(i)), c && (a = a || [], a.push(c)), l && (u = u || [], u.push(l)), p && (h = h || [], h.push(p)), b && (d = d || [], d.push(b)), O && (A = A || [], A.push(O)), m && (f = f || [], f.push(m)), T && (w = w || [], w.push(T)), $ && (k = k || [], k.push($)), I && (v = v || [], v.push(I)), {
|
|
6014
5963
|
molecularHashes: e,
|
|
6015
5964
|
bundleHashes: n,
|
|
6016
5965
|
positions: r,
|
|
@@ -6035,13 +5984,13 @@ class It extends K {
|
|
|
6035
5984
|
* @return {ResponseAtom}
|
|
6036
5985
|
*/
|
|
6037
5986
|
createResponse(e) {
|
|
6038
|
-
return new
|
|
5987
|
+
return new Gs({
|
|
6039
5988
|
query: this,
|
|
6040
5989
|
json: e
|
|
6041
5990
|
});
|
|
6042
5991
|
}
|
|
6043
5992
|
}
|
|
6044
|
-
class
|
|
5993
|
+
class Xs extends C {
|
|
6045
5994
|
/**
|
|
6046
5995
|
* Class constructor
|
|
6047
5996
|
*
|
|
@@ -6066,7 +6015,7 @@ class nr extends C {
|
|
|
6066
6015
|
return e && e.callback ? JSON.parse(e.callback) : null;
|
|
6067
6016
|
}
|
|
6068
6017
|
}
|
|
6069
|
-
class
|
|
6018
|
+
class Zs extends N {
|
|
6070
6019
|
/**
|
|
6071
6020
|
* @param {UrqlClientWrapper} graphQLClient
|
|
6072
6021
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -6092,13 +6041,13 @@ class sr extends K {
|
|
|
6092
6041
|
* @return {ResponsePolicy}
|
|
6093
6042
|
*/
|
|
6094
6043
|
createResponse(e) {
|
|
6095
|
-
return new
|
|
6044
|
+
return new Xs({
|
|
6096
6045
|
query: this,
|
|
6097
6046
|
json: e
|
|
6098
6047
|
});
|
|
6099
6048
|
}
|
|
6100
6049
|
}
|
|
6101
|
-
class
|
|
6050
|
+
class Ys extends C {
|
|
6102
6051
|
/**
|
|
6103
6052
|
* Class constructor
|
|
6104
6053
|
*
|
|
@@ -6127,7 +6076,7 @@ class rr extends C {
|
|
|
6127
6076
|
return n.instances && (t.instances = n.instances), n.instanceCount && (t.instanceCount = n.instanceCount), n.paginatorInfo && (t.paginatorInfo = n.paginatorInfo), t;
|
|
6128
6077
|
}
|
|
6129
6078
|
}
|
|
6130
|
-
class
|
|
6079
|
+
class Mt extends N {
|
|
6131
6080
|
/**
|
|
6132
6081
|
* @param {UrqlClientWrapper} graphQLClient
|
|
6133
6082
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -6213,13 +6162,13 @@ class Tt extends K {
|
|
|
6213
6162
|
* @return {ResponseMetaTypeViaAtom}
|
|
6214
6163
|
*/
|
|
6215
6164
|
createResponse(e) {
|
|
6216
|
-
return new
|
|
6165
|
+
return new Ys({
|
|
6217
6166
|
query: this,
|
|
6218
6167
|
json: e
|
|
6219
6168
|
});
|
|
6220
6169
|
}
|
|
6221
6170
|
}
|
|
6222
|
-
class
|
|
6171
|
+
class it extends C {
|
|
6223
6172
|
/**
|
|
6224
6173
|
* Class constructor
|
|
6225
6174
|
*
|
|
@@ -6288,7 +6237,7 @@ class ot extends C {
|
|
|
6288
6237
|
}, n = e.pop();
|
|
6289
6238
|
return n.instances && (t.instances = n.instances.map((s) => {
|
|
6290
6239
|
let r = s.metas;
|
|
6291
|
-
return (!r || r.length === 0) && (r =
|
|
6240
|
+
return (!r || r.length === 0) && (r = it.extractMetasFromMolecule(
|
|
6292
6241
|
s.molecule,
|
|
6293
6242
|
s.metaType,
|
|
6294
6243
|
s.metaId
|
|
@@ -6307,20 +6256,19 @@ class ot extends C {
|
|
|
6307
6256
|
* @return {{ verified: boolean, molecules: Array<{ molecularHash: string, verified: boolean, error: string|null }> }}
|
|
6308
6257
|
*/
|
|
6309
6258
|
verifyIntegrity() {
|
|
6310
|
-
var s;
|
|
6311
6259
|
const e = [], t = this.data();
|
|
6312
6260
|
if (!t || t.length === 0)
|
|
6313
6261
|
return { verified: !0, molecules: e };
|
|
6314
|
-
const n =
|
|
6315
|
-
for (const
|
|
6316
|
-
|
|
6262
|
+
const n = t[t.length - 1]?.instances || [];
|
|
6263
|
+
for (const s of n)
|
|
6264
|
+
s.molecule && e.push(Ae.verifyFromServerData(s.molecule));
|
|
6317
6265
|
return {
|
|
6318
|
-
verified: e.length === 0 || e.every((
|
|
6266
|
+
verified: e.length === 0 || e.every((s) => s.verified),
|
|
6319
6267
|
molecules: e
|
|
6320
6268
|
};
|
|
6321
6269
|
}
|
|
6322
6270
|
}
|
|
6323
|
-
class
|
|
6271
|
+
class Tt extends N {
|
|
6324
6272
|
/**
|
|
6325
6273
|
* @param {UrqlClientWrapper} graphQLClient
|
|
6326
6274
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -6427,13 +6375,13 @@ class Mt extends K {
|
|
|
6427
6375
|
* @return {ResponseMetaTypeViaMolecule}
|
|
6428
6376
|
*/
|
|
6429
6377
|
createResponse(e) {
|
|
6430
|
-
return new
|
|
6378
|
+
return new it({
|
|
6431
6379
|
query: this,
|
|
6432
6380
|
json: e
|
|
6433
6381
|
});
|
|
6434
6382
|
}
|
|
6435
6383
|
}
|
|
6436
|
-
class
|
|
6384
|
+
class er extends C {
|
|
6437
6385
|
/**
|
|
6438
6386
|
* Class constructor
|
|
6439
6387
|
*
|
|
@@ -6469,7 +6417,7 @@ class ir extends C {
|
|
|
6469
6417
|
return !e || !Array.isArray(e) || e.length === 0 ? null : e;
|
|
6470
6418
|
}
|
|
6471
6419
|
}
|
|
6472
|
-
class Ct extends
|
|
6420
|
+
class Ct extends N {
|
|
6473
6421
|
/**
|
|
6474
6422
|
* @param {UrqlClientWrapper} graphQLClient
|
|
6475
6423
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -6513,15 +6461,15 @@ class Ct extends K {
|
|
|
6513
6461
|
* @return {ResponseEmbeddingStatus}
|
|
6514
6462
|
*/
|
|
6515
6463
|
createResponse(e) {
|
|
6516
|
-
return new
|
|
6464
|
+
return new er({
|
|
6517
6465
|
query: this,
|
|
6518
6466
|
json: e
|
|
6519
6467
|
});
|
|
6520
6468
|
}
|
|
6521
6469
|
}
|
|
6522
|
-
class
|
|
6470
|
+
class tr extends D {
|
|
6523
6471
|
}
|
|
6524
|
-
class
|
|
6472
|
+
class nr extends W {
|
|
6525
6473
|
/**
|
|
6526
6474
|
*
|
|
6527
6475
|
* @param {string} metaType
|
|
@@ -6549,13 +6497,13 @@ class ar extends W {
|
|
|
6549
6497
|
* @return {ResponseCreateRule}
|
|
6550
6498
|
*/
|
|
6551
6499
|
createResponse(e) {
|
|
6552
|
-
return new
|
|
6500
|
+
return new tr({
|
|
6553
6501
|
query: this,
|
|
6554
6502
|
json: e
|
|
6555
6503
|
});
|
|
6556
6504
|
}
|
|
6557
6505
|
}
|
|
6558
|
-
class
|
|
6506
|
+
class sr extends W {
|
|
6559
6507
|
/**
|
|
6560
6508
|
* Fills the Molecule with provided wallet and amount data
|
|
6561
6509
|
*
|
|
@@ -6572,7 +6520,7 @@ class lr extends W {
|
|
|
6572
6520
|
}), this.$__molecule.sign({}), this.$__molecule.check(this.$__molecule.sourceWallet);
|
|
6573
6521
|
}
|
|
6574
6522
|
}
|
|
6575
|
-
class
|
|
6523
|
+
class rr extends W {
|
|
6576
6524
|
/**
|
|
6577
6525
|
*
|
|
6578
6526
|
* @param recipients
|
|
@@ -6672,38 +6620,38 @@ function Z(o, e) {
|
|
|
6672
6620
|
};
|
|
6673
6621
|
}
|
|
6674
6622
|
}
|
|
6675
|
-
var q = { exclude: [], include: [], logging: !0 }, Jt = {},
|
|
6623
|
+
var q = { exclude: [], include: [], logging: !0 }, Jt = {}, ir = { timeout: "true" }, z = function(o, e) {
|
|
6676
6624
|
typeof window < "u" && (Jt[o] = e);
|
|
6677
|
-
},
|
|
6625
|
+
}, or = function() {
|
|
6678
6626
|
return Object.fromEntries(Object.entries(Jt).filter((function(o) {
|
|
6679
6627
|
var e, t = o[0];
|
|
6680
|
-
return !(!((e = q
|
|
6628
|
+
return !(!((e = q?.exclude) === null || e === void 0) && e.includes(t));
|
|
6681
6629
|
})).filter((function(o) {
|
|
6682
6630
|
var e, t, n, s, r = o[0];
|
|
6683
|
-
return !((e = q
|
|
6631
|
+
return !((e = q?.include) === null || e === void 0) && e.some((function(i) {
|
|
6684
6632
|
return i.includes(".");
|
|
6685
|
-
})) ? (t = q
|
|
6633
|
+
})) ? (t = q?.include) === null || t === void 0 ? void 0 : t.some((function(i) {
|
|
6686
6634
|
return i.startsWith(r);
|
|
6687
|
-
})) : ((n = q
|
|
6635
|
+
})) : ((n = q?.include) === null || n === void 0 ? void 0 : n.length) === 0 || ((s = q?.include) === null || s === void 0 ? void 0 : s.includes(r));
|
|
6688
6636
|
})).map((function(o) {
|
|
6689
6637
|
return [o[0], (0, o[1])()];
|
|
6690
6638
|
})));
|
|
6691
6639
|
};
|
|
6692
|
-
function
|
|
6640
|
+
function Oe(o) {
|
|
6693
6641
|
return o ^= o >>> 16, o = Math.imul(o, 2246822507), o ^= o >>> 13, o = Math.imul(o, 3266489909), (o ^= o >>> 16) >>> 0;
|
|
6694
6642
|
}
|
|
6695
6643
|
var B = new Uint32Array([597399067, 2869860233, 951274213, 2716044179]);
|
|
6696
|
-
function
|
|
6644
|
+
function Q(o, e) {
|
|
6697
6645
|
return o << e | o >>> 32 - e;
|
|
6698
6646
|
}
|
|
6699
|
-
function
|
|
6647
|
+
function ot(o, e) {
|
|
6700
6648
|
var t;
|
|
6701
6649
|
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");
|
|
6702
6650
|
var n = new Uint32Array([e, e, e, e]);
|
|
6703
6651
|
(function(r, i) {
|
|
6704
6652
|
for (var a = r.byteLength / 16 | 0, c = new Uint32Array(r, 0, 4 * a), u = 0; u < a; u++) {
|
|
6705
6653
|
var l = c.subarray(4 * u, 4 * (u + 1));
|
|
6706
|
-
l[0] = Math.imul(l[0], B[0]), l[0] =
|
|
6654
|
+
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;
|
|
6707
6655
|
}
|
|
6708
6656
|
})(o, n), (function(r, i) {
|
|
6709
6657
|
var a = r.byteLength / 16 | 0, c = r.byteLength % 16, u = new Uint32Array(4), l = new Uint8Array(r, 16 * a, c);
|
|
@@ -6713,7 +6661,7 @@ function at(o, e) {
|
|
|
6713
6661
|
case 14:
|
|
6714
6662
|
u[3] = u[3] ^ l[13] << 8;
|
|
6715
6663
|
case 13:
|
|
6716
|
-
u[3] = u[3] ^ l[12] << 0, u[3] = Math.imul(u[3], B[3]), u[3] =
|
|
6664
|
+
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];
|
|
6717
6665
|
case 12:
|
|
6718
6666
|
u[2] = u[2] ^ l[11] << 24;
|
|
6719
6667
|
case 11:
|
|
@@ -6721,7 +6669,7 @@ function at(o, e) {
|
|
|
6721
6669
|
case 10:
|
|
6722
6670
|
u[2] = u[2] ^ l[9] << 8;
|
|
6723
6671
|
case 9:
|
|
6724
|
-
u[2] = u[2] ^ l[8] << 0, u[2] = Math.imul(u[2], B[2]), u[2] =
|
|
6672
|
+
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];
|
|
6725
6673
|
case 8:
|
|
6726
6674
|
u[1] = u[1] ^ l[7] << 24;
|
|
6727
6675
|
case 7:
|
|
@@ -6729,7 +6677,7 @@ function at(o, e) {
|
|
|
6729
6677
|
case 6:
|
|
6730
6678
|
u[1] = u[1] ^ l[5] << 8;
|
|
6731
6679
|
case 5:
|
|
6732
|
-
u[1] = u[1] ^ l[4] << 0, u[1] = Math.imul(u[1], B[1]), u[1] =
|
|
6680
|
+
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];
|
|
6733
6681
|
case 4:
|
|
6734
6682
|
u[0] = u[0] ^ l[3] << 24;
|
|
6735
6683
|
case 3:
|
|
@@ -6737,31 +6685,31 @@ function at(o, e) {
|
|
|
6737
6685
|
case 2:
|
|
6738
6686
|
u[0] = u[0] ^ l[1] << 8;
|
|
6739
6687
|
case 1:
|
|
6740
|
-
u[0] = u[0] ^ l[0] << 0, u[0] = Math.imul(u[0], B[0]), u[0] =
|
|
6688
|
+
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];
|
|
6741
6689
|
}
|
|
6742
6690
|
})(o, n), (function(r, i) {
|
|
6743
|
-
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] =
|
|
6691
|
+
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;
|
|
6744
6692
|
})(o, n);
|
|
6745
6693
|
var s = new Uint8Array(n.buffer);
|
|
6746
6694
|
return Array.from(s).map((function(r) {
|
|
6747
6695
|
return r.toString(16).padStart(2, "0");
|
|
6748
6696
|
})).join("");
|
|
6749
6697
|
}
|
|
6750
|
-
function
|
|
6698
|
+
function ar(o, e) {
|
|
6751
6699
|
return new Promise((function(t) {
|
|
6752
6700
|
setTimeout((function() {
|
|
6753
6701
|
return t(e);
|
|
6754
6702
|
}), o);
|
|
6755
6703
|
}));
|
|
6756
6704
|
}
|
|
6757
|
-
function
|
|
6705
|
+
function lr(o, e, t) {
|
|
6758
6706
|
return Promise.all(o.map((function(n) {
|
|
6759
|
-
return Promise.race([n,
|
|
6707
|
+
return Promise.race([n, ar(e, t)]);
|
|
6760
6708
|
})));
|
|
6761
6709
|
}
|
|
6762
|
-
var
|
|
6763
|
-
function
|
|
6764
|
-
return
|
|
6710
|
+
var cr = "0.19.1";
|
|
6711
|
+
function ur() {
|
|
6712
|
+
return cr;
|
|
6765
6713
|
}
|
|
6766
6714
|
function Gt() {
|
|
6767
6715
|
return X(this, void 0, void 0, (function() {
|
|
@@ -6769,7 +6717,7 @@ function Gt() {
|
|
|
6769
6717
|
return Z(this, (function(r) {
|
|
6770
6718
|
switch (r.label) {
|
|
6771
6719
|
case 0:
|
|
6772
|
-
return r.trys.push([0, 2, , 3]), o =
|
|
6720
|
+
return r.trys.push([0, 2, , 3]), o = or(), e = Object.keys(o), [4, lr(Object.values(o), q?.timeout || 1e3, ir)];
|
|
6773
6721
|
case 1:
|
|
6774
6722
|
return t = r.sent(), n = t.filter((function(i) {
|
|
6775
6723
|
return i !== void 0;
|
|
@@ -6805,7 +6753,7 @@ function Xt(o, e, t, n) {
|
|
|
6805
6753
|
}
|
|
6806
6754
|
return s;
|
|
6807
6755
|
}
|
|
6808
|
-
function
|
|
6756
|
+
function hr(o) {
|
|
6809
6757
|
return X(this, void 0, void 0, (function() {
|
|
6810
6758
|
var e, t;
|
|
6811
6759
|
return Z(this, (function(n) {
|
|
@@ -6813,13 +6761,13 @@ function yr(o) {
|
|
|
6813
6761
|
case 0:
|
|
6814
6762
|
return n.trys.push([0, 2, , 3]), [4, Gt()];
|
|
6815
6763
|
case 1:
|
|
6816
|
-
return e = n.sent(), t =
|
|
6764
|
+
return e = n.sent(), t = ot(JSON.stringify(e)), Math.random() < 1e-3 && q.logging && (function(s, r) {
|
|
6817
6765
|
X(this, void 0, void 0, (function() {
|
|
6818
6766
|
var i, a;
|
|
6819
6767
|
return Z(this, (function(c) {
|
|
6820
6768
|
switch (c.label) {
|
|
6821
6769
|
case 0:
|
|
6822
|
-
if (i = "https://logging.thumbmarkjs.com/v1/log", a = { thumbmark: s, components: r, version:
|
|
6770
|
+
if (i = "https://logging.thumbmarkjs.com/v1/log", a = { thumbmark: s, components: r, version: ur() }, sessionStorage.getItem("_tmjs_l")) return [3, 4];
|
|
6823
6771
|
sessionStorage.setItem("_tmjs_l", "1"), c.label = 1;
|
|
6824
6772
|
case 1:
|
|
6825
6773
|
return c.trys.push([1, 3, , 4]), [4, fetch(i, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(a) })];
|
|
@@ -6840,19 +6788,19 @@ function yr(o) {
|
|
|
6840
6788
|
}));
|
|
6841
6789
|
}));
|
|
6842
6790
|
}
|
|
6843
|
-
function
|
|
6791
|
+
function dr(o) {
|
|
6844
6792
|
for (var e = 0, t = 0; t < o.length; ++t) e += Math.abs(o[t]);
|
|
6845
6793
|
return e;
|
|
6846
6794
|
}
|
|
6847
6795
|
function Zt(o, e, t) {
|
|
6848
6796
|
for (var n = [], s = 0; s < o[0].data.length; s++) {
|
|
6849
6797
|
for (var r = [], i = 0; i < o.length; i++) r.push(o[i].data[s]);
|
|
6850
|
-
n.push(
|
|
6798
|
+
n.push(pr(r));
|
|
6851
6799
|
}
|
|
6852
6800
|
var a = new Uint8ClampedArray(n);
|
|
6853
6801
|
return new ImageData(a, e, t);
|
|
6854
6802
|
}
|
|
6855
|
-
function
|
|
6803
|
+
function pr(o) {
|
|
6856
6804
|
if (o.length === 0) return 0;
|
|
6857
6805
|
for (var e = {}, t = 0, n = o; t < n.length; t++)
|
|
6858
6806
|
e[r = n[t]] = (e[r] || 0) + 1;
|
|
@@ -6860,7 +6808,7 @@ function br(o) {
|
|
|
6860
6808
|
for (var r in e) e[r] > e[s] && (s = parseInt(r, 10));
|
|
6861
6809
|
return s;
|
|
6862
6810
|
}
|
|
6863
|
-
function
|
|
6811
|
+
function Ie() {
|
|
6864
6812
|
if (typeof navigator > "u") return { name: "unknown", version: "unknown" };
|
|
6865
6813
|
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++) {
|
|
6866
6814
|
var s = n[t], r = o.match(s);
|
|
@@ -6868,7 +6816,7 @@ function Te() {
|
|
|
6868
6816
|
}
|
|
6869
6817
|
return { name: "unknown", version: "unknown" };
|
|
6870
6818
|
}
|
|
6871
|
-
|
|
6819
|
+
z("audio", (function() {
|
|
6872
6820
|
return X(this, void 0, void 0, (function() {
|
|
6873
6821
|
return Z(this, (function(o) {
|
|
6874
6822
|
return [2, new Promise((function(e, t) {
|
|
@@ -6877,7 +6825,7 @@ J("audio", (function() {
|
|
|
6877
6825
|
r.frequency.value = 1e3;
|
|
6878
6826
|
var i, a = n.createDynamicsCompressor();
|
|
6879
6827
|
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) {
|
|
6880
|
-
i = c.renderedBuffer.getChannelData(0), e({ sampleHash:
|
|
6828
|
+
i = c.renderedBuffer.getChannelData(0), e({ sampleHash: dr(i), oscillator: r.type, maxChannels: n.destination.maxChannelCount, channelCountMode: s.channelCountMode });
|
|
6881
6829
|
}, n.startRendering();
|
|
6882
6830
|
} catch (c) {
|
|
6883
6831
|
console.error("Error creating audio fingerprint:", c), t(c);
|
|
@@ -6886,10 +6834,10 @@ J("audio", (function() {
|
|
|
6886
6834
|
}));
|
|
6887
6835
|
}));
|
|
6888
6836
|
}));
|
|
6889
|
-
var
|
|
6890
|
-
|
|
6837
|
+
var fr = Ie().name !== "SamsungBrowser" ? 1 : 3, Et = 280, Ot = 20;
|
|
6838
|
+
Ie().name != "Firefox" && z("canvas", (function() {
|
|
6891
6839
|
return document.createElement("canvas").getContext("2d"), new Promise((function(o) {
|
|
6892
|
-
var e = Array.from({ length:
|
|
6840
|
+
var e = Array.from({ length: fr }, (function() {
|
|
6893
6841
|
return (function() {
|
|
6894
6842
|
var t = document.createElement("canvas"), n = t.getContext("2d");
|
|
6895
6843
|
if (!n) return new ImageData(1, 1);
|
|
@@ -6902,15 +6850,15 @@ Te().name != "Firefox" && J("canvas", (function() {
|
|
|
6902
6850
|
return i;
|
|
6903
6851
|
})();
|
|
6904
6852
|
}));
|
|
6905
|
-
o({ commonImageDataHash:
|
|
6853
|
+
o({ commonImageDataHash: ot(Zt(e, Et, Ot).data.toString()).toString() });
|
|
6906
6854
|
}));
|
|
6907
6855
|
}));
|
|
6908
|
-
var
|
|
6856
|
+
var et, mr = ["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"], yr = ["monospace", "sans-serif", "serif"];
|
|
6909
6857
|
function Rt(o, e) {
|
|
6910
6858
|
if (!o) throw new Error("Canvas context not supported");
|
|
6911
6859
|
return o.font, o.font = "72px ".concat(e), o.measureText("WwMmLli0Oo").width;
|
|
6912
6860
|
}
|
|
6913
|
-
function
|
|
6861
|
+
function gr() {
|
|
6914
6862
|
var o, e = document.createElement("canvas"), t = (o = e.getContext("webgl")) !== null && o !== void 0 ? o : e.getContext("experimental-webgl");
|
|
6915
6863
|
if (t && "getParameter" in t) try {
|
|
6916
6864
|
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() };
|
|
@@ -6926,11 +6874,11 @@ function Sr() {
|
|
|
6926
6874
|
}
|
|
6927
6875
|
return "undefined";
|
|
6928
6876
|
}
|
|
6929
|
-
function
|
|
6877
|
+
function br() {
|
|
6930
6878
|
var o = new Float32Array(1), e = new Uint8Array(o.buffer);
|
|
6931
6879
|
return o[0] = 1 / 0, o[0] = o[0] - o[0], e[3];
|
|
6932
6880
|
}
|
|
6933
|
-
function
|
|
6881
|
+
function wr(o, e) {
|
|
6934
6882
|
var t = {};
|
|
6935
6883
|
return e.forEach((function(n) {
|
|
6936
6884
|
var s = (function(r) {
|
|
@@ -6952,7 +6900,7 @@ function Ar(o, e) {
|
|
|
6952
6900
|
s && (t[n] = s);
|
|
6953
6901
|
})), t;
|
|
6954
6902
|
}
|
|
6955
|
-
function
|
|
6903
|
+
function kr() {
|
|
6956
6904
|
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"] };
|
|
6957
6905
|
return Object.keys(e).forEach((function(t) {
|
|
6958
6906
|
e[t].forEach((function(n) {
|
|
@@ -6960,7 +6908,7 @@ function vr() {
|
|
|
6960
6908
|
}));
|
|
6961
6909
|
})), o;
|
|
6962
6910
|
}
|
|
6963
|
-
function
|
|
6911
|
+
function _r() {
|
|
6964
6912
|
if (window.location.protocol === "https:" && typeof window.ApplePaySession == "function") try {
|
|
6965
6913
|
for (var o = window.ApplePaySession.supportsVersion, e = 15; e > 0; e--) if (o(e)) return e;
|
|
6966
6914
|
} catch {
|
|
@@ -6968,7 +6916,7 @@ function xr() {
|
|
|
6968
6916
|
}
|
|
6969
6917
|
return 0;
|
|
6970
6918
|
}
|
|
6971
|
-
|
|
6919
|
+
Ie().name != "Firefox" && z("fonts", (function() {
|
|
6972
6920
|
var o = this;
|
|
6973
6921
|
return new Promise((function(e, t) {
|
|
6974
6922
|
try {
|
|
@@ -6998,9 +6946,9 @@ Te().name != "Firefox" && J("fonts", (function() {
|
|
|
6998
6946
|
return X(o, void 0, void 0, (function() {
|
|
6999
6947
|
var r, i, a, c;
|
|
7000
6948
|
return Z(this, (function(u) {
|
|
7001
|
-
return r = s.createElement("canvas"), i = r.getContext("2d"), a =
|
|
6949
|
+
return r = s.createElement("canvas"), i = r.getContext("2d"), a = yr.map((function(l) {
|
|
7002
6950
|
return Rt(i, l);
|
|
7003
|
-
})), c = {},
|
|
6951
|
+
})), c = {}, mr.forEach((function(l) {
|
|
7004
6952
|
var h = Rt(i, l);
|
|
7005
6953
|
a.includes(h) || (c[l] = h);
|
|
7006
6954
|
})), e(c), [2];
|
|
@@ -7011,27 +6959,27 @@ Te().name != "Firefox" && J("fonts", (function() {
|
|
|
7011
6959
|
t({ error: "unsupported" });
|
|
7012
6960
|
}
|
|
7013
6961
|
}));
|
|
7014
|
-
})),
|
|
6962
|
+
})), z("hardware", (function() {
|
|
7015
6963
|
return new Promise((function(o, e) {
|
|
7016
6964
|
var t = navigator.deviceMemory !== void 0 ? navigator.deviceMemory : 0, n = window.performance && window.performance.memory ? window.performance.memory : 0;
|
|
7017
|
-
o({ videocard:
|
|
6965
|
+
o({ videocard: gr(), architecture: br(), deviceMemory: t.toString() || "undefined", jsHeapSizeLimit: n.jsHeapSizeLimit || 0 });
|
|
7018
6966
|
}));
|
|
7019
|
-
})),
|
|
6967
|
+
})), z("locales", (function() {
|
|
7020
6968
|
return new Promise((function(o) {
|
|
7021
6969
|
o({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
|
|
7022
6970
|
}));
|
|
7023
|
-
})),
|
|
6971
|
+
})), z("permissions", (function() {
|
|
7024
6972
|
return X(this, void 0, void 0, (function() {
|
|
7025
6973
|
var o;
|
|
7026
6974
|
return Z(this, (function(e) {
|
|
7027
|
-
return
|
|
6975
|
+
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() {
|
|
7028
6976
|
return (function() {
|
|
7029
6977
|
return X(this, void 0, void 0, (function() {
|
|
7030
6978
|
var t, n, s, r, i;
|
|
7031
6979
|
return Z(this, (function(a) {
|
|
7032
6980
|
switch (a.label) {
|
|
7033
6981
|
case 0:
|
|
7034
|
-
t = {}, n = 0, s =
|
|
6982
|
+
t = {}, n = 0, s = et, a.label = 1;
|
|
7035
6983
|
case 1:
|
|
7036
6984
|
if (!(n < s.length)) return [3, 6];
|
|
7037
6985
|
r = s[n], a.label = 2;
|
|
@@ -7050,11 +6998,11 @@ Te().name != "Firefox" && J("fonts", (function() {
|
|
|
7050
6998
|
}));
|
|
7051
6999
|
})();
|
|
7052
7000
|
})), [2, Promise.all(o).then((function(t) {
|
|
7053
|
-
return
|
|
7001
|
+
return wr(t, et);
|
|
7054
7002
|
}))];
|
|
7055
7003
|
}));
|
|
7056
7004
|
}));
|
|
7057
|
-
})),
|
|
7005
|
+
})), z("plugins", (function() {
|
|
7058
7006
|
var o = [];
|
|
7059
7007
|
if (navigator.plugins) for (var e = 0; e < navigator.plugins.length; e++) {
|
|
7060
7008
|
var t = navigator.plugins[e];
|
|
@@ -7063,25 +7011,25 @@ Te().name != "Firefox" && J("fonts", (function() {
|
|
|
7063
7011
|
return new Promise((function(n) {
|
|
7064
7012
|
n({ plugins: o });
|
|
7065
7013
|
}));
|
|
7066
|
-
})),
|
|
7014
|
+
})), z("screen", (function() {
|
|
7067
7015
|
return new Promise((function(o) {
|
|
7068
|
-
o({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches:
|
|
7016
|
+
o({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: kr() });
|
|
7069
7017
|
}));
|
|
7070
|
-
})),
|
|
7018
|
+
})), z("system", (function() {
|
|
7071
7019
|
return new Promise((function(o) {
|
|
7072
|
-
var e =
|
|
7073
|
-
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:
|
|
7020
|
+
var e = Ie();
|
|
7021
|
+
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: _r() });
|
|
7074
7022
|
}));
|
|
7075
7023
|
}));
|
|
7076
|
-
var
|
|
7077
|
-
|
|
7024
|
+
var K, Sr = Ie().name !== "SamsungBrowser" ? 1 : 3, y = null;
|
|
7025
|
+
z("webgl", (function() {
|
|
7078
7026
|
return X(this, void 0, void 0, (function() {
|
|
7079
7027
|
var o;
|
|
7080
7028
|
return Z(this, (function(e) {
|
|
7081
|
-
typeof document < "u" && ((
|
|
7029
|
+
typeof document < "u" && ((K = document.createElement("canvas")).width = 200, K.height = 100, y = K.getContext("webgl"));
|
|
7082
7030
|
try {
|
|
7083
7031
|
if (!y) throw new Error("WebGL not supported");
|
|
7084
|
-
return o = Array.from({ length:
|
|
7032
|
+
return o = Array.from({ length: Sr }, (function() {
|
|
7085
7033
|
return (function() {
|
|
7086
7034
|
try {
|
|
7087
7035
|
if (!y) throw new Error("WebGL not supported");
|
|
@@ -7105,21 +7053,21 @@ J("webgl", (function() {
|
|
|
7105
7053
|
y.useProgram(i);
|
|
7106
7054
|
for (var a = 137, c = new Float32Array(4 * a), u = 2 * Math.PI / a, l = 0; l < a; l++) {
|
|
7107
7055
|
var h = l * u;
|
|
7108
|
-
c[4 * l] = 0, c[4 * l + 1] = 0, c[4 * l + 2] = Math.cos(h) * (
|
|
7056
|
+
c[4 * l] = 0, c[4 * l + 1] = 0, c[4 * l + 2] = Math.cos(h) * (K.width / 2), c[4 * l + 3] = Math.sin(h) * (K.height / 2);
|
|
7109
7057
|
}
|
|
7110
7058
|
var p = y.createBuffer();
|
|
7111
7059
|
y.bindBuffer(y.ARRAY_BUFFER, p), y.bufferData(y.ARRAY_BUFFER, c, y.STATIC_DRAW);
|
|
7112
7060
|
var d = y.getAttribLocation(i, "position");
|
|
7113
|
-
y.enableVertexAttribArray(d), y.vertexAttribPointer(d, 2, y.FLOAT, !1, 0, 0), y.viewport(0, 0,
|
|
7114
|
-
var b = new Uint8ClampedArray(
|
|
7115
|
-
return y.readPixels(0, 0,
|
|
7061
|
+
y.enableVertexAttribArray(d), y.vertexAttribPointer(d, 2, y.FLOAT, !1, 0, 0), y.viewport(0, 0, K.width, K.height), y.clearColor(0, 0, 0, 1), y.clear(y.COLOR_BUFFER_BIT), y.drawArrays(y.LINES, 0, 2 * a);
|
|
7062
|
+
var b = new Uint8ClampedArray(K.width * K.height * 4);
|
|
7063
|
+
return y.readPixels(0, 0, K.width, K.height, y.RGBA, y.UNSIGNED_BYTE, b), new ImageData(b, K.width, K.height);
|
|
7116
7064
|
} catch {
|
|
7117
7065
|
return new ImageData(1, 1);
|
|
7118
7066
|
} finally {
|
|
7119
7067
|
y && (y.bindBuffer(y.ARRAY_BUFFER, null), y.useProgram(null), y.viewport(0, 0, y.drawingBufferWidth, y.drawingBufferHeight), y.clearColor(0, 0, 0, 0));
|
|
7120
7068
|
}
|
|
7121
7069
|
})();
|
|
7122
|
-
})), [2, { commonImageHash:
|
|
7070
|
+
})), [2, { commonImageHash: ot(Zt(o, K.width, K.height).data.toString()).toString() }];
|
|
7123
7071
|
} catch {
|
|
7124
7072
|
return [2, { webgl: "unsupported" }];
|
|
7125
7073
|
}
|
|
@@ -7127,40 +7075,49 @@ J("webgl", (function() {
|
|
|
7127
7075
|
}));
|
|
7128
7076
|
}));
|
|
7129
7077
|
}));
|
|
7130
|
-
var
|
|
7078
|
+
var re = function(o, e, t, n) {
|
|
7131
7079
|
for (var s = (t - e) / n, r = 0, i = 0; i < n; i++)
|
|
7132
7080
|
r += o(e + (i + 0.5) * s);
|
|
7133
7081
|
return r * s;
|
|
7134
7082
|
};
|
|
7135
|
-
|
|
7083
|
+
z("math", (function() {
|
|
7136
7084
|
return X(void 0, void 0, void 0, (function() {
|
|
7137
7085
|
return Z(this, (function(o) {
|
|
7138
|
-
return [2, { acos: Math.acos(0.5), asin:
|
|
7086
|
+
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) }];
|
|
7139
7087
|
}));
|
|
7140
7088
|
}));
|
|
7141
7089
|
}));
|
|
7142
|
-
|
|
7090
|
+
const $r = "query ( $Hash: String! ) { CipherHash ( Hash: $Hash ) { hash } }";
|
|
7091
|
+
function Ar(o) {
|
|
7092
|
+
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;
|
|
7093
|
+
return { type: t, name: s ? s[0] : "" };
|
|
7094
|
+
}
|
|
7095
|
+
class vr {
|
|
7143
7096
|
constructor({ serverUri: e, socket: t = null, encrypt: n = !1 }) {
|
|
7144
7097
|
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();
|
|
7145
7098
|
}
|
|
7146
7099
|
createUrqlClient({ serverUri: e, socket: t, encrypt: n }) {
|
|
7147
|
-
const s = [
|
|
7100
|
+
const s = [en, tn];
|
|
7148
7101
|
if (t && t.socketUri) {
|
|
7149
|
-
const r =
|
|
7102
|
+
const r = rn({
|
|
7150
7103
|
url: t.socketUri,
|
|
7151
7104
|
connectionParams: () => ({
|
|
7152
7105
|
authToken: this.$__authToken
|
|
7153
7106
|
})
|
|
7154
7107
|
});
|
|
7155
|
-
s.push(
|
|
7108
|
+
s.push(nn({
|
|
7156
7109
|
forwardSubscription: (i) => ({
|
|
7157
7110
|
subscribe: (a) => ({ unsubscribe: r.subscribe(i, a) })
|
|
7158
7111
|
})
|
|
7159
7112
|
}));
|
|
7160
7113
|
}
|
|
7161
|
-
return
|
|
7114
|
+
return sn({
|
|
7162
7115
|
url: e,
|
|
7163
7116
|
exchanges: s,
|
|
7117
|
+
// PQ-transport Phase E: when encryption is on, route fetch through the CipherHash
|
|
7118
|
+
// wrapper (encrypt the request body to the validator's ML-KEM pubkey, decrypt the
|
|
7119
|
+
// response). Undefined → urql uses the global fetch (plaintext).
|
|
7120
|
+
...n ? { fetch: (r, i) => this.cipherFetch(r, i) } : {},
|
|
7164
7121
|
fetchOptions: () => ({
|
|
7165
7122
|
headers: {
|
|
7166
7123
|
"X-Auth-Token": this.$__authToken
|
|
@@ -7170,6 +7127,50 @@ class Tr {
|
|
|
7170
7127
|
})
|
|
7171
7128
|
});
|
|
7172
7129
|
}
|
|
7130
|
+
/**
|
|
7131
|
+
* Whether an outgoing GraphQL request body should be wrapped in CipherHash. Bypass (plaintext):
|
|
7132
|
+
* introspection `__schema`, `ContinuId`, the `AccessToken` mutation, and the U-isotope
|
|
7133
|
+
* `ProposeMolecule` (auth bootstrap — the key exchange itself can't be encrypted). Mirrors the
|
|
7134
|
+
* Kotlin/validator bypass set.
|
|
7135
|
+
*/
|
|
7136
|
+
shouldEncrypt(e) {
|
|
7137
|
+
let t;
|
|
7138
|
+
try {
|
|
7139
|
+
t = JSON.parse(e);
|
|
7140
|
+
} catch {
|
|
7141
|
+
return !1;
|
|
7142
|
+
}
|
|
7143
|
+
const { type: n, name: s } = Ar(t.query);
|
|
7144
|
+
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");
|
|
7145
|
+
}
|
|
7146
|
+
/**
|
|
7147
|
+
* Custom `fetch` that wraps a GraphQL request in the ML-KEM CipherHash envelope and decrypts the
|
|
7148
|
+
* response (PQ-transport Phase E). Operates on the raw POST body (mirrors Kotlin's
|
|
7149
|
+
* encryptBody/decryptBody). Reads the CURRENT client wallet + validator pubkey from auth.
|
|
7150
|
+
*/
|
|
7151
|
+
async cipherFetch(e, t) {
|
|
7152
|
+
const n = this.getWallet(), s = this.getPubKey();
|
|
7153
|
+
let r = !1, i = t;
|
|
7154
|
+
if (n && s && t && typeof t.body == "string" && this.shouldEncrypt(t.body)) {
|
|
7155
|
+
const d = await n.encryptStringML768(t.body, s);
|
|
7156
|
+
i = { ...t, body: JSON.stringify({ query: $r, variables: { Hash: d } }) }, r = !0;
|
|
7157
|
+
}
|
|
7158
|
+
const a = await fetch(e, i);
|
|
7159
|
+
if (!r)
|
|
7160
|
+
return a;
|
|
7161
|
+
const c = await a.text(), u = { status: a.status, statusText: a.statusText, headers: a.headers };
|
|
7162
|
+
let l;
|
|
7163
|
+
try {
|
|
7164
|
+
l = JSON.parse(c);
|
|
7165
|
+
} catch {
|
|
7166
|
+
return new Response(c, u);
|
|
7167
|
+
}
|
|
7168
|
+
const h = l && l.data && l.data.CipherHash && l.data.CipherHash.hash;
|
|
7169
|
+
if (typeof h != "string")
|
|
7170
|
+
return new Response(c, u);
|
|
7171
|
+
const p = await n.decryptMyMessageML768(JSON.parse(h));
|
|
7172
|
+
return new Response(p ?? c, u);
|
|
7173
|
+
}
|
|
7173
7174
|
setAuthData({ token: e, pubkey: t, wallet: n }) {
|
|
7174
7175
|
this.$__authToken = e, this.$__pubkey = t, this.$__wallet = n, this.$__client = this.createUrqlClient({
|
|
7175
7176
|
serverUri: this.serverUri,
|
|
@@ -7216,12 +7217,12 @@ class Tr {
|
|
|
7216
7217
|
return this.formatResponse(i);
|
|
7217
7218
|
}
|
|
7218
7219
|
subscribe(e, t) {
|
|
7219
|
-
const { query: n, variables: s, operationName: r } = e, i =
|
|
7220
|
+
const { query: n, variables: s, operationName: r } = e, i = on(
|
|
7220
7221
|
this.$__client.subscription(n, s),
|
|
7221
|
-
|
|
7222
|
+
an((a) => {
|
|
7222
7223
|
t(this.formatResponse(a));
|
|
7223
7224
|
}),
|
|
7224
|
-
|
|
7225
|
+
ln(() => {
|
|
7225
7226
|
})
|
|
7226
7227
|
);
|
|
7227
7228
|
return this.$__subscriptionManager.set(r, i), {
|
|
@@ -7289,7 +7290,7 @@ class Tr {
|
|
|
7289
7290
|
});
|
|
7290
7291
|
}
|
|
7291
7292
|
}
|
|
7292
|
-
class
|
|
7293
|
+
class Or {
|
|
7293
7294
|
/**
|
|
7294
7295
|
* Class constructor
|
|
7295
7296
|
*
|
|
@@ -7343,7 +7344,7 @@ class Wr {
|
|
|
7343
7344
|
const u = this.$__uris[c];
|
|
7344
7345
|
this.$__authTokenObjects[u] = null;
|
|
7345
7346
|
}
|
|
7346
|
-
this.log("info", `KnishIOClient::initialize() - Initializing new Knish.IO client session for SDK version ${r}...`), this.$__client = s || new
|
|
7347
|
+
this.log("info", `KnishIOClient::initialize() - Initializing new Knish.IO client session for SDK version ${r}...`), this.$__client = s || new vr({
|
|
7347
7348
|
socket: {
|
|
7348
7349
|
socketUri: null,
|
|
7349
7350
|
appKey: "knishio",
|
|
@@ -7382,7 +7383,7 @@ class Wr {
|
|
|
7382
7383
|
*/
|
|
7383
7384
|
subscribe() {
|
|
7384
7385
|
if (!this.client().getSocketUri())
|
|
7385
|
-
throw new
|
|
7386
|
+
throw new Y("KnishIOClient::subscribe() - Socket client not initialized!");
|
|
7386
7387
|
return this.client();
|
|
7387
7388
|
}
|
|
7388
7389
|
/**
|
|
@@ -7506,7 +7507,7 @@ class Wr {
|
|
|
7506
7507
|
* @returns {string}
|
|
7507
7508
|
*/
|
|
7508
7509
|
hashSecret(e, t = null) {
|
|
7509
|
-
return this.log("info", `KnishIOClient::hashSecret(${t ? `source: ${t}` : ""}) - Computing wallet bundle from secret...`),
|
|
7510
|
+
return this.log("info", `KnishIOClient::hashSecret(${t ? `source: ${t}` : ""}) - Computing wallet bundle from secret...`), de(e);
|
|
7510
7511
|
}
|
|
7511
7512
|
/**
|
|
7512
7513
|
* Retrieves the stored secret for this session
|
|
@@ -7515,7 +7516,7 @@ class Wr {
|
|
|
7515
7516
|
*/
|
|
7516
7517
|
getSecret() {
|
|
7517
7518
|
if (!this.hasSecret())
|
|
7518
|
-
throw new
|
|
7519
|
+
throw new Pe("KnishIOClient::getSecret() - Unable to find a stored secret! Have you set a secret?");
|
|
7519
7520
|
return this.$__secret;
|
|
7520
7521
|
}
|
|
7521
7522
|
/**
|
|
@@ -7533,7 +7534,7 @@ class Wr {
|
|
|
7533
7534
|
*/
|
|
7534
7535
|
getBundle() {
|
|
7535
7536
|
if (!this.hasBundle())
|
|
7536
|
-
throw new
|
|
7537
|
+
throw new Pe("KnishIOClient::getBundle() - Unable to find a stored bundle! Have you set a secret?");
|
|
7537
7538
|
return this.$__bundle;
|
|
7538
7539
|
}
|
|
7539
7540
|
/**
|
|
@@ -7542,7 +7543,7 @@ class Wr {
|
|
|
7542
7543
|
* @returns {Promise<string>} A promise that resolves to the device fingerprint as a string.
|
|
7543
7544
|
*/
|
|
7544
7545
|
getFingerprint() {
|
|
7545
|
-
return
|
|
7546
|
+
return hr();
|
|
7546
7547
|
}
|
|
7547
7548
|
getFingerprintData() {
|
|
7548
7549
|
return Gt();
|
|
@@ -7602,7 +7603,7 @@ class Wr {
|
|
|
7602
7603
|
token: "USER",
|
|
7603
7604
|
batchId: n.batchId,
|
|
7604
7605
|
characters: n.characters
|
|
7605
|
-
}), new
|
|
7606
|
+
}), new V({
|
|
7606
7607
|
secret: e,
|
|
7607
7608
|
sourceWallet: n,
|
|
7608
7609
|
remainderWallet: this.getRemainderWallet(),
|
|
@@ -7642,7 +7643,7 @@ class Wr {
|
|
|
7642
7643
|
this.log("info", `KnishIOClient::createMoleculeQuery() - Creating a new ${e.name} query...`);
|
|
7643
7644
|
const n = t || await this.createMolecule({}), s = new e(this.client(), this, n);
|
|
7644
7645
|
if (!(s instanceof W))
|
|
7645
|
-
throw new
|
|
7646
|
+
throw new Y(`${this.constructor.name}::createMoleculeMutation() - This method only accepts MutationProposeMolecule!`);
|
|
7646
7647
|
return this.lastMoleculeQuery = s, s;
|
|
7647
7648
|
}
|
|
7648
7649
|
/**
|
|
@@ -7707,7 +7708,7 @@ class Wr {
|
|
|
7707
7708
|
bundle: t = null,
|
|
7708
7709
|
type: n = "regular"
|
|
7709
7710
|
}) {
|
|
7710
|
-
const s = this.createQuery(
|
|
7711
|
+
const s = this.createQuery(fs);
|
|
7711
7712
|
return this.executeQuery(s, {
|
|
7712
7713
|
bundleHash: t || this.getBundle(),
|
|
7713
7714
|
token: e,
|
|
@@ -7730,10 +7731,10 @@ class Wr {
|
|
|
7730
7731
|
token: e,
|
|
7731
7732
|
type: n
|
|
7732
7733
|
})).payload();
|
|
7733
|
-
if (s === null ||
|
|
7734
|
-
throw new
|
|
7734
|
+
if (s === null || le.cmp(s.balance, t) < 0)
|
|
7735
|
+
throw new J();
|
|
7735
7736
|
if (!s.position || !s.address)
|
|
7736
|
-
throw new
|
|
7737
|
+
throw new J("Source wallet can not be a shadow wallet.");
|
|
7737
7738
|
return s;
|
|
7738
7739
|
}
|
|
7739
7740
|
/**
|
|
@@ -7745,7 +7746,7 @@ class Wr {
|
|
|
7745
7746
|
bundle: e,
|
|
7746
7747
|
closure: t
|
|
7747
7748
|
}) {
|
|
7748
|
-
return await this.createSubscribe(
|
|
7749
|
+
return await this.createSubscribe(Ns).execute({
|
|
7749
7750
|
variables: {
|
|
7750
7751
|
bundle: e || this.getBundle()
|
|
7751
7752
|
},
|
|
@@ -7766,8 +7767,8 @@ class Wr {
|
|
|
7766
7767
|
closure: n
|
|
7767
7768
|
}) {
|
|
7768
7769
|
if (!t)
|
|
7769
|
-
throw new
|
|
7770
|
-
return this.createSubscribe(
|
|
7770
|
+
throw new Y(`${this.constructor.name}::subscribeWalletStatus() - Token parameter is required!`);
|
|
7771
|
+
return this.createSubscribe(Ls).execute({
|
|
7771
7772
|
variables: {
|
|
7772
7773
|
bundle: e || this.getBundle(),
|
|
7773
7774
|
token: t
|
|
@@ -7786,7 +7787,7 @@ class Wr {
|
|
|
7786
7787
|
bundle: e,
|
|
7787
7788
|
closure: t
|
|
7788
7789
|
}) {
|
|
7789
|
-
return this.createSubscribe(
|
|
7790
|
+
return this.createSubscribe(Fs).execute({
|
|
7790
7791
|
variables: {
|
|
7791
7792
|
bundle: e || this.getBundle()
|
|
7792
7793
|
},
|
|
@@ -7806,7 +7807,7 @@ class Wr {
|
|
|
7806
7807
|
metaId: t,
|
|
7807
7808
|
closure: n
|
|
7808
7809
|
}) {
|
|
7809
|
-
return this.createSubscribe(
|
|
7810
|
+
return this.createSubscribe(Qs).execute({
|
|
7810
7811
|
variables: {
|
|
7811
7812
|
metaType: e,
|
|
7812
7813
|
metaId: t
|
|
@@ -7865,7 +7866,7 @@ class Wr {
|
|
|
7865
7866
|
}) {
|
|
7866
7867
|
this.log("info", `KnishIOClient::queryMeta() - Querying metaType: ${e}, metaId: ${t}...`);
|
|
7867
7868
|
let f, m;
|
|
7868
|
-
return p ? (f = this.createQuery(
|
|
7869
|
+
return p ? (f = this.createQuery(Tt), m = Tt.createVariables({
|
|
7869
7870
|
metaType: e,
|
|
7870
7871
|
metaId: t,
|
|
7871
7872
|
key: n,
|
|
@@ -7878,7 +7879,7 @@ class Wr {
|
|
|
7878
7879
|
keys: b,
|
|
7879
7880
|
atomValues: A,
|
|
7880
7881
|
cellSlug: this.getCellSlug()
|
|
7881
|
-
})) : h ? (f = this.createQuery(
|
|
7882
|
+
})) : h ? (f = this.createQuery(Mt), m = Mt.createVariables({
|
|
7882
7883
|
metaType: e,
|
|
7883
7884
|
metaId: t,
|
|
7884
7885
|
key: n,
|
|
@@ -7891,7 +7892,7 @@ class Wr {
|
|
|
7891
7892
|
keys: b,
|
|
7892
7893
|
atomValues: A,
|
|
7893
7894
|
cellSlug: this.getCellSlug()
|
|
7894
|
-
})) : (f = this.createQuery(
|
|
7895
|
+
})) : (f = this.createQuery($t), m = $t.createVariables({
|
|
7895
7896
|
metaType: e,
|
|
7896
7897
|
metaId: t,
|
|
7897
7898
|
key: n,
|
|
@@ -7926,18 +7927,17 @@ class Wr {
|
|
|
7926
7927
|
* @return {Promise<boolean>}
|
|
7927
7928
|
*/
|
|
7928
7929
|
async hasQueryField(e) {
|
|
7929
|
-
var s, r, i;
|
|
7930
7930
|
const n = `${this.getUri()}::${e}`;
|
|
7931
7931
|
if (typeof this.$__capabilityCache[n] == "boolean")
|
|
7932
7932
|
return this.$__capabilityCache[n];
|
|
7933
7933
|
try {
|
|
7934
|
-
const
|
|
7934
|
+
const i = ((await this.$__client.query({
|
|
7935
7935
|
query: "{ __schema { queryType { fields { name } } } }",
|
|
7936
7936
|
variables: {}
|
|
7937
|
-
})
|
|
7938
|
-
return this.$__capabilityCache[n] =
|
|
7939
|
-
} catch (
|
|
7940
|
-
return this.log("warn", `KnishIOClient::hasQueryField() - Capability probe for '${e}' failed: ${
|
|
7937
|
+
}))?.data?.__schema?.queryType?.fields || []).some((a) => a.name === e);
|
|
7938
|
+
return this.$__capabilityCache[n] = i, i;
|
|
7939
|
+
} catch (s) {
|
|
7940
|
+
return this.log("warn", `KnishIOClient::hasQueryField() - Capability probe for '${e}' failed: ${s.message}`), this.$__capabilityCache[n] = !1, !1;
|
|
7941
7941
|
}
|
|
7942
7942
|
}
|
|
7943
7943
|
/**
|
|
@@ -7974,7 +7974,7 @@ class Wr {
|
|
|
7974
7974
|
batchId: e
|
|
7975
7975
|
}) {
|
|
7976
7976
|
this.log("info", `KnishIOClient::queryBatch() - Querying cascading meta instances for batchId: ${e}...`);
|
|
7977
|
-
const t = this.createQuery(
|
|
7977
|
+
const t = this.createQuery(xe);
|
|
7978
7978
|
return await this.executeQuery(t, {
|
|
7979
7979
|
batchId: e
|
|
7980
7980
|
});
|
|
@@ -7989,7 +7989,7 @@ class Wr {
|
|
|
7989
7989
|
batchId: e
|
|
7990
7990
|
}) {
|
|
7991
7991
|
this.log("info", `KnishIOClient::queryBatchHistory() - Querying cascading meta instances for batchId: ${e}...`);
|
|
7992
|
-
const t = this.createQuery(
|
|
7992
|
+
const t = this.createQuery(ys);
|
|
7993
7993
|
return await this.executeQuery(t, {
|
|
7994
7994
|
batchId: e
|
|
7995
7995
|
});
|
|
@@ -8049,7 +8049,7 @@ class Wr {
|
|
|
8049
8049
|
values: f,
|
|
8050
8050
|
value: m,
|
|
8051
8051
|
metaTypes: w,
|
|
8052
|
-
metaType:
|
|
8052
|
+
metaType: T,
|
|
8053
8053
|
metaIds: k,
|
|
8054
8054
|
metaId: $,
|
|
8055
8055
|
indexes: v,
|
|
@@ -8083,7 +8083,7 @@ class Wr {
|
|
|
8083
8083
|
values: f,
|
|
8084
8084
|
value: m,
|
|
8085
8085
|
metaTypes: w,
|
|
8086
|
-
metaType:
|
|
8086
|
+
metaType: T,
|
|
8087
8087
|
metaIds: k,
|
|
8088
8088
|
metaId: $,
|
|
8089
8089
|
indexes: v,
|
|
@@ -8106,7 +8106,7 @@ class Wr {
|
|
|
8106
8106
|
secret: this.getSecret(),
|
|
8107
8107
|
token: e
|
|
8108
8108
|
}), n = await this.createMoleculeMutation({
|
|
8109
|
-
mutationClass:
|
|
8109
|
+
mutationClass: Bs
|
|
8110
8110
|
});
|
|
8111
8111
|
return n.fillMolecule(t), await this.executeQuery(n);
|
|
8112
8112
|
}
|
|
@@ -8123,55 +8123,13 @@ class Wr {
|
|
|
8123
8123
|
metaType: t,
|
|
8124
8124
|
metaId: n
|
|
8125
8125
|
}) {
|
|
8126
|
-
const s = this.createQuery(
|
|
8126
|
+
const s = this.createQuery(zs);
|
|
8127
8127
|
return await this.executeQuery(s, {
|
|
8128
8128
|
bundleHash: e,
|
|
8129
8129
|
metaType: t,
|
|
8130
8130
|
metaId: n
|
|
8131
8131
|
});
|
|
8132
8132
|
}
|
|
8133
|
-
/**
|
|
8134
|
-
* Queries user activity based on the provided parameters.
|
|
8135
|
-
*
|
|
8136
|
-
* @param {string} bundleHash - The bundle hash.
|
|
8137
|
-
* @param {string} metaType - The meta type.
|
|
8138
|
-
* @param {string} metaId - The meta ID.
|
|
8139
|
-
* @param {string} ipAddress - The IP address.
|
|
8140
|
-
* @param {string} browser - The browser.
|
|
8141
|
-
* @param {string} osCpu - The operating system and CPU.
|
|
8142
|
-
* @param {string} resolution - The screen resolution.
|
|
8143
|
-
* @param {string} timeZone - The time zone.
|
|
8144
|
-
* @param {string} countBy - The count by parameter.
|
|
8145
|
-
* @param {string} interval - The interval parameter.
|
|
8146
|
-
*
|
|
8147
|
-
* @returns {Promise<ResponseQueryUserActivity>} The result of the query.
|
|
8148
|
-
*/
|
|
8149
|
-
async queryUserActivity({
|
|
8150
|
-
bundleHash: e,
|
|
8151
|
-
metaType: t,
|
|
8152
|
-
metaId: n,
|
|
8153
|
-
ipAddress: s,
|
|
8154
|
-
browser: r,
|
|
8155
|
-
osCpu: i,
|
|
8156
|
-
resolution: a,
|
|
8157
|
-
timeZone: c,
|
|
8158
|
-
countBy: u,
|
|
8159
|
-
interval: l
|
|
8160
|
-
}) {
|
|
8161
|
-
const h = this.createQuery(Ys);
|
|
8162
|
-
return await this.executeQuery(h, {
|
|
8163
|
-
bundleHash: e,
|
|
8164
|
-
metaType: t,
|
|
8165
|
-
metaId: n,
|
|
8166
|
-
ipAddress: s,
|
|
8167
|
-
browser: r,
|
|
8168
|
-
osCpu: i,
|
|
8169
|
-
resolution: a,
|
|
8170
|
-
timeZone: c,
|
|
8171
|
-
countBy: u,
|
|
8172
|
-
interval: l
|
|
8173
|
-
});
|
|
8174
|
-
}
|
|
8175
8133
|
/**
|
|
8176
8134
|
* Builds and executes a molecule to declare an active session for the given MetaType
|
|
8177
8135
|
*
|
|
@@ -8198,7 +8156,7 @@ class Wr {
|
|
|
8198
8156
|
timeZone: c,
|
|
8199
8157
|
json: u = {}
|
|
8200
8158
|
}) {
|
|
8201
|
-
const l = this.createQuery(
|
|
8159
|
+
const l = this.createQuery(Ds);
|
|
8202
8160
|
return await this.executeQuery(l, {
|
|
8203
8161
|
bundleHash: e,
|
|
8204
8162
|
metaType: t,
|
|
@@ -8233,12 +8191,12 @@ class Wr {
|
|
|
8233
8191
|
batchId: s = null,
|
|
8234
8192
|
units: r = []
|
|
8235
8193
|
}) {
|
|
8236
|
-
const i =
|
|
8237
|
-
if (i === "stackable" && (n.batchId = s ||
|
|
8238
|
-
if (
|
|
8239
|
-
throw new
|
|
8194
|
+
const i = M.get(n || {}, "fungibility");
|
|
8195
|
+
if (i === "stackable" && (n.batchId = s || Be({})), ["nonfungible", "stackable"].includes(i) && r.length > 0) {
|
|
8196
|
+
if (M.get(n || {}, "decimals") > 0)
|
|
8197
|
+
throw new Ks();
|
|
8240
8198
|
if (t > 0)
|
|
8241
|
-
throw new
|
|
8199
|
+
throw new ke();
|
|
8242
8200
|
t = r.length, n.splittable = 1, n.decimals = 0, n.tokenUnits = JSON.stringify(r);
|
|
8243
8201
|
}
|
|
8244
8202
|
const a = new S({
|
|
@@ -8247,7 +8205,7 @@ class Wr {
|
|
|
8247
8205
|
token: e,
|
|
8248
8206
|
batchId: s
|
|
8249
8207
|
}), c = await this.createMoleculeMutation({
|
|
8250
|
-
mutationClass:
|
|
8208
|
+
mutationClass: ks
|
|
8251
8209
|
});
|
|
8252
8210
|
return c.fillMolecule({
|
|
8253
8211
|
recipientWallet: a,
|
|
@@ -8272,7 +8230,7 @@ class Wr {
|
|
|
8272
8230
|
}) {
|
|
8273
8231
|
const r = await this.createMoleculeMutation(
|
|
8274
8232
|
{
|
|
8275
|
-
mutationClass:
|
|
8233
|
+
mutationClass: nr,
|
|
8276
8234
|
molecule: await this.createMolecule({
|
|
8277
8235
|
secret: this.getSecret()
|
|
8278
8236
|
})
|
|
@@ -8302,7 +8260,7 @@ class Wr {
|
|
|
8302
8260
|
}) {
|
|
8303
8261
|
const r = await this.createMoleculeMutation(
|
|
8304
8262
|
{
|
|
8305
|
-
mutationClass:
|
|
8263
|
+
mutationClass: Ts,
|
|
8306
8264
|
molecule: await this.createMolecule({
|
|
8307
8265
|
secret: this.getSecret()
|
|
8308
8266
|
})
|
|
@@ -8325,7 +8283,7 @@ class Wr {
|
|
|
8325
8283
|
host: e
|
|
8326
8284
|
}) {
|
|
8327
8285
|
const t = await this.createMoleculeMutation({
|
|
8328
|
-
mutationClass:
|
|
8286
|
+
mutationClass: Es,
|
|
8329
8287
|
molecule: await this.createMolecule({
|
|
8330
8288
|
secret: this.getSecret()
|
|
8331
8289
|
})
|
|
@@ -8350,7 +8308,7 @@ class Wr {
|
|
|
8350
8308
|
meta: s = {}
|
|
8351
8309
|
}) {
|
|
8352
8310
|
const r = await this.createMoleculeMutation({
|
|
8353
|
-
mutationClass:
|
|
8311
|
+
mutationClass: Rs,
|
|
8354
8312
|
molecule: await this.createMolecule({
|
|
8355
8313
|
secret: this.getSecret()
|
|
8356
8314
|
})
|
|
@@ -8376,7 +8334,7 @@ class Wr {
|
|
|
8376
8334
|
code: n
|
|
8377
8335
|
}) {
|
|
8378
8336
|
const s = await this.createMoleculeMutation({
|
|
8379
|
-
mutationClass:
|
|
8337
|
+
mutationClass: vs
|
|
8380
8338
|
});
|
|
8381
8339
|
return s.fillMolecule({
|
|
8382
8340
|
type: e,
|
|
@@ -8395,7 +8353,7 @@ class Wr {
|
|
|
8395
8353
|
type: e,
|
|
8396
8354
|
contact: t
|
|
8397
8355
|
}) {
|
|
8398
|
-
const n = this.createQuery(
|
|
8356
|
+
const n = this.createQuery(Ws);
|
|
8399
8357
|
return await this.executeQuery(n, {
|
|
8400
8358
|
bundle: this.getBundle(),
|
|
8401
8359
|
type: e,
|
|
@@ -8442,7 +8400,7 @@ class Wr {
|
|
|
8442
8400
|
metaType: e,
|
|
8443
8401
|
metaId: t
|
|
8444
8402
|
}) {
|
|
8445
|
-
const n = this.createQuery(
|
|
8403
|
+
const n = this.createQuery(Zs);
|
|
8446
8404
|
return await this.executeQuery(n, {
|
|
8447
8405
|
metaType: e,
|
|
8448
8406
|
metaId: t
|
|
@@ -8464,7 +8422,7 @@ class Wr {
|
|
|
8464
8422
|
unspent: n = !0
|
|
8465
8423
|
}) {
|
|
8466
8424
|
this.log("info", `KnishIOClient::queryWallets() - Querying wallets${e ? ` for ${e}` : ""}...`);
|
|
8467
|
-
const s = this.createQuery(
|
|
8425
|
+
const s = this.createQuery(ds);
|
|
8468
8426
|
return this.executeQuery(s, {
|
|
8469
8427
|
bundleHash: e || this.getBundle(),
|
|
8470
8428
|
token: t,
|
|
@@ -8486,7 +8444,7 @@ class Wr {
|
|
|
8486
8444
|
raw: n = !1
|
|
8487
8445
|
}) {
|
|
8488
8446
|
this.log("info", `KnishIOClient::queryBundle() - Querying wallet bundle metadata${e ? ` for ${e}` : ""}...`), e || (e = this.getBundle()), typeof e == "string" && (e = [e]);
|
|
8489
|
-
const s = this.createQuery(
|
|
8447
|
+
const s = this.createQuery(hs);
|
|
8490
8448
|
return this.executeQuery(s, { bundleHashes: e }).then((r) => n ? r : r.payload());
|
|
8491
8449
|
}
|
|
8492
8450
|
/**
|
|
@@ -8498,7 +8456,7 @@ class Wr {
|
|
|
8498
8456
|
async queryContinuId({
|
|
8499
8457
|
bundle: e
|
|
8500
8458
|
}) {
|
|
8501
|
-
const t = this.createQuery(
|
|
8459
|
+
const t = this.createQuery(cs);
|
|
8502
8460
|
return this.executeQuery(t, {
|
|
8503
8461
|
bundle: e
|
|
8504
8462
|
});
|
|
@@ -8530,14 +8488,14 @@ class Wr {
|
|
|
8530
8488
|
}) {
|
|
8531
8489
|
let a, c;
|
|
8532
8490
|
r = r || {};
|
|
8533
|
-
const u = this.createQuery(
|
|
8491
|
+
const u = this.createQuery(Js), l = await this.executeQuery(u, {
|
|
8534
8492
|
slug: e
|
|
8535
|
-
}), h =
|
|
8493
|
+
}), h = M.get(l.data(), "0.fungibility") === "stackable";
|
|
8536
8494
|
if (!h && i !== null)
|
|
8537
|
-
throw new
|
|
8538
|
-
if (h && i === null && (i =
|
|
8495
|
+
throw new We("Expected Batch ID = null for non-stackable tokens.");
|
|
8496
|
+
if (h && i === null && (i = Be({})), s.length > 0) {
|
|
8539
8497
|
if (n > 0)
|
|
8540
|
-
throw new
|
|
8498
|
+
throw new ke();
|
|
8541
8499
|
n = s.length, r.tokenUnits = JSON.stringify(s);
|
|
8542
8500
|
}
|
|
8543
8501
|
t ? (Object.prototype.toString.call(t) === "[object String]" && (S.isBundleHash(t) ? (a = "walletBundle", c = t) : t = S.create({
|
|
@@ -8545,7 +8503,7 @@ class Wr {
|
|
|
8545
8503
|
token: e
|
|
8546
8504
|
})), t instanceof S && (a = "wallet", r.position = t.position, r.bundle = t.bundle, c = t.address)) : (a = "walletBundle", c = this.getBundle());
|
|
8547
8505
|
const p = await this.createMoleculeMutation({
|
|
8548
|
-
mutationClass:
|
|
8506
|
+
mutationClass: Ss
|
|
8549
8507
|
});
|
|
8550
8508
|
return p.fillMolecule({
|
|
8551
8509
|
token: e,
|
|
@@ -8571,7 +8529,7 @@ class Wr {
|
|
|
8571
8529
|
molecule: n = null
|
|
8572
8530
|
}) {
|
|
8573
8531
|
const s = await this.createMoleculeMutation({
|
|
8574
|
-
mutationClass:
|
|
8532
|
+
mutationClass: Is,
|
|
8575
8533
|
molecule: n
|
|
8576
8534
|
});
|
|
8577
8535
|
return s.fillMolecule({
|
|
@@ -8631,14 +8589,14 @@ class Wr {
|
|
|
8631
8589
|
}) {
|
|
8632
8590
|
if (s.length > 0) {
|
|
8633
8591
|
if (n > 0)
|
|
8634
|
-
throw new
|
|
8592
|
+
throw new ke();
|
|
8635
8593
|
n = s.length;
|
|
8636
8594
|
}
|
|
8637
8595
|
if (i === null && (i = await this.querySourceWallet({
|
|
8638
8596
|
token: t,
|
|
8639
8597
|
amount: n
|
|
8640
|
-
})), i === null ||
|
|
8641
|
-
throw new
|
|
8598
|
+
})), i === null || le.cmp(i.balance, n) < 0)
|
|
8599
|
+
throw new J();
|
|
8642
8600
|
const a = S.create({
|
|
8643
8601
|
bundle: e,
|
|
8644
8602
|
token: t
|
|
@@ -8656,7 +8614,7 @@ class Wr {
|
|
|
8656
8614
|
sourceWallet: i,
|
|
8657
8615
|
remainderWallet: c
|
|
8658
8616
|
}), l = await this.createMoleculeMutation({
|
|
8659
|
-
mutationClass:
|
|
8617
|
+
mutationClass: At,
|
|
8660
8618
|
molecule: u
|
|
8661
8619
|
});
|
|
8662
8620
|
return l.fillMolecule({
|
|
@@ -8664,6 +8622,70 @@ class Wr {
|
|
|
8664
8622
|
amount: n
|
|
8665
8623
|
}), await this.executeQuery(l);
|
|
8666
8624
|
}
|
|
8625
|
+
/**
|
|
8626
|
+
* Transfers tokens from one source wallet to MULTIPLE recipients in a single molecule.
|
|
8627
|
+
*
|
|
8628
|
+
* One molecule funds N recipients (WP line 544: "utilizing the sender's Wallet to fund multiple
|
|
8629
|
+
* recipients with one transaction"). Each recipient receives its own amount and, for stackable
|
|
8630
|
+
* tokens, its own subset of token units. The source is fully drained and the unsent change
|
|
8631
|
+
* returns via the remainder atom (UTXO), so the V-atoms conserve. Single-recipient transfers
|
|
8632
|
+
* should keep using transferToken(); this is its N-recipient generalization.
|
|
8633
|
+
*
|
|
8634
|
+
* @param {Object} options - The transfer options.
|
|
8635
|
+
* @param {string} options.token - The token to transfer.
|
|
8636
|
+
* @param {Array} options.recipients - [{ bundleHash, amount?, units?, batchId? }] per recipient.
|
|
8637
|
+
* @param {Object} [options.sourceWallet=null] - The source wallet; queried if not provided.
|
|
8638
|
+
*
|
|
8639
|
+
* @returns {Promise} - A Promise that resolves to the transaction result.
|
|
8640
|
+
*
|
|
8641
|
+
* @throws {StackableUnitAmountException} - If a recipient provides both amount and units.
|
|
8642
|
+
* @throws {TransferBalanceException} - If the source wallet does not have enough balance.
|
|
8643
|
+
*/
|
|
8644
|
+
async transferTokens({
|
|
8645
|
+
token: e,
|
|
8646
|
+
recipients: t,
|
|
8647
|
+
sourceWallet: n = null
|
|
8648
|
+
}) {
|
|
8649
|
+
const s = t.map((l) => {
|
|
8650
|
+
const h = l.units || [];
|
|
8651
|
+
if (h.length > 0) {
|
|
8652
|
+
if (l.amount > 0)
|
|
8653
|
+
throw new ke();
|
|
8654
|
+
return h.length;
|
|
8655
|
+
}
|
|
8656
|
+
return l.amount || 0;
|
|
8657
|
+
}), r = s.reduce((l, h) => l + h, 0);
|
|
8658
|
+
if (n === null && (n = await this.querySourceWallet({
|
|
8659
|
+
token: e,
|
|
8660
|
+
amount: r
|
|
8661
|
+
})), n === null || le.cmp(n.balance, r) < 0)
|
|
8662
|
+
throw new J();
|
|
8663
|
+
const i = t.map((l) => {
|
|
8664
|
+
const h = S.create({
|
|
8665
|
+
bundle: l.bundleHash,
|
|
8666
|
+
token: e
|
|
8667
|
+
});
|
|
8668
|
+
return l.batchId !== void 0 && l.batchId !== null ? h.batchId = l.batchId : h.initBatchId({
|
|
8669
|
+
sourceWallet: n
|
|
8670
|
+
}), h;
|
|
8671
|
+
}), a = n.createRemainder(this.getSecret());
|
|
8672
|
+
n.splitUnitsMulti(
|
|
8673
|
+
t.map((l) => l.units || []),
|
|
8674
|
+
i,
|
|
8675
|
+
a
|
|
8676
|
+
);
|
|
8677
|
+
const c = await this.createMolecule({
|
|
8678
|
+
sourceWallet: n,
|
|
8679
|
+
remainderWallet: a
|
|
8680
|
+
}), u = await this.createMoleculeMutation({
|
|
8681
|
+
mutationClass: At,
|
|
8682
|
+
molecule: c
|
|
8683
|
+
});
|
|
8684
|
+
return u.fillMoleculeMulti({
|
|
8685
|
+
recipientWallets: i,
|
|
8686
|
+
amounts: s
|
|
8687
|
+
}), await this.executeQuery(u);
|
|
8688
|
+
}
|
|
8667
8689
|
/**
|
|
8668
8690
|
* Deposits buffer token into the source wallet.
|
|
8669
8691
|
*
|
|
@@ -8689,7 +8711,7 @@ class Wr {
|
|
|
8689
8711
|
sourceWallet: s,
|
|
8690
8712
|
remainderWallet: r
|
|
8691
8713
|
}), a = await this.createMoleculeMutation({
|
|
8692
|
-
mutationClass:
|
|
8714
|
+
mutationClass: sr,
|
|
8693
8715
|
molecule: i
|
|
8694
8716
|
});
|
|
8695
8717
|
return a.fillMolecule({
|
|
@@ -8722,7 +8744,7 @@ class Wr {
|
|
|
8722
8744
|
sourceWallet: n,
|
|
8723
8745
|
remainderWallet: r
|
|
8724
8746
|
}), a = await this.createMoleculeMutation({
|
|
8725
|
-
mutationClass:
|
|
8747
|
+
mutationClass: rr,
|
|
8726
8748
|
molecule: i
|
|
8727
8749
|
}), c = {};
|
|
8728
8750
|
return c[this.getBundle()] = t, a.fillMolecule({
|
|
@@ -8752,7 +8774,7 @@ class Wr {
|
|
|
8752
8774
|
const r = s.createRemainder(this.getSecret());
|
|
8753
8775
|
if (n.length > 0) {
|
|
8754
8776
|
if (t > 0)
|
|
8755
|
-
throw new
|
|
8777
|
+
throw new ke();
|
|
8756
8778
|
t = n.length, s.splitUnits(
|
|
8757
8779
|
n,
|
|
8758
8780
|
r
|
|
@@ -8787,7 +8809,7 @@ class Wr {
|
|
|
8787
8809
|
sourceWallet: s = null
|
|
8788
8810
|
}) {
|
|
8789
8811
|
if (s === null && (s = (await this.queryBalance({ token: e })).payload()), !s)
|
|
8790
|
-
throw new
|
|
8812
|
+
throw new J("Source wallet is missing or invalid.");
|
|
8791
8813
|
const r = s.createRemainder(this.getSecret()), i = await this.createMolecule({
|
|
8792
8814
|
sourceWallet: s,
|
|
8793
8815
|
remainderWallet: r
|
|
@@ -8821,17 +8843,17 @@ class Wr {
|
|
|
8821
8843
|
sourceWallet: r = null
|
|
8822
8844
|
}) {
|
|
8823
8845
|
if (r === null && (r = (await this.queryBalance({ token: t })).payload()), r === null)
|
|
8824
|
-
throw new
|
|
8846
|
+
throw new J("Source wallet is missing or invalid.");
|
|
8825
8847
|
if (!r.tokenUnits || !r.tokenUnits.length)
|
|
8826
|
-
throw new
|
|
8848
|
+
throw new J("Source wallet does not have token units.");
|
|
8827
8849
|
if (!s.length)
|
|
8828
|
-
throw new
|
|
8850
|
+
throw new J("Fused token unit list is empty.");
|
|
8829
8851
|
const i = [];
|
|
8830
8852
|
r.tokenUnits.forEach((h) => {
|
|
8831
8853
|
i.push(h.id);
|
|
8832
8854
|
}), s.forEach((h) => {
|
|
8833
8855
|
if (!i.includes(h))
|
|
8834
|
-
throw new
|
|
8856
|
+
throw new J(`Fused token unit ID = ${h} does not found in the source wallet.`);
|
|
8835
8857
|
});
|
|
8836
8858
|
const a = S.create({
|
|
8837
8859
|
bundle: e,
|
|
@@ -8839,7 +8861,7 @@ class Wr {
|
|
|
8839
8861
|
});
|
|
8840
8862
|
a.initBatchId({ sourceWallet: r });
|
|
8841
8863
|
const c = r.createRemainder(this.getSecret());
|
|
8842
|
-
r.splitUnits(s, c), typeof n == "string" && (n = new
|
|
8864
|
+
r.splitUnits(s, c), typeof n == "string" && (n = new pe(n, n, {})), n.metas.fusedTokenUnits = r.getTokenUnitsData(), a.tokenUnits = [n];
|
|
8843
8865
|
const u = await this.createMolecule({
|
|
8844
8866
|
sourceWallet: r,
|
|
8845
8867
|
remainderWallet: c
|
|
@@ -8866,15 +8888,15 @@ class Wr {
|
|
|
8866
8888
|
}) {
|
|
8867
8889
|
this.setCellSlug(e);
|
|
8868
8890
|
const n = new S({
|
|
8869
|
-
secret:
|
|
8891
|
+
secret: tt(await this.getFingerprint()),
|
|
8870
8892
|
token: "AUTH"
|
|
8871
|
-
}), s = await this.createQuery(
|
|
8893
|
+
}), s = await this.createQuery(Ps), r = {
|
|
8872
8894
|
cellSlug: e,
|
|
8873
8895
|
pubkey: n.pubkey,
|
|
8874
8896
|
encrypt: t
|
|
8875
8897
|
}, i = await s.execute({ variables: r });
|
|
8876
8898
|
if (i.success()) {
|
|
8877
|
-
const a =
|
|
8899
|
+
const a = ve.create({
|
|
8878
8900
|
token: i.token(),
|
|
8879
8901
|
expiresAt: i.expiresAt(),
|
|
8880
8902
|
pubkey: i.pubKey(),
|
|
@@ -8904,22 +8926,22 @@ class Wr {
|
|
|
8904
8926
|
secret: e,
|
|
8905
8927
|
sourceWallet: n
|
|
8906
8928
|
}), r = await this.createMoleculeMutation({
|
|
8907
|
-
mutationClass:
|
|
8929
|
+
mutationClass: bs,
|
|
8908
8930
|
molecule: s
|
|
8909
|
-
});
|
|
8910
|
-
r.fillMolecule({ meta:
|
|
8911
|
-
const
|
|
8912
|
-
if (
|
|
8913
|
-
const
|
|
8914
|
-
token:
|
|
8915
|
-
expiresAt:
|
|
8916
|
-
pubkey:
|
|
8917
|
-
encrypt:
|
|
8931
|
+
}), i = { encrypt: t ? "true" : "false" };
|
|
8932
|
+
n.pubkey && (i.walletPubkey = n.pubkey), r.fillMolecule({ meta: i });
|
|
8933
|
+
const a = await r.execute({});
|
|
8934
|
+
if (a.success()) {
|
|
8935
|
+
const c = ve.create({
|
|
8936
|
+
token: a.token(),
|
|
8937
|
+
expiresAt: a.expiresAt(),
|
|
8938
|
+
pubkey: a.pubKey(),
|
|
8939
|
+
encrypt: a.encrypt()
|
|
8918
8940
|
}, n);
|
|
8919
|
-
this.setAuthToken(
|
|
8941
|
+
this.setAuthToken(c);
|
|
8920
8942
|
} else
|
|
8921
|
-
throw new xt(`KnishIOClient::requestProfileAuthToken() - Authorization attempt rejected by ledger. Reason: ${
|
|
8922
|
-
return
|
|
8943
|
+
throw new xt(`KnishIOClient::requestProfileAuthToken() - Authorization attempt rejected by ledger. Reason: ${a.reason()}`);
|
|
8944
|
+
return a;
|
|
8923
8945
|
}
|
|
8924
8946
|
/**
|
|
8925
8947
|
* Request an auth token (guest or profile)
|
|
@@ -8938,7 +8960,7 @@ class Wr {
|
|
|
8938
8960
|
}) {
|
|
8939
8961
|
if (this.$__serverSdkVersion < 3)
|
|
8940
8962
|
return this.log("warn", "KnishIOClient::authorize() - Server SDK version does not require an authorization..."), null;
|
|
8941
|
-
e === null && t && (e =
|
|
8963
|
+
e === null && t && (e = tt(t)), n && this.setCellSlug(n), this.$__authInProcess = !0;
|
|
8942
8964
|
let r;
|
|
8943
8965
|
return e ? r = await this.requestProfileAuthToken({
|
|
8944
8966
|
secret: e,
|
|
@@ -8990,7 +9012,7 @@ class Wr {
|
|
|
8990
9012
|
}
|
|
8991
9013
|
}
|
|
8992
9014
|
}
|
|
8993
|
-
class
|
|
9015
|
+
class Rr extends C {
|
|
8994
9016
|
/**
|
|
8995
9017
|
* Class constructor
|
|
8996
9018
|
*
|
|
@@ -9038,9 +9060,9 @@ class Ur extends C {
|
|
|
9038
9060
|
* @return {*}
|
|
9039
9061
|
*/
|
|
9040
9062
|
payloadKey(e) {
|
|
9041
|
-
if (!
|
|
9042
|
-
throw new
|
|
9043
|
-
return
|
|
9063
|
+
if (!M.has(this.payload(), e))
|
|
9064
|
+
throw new ee(`ResponseAuthorizationGuest::payloadKey() - '${e}' key is not found in the payload!`);
|
|
9065
|
+
return M.get(this.payload(), e);
|
|
9044
9066
|
}
|
|
9045
9067
|
/**
|
|
9046
9068
|
* Returns the auth token
|
|
@@ -9061,121 +9083,119 @@ class Ur extends C {
|
|
|
9061
9083
|
}
|
|
9062
9084
|
export {
|
|
9063
9085
|
g as Atom,
|
|
9064
|
-
|
|
9086
|
+
be as AtomIndexException,
|
|
9065
9087
|
P as AtomMeta,
|
|
9066
|
-
|
|
9067
|
-
|
|
9088
|
+
oe as AtomsMissingException,
|
|
9089
|
+
ve as AuthToken,
|
|
9068
9090
|
xt as AuthorizationRejectedException,
|
|
9069
9091
|
ue as BalanceInsufficientException,
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9092
|
+
We as BatchIdException,
|
|
9093
|
+
Ae as CheckMolecule,
|
|
9094
|
+
Y as CodeException,
|
|
9095
|
+
le as Decimal,
|
|
9096
|
+
M as Dot,
|
|
9097
|
+
ee as InvalidResponseException,
|
|
9098
|
+
Or as KnishIOClient,
|
|
9099
|
+
he as Meta,
|
|
9078
9100
|
H as MetaMissingException,
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9101
|
+
rs as MolecularHashMismatchException,
|
|
9102
|
+
is as MolecularHashMissingException,
|
|
9103
|
+
V as Molecule,
|
|
9104
|
+
Fe as Mutation,
|
|
9105
|
+
Ds as MutationActiveSession,
|
|
9106
|
+
Rs as MutationAppendRequest,
|
|
9107
|
+
Is as MutationClaimShadowWallet,
|
|
9108
|
+
vs as MutationCreateIdentifier,
|
|
9109
|
+
Ts as MutationCreateMeta,
|
|
9110
|
+
nr as MutationCreateRule,
|
|
9111
|
+
ks as MutationCreateToken,
|
|
9112
|
+
Bs as MutationCreateWallet,
|
|
9113
|
+
sr as MutationDepositBufferToken,
|
|
9114
|
+
Ws as MutationLinkIdentifier,
|
|
9115
|
+
Es as MutationPeering,
|
|
9094
9116
|
W as MutationProposeMolecule,
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9117
|
+
bs as MutationRequestAuthorization,
|
|
9118
|
+
Ps as MutationRequestAuthorizationGuest,
|
|
9119
|
+
Ss as MutationRequestTokens,
|
|
9120
|
+
At as MutationTransferTokens,
|
|
9121
|
+
rr as MutationWithdrawBufferToken,
|
|
9122
|
+
St as NegativeAmountException,
|
|
9123
|
+
bt as PolicyInvalidException,
|
|
9124
|
+
st as PolicyMeta,
|
|
9125
|
+
N as Query,
|
|
9126
|
+
zs as QueryActiveSession,
|
|
9105
9127
|
It as QueryAtom,
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9128
|
+
fs as QueryBalance,
|
|
9129
|
+
xe as QueryBatch,
|
|
9130
|
+
ys as QueryBatchHistory,
|
|
9131
|
+
cs as QueryContinuId,
|
|
9110
9132
|
Ct as QueryEmbeddingStatus,
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
fs as QueryWalletList,
|
|
9133
|
+
$t as QueryMetaType,
|
|
9134
|
+
Mt as QueryMetaTypeViaAtom,
|
|
9135
|
+
Tt as QueryMetaTypeViaMolecule,
|
|
9136
|
+
Zs as QueryPolicy,
|
|
9137
|
+
Js as QueryToken,
|
|
9138
|
+
hs as QueryWalletBundle,
|
|
9139
|
+
ds as QueryWalletList,
|
|
9119
9140
|
C as Response,
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
$s as
|
|
9145
|
-
|
|
9146
|
-
ds as ResponseWalletBundle,
|
|
9141
|
+
js as ResponseActiveSession,
|
|
9142
|
+
Os as ResponseAppendRequest,
|
|
9143
|
+
Gs as ResponseAtom,
|
|
9144
|
+
Rr as ResponseAuthorizationGuest,
|
|
9145
|
+
ps as ResponseBalance,
|
|
9146
|
+
xs as ResponseClaimShadowWallet,
|
|
9147
|
+
ls as ResponseContinuId,
|
|
9148
|
+
As as ResponseCreateIdentifier,
|
|
9149
|
+
Ms as ResponseCreateMeta,
|
|
9150
|
+
tr as ResponseCreateRule,
|
|
9151
|
+
ws as ResponseCreateToken,
|
|
9152
|
+
Us as ResponseCreateWallet,
|
|
9153
|
+
er as ResponseEmbeddingStatus,
|
|
9154
|
+
qs as ResponseLinkIdentifier,
|
|
9155
|
+
ms as ResponseMetaType,
|
|
9156
|
+
Ys as ResponseMetaTypeViaAtom,
|
|
9157
|
+
it as ResponseMetaTypeViaMolecule,
|
|
9158
|
+
Cs as ResponsePeering,
|
|
9159
|
+
Xs as ResponsePolicy,
|
|
9160
|
+
D as ResponseProposeMolecule,
|
|
9161
|
+
Vs as ResponseQueryActiveSession,
|
|
9162
|
+
gs as ResponseRequestAuthorization,
|
|
9163
|
+
Hs as ResponseRequestAuthorizationGuest,
|
|
9164
|
+
_s as ResponseRequestTokens,
|
|
9165
|
+
$s as ResponseTransferTokens,
|
|
9166
|
+
us as ResponseWalletBundle,
|
|
9147
9167
|
Le as ResponseWalletList,
|
|
9148
9168
|
zt as SignatureMalformedException,
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9169
|
+
os as SignatureMismatchException,
|
|
9170
|
+
ke as StackableUnitAmountException,
|
|
9171
|
+
Ks as StackableUnitDecimalsException,
|
|
9172
|
+
pe as TokenUnit,
|
|
9173
|
+
J as TransferBalanceException,
|
|
9174
|
+
we as TransferMalformedException,
|
|
9175
|
+
wt as TransferMismatchedException,
|
|
9176
|
+
kt as TransferRemainderException,
|
|
9177
|
+
as as TransferToSelfException,
|
|
9178
|
+
Ee as TransferUnbalancedException,
|
|
9179
|
+
Pe as UnauthenticatedException,
|
|
9160
9180
|
S as Wallet,
|
|
9161
9181
|
vt as WalletShadowException,
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9182
|
+
se as WrongTokenTypeException,
|
|
9183
|
+
pn as base64ToHex,
|
|
9184
|
+
un as bufferToHexString,
|
|
9185
|
+
cn as charsetBaseConvert,
|
|
9186
|
+
mn as chunkArray,
|
|
9187
|
+
Ue as chunkSubstr,
|
|
9188
|
+
yn as deepCloning,
|
|
9189
|
+
gn as diff,
|
|
9190
|
+
Be as generateBatchId,
|
|
9191
|
+
de as generateBundleHash,
|
|
9192
|
+
tt as generateSecret,
|
|
9193
|
+
hn as hexStringToBuffer,
|
|
9194
|
+
dn as hexToBase64,
|
|
9195
|
+
fe as intersect,
|
|
9196
|
+
De as isHex,
|
|
9197
|
+
fn as isNumeric,
|
|
9198
|
+
nt as randomString,
|
|
9199
|
+
Ve as shake256
|
|
9180
9200
|
};
|
|
9181
9201
|
//# sourceMappingURL=client.es.mjs.map
|