@hinkal/common 0.0.38 → 0.0.39
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/assets/{utxoWorkerLauncher-DD2MTdrZ.js → snarkjsWorkerLauncher-DnwkYs-X.js} +1 -2
- package/assets/{snarkjsWorkerLogic-CEwqbPan.js → snarkjsWorkerLogic-BC6aIyVU.js} +1737 -1714
- package/assets/{snarkjsWorkerLogic-CLrSWcNt.js → snarkjsWorkerLogic-nszaMzK5.js} +615 -613
- package/assets/{snarkjsWorkerLauncher-CA30lfwg.js → utxoWorkerLauncher-DnwHvvqe.js} +1 -2
- package/assets/{utxoWorkerLogic-POijX68C.js → utxoWorkerLogic-7GeccTLS.js} +31 -26
- package/assets/{utxoWorkerLogic-BgOyVxuc.js → utxoWorkerLogic-nv68H8Xa.js} +9 -9
- package/assets/viteWorkerURL.constant-C5mJTKPS.js +11 -0
- package/assets/{zkProofWorkerLauncher-3zvFwfyC.js → zkProofWorkerLauncher-z3GSPrLx.js} +22 -23
- package/assets/{zkProofWorkerLogic-DjFkre1v.js → zkProofWorkerLogic-BbfiJ5PN.js} +57523 -57493
- package/constants/token-data/index.d.ts +2 -1
- package/constants/token-data/popularTokens.constants.d.ts +3 -0
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -0
- package/data-structures/Hinkal/index.d.ts +1 -0
- package/functions/index.d.ts +1 -0
- package/functions/private-wallet/emporium.helpers.d.ts +5 -0
- package/functions/private-wallet/index.d.ts +1 -0
- package/functions/snarkjs/constructEmporiumProof.d.ts +10 -0
- package/functions/snarkjs/index.d.ts +1 -0
- package/{index-B2h7Ehka.js → index-CaHu7xgL.mjs} +7814 -7666
- package/index.mjs +453 -0
- package/package.json +6 -9
- package/{snarkjsWorkerLogic-CVOSTl5c.js → snarkjsWorkerLogic-FVkZbSSu.mjs} +615 -612
- package/types/ethereum-network.types.d.ts +1 -0
- package/{utxoWorkerLogic-BG98Iib9.js → utxoWorkerLogic-DkQqd2La.mjs} +4 -4
- package/viteWorkerURL.constant-DV_UzTgr.mjs +9 -0
- package/{workerProxy-AhHfF6hk.js → workerProxy-C7q4UMti.mjs} +1 -1
- package/{zkProofWorkerLogic-Dk3zCanr.js → zkProofWorkerLogic-CCcXVAsh.mjs} +20 -20
- package/assets/viteWorkerURL.constant-CQNSvlud.js +0 -11
- package/index.js +0 -448
- package/viteWorkerURL.constant-DtthAV1C.js +0 -9
|
@@ -1192,9 +1192,8 @@ const It = /* @__PURE__ */ dt(mt), Ft = () => {
|
|
|
1192
1192
|
};
|
|
1193
1193
|
globalThis.process = It;
|
|
1194
1194
|
globalThis.Buffer = gr;
|
|
1195
|
-
const Tt = import("./
|
|
1195
|
+
const Tt = import("./utxoWorkerLogic-7GeccTLS.js");
|
|
1196
1196
|
addEventListener("message", async (h) => {
|
|
1197
|
-
console.log("addEventListener in Snarkjs Launcher starts");
|
|
1198
1197
|
const { onWorkerMessage: f } = await Tt;
|
|
1199
1198
|
f(h.data);
|
|
1200
1199
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as dist, p as process$1, B as Buffer } from "./utxoWorkerLauncher-
|
|
1
|
+
import { d as dist, p as process$1, B as Buffer } from "./utxoWorkerLauncher-DnwHvvqe.js";
|
|
2
2
|
const hexLen = [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4];
|
|
3
3
|
function fromString(_, c) {
|
|
4
4
|
if (!c || c == 10)
|
|
@@ -11425,7 +11425,7 @@ var streamBrowser$1, hasRequiredStreamBrowser$1;
|
|
|
11425
11425
|
function requireStreamBrowser$1() {
|
|
11426
11426
|
return hasRequiredStreamBrowser$1 || (hasRequiredStreamBrowser$1 = 1, streamBrowser$1 = requireEvents().EventEmitter), streamBrowser$1;
|
|
11427
11427
|
}
|
|
11428
|
-
var require$$0$
|
|
11428
|
+
var require$$0$1 = /* @__PURE__ */ getAugmentedNamespace(dist), util$1 = {}, types = {}, shams$1 = function() {
|
|
11429
11429
|
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
|
|
11430
11430
|
return !1;
|
|
11431
11431
|
if (typeof Symbol.iterator == "symbol")
|
|
@@ -12670,7 +12670,7 @@ function requireBuffer_list() {
|
|
|
12670
12670
|
}
|
|
12671
12671
|
return (N === "string" ? String : Number)(V);
|
|
12672
12672
|
}
|
|
12673
|
-
var G = require$$0$
|
|
12673
|
+
var G = require$$0$1, Q = G.Buffer, y = util$1, K = y.inspect, k = K && K.custom || "inspect";
|
|
12674
12674
|
function T(V, N, r0) {
|
|
12675
12675
|
Q.prototype.copy.call(V, N, r0);
|
|
12676
12676
|
}
|
|
@@ -12948,7 +12948,7 @@ function require_stream_writable$1() {
|
|
|
12948
12948
|
n0.WritableState = A0;
|
|
12949
12949
|
var h = {
|
|
12950
12950
|
deprecate: requireBrowser$b()
|
|
12951
|
-
}, s = requireStreamBrowser$1(), B = require$$0$
|
|
12951
|
+
}, s = requireStreamBrowser$1(), B = require$$0$1.Buffer, x = (typeof commonjsGlobal < "u" ? commonjsGlobal : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
|
|
12952
12952
|
};
|
|
12953
12953
|
function u(U) {
|
|
12954
12954
|
return B.from(U);
|
|
@@ -13237,7 +13237,7 @@ var string_decoder = {}, safeBuffer$1 = { exports: {} };
|
|
|
13237
13237
|
var hasRequiredSafeBuffer$1;
|
|
13238
13238
|
function requireSafeBuffer$1() {
|
|
13239
13239
|
return hasRequiredSafeBuffer$1 || (hasRequiredSafeBuffer$1 = 1, function(_, c) {
|
|
13240
|
-
var h = require$$0$
|
|
13240
|
+
var h = require$$0$1, s = h.Buffer;
|
|
13241
13241
|
function B(u, S) {
|
|
13242
13242
|
for (var G in u)
|
|
13243
13243
|
S[G] = u[G];
|
|
@@ -13626,7 +13626,7 @@ function require_stream_readable$1() {
|
|
|
13626
13626
|
l0.ReadableState = n0, requireEvents().EventEmitter;
|
|
13627
13627
|
var c = function(m0, T0) {
|
|
13628
13628
|
return m0.listeners(T0).length;
|
|
13629
|
-
}, h = requireStreamBrowser$1(), s = require$$0$
|
|
13629
|
+
}, h = requireStreamBrowser$1(), s = require$$0$1.Buffer, B = (typeof commonjsGlobal < "u" ? commonjsGlobal : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
|
|
13630
13630
|
};
|
|
13631
13631
|
function x(Z) {
|
|
13632
13632
|
return s.from(Z);
|
|
@@ -14370,7 +14370,7 @@ function requireBn$6() {
|
|
|
14370
14370
|
typeof c == "object" ? c.exports = x : h.BN = x, x.BN = x, x.wordSize = 26;
|
|
14371
14371
|
var u;
|
|
14372
14372
|
try {
|
|
14373
|
-
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$
|
|
14373
|
+
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$1.Buffer;
|
|
14374
14374
|
} catch {
|
|
14375
14375
|
}
|
|
14376
14376
|
x.isBN = function(l) {
|
|
@@ -46251,10 +46251,15 @@ let didPreprocess = !1;
|
|
|
46251
46251
|
const preProcessing = async () => {
|
|
46252
46252
|
didPreprocess || (await poseidonHolder.init(), await jubHolder.init(), didPreprocess = !0);
|
|
46253
46253
|
};
|
|
46254
|
-
var libsodiumWrappers = {}, libsodium = { exports: {} },
|
|
46255
|
-
|
|
46256
|
-
|
|
46257
|
-
|
|
46254
|
+
var libsodiumWrappers = {}, libsodium = { exports: {} }, empty_1, hasRequiredEmpty;
|
|
46255
|
+
function requireEmpty() {
|
|
46256
|
+
if (hasRequiredEmpty)
|
|
46257
|
+
return empty_1;
|
|
46258
|
+
hasRequiredEmpty = 1;
|
|
46259
|
+
var _ = null;
|
|
46260
|
+
return empty_1 = _, empty_1;
|
|
46261
|
+
}
|
|
46262
|
+
var pathBrowserify, hasRequiredPathBrowserify;
|
|
46258
46263
|
function requirePathBrowserify() {
|
|
46259
46264
|
if (hasRequiredPathBrowserify)
|
|
46260
46265
|
return pathBrowserify;
|
|
@@ -46638,7 +46643,7 @@ function requireRipemd160() {
|
|
|
46638
46643
|
if (hasRequiredRipemd160)
|
|
46639
46644
|
return ripemd160;
|
|
46640
46645
|
hasRequiredRipemd160 = 1;
|
|
46641
|
-
var _ = require$$0$
|
|
46646
|
+
var _ = require$$0$1.Buffer, c = requireInherits_browser(), h = requireHashBase(), s = new Array(16), B = [
|
|
46642
46647
|
0,
|
|
46643
46648
|
1,
|
|
46644
46649
|
2,
|
|
@@ -49747,7 +49752,7 @@ function requireBn$5() {
|
|
|
49747
49752
|
typeof c == "object" ? c.exports = x : h.BN = x, x.BN = x, x.wordSize = 26;
|
|
49748
49753
|
var u;
|
|
49749
49754
|
try {
|
|
49750
|
-
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$
|
|
49755
|
+
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$1.Buffer;
|
|
49751
49756
|
} catch {
|
|
49752
49757
|
}
|
|
49753
49758
|
x.isBN = function(d) {
|
|
@@ -50930,7 +50935,7 @@ function requireBn$4() {
|
|
|
50930
50935
|
typeof c == "object" ? c.exports = x : h.BN = x, x.BN = x, x.wordSize = 26;
|
|
50931
50936
|
var u;
|
|
50932
50937
|
try {
|
|
50933
|
-
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$
|
|
50938
|
+
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$1.Buffer;
|
|
50934
50939
|
} catch {
|
|
50935
50940
|
}
|
|
50936
50941
|
x.isBN = function(d) {
|
|
@@ -52428,7 +52433,7 @@ function requireStreamBrowser() {
|
|
|
52428
52433
|
var safeBuffer = { exports: {} }, hasRequiredSafeBuffer;
|
|
52429
52434
|
function requireSafeBuffer() {
|
|
52430
52435
|
return hasRequiredSafeBuffer || (hasRequiredSafeBuffer = 1, function(_, c) {
|
|
52431
|
-
var h = require$$0$
|
|
52436
|
+
var h = require$$0$1, s = h.Buffer;
|
|
52432
52437
|
function B(u, S) {
|
|
52433
52438
|
for (var G in u)
|
|
52434
52439
|
S[G] = u[G];
|
|
@@ -52518,7 +52523,7 @@ function requireUtil() {
|
|
|
52518
52523
|
return N === null || typeof N == "boolean" || typeof N == "number" || typeof N == "string" || typeof N == "symbol" || // ES6 symbol
|
|
52519
52524
|
typeof N > "u";
|
|
52520
52525
|
}
|
|
52521
|
-
util.isPrimitive = T, util.isBuffer = require$$0$
|
|
52526
|
+
util.isPrimitive = T, util.isBuffer = require$$0$1.Buffer.isBuffer;
|
|
52522
52527
|
function V(N) {
|
|
52523
52528
|
return Object.prototype.toString.call(N);
|
|
52524
52529
|
}
|
|
@@ -53367,7 +53372,7 @@ function requireBn$3() {
|
|
|
53367
53372
|
typeof c == "object" ? c.exports = x : h.BN = x, x.BN = x, x.wordSize = 26;
|
|
53368
53373
|
var u;
|
|
53369
53374
|
try {
|
|
53370
|
-
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$
|
|
53375
|
+
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$1.Buffer;
|
|
53371
53376
|
} catch {
|
|
53372
53377
|
}
|
|
53373
53378
|
x.isBN = function(d) {
|
|
@@ -56663,7 +56668,7 @@ function requireBn$2() {
|
|
|
56663
56668
|
typeof c == "object" ? c.exports = x : h.BN = x, x.BN = x, x.wordSize = 26;
|
|
56664
56669
|
var u;
|
|
56665
56670
|
try {
|
|
56666
|
-
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$
|
|
56671
|
+
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$1.Buffer;
|
|
56667
56672
|
} catch {
|
|
56668
56673
|
}
|
|
56669
56674
|
x.isBN = function(d) {
|
|
@@ -58048,7 +58053,7 @@ function requireBuffer() {
|
|
|
58048
58053
|
if (hasRequiredBuffer)
|
|
58049
58054
|
return buffer;
|
|
58050
58055
|
hasRequiredBuffer = 1;
|
|
58051
|
-
var _ = requireInherits_browser(), c = requireBase().Reporter, h = require$$0$
|
|
58056
|
+
var _ = requireInherits_browser(), c = requireBase().Reporter, h = require$$0$1.Buffer;
|
|
58052
58057
|
function s(x, u) {
|
|
58053
58058
|
if (c.call(this, u), !h.isBuffer(x)) {
|
|
58054
58059
|
this.error("Input not Buffer");
|
|
@@ -58659,7 +58664,7 @@ function requirePem$1() {
|
|
|
58659
58664
|
if (hasRequiredPem$1)
|
|
58660
58665
|
return pem$1;
|
|
58661
58666
|
hasRequiredPem$1 = 1;
|
|
58662
|
-
var _ = requireInherits_browser(), c = require$$0$
|
|
58667
|
+
var _ = requireInherits_browser(), c = require$$0$1.Buffer, h = requireDer$1();
|
|
58663
58668
|
function s(B) {
|
|
58664
58669
|
h.call(this, B), this.enc = "pem";
|
|
58665
58670
|
}
|
|
@@ -58698,7 +58703,7 @@ function requireDer() {
|
|
|
58698
58703
|
if (hasRequiredDer)
|
|
58699
58704
|
return der_1;
|
|
58700
58705
|
hasRequiredDer = 1;
|
|
58701
|
-
var _ = requireInherits_browser(), c = require$$0$
|
|
58706
|
+
var _ = requireInherits_browser(), c = require$$0$1.Buffer, h = requireAsn1$1(), s = h.base, B = h.constants.der;
|
|
58702
58707
|
function x(Q) {
|
|
58703
58708
|
this.enc = "der", this.name = Q.name, this.entity = Q, this.tree = new u(), this.tree._init(Q.body);
|
|
58704
58709
|
}
|
|
@@ -59384,7 +59389,7 @@ function requireBn$1() {
|
|
|
59384
59389
|
typeof c == "object" ? c.exports = x : h.BN = x, x.BN = x, x.wordSize = 26;
|
|
59385
59390
|
var u;
|
|
59386
59391
|
try {
|
|
59387
|
-
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$
|
|
59392
|
+
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$1.Buffer;
|
|
59388
59393
|
} catch {
|
|
59389
59394
|
}
|
|
59390
59395
|
x.isBN = function(d) {
|
|
@@ -60666,7 +60671,7 @@ function requireBn() {
|
|
|
60666
60671
|
typeof c == "object" ? c.exports = x : h.BN = x, x.BN = x, x.wordSize = 26;
|
|
60667
60672
|
var u;
|
|
60668
60673
|
try {
|
|
60669
|
-
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$
|
|
60674
|
+
typeof window < "u" && typeof window.Buffer < "u" ? u = window.Buffer : u = require$$0$1.Buffer;
|
|
60670
60675
|
} catch {
|
|
60671
60676
|
}
|
|
60672
60677
|
x.isBN = function(d) {
|
|
@@ -62087,7 +62092,7 @@ function requireLibsodium() {
|
|
|
62087
62092
|
};
|
|
62088
62093
|
var Y0, K0, B0 = B0 !== void 0 ? B0 : {}, W0 = Object.assign({}, B0), ge = typeof window == "object", fa = typeof importScripts == "function", O0 = typeof process$1 == "object" && typeof process$1.versions == "object" && typeof process$1.versions.node == "string", Z0 = "";
|
|
62089
62094
|
if (O0) {
|
|
62090
|
-
var Je =
|
|
62095
|
+
var Je = requireEmpty(), we = requirePathBrowserify();
|
|
62091
62096
|
Z0 = fa ? we.dirname(Z0) + "/" : __dirname + "/", Y0 = (re, ve) => (re = function(Re) {
|
|
62092
62097
|
return Re.startsWith("file://");
|
|
62093
62098
|
}(re) ? new URL(re) : we.normalize(re), Je.readFileSync(re, ve ? void 0 : "utf8")), K0 = (re) => {
|
|
@@ -64561,7 +64566,7 @@ function requireLibsodium() {
|
|
|
64561
64566
|
};
|
|
64562
64567
|
var y, K, k = k !== void 0 ? k : {}, T = Object.assign({}, k), V = typeof window == "object", N = typeof importScripts == "function", r0 = typeof process$1 == "object" && typeof process$1.versions == "object" && typeof process$1.versions.node == "string", e0 = "";
|
|
64563
64568
|
if (r0) {
|
|
64564
|
-
var W =
|
|
64569
|
+
var W = requireEmpty(), x0 = requirePathBrowserify();
|
|
64565
64570
|
e0 = N ? x0.dirname(e0) + "/" : __dirname + "/", y = (R0, X0) => (R0 = function(Y0) {
|
|
64566
64571
|
return Y0.startsWith("file://");
|
|
64567
64572
|
}(R0) ? new URL(R0) : x0.normalize(R0), W.readFileSync(R0, X0 ? void 0 : "utf8")), K = (R0) => {
|
|
@@ -67767,7 +67772,7 @@ const workerProxy = new WorkerProxy(), handleFilterUtxosWithNullifier = async ({
|
|
|
67767
67772
|
}
|
|
67768
67773
|
workerProxy.postMessageToMainThread({ additionalEncryptedOutputs: h, lastOutput: B });
|
|
67769
67774
|
}, onWorkerMessage = async (_) => {
|
|
67770
|
-
|
|
67775
|
+
await preProcessing();
|
|
67771
67776
|
const { type: c } = _.payload;
|
|
67772
67777
|
switch (c) {
|
|
67773
67778
|
case UtxoWorkerActionType.BATCH_FILTER_UTXOS_WITH_NULLIFIER:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as U } from "./zkProofWorkerLauncher-
|
|
2
|
-
import { U as l,
|
|
1
|
+
import { B as U } from "./zkProofWorkerLauncher-z3GSPrLx.js";
|
|
2
|
+
import { U as l, h as T, f, i as I, j as y, k as m, l as h, p as S } from "./zkProofWorkerLogic-BbfiJ5PN.js";
|
|
3
3
|
const g = (e) => {
|
|
4
4
|
const t = T.decode(
|
|
5
5
|
["uint256", "address", "tuple(uint256, uint256, uint256, uint256)", "uint256", "uint256"],
|
|
@@ -15,7 +15,7 @@ const g = (e) => {
|
|
|
15
15
|
timeStamp: c,
|
|
16
16
|
tokenId: p
|
|
17
17
|
};
|
|
18
|
-
},
|
|
18
|
+
}, _ = (e, t) => {
|
|
19
19
|
const { amount: o, erc20TokenAddress: r, timeStamp: s, tokenId: n, randomization: a } = g(e);
|
|
20
20
|
return {
|
|
21
21
|
amount: o,
|
|
@@ -25,23 +25,23 @@ const g = (e) => {
|
|
|
25
25
|
randomization: a,
|
|
26
26
|
shieldedPrivateKey: t
|
|
27
27
|
};
|
|
28
|
-
},
|
|
28
|
+
}, x = (e, t) => {
|
|
29
29
|
const { randomization: o, H0: r, H1: s } = g(e), n = l.checkSignature(o, r, s, t);
|
|
30
30
|
if (!n)
|
|
31
31
|
throw new Error("UTXO doesn't belong to user");
|
|
32
32
|
return n;
|
|
33
33
|
};
|
|
34
34
|
var d = /* @__PURE__ */ ((e) => (e[e.BATCH_FILTER_UTXOS_WITH_NULLIFIER = 0] = "BATCH_FILTER_UTXOS_WITH_NULLIFIER", e[e.BUILD_UTXOS = 1] = "BUILD_UTXOS", e[e.DECIPHER_OUTPUTS = 2] = "DECIPHER_OUTPUTS", e))(d || {});
|
|
35
|
-
const u = new
|
|
35
|
+
const u = new f(), E = async ({ data: e }) => {
|
|
36
36
|
const { utxos: t, nullifiers: o } = e, r = t.filter((s) => {
|
|
37
|
-
const n = new
|
|
37
|
+
const n = new I(s);
|
|
38
38
|
return !o.has(n.getNullifier());
|
|
39
39
|
});
|
|
40
40
|
u.postMessageToMainThread(r);
|
|
41
41
|
}, v = async ({ data: e }) => {
|
|
42
42
|
const t = new l(e.signature), o = t.getShieldedPrivateKey(), r = e.encryptedOutputs.map((s) => {
|
|
43
43
|
try {
|
|
44
|
-
return s.isPositive ? y(U.from(s.value.slice(2), "hex"), t) :
|
|
44
|
+
return s.isPositive ? y(U.from(s.value.slice(2), "hex"), t) : _(s.value, o);
|
|
45
45
|
} catch {
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
@@ -63,14 +63,14 @@ const u = new I(), E = async ({ data: e }) => {
|
|
|
63
63
|
}
|
|
64
64
|
else
|
|
65
65
|
try {
|
|
66
|
-
|
|
66
|
+
x(s, t.getShieldedPrivateKey()) && (o.map((c) => c.value).includes(a.value) || o.push(a));
|
|
67
67
|
} catch {
|
|
68
68
|
h("Utxo not decoded");
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
u.postMessageToMainThread({ additionalEncryptedOutputs: o, lastOutput: s });
|
|
72
72
|
}, B = async (e) => {
|
|
73
|
-
|
|
73
|
+
await S();
|
|
74
74
|
const { type: t } = e.payload;
|
|
75
75
|
switch (t) {
|
|
76
76
|
case d.BATCH_FILTER_UTXOS_WITH_NULLIFIER:
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { W as r } from "./zkProofWorkerLogic-BbfiJ5PN.js";
|
|
2
|
+
import "./zkProofWorkerLauncher-z3GSPrLx.js";
|
|
3
|
+
var o = self.location.href, e = "" + new URL("snarkjsWorkerLauncher-DnwkYs-X.js", import.meta.url).href, a = "" + new URL("utxoWorkerLauncher-DnwHvvqe.js", import.meta.url).href;
|
|
4
|
+
const n = {
|
|
5
|
+
[r.ZKProof]: o,
|
|
6
|
+
[r.SnarkJS]: e,
|
|
7
|
+
[r.UTXO]: a
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
n as workerViteURL
|
|
11
|
+
};
|
|
@@ -64,12 +64,12 @@ or.read = function(h, f, p, x, w) {
|
|
|
64
64
|
return (C ? -1 : 1) * l * Math.pow(2, s - x);
|
|
65
65
|
};
|
|
66
66
|
or.write = function(h, f, p, x, w, s) {
|
|
67
|
-
var l, I, B, A = s * 8 - w - 1, o = (1 << A) - 1, U = o >> 1, k = w === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, C = x ? 0 : s - 1,
|
|
68
|
-
for (f = Math.abs(f), isNaN(f) || f === 1 / 0 ? (I = isNaN(f) ? 1 : 0, l = o) : (l = Math.floor(Math.log(f) / Math.LN2), f * (B = Math.pow(2, -l)) < 1 && (l--, B *= 2), l + U >= 1 ? f += k / B : f += k * Math.pow(2, 1 - U), f * B >= 2 && (l++, B /= 2), l + U >= o ? (I = 0, l = o) : l + U >= 1 ? (I = (f * B - 1) * Math.pow(2, w), l = l + U) : (I = f * Math.pow(2, U - 1) * Math.pow(2, w), l = 0)); w >= 8; h[p + C] = I & 255, C +=
|
|
67
|
+
var l, I, B, A = s * 8 - w - 1, o = (1 << A) - 1, U = o >> 1, k = w === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, C = x ? 0 : s - 1, P = x ? 1 : -1, J = f < 0 || f === 0 && 1 / f < 0 ? 1 : 0;
|
|
68
|
+
for (f = Math.abs(f), isNaN(f) || f === 1 / 0 ? (I = isNaN(f) ? 1 : 0, l = o) : (l = Math.floor(Math.log(f) / Math.LN2), f * (B = Math.pow(2, -l)) < 1 && (l--, B *= 2), l + U >= 1 ? f += k / B : f += k * Math.pow(2, 1 - U), f * B >= 2 && (l++, B /= 2), l + U >= o ? (I = 0, l = o) : l + U >= 1 ? (I = (f * B - 1) * Math.pow(2, w), l = l + U) : (I = f * Math.pow(2, U - 1) * Math.pow(2, w), l = 0)); w >= 8; h[p + C] = I & 255, C += P, I /= 256, w -= 8)
|
|
69
69
|
;
|
|
70
|
-
for (l = l << w | I, A += w; A > 0; h[p + C] = l & 255, C +=
|
|
70
|
+
for (l = l << w | I, A += w; A > 0; h[p + C] = l & 255, C += P, l /= 256, A -= 8)
|
|
71
71
|
;
|
|
72
|
-
h[p + C -
|
|
72
|
+
h[p + C - P] |= J * 128;
|
|
73
73
|
};
|
|
74
74
|
/*!
|
|
75
75
|
* The buffer module from node.js, for the browser.
|
|
@@ -121,7 +121,7 @@ or.write = function(h, f, p, x, w, s) {
|
|
|
121
121
|
throw new TypeError(
|
|
122
122
|
'The "string" argument must be of type string. Received type number'
|
|
123
123
|
);
|
|
124
|
-
return
|
|
124
|
+
return P(e);
|
|
125
125
|
}
|
|
126
126
|
return U(e, r, t);
|
|
127
127
|
}
|
|
@@ -168,13 +168,13 @@ or.write = function(h, f, p, x, w, s) {
|
|
|
168
168
|
o.alloc = function(e, r, t) {
|
|
169
169
|
return C(e, r, t);
|
|
170
170
|
};
|
|
171
|
-
function
|
|
171
|
+
function P(e) {
|
|
172
172
|
return k(e), A(e < 0 ? 0 : Z(e) | 0);
|
|
173
173
|
}
|
|
174
174
|
o.allocUnsafe = function(e) {
|
|
175
|
-
return
|
|
175
|
+
return P(e);
|
|
176
176
|
}, o.allocUnsafeSlow = function(e) {
|
|
177
|
-
return
|
|
177
|
+
return P(e);
|
|
178
178
|
};
|
|
179
179
|
function J(e, r) {
|
|
180
180
|
if ((typeof r != "string" || r === "") && (r = "utf8"), !o.isEncoding(r))
|
|
@@ -328,7 +328,7 @@ or.write = function(h, f, p, x, w, s) {
|
|
|
328
328
|
for (e || (e = "utf8"); ; )
|
|
329
329
|
switch (e) {
|
|
330
330
|
case "hex":
|
|
331
|
-
return
|
|
331
|
+
return Pr(this, r, t);
|
|
332
332
|
case "utf8":
|
|
333
333
|
case "utf-8":
|
|
334
334
|
return fr(this, r, t);
|
|
@@ -336,7 +336,7 @@ or.write = function(h, f, p, x, w, s) {
|
|
|
336
336
|
return Dr(this, r, t);
|
|
337
337
|
case "latin1":
|
|
338
338
|
case "binary":
|
|
339
|
-
return
|
|
339
|
+
return $r(this, r, t);
|
|
340
340
|
case "base64":
|
|
341
341
|
return kr(this, r, t);
|
|
342
342
|
case "ucs2":
|
|
@@ -590,14 +590,14 @@ or.write = function(h, f, p, x, w, s) {
|
|
|
590
590
|
n += String.fromCharCode(e[i] & 127);
|
|
591
591
|
return n;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function $r(e, r, t) {
|
|
594
594
|
let n = "";
|
|
595
595
|
t = Math.min(e.length, t);
|
|
596
596
|
for (let i = r; i < t; ++i)
|
|
597
597
|
n += String.fromCharCode(e[i]);
|
|
598
598
|
return n;
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function Pr(e, r, t) {
|
|
601
601
|
const n = e.length;
|
|
602
602
|
(!r || r < 0) && (r = 0), (!t || t < 0 || t > n) && (t = n);
|
|
603
603
|
let i = "";
|
|
@@ -646,13 +646,13 @@ or.write = function(h, f, p, x, w, s) {
|
|
|
646
646
|
return r = r >>> 0, t || T(r, 4, this.length), (this[r] | this[r + 1] << 8 | this[r + 2] << 16) + this[r + 3] * 16777216;
|
|
647
647
|
}, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(r, t) {
|
|
648
648
|
return r = r >>> 0, t || T(r, 4, this.length), this[r] * 16777216 + (this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3]);
|
|
649
|
-
}, o.prototype.readBigUInt64LE =
|
|
649
|
+
}, o.prototype.readBigUInt64LE = $(function(r) {
|
|
650
650
|
r = r >>> 0, Y(r, "offset");
|
|
651
651
|
const t = this[r], n = this[r + 7];
|
|
652
652
|
(t === void 0 || n === void 0) && X(r, this.length - 8);
|
|
653
653
|
const i = t + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24, u = this[++r] + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + n * 2 ** 24;
|
|
654
654
|
return BigInt(i) + (BigInt(u) << BigInt(32));
|
|
655
|
-
}), o.prototype.readBigUInt64BE =
|
|
655
|
+
}), o.prototype.readBigUInt64BE = $(function(r) {
|
|
656
656
|
r = r >>> 0, Y(r, "offset");
|
|
657
657
|
const t = this[r], n = this[r + 7];
|
|
658
658
|
(t === void 0 || n === void 0) && X(r, this.length - 8);
|
|
@@ -684,13 +684,13 @@ or.write = function(h, f, p, x, w, s) {
|
|
|
684
684
|
return r = r >>> 0, t || T(r, 4, this.length), this[r] | this[r + 1] << 8 | this[r + 2] << 16 | this[r + 3] << 24;
|
|
685
685
|
}, o.prototype.readInt32BE = function(r, t) {
|
|
686
686
|
return r = r >>> 0, t || T(r, 4, this.length), this[r] << 24 | this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3];
|
|
687
|
-
}, o.prototype.readBigInt64LE =
|
|
687
|
+
}, o.prototype.readBigInt64LE = $(function(r) {
|
|
688
688
|
r = r >>> 0, Y(r, "offset");
|
|
689
689
|
const t = this[r], n = this[r + 7];
|
|
690
690
|
(t === void 0 || n === void 0) && X(r, this.length - 8);
|
|
691
691
|
const i = this[r + 4] + this[r + 5] * 2 ** 8 + this[r + 6] * 2 ** 16 + (n << 24);
|
|
692
692
|
return (BigInt(i) << BigInt(32)) + BigInt(t + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24);
|
|
693
|
-
}), o.prototype.readBigInt64BE =
|
|
693
|
+
}), o.prototype.readBigInt64BE = $(function(r) {
|
|
694
694
|
r = r >>> 0, Y(r, "offset");
|
|
695
695
|
const t = this[r], n = this[r + 7];
|
|
696
696
|
(t === void 0 || n === void 0) && X(r, this.length - 8);
|
|
@@ -757,9 +757,9 @@ or.write = function(h, f, p, x, w, s) {
|
|
|
757
757
|
let c = Number(r >> BigInt(32) & BigInt(4294967295));
|
|
758
758
|
return e[t + 3] = c, c = c >> 8, e[t + 2] = c, c = c >> 8, e[t + 1] = c, c = c >> 8, e[t] = c, t + 8;
|
|
759
759
|
}
|
|
760
|
-
o.prototype.writeBigUInt64LE =
|
|
760
|
+
o.prototype.writeBigUInt64LE = $(function(r, t = 0) {
|
|
761
761
|
return lr(this, r, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
762
|
-
}), o.prototype.writeBigUInt64BE =
|
|
762
|
+
}), o.prototype.writeBigUInt64BE = $(function(r, t = 0) {
|
|
763
763
|
return pr(this, r, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
764
764
|
}), o.prototype.writeIntLE = function(r, t, n, i) {
|
|
765
765
|
if (r = +r, t = t >>> 0, !i) {
|
|
@@ -789,9 +789,9 @@ or.write = function(h, f, p, x, w, s) {
|
|
|
789
789
|
return r = +r, t = t >>> 0, n || R(this, r, t, 4, 2147483647, -2147483648), this[t] = r & 255, this[t + 1] = r >>> 8, this[t + 2] = r >>> 16, this[t + 3] = r >>> 24, t + 4;
|
|
790
790
|
}, o.prototype.writeInt32BE = function(r, t, n) {
|
|
791
791
|
return r = +r, t = t >>> 0, n || R(this, r, t, 4, 2147483647, -2147483648), r < 0 && (r = 4294967295 + r + 1), this[t] = r >>> 24, this[t + 1] = r >>> 16, this[t + 2] = r >>> 8, this[t + 3] = r & 255, t + 4;
|
|
792
|
-
}, o.prototype.writeBigInt64LE =
|
|
792
|
+
}, o.prototype.writeBigInt64LE = $(function(r, t = 0) {
|
|
793
793
|
return lr(this, r, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
794
|
-
}), o.prototype.writeBigInt64BE =
|
|
794
|
+
}), o.prototype.writeBigInt64BE = $(function(r, t = 0) {
|
|
795
795
|
return pr(this, r, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
796
796
|
});
|
|
797
797
|
function ar(e, r, t, n, i, u) {
|
|
@@ -1042,7 +1042,7 @@ or.write = function(h, f, p, x, w, s) {
|
|
|
1042
1042
|
}
|
|
1043
1043
|
return r;
|
|
1044
1044
|
}();
|
|
1045
|
-
function
|
|
1045
|
+
function $(e) {
|
|
1046
1046
|
return typeof BigInt > "u" ? zr : e;
|
|
1047
1047
|
}
|
|
1048
1048
|
function zr() {
|
|
@@ -1192,11 +1192,10 @@ const It = /* @__PURE__ */ dt(mt), Ft = () => {
|
|
|
1192
1192
|
};
|
|
1193
1193
|
globalThis.process = It;
|
|
1194
1194
|
globalThis.Buffer = gr;
|
|
1195
|
-
const Tt = import("./zkProofWorkerLogic-
|
|
1195
|
+
const Tt = import("./zkProofWorkerLogic-BbfiJ5PN.js").then(function(h) {
|
|
1196
1196
|
return h.z;
|
|
1197
1197
|
});
|
|
1198
1198
|
addEventListener("message", async (h) => {
|
|
1199
|
-
console.log("addEventListener in zkProof Launcher starts");
|
|
1200
1199
|
const { onWorkerMessage: f } = await Tt;
|
|
1201
1200
|
f(h.data);
|
|
1202
1201
|
});
|