h_test_1 0.0.23 → 0.0.24

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../functions/web3/etherFunctions.cjs"),c=require("../../crypto/poseidon.cjs"),i=require("./MerkleTree.cjs"),u=(r,n,o,t)=>{if(!t||o){const e=i.MerkleTree.create(c.poseidonFunction,0n);return e.insert(BigInt(n),e.getStartIndex()),t||e.insert(s.randomBigInt(31),e.getStartIndex()+1n),e}return r};exports.getPatchedAccessTokenMerkleTree=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../functions/web3/etherFunctions.cjs"),s=require("../../crypto/poseidon.cjs"),l=require("./MerkleTree.cjs"),g=(n,o,r,t)=>{if(console.log("getPatchedAccessTokenMerkleTree a1",{merkleTreeAccessToken:n,accessKey:o,patchAccessTokenMerkleTree:r,kycRequired:t}),!t||r){const e=l.MerkleTree.create(s.poseidonFunction,0n);return console.log("getPatchedAccessTokenMerkleTree a2",{tree:e}),e.insert(BigInt(o),e.getStartIndex()),t||(e.insert(c.randomBigInt(31),e.getStartIndex()+1n),console.log("getPatchedAccessTokenMerkleTree a3",{tree:e})),console.log("getPatchedAccessTokenMerkleTree a4",{tree:e}),e}return n};exports.getPatchedAccessTokenMerkleTree=g;
@@ -1,13 +1,18 @@
1
- import { randomBigInt as i } from "../../functions/web3/etherFunctions.mjs";
2
- import { poseidonFunction as m } from "../../crypto/poseidon.mjs";
1
+ import { randomBigInt as c } from "../../functions/web3/etherFunctions.mjs";
2
+ import { poseidonFunction as g } from "../../crypto/poseidon.mjs";
3
3
  import { MerkleTree as s } from "./MerkleTree.mjs";
4
- const g = (r, n, o, t) => {
5
- if (!t || o) {
6
- const e = s.create(m, 0n);
7
- return e.insert(BigInt(n), e.getStartIndex()), t || e.insert(i(31), e.getStartIndex() + 1n), e;
4
+ const d = (o, r, n, t) => {
5
+ if (console.log("getPatchedAccessTokenMerkleTree a1", {
6
+ merkleTreeAccessToken: o,
7
+ accessKey: r,
8
+ patchAccessTokenMerkleTree: n,
9
+ kycRequired: t
10
+ }), !t || n) {
11
+ const e = s.create(g, 0n);
12
+ return console.log("getPatchedAccessTokenMerkleTree a2", { tree: e }), e.insert(BigInt(r), e.getStartIndex()), t || (e.insert(c(31), e.getStartIndex() + 1n), console.log("getPatchedAccessTokenMerkleTree a3", { tree: e })), console.log("getPatchedAccessTokenMerkleTree a4", { tree: e }), e;
8
13
  }
9
- return r;
14
+ return o;
10
15
  };
11
16
  export {
12
- g as getPatchedAccessTokenMerkleTree
17
+ d as getPatchedAccessTokenMerkleTree
13
18
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("../../data-structures/merkle-tree/MerkleTree.cjs"),A=require("../../data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs"),S=require("../../webworker/performTaskWithWorker.cjs"),m=require("../../webworker/worker.registry.cjs"),h=require("../../webworker/zkProofWorker/zkProofWorker.types.cjs"),u=require("./fetchMerkleTreeSiblings.cjs"),H=require("../utils/amounts.utils.cjs"),P=require("../../crypto/poseidon.cjs"),C=require("../../constants/vite.constants.cjs"),R=require("./fetchOnChainRootHashes.cjs"),p=async(e,a)=>{const o=e.getRootHash();if(console.log("pre calculate access token siblings and root hash",{rootHash:o,patchedMerkleTree:e}),o===void 0)throw new Error("Root hash not available from patched merkle tree");const s=await S.performTaskWithWorker({type:m.WorkerVariant.ZKProof,payload:{type:h.ZKProofWorkerActionType.CALC_ACCESS_TOKEN_SIBLING_AND_SIDES,data:{accessKey:a,merkleTreeAccessTokenSerialized:e.toJSON()}}});return{accessTokenSiblings:s.accessTokenSiblings,accessTokenSiblingSides:s.accessTokenSiblingSides,rootHashAccessToken:o}},_=async(e,a,o,s,i,n)=>{console.log("hinkalDeposit sa5");const r=o.getAccessKey();console.log("hinkalDeposit sa6",{accessKey:r});const t=A.getPatchedAccessTokenMerkleTree(a,r,i,n),g=e.getRootHash();if(g===void 0)throw new Error("Root hash not available from hinkal merkle tree");let l,c;return C.isNode?(l=await p(t,r),c=await S.performTaskWithWorker({type:m.WorkerVariant.ZKProof,payload:{type:h.ZKProofWorkerActionType.CALC_COMMITMENTS_SIBLING_AND_SIDES,data:{inputUtxosSerialized:s,merkleTreeSerialized:e.toJSON()}}})):[l,c]=await Promise.all([p(t,r),S.performTaskWithWorker({type:m.WorkerVariant.ZKProof,payload:{type:h.ZKProofWorkerActionType.CALC_COMMITMENTS_SIBLING_AND_SIDES,data:{inputUtxosSerialized:s,merkleTreeSerialized:e.toJSON()}}})]),{inCommitmentSiblings:c.inCommitmentSiblings,inCommitmentSiblingSides:c.inCommitmentSiblingSides,accessTokenSiblings:l.accessTokenSiblings,accessTokenSiblingSides:l.accessTokenSiblingSides,rootHashHinkal:g,rootHashAccessToken:l.rootHashAccessToken}},N=async(e,a,o,s,i)=>{console.log("hinkalDeposit sa3");const n=a.getAccessKey();if(console.log("hinkalDeposit sa4",{accessKey:n}),!i||s){const g=W.MerkleTree.create(P.poseidonFunction,0n),l=A.getPatchedAccessTokenMerkleTree(g,n,s,i);console.log("pre calculating access token siblings and root hash",{accessKey:n});const[c,k]=await Promise.all([p(l,n),u.fetchMerkleTreeSiblings(e,o,n)]);return console.log("post calculating access token siblings and root hash",{accessTokenResult:c,siblingsResponse:k}),{inCommitmentSiblings:k.inCommitmentSiblings,inCommitmentSiblingSides:k.inCommitmentSiblingSides,accessTokenSiblings:c.accessTokenSiblings,accessTokenSiblingSides:c.accessTokenSiblingSides,rootHashHinkal:H.toBigInt(k.rootHashHinkal),rootHashAccessToken:c.rootHashAccessToken}}const t=await u.fetchMerkleTreeSiblings(e,o,n);return{inCommitmentSiblings:t.inCommitmentSiblings,inCommitmentSiblingSides:t.inCommitmentSiblingSides,accessTokenSiblings:t.accessTokenSiblings,accessTokenSiblingSides:t.accessTokenSiblingSides,rootHashHinkal:H.toBigInt(t.rootHashHinkal),rootHashAccessToken:H.toBigInt(t.rootHashAccessToken)}},I=async(e,a,o)=>{if(!a||!o)return!1;try{const s=a.getRootHash(),i=o.getRootHash();if(!s||!i)return!1;const{hinkalRootHash:n,accessTokenRootHash:r}=await R.fetchOnChainRootHashes(e);return s===n&&i===r}catch{return!1}},y=async(e,a,o,s,i,n,r)=>{const t=await I(e,n,r);return console.log("hinkalDeposit sa2",{isLocalFresh:t}),t?_(n,r,a,o,s,i):N(e,a,o,s,i)},M=async(e,a,o,s,i,n,r,t,g)=>{if(C.isNode){const{inCommitmentSiblings:l,inCommitmentSiblingSides:c,accessTokenSiblings:k,accessTokenSiblingSides:T,rootHashHinkal:b,rootHashAccessToken:d}=await y(e,s,i,n,r,a,o),f=await S.performTaskWithWorker({type:m.WorkerVariant.ZKProof,payload:{type:h.ZKProofWorkerActionType.BUILD_IN_NULLIFIERS,data:{inputUtxosSerialized:i,onChainCreation:t,proverVersion:g}}});return{inCommitmentSiblings:l,inCommitmentSiblingSides:c,accessTokenSiblings:k,accessTokenSiblingSides:T,rootHashHinkal:b,rootHashAccessToken:d,inNullifiers:f}}else{const[{inCommitmentSiblings:l,inCommitmentSiblingSides:c,accessTokenSiblings:k,accessTokenSiblingSides:T,rootHashHinkal:b,rootHashAccessToken:d},f]=await Promise.all([y(e,s,i,n,r,a,o),S.performTaskWithWorker({type:m.WorkerVariant.ZKProof,payload:{type:h.ZKProofWorkerActionType.BUILD_IN_NULLIFIERS,data:{inputUtxosSerialized:i,onChainCreation:t,proverVersion:g}}})]);return{inCommitmentSiblings:l,inCommitmentSiblingSides:c,accessTokenSiblings:k,accessTokenSiblingSides:T,rootHashHinkal:b,rootHashAccessToken:d,inNullifiers:f}}};exports.getDataFromWorkers=M;exports.getMerkleTreeSiblingsAndRootHashes=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("../../data-structures/merkle-tree/MerkleTree.cjs"),A=require("../../data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs"),S=require("../../webworker/performTaskWithWorker.cjs"),m=require("../../webworker/worker.registry.cjs"),h=require("../../webworker/zkProofWorker/zkProofWorker.types.cjs"),u=require("./fetchMerkleTreeSiblings.cjs"),H=require("../utils/amounts.utils.cjs"),R=require("../../crypto/poseidon.cjs"),C=require("../../constants/vite.constants.cjs"),_=require("./fetchOnChainRootHashes.cjs"),p=async(e,r)=>{const o=e.getRootHash();if(console.log("pre calculate access token siblings and root hash",{rootHash:o,patchedMerkleTree:e}),o===void 0)throw new Error("Root hash not available from patched merkle tree");const s=await S.performTaskWithWorker({type:m.WorkerVariant.ZKProof,payload:{type:h.ZKProofWorkerActionType.CALC_ACCESS_TOKEN_SIBLING_AND_SIDES,data:{accessKey:r,merkleTreeAccessTokenSerialized:e.toJSON()}}});return{accessTokenSiblings:s.accessTokenSiblings,accessTokenSiblingSides:s.accessTokenSiblingSides,rootHashAccessToken:o}},N=async(e,r,o,s,i,n)=>{console.log("hinkalDeposit sa5");const t=o.getAccessKey();console.log("hinkalDeposit sa6",{accessKey:t});const a=A.getPatchedAccessTokenMerkleTree(r,t,i,n),k=e.getRootHash();if(k===void 0)throw new Error("Root hash not available from hinkal merkle tree");let l,c;return C.isNode?(l=await p(a,t),c=await S.performTaskWithWorker({type:m.WorkerVariant.ZKProof,payload:{type:h.ZKProofWorkerActionType.CALC_COMMITMENTS_SIBLING_AND_SIDES,data:{inputUtxosSerialized:s,merkleTreeSerialized:e.toJSON()}}})):[l,c]=await Promise.all([p(a,t),S.performTaskWithWorker({type:m.WorkerVariant.ZKProof,payload:{type:h.ZKProofWorkerActionType.CALC_COMMITMENTS_SIBLING_AND_SIDES,data:{inputUtxosSerialized:s,merkleTreeSerialized:e.toJSON()}}})]),{inCommitmentSiblings:c.inCommitmentSiblings,inCommitmentSiblingSides:c.inCommitmentSiblingSides,accessTokenSiblings:l.accessTokenSiblings,accessTokenSiblingSides:l.accessTokenSiblingSides,rootHashHinkal:k,rootHashAccessToken:l.rootHashAccessToken}},P=async(e,r,o,s,i)=>{console.log("hinkalDeposit sa3");const n=r.getAccessKey();console.log("hinkalDeposit sa4",{accessKey:n});const t=!i||s;if(console.log("ba4",{needsPatching:t}),t){console.log("ba5");const k=W.MerkleTree.create(R.poseidonFunction,0n);console.log("ba6",{emptyMerkleTreeAccessToken:k});const l=A.getPatchedAccessTokenMerkleTree(k,n,s,i);console.log("pre calculating access token siblings and root hash",{accessKey:n});const[c,g]=await Promise.all([p(l,n),u.fetchMerkleTreeSiblings(e,o,n)]);return console.log("post calculating access token siblings and root hash",{accessTokenResult:c,siblingsResponse:g}),{inCommitmentSiblings:g.inCommitmentSiblings,inCommitmentSiblingSides:g.inCommitmentSiblingSides,accessTokenSiblings:c.accessTokenSiblings,accessTokenSiblingSides:c.accessTokenSiblingSides,rootHashHinkal:H.toBigInt(g.rootHashHinkal),rootHashAccessToken:c.rootHashAccessToken}}console.log("kaksk",{chainId:e,inputUtxosSerialized:o,accessKey:n});const a=await u.fetchMerkleTreeSiblings(e,o,n);return{inCommitmentSiblings:a.inCommitmentSiblings,inCommitmentSiblingSides:a.inCommitmentSiblingSides,accessTokenSiblings:a.accessTokenSiblings,accessTokenSiblingSides:a.accessTokenSiblingSides,rootHashHinkal:H.toBigInt(a.rootHashHinkal),rootHashAccessToken:H.toBigInt(a.rootHashAccessToken)}},I=async(e,r,o)=>{if(!r||!o)return!1;try{const s=r.getRootHash(),i=o.getRootHash();if(!s||!i)return!1;const{hinkalRootHash:n,accessTokenRootHash:t}=await _.fetchOnChainRootHashes(e);return s===n&&i===t}catch{return!1}},y=async(e,r,o,s,i,n,t)=>{const a=await I(e,n,t);return console.log("hinkalDeposit sa2",{isLocalFresh:a}),a?N(n,t,r,o,s,i):P(e,r,o,s,i)},M=async(e,r,o,s,i,n,t,a,k)=>{if(C.isNode){const{inCommitmentSiblings:l,inCommitmentSiblingSides:c,accessTokenSiblings:g,accessTokenSiblingSides:T,rootHashHinkal:b,rootHashAccessToken:d}=await y(e,s,i,n,t,r,o),f=await S.performTaskWithWorker({type:m.WorkerVariant.ZKProof,payload:{type:h.ZKProofWorkerActionType.BUILD_IN_NULLIFIERS,data:{inputUtxosSerialized:i,onChainCreation:a,proverVersion:k}}});return{inCommitmentSiblings:l,inCommitmentSiblingSides:c,accessTokenSiblings:g,accessTokenSiblingSides:T,rootHashHinkal:b,rootHashAccessToken:d,inNullifiers:f}}else{const[{inCommitmentSiblings:l,inCommitmentSiblingSides:c,accessTokenSiblings:g,accessTokenSiblingSides:T,rootHashHinkal:b,rootHashAccessToken:d},f]=await Promise.all([y(e,s,i,n,t,r,o),S.performTaskWithWorker({type:m.WorkerVariant.ZKProof,payload:{type:h.ZKProofWorkerActionType.BUILD_IN_NULLIFIERS,data:{inputUtxosSerialized:i,onChainCreation:a,proverVersion:k}}})]);return{inCommitmentSiblings:l,inCommitmentSiblingSides:c,accessTokenSiblings:g,accessTokenSiblingSides:T,rootHashHinkal:b,rootHashAccessToken:d,inNullifiers:f}}};exports.getDataFromWorkers=M;exports.getMerkleTreeSiblingsAndRootHashes=y;
@@ -2,22 +2,22 @@ import { MerkleTree as R } from "../../data-structures/merkle-tree/MerkleTree.mj
2
2
  import { getPatchedAccessTokenMerkleTree as A } from "../../data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs";
3
3
  import { performTaskWithWorker as g } from "../../webworker/performTaskWithWorker.mjs";
4
4
  import { WorkerVariant as k } from "../../webworker/worker.registry.mjs";
5
- import { ZKProofWorkerActionType as h } from "../../webworker/zkProofWorker/zkProofWorker.types.mjs";
5
+ import { ZKProofWorkerActionType as b } from "../../webworker/zkProofWorker/zkProofWorker.types.mjs";
6
6
  import { fetchMerkleTreeSiblings as C } from "./fetchMerkleTreeSiblings.mjs";
7
- import { toBigInt as H } from "../utils/amounts.utils.mjs";
8
- import { poseidonFunction as I } from "../../crypto/poseidon.mjs";
7
+ import { toBigInt as p } from "../utils/amounts.utils.mjs";
8
+ import { poseidonFunction as _ } from "../../crypto/poseidon.mjs";
9
9
  import { isNode as N } from "../../constants/vite.constants.mjs";
10
- import { fetchOnChainRootHashes as _ } from "./fetchOnChainRootHashes.mjs";
11
- const p = async (o, a) => {
10
+ import { fetchOnChainRootHashes as I } from "./fetchOnChainRootHashes.mjs";
11
+ const d = async (o, c) => {
12
12
  const s = o.getRootHash();
13
13
  if (console.log("pre calculate access token siblings and root hash", { rootHash: s, patchedMerkleTree: o }), s === void 0)
14
14
  throw new Error("Root hash not available from patched merkle tree");
15
15
  const e = await g({
16
16
  type: k.ZKProof,
17
17
  payload: {
18
- type: h.CALC_ACCESS_TOKEN_SIBLING_AND_SIDES,
18
+ type: b.CALC_ACCESS_TOKEN_SIBLING_AND_SIDES,
19
19
  data: {
20
- accessKey: a,
20
+ accessKey: c,
21
21
  merkleTreeAccessTokenSerialized: o.toJSON()
22
22
  }
23
23
  }
@@ -27,31 +27,31 @@ const p = async (o, a) => {
27
27
  accessTokenSiblingSides: e.accessTokenSiblingSides,
28
28
  rootHashAccessToken: s
29
29
  };
30
- }, w = async (o, a, s, e, n, i) => {
30
+ }, w = async (o, c, s, e, i, n) => {
31
31
  console.log("hinkalDeposit sa5");
32
- const c = s.getAccessKey();
33
- console.log("hinkalDeposit sa6", { accessKey: c });
34
- const t = A(
35
- a,
32
+ const t = s.getAccessKey();
33
+ console.log("hinkalDeposit sa6", { accessKey: t });
34
+ const a = A(
36
35
  c,
37
- n,
38
- i
39
- ), S = o.getRootHash();
40
- if (S === void 0)
36
+ t,
37
+ i,
38
+ n
39
+ ), m = o.getRootHash();
40
+ if (m === void 0)
41
41
  throw new Error("Root hash not available from hinkal merkle tree");
42
42
  let r, l;
43
- return N ? (r = await p(t, c), l = await g({
43
+ return N ? (r = await d(a, t), l = await g({
44
44
  type: k.ZKProof,
45
45
  payload: {
46
- type: h.CALC_COMMITMENTS_SIBLING_AND_SIDES,
46
+ type: b.CALC_COMMITMENTS_SIBLING_AND_SIDES,
47
47
  data: { inputUtxosSerialized: e, merkleTreeSerialized: o.toJSON() }
48
48
  }
49
49
  })) : [r, l] = await Promise.all([
50
- p(t, c),
50
+ d(a, t),
51
51
  g({
52
52
  type: k.ZKProof,
53
53
  payload: {
54
- type: h.CALC_COMMITMENTS_SIBLING_AND_SIDES,
54
+ type: b.CALC_COMMITMENTS_SIBLING_AND_SIDES,
55
55
  data: { inputUtxosSerialized: e, merkleTreeSerialized: o.toJSON() }
56
56
  }
57
57
  })
@@ -60,134 +60,140 @@ const p = async (o, a) => {
60
60
  inCommitmentSiblingSides: l.inCommitmentSiblingSides,
61
61
  accessTokenSiblings: r.accessTokenSiblings,
62
62
  accessTokenSiblingSides: r.accessTokenSiblingSides,
63
- rootHashHinkal: S,
63
+ rootHashHinkal: m,
64
64
  rootHashAccessToken: r.rootHashAccessToken
65
65
  };
66
- }, D = async (o, a, s, e, n) => {
66
+ }, D = async (o, c, s, e, i) => {
67
67
  console.log("hinkalDeposit sa3");
68
- const i = a.getAccessKey();
69
- if (console.log("hinkalDeposit sa4", { accessKey: i }), !n || e) {
70
- const S = R.create(I, 0n), r = A(
71
- S,
72
- i,
68
+ const n = c.getAccessKey();
69
+ console.log("hinkalDeposit sa4", { accessKey: n });
70
+ const t = !i || e;
71
+ if (console.log("ba4", { needsPatching: t }), t) {
72
+ console.log("ba5");
73
+ const m = R.create(_, 0n);
74
+ console.log("ba6", { emptyMerkleTreeAccessToken: m });
75
+ const r = A(
76
+ m,
77
+ n,
73
78
  e,
74
- n
79
+ i
75
80
  );
76
- console.log("pre calculating access token siblings and root hash", { accessKey: i });
77
- const [l, m] = await Promise.all([
78
- p(r, i),
79
- C(o, s, i)
81
+ console.log("pre calculating access token siblings and root hash", { accessKey: n });
82
+ const [l, S] = await Promise.all([
83
+ d(r, n),
84
+ C(o, s, n)
80
85
  ]);
81
- return console.log("post calculating access token siblings and root hash", { accessTokenResult: l, siblingsResponse: m }), {
82
- inCommitmentSiblings: m.inCommitmentSiblings,
83
- inCommitmentSiblingSides: m.inCommitmentSiblingSides,
86
+ return console.log("post calculating access token siblings and root hash", { accessTokenResult: l, siblingsResponse: S }), {
87
+ inCommitmentSiblings: S.inCommitmentSiblings,
88
+ inCommitmentSiblingSides: S.inCommitmentSiblingSides,
84
89
  accessTokenSiblings: l.accessTokenSiblings,
85
90
  accessTokenSiblingSides: l.accessTokenSiblingSides,
86
- rootHashHinkal: H(m.rootHashHinkal),
91
+ rootHashHinkal: p(S.rootHashHinkal),
87
92
  rootHashAccessToken: l.rootHashAccessToken
88
93
  };
89
94
  }
90
- const t = await C(o, s, i);
95
+ console.log("kaksk", { chainId: o, inputUtxosSerialized: s, accessKey: n });
96
+ const a = await C(o, s, n);
91
97
  return {
92
- inCommitmentSiblings: t.inCommitmentSiblings,
93
- inCommitmentSiblingSides: t.inCommitmentSiblingSides,
94
- accessTokenSiblings: t.accessTokenSiblings,
95
- accessTokenSiblingSides: t.accessTokenSiblingSides,
96
- rootHashHinkal: H(t.rootHashHinkal),
97
- rootHashAccessToken: H(t.rootHashAccessToken)
98
+ inCommitmentSiblings: a.inCommitmentSiblings,
99
+ inCommitmentSiblingSides: a.inCommitmentSiblingSides,
100
+ accessTokenSiblings: a.accessTokenSiblings,
101
+ accessTokenSiblingSides: a.accessTokenSiblingSides,
102
+ rootHashHinkal: p(a.rootHashHinkal),
103
+ rootHashAccessToken: p(a.rootHashAccessToken)
98
104
  };
99
- }, L = async (o, a, s) => {
100
- if (!a || !s)
105
+ }, L = async (o, c, s) => {
106
+ if (!c || !s)
101
107
  return !1;
102
108
  try {
103
- const e = a.getRootHash(), n = s.getRootHash();
104
- if (!e || !n)
109
+ const e = c.getRootHash(), i = s.getRootHash();
110
+ if (!e || !i)
105
111
  return !1;
106
- const { hinkalRootHash: i, accessTokenRootHash: c } = await _(o);
107
- return e === i && n === c;
112
+ const { hinkalRootHash: n, accessTokenRootHash: t } = await I(o);
113
+ return e === n && i === t;
108
114
  } catch {
109
115
  return !1;
110
116
  }
111
- }, y = async (o, a, s, e, n, i, c) => {
112
- const t = await L(o, i, c);
113
- return console.log("hinkalDeposit sa2", { isLocalFresh: t }), t ? w(
114
- i,
117
+ }, y = async (o, c, s, e, i, n, t) => {
118
+ const a = await L(o, n, t);
119
+ return console.log("hinkalDeposit sa2", { isLocalFresh: a }), a ? w(
120
+ n,
121
+ t,
115
122
  c,
116
- a,
117
123
  s,
118
124
  e,
119
- n
120
- ) : D(o, a, s, e, n);
121
- }, v = async (o, a, s, e, n, i, c, t, S) => {
125
+ i
126
+ ) : D(o, c, s, e, i);
127
+ }, v = async (o, c, s, e, i, n, t, a, m) => {
122
128
  if (N) {
123
129
  const {
124
130
  inCommitmentSiblings: r,
125
131
  inCommitmentSiblingSides: l,
126
- accessTokenSiblings: m,
127
- accessTokenSiblingSides: b,
132
+ accessTokenSiblings: S,
133
+ accessTokenSiblingSides: h,
128
134
  rootHashHinkal: T,
129
- rootHashAccessToken: d
135
+ rootHashAccessToken: f
130
136
  } = await y(
131
137
  o,
132
138
  e,
133
- n,
134
139
  i,
140
+ n,
141
+ t,
135
142
  c,
136
- a,
137
143
  s
138
- ), f = await g({
144
+ ), H = await g({
139
145
  type: k.ZKProof,
140
146
  payload: {
141
- type: h.BUILD_IN_NULLIFIERS,
142
- data: { inputUtxosSerialized: n, onChainCreation: t, proverVersion: S }
147
+ type: b.BUILD_IN_NULLIFIERS,
148
+ data: { inputUtxosSerialized: i, onChainCreation: a, proverVersion: m }
143
149
  }
144
150
  });
145
151
  return {
146
152
  inCommitmentSiblings: r,
147
153
  inCommitmentSiblingSides: l,
148
- accessTokenSiblings: m,
149
- accessTokenSiblingSides: b,
154
+ accessTokenSiblings: S,
155
+ accessTokenSiblingSides: h,
150
156
  rootHashHinkal: T,
151
- rootHashAccessToken: d,
152
- inNullifiers: f
157
+ rootHashAccessToken: f,
158
+ inNullifiers: H
153
159
  };
154
160
  } else {
155
161
  const [
156
162
  {
157
163
  inCommitmentSiblings: r,
158
164
  inCommitmentSiblingSides: l,
159
- accessTokenSiblings: m,
160
- accessTokenSiblingSides: b,
165
+ accessTokenSiblings: S,
166
+ accessTokenSiblingSides: h,
161
167
  rootHashHinkal: T,
162
- rootHashAccessToken: d
168
+ rootHashAccessToken: f
163
169
  },
164
- f
170
+ H
165
171
  ] = await Promise.all([
166
172
  y(
167
173
  o,
168
174
  e,
169
- n,
170
175
  i,
176
+ n,
177
+ t,
171
178
  c,
172
- a,
173
179
  s
174
180
  ),
175
181
  g({
176
182
  type: k.ZKProof,
177
183
  payload: {
178
- type: h.BUILD_IN_NULLIFIERS,
179
- data: { inputUtxosSerialized: n, onChainCreation: t, proverVersion: S }
184
+ type: b.BUILD_IN_NULLIFIERS,
185
+ data: { inputUtxosSerialized: i, onChainCreation: a, proverVersion: m }
180
186
  }
181
187
  })
182
188
  ]);
183
189
  return {
184
190
  inCommitmentSiblings: r,
185
191
  inCommitmentSiblingSides: l,
186
- accessTokenSiblings: m,
187
- accessTokenSiblingSides: b,
192
+ accessTokenSiblings: S,
193
+ accessTokenSiblingSides: h,
188
194
  rootHashHinkal: T,
189
- rootHashAccessToken: d,
190
- inNullifiers: f
195
+ rootHashAccessToken: f,
196
+ inNullifiers: H
191
197
  };
192
198
  }
193
199
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "h_test_1",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "homepage": "hinkal.io",
5
5
  "author": {
6
6
  "name": "Hinkal Protocol"