@wishknish/knishio-client-js 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.cjs.js +29 -102
- package/dist/client.cjs.js.map +1 -1
- package/dist/client.es.mjs +823 -766
- 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 +1 -1
- package/src/Atom.js +18 -20
- package/src/KnishIOClient.js +115 -49
- package/src/Molecule.js +78 -68
- package/src/Wallet.js +89 -6
- package/src/index.js +0 -4
- package/src/instance/Rules/Callback.js +1 -0
- package/src/instance/Rules/Meta.js +1 -3
- package/src/instance/Rules/Rule.js +1 -0
- package/src/libraries/strings.js +1 -0
- package/src/libraries/urql/UrqlClientWrapper.js +129 -10
- package/src/mutation/MutationTransferTokens.js +18 -0
- package/src/query/QueryPolicy.js +1 -1
- package/src/response/Response.js +3 -3
- package/src/response/ResponseActiveSession.js +0 -1
- package/src/response/ResponseAtom.js +0 -1
- package/src/response/ResponseAuthorizationGuest.js +0 -1
- package/src/response/ResponseBalance.js +0 -1
- package/src/response/ResponseContinuId.js +0 -1
- package/src/response/ResponseLinkIdentifier.js +0 -1
- package/src/response/ResponseMetaType.js +0 -1
- package/src/response/ResponseMetaTypeViaAtom.js +0 -1
- package/src/response/ResponseMetaTypeViaMolecule.js +0 -1
- package/src/response/ResponsePolicy.js +0 -1
- package/src/response/ResponseQueryActiveSession.js +0 -1
- package/src/response/ResponseWalletBundle.js +0 -1
- package/src/response/ResponseWalletList.js +0 -1
- package/src/query/QueryUserActivity.js +0 -151
- package/src/response/ResponseQueryUserActivity.js +0 -80
package/dist/client.es.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Q = (o, e, t) =>
|
|
1
|
+
var tn = Object.defineProperty;
|
|
2
|
+
var nn = (o, e, t) => e in o ? tn(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var Q = (o, e, t) => nn(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import L from "jssha";
|
|
5
|
-
import { gql as E, cacheExchange as
|
|
6
|
-
import { createClient as
|
|
7
|
-
import { pipe as
|
|
5
|
+
import { gql as E, cacheExchange as sn, fetchExchange as rn, subscriptionExchange as on, createClient as an } from "@urql/core";
|
|
6
|
+
import { createClient as ln } from "graphql-ws";
|
|
7
|
+
import { pipe as cn, map as un, subscribe as hn } from "wonka";
|
|
8
8
|
typeof self > "u" && (global.self = global);
|
|
9
|
-
class
|
|
9
|
+
class Wt {
|
|
10
10
|
/**
|
|
11
11
|
* Converts the given buffer to a string containing its hexadecimal representation.
|
|
12
12
|
*
|
|
@@ -75,7 +75,7 @@ String.prototype.toCamelCase || (String.prototype.toCamelCase = function() {
|
|
|
75
75
|
String.prototype.toSnakeCase || (String.prototype.toSnakeCase = function() {
|
|
76
76
|
return this.replace(/[A-Z]/g, (o) => `_${o.toLowerCase()}`);
|
|
77
77
|
});
|
|
78
|
-
function
|
|
78
|
+
function Be(o, e) {
|
|
79
79
|
const t = Math.ceil(o.length / e), n = [];
|
|
80
80
|
for (let s = 0, r = 0; s < t; ++s, r += e)
|
|
81
81
|
n[s] = o.substr(r, e);
|
|
@@ -85,7 +85,7 @@ function st(o = 256, e = "abcdef0123456789") {
|
|
|
85
85
|
let t = new Uint8Array(o);
|
|
86
86
|
return t = crypto.getRandomValues(t), t = t.map((n) => e.charCodeAt(n % e.length)), String.fromCharCode.apply(null, t);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function dn(o, e, t, n, s) {
|
|
89
89
|
if (n = n || "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~`!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?¿¡", s = s || n, e > n.length || t > s.length)
|
|
90
90
|
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
91
|
let i = BigInt(0);
|
|
@@ -98,27 +98,27 @@ function hn(o, e, t, n, s) {
|
|
|
98
98
|
}
|
|
99
99
|
return a || "0";
|
|
100
100
|
}
|
|
101
|
-
function dn(o) {
|
|
102
|
-
return qt.toHex(o, {});
|
|
103
|
-
}
|
|
104
101
|
function pn(o) {
|
|
105
|
-
return
|
|
102
|
+
return Wt.toHex(o, {});
|
|
106
103
|
}
|
|
107
104
|
function fn(o) {
|
|
108
|
-
|
|
109
|
-
return btoa(String.fromCharCode.apply(null, e));
|
|
105
|
+
return Wt.toUint8Array(o);
|
|
110
106
|
}
|
|
111
107
|
function mn(o) {
|
|
108
|
+
const e = fn(o);
|
|
109
|
+
return btoa(String.fromCharCode.apply(null, e));
|
|
110
|
+
}
|
|
111
|
+
function yn(o) {
|
|
112
112
|
const e = new Uint8Array(atob(o).split("").map((t) => t.charCodeAt(0)));
|
|
113
|
-
return
|
|
113
|
+
return pn(e);
|
|
114
114
|
}
|
|
115
115
|
function Ve(o) {
|
|
116
116
|
return /^[A-F0-9]+$/i.test(o);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function gn(o) {
|
|
119
119
|
return (typeof o == "number" || typeof o == "string" && o.trim() !== "") && !isNaN(o);
|
|
120
120
|
}
|
|
121
|
-
let
|
|
121
|
+
let de = class {
|
|
122
122
|
/**
|
|
123
123
|
* Normalizes the meta array into the standard {key: ..., value: ...} format
|
|
124
124
|
*
|
|
@@ -155,10 +155,10 @@ let pe = class {
|
|
|
155
155
|
return t;
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
|
-
function gn(o, e) {
|
|
159
|
-
return o.length ? [o.slice(0, e)].concat(gn(o.slice(e), e)) : [];
|
|
160
|
-
}
|
|
161
158
|
function bn(o, e) {
|
|
159
|
+
return o.length ? [o.slice(0, e)].concat(bn(o.slice(e), e)) : [];
|
|
160
|
+
}
|
|
161
|
+
function wn(o, e) {
|
|
162
162
|
let t, n, s;
|
|
163
163
|
const r = [Array, Date, Number, String, Boolean], i = Object.prototype.toString;
|
|
164
164
|
for (e = e || [], t = 0; t < e.length; t += 2)
|
|
@@ -168,11 +168,11 @@ function bn(o, e) {
|
|
|
168
168
|
i.call(o) === i.call(s = new r[t](o)) && (n = t ? s : []);
|
|
169
169
|
e.push(o, n);
|
|
170
170
|
for (t in o)
|
|
171
|
-
e.hasOwnProperty.call(o, t) && (n[t] =
|
|
171
|
+
e.hasOwnProperty.call(o, t) && (n[t] = wn(o[t], e));
|
|
172
172
|
}
|
|
173
173
|
return n || o;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function kn(...o) {
|
|
176
176
|
return [].concat(...o.map((e, t) => {
|
|
177
177
|
const n = o.slice(0);
|
|
178
178
|
n.splice(t, 1);
|
|
@@ -180,7 +180,7 @@ function wn(...o) {
|
|
|
180
180
|
return e.filter((r) => !s.includes(r));
|
|
181
181
|
}));
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function me(...o) {
|
|
184
184
|
return o.reduce((e, t) => e.filter((n) => t.includes(n)));
|
|
185
185
|
}
|
|
186
186
|
class rt {
|
|
@@ -218,7 +218,7 @@ class rt {
|
|
|
218
218
|
})) {
|
|
219
219
|
const i = r.map((a) => a.key);
|
|
220
220
|
this.policy[s] || (this.policy[s] = {});
|
|
221
|
-
for (const a of
|
|
221
|
+
for (const a of kn(e, i))
|
|
222
222
|
this.policy[s][a] || (this.policy[s][a] = s === "write" && !["characters", "pubkey"].includes(a) ? ["self"] : ["all"]);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
@@ -243,7 +243,7 @@ class P {
|
|
|
243
243
|
* @param {object|array} meta
|
|
244
244
|
*/
|
|
245
245
|
constructor(e = []) {
|
|
246
|
-
this.meta =
|
|
246
|
+
this.meta = de.normalizeMeta(e);
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
249
|
*
|
|
@@ -251,7 +251,7 @@ class P {
|
|
|
251
251
|
* @returns {AtomMeta}
|
|
252
252
|
*/
|
|
253
253
|
merge(e) {
|
|
254
|
-
return this.meta = Array.from(/* @__PURE__ */ new Set([...this.meta, ...
|
|
254
|
+
return this.meta = Array.from(/* @__PURE__ */ new Set([...this.meta, ...de.normalizeMeta(e)])), this;
|
|
255
255
|
}
|
|
256
256
|
/**
|
|
257
257
|
*
|
|
@@ -419,7 +419,7 @@ class oe {
|
|
|
419
419
|
return oe.structure(this);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
class
|
|
422
|
+
class _n extends oe {
|
|
423
423
|
constructor({
|
|
424
424
|
position: e = null,
|
|
425
425
|
walletAddress: t = null,
|
|
@@ -437,8 +437,8 @@ class kn extends oe {
|
|
|
437
437
|
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
438
|
}
|
|
439
439
|
}
|
|
440
|
-
const
|
|
441
|
-
4:
|
|
440
|
+
const qe = {
|
|
441
|
+
4: _n
|
|
442
442
|
};
|
|
443
443
|
class g {
|
|
444
444
|
/**
|
|
@@ -471,7 +471,7 @@ class g {
|
|
|
471
471
|
index: h = null,
|
|
472
472
|
version: p = null
|
|
473
473
|
}) {
|
|
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 ?
|
|
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 ? de.normalizeMeta(u) : [], this.index = h, this.otsFragment = l, this.createdAt = String(+/* @__PURE__ */ new Date()), p !== null && Object.prototype.hasOwnProperty.call(qe, p) && (this.version = String(p));
|
|
475
475
|
}
|
|
476
476
|
/**
|
|
477
477
|
*
|
|
@@ -546,7 +546,7 @@ class g {
|
|
|
546
546
|
}
|
|
547
547
|
/**
|
|
548
548
|
* Returns JSON-ready object for cross-SDK compatibility (2025 JS best practices)
|
|
549
|
-
*
|
|
549
|
+
*
|
|
550
550
|
* Provides clean serialization of atomic operations with optional OTS fragments.
|
|
551
551
|
* Follows 2025 JavaScript best practices with proper type safety and validation.
|
|
552
552
|
*
|
|
@@ -589,7 +589,7 @@ class g {
|
|
|
589
589
|
}
|
|
590
590
|
/**
|
|
591
591
|
* Creates an Atom instance from JSON data (2025 JS best practices)
|
|
592
|
-
*
|
|
592
|
+
*
|
|
593
593
|
* Handles cross-SDK atom deserialization with robust error handling.
|
|
594
594
|
* Essential for reconstructing atoms from other SDK implementations.
|
|
595
595
|
*
|
|
@@ -650,8 +650,8 @@ class g {
|
|
|
650
650
|
if (!(r instanceof g))
|
|
651
651
|
throw new ae();
|
|
652
652
|
return r;
|
|
653
|
-
}), s.every((r) => r.version && Object.prototype.hasOwnProperty.call(
|
|
654
|
-
n.update(JSON.stringify(s.map((r) =>
|
|
653
|
+
}), s.every((r) => r.version && Object.prototype.hasOwnProperty.call(qe, r.version)))
|
|
654
|
+
n.update(JSON.stringify(s.map((r) => qe[r.version].create(r).view())));
|
|
655
655
|
else {
|
|
656
656
|
const r = String(e.length);
|
|
657
657
|
let i = [];
|
|
@@ -666,7 +666,7 @@ class g {
|
|
|
666
666
|
case "array":
|
|
667
667
|
return n.getHash("ARRAYBUFFER", { outputLen: 256 });
|
|
668
668
|
default:
|
|
669
|
-
return
|
|
669
|
+
return dn(n.getHash("HEX", { outputLen: 256 }), 16, 17, "0123456789abcdef", "0123456789abcdefg").padStart(64, "0");
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
static jsonSerialization(e, t) {
|
|
@@ -687,7 +687,7 @@ class g {
|
|
|
687
687
|
* Get aggregated meta from stored normalized ones
|
|
688
688
|
*/
|
|
689
689
|
aggregatedMeta() {
|
|
690
|
-
return
|
|
690
|
+
return de.aggregateMeta(this.meta);
|
|
691
691
|
}
|
|
692
692
|
/**
|
|
693
693
|
*
|
|
@@ -714,21 +714,21 @@ function nt(o = null, e = 2048) {
|
|
|
714
714
|
} else
|
|
715
715
|
return st(e);
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function pe(o, e = null) {
|
|
718
718
|
const t = new L("SHAKE256", "TEXT");
|
|
719
719
|
return t.update(o), t.getHash("HEX", { outputLen: 256 });
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function ze(o, e) {
|
|
722
722
|
const t = new L("SHAKE256", "TEXT");
|
|
723
723
|
return t.update(o), t.getHash("HEX", { outputLen: e });
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function He({
|
|
726
726
|
molecularHash: o = null,
|
|
727
727
|
index: e = null
|
|
728
728
|
}) {
|
|
729
|
-
return o !== null && e !== null ?
|
|
729
|
+
return o !== null && e !== null ? pe(String(o) + String(e), "generateBatchId") : st(64);
|
|
730
730
|
}
|
|
731
|
-
class
|
|
731
|
+
class fe {
|
|
732
732
|
/**
|
|
733
733
|
*
|
|
734
734
|
* @param id
|
|
@@ -745,7 +745,7 @@ class me {
|
|
|
745
745
|
*/
|
|
746
746
|
static createFromGraphQL(e) {
|
|
747
747
|
let t = e.metas || {};
|
|
748
|
-
return t.length && (t = JSON.parse(t), t || (t = {})), new
|
|
748
|
+
return t.length && (t = JSON.parse(t), t || (t = {})), new fe(
|
|
749
749
|
e.id,
|
|
750
750
|
e.name,
|
|
751
751
|
t
|
|
@@ -757,7 +757,7 @@ class me {
|
|
|
757
757
|
* @returns {TokenUnit}
|
|
758
758
|
*/
|
|
759
759
|
static createFromDB(e) {
|
|
760
|
-
return new
|
|
760
|
+
return new fe(
|
|
761
761
|
e[0],
|
|
762
762
|
e[1],
|
|
763
763
|
e.length > 2 ? e[2] : {}
|
|
@@ -795,7 +795,7 @@ class me {
|
|
|
795
795
|
};
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
|
-
class
|
|
798
|
+
class Je extends x {
|
|
799
799
|
/**
|
|
800
800
|
* Class constructor
|
|
801
801
|
*
|
|
@@ -807,39 +807,39 @@ class ze extends x {
|
|
|
807
807
|
super(e, t, n), this.name = "WalletCredentialException";
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
|
-
const Ce = /* @__PURE__ */ BigInt(2 ** 32 - 1),
|
|
811
|
-
function _n(o, e = !1) {
|
|
812
|
-
return e ? { h: Number(o & Ce), l: Number(o >> ct & Ce) } : { h: Number(o >> ct & Ce) | 0, l: Number(o & Ce) | 0 };
|
|
813
|
-
}
|
|
810
|
+
const Ce = /* @__PURE__ */ BigInt(2 ** 32 - 1), lt = /* @__PURE__ */ BigInt(32);
|
|
814
811
|
function Sn(o, e = !1) {
|
|
812
|
+
return e ? { h: Number(o & Ce), l: Number(o >> lt & Ce) } : { h: Number(o >> lt & Ce) | 0, l: Number(o & Ce) | 0 };
|
|
813
|
+
}
|
|
814
|
+
function $n(o, e = !1) {
|
|
815
815
|
const t = o.length;
|
|
816
816
|
let n = new Uint32Array(t), s = new Uint32Array(t);
|
|
817
817
|
for (let r = 0; r < t; r++) {
|
|
818
|
-
const { h: i, l: a } =
|
|
818
|
+
const { h: i, l: a } = Sn(o[r], e);
|
|
819
819
|
[n[r], s[r]] = [i, a];
|
|
820
820
|
}
|
|
821
821
|
return [n, s];
|
|
822
822
|
}
|
|
823
|
-
const
|
|
823
|
+
const An = (o, e, t) => o << t | e >>> 32 - t, vn = (o, e, t) => e << t | o >>> 32 - t, xn = (o, e, t) => e << t - 32 | o >>> 64 - t, In = (o, e, t) => o << t - 32 | e >>> 64 - t;
|
|
824
824
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
825
|
-
function
|
|
825
|
+
function Mn(o) {
|
|
826
826
|
return o instanceof Uint8Array || ArrayBuffer.isView(o) && o.constructor.name === "Uint8Array";
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function ct(o, e = "") {
|
|
829
829
|
if (!Number.isSafeInteger(o) || o < 0) {
|
|
830
830
|
const t = e && `"${e}" `;
|
|
831
831
|
throw new Error(`${t}expected integer >= 0, got ${o}`);
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
834
|
function D(o, e, t = "") {
|
|
835
|
-
const n =
|
|
835
|
+
const n = Mn(o), s = o == null ? void 0 : o.length, r = e !== void 0;
|
|
836
836
|
if (!n || r && s !== e) {
|
|
837
837
|
const i = t && `"${t}" `, a = r ? ` of length ${e}` : "", c = n ? `length=${s}` : `type=${typeof o}`;
|
|
838
838
|
throw new Error(i + "expected Uint8Array" + a + ", got " + c);
|
|
839
839
|
}
|
|
840
840
|
return o;
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function ut(o, e = !0) {
|
|
843
843
|
if (o.destroyed)
|
|
844
844
|
throw new Error("Hash instance has been destroyed");
|
|
845
845
|
if (e && o.finished)
|
|
@@ -851,28 +851,28 @@ function Tn(o, e) {
|
|
|
851
851
|
if (o.length < t)
|
|
852
852
|
throw new Error('"digestInto() output" expected to be of length >=' + t);
|
|
853
853
|
}
|
|
854
|
-
function
|
|
854
|
+
function Ut(o) {
|
|
855
855
|
return new Uint32Array(o.buffer, o.byteOffset, Math.floor(o.byteLength / 4));
|
|
856
856
|
}
|
|
857
|
-
function
|
|
857
|
+
function Bt(...o) {
|
|
858
858
|
for (let e = 0; e < o.length; e++)
|
|
859
859
|
o[e].fill(0);
|
|
860
860
|
}
|
|
861
|
-
const
|
|
862
|
-
function
|
|
861
|
+
const Cn = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
862
|
+
function En(o) {
|
|
863
863
|
return o << 24 & 4278190080 | o << 8 & 16711680 | o >>> 8 & 65280 | o >>> 24 & 255;
|
|
864
864
|
}
|
|
865
|
-
function
|
|
865
|
+
function On(o) {
|
|
866
866
|
for (let e = 0; e < o.length; e++)
|
|
867
|
-
o[e] =
|
|
867
|
+
o[e] = En(o[e]);
|
|
868
868
|
return o;
|
|
869
869
|
}
|
|
870
|
-
const
|
|
871
|
-
function
|
|
870
|
+
const ht = Cn ? (o) => o : On;
|
|
871
|
+
function Ht(o, e = {}) {
|
|
872
872
|
const t = (s, r) => o(r).update(s).digest(), n = o(void 0);
|
|
873
873
|
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = (s) => o(s), Object.assign(t, e), Object.freeze(t);
|
|
874
874
|
}
|
|
875
|
-
function
|
|
875
|
+
function Rn(o = 32) {
|
|
876
876
|
const e = typeof globalThis == "object" ? globalThis.crypto : null;
|
|
877
877
|
if (typeof (e == null ? void 0 : e.getRandomValues) != "function")
|
|
878
878
|
throw new Error("crypto.getRandomValues must be defined");
|
|
@@ -880,28 +880,28 @@ function On(o = 32) {
|
|
|
880
880
|
}
|
|
881
881
|
const Ne = (o) => ({
|
|
882
882
|
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, o])
|
|
883
|
-
}),
|
|
884
|
-
for (let o = 0, e =
|
|
885
|
-
[t, n] = [n, (2 * t + 3 * n) % 5],
|
|
886
|
-
let s =
|
|
883
|
+
}), qn = BigInt(0), ye = BigInt(1), Wn = BigInt(2), Un = BigInt(7), Bn = BigInt(256), Hn = BigInt(113), Pt = [], Kt = [], Nt = [];
|
|
884
|
+
for (let o = 0, e = ye, t = 1, n = 0; o < 24; o++) {
|
|
885
|
+
[t, n] = [n, (2 * t + 3 * n) % 5], Pt.push(2 * (5 * n + t)), Kt.push((o + 1) * (o + 2) / 2 % 64);
|
|
886
|
+
let s = qn;
|
|
887
887
|
for (let r = 0; r < 7; r++)
|
|
888
|
-
e = (e <<
|
|
889
|
-
|
|
888
|
+
e = (e << ye ^ (e >> Un) * Hn) % Bn, e & Wn && (s ^= ye << (ye << BigInt(r)) - ye);
|
|
889
|
+
Nt.push(s);
|
|
890
890
|
}
|
|
891
|
-
const
|
|
892
|
-
function
|
|
891
|
+
const Ft = $n(Nt, !0), Pn = Ft[0], Kn = Ft[1], dt = (o, e, t) => t > 32 ? xn(o, e, t) : An(o, e, t), pt = (o, e, t) => t > 32 ? In(o, e, t) : vn(o, e, t);
|
|
892
|
+
function Nn(o, e = 24) {
|
|
893
893
|
const t = new Uint32Array(10);
|
|
894
894
|
for (let n = 24 - e; n < 24; n++) {
|
|
895
895
|
for (let i = 0; i < 10; i++)
|
|
896
896
|
t[i] = o[i] ^ o[i + 10] ^ o[i + 20] ^ o[i + 30] ^ o[i + 40];
|
|
897
897
|
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 =
|
|
898
|
+
const a = (i + 8) % 10, c = (i + 2) % 10, u = t[c], l = t[c + 1], h = dt(u, l, 1) ^ t[a], p = pt(u, l, 1) ^ t[a + 1];
|
|
899
899
|
for (let d = 0; d < 50; d += 10)
|
|
900
900
|
o[i + d] ^= h, o[i + d + 1] ^= p;
|
|
901
901
|
}
|
|
902
902
|
let s = o[2], r = o[3];
|
|
903
903
|
for (let i = 0; i < 24; i++) {
|
|
904
|
-
const a =
|
|
904
|
+
const a = Kt[i], c = dt(s, r, a), u = pt(s, r, a), l = Pt[i];
|
|
905
905
|
s = o[l], r = o[l + 1], o[l] = c, o[l + 1] = u;
|
|
906
906
|
}
|
|
907
907
|
for (let i = 0; i < 50; i += 10) {
|
|
@@ -910,9 +910,9 @@ function Kn(o, e = 24) {
|
|
|
910
910
|
for (let a = 0; a < 10; a++)
|
|
911
911
|
o[i + a] ^= ~t[(a + 2) % 10] & t[(a + 4) % 10];
|
|
912
912
|
}
|
|
913
|
-
o[0] ^=
|
|
913
|
+
o[0] ^= Pn[n], o[1] ^= Kn[n];
|
|
914
914
|
}
|
|
915
|
-
|
|
915
|
+
Bt(t);
|
|
916
916
|
}
|
|
917
917
|
class Fe {
|
|
918
918
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
@@ -928,18 +928,18 @@ class Fe {
|
|
|
928
928
|
Q(this, "outputLen");
|
|
929
929
|
Q(this, "enableXOF", !1);
|
|
930
930
|
Q(this, "rounds");
|
|
931
|
-
if (this.blockLen = e, this.suffix = t, this.outputLen = n, this.enableXOF = s, this.rounds = r,
|
|
931
|
+
if (this.blockLen = e, this.suffix = t, this.outputLen = n, this.enableXOF = s, this.rounds = r, ct(n, "outputLen"), !(0 < e && e < 200))
|
|
932
932
|
throw new Error("only keccak-f1600 function is supported");
|
|
933
|
-
this.state = new Uint8Array(200), this.state32 =
|
|
933
|
+
this.state = new Uint8Array(200), this.state32 = Ut(this.state);
|
|
934
934
|
}
|
|
935
935
|
clone() {
|
|
936
936
|
return this._cloneInto();
|
|
937
937
|
}
|
|
938
938
|
keccak() {
|
|
939
|
-
|
|
939
|
+
ht(this.state32), Nn(this.state32, this.rounds), ht(this.state32), this.posOut = 0, this.pos = 0;
|
|
940
940
|
}
|
|
941
941
|
update(e) {
|
|
942
|
-
|
|
942
|
+
ut(this), D(e);
|
|
943
943
|
const { blockLen: t, state: n } = this, s = e.length;
|
|
944
944
|
for (let r = 0; r < s; ) {
|
|
945
945
|
const i = Math.min(t - this.pos, s - r);
|
|
@@ -957,7 +957,7 @@ class Fe {
|
|
|
957
957
|
e[n] ^= t, (t & 128) !== 0 && n === s - 1 && this.keccak(), e[s - 1] ^= 128, this.keccak();
|
|
958
958
|
}
|
|
959
959
|
writeInto(e) {
|
|
960
|
-
|
|
960
|
+
ut(this, !1), D(e), this.finish();
|
|
961
961
|
const t = this.state, { blockLen: n } = this;
|
|
962
962
|
for (let s = 0, r = e.length; s < r; ) {
|
|
963
963
|
this.posOut >= n && this.keccak();
|
|
@@ -972,7 +972,7 @@ class Fe {
|
|
|
972
972
|
return this.writeInto(e);
|
|
973
973
|
}
|
|
974
974
|
xof(e) {
|
|
975
|
-
return
|
|
975
|
+
return ct(e), this.xofInto(new Uint8Array(e));
|
|
976
976
|
}
|
|
977
977
|
digestInto(e) {
|
|
978
978
|
if (Tn(e, this), this.finished)
|
|
@@ -983,49 +983,49 @@ class Fe {
|
|
|
983
983
|
return this.digestInto(new Uint8Array(this.outputLen));
|
|
984
984
|
}
|
|
985
985
|
destroy() {
|
|
986
|
-
this.destroyed = !0,
|
|
986
|
+
this.destroyed = !0, Bt(this.state);
|
|
987
987
|
}
|
|
988
988
|
_cloneInto(e) {
|
|
989
989
|
const { blockLen: t, suffix: n, outputLen: s, rounds: r, enableXOF: i } = this;
|
|
990
990
|
return e || (e = new Fe(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
991
|
}
|
|
992
992
|
}
|
|
993
|
-
const
|
|
993
|
+
const Lt = (o, e, t, n = {}) => Ht(() => new Fe(e, o, t), n), Fn = /* @__PURE__ */ Lt(
|
|
994
994
|
6,
|
|
995
995
|
136,
|
|
996
996
|
32,
|
|
997
997
|
/* @__PURE__ */ Ne(8)
|
|
998
|
-
),
|
|
998
|
+
), Ln = /* @__PURE__ */ Lt(
|
|
999
999
|
6,
|
|
1000
1000
|
72,
|
|
1001
1001
|
64,
|
|
1002
1002
|
/* @__PURE__ */ Ne(10)
|
|
1003
|
-
),
|
|
1003
|
+
), Qt = (o, e, t, n = {}) => Ht((s = {}) => new Fe(e, o, s.dkLen === void 0 ? t : s.dkLen, !0), n), Qn = /* @__PURE__ */ Qt(31, 168, 16, /* @__PURE__ */ Ne(11)), jt = /* @__PURE__ */ Qt(31, 136, 32, /* @__PURE__ */ Ne(12));
|
|
1004
1004
|
function it(o) {
|
|
1005
1005
|
if (!Number.isSafeInteger(o) || o < 0 || o > 4294967295)
|
|
1006
1006
|
throw new Error("wrong u32 integer:" + o);
|
|
1007
1007
|
return o;
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
function Dt(o) {
|
|
1010
1010
|
return it(o), (o & o - 1) === 0 && o !== 0;
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function Vt(o, e) {
|
|
1013
1013
|
it(o);
|
|
1014
1014
|
let t = 0;
|
|
1015
1015
|
for (let n = 0; n < e; n++, o >>>= 1)
|
|
1016
1016
|
t = t << 1 | o & 1;
|
|
1017
1017
|
return t;
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1019
|
+
function zt(o) {
|
|
1020
1020
|
return it(o), 31 - Math.clz32(o);
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1022
|
+
function ft(o) {
|
|
1023
1023
|
const e = o.length;
|
|
1024
|
-
if (e < 2 || !
|
|
1024
|
+
if (e < 2 || !Dt(e))
|
|
1025
1025
|
throw new Error("n must be a power of 2 and greater than 1. Got " + e);
|
|
1026
|
-
const t =
|
|
1026
|
+
const t = zt(e);
|
|
1027
1027
|
for (let n = 0; n < e; n++) {
|
|
1028
|
-
const s =
|
|
1028
|
+
const s = Vt(n, t);
|
|
1029
1029
|
if (n < s) {
|
|
1030
1030
|
const r = o[n];
|
|
1031
1031
|
o[n] = o[s], o[s] = r;
|
|
@@ -1033,32 +1033,32 @@ function mt(o) {
|
|
|
1033
1033
|
}
|
|
1034
1034
|
return o;
|
|
1035
1035
|
}
|
|
1036
|
-
const
|
|
1037
|
-
const { N: t, roots: n, dit: s, invertButterflies: r = !1, skipStages: i = 0, brp: a = !0 } = e, c =
|
|
1038
|
-
if (!
|
|
1036
|
+
const mt = (o, e) => {
|
|
1037
|
+
const { N: t, roots: n, dit: s, invertButterflies: r = !1, skipStages: i = 0, brp: a = !0 } = e, c = zt(t);
|
|
1038
|
+
if (!Dt(t))
|
|
1039
1039
|
throw new Error("FFT: Polynomial size should be power of two");
|
|
1040
1040
|
const u = s !== r;
|
|
1041
1041
|
return (l) => {
|
|
1042
1042
|
if (l.length !== t)
|
|
1043
1043
|
throw new Error("FFT: wrong Polynomial length");
|
|
1044
|
-
s && a &&
|
|
1044
|
+
s && a && ft(l);
|
|
1045
1045
|
for (let h = 0, p = 1; h < c - i; h++) {
|
|
1046
1046
|
const d = s ? h + 1 + i : c - h, b = 1 << d, A = b >> 1, O = t >> d;
|
|
1047
1047
|
for (let f = 0; f < t; f += b)
|
|
1048
1048
|
for (let m = 0, w = p++; m < A; m++) {
|
|
1049
|
-
const
|
|
1049
|
+
const T = r ? s ? t - w : w : m * O, k = f + m, $ = f + m + A, v = n[T], I = l[$], _ = l[k];
|
|
1050
1050
|
if (u) {
|
|
1051
1051
|
const U = o.mul(I, v);
|
|
1052
1052
|
l[k] = o.add(_, U), l[$] = o.sub(_, U);
|
|
1053
1053
|
} 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
1054
|
}
|
|
1055
1055
|
}
|
|
1056
|
-
return !s && a &&
|
|
1056
|
+
return !s && a && ft(l), l;
|
|
1057
1057
|
};
|
|
1058
1058
|
};
|
|
1059
1059
|
/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
|
|
1060
|
-
const
|
|
1061
|
-
function
|
|
1060
|
+
const yt = Rn;
|
|
1061
|
+
function Ge(o, e) {
|
|
1062
1062
|
if (o.length !== e.length)
|
|
1063
1063
|
return !1;
|
|
1064
1064
|
let t = 0;
|
|
@@ -1066,10 +1066,10 @@ function Je(o, e) {
|
|
|
1066
1066
|
t |= o[n] ^ e[n];
|
|
1067
1067
|
return t === 0;
|
|
1068
1068
|
}
|
|
1069
|
-
function
|
|
1069
|
+
function jn(o) {
|
|
1070
1070
|
return Uint8Array.from(o);
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function We(o, ...e) {
|
|
1073
1073
|
const t = (s) => typeof s == "number" ? s : s.bytesLen, n = e.reduce((s, r) => s + t(r), 0);
|
|
1074
1074
|
return {
|
|
1075
1075
|
bytesLen: n,
|
|
@@ -1092,7 +1092,7 @@ function Ue(o, ...e) {
|
|
|
1092
1092
|
}
|
|
1093
1093
|
};
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function Xe(o, e) {
|
|
1096
1096
|
const t = e * o.bytesLen;
|
|
1097
1097
|
return {
|
|
1098
1098
|
bytesLen: t,
|
|
@@ -1115,7 +1115,7 @@ function Ge(o, e) {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
};
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1118
|
+
function X(...o) {
|
|
1119
1119
|
for (const e of o)
|
|
1120
1120
|
if (Array.isArray(e))
|
|
1121
1121
|
for (const t of e)
|
|
@@ -1123,11 +1123,11 @@ function G(...o) {
|
|
|
1123
1123
|
else
|
|
1124
1124
|
e.fill(0);
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1126
|
+
function gt(o) {
|
|
1127
1127
|
return (1 << o) - 1;
|
|
1128
1128
|
}
|
|
1129
1129
|
/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
|
|
1130
|
-
const
|
|
1130
|
+
const Dn = (o) => {
|
|
1131
1131
|
const { newPoly: e, N: t, Q: n, F: s, ROOT_OF_UNITY: r, brvBits: i } = o, a = (f, m = n) => {
|
|
1132
1132
|
const w = f % m | 0;
|
|
1133
1133
|
return (w >= 0 ? w | 0 : m + w | 0) | 0;
|
|
@@ -1138,8 +1138,8 @@ const jn = (o) => {
|
|
|
1138
1138
|
function u() {
|
|
1139
1139
|
const f = e(t);
|
|
1140
1140
|
for (let m = 0; m < t; m++) {
|
|
1141
|
-
const w =
|
|
1142
|
-
f[m] = Number(
|
|
1141
|
+
const w = Vt(m, i), T = BigInt(r) ** BigInt(w) % BigInt(n);
|
|
1142
|
+
f[m] = Number(T) | 0;
|
|
1143
1143
|
}
|
|
1144
1144
|
return f;
|
|
1145
1145
|
}
|
|
@@ -1156,7 +1156,7 @@ const jn = (o) => {
|
|
|
1156
1156
|
invertButterflies: !0,
|
|
1157
1157
|
skipStages: 1,
|
|
1158
1158
|
brp: !1
|
|
1159
|
-
}, d =
|
|
1159
|
+
}, d = mt(h, { dit: !1, ...p }), b = mt(h, { dit: !0, ...p });
|
|
1160
1160
|
return { mod: a, smod: c, nttZetas: l, NTT: {
|
|
1161
1161
|
encode: (f) => d(f),
|
|
1162
1162
|
decode: (f) => {
|
|
@@ -1166,14 +1166,14 @@ const jn = (o) => {
|
|
|
1166
1166
|
return f;
|
|
1167
1167
|
}
|
|
1168
1168
|
}, bitsCoder: (f, m) => {
|
|
1169
|
-
const w =
|
|
1169
|
+
const w = gt(f), T = f * (t / 8);
|
|
1170
1170
|
return {
|
|
1171
|
-
bytesLen:
|
|
1171
|
+
bytesLen: T,
|
|
1172
1172
|
encode: (k) => {
|
|
1173
|
-
const $ = new Uint8Array(
|
|
1173
|
+
const $ = new Uint8Array(T);
|
|
1174
1174
|
for (let v = 0, I = 0, _ = 0, U = 0; v < k.length; v++)
|
|
1175
1175
|
for (I |= (m.encode(k[v]) & w) << _, _ += f; _ >= 8; _ -= 8, I >>= 8)
|
|
1176
|
-
$[U++] = I &
|
|
1176
|
+
$[U++] = I & gt(_);
|
|
1177
1177
|
return $;
|
|
1178
1178
|
},
|
|
1179
1179
|
decode: (k) => {
|
|
@@ -1185,7 +1185,7 @@ const jn = (o) => {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
};
|
|
1187
1187
|
} };
|
|
1188
|
-
},
|
|
1188
|
+
}, Vn = (o) => (e, t) => {
|
|
1189
1189
|
t || (t = o.blockLen);
|
|
1190
1190
|
const n = new Uint8Array(e.length + 2);
|
|
1191
1191
|
n.set(e);
|
|
@@ -1195,21 +1195,21 @@ const jn = (o) => {
|
|
|
1195
1195
|
stats: () => ({ calls: a, xofs: c }),
|
|
1196
1196
|
get: (u, l) => (n[s + 0] = u, n[s + 1] = l, i.destroy(), i = o.create({}).update(n), a++, () => (c++, i.xofInto(r))),
|
|
1197
1197
|
clean: () => {
|
|
1198
|
-
i.destroy(),
|
|
1198
|
+
i.destroy(), X(r, n);
|
|
1199
1199
|
}
|
|
1200
1200
|
};
|
|
1201
|
-
},
|
|
1201
|
+
}, zn = /* @__PURE__ */ Vn(Qn);
|
|
1202
1202
|
/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
|
|
1203
|
-
const F = 256, le = 3329,
|
|
1203
|
+
const F = 256, le = 3329, Jn = 3303, Gn = 17, { mod: $e, nttZetas: Xn, NTT: ne, bitsCoder: Zn } = Dn({
|
|
1204
1204
|
N: F,
|
|
1205
1205
|
Q: le,
|
|
1206
|
-
F:
|
|
1207
|
-
ROOT_OF_UNITY:
|
|
1206
|
+
F: Jn,
|
|
1207
|
+
ROOT_OF_UNITY: Gn,
|
|
1208
1208
|
newPoly: (o) => new Uint16Array(o),
|
|
1209
1209
|
brvBits: 7
|
|
1210
|
-
}),
|
|
1210
|
+
}), Yn = {
|
|
1211
1211
|
768: { N: F, Q: le, K: 3, ETA1: 2, ETA2: 2, du: 10, dv: 4, RBGstrength: 192 }
|
|
1212
|
-
},
|
|
1212
|
+
}, es = (o) => {
|
|
1213
1213
|
if (o >= 12)
|
|
1214
1214
|
return { encode: (t) => t, decode: (t) => t };
|
|
1215
1215
|
const e = 2 ** (o - 1);
|
|
@@ -1219,29 +1219,29 @@ const F = 256, le = 3329, zn = 3303, Jn = 17, { mod: $e, nttZetas: Gn, NTT: ne,
|
|
|
1219
1219
|
// const decompress = (i: number) => round((Q / 2 ** d) * i);
|
|
1220
1220
|
decode: (t) => t * le + e >>> o
|
|
1221
1221
|
};
|
|
1222
|
-
},
|
|
1222
|
+
}, ge = (o) => Zn(o, es(o));
|
|
1223
1223
|
function se(o, e) {
|
|
1224
1224
|
for (let t = 0; t < F; t++)
|
|
1225
1225
|
o[t] = $e(o[t] + e[t]);
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function ts(o, e) {
|
|
1228
1228
|
for (let t = 0; t < F; t++)
|
|
1229
1229
|
o[t] = $e(o[t] - e[t]);
|
|
1230
1230
|
}
|
|
1231
|
-
function
|
|
1231
|
+
function ns(o, e, t, n, s) {
|
|
1232
1232
|
const r = $e(e * n * s + o * t), i = $e(o * n + e * t);
|
|
1233
1233
|
return { c0: r, c1: i };
|
|
1234
1234
|
}
|
|
1235
1235
|
function Ee(o, e) {
|
|
1236
1236
|
for (let t = 0; t < F / 2; t++) {
|
|
1237
|
-
let n =
|
|
1237
|
+
let n = Xn[64 + (t >> 1)];
|
|
1238
1238
|
t & 1 && (n = -n);
|
|
1239
|
-
const { c0: s, c1: r } =
|
|
1239
|
+
const { c0: s, c1: r } = ns(o[2 * t + 0], o[2 * t + 1], e[2 * t + 0], e[2 * t + 1], n);
|
|
1240
1240
|
o[2 * t + 0] = s, o[2 * t + 1] = r;
|
|
1241
1241
|
}
|
|
1242
1242
|
return o;
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1244
|
+
function bt(o) {
|
|
1245
1245
|
const e = new Uint16Array(F);
|
|
1246
1246
|
for (let t = 0; t < F; ) {
|
|
1247
1247
|
const n = o();
|
|
@@ -1254,8 +1254,8 @@ function wt(o) {
|
|
|
1254
1254
|
}
|
|
1255
1255
|
return e;
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1258
|
-
const s = o(n * F / 4, e, t), r = new Uint16Array(F), i =
|
|
1257
|
+
function be(o, e, t, n) {
|
|
1258
|
+
const s = o(n * F / 4, e, t), r = new Uint16Array(F), i = Ut(s);
|
|
1259
1259
|
let a = 0;
|
|
1260
1260
|
for (let c = 0, u = 0, l = 0, h = 0; c < i.length; c++) {
|
|
1261
1261
|
let p = i[c];
|
|
@@ -1266,8 +1266,8 @@ function we(o, e, t, n) {
|
|
|
1266
1266
|
throw new Error(`sampleCBD: leftover bits: ${a}`);
|
|
1267
1267
|
return r;
|
|
1268
1268
|
}
|
|
1269
|
-
const
|
|
1270
|
-
const { K: e, PRF: t, XOF: n, HASH512: s, ETA1: r, ETA2: i, du: a, dv: c } = o, u =
|
|
1269
|
+
const ss = (o) => {
|
|
1270
|
+
const { K: e, PRF: t, XOF: n, HASH512: s, ETA1: r, ETA2: i, du: a, dv: c } = o, u = ge(1), l = ge(c), h = ge(a), p = We("publicKey", Xe(ge(12), e), 32), d = Xe(ge(12), e), b = We("ciphertext", Xe(h, e), l), A = We("seed", 32, 32);
|
|
1271
1271
|
return {
|
|
1272
1272
|
secretCoder: d,
|
|
1273
1273
|
lengths: {
|
|
@@ -1279,15 +1279,15 @@ const ns = (o) => {
|
|
|
1279
1279
|
D(O, 32, "seed");
|
|
1280
1280
|
const f = new Uint8Array(33);
|
|
1281
1281
|
f.set(O), f[32] = e;
|
|
1282
|
-
const m = s(f), [w,
|
|
1282
|
+
const m = s(f), [w, T] = A.decode(m), k = [], $ = [];
|
|
1283
1283
|
for (let _ = 0; _ < e; _++)
|
|
1284
|
-
k.push(ne.encode(
|
|
1284
|
+
k.push(ne.encode(be(t, T, _, r)));
|
|
1285
1285
|
const v = n(w);
|
|
1286
1286
|
for (let _ = 0; _ < e; _++) {
|
|
1287
|
-
const U = ne.encode(
|
|
1287
|
+
const U = ne.encode(be(t, T, e + _, r));
|
|
1288
1288
|
for (let R = 0; R < e; R++) {
|
|
1289
|
-
const
|
|
1290
|
-
se(U, Ee(
|
|
1289
|
+
const ue = bt(v.get(R, _));
|
|
1290
|
+
se(U, Ee(ue, k[R]));
|
|
1291
1291
|
}
|
|
1292
1292
|
$.push(U);
|
|
1293
1293
|
}
|
|
@@ -1296,37 +1296,37 @@ const ns = (o) => {
|
|
|
1296
1296
|
publicKey: p.encode([$, w]),
|
|
1297
1297
|
secretKey: d.encode(k)
|
|
1298
1298
|
};
|
|
1299
|
-
return
|
|
1299
|
+
return X(w, T, k, $, f, m), I;
|
|
1300
1300
|
},
|
|
1301
1301
|
encrypt: (O, f, m) => {
|
|
1302
|
-
const [w,
|
|
1302
|
+
const [w, T] = p.decode(O), k = [];
|
|
1303
1303
|
for (let R = 0; R < e; R++)
|
|
1304
|
-
k.push(ne.encode(
|
|
1305
|
-
const $ = n(
|
|
1304
|
+
k.push(ne.encode(be(t, m, R, r)));
|
|
1305
|
+
const $ = n(T), v = new Uint16Array(F), I = [];
|
|
1306
1306
|
for (let R = 0; R < e; R++) {
|
|
1307
|
-
const
|
|
1308
|
-
for (let
|
|
1309
|
-
const
|
|
1310
|
-
se(De, Ee(
|
|
1307
|
+
const ue = be(t, m, e + R, i), De = new Uint16Array(F);
|
|
1308
|
+
for (let Te = 0; Te < e; Te++) {
|
|
1309
|
+
const en = bt($.get(R, Te));
|
|
1310
|
+
se(De, Ee(en, k[Te]));
|
|
1311
1311
|
}
|
|
1312
|
-
se(
|
|
1312
|
+
se(ue, ne.decode(De)), I.push(ue), se(v, Ee(w[R], k[R])), X(De);
|
|
1313
1313
|
}
|
|
1314
1314
|
$.clean();
|
|
1315
|
-
const _ =
|
|
1315
|
+
const _ = be(t, m, 2 * e, i);
|
|
1316
1316
|
se(_, ne.decode(v));
|
|
1317
1317
|
const U = u.decode(f);
|
|
1318
|
-
return se(U, _),
|
|
1318
|
+
return se(U, _), X(w, k, v, _), b.encode([I, U]);
|
|
1319
1319
|
},
|
|
1320
1320
|
decrypt: (O, f) => {
|
|
1321
|
-
const [m, w] = b.decode(O),
|
|
1321
|
+
const [m, w] = b.decode(O), T = d.decode(f), k = new Uint16Array(F);
|
|
1322
1322
|
for (let $ = 0; $ < e; $++)
|
|
1323
|
-
se(k, Ee(
|
|
1324
|
-
return
|
|
1323
|
+
se(k, Ee(T[$], ne.encode(m[$])));
|
|
1324
|
+
return ts(w, ne.decode(k)), X(k, T, m), u.encode(w);
|
|
1325
1325
|
}
|
|
1326
1326
|
};
|
|
1327
1327
|
};
|
|
1328
|
-
function
|
|
1329
|
-
const e =
|
|
1328
|
+
function rs(o) {
|
|
1329
|
+
const e = ss(o), { HASH256: t, HASH512: n, KDF: s } = o, { secretCoder: r, lengths: i } = e, a = We("secretKey", i.secretKey, i.publicKey, 32, 32), c = 32, u = 64;
|
|
1330
1330
|
return {
|
|
1331
1331
|
info: { type: "ml-kem" },
|
|
1332
1332
|
lengths: {
|
|
@@ -1336,46 +1336,46 @@ function ss(o) {
|
|
|
1336
1336
|
msgRand: c,
|
|
1337
1337
|
secretKey: a.bytesLen
|
|
1338
1338
|
},
|
|
1339
|
-
keygen: (l =
|
|
1339
|
+
keygen: (l = yt(u)) => {
|
|
1340
1340
|
D(l, u, "seed");
|
|
1341
1341
|
const { publicKey: h, secretKey: p } = e.keygen(l.subarray(0, 32)), d = t(h), b = a.encode([p, h, d, l.subarray(32)]);
|
|
1342
|
-
return
|
|
1342
|
+
return X(p, d), { publicKey: h, secretKey: b };
|
|
1343
1343
|
},
|
|
1344
1344
|
getPublicKey: (l) => {
|
|
1345
1345
|
const [h, p] = a.decode(l);
|
|
1346
1346
|
return Uint8Array.from(p);
|
|
1347
1347
|
},
|
|
1348
|
-
encapsulate: (l, h =
|
|
1348
|
+
encapsulate: (l, h = yt(c)) => {
|
|
1349
1349
|
D(l, i.publicKey, "publicKey"), D(h, c, "message");
|
|
1350
|
-
const p = l.subarray(0, 384 * o.K), d = r.encode(r.decode(
|
|
1351
|
-
if (!
|
|
1352
|
-
throw
|
|
1353
|
-
|
|
1350
|
+
const p = l.subarray(0, 384 * o.K), d = r.encode(r.decode(jn(p)));
|
|
1351
|
+
if (!Ge(d, p))
|
|
1352
|
+
throw X(d), new Error("ML-KEM.encapsulate: wrong publicKey modulus");
|
|
1353
|
+
X(d);
|
|
1354
1354
|
const b = n.create().update(h).update(t(l)).digest(), A = e.encrypt(l, h, b.subarray(32, 64));
|
|
1355
|
-
return
|
|
1355
|
+
return X(b.subarray(32)), { cipherText: A, sharedSecret: b.subarray(0, 32) };
|
|
1356
1356
|
},
|
|
1357
1357
|
decapsulate: (l, h) => {
|
|
1358
1358
|
D(h, a.bytesLen, "secretKey"), D(l, i.cipherText, "cipherText");
|
|
1359
1359
|
const p = a.bytesLen - 96, d = p + 32, b = t(h.subarray(p / 2, d));
|
|
1360
|
-
if (!
|
|
1360
|
+
if (!Ge(b, h.subarray(d, d + 32)))
|
|
1361
1361
|
throw new Error("invalid secretKey: hash check failed");
|
|
1362
|
-
const [A, O, f, m] = a.decode(h), w = e.decrypt(l, A),
|
|
1363
|
-
return
|
|
1362
|
+
const [A, O, f, m] = a.decode(h), w = e.decrypt(l, A), T = n.create().update(w).update(f).digest(), k = T.subarray(0, 32), $ = e.encrypt(O, w, T.subarray(32, 64)), v = Ge(l, $), I = s.create({ dkLen: 32 }).update(m).update(l).digest();
|
|
1363
|
+
return X(w, $, v ? I : k), v ? k : I;
|
|
1364
1364
|
}
|
|
1365
1365
|
};
|
|
1366
1366
|
}
|
|
1367
|
-
function
|
|
1368
|
-
return
|
|
1369
|
-
}
|
|
1370
|
-
const
|
|
1371
|
-
HASH256:
|
|
1372
|
-
HASH512:
|
|
1373
|
-
KDF:
|
|
1374
|
-
XOF:
|
|
1375
|
-
PRF:
|
|
1376
|
-
},
|
|
1377
|
-
...
|
|
1378
|
-
...
|
|
1367
|
+
function is(o, e, t) {
|
|
1368
|
+
return jt.create({ dkLen: o }).update(e).update(new Uint8Array([t])).digest();
|
|
1369
|
+
}
|
|
1370
|
+
const os = {
|
|
1371
|
+
HASH256: Fn,
|
|
1372
|
+
HASH512: Ln,
|
|
1373
|
+
KDF: jt,
|
|
1374
|
+
XOF: zn,
|
|
1375
|
+
PRF: is
|
|
1376
|
+
}, Ze = /* @__PURE__ */ rs({
|
|
1377
|
+
...os,
|
|
1378
|
+
...Yn[768]
|
|
1379
1379
|
});
|
|
1380
1380
|
class S {
|
|
1381
1381
|
/**
|
|
@@ -1398,7 +1398,7 @@ class S {
|
|
|
1398
1398
|
batchId: i = null,
|
|
1399
1399
|
characters: a = null
|
|
1400
1400
|
}) {
|
|
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 ||
|
|
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 || pe(e, "Wallet::constructor"), this.position = this.position || S.generatePosition(), this.key = S.generateKey({
|
|
1402
1402
|
secret: e,
|
|
1403
1403
|
token: this.token,
|
|
1404
1404
|
position: this.position
|
|
@@ -1423,8 +1423,8 @@ class S {
|
|
|
1423
1423
|
}) {
|
|
1424
1424
|
let i = null;
|
|
1425
1425
|
if (!e && !t)
|
|
1426
|
-
throw new
|
|
1427
|
-
return e && !t && (i = S.generatePosition(), t =
|
|
1426
|
+
throw new Je();
|
|
1427
|
+
return e && !t && (i = S.generatePosition(), t = pe(e, "Wallet::create")), new S({
|
|
1428
1428
|
secret: e,
|
|
1429
1429
|
bundle: t,
|
|
1430
1430
|
token: n,
|
|
@@ -1451,7 +1451,7 @@ class S {
|
|
|
1451
1451
|
static getTokenUnits(e) {
|
|
1452
1452
|
const t = [];
|
|
1453
1453
|
return e.forEach((n) => {
|
|
1454
|
-
t.push(
|
|
1454
|
+
t.push(fe.createFromDB(n));
|
|
1455
1455
|
}), t;
|
|
1456
1456
|
}
|
|
1457
1457
|
/**
|
|
@@ -1468,10 +1468,10 @@ class S {
|
|
|
1468
1468
|
position: n
|
|
1469
1469
|
}) {
|
|
1470
1470
|
if (!e)
|
|
1471
|
-
throw new
|
|
1471
|
+
throw new Je("Wallet::generateKey() - Secret is required!");
|
|
1472
1472
|
if (!n)
|
|
1473
|
-
throw new
|
|
1474
|
-
const s = Ve(e) ? e :
|
|
1473
|
+
throw new Je("Wallet::generateKey() - Position is required!");
|
|
1474
|
+
const s = Ve(e) ? e : ze(e, 1024), r = Ve(n) ? n : ze(n, 256), a = BigInt(`0x${s}`) + BigInt(`0x${r}`), c = new L("SHAKE256", "TEXT");
|
|
1475
1475
|
c.update(a.toString(16)), t && c.update(t);
|
|
1476
1476
|
const u = new L("SHAKE256", "TEXT");
|
|
1477
1477
|
return u.update(c.getHash("HEX", { outputLen: 8192 })), u.getHash("HEX", { outputLen: 8192 });
|
|
@@ -1483,7 +1483,7 @@ class S {
|
|
|
1483
1483
|
* @return {string}
|
|
1484
1484
|
*/
|
|
1485
1485
|
static generateAddress(e) {
|
|
1486
|
-
const t =
|
|
1486
|
+
const t = Be(e, 128), n = new L("SHAKE256", "TEXT");
|
|
1487
1487
|
for (const r in t) {
|
|
1488
1488
|
let i = t[r];
|
|
1489
1489
|
for (let a = 1; a <= 16; a++) {
|
|
@@ -1510,7 +1510,7 @@ class S {
|
|
|
1510
1510
|
const e = nt(this.key, 128), t = new Uint8Array(64);
|
|
1511
1511
|
for (let r = 0; r < 64; r++)
|
|
1512
1512
|
t[r] = parseInt(e.substr(r * 2, 2), 16);
|
|
1513
|
-
const { publicKey: n, secretKey: s } =
|
|
1513
|
+
const { publicKey: n, secretKey: s } = Ze.keygen(t);
|
|
1514
1514
|
this.pubkey = this.serializeKey(n), this.privkey = s;
|
|
1515
1515
|
}
|
|
1516
1516
|
serializeKey(e) {
|
|
@@ -1580,6 +1580,27 @@ class S {
|
|
|
1580
1580
|
e.includes(i.id) ? s.push(i) : r.push(i);
|
|
1581
1581
|
}), this.tokenUnits = s, n !== null && (n.tokenUnits = s), t.tokenUnits = r;
|
|
1582
1582
|
}
|
|
1583
|
+
/**
|
|
1584
|
+
* Split token units across MULTIPLE recipients (WP line 544).
|
|
1585
|
+
*
|
|
1586
|
+
* The source retains the SENT union (all units leaving), each recipient gets its own subset,
|
|
1587
|
+
* and the remainder gets the KEPT units (those not assigned to any recipient). Mirrors
|
|
1588
|
+
* splitUnits() but N-way: the source's tokenUnits become the union (not a single recipient's
|
|
1589
|
+
* subset) so the source atom carries the full SENT set the validator reads as the authority.
|
|
1590
|
+
*
|
|
1591
|
+
* @param {array[]} recipientUnitLists - array of unit-id arrays, parallel to recipientWallets
|
|
1592
|
+
* @param {Wallet[]} recipientWallets
|
|
1593
|
+
* @param {Wallet} remainderWallet
|
|
1594
|
+
*/
|
|
1595
|
+
splitUnitsMulti(e, t, n) {
|
|
1596
|
+
const s = /* @__PURE__ */ new Set();
|
|
1597
|
+
e.forEach((r) => {
|
|
1598
|
+
r.forEach((i) => s.add(i));
|
|
1599
|
+
}), s.size !== 0 && (t.forEach((r, i) => {
|
|
1600
|
+
const a = e[i];
|
|
1601
|
+
r.tokenUnits = this.tokenUnits.filter((c) => a.includes(c.id));
|
|
1602
|
+
}), n.tokenUnits = this.tokenUnits.filter((r) => !s.has(r.id)), this.tokenUnits = this.tokenUnits.filter((r) => s.has(r.id)));
|
|
1603
|
+
}
|
|
1583
1604
|
/**
|
|
1584
1605
|
* Create a remainder wallet from the source one
|
|
1585
1606
|
*
|
|
@@ -1612,42 +1633,77 @@ class S {
|
|
|
1612
1633
|
sourceWallet: e,
|
|
1613
1634
|
isRemainder: t = !1
|
|
1614
1635
|
}) {
|
|
1615
|
-
e.batchId && (this.batchId = t ? e.batchId :
|
|
1636
|
+
e.batchId && (this.batchId = t ? e.batchId : He({}));
|
|
1616
1637
|
}
|
|
1617
1638
|
async encryptMessage(e, t) {
|
|
1618
|
-
const n = JSON.stringify(e), s = new TextEncoder().encode(n), r = this.deserializeKey(t), { cipherText: i, sharedSecret: a } =
|
|
1639
|
+
const n = JSON.stringify(e), s = new TextEncoder().encode(n), r = this.deserializeKey(t), { cipherText: i, sharedSecret: a } = Ze.encapsulate(r), c = await this.encryptWithSharedSecret(s, a);
|
|
1619
1640
|
return {
|
|
1620
1641
|
cipherText: this.serializeKey(i),
|
|
1621
1642
|
encryptedMessage: this.serializeKey(c)
|
|
1622
1643
|
};
|
|
1623
1644
|
}
|
|
1624
1645
|
async decryptMessage(e) {
|
|
1646
|
+
const t = await this._mlkemDecryptToString(e);
|
|
1647
|
+
return t === null ? null : JSON.parse(t);
|
|
1648
|
+
}
|
|
1649
|
+
/**
|
|
1650
|
+
* ML-KEM768 decapsulate + AES-256-GCM decrypt → the RAW decrypted UTF-8 string
|
|
1651
|
+
* (no JSON.parse). Shared by {@link decryptMessage} (which JSON.parses the result)
|
|
1652
|
+
* and the PQ CipherHash transport ({@link decryptMyMessageML768}, which needs the raw
|
|
1653
|
+
* response JSON text). PQ-transport Phase E (cycle 163).
|
|
1654
|
+
*/
|
|
1655
|
+
async _mlkemDecryptToString(e) {
|
|
1625
1656
|
const { cipherText: t, encryptedMessage: n } = e;
|
|
1626
1657
|
let s;
|
|
1627
1658
|
try {
|
|
1628
|
-
s =
|
|
1629
|
-
} catch (
|
|
1630
|
-
return console.error("Wallet::decryptMessage() - Decapsulation failed",
|
|
1659
|
+
s = Ze.decapsulate(this.deserializeKey(t), this.privkey);
|
|
1660
|
+
} catch (a) {
|
|
1661
|
+
return console.error("Wallet::decryptMessage() - Decapsulation failed", a), console.info("Wallet::decryptMessage() - my public key", this.pubkey), null;
|
|
1631
1662
|
}
|
|
1632
1663
|
let r;
|
|
1633
1664
|
try {
|
|
1634
1665
|
r = this.deserializeKey(n);
|
|
1635
|
-
} catch (
|
|
1636
|
-
return console.warn("Wallet::decryptMessage() - Deserialization failed",
|
|
1666
|
+
} catch (a) {
|
|
1667
|
+
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
1668
|
}
|
|
1638
1669
|
let i;
|
|
1639
1670
|
try {
|
|
1640
1671
|
i = await this.decryptWithSharedSecret(r, s);
|
|
1641
|
-
} catch (
|
|
1642
|
-
return console.warn("Wallet::decryptMessage() - Decryption failed",
|
|
1672
|
+
} catch (a) {
|
|
1673
|
+
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
1674
|
}
|
|
1644
|
-
let a;
|
|
1645
1675
|
try {
|
|
1646
|
-
|
|
1647
|
-
} catch (
|
|
1648
|
-
return console.warn("Wallet::decryptMessage() - Decoding failed",
|
|
1676
|
+
return new TextDecoder().decode(i);
|
|
1677
|
+
} catch (a) {
|
|
1678
|
+
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
1679
|
}
|
|
1650
|
-
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* Multi-recipient map key for a public key: `Base64_standard(SHAKE256(pubkey_utf8, 8 bytes))`
|
|
1683
|
+
* — matches the validator's `hash_share` and the other SDKs' `hashShare`/`shortHash`.
|
|
1684
|
+
* `shake256(pubkey, 64)` = 64 bits = 8 bytes, hex; hex-decode → standard base64. PQ Phase E.
|
|
1685
|
+
*/
|
|
1686
|
+
hashShare(e) {
|
|
1687
|
+
const t = ze(e, 64), n = Uint8Array.from(t.match(/.{2}/g).map((s) => parseInt(s, 16)));
|
|
1688
|
+
return this.serializeKey(n);
|
|
1689
|
+
}
|
|
1690
|
+
/**
|
|
1691
|
+
* Post-quantum (ML-KEM768) `CipherHash` request envelope: a stringified single-recipient
|
|
1692
|
+
* map `{ "<hashShare(recipientPubkey)>": {cipherText, encryptedMessage} }` (object-valued,
|
|
1693
|
+
* via {@link encryptMessage}). Matches the Rust validator's CipherHash handler. PQ Phase E.
|
|
1694
|
+
*/
|
|
1695
|
+
async encryptStringML768(e, t) {
|
|
1696
|
+
const n = await this.encryptMessage(e, t);
|
|
1697
|
+
return JSON.stringify({ [this.hashShare(t)]: n });
|
|
1698
|
+
}
|
|
1699
|
+
/**
|
|
1700
|
+
* Decrypt a `CipherHash` response map addressed to THIS wallet's ML-KEM pubkey
|
|
1701
|
+
* (`hashShare(this.pubkey)`) → the RAW decrypted GraphQL response JSON text (NOT JSON.parsed;
|
|
1702
|
+
* it replaces the HTTP response body for the normal parser). `null` if no entry / decrypt fails.
|
|
1703
|
+
*/
|
|
1704
|
+
async decryptMyMessageML768(e) {
|
|
1705
|
+
const t = e[this.hashShare(this.pubkey)];
|
|
1706
|
+
return t ? this._mlkemDecryptToString(t) : null;
|
|
1651
1707
|
}
|
|
1652
1708
|
async encryptWithSharedSecret(e, t) {
|
|
1653
1709
|
const n = crypto.getRandomValues(new Uint8Array(12)), s = { name: "AES-GCM", iv: n }, r = await crypto.subtle.importKey(
|
|
@@ -1684,7 +1740,7 @@ class S {
|
|
|
1684
1740
|
return new Uint8Array(i);
|
|
1685
1741
|
}
|
|
1686
1742
|
}
|
|
1687
|
-
class
|
|
1743
|
+
class we extends x {
|
|
1688
1744
|
/**
|
|
1689
1745
|
* Class constructor
|
|
1690
1746
|
*
|
|
@@ -1696,7 +1752,7 @@ class ke extends x {
|
|
|
1696
1752
|
super(e, t, n), this.name = "AtomIndexException";
|
|
1697
1753
|
}
|
|
1698
1754
|
}
|
|
1699
|
-
class
|
|
1755
|
+
class as extends x {
|
|
1700
1756
|
/**
|
|
1701
1757
|
* Class constructor
|
|
1702
1758
|
*
|
|
@@ -1708,7 +1764,7 @@ class os extends x {
|
|
|
1708
1764
|
super(e, t, n), this.name = "MolecularHashMismatchException";
|
|
1709
1765
|
}
|
|
1710
1766
|
}
|
|
1711
|
-
class
|
|
1767
|
+
class ls extends x {
|
|
1712
1768
|
/**
|
|
1713
1769
|
* Class constructor
|
|
1714
1770
|
*
|
|
@@ -1720,7 +1776,7 @@ class as extends x {
|
|
|
1720
1776
|
super(e, t, n), this.name = "MolecularHashMissingException";
|
|
1721
1777
|
}
|
|
1722
1778
|
}
|
|
1723
|
-
class
|
|
1779
|
+
class wt extends x {
|
|
1724
1780
|
/**
|
|
1725
1781
|
* Class constructor
|
|
1726
1782
|
*
|
|
@@ -1732,7 +1788,7 @@ class kt extends x {
|
|
|
1732
1788
|
super(e, t, n), this.name = "PolicyInvalidException";
|
|
1733
1789
|
}
|
|
1734
1790
|
}
|
|
1735
|
-
class
|
|
1791
|
+
class Jt extends x {
|
|
1736
1792
|
/**
|
|
1737
1793
|
* Class constructor
|
|
1738
1794
|
*
|
|
@@ -1744,7 +1800,7 @@ class zt extends x {
|
|
|
1744
1800
|
super(e, t, n), this.name = "SignatureMalformedException";
|
|
1745
1801
|
}
|
|
1746
1802
|
}
|
|
1747
|
-
class
|
|
1803
|
+
class cs extends x {
|
|
1748
1804
|
/**
|
|
1749
1805
|
* Class constructor
|
|
1750
1806
|
*
|
|
@@ -1756,7 +1812,7 @@ class ls extends x {
|
|
|
1756
1812
|
super(e, t, n), this.name = "SignatureMismatchException";
|
|
1757
1813
|
}
|
|
1758
1814
|
}
|
|
1759
|
-
class
|
|
1815
|
+
class G extends x {
|
|
1760
1816
|
/**
|
|
1761
1817
|
* Class constructor
|
|
1762
1818
|
*
|
|
@@ -1768,7 +1824,7 @@ class Y extends x {
|
|
|
1768
1824
|
super(e, t, n), this.name = "TransferBalanceException";
|
|
1769
1825
|
}
|
|
1770
1826
|
}
|
|
1771
|
-
class
|
|
1827
|
+
class ke extends x {
|
|
1772
1828
|
/**
|
|
1773
1829
|
* Class constructor
|
|
1774
1830
|
*
|
|
@@ -1780,7 +1836,7 @@ class _e extends x {
|
|
|
1780
1836
|
super(e, t, n), this.name = "TransferMalformedException";
|
|
1781
1837
|
}
|
|
1782
1838
|
}
|
|
1783
|
-
class
|
|
1839
|
+
class kt extends x {
|
|
1784
1840
|
/**
|
|
1785
1841
|
* @param {string} message
|
|
1786
1842
|
* @param {string|null} fileName
|
|
@@ -1790,7 +1846,7 @@ class _t extends x {
|
|
|
1790
1846
|
super(e, t, n), this.name = "TransferMismatchedException";
|
|
1791
1847
|
}
|
|
1792
1848
|
}
|
|
1793
|
-
class
|
|
1849
|
+
class _t extends x {
|
|
1794
1850
|
/**
|
|
1795
1851
|
* Class constructor
|
|
1796
1852
|
*
|
|
@@ -1802,7 +1858,7 @@ class St extends x {
|
|
|
1802
1858
|
super(e, t, n), this.name = "TransferRemainderException";
|
|
1803
1859
|
}
|
|
1804
1860
|
}
|
|
1805
|
-
class
|
|
1861
|
+
class us extends x {
|
|
1806
1862
|
/**
|
|
1807
1863
|
* Class constructor
|
|
1808
1864
|
*
|
|
@@ -1850,7 +1906,7 @@ class re extends x {
|
|
|
1850
1906
|
super(e, t, n), this.name = "WrongTokenTypeException";
|
|
1851
1907
|
}
|
|
1852
1908
|
}
|
|
1853
|
-
class
|
|
1909
|
+
class Ue extends x {
|
|
1854
1910
|
/**
|
|
1855
1911
|
* @param {string|null} message
|
|
1856
1912
|
* @param {string|null} fileName
|
|
@@ -1860,9 +1916,8 @@ class Be extends x {
|
|
|
1860
1916
|
super(e, t, n), this.name = "BatchIdException";
|
|
1861
1917
|
}
|
|
1862
1918
|
}
|
|
1863
|
-
class
|
|
1864
|
-
constructor({}) {
|
|
1865
|
-
const e = arguments[0];
|
|
1919
|
+
class St {
|
|
1920
|
+
constructor(e = {}) {
|
|
1866
1921
|
for (const t in e)
|
|
1867
1922
|
this[`__${t}`] = e[t];
|
|
1868
1923
|
}
|
|
@@ -1940,7 +1995,7 @@ class Se {
|
|
|
1940
1995
|
* @param {string} amount
|
|
1941
1996
|
*/
|
|
1942
1997
|
set amount(e) {
|
|
1943
|
-
if (!
|
|
1998
|
+
if (!gn(e))
|
|
1944
1999
|
throw new ee("Parameter amount should be a string containing numbers");
|
|
1945
2000
|
this.__amount = e;
|
|
1946
2001
|
}
|
|
@@ -1963,7 +2018,7 @@ class Se {
|
|
|
1963
2018
|
* @param {Meta|object} meta
|
|
1964
2019
|
*/
|
|
1965
2020
|
set meta(e) {
|
|
1966
|
-
this.__meta = e instanceof
|
|
2021
|
+
this.__meta = e instanceof St ? e : St.toObject(e);
|
|
1967
2022
|
}
|
|
1968
2023
|
/**
|
|
1969
2024
|
*
|
|
@@ -2011,31 +2066,31 @@ class Se {
|
|
|
2011
2066
|
* @return {boolean}
|
|
2012
2067
|
*/
|
|
2013
2068
|
isMeta() {
|
|
2014
|
-
return
|
|
2069
|
+
return me(Object.keys(this.toJSON()), ["action", "metaId", "metaType", "meta"]).length === 4 && this._is("meta");
|
|
2015
2070
|
}
|
|
2016
2071
|
/**
|
|
2017
2072
|
* @return {boolean}
|
|
2018
2073
|
*/
|
|
2019
2074
|
isCollect() {
|
|
2020
|
-
return
|
|
2075
|
+
return me(Object.keys(this.toJSON()), ["action", "address", "token", "amount", "comparison"]).length === 5 && this._is("collect");
|
|
2021
2076
|
}
|
|
2022
2077
|
/**
|
|
2023
2078
|
* @return {boolean}
|
|
2024
2079
|
*/
|
|
2025
2080
|
isBuffer() {
|
|
2026
|
-
return
|
|
2081
|
+
return me(Object.keys(this.toJSON()), ["action", "address", "token", "amount", "comparison"]).length === 5 && this._is("buffer");
|
|
2027
2082
|
}
|
|
2028
2083
|
/**
|
|
2029
2084
|
* @return {boolean}
|
|
2030
2085
|
*/
|
|
2031
2086
|
isRemit() {
|
|
2032
|
-
return
|
|
2087
|
+
return me(Object.keys(this.toJSON()), ["action", "token", "amount"]).length === 3 && this._is("remit");
|
|
2033
2088
|
}
|
|
2034
2089
|
/**
|
|
2035
2090
|
* @return {boolean}
|
|
2036
2091
|
*/
|
|
2037
2092
|
isBurn() {
|
|
2038
|
-
return
|
|
2093
|
+
return me(Object.keys(this.toJSON()), ["action", "token", "amount", "comparison"]).length === 4 && this._is("burn");
|
|
2039
2094
|
}
|
|
2040
2095
|
/**
|
|
2041
2096
|
* @param {string} type
|
|
@@ -2047,7 +2102,7 @@ class Se {
|
|
|
2047
2102
|
return this.__action.toLowerCase() === e.toLowerCase();
|
|
2048
2103
|
}
|
|
2049
2104
|
}
|
|
2050
|
-
class
|
|
2105
|
+
class Ye {
|
|
2051
2106
|
/**
|
|
2052
2107
|
*
|
|
2053
2108
|
* @param key
|
|
@@ -2096,7 +2151,7 @@ class Ae {
|
|
|
2096
2151
|
callback: t = []
|
|
2097
2152
|
}) {
|
|
2098
2153
|
for (const n of e)
|
|
2099
|
-
if (!(n instanceof
|
|
2154
|
+
if (!(n instanceof Ye))
|
|
2100
2155
|
throw new Pe();
|
|
2101
2156
|
for (const n of t)
|
|
2102
2157
|
if (!(n instanceof Se))
|
|
@@ -2108,7 +2163,7 @@ class Ae {
|
|
|
2108
2163
|
* @param {Condition[]|{}} condition
|
|
2109
2164
|
*/
|
|
2110
2165
|
set comparison(e) {
|
|
2111
|
-
this.__condition.push(e instanceof
|
|
2166
|
+
this.__condition.push(e instanceof Ye ? e : Ye.toObject(e));
|
|
2112
2167
|
}
|
|
2113
2168
|
/**
|
|
2114
2169
|
* @param {Callback[]|{}} callback
|
|
@@ -2144,7 +2199,7 @@ class Ae {
|
|
|
2144
2199
|
};
|
|
2145
2200
|
}
|
|
2146
2201
|
}
|
|
2147
|
-
class
|
|
2202
|
+
class M {
|
|
2148
2203
|
/**
|
|
2149
2204
|
* Initialize the Dot utility with the given object and key path
|
|
2150
2205
|
* @param {object|array} obj - The object or array to traverse
|
|
@@ -2210,12 +2265,12 @@ class ve {
|
|
|
2210
2265
|
*/
|
|
2211
2266
|
constructor(e) {
|
|
2212
2267
|
if (e.molecularHash === null)
|
|
2213
|
-
throw new
|
|
2268
|
+
throw new ls();
|
|
2214
2269
|
if (!e.atoms.length)
|
|
2215
2270
|
throw new ae();
|
|
2216
2271
|
for (const t of e.atoms)
|
|
2217
2272
|
if (t.index === null)
|
|
2218
|
-
throw new
|
|
2273
|
+
throw new we();
|
|
2219
2274
|
this.molecule = e;
|
|
2220
2275
|
}
|
|
2221
2276
|
/**
|
|
@@ -2245,14 +2300,14 @@ class ve {
|
|
|
2245
2300
|
if (e.isotope === "V" && e.batchId !== null) {
|
|
2246
2301
|
const t = this.molecule.getIsotopes("V"), n = t[t.length - 1];
|
|
2247
2302
|
if (e.batchId !== n.batchId)
|
|
2248
|
-
throw new
|
|
2303
|
+
throw new Ue();
|
|
2249
2304
|
for (const s of t)
|
|
2250
2305
|
if (s.batchId === null)
|
|
2251
|
-
throw new
|
|
2306
|
+
throw new Ue();
|
|
2252
2307
|
}
|
|
2253
2308
|
return !0;
|
|
2254
2309
|
}
|
|
2255
|
-
throw new
|
|
2310
|
+
throw new Ue();
|
|
2256
2311
|
}
|
|
2257
2312
|
/**
|
|
2258
2313
|
*
|
|
@@ -2263,7 +2318,7 @@ class ve {
|
|
|
2263
2318
|
if (e.token !== "USER")
|
|
2264
2319
|
throw new re(`Check::isotopeI() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2265
2320
|
if (e.index === 0)
|
|
2266
|
-
throw new
|
|
2321
|
+
throw new we(`Check::isotopeI() - Isotope "${e.isotope}" Atoms must have a non-zero index!`);
|
|
2267
2322
|
}
|
|
2268
2323
|
return !0;
|
|
2269
2324
|
}
|
|
@@ -2276,7 +2331,7 @@ class ve {
|
|
|
2276
2331
|
if (e.token !== "AUTH")
|
|
2277
2332
|
throw new re(`Check::isotopeU() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2278
2333
|
if (e.index !== 0)
|
|
2279
|
-
throw new
|
|
2334
|
+
throw new we(`Check::isotopeU() - Isotope "${e.isotope}" Atoms must have an index equal to 0!`);
|
|
2280
2335
|
}
|
|
2281
2336
|
return !0;
|
|
2282
2337
|
}
|
|
@@ -2291,7 +2346,7 @@ class ve {
|
|
|
2291
2346
|
throw new H();
|
|
2292
2347
|
if (t.token !== "USER")
|
|
2293
2348
|
throw new re(`Check::isotopeM() - "${t.token}" is not a valid Token slug for "${t.isotope}" isotope Atoms!`);
|
|
2294
|
-
const n =
|
|
2349
|
+
const n = de.aggregateMeta(t.meta);
|
|
2295
2350
|
for (const s of e) {
|
|
2296
2351
|
let r = n[s];
|
|
2297
2352
|
if (r) {
|
|
@@ -2299,10 +2354,10 @@ class ve {
|
|
|
2299
2354
|
for (const [i, a] of Object.entries(r))
|
|
2300
2355
|
if (!e.includes(i)) {
|
|
2301
2356
|
if (!Object.keys(n).includes(i))
|
|
2302
|
-
throw new
|
|
2357
|
+
throw new wt(`${i} is missing from the meta.`);
|
|
2303
2358
|
for (const c of a)
|
|
2304
2359
|
if (!S.isBundleHash(c) && !["all", "self"].includes(c))
|
|
2305
|
-
throw new
|
|
2360
|
+
throw new wt(`${c} does not correspond to the format of the policy.`);
|
|
2306
2361
|
}
|
|
2307
2362
|
}
|
|
2308
2363
|
}
|
|
@@ -2318,7 +2373,7 @@ class ve {
|
|
|
2318
2373
|
if (e.token !== "USER")
|
|
2319
2374
|
throw new re(`Check::isotopeC() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2320
2375
|
if (e.index !== 0)
|
|
2321
|
-
throw new
|
|
2376
|
+
throw new we(`Check::isotopeC() - Isotope "${e.isotope}" Atoms must have an index equal to 0!`);
|
|
2322
2377
|
}
|
|
2323
2378
|
return !0;
|
|
2324
2379
|
}
|
|
@@ -2340,7 +2395,7 @@ class ve {
|
|
|
2340
2395
|
if (e.token !== "USER")
|
|
2341
2396
|
throw new re(`Check::isotopeT() - "${e.token}" is not a valid Token slug for "${e.isotope}" isotope Atoms!`);
|
|
2342
2397
|
if (e.index !== 0)
|
|
2343
|
-
throw new
|
|
2398
|
+
throw new we(`Check::isotopeT() - Isotope "${e.isotope}" Atoms must have an index equal to 0!`);
|
|
2344
2399
|
}
|
|
2345
2400
|
return !0;
|
|
2346
2401
|
}
|
|
@@ -2418,7 +2473,7 @@ class ve {
|
|
|
2418
2473
|
throw new H("Check::isotopeB() - B-isotope atoms must have a metaId!");
|
|
2419
2474
|
const s = Number(n.value);
|
|
2420
2475
|
if (Number.isNaN(s))
|
|
2421
|
-
throw new
|
|
2476
|
+
throw new ke("Check::isotopeB() - B-isotope atom value is not a valid number!");
|
|
2422
2477
|
}
|
|
2423
2478
|
const t = this.molecule.getIsotopes("V");
|
|
2424
2479
|
if (t.length > 0) {
|
|
@@ -2448,9 +2503,9 @@ class ve {
|
|
|
2448
2503
|
throw new H("Check::isotopeF() - F-isotope atoms must have a metaId!");
|
|
2449
2504
|
const s = Number(n.value);
|
|
2450
2505
|
if (Number.isNaN(s))
|
|
2451
|
-
throw new
|
|
2506
|
+
throw new ke("Check::isotopeF() - F-isotope atom value is not a valid number!");
|
|
2452
2507
|
if (s < 0)
|
|
2453
|
-
throw new
|
|
2508
|
+
throw new ke("Check::isotopeF() - F-isotope atom value must not be negative!");
|
|
2454
2509
|
}
|
|
2455
2510
|
const t = this.molecule.getIsotopes("V");
|
|
2456
2511
|
if (t.length > 0) {
|
|
@@ -2477,9 +2532,9 @@ class ve {
|
|
|
2477
2532
|
if (!n && s.isotope === "V" && t.length === 2) {
|
|
2478
2533
|
const a = t[t.length - 1];
|
|
2479
2534
|
if (s.token !== a.token)
|
|
2480
|
-
throw new
|
|
2535
|
+
throw new kt();
|
|
2481
2536
|
if (a.value < 0)
|
|
2482
|
-
throw new
|
|
2537
|
+
throw new ke();
|
|
2483
2538
|
if (Number(s.value) + Number(a.value) !== 0)
|
|
2484
2539
|
throw new Oe();
|
|
2485
2540
|
return !0;
|
|
@@ -2493,12 +2548,12 @@ class ve {
|
|
|
2493
2548
|
if (i = c.value * 1, Number.isNaN(i))
|
|
2494
2549
|
throw new TypeError('Invalid isotope "V" values');
|
|
2495
2550
|
if (c.token !== s.token)
|
|
2496
|
-
throw new
|
|
2551
|
+
throw new kt();
|
|
2497
2552
|
if (a > 0) {
|
|
2498
2553
|
if (i < 0)
|
|
2499
|
-
throw new
|
|
2554
|
+
throw new ke();
|
|
2500
2555
|
if (c.walletAddress === s.walletAddress)
|
|
2501
|
-
throw new
|
|
2556
|
+
throw new us();
|
|
2502
2557
|
}
|
|
2503
2558
|
r += i;
|
|
2504
2559
|
}
|
|
@@ -2509,11 +2564,11 @@ class ve {
|
|
|
2509
2564
|
throw new TypeError('Invalid isotope "V" values');
|
|
2510
2565
|
const a = Number(e.balance) + i;
|
|
2511
2566
|
if (a < 0)
|
|
2512
|
-
throw new
|
|
2567
|
+
throw new G();
|
|
2513
2568
|
if (!n && a !== r)
|
|
2514
|
-
throw new
|
|
2569
|
+
throw new _t();
|
|
2515
2570
|
} else if (i !== 0)
|
|
2516
|
-
throw new
|
|
2571
|
+
throw new _t();
|
|
2517
2572
|
return !0;
|
|
2518
2573
|
}
|
|
2519
2574
|
/**
|
|
@@ -2525,7 +2580,7 @@ class ve {
|
|
|
2525
2580
|
if (this.molecule.molecularHash !== g.hashAtoms({
|
|
2526
2581
|
atoms: this.molecule.atoms
|
|
2527
2582
|
}))
|
|
2528
|
-
throw new
|
|
2583
|
+
throw new as();
|
|
2529
2584
|
return !0;
|
|
2530
2585
|
}
|
|
2531
2586
|
/**
|
|
@@ -2542,9 +2597,9 @@ class ve {
|
|
|
2542
2597
|
).reduce(
|
|
2543
2598
|
(p, d) => p + d
|
|
2544
2599
|
);
|
|
2545
|
-
if (t.length !== 2048 && (t =
|
|
2546
|
-
throw new
|
|
2547
|
-
const n =
|
|
2600
|
+
if (t.length !== 2048 && (t = yn(t), t.length !== 2048))
|
|
2601
|
+
throw new Jt();
|
|
2602
|
+
const n = Be(t, 128);
|
|
2548
2603
|
let s = "";
|
|
2549
2604
|
for (const p in n) {
|
|
2550
2605
|
let d = n[p];
|
|
@@ -2558,9 +2613,9 @@ class ve {
|
|
|
2558
2613
|
a.update(i);
|
|
2559
2614
|
const c = a.getHash("HEX", { outputLen: 256 }), u = this.molecule.atoms[0];
|
|
2560
2615
|
let l = u.walletAddress;
|
|
2561
|
-
const h =
|
|
2562
|
-
if (h && (l =
|
|
2563
|
-
throw new
|
|
2616
|
+
const h = M.get(u.aggregatedMeta(), "signingWallet");
|
|
2617
|
+
if (h && (l = M.get(JSON.parse(h), "address")), c !== l)
|
|
2618
|
+
throw new cs();
|
|
2564
2619
|
return !0;
|
|
2565
2620
|
}
|
|
2566
2621
|
/**
|
|
@@ -2646,7 +2701,7 @@ class ve {
|
|
|
2646
2701
|
}
|
|
2647
2702
|
}
|
|
2648
2703
|
}
|
|
2649
|
-
class
|
|
2704
|
+
class he extends x {
|
|
2650
2705
|
/**
|
|
2651
2706
|
* Class constructor
|
|
2652
2707
|
*
|
|
@@ -2658,7 +2713,7 @@ class ue extends x {
|
|
|
2658
2713
|
super(e, t, n), this.name = "BalanceInsufficientException";
|
|
2659
2714
|
}
|
|
2660
2715
|
}
|
|
2661
|
-
class
|
|
2716
|
+
class $t extends x {
|
|
2662
2717
|
/**
|
|
2663
2718
|
* Class constructor
|
|
2664
2719
|
*
|
|
@@ -2690,7 +2745,7 @@ class z {
|
|
|
2690
2745
|
version: i = null,
|
|
2691
2746
|
continuIdPosition: a = null
|
|
2692
2747
|
}) {
|
|
2693
|
-
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(
|
|
2748
|
+
this.status = null, this.molecularHash = null, this.createdAt = String(+/* @__PURE__ */ new Date()), this.cellSlugOrigin = this.cellSlug = r, this.secret = e, this.bundle = t, this.sourceWallet = n, this.continuIdPosition = a, this.atoms = [], this.parentHashes = [], i !== null && Object.prototype.hasOwnProperty.call(qe, i) && (this.version = String(i)), (s || n) && (this.remainderWallet = s || S.create({
|
|
2694
2749
|
secret: e,
|
|
2695
2750
|
bundle: t,
|
|
2696
2751
|
token: n.token,
|
|
@@ -2900,7 +2955,7 @@ class z {
|
|
|
2900
2955
|
fuseToken(e, t) {
|
|
2901
2956
|
const n = e.length;
|
|
2902
2957
|
if (this.sourceWallet.balance - n < 0)
|
|
2903
|
-
throw new
|
|
2958
|
+
throw new he();
|
|
2904
2959
|
return this.addAtom(g.create({
|
|
2905
2960
|
isotope: "V",
|
|
2906
2961
|
wallet: this.sourceWallet,
|
|
@@ -2931,9 +2986,9 @@ class z {
|
|
|
2931
2986
|
walletBundle: t = null
|
|
2932
2987
|
}) {
|
|
2933
2988
|
if (e < 0)
|
|
2934
|
-
throw new
|
|
2989
|
+
throw new $t("Molecule::burnToken() - Amount to burn must be positive!");
|
|
2935
2990
|
if (this.sourceWallet.balance - e < 0)
|
|
2936
|
-
throw new
|
|
2991
|
+
throw new he();
|
|
2937
2992
|
const n = new S({
|
|
2938
2993
|
bundle: "0000000000000000000000000000000000000000000000000000000000000000",
|
|
2939
2994
|
token: this.sourceWallet.token
|
|
@@ -2969,7 +3024,7 @@ class z {
|
|
|
2969
3024
|
units: t = []
|
|
2970
3025
|
}) {
|
|
2971
3026
|
if (e < 0)
|
|
2972
|
-
throw new
|
|
3027
|
+
throw new $t("Molecule::replenishToken() - Amount to replenish must be positive!");
|
|
2973
3028
|
if (t.length) {
|
|
2974
3029
|
t = S.getTokenUnits(t), this.remainderWallet.tokenUnits = this.sourceWallet.tokenUnits;
|
|
2975
3030
|
for (const n of t)
|
|
@@ -3002,7 +3057,7 @@ class z {
|
|
|
3002
3057
|
amount: t
|
|
3003
3058
|
}) {
|
|
3004
3059
|
if (this.sourceWallet.balance - t < 0)
|
|
3005
|
-
throw new
|
|
3060
|
+
throw new he();
|
|
3006
3061
|
return this.addAtom(g.create({
|
|
3007
3062
|
isotope: "V",
|
|
3008
3063
|
wallet: this.sourceWallet,
|
|
@@ -3022,42 +3077,45 @@ class z {
|
|
|
3022
3077
|
})), this;
|
|
3023
3078
|
}
|
|
3024
3079
|
/**
|
|
3025
|
-
*
|
|
3026
|
-
*
|
|
3027
|
-
*
|
|
3080
|
+
* Multi-recipient value transfer (WP line 544: one molecule funds N recipients).
|
|
3081
|
+
*
|
|
3082
|
+
* Builds 1 source atom (full-balance debit, carrying the SENT union of all units) + one atom
|
|
3083
|
+
* per recipient (its amount + its own units, walletBundle-bonded) + 1 remainder atom (the KEPT
|
|
3084
|
+
* change). Conservation: -balance + Σ amounts + (balance - Σ amounts) == 0.
|
|
3085
|
+
*
|
|
3086
|
+
* Per-unit (stackable) routing is layered by calling Wallet.splitUnitsMulti(...) BEFORE this —
|
|
3087
|
+
* it sets the source's tokenUnits to the union, each recipient's to its subset, and the
|
|
3088
|
+
* remainder's to the kept units. The single-recipient initValue() is the N=1 special case.
|
|
3028
3089
|
*
|
|
3029
|
-
* @param {Wallet}
|
|
3030
|
-
* @param {number}
|
|
3090
|
+
* @param {Wallet[]} recipientWallets
|
|
3091
|
+
* @param {number[]} amounts - parallel to recipientWallets
|
|
3031
3092
|
* @return {Molecule}
|
|
3032
3093
|
*/
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3094
|
+
initValues({
|
|
3095
|
+
recipientWallets: e,
|
|
3096
|
+
amounts: t
|
|
3036
3097
|
}) {
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
throw new ue();
|
|
3041
|
-
const n = this.sourceWallet.batchId || he({});
|
|
3098
|
+
const n = t.reduce((s, r) => s + Number(r), 0);
|
|
3099
|
+
if (this.sourceWallet.balance - n < 0)
|
|
3100
|
+
throw new he();
|
|
3042
3101
|
return this.addAtom(g.create({
|
|
3043
3102
|
isotope: "V",
|
|
3044
3103
|
wallet: this.sourceWallet,
|
|
3045
|
-
value: -
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
})
|
|
3104
|
+
value: -this.sourceWallet.balance
|
|
3105
|
+
})), e.forEach((s, r) => {
|
|
3106
|
+
this.addAtom(g.create({
|
|
3107
|
+
isotope: "V",
|
|
3108
|
+
wallet: s,
|
|
3109
|
+
value: t[r],
|
|
3110
|
+
metaType: "walletBundle",
|
|
3111
|
+
metaId: s.bundle
|
|
3112
|
+
}));
|
|
3113
|
+
}), this.addAtom(g.create({
|
|
3055
3114
|
isotope: "V",
|
|
3056
3115
|
wallet: this.remainderWallet,
|
|
3057
|
-
value: this.sourceWallet.balance -
|
|
3116
|
+
value: this.sourceWallet.balance - n,
|
|
3058
3117
|
metaType: "walletBundle",
|
|
3059
|
-
metaId: this.remainderWallet.bundle
|
|
3060
|
-
batchId: n
|
|
3118
|
+
metaId: this.remainderWallet.bundle
|
|
3061
3119
|
})), this;
|
|
3062
3120
|
}
|
|
3063
3121
|
/**
|
|
@@ -3070,7 +3128,7 @@ class z {
|
|
|
3070
3128
|
tradeRates: t
|
|
3071
3129
|
}) {
|
|
3072
3130
|
if (this.sourceWallet.balance - e < 0)
|
|
3073
|
-
throw new
|
|
3131
|
+
throw new he();
|
|
3074
3132
|
const n = S.create({
|
|
3075
3133
|
secret: this.secret,
|
|
3076
3134
|
bundle: this.bundle,
|
|
@@ -3106,10 +3164,10 @@ class z {
|
|
|
3106
3164
|
signingWallet: t = null
|
|
3107
3165
|
}) {
|
|
3108
3166
|
let n = 0;
|
|
3109
|
-
for (const
|
|
3110
|
-
n +=
|
|
3167
|
+
for (const r of Object.values(e || {}))
|
|
3168
|
+
n += r;
|
|
3111
3169
|
if (this.sourceWallet.balance - n < 0)
|
|
3112
|
-
throw new
|
|
3170
|
+
throw new he();
|
|
3113
3171
|
const s = new P();
|
|
3114
3172
|
t && s.setSigningWallet(t), this.addAtom(g.create({
|
|
3115
3173
|
isotope: "B",
|
|
@@ -3124,7 +3182,7 @@ class z {
|
|
|
3124
3182
|
isotope: "V",
|
|
3125
3183
|
token: this.sourceWallet.token,
|
|
3126
3184
|
value: i,
|
|
3127
|
-
batchId: this.sourceWallet.batchId ?
|
|
3185
|
+
batchId: this.sourceWallet.batchId ? He({}) : null,
|
|
3128
3186
|
metaType: "walletBundle",
|
|
3129
3187
|
metaId: r
|
|
3130
3188
|
}));
|
|
@@ -3232,7 +3290,7 @@ class z {
|
|
|
3232
3290
|
}) {
|
|
3233
3291
|
const s = {
|
|
3234
3292
|
code: n,
|
|
3235
|
-
hash:
|
|
3293
|
+
hash: pe(t.trim(), "Molecule::initIdentifierCreation")
|
|
3236
3294
|
};
|
|
3237
3295
|
return this.addAtom(g.create({
|
|
3238
3296
|
isotope: "C",
|
|
@@ -3371,19 +3429,19 @@ class z {
|
|
|
3371
3429
|
}) {
|
|
3372
3430
|
if (this.atoms.length === 0 || this.atoms.filter((d) => !(d instanceof g)).length !== 0)
|
|
3373
3431
|
throw new ae();
|
|
3374
|
-
!t && !this.bundle && (this.bundle = e ||
|
|
3432
|
+
!t && !this.bundle && (this.bundle = e || pe(this.secret, "Molecule::sign")), this.molecularHash = g.hashAtoms({
|
|
3375
3433
|
atoms: this.atoms
|
|
3376
3434
|
});
|
|
3377
3435
|
const s = this.atoms[0];
|
|
3378
3436
|
let r = s.position;
|
|
3379
|
-
const i =
|
|
3380
|
-
if (i && (r =
|
|
3381
|
-
throw new
|
|
3437
|
+
const i = M.get(s.aggregatedMeta(), "signingWallet");
|
|
3438
|
+
if (i && (r = M.get(JSON.parse(i), "position")), !r)
|
|
3439
|
+
throw new Jt("Signing wallet must have a position!");
|
|
3382
3440
|
const a = S.generateKey({
|
|
3383
3441
|
secret: this.secret,
|
|
3384
3442
|
token: s.token,
|
|
3385
3443
|
position: s.position
|
|
3386
|
-
}), c =
|
|
3444
|
+
}), c = Be(a, 128), u = this.normalizedHash();
|
|
3387
3445
|
let l = "";
|
|
3388
3446
|
for (const d in c) {
|
|
3389
3447
|
let b = c[d];
|
|
@@ -3391,8 +3449,8 @@ class z {
|
|
|
3391
3449
|
b = new L("SHAKE256", "TEXT").update(b).getHash("HEX", { outputLen: 512 });
|
|
3392
3450
|
l += b;
|
|
3393
3451
|
}
|
|
3394
|
-
n && (l =
|
|
3395
|
-
const h =
|
|
3452
|
+
n && (l = mn(l));
|
|
3453
|
+
const h = Be(l, Math.ceil(l.length / this.atoms.length));
|
|
3396
3454
|
let p = null;
|
|
3397
3455
|
for (let d = 0, b = h.length; d < b; d++)
|
|
3398
3456
|
this.atoms[d].otsFragment = h[d], p = this.atoms[d].position;
|
|
@@ -3665,7 +3723,7 @@ class xe {
|
|
|
3665
3723
|
}
|
|
3666
3724
|
}
|
|
3667
3725
|
const et = 10 ** 18;
|
|
3668
|
-
class
|
|
3726
|
+
class ce {
|
|
3669
3727
|
/**
|
|
3670
3728
|
* @param {number} value
|
|
3671
3729
|
* @return {number}
|
|
@@ -3680,7 +3738,7 @@ class de {
|
|
|
3680
3738
|
* @return {number}
|
|
3681
3739
|
*/
|
|
3682
3740
|
static cmp(e, t, n = !1) {
|
|
3683
|
-
const s =
|
|
3741
|
+
const s = ce.val(e) * et, r = ce.val(t) * et;
|
|
3684
3742
|
return Math.abs(s - r) < 1 ? 0 : s > r ? 1 : -1;
|
|
3685
3743
|
}
|
|
3686
3744
|
/**
|
|
@@ -3689,7 +3747,7 @@ class de {
|
|
|
3689
3747
|
* @return {boolean}
|
|
3690
3748
|
*/
|
|
3691
3749
|
static equal(e, t) {
|
|
3692
|
-
return
|
|
3750
|
+
return ce.cmp(e, t) === 0;
|
|
3693
3751
|
}
|
|
3694
3752
|
}
|
|
3695
3753
|
class te extends x {
|
|
@@ -3716,7 +3774,7 @@ class Ke extends x {
|
|
|
3716
3774
|
super(e, t, n), this.name = "UnauthenticatedException";
|
|
3717
3775
|
}
|
|
3718
3776
|
}
|
|
3719
|
-
|
|
3777
|
+
let C = class {
|
|
3720
3778
|
/**
|
|
3721
3779
|
* Class constructor
|
|
3722
3780
|
*
|
|
@@ -3731,8 +3789,8 @@ class C {
|
|
|
3731
3789
|
}) {
|
|
3732
3790
|
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)
|
|
3733
3791
|
throw new te();
|
|
3734
|
-
if (
|
|
3735
|
-
const s =
|
|
3792
|
+
if (M.has(this.$__response, this.errorKey)) {
|
|
3793
|
+
const s = M.get(this.$__response, this.errorKey);
|
|
3736
3794
|
throw String(s).includes("Unauthenticated") ? new Ke() : new te();
|
|
3737
3795
|
}
|
|
3738
3796
|
if (this.$__response.errors && Array.isArray(this.$__response.errors) && this.$__response.errors.length > 0) {
|
|
@@ -3754,9 +3812,9 @@ class C {
|
|
|
3754
3812
|
return this.response();
|
|
3755
3813
|
if (!this.response().data)
|
|
3756
3814
|
throw new te("Response has no data field");
|
|
3757
|
-
if (!
|
|
3815
|
+
if (!M.has(this.response(), this.dataKey))
|
|
3758
3816
|
throw new te(`Missing expected field: ${this.dataKey}`);
|
|
3759
|
-
return
|
|
3817
|
+
return M.get(this.response(), this.dataKey);
|
|
3760
3818
|
}
|
|
3761
3819
|
/**
|
|
3762
3820
|
* @return {object}
|
|
@@ -3898,8 +3956,8 @@ class C {
|
|
|
3898
3956
|
else
|
|
3899
3957
|
return this;
|
|
3900
3958
|
}
|
|
3901
|
-
}
|
|
3902
|
-
class
|
|
3959
|
+
};
|
|
3960
|
+
class N {
|
|
3903
3961
|
/**
|
|
3904
3962
|
* @param {UrqlClientWrapper} graphQLClient
|
|
3905
3963
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4009,7 +4067,7 @@ class K {
|
|
|
4009
4067
|
return {};
|
|
4010
4068
|
}
|
|
4011
4069
|
}
|
|
4012
|
-
class
|
|
4070
|
+
class hs extends C {
|
|
4013
4071
|
/**
|
|
4014
4072
|
* Class constructor
|
|
4015
4073
|
*
|
|
@@ -4040,7 +4098,7 @@ class us extends C {
|
|
|
4040
4098
|
}), 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;
|
|
4041
4099
|
}
|
|
4042
4100
|
}
|
|
4043
|
-
class
|
|
4101
|
+
class ds extends N {
|
|
4044
4102
|
/**
|
|
4045
4103
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4046
4104
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4074,13 +4132,13 @@ class hs extends K {
|
|
|
4074
4132
|
* @return {ResponseContinuId}
|
|
4075
4133
|
*/
|
|
4076
4134
|
createResponse(e) {
|
|
4077
|
-
return new
|
|
4135
|
+
return new hs({
|
|
4078
4136
|
query: this,
|
|
4079
4137
|
json: e
|
|
4080
4138
|
});
|
|
4081
4139
|
}
|
|
4082
4140
|
}
|
|
4083
|
-
class
|
|
4141
|
+
class ps extends C {
|
|
4084
4142
|
/**
|
|
4085
4143
|
* Class constructor
|
|
4086
4144
|
*
|
|
@@ -4108,11 +4166,11 @@ class ds extends C {
|
|
|
4108
4166
|
return null;
|
|
4109
4167
|
const t = {};
|
|
4110
4168
|
return e.forEach((n) => {
|
|
4111
|
-
n.metas =
|
|
4169
|
+
n.metas = de.aggregateMeta(n.metas), t[n.bundleHash] = n;
|
|
4112
4170
|
}), t;
|
|
4113
4171
|
}
|
|
4114
4172
|
}
|
|
4115
|
-
class
|
|
4173
|
+
class fs extends N {
|
|
4116
4174
|
/**
|
|
4117
4175
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4118
4176
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4139,7 +4197,7 @@ class ps extends K {
|
|
|
4139
4197
|
* @return {ResponseWalletBundle}
|
|
4140
4198
|
*/
|
|
4141
4199
|
createResponse(e) {
|
|
4142
|
-
return new
|
|
4200
|
+
return new ps({
|
|
4143
4201
|
query: this,
|
|
4144
4202
|
json: e
|
|
4145
4203
|
});
|
|
@@ -4187,7 +4245,7 @@ class Le extends C {
|
|
|
4187
4245
|
characters: e.characters
|
|
4188
4246
|
}), 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)
|
|
4189
4247
|
for (const s of e.tokenUnits)
|
|
4190
|
-
n.tokenUnits.push(
|
|
4248
|
+
n.tokenUnits.push(fe.createFromGraphQL(s));
|
|
4191
4249
|
if (e.tradeRates.length)
|
|
4192
4250
|
for (const s of e.tradeRates)
|
|
4193
4251
|
n.tradeRates[s.tokenSlug] = s.amount;
|
|
@@ -4220,7 +4278,7 @@ class Le extends C {
|
|
|
4220
4278
|
return this.getWallets();
|
|
4221
4279
|
}
|
|
4222
4280
|
}
|
|
4223
|
-
class
|
|
4281
|
+
class ms extends N {
|
|
4224
4282
|
/**
|
|
4225
4283
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4226
4284
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4268,7 +4326,7 @@ class fs extends K {
|
|
|
4268
4326
|
});
|
|
4269
4327
|
}
|
|
4270
4328
|
}
|
|
4271
|
-
class
|
|
4329
|
+
class ys extends C {
|
|
4272
4330
|
/**
|
|
4273
4331
|
* Class constructor
|
|
4274
4332
|
*
|
|
@@ -4297,7 +4355,7 @@ class ms extends C {
|
|
|
4297
4355
|
});
|
|
4298
4356
|
}
|
|
4299
4357
|
}
|
|
4300
|
-
class
|
|
4358
|
+
class gs extends N {
|
|
4301
4359
|
/**
|
|
4302
4360
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4303
4361
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4332,13 +4390,13 @@ class ys extends K {
|
|
|
4332
4390
|
* @return {ResponseBalance}
|
|
4333
4391
|
*/
|
|
4334
4392
|
createResponse(e) {
|
|
4335
|
-
return new
|
|
4393
|
+
return new ys({
|
|
4336
4394
|
query: this,
|
|
4337
4395
|
json: e
|
|
4338
4396
|
});
|
|
4339
4397
|
}
|
|
4340
4398
|
}
|
|
4341
|
-
class
|
|
4399
|
+
class bs extends C {
|
|
4342
4400
|
/**
|
|
4343
4401
|
* Class constructor
|
|
4344
4402
|
*
|
|
@@ -4372,7 +4430,7 @@ class gs extends C {
|
|
|
4372
4430
|
return n.instances && (t.instances = n.instances), n.instanceCount && (t.instanceCount = n.instanceCount), n.paginatorInfo && (t.paginatorInfo = n.paginatorInfo), t;
|
|
4373
4431
|
}
|
|
4374
4432
|
}
|
|
4375
|
-
class At extends
|
|
4433
|
+
class At extends N {
|
|
4376
4434
|
/**
|
|
4377
4435
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4378
4436
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4441,13 +4499,13 @@ class At extends K {
|
|
|
4441
4499
|
* @return {ResponseMetaType}
|
|
4442
4500
|
*/
|
|
4443
4501
|
createResponse(e) {
|
|
4444
|
-
return new
|
|
4502
|
+
return new bs({
|
|
4445
4503
|
query: this,
|
|
4446
4504
|
json: e
|
|
4447
4505
|
});
|
|
4448
4506
|
}
|
|
4449
4507
|
}
|
|
4450
|
-
class Ie extends
|
|
4508
|
+
class Ie extends N {
|
|
4451
4509
|
/**
|
|
4452
4510
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4453
4511
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4528,7 +4586,7 @@ class Ie extends K {
|
|
|
4528
4586
|
return t.dataKey = "data.Batch", t;
|
|
4529
4587
|
}
|
|
4530
4588
|
}
|
|
4531
|
-
class
|
|
4589
|
+
class ws extends N {
|
|
4532
4590
|
/**
|
|
4533
4591
|
* @param {UrqlClientWrapper} graphQLClient
|
|
4534
4592
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -4575,7 +4633,7 @@ class V extends C {
|
|
|
4575
4633
|
* Initialize response object with payload data
|
|
4576
4634
|
*/
|
|
4577
4635
|
init() {
|
|
4578
|
-
const e =
|
|
4636
|
+
const e = M.get(this.data(), "payload");
|
|
4579
4637
|
try {
|
|
4580
4638
|
this.$__payload = Object.prototype.toString.call(e) === "[object String]" ? JSON.parse(e) : e;
|
|
4581
4639
|
} catch {
|
|
@@ -4598,7 +4656,7 @@ class V extends C {
|
|
|
4598
4656
|
if (!e)
|
|
4599
4657
|
return null;
|
|
4600
4658
|
const t = new z({});
|
|
4601
|
-
return t.molecularHash =
|
|
4659
|
+
return t.molecularHash = M.get(e, "molecularHash"), t.status = M.get(e, "status"), t.createdAt = M.get(e, "createdAt"), t;
|
|
4602
4660
|
}
|
|
4603
4661
|
/**
|
|
4604
4662
|
* Returns whether molecule was accepted or not
|
|
@@ -4614,7 +4672,7 @@ class V extends C {
|
|
|
4614
4672
|
* @return {string}
|
|
4615
4673
|
*/
|
|
4616
4674
|
status() {
|
|
4617
|
-
return
|
|
4675
|
+
return M.get(this.data(), "status", "rejected");
|
|
4618
4676
|
}
|
|
4619
4677
|
/**
|
|
4620
4678
|
* Returns the reason for rejection
|
|
@@ -4622,7 +4680,7 @@ class V extends C {
|
|
|
4622
4680
|
* @return {string}
|
|
4623
4681
|
*/
|
|
4624
4682
|
reason() {
|
|
4625
|
-
return
|
|
4683
|
+
return M.get(this.data(), "reason", "Invalid response from server");
|
|
4626
4684
|
}
|
|
4627
4685
|
/**
|
|
4628
4686
|
* Returns payload object
|
|
@@ -4633,7 +4691,7 @@ class V extends C {
|
|
|
4633
4691
|
return this.$__payload;
|
|
4634
4692
|
}
|
|
4635
4693
|
}
|
|
4636
|
-
class Qe extends
|
|
4694
|
+
class Qe extends N {
|
|
4637
4695
|
/**
|
|
4638
4696
|
* Creates a new Request for the given parameters
|
|
4639
4697
|
*
|
|
@@ -4748,7 +4806,7 @@ class W extends Qe {
|
|
|
4748
4806
|
return this.$__molecule;
|
|
4749
4807
|
}
|
|
4750
4808
|
}
|
|
4751
|
-
class
|
|
4809
|
+
class ks extends V {
|
|
4752
4810
|
/**
|
|
4753
4811
|
* return the authorization key
|
|
4754
4812
|
*
|
|
@@ -4756,9 +4814,9 @@ class ws extends V {
|
|
|
4756
4814
|
* @return {*}
|
|
4757
4815
|
*/
|
|
4758
4816
|
payloadKey(e) {
|
|
4759
|
-
if (!
|
|
4817
|
+
if (!M.has(this.payload(), e))
|
|
4760
4818
|
throw new te(`ResponseRequestAuthorization::payloadKey() - '${e}' key was not found in the payload!`);
|
|
4761
|
-
return
|
|
4819
|
+
return M.get(this.payload(), e);
|
|
4762
4820
|
}
|
|
4763
4821
|
/**
|
|
4764
4822
|
* Returns the auth token
|
|
@@ -4809,7 +4867,7 @@ class ws extends V {
|
|
|
4809
4867
|
return this.payloadKey("key");
|
|
4810
4868
|
}
|
|
4811
4869
|
}
|
|
4812
|
-
class
|
|
4870
|
+
class _s extends W {
|
|
4813
4871
|
/**
|
|
4814
4872
|
*
|
|
4815
4873
|
* @param {object} meta
|
|
@@ -4824,15 +4882,15 @@ class ks extends W {
|
|
|
4824
4882
|
* @return {ResponseRequestAuthorization}
|
|
4825
4883
|
*/
|
|
4826
4884
|
createResponse(e) {
|
|
4827
|
-
return new
|
|
4885
|
+
return new ks({
|
|
4828
4886
|
query: this,
|
|
4829
4887
|
json: e
|
|
4830
4888
|
});
|
|
4831
4889
|
}
|
|
4832
4890
|
}
|
|
4833
|
-
class
|
|
4891
|
+
class Ss extends V {
|
|
4834
4892
|
}
|
|
4835
|
-
class
|
|
4893
|
+
class $s extends W {
|
|
4836
4894
|
/**
|
|
4837
4895
|
* @param {Wallet|null} recipientWallet
|
|
4838
4896
|
* @param {number|null} amount
|
|
@@ -4858,15 +4916,15 @@ class Ss extends W {
|
|
|
4858
4916
|
* @return {ResponseCreateToken}
|
|
4859
4917
|
*/
|
|
4860
4918
|
createResponse(e) {
|
|
4861
|
-
return new
|
|
4919
|
+
return new Ss({
|
|
4862
4920
|
query: this,
|
|
4863
4921
|
json: e
|
|
4864
4922
|
});
|
|
4865
4923
|
}
|
|
4866
4924
|
}
|
|
4867
|
-
class
|
|
4925
|
+
class As extends V {
|
|
4868
4926
|
}
|
|
4869
|
-
class
|
|
4927
|
+
class vs extends W {
|
|
4870
4928
|
/**
|
|
4871
4929
|
* Fills a Molecule with the appropriate atoms and prepares for broadcast
|
|
4872
4930
|
*
|
|
@@ -4901,13 +4959,13 @@ class As extends W {
|
|
|
4901
4959
|
* @return {ResponseRequestTokens}
|
|
4902
4960
|
*/
|
|
4903
4961
|
createResponse(e) {
|
|
4904
|
-
return new
|
|
4962
|
+
return new As({
|
|
4905
4963
|
query: this,
|
|
4906
4964
|
json: e
|
|
4907
4965
|
});
|
|
4908
4966
|
}
|
|
4909
4967
|
}
|
|
4910
|
-
class
|
|
4968
|
+
class xs extends V {
|
|
4911
4969
|
/**
|
|
4912
4970
|
* Returns result of the transfer
|
|
4913
4971
|
*
|
|
@@ -4921,7 +4979,7 @@ class vs extends V {
|
|
|
4921
4979
|
return e.reason = typeof t.reason > "u" ? "Invalid response from server" : t.reason, e.status = typeof t.status > "u" ? "rejected" : t.status, e;
|
|
4922
4980
|
}
|
|
4923
4981
|
}
|
|
4924
|
-
class
|
|
4982
|
+
class vt extends W {
|
|
4925
4983
|
/**
|
|
4926
4984
|
* Fills the Molecule with provided wallet and amount data
|
|
4927
4985
|
*
|
|
@@ -4937,6 +4995,21 @@ class xs extends W {
|
|
|
4937
4995
|
amount: t
|
|
4938
4996
|
}), this.$__molecule.sign({}), this.$__molecule.check(this.$__molecule.sourceWallet);
|
|
4939
4997
|
}
|
|
4998
|
+
/**
|
|
4999
|
+
* Fills the Molecule for a MULTI-recipient transfer (WP line 544)
|
|
5000
|
+
*
|
|
5001
|
+
* @param {Wallet[]} recipientWallets
|
|
5002
|
+
* @param {number[]} amounts - parallel to recipientWallets
|
|
5003
|
+
*/
|
|
5004
|
+
fillMoleculeMulti({
|
|
5005
|
+
recipientWallets: e,
|
|
5006
|
+
amounts: t
|
|
5007
|
+
}) {
|
|
5008
|
+
this.$__molecule.initValues({
|
|
5009
|
+
recipientWallets: e,
|
|
5010
|
+
amounts: t
|
|
5011
|
+
}), this.$__molecule.sign({}), this.$__molecule.check(this.$__molecule.sourceWallet);
|
|
5012
|
+
}
|
|
4940
5013
|
/**
|
|
4941
5014
|
* Builds a Response object out of a JSON string
|
|
4942
5015
|
*
|
|
@@ -4944,7 +5017,7 @@ class xs extends W {
|
|
|
4944
5017
|
* @return {ResponseTransferTokens}
|
|
4945
5018
|
*/
|
|
4946
5019
|
createResponse(e) {
|
|
4947
|
-
return new
|
|
5020
|
+
return new xs({
|
|
4948
5021
|
query: this,
|
|
4949
5022
|
json: e
|
|
4950
5023
|
});
|
|
@@ -4952,7 +5025,7 @@ class xs extends W {
|
|
|
4952
5025
|
}
|
|
4953
5026
|
class Is extends V {
|
|
4954
5027
|
}
|
|
4955
|
-
class
|
|
5028
|
+
class Ms extends W {
|
|
4956
5029
|
fillMolecule({
|
|
4957
5030
|
type: e,
|
|
4958
5031
|
contact: t,
|
|
@@ -4977,7 +5050,7 @@ class Ts extends W {
|
|
|
4977
5050
|
});
|
|
4978
5051
|
}
|
|
4979
5052
|
}
|
|
4980
|
-
class
|
|
5053
|
+
class Ts extends V {
|
|
4981
5054
|
}
|
|
4982
5055
|
class Cs extends W {
|
|
4983
5056
|
/**
|
|
@@ -5005,7 +5078,7 @@ class Cs extends W {
|
|
|
5005
5078
|
* @return {ResponseClaimShadowWallet}
|
|
5006
5079
|
*/
|
|
5007
5080
|
createResponse(e) {
|
|
5008
|
-
return new
|
|
5081
|
+
return new Ts({
|
|
5009
5082
|
query: this,
|
|
5010
5083
|
json: e
|
|
5011
5084
|
});
|
|
@@ -5136,7 +5209,7 @@ class Bs extends C {
|
|
|
5136
5209
|
* @return {*}
|
|
5137
5210
|
*/
|
|
5138
5211
|
success() {
|
|
5139
|
-
return
|
|
5212
|
+
return M.get(this.data(), "set");
|
|
5140
5213
|
}
|
|
5141
5214
|
/**
|
|
5142
5215
|
* Returns message
|
|
@@ -5144,7 +5217,7 @@ class Bs extends C {
|
|
|
5144
5217
|
* @return {*}
|
|
5145
5218
|
*/
|
|
5146
5219
|
message() {
|
|
5147
|
-
return
|
|
5220
|
+
return M.get(this.data(), "message");
|
|
5148
5221
|
}
|
|
5149
5222
|
}
|
|
5150
5223
|
class Hs extends Qe {
|
|
@@ -5243,9 +5316,9 @@ class Ns extends C {
|
|
|
5243
5316
|
* @return {*}
|
|
5244
5317
|
*/
|
|
5245
5318
|
payloadKey(e) {
|
|
5246
|
-
if (!
|
|
5319
|
+
if (!M.has(this.payload(), e))
|
|
5247
5320
|
throw new te(`ResponseAuthorizationGuest::payloadKey() - '${e}' key is not found in the payload!`);
|
|
5248
|
-
return
|
|
5321
|
+
return M.get(this.payload(), e);
|
|
5249
5322
|
}
|
|
5250
5323
|
/**
|
|
5251
5324
|
* Returns the auth token
|
|
@@ -5324,7 +5397,7 @@ class Fs extends Qe {
|
|
|
5324
5397
|
});
|
|
5325
5398
|
}
|
|
5326
5399
|
}
|
|
5327
|
-
class
|
|
5400
|
+
class xt extends x {
|
|
5328
5401
|
/**
|
|
5329
5402
|
* Class constructor
|
|
5330
5403
|
*
|
|
@@ -5348,7 +5421,7 @@ class Ls extends x {
|
|
|
5348
5421
|
super(e, t, n), this.name = "StackableUnitDecimalsException";
|
|
5349
5422
|
}
|
|
5350
5423
|
}
|
|
5351
|
-
class
|
|
5424
|
+
class _e extends x {
|
|
5352
5425
|
/**
|
|
5353
5426
|
* Class constructor
|
|
5354
5427
|
*
|
|
@@ -5648,7 +5721,7 @@ class Gs extends C {
|
|
|
5648
5721
|
return t;
|
|
5649
5722
|
}
|
|
5650
5723
|
}
|
|
5651
|
-
class Xs extends
|
|
5724
|
+
class Xs extends N {
|
|
5652
5725
|
/**
|
|
5653
5726
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5654
5727
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -5676,126 +5749,7 @@ class Xs extends K {
|
|
|
5676
5749
|
});
|
|
5677
5750
|
}
|
|
5678
5751
|
}
|
|
5679
|
-
class Zs extends
|
|
5680
|
-
/**
|
|
5681
|
-
* Class constructor
|
|
5682
|
-
*
|
|
5683
|
-
* @param {Query} query
|
|
5684
|
-
* @param {object} json
|
|
5685
|
-
*/
|
|
5686
|
-
constructor({
|
|
5687
|
-
query: e,
|
|
5688
|
-
json: t
|
|
5689
|
-
}) {
|
|
5690
|
-
super({
|
|
5691
|
-
query: e,
|
|
5692
|
-
json: t,
|
|
5693
|
-
dataKey: "data.UserActivity"
|
|
5694
|
-
});
|
|
5695
|
-
}
|
|
5696
|
-
payload() {
|
|
5697
|
-
const e = JSON.parse(JSON.stringify(this.data()));
|
|
5698
|
-
if (e.instances)
|
|
5699
|
-
for (const t of e.instances)
|
|
5700
|
-
t.jsonData = JSON.parse(t.jsonData);
|
|
5701
|
-
return e;
|
|
5702
|
-
}
|
|
5703
|
-
}
|
|
5704
|
-
class Ys extends K {
|
|
5705
|
-
/**
|
|
5706
|
-
* @param {UrqlClientWrapper} graphQLClient
|
|
5707
|
-
* @param {KnishIOClient} knishIOClient
|
|
5708
|
-
*/
|
|
5709
|
-
constructor(e, t) {
|
|
5710
|
-
super(e, t), this.$__query = E`query UserActivity (
|
|
5711
|
-
$bundleHash:String,
|
|
5712
|
-
$metaType: String,
|
|
5713
|
-
$metaId: String,
|
|
5714
|
-
$ipAddress: String,
|
|
5715
|
-
$browser: String,
|
|
5716
|
-
$osCpu: String,
|
|
5717
|
-
$resolution: String,
|
|
5718
|
-
$timeZone: String,
|
|
5719
|
-
$countBy: [CountByUserActivity],
|
|
5720
|
-
$interval: span
|
|
5721
|
-
) {
|
|
5722
|
-
UserActivity (
|
|
5723
|
-
bundleHash: $bundleHash,
|
|
5724
|
-
metaType: $metaType,
|
|
5725
|
-
metaId: $metaId,
|
|
5726
|
-
ipAddress: $ipAddress,
|
|
5727
|
-
browser: $browser,
|
|
5728
|
-
osCpu: $osCpu,
|
|
5729
|
-
resolution: $resolution,
|
|
5730
|
-
timeZone: $timeZone,
|
|
5731
|
-
countBy: $countBy,
|
|
5732
|
-
interval: $interval
|
|
5733
|
-
) {
|
|
5734
|
-
createdAt,
|
|
5735
|
-
bundleHash,
|
|
5736
|
-
metaType,
|
|
5737
|
-
metaId,
|
|
5738
|
-
instances {
|
|
5739
|
-
bundleHash,
|
|
5740
|
-
metaType,
|
|
5741
|
-
metaId,
|
|
5742
|
-
jsonData,
|
|
5743
|
-
createdAt,
|
|
5744
|
-
updatedAt
|
|
5745
|
-
},
|
|
5746
|
-
instanceCount {
|
|
5747
|
-
...SubFields,
|
|
5748
|
-
...Recursive
|
|
5749
|
-
}
|
|
5750
|
-
}
|
|
5751
|
-
}
|
|
5752
|
-
|
|
5753
|
-
fragment SubFields on InstanceCountType {
|
|
5754
|
-
id,
|
|
5755
|
-
count
|
|
5756
|
-
}
|
|
5757
|
-
|
|
5758
|
-
fragment Recursive on InstanceCountType {
|
|
5759
|
-
instances {
|
|
5760
|
-
...SubFields
|
|
5761
|
-
instances {
|
|
5762
|
-
...SubFields,
|
|
5763
|
-
instances {
|
|
5764
|
-
...SubFields
|
|
5765
|
-
instances {
|
|
5766
|
-
...SubFields
|
|
5767
|
-
instances {
|
|
5768
|
-
...SubFields
|
|
5769
|
-
instances {
|
|
5770
|
-
...SubFields
|
|
5771
|
-
instances {
|
|
5772
|
-
...SubFields
|
|
5773
|
-
instances {
|
|
5774
|
-
...SubFields
|
|
5775
|
-
}
|
|
5776
|
-
}
|
|
5777
|
-
}
|
|
5778
|
-
}
|
|
5779
|
-
}
|
|
5780
|
-
}
|
|
5781
|
-
}
|
|
5782
|
-
}
|
|
5783
|
-
}`;
|
|
5784
|
-
}
|
|
5785
|
-
/**
|
|
5786
|
-
* Returns a Response object
|
|
5787
|
-
*
|
|
5788
|
-
* @param {object} json
|
|
5789
|
-
* @return {ResponseQueryUserActivity}
|
|
5790
|
-
*/
|
|
5791
|
-
createResponse(e) {
|
|
5792
|
-
return new Zs({
|
|
5793
|
-
query: this,
|
|
5794
|
-
json: e
|
|
5795
|
-
});
|
|
5796
|
-
}
|
|
5797
|
-
}
|
|
5798
|
-
class er extends K {
|
|
5752
|
+
class Zs extends N {
|
|
5799
5753
|
/**
|
|
5800
5754
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5801
5755
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -5826,7 +5780,7 @@ class er extends K {
|
|
|
5826
5780
|
});
|
|
5827
5781
|
}
|
|
5828
5782
|
}
|
|
5829
|
-
class
|
|
5783
|
+
class It extends x {
|
|
5830
5784
|
/**
|
|
5831
5785
|
* Class constructor
|
|
5832
5786
|
*
|
|
@@ -5838,7 +5792,7 @@ class xt extends x {
|
|
|
5838
5792
|
super(e, t, n), this.name = "AuthorizationRejectedException";
|
|
5839
5793
|
}
|
|
5840
5794
|
}
|
|
5841
|
-
class
|
|
5795
|
+
class Ys extends C {
|
|
5842
5796
|
/**
|
|
5843
5797
|
* Class constructor
|
|
5844
5798
|
*
|
|
@@ -5886,7 +5840,7 @@ class tr extends C {
|
|
|
5886
5840
|
return t;
|
|
5887
5841
|
}
|
|
5888
5842
|
}
|
|
5889
|
-
class
|
|
5843
|
+
class Mt extends N {
|
|
5890
5844
|
/**
|
|
5891
5845
|
* @param {UrqlClientWrapper} graphQLClient
|
|
5892
5846
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -6002,7 +5956,7 @@ class It extends K {
|
|
|
6002
5956
|
values: f,
|
|
6003
5957
|
value: m,
|
|
6004
5958
|
metaTypes: w,
|
|
6005
|
-
metaType:
|
|
5959
|
+
metaType: T,
|
|
6006
5960
|
metaIds: k,
|
|
6007
5961
|
metaId: $,
|
|
6008
5962
|
indexes: v,
|
|
@@ -6011,7 +5965,7 @@ class It extends K {
|
|
|
6011
5965
|
latest: U,
|
|
6012
5966
|
queryArgs: R
|
|
6013
5967
|
}) {
|
|
6014
|
-
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)),
|
|
5968
|
+
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)), {
|
|
6015
5969
|
molecularHashes: e,
|
|
6016
5970
|
bundleHashes: n,
|
|
6017
5971
|
positions: r,
|
|
@@ -6036,13 +5990,13 @@ class It extends K {
|
|
|
6036
5990
|
* @return {ResponseAtom}
|
|
6037
5991
|
*/
|
|
6038
5992
|
createResponse(e) {
|
|
6039
|
-
return new
|
|
5993
|
+
return new Ys({
|
|
6040
5994
|
query: this,
|
|
6041
5995
|
json: e
|
|
6042
5996
|
});
|
|
6043
5997
|
}
|
|
6044
5998
|
}
|
|
6045
|
-
class
|
|
5999
|
+
class er extends C {
|
|
6046
6000
|
/**
|
|
6047
6001
|
* Class constructor
|
|
6048
6002
|
*
|
|
@@ -6067,7 +6021,7 @@ class nr extends C {
|
|
|
6067
6021
|
return e && e.callback ? JSON.parse(e.callback) : null;
|
|
6068
6022
|
}
|
|
6069
6023
|
}
|
|
6070
|
-
class
|
|
6024
|
+
class tr extends N {
|
|
6071
6025
|
/**
|
|
6072
6026
|
* @param {UrqlClientWrapper} graphQLClient
|
|
6073
6027
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -6093,13 +6047,13 @@ class sr extends K {
|
|
|
6093
6047
|
* @return {ResponsePolicy}
|
|
6094
6048
|
*/
|
|
6095
6049
|
createResponse(e) {
|
|
6096
|
-
return new
|
|
6050
|
+
return new er({
|
|
6097
6051
|
query: this,
|
|
6098
6052
|
json: e
|
|
6099
6053
|
});
|
|
6100
6054
|
}
|
|
6101
6055
|
}
|
|
6102
|
-
class
|
|
6056
|
+
class nr extends C {
|
|
6103
6057
|
/**
|
|
6104
6058
|
* Class constructor
|
|
6105
6059
|
*
|
|
@@ -6128,7 +6082,7 @@ class rr extends C {
|
|
|
6128
6082
|
return n.instances && (t.instances = n.instances), n.instanceCount && (t.instanceCount = n.instanceCount), n.paginatorInfo && (t.paginatorInfo = n.paginatorInfo), t;
|
|
6129
6083
|
}
|
|
6130
6084
|
}
|
|
6131
|
-
class Tt extends
|
|
6085
|
+
class Tt extends N {
|
|
6132
6086
|
/**
|
|
6133
6087
|
* @param {UrqlClientWrapper} graphQLClient
|
|
6134
6088
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -6214,7 +6168,7 @@ class Tt extends K {
|
|
|
6214
6168
|
* @return {ResponseMetaTypeViaAtom}
|
|
6215
6169
|
*/
|
|
6216
6170
|
createResponse(e) {
|
|
6217
|
-
return new
|
|
6171
|
+
return new nr({
|
|
6218
6172
|
query: this,
|
|
6219
6173
|
json: e
|
|
6220
6174
|
});
|
|
@@ -6321,7 +6275,7 @@ class ot extends C {
|
|
|
6321
6275
|
};
|
|
6322
6276
|
}
|
|
6323
6277
|
}
|
|
6324
|
-
class
|
|
6278
|
+
class Ct extends N {
|
|
6325
6279
|
/**
|
|
6326
6280
|
* @param {UrqlClientWrapper} graphQLClient
|
|
6327
6281
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -6434,7 +6388,7 @@ class Mt extends K {
|
|
|
6434
6388
|
});
|
|
6435
6389
|
}
|
|
6436
6390
|
}
|
|
6437
|
-
class
|
|
6391
|
+
class sr extends C {
|
|
6438
6392
|
/**
|
|
6439
6393
|
* Class constructor
|
|
6440
6394
|
*
|
|
@@ -6470,7 +6424,7 @@ class ir extends C {
|
|
|
6470
6424
|
return !e || !Array.isArray(e) || e.length === 0 ? null : e;
|
|
6471
6425
|
}
|
|
6472
6426
|
}
|
|
6473
|
-
class
|
|
6427
|
+
class Et extends N {
|
|
6474
6428
|
/**
|
|
6475
6429
|
* @param {UrqlClientWrapper} graphQLClient
|
|
6476
6430
|
* @param {KnishIOClient} knishIOClient
|
|
@@ -6514,15 +6468,15 @@ class Ct extends K {
|
|
|
6514
6468
|
* @return {ResponseEmbeddingStatus}
|
|
6515
6469
|
*/
|
|
6516
6470
|
createResponse(e) {
|
|
6517
|
-
return new
|
|
6471
|
+
return new sr({
|
|
6518
6472
|
query: this,
|
|
6519
6473
|
json: e
|
|
6520
6474
|
});
|
|
6521
6475
|
}
|
|
6522
6476
|
}
|
|
6523
|
-
class
|
|
6477
|
+
class rr extends V {
|
|
6524
6478
|
}
|
|
6525
|
-
class
|
|
6479
|
+
class ir extends W {
|
|
6526
6480
|
/**
|
|
6527
6481
|
*
|
|
6528
6482
|
* @param {string} metaType
|
|
@@ -6550,13 +6504,13 @@ class ar extends W {
|
|
|
6550
6504
|
* @return {ResponseCreateRule}
|
|
6551
6505
|
*/
|
|
6552
6506
|
createResponse(e) {
|
|
6553
|
-
return new
|
|
6507
|
+
return new rr({
|
|
6554
6508
|
query: this,
|
|
6555
6509
|
json: e
|
|
6556
6510
|
});
|
|
6557
6511
|
}
|
|
6558
6512
|
}
|
|
6559
|
-
class
|
|
6513
|
+
class or extends W {
|
|
6560
6514
|
/**
|
|
6561
6515
|
* Fills the Molecule with provided wallet and amount data
|
|
6562
6516
|
*
|
|
@@ -6573,7 +6527,7 @@ class lr extends W {
|
|
|
6573
6527
|
}), this.$__molecule.sign({}), this.$__molecule.check(this.$__molecule.sourceWallet);
|
|
6574
6528
|
}
|
|
6575
6529
|
}
|
|
6576
|
-
class
|
|
6530
|
+
class ar extends W {
|
|
6577
6531
|
/**
|
|
6578
6532
|
*
|
|
6579
6533
|
* @param recipients
|
|
@@ -6589,7 +6543,7 @@ class cr extends W {
|
|
|
6589
6543
|
}), this.$__molecule.sign({}), this.$__molecule.check(this.$__molecule.sourceWallet);
|
|
6590
6544
|
}
|
|
6591
6545
|
}
|
|
6592
|
-
function
|
|
6546
|
+
function Z(o, e, t, n) {
|
|
6593
6547
|
return new (t || (t = Promise))((function(s, r) {
|
|
6594
6548
|
function i(u) {
|
|
6595
6549
|
try {
|
|
@@ -6614,7 +6568,7 @@ function X(o, e, t, n) {
|
|
|
6614
6568
|
c((n = n.apply(o, [])).next());
|
|
6615
6569
|
}));
|
|
6616
6570
|
}
|
|
6617
|
-
function
|
|
6571
|
+
function Y(o, e) {
|
|
6618
6572
|
var t, n, s, r, i = { label: 0, sent: function() {
|
|
6619
6573
|
if (1 & s[0]) throw s[1];
|
|
6620
6574
|
return s[1];
|
|
@@ -6673,10 +6627,10 @@ function Z(o, e) {
|
|
|
6673
6627
|
};
|
|
6674
6628
|
}
|
|
6675
6629
|
}
|
|
6676
|
-
var q = { exclude: [], include: [], logging: !0 },
|
|
6677
|
-
typeof window < "u" && (
|
|
6678
|
-
},
|
|
6679
|
-
return Object.fromEntries(Object.entries(
|
|
6630
|
+
var q = { exclude: [], include: [], logging: !0 }, Gt = {}, lr = { timeout: "true" }, J = function(o, e) {
|
|
6631
|
+
typeof window < "u" && (Gt[o] = e);
|
|
6632
|
+
}, cr = function() {
|
|
6633
|
+
return Object.fromEntries(Object.entries(Gt).filter((function(o) {
|
|
6680
6634
|
var e, t = o[0];
|
|
6681
6635
|
return !(!((e = q == null ? void 0 : q.exclude) === null || e === void 0) && e.includes(t));
|
|
6682
6636
|
})).filter((function(o) {
|
|
@@ -6690,7 +6644,7 @@ var q = { exclude: [], include: [], logging: !0 }, Jt = {}, ur = { timeout: "tru
|
|
|
6690
6644
|
return [o[0], (0, o[1])()];
|
|
6691
6645
|
})));
|
|
6692
6646
|
};
|
|
6693
|
-
function
|
|
6647
|
+
function Re(o) {
|
|
6694
6648
|
return o ^= o >>> 16, o = Math.imul(o, 2246822507), o ^= o >>> 13, o = Math.imul(o, 3266489909), (o ^= o >>> 16) >>> 0;
|
|
6695
6649
|
}
|
|
6696
6650
|
var B = new Uint32Array([597399067, 2869860233, 951274213, 2716044179]);
|
|
@@ -6741,42 +6695,42 @@ function at(o, e) {
|
|
|
6741
6695
|
u[0] = u[0] ^ l[0] << 0, u[0] = Math.imul(u[0], B[0]), u[0] = j(u[0], 15), u[0] = Math.imul(u[0], B[1]), i[0] = i[0] ^ u[0];
|
|
6742
6696
|
}
|
|
6743
6697
|
})(o, n), (function(r, i) {
|
|
6744
|
-
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] =
|
|
6698
|
+
i[0] = i[0] ^ r.byteLength, i[1] = i[1] ^ r.byteLength, i[2] = i[2] ^ r.byteLength, i[3] = i[3] ^ r.byteLength, i[0] = i[0] + i[1] | 0, i[0] = i[0] + i[2] | 0, i[0] = i[0] + i[3] | 0, i[1] = i[1] + i[0] | 0, i[2] = i[2] + i[0] | 0, i[3] = i[3] + i[0] | 0, i[0] = Re(i[0]), i[1] = Re(i[1]), i[2] = Re(i[2]), i[3] = Re(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;
|
|
6745
6699
|
})(o, n);
|
|
6746
6700
|
var s = new Uint8Array(n.buffer);
|
|
6747
6701
|
return Array.from(s).map((function(r) {
|
|
6748
6702
|
return r.toString(16).padStart(2, "0");
|
|
6749
6703
|
})).join("");
|
|
6750
6704
|
}
|
|
6751
|
-
function
|
|
6705
|
+
function ur(o, e) {
|
|
6752
6706
|
return new Promise((function(t) {
|
|
6753
6707
|
setTimeout((function() {
|
|
6754
6708
|
return t(e);
|
|
6755
6709
|
}), o);
|
|
6756
6710
|
}));
|
|
6757
6711
|
}
|
|
6758
|
-
function
|
|
6712
|
+
function hr(o, e, t) {
|
|
6759
6713
|
return Promise.all(o.map((function(n) {
|
|
6760
|
-
return Promise.race([n,
|
|
6714
|
+
return Promise.race([n, ur(e, t)]);
|
|
6761
6715
|
})));
|
|
6762
6716
|
}
|
|
6763
|
-
var
|
|
6764
|
-
function
|
|
6765
|
-
return
|
|
6717
|
+
var dr = "0.19.1";
|
|
6718
|
+
function pr() {
|
|
6719
|
+
return dr;
|
|
6766
6720
|
}
|
|
6767
|
-
function
|
|
6768
|
-
return
|
|
6721
|
+
function Xt() {
|
|
6722
|
+
return Z(this, void 0, void 0, (function() {
|
|
6769
6723
|
var o, e, t, n, s;
|
|
6770
|
-
return
|
|
6724
|
+
return Y(this, (function(r) {
|
|
6771
6725
|
switch (r.label) {
|
|
6772
6726
|
case 0:
|
|
6773
|
-
return r.trys.push([0, 2, , 3]), o =
|
|
6727
|
+
return r.trys.push([0, 2, , 3]), o = cr(), e = Object.keys(o), [4, hr(Object.values(o), (q == null ? void 0 : q.timeout) || 1e3, lr)];
|
|
6774
6728
|
case 1:
|
|
6775
6729
|
return t = r.sent(), n = t.filter((function(i) {
|
|
6776
6730
|
return i !== void 0;
|
|
6777
6731
|
})), s = {}, n.forEach((function(i, a) {
|
|
6778
6732
|
s[e[a]] = i;
|
|
6779
|
-
})), [2,
|
|
6733
|
+
})), [2, Zt(s, q.exclude || [], q.include || [], "")];
|
|
6780
6734
|
case 2:
|
|
6781
6735
|
throw r.sent();
|
|
6782
6736
|
case 3:
|
|
@@ -6785,7 +6739,7 @@ function Gt() {
|
|
|
6785
6739
|
}));
|
|
6786
6740
|
}));
|
|
6787
6741
|
}
|
|
6788
|
-
function
|
|
6742
|
+
function Zt(o, e, t, n) {
|
|
6789
6743
|
n === void 0 && (n = "");
|
|
6790
6744
|
for (var s = {}, r = function(u, l) {
|
|
6791
6745
|
var h = n + u + ".";
|
|
@@ -6797,7 +6751,7 @@ function Xt(o, e, t, n) {
|
|
|
6797
6751
|
}));
|
|
6798
6752
|
p && !d || (s[u] = l);
|
|
6799
6753
|
} else {
|
|
6800
|
-
var b =
|
|
6754
|
+
var b = Zt(l, e, t, h);
|
|
6801
6755
|
Object.keys(b).length > 0 && (s[u] = b);
|
|
6802
6756
|
}
|
|
6803
6757
|
}, i = 0, a = Object.entries(o); i < a.length; i++) {
|
|
@@ -6806,21 +6760,21 @@ function Xt(o, e, t, n) {
|
|
|
6806
6760
|
}
|
|
6807
6761
|
return s;
|
|
6808
6762
|
}
|
|
6809
|
-
function
|
|
6810
|
-
return
|
|
6763
|
+
function fr(o) {
|
|
6764
|
+
return Z(this, void 0, void 0, (function() {
|
|
6811
6765
|
var e, t;
|
|
6812
|
-
return
|
|
6766
|
+
return Y(this, (function(n) {
|
|
6813
6767
|
switch (n.label) {
|
|
6814
6768
|
case 0:
|
|
6815
|
-
return n.trys.push([0, 2, , 3]), [4,
|
|
6769
|
+
return n.trys.push([0, 2, , 3]), [4, Xt()];
|
|
6816
6770
|
case 1:
|
|
6817
6771
|
return e = n.sent(), t = at(JSON.stringify(e)), Math.random() < 1e-3 && q.logging && (function(s, r) {
|
|
6818
|
-
|
|
6772
|
+
Z(this, void 0, void 0, (function() {
|
|
6819
6773
|
var i, a;
|
|
6820
|
-
return
|
|
6774
|
+
return Y(this, (function(c) {
|
|
6821
6775
|
switch (c.label) {
|
|
6822
6776
|
case 0:
|
|
6823
|
-
if (i = "https://logging.thumbmarkjs.com/v1/log", a = { thumbmark: s, components: r, version:
|
|
6777
|
+
if (i = "https://logging.thumbmarkjs.com/v1/log", a = { thumbmark: s, components: r, version: pr() }, sessionStorage.getItem("_tmjs_l")) return [3, 4];
|
|
6824
6778
|
sessionStorage.setItem("_tmjs_l", "1"), c.label = 1;
|
|
6825
6779
|
case 1:
|
|
6826
6780
|
return c.trys.push([1, 3, , 4]), [4, fetch(i, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(a) })];
|
|
@@ -6841,19 +6795,19 @@ function yr(o) {
|
|
|
6841
6795
|
}));
|
|
6842
6796
|
}));
|
|
6843
6797
|
}
|
|
6844
|
-
function
|
|
6798
|
+
function mr(o) {
|
|
6845
6799
|
for (var e = 0, t = 0; t < o.length; ++t) e += Math.abs(o[t]);
|
|
6846
6800
|
return e;
|
|
6847
6801
|
}
|
|
6848
|
-
function
|
|
6802
|
+
function Yt(o, e, t) {
|
|
6849
6803
|
for (var n = [], s = 0; s < o[0].data.length; s++) {
|
|
6850
6804
|
for (var r = [], i = 0; i < o.length; i++) r.push(o[i].data[s]);
|
|
6851
|
-
n.push(
|
|
6805
|
+
n.push(yr(r));
|
|
6852
6806
|
}
|
|
6853
6807
|
var a = new Uint8ClampedArray(n);
|
|
6854
6808
|
return new ImageData(a, e, t);
|
|
6855
6809
|
}
|
|
6856
|
-
function
|
|
6810
|
+
function yr(o) {
|
|
6857
6811
|
if (o.length === 0) return 0;
|
|
6858
6812
|
for (var e = {}, t = 0, n = o; t < n.length; t++)
|
|
6859
6813
|
e[r = n[t]] = (e[r] || 0) + 1;
|
|
@@ -6861,7 +6815,7 @@ function br(o) {
|
|
|
6861
6815
|
for (var r in e) e[r] > e[s] && (s = parseInt(r, 10));
|
|
6862
6816
|
return s;
|
|
6863
6817
|
}
|
|
6864
|
-
function
|
|
6818
|
+
function Me() {
|
|
6865
6819
|
if (typeof navigator > "u") return { name: "unknown", version: "unknown" };
|
|
6866
6820
|
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++) {
|
|
6867
6821
|
var s = n[t], r = o.match(s);
|
|
@@ -6870,15 +6824,15 @@ function Te() {
|
|
|
6870
6824
|
return { name: "unknown", version: "unknown" };
|
|
6871
6825
|
}
|
|
6872
6826
|
J("audio", (function() {
|
|
6873
|
-
return
|
|
6874
|
-
return
|
|
6827
|
+
return Z(this, void 0, void 0, (function() {
|
|
6828
|
+
return Y(this, (function(o) {
|
|
6875
6829
|
return [2, new Promise((function(e, t) {
|
|
6876
6830
|
try {
|
|
6877
6831
|
var n = new (window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, 5e3, 44100), s = n.createBufferSource(), r = n.createOscillator();
|
|
6878
6832
|
r.frequency.value = 1e3;
|
|
6879
6833
|
var i, a = n.createDynamicsCompressor();
|
|
6880
6834
|
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) {
|
|
6881
|
-
i = c.renderedBuffer.getChannelData(0), e({ sampleHash:
|
|
6835
|
+
i = c.renderedBuffer.getChannelData(0), e({ sampleHash: mr(i), oscillator: r.type, maxChannels: n.destination.maxChannelCount, channelCountMode: s.channelCountMode });
|
|
6882
6836
|
}, n.startRendering();
|
|
6883
6837
|
} catch (c) {
|
|
6884
6838
|
console.error("Error creating audio fingerprint:", c), t(c);
|
|
@@ -6887,14 +6841,14 @@ J("audio", (function() {
|
|
|
6887
6841
|
}));
|
|
6888
6842
|
}));
|
|
6889
6843
|
}));
|
|
6890
|
-
var
|
|
6891
|
-
|
|
6844
|
+
var gr = Me().name !== "SamsungBrowser" ? 1 : 3, Ot = 280, Rt = 20;
|
|
6845
|
+
Me().name != "Firefox" && J("canvas", (function() {
|
|
6892
6846
|
return document.createElement("canvas").getContext("2d"), new Promise((function(o) {
|
|
6893
|
-
var e = Array.from({ length:
|
|
6847
|
+
var e = Array.from({ length: gr }, (function() {
|
|
6894
6848
|
return (function() {
|
|
6895
6849
|
var t = document.createElement("canvas"), n = t.getContext("2d");
|
|
6896
6850
|
if (!n) return new ImageData(1, 1);
|
|
6897
|
-
t.width =
|
|
6851
|
+
t.width = Ot, t.height = Rt;
|
|
6898
6852
|
var s = n.createLinearGradient(0, 0, t.width, t.height);
|
|
6899
6853
|
s.addColorStop(0, "red"), s.addColorStop(0.16666666666666666, "orange"), s.addColorStop(0.3333333333333333, "yellow"), s.addColorStop(0.5, "green"), s.addColorStop(0.6666666666666666, "blue"), s.addColorStop(0.8333333333333334, "indigo"), s.addColorStop(1, "violet"), n.fillStyle = s, n.fillRect(0, 0, t.width, t.height);
|
|
6900
6854
|
var r = "Random Text WMwmil10Oo";
|
|
@@ -6903,15 +6857,15 @@ Te().name != "Firefox" && J("canvas", (function() {
|
|
|
6903
6857
|
return i;
|
|
6904
6858
|
})();
|
|
6905
6859
|
}));
|
|
6906
|
-
o({ commonImageDataHash: at(
|
|
6860
|
+
o({ commonImageDataHash: at(Yt(e, Ot, Rt).data.toString()).toString() });
|
|
6907
6861
|
}));
|
|
6908
6862
|
}));
|
|
6909
|
-
var tt,
|
|
6910
|
-
function
|
|
6863
|
+
var tt, br = ["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"], wr = ["monospace", "sans-serif", "serif"];
|
|
6864
|
+
function qt(o, e) {
|
|
6911
6865
|
if (!o) throw new Error("Canvas context not supported");
|
|
6912
6866
|
return o.font, o.font = "72px ".concat(e), o.measureText("WwMmLli0Oo").width;
|
|
6913
6867
|
}
|
|
6914
|
-
function
|
|
6868
|
+
function kr() {
|
|
6915
6869
|
var o, e = document.createElement("canvas"), t = (o = e.getContext("webgl")) !== null && o !== void 0 ? o : e.getContext("experimental-webgl");
|
|
6916
6870
|
if (t && "getParameter" in t) try {
|
|
6917
6871
|
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() };
|
|
@@ -6927,11 +6881,11 @@ function Sr() {
|
|
|
6927
6881
|
}
|
|
6928
6882
|
return "undefined";
|
|
6929
6883
|
}
|
|
6930
|
-
function
|
|
6884
|
+
function _r() {
|
|
6931
6885
|
var o = new Float32Array(1), e = new Uint8Array(o.buffer);
|
|
6932
6886
|
return o[0] = 1 / 0, o[0] = o[0] - o[0], e[3];
|
|
6933
6887
|
}
|
|
6934
|
-
function
|
|
6888
|
+
function Sr(o, e) {
|
|
6935
6889
|
var t = {};
|
|
6936
6890
|
return e.forEach((function(n) {
|
|
6937
6891
|
var s = (function(r) {
|
|
@@ -6953,7 +6907,7 @@ function Ar(o, e) {
|
|
|
6953
6907
|
s && (t[n] = s);
|
|
6954
6908
|
})), t;
|
|
6955
6909
|
}
|
|
6956
|
-
function
|
|
6910
|
+
function $r() {
|
|
6957
6911
|
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"] };
|
|
6958
6912
|
return Object.keys(e).forEach((function(t) {
|
|
6959
6913
|
e[t].forEach((function(n) {
|
|
@@ -6961,7 +6915,7 @@ function vr() {
|
|
|
6961
6915
|
}));
|
|
6962
6916
|
})), o;
|
|
6963
6917
|
}
|
|
6964
|
-
function
|
|
6918
|
+
function Ar() {
|
|
6965
6919
|
if (window.location.protocol === "https:" && typeof window.ApplePaySession == "function") try {
|
|
6966
6920
|
for (var o = window.ApplePaySession.supportsVersion, e = 15; e > 0; e--) if (o(e)) return e;
|
|
6967
6921
|
} catch {
|
|
@@ -6969,15 +6923,15 @@ function xr() {
|
|
|
6969
6923
|
}
|
|
6970
6924
|
return 0;
|
|
6971
6925
|
}
|
|
6972
|
-
|
|
6926
|
+
Me().name != "Firefox" && J("fonts", (function() {
|
|
6973
6927
|
var o = this;
|
|
6974
6928
|
return new Promise((function(e, t) {
|
|
6975
6929
|
try {
|
|
6976
6930
|
(function(n) {
|
|
6977
6931
|
var s;
|
|
6978
|
-
|
|
6932
|
+
Z(this, void 0, void 0, (function() {
|
|
6979
6933
|
var r, i, a;
|
|
6980
|
-
return
|
|
6934
|
+
return Y(this, (function(c) {
|
|
6981
6935
|
switch (c.label) {
|
|
6982
6936
|
case 0:
|
|
6983
6937
|
return document.body ? [3, 2] : [4, (u = 50, new Promise((function(h) {
|
|
@@ -6996,13 +6950,13 @@ Te().name != "Firefox" && J("fonts", (function() {
|
|
|
6996
6950
|
}));
|
|
6997
6951
|
})((function(n) {
|
|
6998
6952
|
var s = n.iframe;
|
|
6999
|
-
return
|
|
6953
|
+
return Z(o, void 0, void 0, (function() {
|
|
7000
6954
|
var r, i, a, c;
|
|
7001
|
-
return
|
|
7002
|
-
return r = s.createElement("canvas"), i = r.getContext("2d"), a =
|
|
7003
|
-
return
|
|
7004
|
-
})), c = {},
|
|
7005
|
-
var h =
|
|
6955
|
+
return Y(this, (function(u) {
|
|
6956
|
+
return r = s.createElement("canvas"), i = r.getContext("2d"), a = wr.map((function(l) {
|
|
6957
|
+
return qt(i, l);
|
|
6958
|
+
})), c = {}, br.forEach((function(l) {
|
|
6959
|
+
var h = qt(i, l);
|
|
7006
6960
|
a.includes(h) || (c[l] = h);
|
|
7007
6961
|
})), e(c), [2];
|
|
7008
6962
|
}));
|
|
@@ -7015,21 +6969,21 @@ Te().name != "Firefox" && J("fonts", (function() {
|
|
|
7015
6969
|
})), J("hardware", (function() {
|
|
7016
6970
|
return new Promise((function(o, e) {
|
|
7017
6971
|
var t = navigator.deviceMemory !== void 0 ? navigator.deviceMemory : 0, n = window.performance && window.performance.memory ? window.performance.memory : 0;
|
|
7018
|
-
o({ videocard:
|
|
6972
|
+
o({ videocard: kr(), architecture: _r(), deviceMemory: t.toString() || "undefined", jsHeapSizeLimit: n.jsHeapSizeLimit || 0 });
|
|
7019
6973
|
}));
|
|
7020
6974
|
})), J("locales", (function() {
|
|
7021
6975
|
return new Promise((function(o) {
|
|
7022
6976
|
o({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
|
|
7023
6977
|
}));
|
|
7024
6978
|
})), J("permissions", (function() {
|
|
7025
|
-
return
|
|
6979
|
+
return Z(this, void 0, void 0, (function() {
|
|
7026
6980
|
var o;
|
|
7027
|
-
return
|
|
6981
|
+
return Y(this, (function(e) {
|
|
7028
6982
|
return tt = (q == null ? void 0 : 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 == null ? void 0 : q.retries) || 3 }, (function() {
|
|
7029
6983
|
return (function() {
|
|
7030
|
-
return
|
|
6984
|
+
return Z(this, void 0, void 0, (function() {
|
|
7031
6985
|
var t, n, s, r, i;
|
|
7032
|
-
return
|
|
6986
|
+
return Y(this, (function(a) {
|
|
7033
6987
|
switch (a.label) {
|
|
7034
6988
|
case 0:
|
|
7035
6989
|
t = {}, n = 0, s = tt, a.label = 1;
|
|
@@ -7051,7 +7005,7 @@ Te().name != "Firefox" && J("fonts", (function() {
|
|
|
7051
7005
|
}));
|
|
7052
7006
|
})();
|
|
7053
7007
|
})), [2, Promise.all(o).then((function(t) {
|
|
7054
|
-
return
|
|
7008
|
+
return Sr(t, tt);
|
|
7055
7009
|
}))];
|
|
7056
7010
|
}));
|
|
7057
7011
|
}));
|
|
@@ -7066,23 +7020,23 @@ Te().name != "Firefox" && J("fonts", (function() {
|
|
|
7066
7020
|
}));
|
|
7067
7021
|
})), J("screen", (function() {
|
|
7068
7022
|
return new Promise((function(o) {
|
|
7069
|
-
o({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches:
|
|
7023
|
+
o({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: $r() });
|
|
7070
7024
|
}));
|
|
7071
7025
|
})), J("system", (function() {
|
|
7072
7026
|
return new Promise((function(o) {
|
|
7073
|
-
var e =
|
|
7074
|
-
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:
|
|
7027
|
+
var e = Me();
|
|
7028
|
+
o({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: e.name, version: e.version }, applePayVersion: Ar() });
|
|
7075
7029
|
}));
|
|
7076
7030
|
}));
|
|
7077
|
-
var
|
|
7031
|
+
var K, vr = Me().name !== "SamsungBrowser" ? 1 : 3, y = null;
|
|
7078
7032
|
J("webgl", (function() {
|
|
7079
|
-
return
|
|
7033
|
+
return Z(this, void 0, void 0, (function() {
|
|
7080
7034
|
var o;
|
|
7081
|
-
return
|
|
7082
|
-
typeof document < "u" && ((
|
|
7035
|
+
return Y(this, (function(e) {
|
|
7036
|
+
typeof document < "u" && ((K = document.createElement("canvas")).width = 200, K.height = 100, y = K.getContext("webgl"));
|
|
7083
7037
|
try {
|
|
7084
7038
|
if (!y) throw new Error("WebGL not supported");
|
|
7085
|
-
return o = Array.from({ length:
|
|
7039
|
+
return o = Array.from({ length: vr }, (function() {
|
|
7086
7040
|
return (function() {
|
|
7087
7041
|
try {
|
|
7088
7042
|
if (!y) throw new Error("WebGL not supported");
|
|
@@ -7106,21 +7060,21 @@ J("webgl", (function() {
|
|
|
7106
7060
|
y.useProgram(i);
|
|
7107
7061
|
for (var a = 137, c = new Float32Array(4 * a), u = 2 * Math.PI / a, l = 0; l < a; l++) {
|
|
7108
7062
|
var h = l * u;
|
|
7109
|
-
c[4 * l] = 0, c[4 * l + 1] = 0, c[4 * l + 2] = Math.cos(h) * (
|
|
7063
|
+
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);
|
|
7110
7064
|
}
|
|
7111
7065
|
var p = y.createBuffer();
|
|
7112
7066
|
y.bindBuffer(y.ARRAY_BUFFER, p), y.bufferData(y.ARRAY_BUFFER, c, y.STATIC_DRAW);
|
|
7113
7067
|
var d = y.getAttribLocation(i, "position");
|
|
7114
|
-
y.enableVertexAttribArray(d), y.vertexAttribPointer(d, 2, y.FLOAT, !1, 0, 0), y.viewport(0, 0,
|
|
7115
|
-
var b = new Uint8ClampedArray(
|
|
7116
|
-
return y.readPixels(0, 0,
|
|
7068
|
+
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);
|
|
7069
|
+
var b = new Uint8ClampedArray(K.width * K.height * 4);
|
|
7070
|
+
return y.readPixels(0, 0, K.width, K.height, y.RGBA, y.UNSIGNED_BYTE, b), new ImageData(b, K.width, K.height);
|
|
7117
7071
|
} catch {
|
|
7118
7072
|
return new ImageData(1, 1);
|
|
7119
7073
|
} finally {
|
|
7120
7074
|
y && (y.bindBuffer(y.ARRAY_BUFFER, null), y.useProgram(null), y.viewport(0, 0, y.drawingBufferWidth, y.drawingBufferHeight), y.clearColor(0, 0, 0, 0));
|
|
7121
7075
|
}
|
|
7122
7076
|
})();
|
|
7123
|
-
})), [2, { commonImageHash: at(
|
|
7077
|
+
})), [2, { commonImageHash: at(Yt(o, K.width, K.height).data.toString()).toString() }];
|
|
7124
7078
|
} catch {
|
|
7125
7079
|
return [2, { webgl: "unsupported" }];
|
|
7126
7080
|
}
|
|
@@ -7134,34 +7088,43 @@ var ie = function(o, e, t, n) {
|
|
|
7134
7088
|
return r * s;
|
|
7135
7089
|
};
|
|
7136
7090
|
J("math", (function() {
|
|
7137
|
-
return
|
|
7138
|
-
return
|
|
7091
|
+
return Z(void 0, void 0, void 0, (function() {
|
|
7092
|
+
return Y(this, (function(o) {
|
|
7139
7093
|
return [2, { acos: Math.acos(0.5), asin: ie(Math.asin, -1, 1, 97), atan: ie(Math.atan, -1, 1, 97), cos: ie(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: ie(Math.sin, -Math.PI, Math.PI, 97), sinh: ie(Math.sinh, -9 / 7, 7 / 9, 97), sqrt: Math.sqrt(2), tan: ie(Math.tan, 0, 2 * Math.PI, 97), tanh: ie(Math.tanh, -9 / 7, 7 / 9, 97) }];
|
|
7140
7094
|
}));
|
|
7141
7095
|
}));
|
|
7142
7096
|
}));
|
|
7143
|
-
|
|
7097
|
+
const xr = "query ( $Hash: String! ) { CipherHash ( Hash: $Hash ) { hash } }";
|
|
7098
|
+
function Ir(o) {
|
|
7099
|
+
const e = (o || "").match(/\b(query|mutation|subscription)\b/i), t = e ? e[1].toLowerCase() : "query", n = (o || "").indexOf("{"), s = n >= 0 ? o.slice(n + 1).match(/[A-Za-z_][A-Za-z0-9_]*/) : null;
|
|
7100
|
+
return { type: t, name: s ? s[0] : "" };
|
|
7101
|
+
}
|
|
7102
|
+
class Mr {
|
|
7144
7103
|
constructor({ serverUri: e, socket: t = null, encrypt: n = !1 }) {
|
|
7145
7104
|
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();
|
|
7146
7105
|
}
|
|
7147
7106
|
createUrqlClient({ serverUri: e, socket: t, encrypt: n }) {
|
|
7148
|
-
const s = [
|
|
7107
|
+
const s = [sn, rn];
|
|
7149
7108
|
if (t && t.socketUri) {
|
|
7150
|
-
const r =
|
|
7109
|
+
const r = ln({
|
|
7151
7110
|
url: t.socketUri,
|
|
7152
7111
|
connectionParams: () => ({
|
|
7153
7112
|
authToken: this.$__authToken
|
|
7154
7113
|
})
|
|
7155
7114
|
});
|
|
7156
|
-
s.push(
|
|
7115
|
+
s.push(on({
|
|
7157
7116
|
forwardSubscription: (i) => ({
|
|
7158
7117
|
subscribe: (a) => ({ unsubscribe: r.subscribe(i, a) })
|
|
7159
7118
|
})
|
|
7160
7119
|
}));
|
|
7161
7120
|
}
|
|
7162
|
-
return
|
|
7121
|
+
return an({
|
|
7163
7122
|
url: e,
|
|
7164
7123
|
exchanges: s,
|
|
7124
|
+
// PQ-transport Phase E: when encryption is on, route fetch through the CipherHash
|
|
7125
|
+
// wrapper (encrypt the request body to the validator's ML-KEM pubkey, decrypt the
|
|
7126
|
+
// response). Undefined → urql uses the global fetch (plaintext).
|
|
7127
|
+
...n ? { fetch: (r, i) => this.cipherFetch(r, i) } : {},
|
|
7165
7128
|
fetchOptions: () => ({
|
|
7166
7129
|
headers: {
|
|
7167
7130
|
"X-Auth-Token": this.$__authToken
|
|
@@ -7171,6 +7134,50 @@ class Tr {
|
|
|
7171
7134
|
})
|
|
7172
7135
|
});
|
|
7173
7136
|
}
|
|
7137
|
+
/**
|
|
7138
|
+
* Whether an outgoing GraphQL request body should be wrapped in CipherHash. Bypass (plaintext):
|
|
7139
|
+
* introspection `__schema`, `ContinuId`, the `AccessToken` mutation, and the U-isotope
|
|
7140
|
+
* `ProposeMolecule` (auth bootstrap — the key exchange itself can't be encrypted). Mirrors the
|
|
7141
|
+
* Kotlin/validator bypass set.
|
|
7142
|
+
*/
|
|
7143
|
+
shouldEncrypt(e) {
|
|
7144
|
+
let t;
|
|
7145
|
+
try {
|
|
7146
|
+
t = JSON.parse(e);
|
|
7147
|
+
} catch {
|
|
7148
|
+
return !1;
|
|
7149
|
+
}
|
|
7150
|
+
const { type: n, name: s } = Ir(t.query);
|
|
7151
|
+
return !(n === "query" && (s === "__schema" || s === "ContinuId") || n === "mutation" && s === "AccessToken" || n === "mutation" && s === "ProposeMolecule" && (t.variables && t.variables.molecule && t.variables.molecule.atoms && t.variables.molecule.atoms[0] && t.variables.molecule.atoms[0].isotope) === "U");
|
|
7152
|
+
}
|
|
7153
|
+
/**
|
|
7154
|
+
* Custom `fetch` that wraps a GraphQL request in the ML-KEM CipherHash envelope and decrypts the
|
|
7155
|
+
* response (PQ-transport Phase E). Operates on the raw POST body (mirrors Kotlin's
|
|
7156
|
+
* encryptBody/decryptBody). Reads the CURRENT client wallet + validator pubkey from auth.
|
|
7157
|
+
*/
|
|
7158
|
+
async cipherFetch(e, t) {
|
|
7159
|
+
const n = this.getWallet(), s = this.getPubKey();
|
|
7160
|
+
let r = !1, i = t;
|
|
7161
|
+
if (n && s && t && typeof t.body == "string" && this.shouldEncrypt(t.body)) {
|
|
7162
|
+
const d = await n.encryptStringML768(t.body, s);
|
|
7163
|
+
i = { ...t, body: JSON.stringify({ query: xr, variables: { Hash: d } }) }, r = !0;
|
|
7164
|
+
}
|
|
7165
|
+
const a = await fetch(e, i);
|
|
7166
|
+
if (!r)
|
|
7167
|
+
return a;
|
|
7168
|
+
const c = await a.text(), u = { status: a.status, statusText: a.statusText, headers: a.headers };
|
|
7169
|
+
let l;
|
|
7170
|
+
try {
|
|
7171
|
+
l = JSON.parse(c);
|
|
7172
|
+
} catch {
|
|
7173
|
+
return new Response(c, u);
|
|
7174
|
+
}
|
|
7175
|
+
const h = l && l.data && l.data.CipherHash && l.data.CipherHash.hash;
|
|
7176
|
+
if (typeof h != "string")
|
|
7177
|
+
return new Response(c, u);
|
|
7178
|
+
const p = await n.decryptMyMessageML768(JSON.parse(h));
|
|
7179
|
+
return new Response(p ?? c, u);
|
|
7180
|
+
}
|
|
7174
7181
|
setAuthData({ token: e, pubkey: t, wallet: n }) {
|
|
7175
7182
|
this.$__authToken = e, this.$__pubkey = t, this.$__wallet = n, this.$__client = this.createUrqlClient({
|
|
7176
7183
|
serverUri: this.serverUri,
|
|
@@ -7178,21 +7185,51 @@ class Tr {
|
|
|
7178
7185
|
encrypt: !!this.cipherLink
|
|
7179
7186
|
});
|
|
7180
7187
|
}
|
|
7188
|
+
/**
|
|
7189
|
+
* Builds the urql operation options forwarded with a query/mutation.
|
|
7190
|
+
*
|
|
7191
|
+
* Forwards the requestPolicy (so a long-lived client does not serve stale
|
|
7192
|
+
* cache-first reads) and, when the caller supplied a per-query abort signal,
|
|
7193
|
+
* the signal too — while re-supplying the X-Auth-Token header. urql REPLACES
|
|
7194
|
+
* (not merges) the client-level fetchOptions with any operation-context
|
|
7195
|
+
* fetchOptions (createRequestOperation builds the op context as
|
|
7196
|
+
* {...baseOpts, ...opts}), so forwarding fetchOptions WITHOUT the header would
|
|
7197
|
+
* drop X-Auth-Token and break auth. The header here is byte-identical to the
|
|
7198
|
+
* client-level one set in createUrqlClient.
|
|
7199
|
+
*
|
|
7200
|
+
* @param {object} context
|
|
7201
|
+
* @returns {object|undefined}
|
|
7202
|
+
*/
|
|
7203
|
+
buildRequestOptions(e) {
|
|
7204
|
+
if (!e)
|
|
7205
|
+
return;
|
|
7206
|
+
const t = {};
|
|
7207
|
+
e.requestPolicy && (t.requestPolicy = e.requestPolicy);
|
|
7208
|
+
const n = e.fetchOptions && e.fetchOptions.signal;
|
|
7209
|
+
if (n) {
|
|
7210
|
+
const s = typeof AbortSignal < "u" && typeof AbortSignal.any == "function" ? AbortSignal.any([n, AbortSignal.timeout(6e4)]) : n;
|
|
7211
|
+
t.fetchOptions = {
|
|
7212
|
+
headers: { "X-Auth-Token": this.$__authToken },
|
|
7213
|
+
signal: s
|
|
7214
|
+
};
|
|
7215
|
+
}
|
|
7216
|
+
return Object.keys(t).length ? t : void 0;
|
|
7217
|
+
}
|
|
7181
7218
|
async query(e) {
|
|
7182
|
-
const { query: t, variables: n, context: s } = e, r =
|
|
7219
|
+
const { query: t, variables: n, context: s } = e, r = this.buildRequestOptions(s), i = await this.$__client.query(t, n || {}, r).toPromise();
|
|
7183
7220
|
return this.formatResponse(i);
|
|
7184
7221
|
}
|
|
7185
7222
|
async mutate(e) {
|
|
7186
|
-
const { mutation: t, variables: n, context: s } = e, r =
|
|
7223
|
+
const { mutation: t, variables: n, context: s } = e, r = this.buildRequestOptions(s), i = await this.$__client.mutation(t, n || {}, r).toPromise();
|
|
7187
7224
|
return this.formatResponse(i);
|
|
7188
7225
|
}
|
|
7189
7226
|
subscribe(e, t) {
|
|
7190
|
-
const { query: n, variables: s, operationName: r } = e, i =
|
|
7227
|
+
const { query: n, variables: s, operationName: r } = e, i = cn(
|
|
7191
7228
|
this.$__client.subscription(n, s),
|
|
7192
|
-
|
|
7229
|
+
un((a) => {
|
|
7193
7230
|
t(this.formatResponse(a));
|
|
7194
7231
|
}),
|
|
7195
|
-
|
|
7232
|
+
hn(() => {
|
|
7196
7233
|
})
|
|
7197
7234
|
);
|
|
7198
7235
|
return this.$__subscriptionManager.set(r, i), {
|
|
@@ -7260,7 +7297,7 @@ class Tr {
|
|
|
7260
7297
|
});
|
|
7261
7298
|
}
|
|
7262
7299
|
}
|
|
7263
|
-
class
|
|
7300
|
+
class Ur {
|
|
7264
7301
|
/**
|
|
7265
7302
|
* Class constructor
|
|
7266
7303
|
*
|
|
@@ -7314,7 +7351,7 @@ class Wr {
|
|
|
7314
7351
|
const u = this.$__uris[c];
|
|
7315
7352
|
this.$__authTokenObjects[u] = null;
|
|
7316
7353
|
}
|
|
7317
|
-
this.log("info", `KnishIOClient::initialize() - Initializing new Knish.IO client session for SDK version ${r}...`), this.$__client = s || new
|
|
7354
|
+
this.log("info", `KnishIOClient::initialize() - Initializing new Knish.IO client session for SDK version ${r}...`), this.$__client = s || new Mr({
|
|
7318
7355
|
socket: {
|
|
7319
7356
|
socketUri: null,
|
|
7320
7357
|
appKey: "knishio",
|
|
@@ -7477,7 +7514,7 @@ class Wr {
|
|
|
7477
7514
|
* @returns {string}
|
|
7478
7515
|
*/
|
|
7479
7516
|
hashSecret(e, t = null) {
|
|
7480
|
-
return this.log("info", `KnishIOClient::hashSecret(${t ? `source: ${t}` : ""}) - Computing wallet bundle from secret...`),
|
|
7517
|
+
return this.log("info", `KnishIOClient::hashSecret(${t ? `source: ${t}` : ""}) - Computing wallet bundle from secret...`), pe(e);
|
|
7481
7518
|
}
|
|
7482
7519
|
/**
|
|
7483
7520
|
* Retrieves the stored secret for this session
|
|
@@ -7513,10 +7550,10 @@ class Wr {
|
|
|
7513
7550
|
* @returns {Promise<string>} A promise that resolves to the device fingerprint as a string.
|
|
7514
7551
|
*/
|
|
7515
7552
|
getFingerprint() {
|
|
7516
|
-
return
|
|
7553
|
+
return fr();
|
|
7517
7554
|
}
|
|
7518
7555
|
getFingerprintData() {
|
|
7519
|
-
return
|
|
7556
|
+
return Xt();
|
|
7520
7557
|
}
|
|
7521
7558
|
/**
|
|
7522
7559
|
* Retrieves this session's wallet used for signing the next Molecule
|
|
@@ -7678,7 +7715,7 @@ class Wr {
|
|
|
7678
7715
|
bundle: t = null,
|
|
7679
7716
|
type: n = "regular"
|
|
7680
7717
|
}) {
|
|
7681
|
-
const s = this.createQuery(
|
|
7718
|
+
const s = this.createQuery(gs);
|
|
7682
7719
|
return this.executeQuery(s, {
|
|
7683
7720
|
bundleHash: t || this.getBundle(),
|
|
7684
7721
|
token: e,
|
|
@@ -7701,10 +7738,10 @@ class Wr {
|
|
|
7701
7738
|
token: e,
|
|
7702
7739
|
type: n
|
|
7703
7740
|
})).payload();
|
|
7704
|
-
if (s === null ||
|
|
7705
|
-
throw new
|
|
7741
|
+
if (s === null || ce.cmp(s.balance, t) < 0)
|
|
7742
|
+
throw new G();
|
|
7706
7743
|
if (!s.position || !s.address)
|
|
7707
|
-
throw new
|
|
7744
|
+
throw new G("Source wallet can not be a shadow wallet.");
|
|
7708
7745
|
return s;
|
|
7709
7746
|
}
|
|
7710
7747
|
/**
|
|
@@ -7836,7 +7873,7 @@ class Wr {
|
|
|
7836
7873
|
}) {
|
|
7837
7874
|
this.log("info", `KnishIOClient::queryMeta() - Querying metaType: ${e}, metaId: ${t}...`);
|
|
7838
7875
|
let f, m;
|
|
7839
|
-
return p ? (f = this.createQuery(
|
|
7876
|
+
return p ? (f = this.createQuery(Ct), m = Ct.createVariables({
|
|
7840
7877
|
metaType: e,
|
|
7841
7878
|
metaId: t,
|
|
7842
7879
|
key: n,
|
|
@@ -7932,7 +7969,7 @@ class Wr {
|
|
|
7932
7969
|
}) {
|
|
7933
7970
|
if (this.log("info", `KnishIOClient::queryEmbeddingStatus() - Checking embedding status for metaType: ${e || "(bulk)"}...`), !await this.hasQueryField("embeddingStatus"))
|
|
7934
7971
|
return this.log("warn", "KnishIOClient::queryEmbeddingStatus() - Server does not support embeddingStatus query. Returning null."), null;
|
|
7935
|
-
const r = this.createQuery(
|
|
7972
|
+
const r = this.createQuery(Et), i = Et.createVariables({ metaType: e, metaId: t, instances: n });
|
|
7936
7973
|
return this.executeQuery(r, i);
|
|
7937
7974
|
}
|
|
7938
7975
|
/**
|
|
@@ -7960,7 +7997,7 @@ class Wr {
|
|
|
7960
7997
|
batchId: e
|
|
7961
7998
|
}) {
|
|
7962
7999
|
this.log("info", `KnishIOClient::queryBatchHistory() - Querying cascading meta instances for batchId: ${e}...`);
|
|
7963
|
-
const t = this.createQuery(
|
|
8000
|
+
const t = this.createQuery(ws);
|
|
7964
8001
|
return await this.executeQuery(t, {
|
|
7965
8002
|
batchId: e
|
|
7966
8003
|
});
|
|
@@ -8020,7 +8057,7 @@ class Wr {
|
|
|
8020
8057
|
values: f,
|
|
8021
8058
|
value: m,
|
|
8022
8059
|
metaTypes: w,
|
|
8023
|
-
metaType:
|
|
8060
|
+
metaType: T,
|
|
8024
8061
|
metaIds: k,
|
|
8025
8062
|
metaId: $,
|
|
8026
8063
|
indexes: v,
|
|
@@ -8033,8 +8070,8 @@ class Wr {
|
|
|
8033
8070
|
}
|
|
8034
8071
|
}) {
|
|
8035
8072
|
this.log("info", "KnishIOClient::queryAtom() - Querying atom instances");
|
|
8036
|
-
const
|
|
8037
|
-
return await this.executeQuery(
|
|
8073
|
+
const ue = this.createQuery(Mt);
|
|
8074
|
+
return await this.executeQuery(ue, Mt.createVariables({
|
|
8038
8075
|
molecularHashes: e,
|
|
8039
8076
|
molecularHash: t,
|
|
8040
8077
|
bundleHashes: n,
|
|
@@ -8054,7 +8091,7 @@ class Wr {
|
|
|
8054
8091
|
values: f,
|
|
8055
8092
|
value: m,
|
|
8056
8093
|
metaTypes: w,
|
|
8057
|
-
metaType:
|
|
8094
|
+
metaType: T,
|
|
8058
8095
|
metaIds: k,
|
|
8059
8096
|
metaId: $,
|
|
8060
8097
|
indexes: v,
|
|
@@ -8101,48 +8138,6 @@ class Wr {
|
|
|
8101
8138
|
metaId: n
|
|
8102
8139
|
});
|
|
8103
8140
|
}
|
|
8104
|
-
/**
|
|
8105
|
-
* Queries user activity based on the provided parameters.
|
|
8106
|
-
*
|
|
8107
|
-
* @param {string} bundleHash - The bundle hash.
|
|
8108
|
-
* @param {string} metaType - The meta type.
|
|
8109
|
-
* @param {string} metaId - The meta ID.
|
|
8110
|
-
* @param {string} ipAddress - The IP address.
|
|
8111
|
-
* @param {string} browser - The browser.
|
|
8112
|
-
* @param {string} osCpu - The operating system and CPU.
|
|
8113
|
-
* @param {string} resolution - The screen resolution.
|
|
8114
|
-
* @param {string} timeZone - The time zone.
|
|
8115
|
-
* @param {string} countBy - The count by parameter.
|
|
8116
|
-
* @param {string} interval - The interval parameter.
|
|
8117
|
-
*
|
|
8118
|
-
* @returns {Promise<ResponseQueryUserActivity>} The result of the query.
|
|
8119
|
-
*/
|
|
8120
|
-
async queryUserActivity({
|
|
8121
|
-
bundleHash: e,
|
|
8122
|
-
metaType: t,
|
|
8123
|
-
metaId: n,
|
|
8124
|
-
ipAddress: s,
|
|
8125
|
-
browser: r,
|
|
8126
|
-
osCpu: i,
|
|
8127
|
-
resolution: a,
|
|
8128
|
-
timeZone: c,
|
|
8129
|
-
countBy: u,
|
|
8130
|
-
interval: l
|
|
8131
|
-
}) {
|
|
8132
|
-
const h = this.createQuery(Ys);
|
|
8133
|
-
return await this.executeQuery(h, {
|
|
8134
|
-
bundleHash: e,
|
|
8135
|
-
metaType: t,
|
|
8136
|
-
metaId: n,
|
|
8137
|
-
ipAddress: s,
|
|
8138
|
-
browser: r,
|
|
8139
|
-
osCpu: i,
|
|
8140
|
-
resolution: a,
|
|
8141
|
-
timeZone: c,
|
|
8142
|
-
countBy: u,
|
|
8143
|
-
interval: l
|
|
8144
|
-
});
|
|
8145
|
-
}
|
|
8146
8141
|
/**
|
|
8147
8142
|
* Builds and executes a molecule to declare an active session for the given MetaType
|
|
8148
8143
|
*
|
|
@@ -8204,12 +8199,12 @@ class Wr {
|
|
|
8204
8199
|
batchId: s = null,
|
|
8205
8200
|
units: r = []
|
|
8206
8201
|
}) {
|
|
8207
|
-
const i =
|
|
8208
|
-
if (i === "stackable" && (n.batchId = s ||
|
|
8209
|
-
if (
|
|
8202
|
+
const i = M.get(n || {}, "fungibility");
|
|
8203
|
+
if (i === "stackable" && (n.batchId = s || He({})), ["nonfungible", "stackable"].includes(i) && r.length > 0) {
|
|
8204
|
+
if (M.get(n || {}, "decimals") > 0)
|
|
8210
8205
|
throw new Ls();
|
|
8211
8206
|
if (t > 0)
|
|
8212
|
-
throw new
|
|
8207
|
+
throw new _e();
|
|
8213
8208
|
t = r.length, n.splittable = 1, n.decimals = 0, n.tokenUnits = JSON.stringify(r);
|
|
8214
8209
|
}
|
|
8215
8210
|
const a = new S({
|
|
@@ -8218,7 +8213,7 @@ class Wr {
|
|
|
8218
8213
|
token: e,
|
|
8219
8214
|
batchId: s
|
|
8220
8215
|
}), c = await this.createMoleculeMutation({
|
|
8221
|
-
mutationClass:
|
|
8216
|
+
mutationClass: $s
|
|
8222
8217
|
});
|
|
8223
8218
|
return c.fillMolecule({
|
|
8224
8219
|
recipientWallet: a,
|
|
@@ -8243,7 +8238,7 @@ class Wr {
|
|
|
8243
8238
|
}) {
|
|
8244
8239
|
const r = await this.createMoleculeMutation(
|
|
8245
8240
|
{
|
|
8246
|
-
mutationClass:
|
|
8241
|
+
mutationClass: ir,
|
|
8247
8242
|
molecule: await this.createMolecule({
|
|
8248
8243
|
secret: this.getSecret()
|
|
8249
8244
|
})
|
|
@@ -8347,7 +8342,7 @@ class Wr {
|
|
|
8347
8342
|
code: n
|
|
8348
8343
|
}) {
|
|
8349
8344
|
const s = await this.createMoleculeMutation({
|
|
8350
|
-
mutationClass:
|
|
8345
|
+
mutationClass: Ms
|
|
8351
8346
|
});
|
|
8352
8347
|
return s.fillMolecule({
|
|
8353
8348
|
type: e,
|
|
@@ -8413,7 +8408,7 @@ class Wr {
|
|
|
8413
8408
|
metaType: e,
|
|
8414
8409
|
metaId: t
|
|
8415
8410
|
}) {
|
|
8416
|
-
const n = this.createQuery(
|
|
8411
|
+
const n = this.createQuery(tr);
|
|
8417
8412
|
return await this.executeQuery(n, {
|
|
8418
8413
|
metaType: e,
|
|
8419
8414
|
metaId: t
|
|
@@ -8435,7 +8430,7 @@ class Wr {
|
|
|
8435
8430
|
unspent: n = !0
|
|
8436
8431
|
}) {
|
|
8437
8432
|
this.log("info", `KnishIOClient::queryWallets() - Querying wallets${e ? ` for ${e}` : ""}...`);
|
|
8438
|
-
const s = this.createQuery(
|
|
8433
|
+
const s = this.createQuery(ms);
|
|
8439
8434
|
return this.executeQuery(s, {
|
|
8440
8435
|
bundleHash: e || this.getBundle(),
|
|
8441
8436
|
token: t,
|
|
@@ -8457,7 +8452,7 @@ class Wr {
|
|
|
8457
8452
|
raw: n = !1
|
|
8458
8453
|
}) {
|
|
8459
8454
|
this.log("info", `KnishIOClient::queryBundle() - Querying wallet bundle metadata${e ? ` for ${e}` : ""}...`), e || (e = this.getBundle()), typeof e == "string" && (e = [e]);
|
|
8460
|
-
const s = this.createQuery(
|
|
8455
|
+
const s = this.createQuery(fs);
|
|
8461
8456
|
return this.executeQuery(s, { bundleHashes: e }).then((r) => n ? r : r.payload());
|
|
8462
8457
|
}
|
|
8463
8458
|
/**
|
|
@@ -8469,7 +8464,7 @@ class Wr {
|
|
|
8469
8464
|
async queryContinuId({
|
|
8470
8465
|
bundle: e
|
|
8471
8466
|
}) {
|
|
8472
|
-
const t = this.createQuery(
|
|
8467
|
+
const t = this.createQuery(ds);
|
|
8473
8468
|
return this.executeQuery(t, {
|
|
8474
8469
|
bundle: e
|
|
8475
8470
|
});
|
|
@@ -8501,14 +8496,14 @@ class Wr {
|
|
|
8501
8496
|
}) {
|
|
8502
8497
|
let a, c;
|
|
8503
8498
|
r = r || {};
|
|
8504
|
-
const u = this.createQuery(
|
|
8499
|
+
const u = this.createQuery(Zs), l = await this.executeQuery(u, {
|
|
8505
8500
|
slug: e
|
|
8506
|
-
}), h =
|
|
8501
|
+
}), h = M.get(l.data(), "0.fungibility") === "stackable";
|
|
8507
8502
|
if (!h && i !== null)
|
|
8508
|
-
throw new
|
|
8509
|
-
if (h && i === null && (i =
|
|
8503
|
+
throw new Ue("Expected Batch ID = null for non-stackable tokens.");
|
|
8504
|
+
if (h && i === null && (i = He({})), s.length > 0) {
|
|
8510
8505
|
if (n > 0)
|
|
8511
|
-
throw new
|
|
8506
|
+
throw new _e();
|
|
8512
8507
|
n = s.length, r.tokenUnits = JSON.stringify(s);
|
|
8513
8508
|
}
|
|
8514
8509
|
t ? (Object.prototype.toString.call(t) === "[object String]" && (S.isBundleHash(t) ? (a = "walletBundle", c = t) : t = S.create({
|
|
@@ -8516,7 +8511,7 @@ class Wr {
|
|
|
8516
8511
|
token: e
|
|
8517
8512
|
})), t instanceof S && (a = "wallet", r.position = t.position, r.bundle = t.bundle, c = t.address)) : (a = "walletBundle", c = this.getBundle());
|
|
8518
8513
|
const p = await this.createMoleculeMutation({
|
|
8519
|
-
mutationClass:
|
|
8514
|
+
mutationClass: vs
|
|
8520
8515
|
});
|
|
8521
8516
|
return p.fillMolecule({
|
|
8522
8517
|
token: e,
|
|
@@ -8563,10 +8558,10 @@ class Wr {
|
|
|
8563
8558
|
}) {
|
|
8564
8559
|
const t = await this.queryWallets({ token: e });
|
|
8565
8560
|
if (!t || !Array.isArray(t))
|
|
8566
|
-
throw new
|
|
8561
|
+
throw new xt();
|
|
8567
8562
|
t.forEach((s) => {
|
|
8568
8563
|
if (!s.isShadow())
|
|
8569
|
-
throw new
|
|
8564
|
+
throw new xt();
|
|
8570
8565
|
});
|
|
8571
8566
|
const n = [];
|
|
8572
8567
|
for (const s of t)
|
|
@@ -8602,14 +8597,14 @@ class Wr {
|
|
|
8602
8597
|
}) {
|
|
8603
8598
|
if (s.length > 0) {
|
|
8604
8599
|
if (n > 0)
|
|
8605
|
-
throw new
|
|
8600
|
+
throw new _e();
|
|
8606
8601
|
n = s.length;
|
|
8607
8602
|
}
|
|
8608
8603
|
if (i === null && (i = await this.querySourceWallet({
|
|
8609
8604
|
token: t,
|
|
8610
8605
|
amount: n
|
|
8611
|
-
})), i === null ||
|
|
8612
|
-
throw new
|
|
8606
|
+
})), i === null || ce.cmp(i.balance, n) < 0)
|
|
8607
|
+
throw new G();
|
|
8613
8608
|
const a = S.create({
|
|
8614
8609
|
bundle: e,
|
|
8615
8610
|
token: t
|
|
@@ -8627,7 +8622,7 @@ class Wr {
|
|
|
8627
8622
|
sourceWallet: i,
|
|
8628
8623
|
remainderWallet: c
|
|
8629
8624
|
}), l = await this.createMoleculeMutation({
|
|
8630
|
-
mutationClass:
|
|
8625
|
+
mutationClass: vt,
|
|
8631
8626
|
molecule: u
|
|
8632
8627
|
});
|
|
8633
8628
|
return l.fillMolecule({
|
|
@@ -8635,6 +8630,70 @@ class Wr {
|
|
|
8635
8630
|
amount: n
|
|
8636
8631
|
}), await this.executeQuery(l);
|
|
8637
8632
|
}
|
|
8633
|
+
/**
|
|
8634
|
+
* Transfers tokens from one source wallet to MULTIPLE recipients in a single molecule.
|
|
8635
|
+
*
|
|
8636
|
+
* One molecule funds N recipients (WP line 544: "utilizing the sender's Wallet to fund multiple
|
|
8637
|
+
* recipients with one transaction"). Each recipient receives its own amount and, for stackable
|
|
8638
|
+
* tokens, its own subset of token units. The source is fully drained and the unsent change
|
|
8639
|
+
* returns via the remainder atom (UTXO), so the V-atoms conserve. Single-recipient transfers
|
|
8640
|
+
* should keep using transferToken(); this is its N-recipient generalization.
|
|
8641
|
+
*
|
|
8642
|
+
* @param {Object} options - The transfer options.
|
|
8643
|
+
* @param {string} options.token - The token to transfer.
|
|
8644
|
+
* @param {Array} options.recipients - [{ bundleHash, amount?, units?, batchId? }] per recipient.
|
|
8645
|
+
* @param {Object} [options.sourceWallet=null] - The source wallet; queried if not provided.
|
|
8646
|
+
*
|
|
8647
|
+
* @returns {Promise} - A Promise that resolves to the transaction result.
|
|
8648
|
+
*
|
|
8649
|
+
* @throws {StackableUnitAmountException} - If a recipient provides both amount and units.
|
|
8650
|
+
* @throws {TransferBalanceException} - If the source wallet does not have enough balance.
|
|
8651
|
+
*/
|
|
8652
|
+
async transferTokens({
|
|
8653
|
+
token: e,
|
|
8654
|
+
recipients: t,
|
|
8655
|
+
sourceWallet: n = null
|
|
8656
|
+
}) {
|
|
8657
|
+
const s = t.map((l) => {
|
|
8658
|
+
const h = l.units || [];
|
|
8659
|
+
if (h.length > 0) {
|
|
8660
|
+
if (l.amount > 0)
|
|
8661
|
+
throw new _e();
|
|
8662
|
+
return h.length;
|
|
8663
|
+
}
|
|
8664
|
+
return l.amount || 0;
|
|
8665
|
+
}), r = s.reduce((l, h) => l + h, 0);
|
|
8666
|
+
if (n === null && (n = await this.querySourceWallet({
|
|
8667
|
+
token: e,
|
|
8668
|
+
amount: r
|
|
8669
|
+
})), n === null || ce.cmp(n.balance, r) < 0)
|
|
8670
|
+
throw new G();
|
|
8671
|
+
const i = t.map((l) => {
|
|
8672
|
+
const h = S.create({
|
|
8673
|
+
bundle: l.bundleHash,
|
|
8674
|
+
token: e
|
|
8675
|
+
});
|
|
8676
|
+
return l.batchId !== void 0 && l.batchId !== null ? h.batchId = l.batchId : h.initBatchId({
|
|
8677
|
+
sourceWallet: n
|
|
8678
|
+
}), h;
|
|
8679
|
+
}), a = n.createRemainder(this.getSecret());
|
|
8680
|
+
n.splitUnitsMulti(
|
|
8681
|
+
t.map((l) => l.units || []),
|
|
8682
|
+
i,
|
|
8683
|
+
a
|
|
8684
|
+
);
|
|
8685
|
+
const c = await this.createMolecule({
|
|
8686
|
+
sourceWallet: n,
|
|
8687
|
+
remainderWallet: a
|
|
8688
|
+
}), u = await this.createMoleculeMutation({
|
|
8689
|
+
mutationClass: vt,
|
|
8690
|
+
molecule: c
|
|
8691
|
+
});
|
|
8692
|
+
return u.fillMoleculeMulti({
|
|
8693
|
+
recipientWallets: i,
|
|
8694
|
+
amounts: s
|
|
8695
|
+
}), await this.executeQuery(u);
|
|
8696
|
+
}
|
|
8638
8697
|
/**
|
|
8639
8698
|
* Deposits buffer token into the source wallet.
|
|
8640
8699
|
*
|
|
@@ -8660,7 +8719,7 @@ class Wr {
|
|
|
8660
8719
|
sourceWallet: s,
|
|
8661
8720
|
remainderWallet: r
|
|
8662
8721
|
}), a = await this.createMoleculeMutation({
|
|
8663
|
-
mutationClass:
|
|
8722
|
+
mutationClass: or,
|
|
8664
8723
|
molecule: i
|
|
8665
8724
|
});
|
|
8666
8725
|
return a.fillMolecule({
|
|
@@ -8693,7 +8752,7 @@ class Wr {
|
|
|
8693
8752
|
sourceWallet: n,
|
|
8694
8753
|
remainderWallet: r
|
|
8695
8754
|
}), a = await this.createMoleculeMutation({
|
|
8696
|
-
mutationClass:
|
|
8755
|
+
mutationClass: ar,
|
|
8697
8756
|
molecule: i
|
|
8698
8757
|
}), c = {};
|
|
8699
8758
|
return c[this.getBundle()] = t, a.fillMolecule({
|
|
@@ -8723,7 +8782,7 @@ class Wr {
|
|
|
8723
8782
|
const r = s.createRemainder(this.getSecret());
|
|
8724
8783
|
if (n.length > 0) {
|
|
8725
8784
|
if (t > 0)
|
|
8726
|
-
throw new
|
|
8785
|
+
throw new _e();
|
|
8727
8786
|
t = n.length, s.splitUnits(
|
|
8728
8787
|
n,
|
|
8729
8788
|
r
|
|
@@ -8758,7 +8817,7 @@ class Wr {
|
|
|
8758
8817
|
sourceWallet: s = null
|
|
8759
8818
|
}) {
|
|
8760
8819
|
if (s === null && (s = (await this.queryBalance({ token: e })).payload()), !s)
|
|
8761
|
-
throw new
|
|
8820
|
+
throw new G("Source wallet is missing or invalid.");
|
|
8762
8821
|
const r = s.createRemainder(this.getSecret()), i = await this.createMolecule({
|
|
8763
8822
|
sourceWallet: s,
|
|
8764
8823
|
remainderWallet: r
|
|
@@ -8792,17 +8851,17 @@ class Wr {
|
|
|
8792
8851
|
sourceWallet: r = null
|
|
8793
8852
|
}) {
|
|
8794
8853
|
if (r === null && (r = (await this.queryBalance({ token: t })).payload()), r === null)
|
|
8795
|
-
throw new
|
|
8854
|
+
throw new G("Source wallet is missing or invalid.");
|
|
8796
8855
|
if (!r.tokenUnits || !r.tokenUnits.length)
|
|
8797
|
-
throw new
|
|
8856
|
+
throw new G("Source wallet does not have token units.");
|
|
8798
8857
|
if (!s.length)
|
|
8799
|
-
throw new
|
|
8858
|
+
throw new G("Fused token unit list is empty.");
|
|
8800
8859
|
const i = [];
|
|
8801
8860
|
r.tokenUnits.forEach((h) => {
|
|
8802
8861
|
i.push(h.id);
|
|
8803
8862
|
}), s.forEach((h) => {
|
|
8804
8863
|
if (!i.includes(h))
|
|
8805
|
-
throw new
|
|
8864
|
+
throw new G(`Fused token unit ID = ${h} does not found in the source wallet.`);
|
|
8806
8865
|
});
|
|
8807
8866
|
const a = S.create({
|
|
8808
8867
|
bundle: e,
|
|
@@ -8810,7 +8869,7 @@ class Wr {
|
|
|
8810
8869
|
});
|
|
8811
8870
|
a.initBatchId({ sourceWallet: r });
|
|
8812
8871
|
const c = r.createRemainder(this.getSecret());
|
|
8813
|
-
r.splitUnits(s, c), typeof n == "string" && (n = new
|
|
8872
|
+
r.splitUnits(s, c), typeof n == "string" && (n = new fe(n, n, {})), n.metas.fusedTokenUnits = r.getTokenUnitsData(), a.tokenUnits = [n];
|
|
8814
8873
|
const u = await this.createMolecule({
|
|
8815
8874
|
sourceWallet: r,
|
|
8816
8875
|
remainderWallet: c
|
|
@@ -8853,7 +8912,7 @@ class Wr {
|
|
|
8853
8912
|
}, n);
|
|
8854
8913
|
this.setAuthToken(a);
|
|
8855
8914
|
} else
|
|
8856
|
-
throw new
|
|
8915
|
+
throw new It(`KnishIOClient::requestGuestAuthToken() - Authorization attempt rejected by ledger. Reason: ${i.reason()}`);
|
|
8857
8916
|
return i;
|
|
8858
8917
|
}
|
|
8859
8918
|
/**
|
|
@@ -8875,22 +8934,22 @@ class Wr {
|
|
|
8875
8934
|
secret: e,
|
|
8876
8935
|
sourceWallet: n
|
|
8877
8936
|
}), r = await this.createMoleculeMutation({
|
|
8878
|
-
mutationClass:
|
|
8937
|
+
mutationClass: _s,
|
|
8879
8938
|
molecule: s
|
|
8880
|
-
});
|
|
8881
|
-
r.fillMolecule({ meta:
|
|
8882
|
-
const
|
|
8883
|
-
if (
|
|
8884
|
-
const
|
|
8885
|
-
token:
|
|
8886
|
-
expiresAt:
|
|
8887
|
-
pubkey:
|
|
8888
|
-
encrypt:
|
|
8939
|
+
}), i = { encrypt: t ? "true" : "false" };
|
|
8940
|
+
n.pubkey && (i.walletPubkey = n.pubkey), r.fillMolecule({ meta: i });
|
|
8941
|
+
const a = await r.execute({});
|
|
8942
|
+
if (a.success()) {
|
|
8943
|
+
const c = xe.create({
|
|
8944
|
+
token: a.token(),
|
|
8945
|
+
expiresAt: a.expiresAt(),
|
|
8946
|
+
pubkey: a.pubKey(),
|
|
8947
|
+
encrypt: a.encrypt()
|
|
8889
8948
|
}, n);
|
|
8890
|
-
this.setAuthToken(
|
|
8949
|
+
this.setAuthToken(c);
|
|
8891
8950
|
} else
|
|
8892
|
-
throw new
|
|
8893
|
-
return
|
|
8951
|
+
throw new It(`KnishIOClient::requestProfileAuthToken() - Authorization attempt rejected by ledger. Reason: ${a.reason()}`);
|
|
8952
|
+
return a;
|
|
8894
8953
|
}
|
|
8895
8954
|
/**
|
|
8896
8955
|
* Request an auth token (guest or profile)
|
|
@@ -8961,7 +9020,7 @@ class Wr {
|
|
|
8961
9020
|
}
|
|
8962
9021
|
}
|
|
8963
9022
|
}
|
|
8964
|
-
class
|
|
9023
|
+
class Br extends C {
|
|
8965
9024
|
/**
|
|
8966
9025
|
* Class constructor
|
|
8967
9026
|
*
|
|
@@ -9009,9 +9068,9 @@ class Ur extends C {
|
|
|
9009
9068
|
* @return {*}
|
|
9010
9069
|
*/
|
|
9011
9070
|
payloadKey(e) {
|
|
9012
|
-
if (!
|
|
9071
|
+
if (!M.has(this.payload(), e))
|
|
9013
9072
|
throw new te(`ResponseAuthorizationGuest::payloadKey() - '${e}' key is not found in the payload!`);
|
|
9014
|
-
return
|
|
9073
|
+
return M.get(this.payload(), e);
|
|
9015
9074
|
}
|
|
9016
9075
|
/**
|
|
9017
9076
|
* Returns the auth token
|
|
@@ -9032,121 +9091,119 @@ class Ur extends C {
|
|
|
9032
9091
|
}
|
|
9033
9092
|
export {
|
|
9034
9093
|
g as Atom,
|
|
9035
|
-
|
|
9094
|
+
we as AtomIndexException,
|
|
9036
9095
|
P as AtomMeta,
|
|
9037
9096
|
ae as AtomsMissingException,
|
|
9038
9097
|
xe as AuthToken,
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9098
|
+
It as AuthorizationRejectedException,
|
|
9099
|
+
he as BalanceInsufficientException,
|
|
9100
|
+
Ue as BatchIdException,
|
|
9042
9101
|
ve as CheckMolecule,
|
|
9043
9102
|
ee as CodeException,
|
|
9044
|
-
|
|
9045
|
-
|
|
9103
|
+
ce as Decimal,
|
|
9104
|
+
M as Dot,
|
|
9046
9105
|
te as InvalidResponseException,
|
|
9047
|
-
|
|
9048
|
-
|
|
9106
|
+
Ur as KnishIOClient,
|
|
9107
|
+
de as Meta,
|
|
9049
9108
|
H as MetaMissingException,
|
|
9050
|
-
|
|
9051
|
-
|
|
9109
|
+
as as MolecularHashMismatchException,
|
|
9110
|
+
ls as MolecularHashMissingException,
|
|
9052
9111
|
z as Molecule,
|
|
9053
9112
|
Qe as Mutation,
|
|
9054
9113
|
Js as MutationActiveSession,
|
|
9055
9114
|
Us as MutationAppendRequest,
|
|
9056
9115
|
Cs as MutationClaimShadowWallet,
|
|
9057
|
-
|
|
9116
|
+
Ms as MutationCreateIdentifier,
|
|
9058
9117
|
Os as MutationCreateMeta,
|
|
9059
|
-
|
|
9060
|
-
|
|
9118
|
+
ir as MutationCreateRule,
|
|
9119
|
+
$s as MutationCreateToken,
|
|
9061
9120
|
Ks as MutationCreateWallet,
|
|
9062
|
-
|
|
9121
|
+
or as MutationDepositBufferToken,
|
|
9063
9122
|
Hs as MutationLinkIdentifier,
|
|
9064
9123
|
qs as MutationPeering,
|
|
9065
9124
|
W as MutationProposeMolecule,
|
|
9066
|
-
|
|
9125
|
+
_s as MutationRequestAuthorization,
|
|
9067
9126
|
Fs as MutationRequestAuthorizationGuest,
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9127
|
+
vs as MutationRequestTokens,
|
|
9128
|
+
vt as MutationTransferTokens,
|
|
9129
|
+
ar as MutationWithdrawBufferToken,
|
|
9130
|
+
$t as NegativeAmountException,
|
|
9131
|
+
wt as PolicyInvalidException,
|
|
9073
9132
|
rt as PolicyMeta,
|
|
9074
|
-
|
|
9133
|
+
N as Query,
|
|
9075
9134
|
Xs as QueryActiveSession,
|
|
9076
|
-
|
|
9077
|
-
|
|
9135
|
+
Mt as QueryAtom,
|
|
9136
|
+
gs as QueryBalance,
|
|
9078
9137
|
Ie as QueryBatch,
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9138
|
+
ws as QueryBatchHistory,
|
|
9139
|
+
ds as QueryContinuId,
|
|
9140
|
+
Et as QueryEmbeddingStatus,
|
|
9082
9141
|
At as QueryMetaType,
|
|
9083
9142
|
Tt as QueryMetaTypeViaAtom,
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
fs as QueryWalletList,
|
|
9143
|
+
Ct as QueryMetaTypeViaMolecule,
|
|
9144
|
+
tr as QueryPolicy,
|
|
9145
|
+
Zs as QueryToken,
|
|
9146
|
+
fs as QueryWalletBundle,
|
|
9147
|
+
ms as QueryWalletList,
|
|
9090
9148
|
C as Response,
|
|
9091
9149
|
zs as ResponseActiveSession,
|
|
9092
9150
|
Ws as ResponseAppendRequest,
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9151
|
+
Ys as ResponseAtom,
|
|
9152
|
+
Br as ResponseAuthorizationGuest,
|
|
9153
|
+
ys as ResponseBalance,
|
|
9154
|
+
Ts as ResponseClaimShadowWallet,
|
|
9155
|
+
hs as ResponseContinuId,
|
|
9098
9156
|
Is as ResponseCreateIdentifier,
|
|
9099
9157
|
Es as ResponseCreateMeta,
|
|
9100
|
-
|
|
9101
|
-
|
|
9158
|
+
rr as ResponseCreateRule,
|
|
9159
|
+
Ss as ResponseCreateToken,
|
|
9102
9160
|
Ps as ResponseCreateWallet,
|
|
9103
|
-
|
|
9161
|
+
sr as ResponseEmbeddingStatus,
|
|
9104
9162
|
Bs as ResponseLinkIdentifier,
|
|
9105
|
-
|
|
9106
|
-
|
|
9163
|
+
bs as ResponseMetaType,
|
|
9164
|
+
nr as ResponseMetaTypeViaAtom,
|
|
9107
9165
|
ot as ResponseMetaTypeViaMolecule,
|
|
9108
9166
|
Rs as ResponsePeering,
|
|
9109
|
-
|
|
9167
|
+
er as ResponsePolicy,
|
|
9110
9168
|
V as ResponseProposeMolecule,
|
|
9111
9169
|
Gs as ResponseQueryActiveSession,
|
|
9112
|
-
|
|
9113
|
-
ws as ResponseRequestAuthorization,
|
|
9170
|
+
ks as ResponseRequestAuthorization,
|
|
9114
9171
|
Ns as ResponseRequestAuthorizationGuest,
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9172
|
+
As as ResponseRequestTokens,
|
|
9173
|
+
xs as ResponseTransferTokens,
|
|
9174
|
+
ps as ResponseWalletBundle,
|
|
9118
9175
|
Le as ResponseWalletList,
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9176
|
+
Jt as SignatureMalformedException,
|
|
9177
|
+
cs as SignatureMismatchException,
|
|
9178
|
+
_e as StackableUnitAmountException,
|
|
9122
9179
|
Ls as StackableUnitDecimalsException,
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9180
|
+
fe as TokenUnit,
|
|
9181
|
+
G as TransferBalanceException,
|
|
9182
|
+
ke as TransferMalformedException,
|
|
9183
|
+
kt as TransferMismatchedException,
|
|
9184
|
+
_t as TransferRemainderException,
|
|
9185
|
+
us as TransferToSelfException,
|
|
9129
9186
|
Oe as TransferUnbalancedException,
|
|
9130
9187
|
Ke as UnauthenticatedException,
|
|
9131
9188
|
S as Wallet,
|
|
9132
|
-
|
|
9189
|
+
xt as WalletShadowException,
|
|
9133
9190
|
re as WrongTokenTypeException,
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9191
|
+
yn as base64ToHex,
|
|
9192
|
+
pn as bufferToHexString,
|
|
9193
|
+
dn as charsetBaseConvert,
|
|
9194
|
+
bn as chunkArray,
|
|
9195
|
+
Be as chunkSubstr,
|
|
9196
|
+
wn as deepCloning,
|
|
9197
|
+
kn as diff,
|
|
9198
|
+
He as generateBatchId,
|
|
9199
|
+
pe as generateBundleHash,
|
|
9143
9200
|
nt as generateSecret,
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9201
|
+
fn as hexStringToBuffer,
|
|
9202
|
+
mn as hexToBase64,
|
|
9203
|
+
me as intersect,
|
|
9147
9204
|
Ve as isHex,
|
|
9148
|
-
|
|
9205
|
+
gn as isNumeric,
|
|
9149
9206
|
st as randomString,
|
|
9150
|
-
|
|
9207
|
+
ze as shake256
|
|
9151
9208
|
};
|
|
9152
9209
|
//# sourceMappingURL=client.es.mjs.map
|