@hinkal/common 0.0.21 → 0.0.23

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.
@@ -1,5 +1,5 @@
1
- import { p as Se, B as po } from "./zkProofWorkerLauncher-CkAXJL76.js";
2
- import { e as Ua, r as ho, g as Lo, a as mo, b as bo, c as en, d as ja, f as $a, u as zn, h as yo } from "./zkProofWorkerLogic-DO1mhw9j.js";
1
+ import { p as Se, B as po } from "./zkProofWorkerLauncher-D8OXlf5e.js";
2
+ import { e as Ua, r as ho, g as Lo, a as mo, b as bo, c as en, d as ja, f as $a, u as zn, h as yo } from "./zkProofWorkerLogic-Ch0jn4N_.js";
3
3
  const Co = [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4];
4
4
  function sn(c, t) {
5
5
  if (!t || t == 10)
@@ -15655,6 +15655,7 @@ const al = typeof Se < "u" && Se.versions != null && Se.versions.node != null, v
15655
15655
  // @ts-expect-error webpack check is done like this
15656
15656
  typeof __webpack_require__ < "u"
15657
15657
  ), Vi = new yo(), il = async (c) => {
15658
+ console.log("onWorkerMessage snark starts");
15658
15659
  const { input: t, wasmFilePath: e, zKeyFilePath: n, chainId: a } = c.payload.data, {
15659
15660
  hostLocation: { origin: s },
15660
15661
  constants: {
@@ -1192,8 +1192,9 @@ const It = /* @__PURE__ */ dt(mt), Ft = () => {
1192
1192
  };
1193
1193
  globalThis.process = It;
1194
1194
  globalThis.Buffer = gr;
1195
- const Tt = import("./snarkjsWorkerLogic-C0jhwQeU.js");
1195
+ const Tt = import("./utxoWorkerLogic-DxfPxQs8.js");
1196
1196
  addEventListener("message", async (h) => {
1197
+ console.log("addEventListener in Utxo Launcher starts");
1197
1198
  const { onWorkerMessage: f } = await Tt;
1198
1199
  f(h.data);
1199
1200
  });
@@ -1,5 +1,5 @@
1
- import { B as U } from "./zkProofWorkerLauncher-CkAXJL76.js";
2
- import { U as l, i as T, h as I, j as f, k as y, l as m, m as h, p as S } from "./zkProofWorkerLogic-DO1mhw9j.js";
1
+ import { B as U } from "./zkProofWorkerLauncher-D8OXlf5e.js";
2
+ import { U as l, i as T, h as I, j as f, k as y, l as m, m as h, p as x } from "./zkProofWorkerLogic-Ch0jn4N_.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
- }, _ = (e, t) => {
18
+ }, S = (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,7 +25,7 @@ const g = (e) => {
25
25
  randomization: a,
26
26
  shieldedPrivateKey: t
27
27
  };
28
- }, x = (e, t) => {
28
+ }, _ = (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");
@@ -41,7 +41,7 @@ const u = new I(), E = async ({ data: e }) => {
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) : _(s.value, o);
44
+ return s.isPositive ? y(U.from(s.value.slice(2), "hex"), t) : S(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
- x(s, t.getShieldedPrivateKey()) && (o.map((c) => c.value).includes(a.value) || o.push(a));
66
+ _(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
- console.log("onWorkerMessage starts"), await S();
73
+ console.log("onWorkerMessage Utxo starts"), await x();
74
74
  const { type: t } = e.payload;
75
75
  switch (t) {
76
76
  case d.BATCH_FILTER_UTXOS_WITH_NULLIFIER: