@hinkal/common 0.0.17 → 0.0.20
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/{snarkjsWorkerLauncher-CaBCnle3.js → snarkjsWorkerLauncher-Cxayz-rO.js} +395 -392
- package/assets/snarkjsWorkerLogic-C0jhwQeU.js +37319 -0
- package/assets/{snarkjsWorkerLogic-PT_bvjbJ.js → snarkjsWorkerLogic-scy9tbGQ.js} +864 -817
- package/assets/{utxoWorkerLauncher-TRT6Cdzd.js → utxoWorkerLauncher-949gA7j-.js} +395 -394
- package/assets/{utxoWorkerLogic-CaRjg9tk.js → utxoWorkerLogic-CWVrduGP.js} +30 -30
- package/assets/{utxoWorkerLogic-CWrzh8Rb.js → utxoWorkerLogic-CyWO48JX.js} +36352 -20473
- package/assets/viteWorkerURL.constant-D9TTkFfm.js +11 -0
- package/assets/{zkProofWorkerLauncher-D1ef-Gxp.js → zkProofWorkerLauncher-B54jpyIs.js} +395 -395
- package/assets/{zkProofWorkerLogic-BwAAGTST.js → zkProofWorkerLogic-g413cUJh.js} +78787 -66386
- package/{index-DVX9ShLf.js → index-CRZ_sTGy.js} +116241 -103711
- package/index.js +57 -57
- package/package.json +1 -1
- package/{snarkjsWorkerLogic-D0EKr8Rb.js → snarkjsWorkerLogic-CJ6jLJrl.js} +863 -815
- package/utxoWorkerLogic-CxyTY-Iw.js +64 -0
- package/viteWorkerURL.constant-gZWY_Fas.js +9 -0
- package/{workerProxy-BDj498Ht.js → workerProxy-DTKGeJe4.js} +4 -3
- package/{zkProofWorkerLogic-BWuMfo-V.js → zkProofWorkerLogic-B9OTFcZv.js} +11 -11
- package/assets/snarkjsWorkerLogic-BAbiO5gj.js +0 -17935
- package/assets/viteWorkerURL.constant-C7fE1hzc.js +0 -11
- package/utxoWorkerLogic-Ck4p7ORl.js +0 -64
- package/viteWorkerURL.constant-Zrb20DQB.js +0 -9
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { W as r } from "./zkProofWorkerLogic-BwAAGTST.js";
|
|
2
|
-
import "./zkProofWorkerLauncher-D1ef-Gxp.js";
|
|
3
|
-
var o = self.location.href, e = "/assets/snarkjsWorkerLauncher-CaBCnle3.js", a = "/assets/utxoWorkerLauncher-TRT6Cdzd.js";
|
|
4
|
-
const t = {
|
|
5
|
-
[r.ZKProof]: o,
|
|
6
|
-
[r.SnarkJS]: e,
|
|
7
|
-
[r.UTXO]: a
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
t as workerViteURL
|
|
11
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { U as p, g as h, h as y, i as f, j as U, l as d, k as g, d as x, m as u } from "./index-DVX9ShLf.js";
|
|
2
|
-
import { W as T } from "./workerProxy-BDj498Ht.js";
|
|
3
|
-
const i = new T(), v = async ({ data: e }) => {
|
|
4
|
-
const { utxos: s, nullifiers: r } = e, o = s.filter((t) => {
|
|
5
|
-
const c = new p(t);
|
|
6
|
-
return !r.has(c.getNullifier());
|
|
7
|
-
});
|
|
8
|
-
i.postMessageToMainThread(o);
|
|
9
|
-
}, k = async ({ data: e }) => {
|
|
10
|
-
const s = new h(e.signature), r = s.getShieldedPrivateKey(), o = e.encryptedOutputs.map((t) => {
|
|
11
|
-
try {
|
|
12
|
-
return t.isPositive ? y(Buffer.from(t.value.slice(2), "hex"), s) : f(t.value, r);
|
|
13
|
-
} catch {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
}).filter((t) => t !== void 0);
|
|
17
|
-
i.postMessageToMainThread(o);
|
|
18
|
-
}, m = async ({ data: e }) => {
|
|
19
|
-
const s = new h(e.signature), r = [], { encryptedOutputs: o } = e;
|
|
20
|
-
let { lastOutput: t } = e;
|
|
21
|
-
for (let c = 0; c < o.length; c += 1) {
|
|
22
|
-
const a = o[c];
|
|
23
|
-
if (t = a.value, a.isPositive)
|
|
24
|
-
try {
|
|
25
|
-
const n = U(Buffer.from(t.slice(2), "hex"), s);
|
|
26
|
-
if (!n.erc20TokenAddress || !n.amount || !n.stealthAddress)
|
|
27
|
-
throw Error("bruh");
|
|
28
|
-
r.map((l) => l.value).includes(a.value) || r.push(a);
|
|
29
|
-
} catch {
|
|
30
|
-
d("Utxo not decrypted");
|
|
31
|
-
}
|
|
32
|
-
else
|
|
33
|
-
try {
|
|
34
|
-
g(t, s.getShieldedPrivateKey()) && (r.map((l) => l.value).includes(a.value) || r.push(a));
|
|
35
|
-
} catch {
|
|
36
|
-
d("Utxo not decoded");
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
i.postMessageToMainThread({ additionalEncryptedOutputs: r, lastOutput: t });
|
|
40
|
-
}, w = async (e) => {
|
|
41
|
-
await x();
|
|
42
|
-
const { type: s } = e.payload;
|
|
43
|
-
switch (s) {
|
|
44
|
-
case u.BATCH_FILTER_UTXOS_WITH_NULLIFIER:
|
|
45
|
-
v(e.payload);
|
|
46
|
-
return;
|
|
47
|
-
case u.BUILD_UTXOS:
|
|
48
|
-
k(e.payload);
|
|
49
|
-
return;
|
|
50
|
-
case u.DECIPHER_OUTPUTS:
|
|
51
|
-
m(e.payload);
|
|
52
|
-
return;
|
|
53
|
-
default:
|
|
54
|
-
throw Error(`Unknown worker message type ${s}`);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
i.attachWorkerSideOnMessage(w);
|
|
58
|
-
export {
|
|
59
|
-
i as default,
|
|
60
|
-
k as handleBuildUtxosMessage,
|
|
61
|
-
m as handleDecipherMessage,
|
|
62
|
-
v as handleFilterUtxosWithNullifier,
|
|
63
|
-
w as onWorkerMessage
|
|
64
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { W as r } from "./index-DVX9ShLf.js";
|
|
2
|
-
const o = "/assets/zkProofWorkerLauncher-D1ef-Gxp.js", s = "/assets/snarkjsWorkerLauncher-CaBCnle3.js", e = "/assets/utxoWorkerLauncher-TRT6Cdzd.js", k = {
|
|
3
|
-
[r.ZKProof]: o,
|
|
4
|
-
[r.SnarkJS]: s,
|
|
5
|
-
[r.UTXO]: e
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
k as workerViteURL
|
|
9
|
-
};
|