h_test_1 0.0.1 → 0.0.2

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 R=require("../../../data-structures/utxo/Utxo.cjs"),k=require("../../utils/upToDateState.cjs"),O=require("../../utils/cacheFunctions.cjs"),K=require("../../utils/caseInsensitive.utils.cjs"),P=require("../../utils/encodeTokenWithId.cjs"),M=require("./getInputUtxosEnclave.cjs"),F=require("../../../error-handling/logger.cjs"),H=require("../../utils/solanaMint.utils.cjs"),_=require("../../../constants/chains.constants.cjs"),j=require("../../utils/addresses.cjs"),G=require("../../../API/scheduled-transactions-calls.cjs"),b=async(t,o,e,n,c,r,u,a,s)=>{s+=1;const l=r.slice(s),{lastOutput:w,additionalEncryptedOutputs:f}=await t.utxoUtils.batchProcess(l,a,o,e),i=[...u,...f];return await k.checkChainOrAddressNotUpdated(t,e,n),O.setHinkalCache({lastOutput:w,encryptedOutputs:i},t,e,c),await t.utxoUtils.buildBatchProcess(i,o,e)},q=async(t,o,e,n)=>{const{utxos:c,encryptedOutputs:r,lastOutput:u}=await M.getInputUtxosEnclave(t,e,o);return O.setHinkalCache({encryptedOutputs:r,lastOutput:u},t,e,n),c},S=async(t,o,e,n,c,r,u,a,s)=>{try{return await q(t,o,e,c)}catch{return b(t,o,e,n,c,r,u,a,s)}},D=t=>{if(Array.isArray(t))return t;if(t!==void 0)return[t]},J=async(t,o,e)=>await t.utxoUtils.batchFilterUtxosWithNullifier(o,e),W=(t,o,e,n,c,r,u)=>{for(t.sort((a,s)=>a.amount<=s.amount?1:-1),console.log("sorted utxos");t.length<o||t.length>o&&t.length<6;)if(console.log("before pushing"),console.log("aaa",c,u,n,r),t.push(new R.Utxo({amount:0n,erc20TokenAddress:c,mintAddress:u,shieldedPrivateKey:n,tokenId:r,enableLogs:!0})),console.log("after pushing"),e)for(;t.length>6;)t.splice(t.length-1);console.log("completed sorting utxos")},C=async({hinkal:t,chainId:o=void 0,passedShieldedPublicKey:e=void 0,ethAddress:n=void 0,resetCacheBefore:c=!1,allowRemoteDecryption:r=!1,useBlockedUtxos:u=!1})=>{if(!t.getCurrentChainId||!t.getSelectedNetwork())return F.Logger.log("returning empty balance"),{inputUtxos:[]};const a=n??await t.getEthereumAddress(),s=o??t.getCurrentChainId(),l=e??t.userKeys.getShieldedPublicKey(),{encryptedOutputs:w,nullifiers:f,userKeys:i}=t,g=Array.from(w);console.log("getInputUtxoAndBalance 1"),c&&O.resetCache(t,s,l);let{encryptedOutputs:h,lastOutput:x}=O.getHinkalCache(t,s,l);console.log("getInputUtxoAndBalance 2"),await k.checkChainOrAddressNotUpdated(t,s,a),console.log("getInputUtxoAndBalance 3");const p=x!=="",d=g.findIndex(m=>m.value===x);console.log("getInputUtxoAndBalance 4");const y=d>-1,T=!p&&d===-1;console.log("getInputUtxoAndBalance 5");const I=t.areMerkleTreeUpdatesDisabled();console.log("getInputUtxoAndBalance 6");const v=!I&&(y||!r&&T),B=!I&&r&&T,U=!v&&!B;let A=[];v?A=await b(t,i,s,a,l,g,h,x,d):B?A=await S(t,i,s,a,l,g,h,x,d):U&&(A=await t.utxoUtils.buildBatchProcess(h,i,s)),console.log("getInputUtxoAndBalance 7"),await k.checkChainOrAddressNotUpdated(t,s,a);const E=await J(t,A,f);console.log("getInputUtxoAndBalance 8");const L=u?E:E.filter(m=>!m.isBlocked);return console.log("getInputUtxoAndBalance 9"),console.trace(),{inputUtxos:L}},N=async({hinkal:t,chainId:o=void 0,passedShieldedPublicKey:e=void 0,ethAddress:n=void 0,resetCacheBefore:c=!1,allowRemoteDecryption:r=!1})=>{const u=o??t.getCurrentChainId(),a=n??await t.getEthereumAddress(),s=j.hashEthereumAddress(a),{inputUtxos:l}=await C({hinkal:t,chainId:u,passedShieldedPublicKey:e,ethAddress:a,resetCacheBefore:c,allowRemoteDecryption:r,useBlockedUtxos:!0});if(!l.length)return{inputUtxos:[]};const w=l.map(g=>g.getNullifier()),{indexes:f}=await G.getScheduledTransactionsNullifierIndexes(u,{hashedEthereumAddress:s,nullifiers:w});return{inputUtxos:f.map(g=>l[g]).filter(g=>!!g)}},z=async({hinkal:t,tokenWithId:o,minInput:e=2,sliceIfMore6:n=!0,chainId:c=void 0,passedShieldedPrivateKey:r=void 0,passedShieldedPublicKey:u=void 0,ethAddress:a=void 0,resetCacheBefore:s=!1,ensuredTokensWithId:l,useBlockedUtxos:w=!1})=>{const f=r??t.userKeys.getShieldedPrivateKey(),i=c??t.getCurrentChainId();console.log("getInputUtxoAndBalancePerToken 1");const{inputUtxos:g}=w?await N({hinkal:t,chainId:c,ethAddress:a,passedShieldedPrivateKey:r,resetCacheBefore:s}):await C({hinkal:t,tokenWithId:o,minInput:e,sliceIfMore6:n,chainId:c,passedShieldedPrivateKey:r,passedShieldedPublicKey:u,ethAddress:a,resetCacheBefore:s});console.log("getInputUtxoAndBalancePerToken 2");const h=D(o),x=new Map;console.log("getInputUtxoAndBalancePerToken 3"),g.forEach(p=>{const d=p.getTokenAddress(i);if(h&&!h.some(I=>K.caseInsensitiveEqual(I.erc20TokenAddress,d)&&I.tokenId===p.tokenId))return;const y=P.encodeTokenWithId(i,{erc20TokenAddress:d,tokenId:p.tokenId}),T=x.get(y)??[];x.set(y,[...T,p])}),console.log("getInputUtxoAndBalancePerToken 4"),l?.forEach(p=>{const d=P.encodeTokenWithId(i,{erc20TokenAddress:p.erc20TokenAddress,tokenId:p.tokenId});x.set(d,x.get(d)??[])}),console.log("getInputUtxoAndBalancePerToken 5");for(const[p,d]of x){const y=p.split("-")[0],T=Number(p.split("-")[1]),I=_.isSolanaLike(i),v=I?y:void 0,B=I?H.formatMintAddress(y).compressedAddress.toLowerCase():y.toLowerCase(),U=A=>A===null?"null":typeof A!="object"?typeof A:A.constructor.name;console.log("types",JSON.stringify({value:U(d),minInput:U(e),sliceIfMore6:U(n),shieldedPrivateKey:U(f),modifiedErc20TokenAddress:U(B),tokenId:U(T),mintAddress:U(v)})),console.log("started padding"),W(d,e,n,f,B,T,v),console.log("done padding")}return console.log("getInputUtxoAndBalancePerToken 6"),x};exports.attemptGetInputUtxosRemotely=S;exports.getInputUtxoAndBalance=C;exports.getInputUtxoAndBalanceOfStuckUtxos=N;exports.getInputUtxoAndBalancePerToken=z;exports.getInputUtxosRemotely=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("../../../data-structures/utxo/Utxo.cjs"),C=require("../../utils/upToDateState.cjs"),O=require("../../utils/cacheFunctions.cjs"),K=require("../../utils/caseInsensitive.utils.cjs"),b=require("../../utils/encodeTokenWithId.cjs"),M=require("./getInputUtxosEnclave.cjs"),F=require("../../../error-handling/logger.cjs"),H=require("../../utils/solanaMint.utils.cjs"),_=require("../../../constants/chains.constants.cjs"),j=require("../../utils/addresses.cjs"),G=require("../../../API/scheduled-transactions-calls.cjs"),q=async(t,o,e,n,c,r,u,a,s)=>{s+=1;const l=r.slice(s),{lastOutput:f,additionalEncryptedOutputs:y}=await t.utxoUtils.batchProcess(l,a,o,e),i=[...u,...y];return await C.checkChainOrAddressNotUpdated(t,e,n),O.setHinkalCache({lastOutput:f,encryptedOutputs:i},t,e,c),await t.utxoUtils.buildBatchProcess(i,o,e)},S=async(t,o,e,n)=>{const{utxos:c,encryptedOutputs:r,lastOutput:u}=await M.getInputUtxosEnclave(t,e,o);return O.setHinkalCache({encryptedOutputs:r,lastOutput:u},t,e,n),c},N=async(t,o,e,n,c,r,u,a,s)=>{try{return await S(t,o,e,c)}catch{return q(t,o,e,n,c,r,u,a,s)}},D=t=>{if(Array.isArray(t))return t;if(t!==void 0)return[t]},J=async(t,o,e)=>await t.utxoUtils.batchFilterUtxosWithNullifier(o,e),W=(t,o,e,n,c,r,u)=>{for(t.sort((a,s)=>a.amount<=s.amount?1:-1),console.log("sorted utxos");t.length<o||t.length>o&&t.length<6;)if(console.log("before pushing"),console.log("aaa",c,u,n,r),t.push(new R.Utxo({amount:0n,erc20TokenAddress:c,mintAddress:u,shieldedPrivateKey:n,tokenId:r,enableLogs:!0})),console.log("after pushing"),e)for(;t.length>6;)t.splice(t.length-1);console.log("completed sorting utxos")},E=async({hinkal:t,chainId:o=void 0,passedShieldedPublicKey:e=void 0,ethAddress:n=void 0,resetCacheBefore:c=!1,allowRemoteDecryption:r=!1,useBlockedUtxos:u=!1})=>{if(!t.getCurrentChainId||!t.getSelectedNetwork())return F.Logger.log("returning empty balance"),{inputUtxos:[]};const a=n??await t.getEthereumAddress(),s=o??t.getCurrentChainId(),l=e??t.userKeys.getShieldedPublicKey(),{encryptedOutputs:f,nullifiers:y,userKeys:i}=t,g=Array.from(f);console.log("getInputUtxoAndBalance 1",{encryptedOutputs:f}),c&&O.resetCache(t,s,l);let{encryptedOutputs:h,lastOutput:x}=O.getHinkalCache(t,s,l);console.log("getInputUtxoAndBalance 2"),await C.checkChainOrAddressNotUpdated(t,s,a),console.log("getInputUtxoAndBalance 3");const p=x!=="",d=g.findIndex(k=>k.value===x);console.log("getInputUtxoAndBalance 4");const I=d>-1,T=!p&&d===-1;console.log("getInputUtxoAndBalance 5");const w=t.areMerkleTreeUpdatesDisabled();console.log("getInputUtxoAndBalance 6");const v=!w&&(I||!r&&T),B=!w&&r&&T,A=!v&&!B;let U=[];v?U=await q(t,i,s,a,l,g,h,x,d):B?U=await N(t,i,s,a,l,g,h,x,d):A&&(U=await t.utxoUtils.buildBatchProcess(h,i,s)),console.log("getInputUtxoAndBalance 7",{allUtxos:U}),await C.checkChainOrAddressNotUpdated(t,s,a);const m=await J(t,U,y);console.log("getInputUtxoAndBalance 8",{inputUtxos:m});const P=u?m:m.filter(k=>!k.isBlocked);return console.log("getInputUtxoAndBalance 9",{filteredInputUtxos:P}),console.trace(),{inputUtxos:P}},L=async({hinkal:t,chainId:o=void 0,passedShieldedPublicKey:e=void 0,ethAddress:n=void 0,resetCacheBefore:c=!1,allowRemoteDecryption:r=!1})=>{const u=o??t.getCurrentChainId(),a=n??await t.getEthereumAddress(),s=j.hashEthereumAddress(a),{inputUtxos:l}=await E({hinkal:t,chainId:u,passedShieldedPublicKey:e,ethAddress:a,resetCacheBefore:c,allowRemoteDecryption:r,useBlockedUtxos:!0});if(!l.length)return{inputUtxos:[]};const f=l.map(g=>g.getNullifier()),{indexes:y}=await G.getScheduledTransactionsNullifierIndexes(u,{hashedEthereumAddress:s,nullifiers:f});return{inputUtxos:y.map(g=>l[g]).filter(g=>!!g)}},z=async({hinkal:t,tokenWithId:o,minInput:e=2,sliceIfMore6:n=!0,chainId:c=void 0,passedShieldedPrivateKey:r=void 0,passedShieldedPublicKey:u=void 0,ethAddress:a=void 0,resetCacheBefore:s=!1,ensuredTokensWithId:l,useBlockedUtxos:f=!1})=>{const y=r??t.userKeys.getShieldedPrivateKey(),i=c??t.getCurrentChainId();console.log("getInputUtxoAndBalancePerToken 1");const{inputUtxos:g}=f?await L({hinkal:t,chainId:c,ethAddress:a,passedShieldedPrivateKey:r,resetCacheBefore:s}):await E({hinkal:t,tokenWithId:o,minInput:e,sliceIfMore6:n,chainId:c,passedShieldedPrivateKey:r,passedShieldedPublicKey:u,ethAddress:a,resetCacheBefore:s});console.log("getInputUtxoAndBalancePerToken 2");const h=D(o),x=new Map;console.log("getInputUtxoAndBalancePerToken 3"),g.forEach(p=>{const d=p.getTokenAddress(i);if(h&&!h.some(w=>K.caseInsensitiveEqual(w.erc20TokenAddress,d)&&w.tokenId===p.tokenId))return;const I=b.encodeTokenWithId(i,{erc20TokenAddress:d,tokenId:p.tokenId}),T=x.get(I)??[];x.set(I,[...T,p])}),console.log("getInputUtxoAndBalancePerToken 4"),l?.forEach(p=>{const d=b.encodeTokenWithId(i,{erc20TokenAddress:p.erc20TokenAddress,tokenId:p.tokenId});x.set(d,x.get(d)??[])}),console.log("getInputUtxoAndBalancePerToken 5");for(const[p,d]of x){const I=p.split("-")[0],T=Number(p.split("-")[1]),w=_.isSolanaLike(i),v=w?I:void 0,B=w?H.formatMintAddress(I).compressedAddress.toLowerCase():I.toLowerCase(),A=U=>U===null?"null":typeof U!="object"?typeof U:U.constructor.name;console.log("types",JSON.stringify({value:A(d),minInput:A(e),sliceIfMore6:A(n),shieldedPrivateKey:A(y),modifiedErc20TokenAddress:A(B),tokenId:A(T),mintAddress:A(v)})),console.log("started padding"),W(d,e,n,y,B,T,v),console.log("done padding")}return console.log("getInputUtxoAndBalancePerToken 6"),x};exports.attemptGetInputUtxosRemotely=N;exports.getInputUtxoAndBalance=E;exports.getInputUtxoAndBalanceOfStuckUtxos=L;exports.getInputUtxoAndBalancePerToken=z;exports.getInputUtxosRemotely=S;
@@ -1,25 +1,25 @@
1
1
  import { Utxo as S } from "../../../data-structures/utxo/Utxo.mjs";
2
- import { checkChainOrAddressNotUpdated as h } from "../../utils/upToDateState.mjs";
3
- import { setHinkalCache as C, resetCache as L, getHinkalCache as K } from "../../utils/cacheFunctions.mjs";
2
+ import { checkChainOrAddressNotUpdated as E } from "../../utils/upToDateState.mjs";
3
+ import { setHinkalCache as b, resetCache as L, getHinkalCache as K } from "../../utils/cacheFunctions.mjs";
4
4
  import { caseInsensitiveEqual as R } from "../../utils/caseInsensitive.utils.mjs";
5
- import { encodeTokenWithId as P } from "../../utils/encodeTokenWithId.mjs";
5
+ import { encodeTokenWithId as C } from "../../utils/encodeTokenWithId.mjs";
6
6
  import { getInputUtxosEnclave as F } from "./getInputUtxosEnclave.mjs";
7
7
  import { Logger as H } from "../../../error-handling/logger.mjs";
8
8
  import { formatMintAddress as M } from "../../utils/solanaMint.utils.mjs";
9
9
  import { isSolanaLike as j } from "../../../constants/chains.constants.mjs";
10
10
  import { hashEthereumAddress as q } from "../../utils/addresses.mjs";
11
11
  import { getScheduledTransactionsNullifierIndexes as G } from "../../../API/scheduled-transactions-calls.mjs";
12
- const b = async (t, o, e, n, r, c, l, a, s) => {
12
+ const k = async (t, o, e, n, r, c, l, a, s) => {
13
13
  s += 1;
14
- const u = c.slice(s), { lastOutput: I, additionalEncryptedOutputs: A } = await t.utxoUtils.batchProcess(
14
+ const u = c.slice(s), { lastOutput: A, additionalEncryptedOutputs: m } = await t.utxoUtils.batchProcess(
15
15
  u,
16
16
  a,
17
17
  o,
18
18
  e
19
- ), i = [...l, ...A];
20
- return await h(t, e, n), C(
19
+ ), i = [...l, ...m];
20
+ return await E(t, e, n), b(
21
21
  {
22
- lastOutput: I,
22
+ lastOutput: A,
23
23
  encryptedOutputs: i
24
24
  },
25
25
  t,
@@ -32,7 +32,7 @@ const b = async (t, o, e, n, r, c, l, a, s) => {
32
32
  encryptedOutputs: c,
33
33
  lastOutput: l
34
34
  } = await F(t, e, o);
35
- return C(
35
+ return b(
36
36
  {
37
37
  encryptedOutputs: c,
38
38
  lastOutput: l
@@ -45,7 +45,7 @@ const b = async (t, o, e, n, r, c, l, a, s) => {
45
45
  try {
46
46
  return await J(t, o, e, r);
47
47
  } catch {
48
- return b(
48
+ return k(
49
49
  t,
50
50
  o,
51
51
  e,
@@ -70,7 +70,7 @@ const b = async (t, o, e, n, r, c, l, a, s) => {
70
70
  for (; t.length > 6; )
71
71
  t.splice(t.length - 1);
72
72
  console.log("completed sorting utxos");
73
- }, k = async ({
73
+ }, N = async ({
74
74
  hinkal: t,
75
75
  chainId: o = void 0,
76
76
  passedShieldedPublicKey: e = void 0,
@@ -81,23 +81,23 @@ const b = async (t, o, e, n, r, c, l, a, s) => {
81
81
  }) => {
82
82
  if (!t.getCurrentChainId || !t.getSelectedNetwork())
83
83
  return H.log("returning empty balance"), { inputUtxos: [] };
84
- const a = n ?? await t.getEthereumAddress(), s = o ?? t.getCurrentChainId(), u = e ?? t.userKeys.getShieldedPublicKey(), { encryptedOutputs: I, nullifiers: A, userKeys: i } = t, p = Array.from(I);
85
- console.log("getInputUtxoAndBalance 1"), r && L(t, s, u);
84
+ const a = n ?? await t.getEthereumAddress(), s = o ?? t.getCurrentChainId(), u = e ?? t.userKeys.getShieldedPublicKey(), { encryptedOutputs: A, nullifiers: m, userKeys: i } = t, p = Array.from(A);
85
+ console.log("getInputUtxoAndBalance 1", { encryptedOutputs: A }), r && L(t, s, u);
86
86
  let { encryptedOutputs: v, lastOutput: f } = K(
87
87
  t,
88
88
  s,
89
89
  u
90
90
  );
91
- console.log("getInputUtxoAndBalance 2"), await h(t, s, a), console.log("getInputUtxoAndBalance 3");
92
- const g = f !== "", d = p.findIndex((O) => O.value === f);
91
+ console.log("getInputUtxoAndBalance 2"), await E(t, s, a), console.log("getInputUtxoAndBalance 3");
92
+ const g = f !== "", d = p.findIndex((h) => h.value === f);
93
93
  console.log("getInputUtxoAndBalance 4");
94
- const m = d > -1, w = !g && d === -1;
94
+ const y = d > -1, w = !g && d === -1;
95
95
  console.log("getInputUtxoAndBalance 5");
96
- const y = t.areMerkleTreeUpdatesDisabled();
96
+ const I = t.areMerkleTreeUpdatesDisabled();
97
97
  console.log("getInputUtxoAndBalance 6");
98
- const B = !y && (m || !c && w), T = !y && c && w, x = !B && !T;
99
- let U = [];
100
- B ? U = await b(
98
+ const B = !I && (y || !c && w), T = !I && c && w, U = !B && !T;
99
+ let x = [];
100
+ B ? x = await k(
101
101
  t,
102
102
  i,
103
103
  s,
@@ -107,7 +107,7 @@ const b = async (t, o, e, n, r, c, l, a, s) => {
107
107
  v,
108
108
  f,
109
109
  d
110
- ) : T ? U = await z(
110
+ ) : T ? x = await z(
111
111
  t,
112
112
  i,
113
113
  s,
@@ -117,11 +117,11 @@ const b = async (t, o, e, n, r, c, l, a, s) => {
117
117
  v,
118
118
  f,
119
119
  d
120
- ) : x && (U = await t.utxoUtils.buildBatchProcess(v, i, s)), console.log("getInputUtxoAndBalance 7"), await h(t, s, a);
121
- const E = await Q(t, U, A);
122
- console.log("getInputUtxoAndBalance 8");
123
- const N = l ? E : E.filter((O) => !O.isBlocked);
124
- return console.log("getInputUtxoAndBalance 9"), console.trace(), { inputUtxos: N };
120
+ ) : U && (x = await t.utxoUtils.buildBatchProcess(v, i, s)), console.log("getInputUtxoAndBalance 7", { allUtxos: x }), await E(t, s, a);
121
+ const O = await Q(t, x, m);
122
+ console.log("getInputUtxoAndBalance 8", { inputUtxos: O });
123
+ const P = l ? O : O.filter((h) => !h.isBlocked);
124
+ return console.log("getInputUtxoAndBalance 9", { filteredInputUtxos: P }), console.trace(), { inputUtxos: P };
125
125
  }, X = async ({
126
126
  hinkal: t,
127
127
  chainId: o = void 0,
@@ -130,7 +130,7 @@ const b = async (t, o, e, n, r, c, l, a, s) => {
130
130
  resetCacheBefore: r = !1,
131
131
  allowRemoteDecryption: c = !1
132
132
  }) => {
133
- const l = o ?? t.getCurrentChainId(), a = n ?? await t.getEthereumAddress(), s = q(a), { inputUtxos: u } = await k({
133
+ const l = o ?? t.getCurrentChainId(), a = n ?? await t.getEthereumAddress(), s = q(a), { inputUtxos: u } = await N({
134
134
  hinkal: t,
135
135
  chainId: l,
136
136
  passedShieldedPublicKey: e,
@@ -141,11 +141,11 @@ const b = async (t, o, e, n, r, c, l, a, s) => {
141
141
  });
142
142
  if (!u.length)
143
143
  return { inputUtxos: [] };
144
- const I = u.map((p) => p.getNullifier()), { indexes: A } = await G(l, {
144
+ const A = u.map((p) => p.getNullifier()), { indexes: m } = await G(l, {
145
145
  hashedEthereumAddress: s,
146
- nullifiers: I
146
+ nullifiers: A
147
147
  });
148
- return { inputUtxos: A.map((p) => u[p]).filter((p) => !!p) };
148
+ return { inputUtxos: m.map((p) => u[p]).filter((p) => !!p) };
149
149
  }, ct = async ({
150
150
  hinkal: t,
151
151
  tokenWithId: o,
@@ -157,17 +157,17 @@ const b = async (t, o, e, n, r, c, l, a, s) => {
157
157
  ethAddress: a = void 0,
158
158
  resetCacheBefore: s = !1,
159
159
  ensuredTokensWithId: u,
160
- useBlockedUtxos: I = !1
160
+ useBlockedUtxos: A = !1
161
161
  }) => {
162
- const A = c ?? t.userKeys.getShieldedPrivateKey(), i = r ?? t.getCurrentChainId();
162
+ const m = c ?? t.userKeys.getShieldedPrivateKey(), i = r ?? t.getCurrentChainId();
163
163
  console.log("getInputUtxoAndBalancePerToken 1");
164
- const { inputUtxos: p } = I ? await X({
164
+ const { inputUtxos: p } = A ? await X({
165
165
  hinkal: t,
166
166
  chainId: r,
167
167
  ethAddress: a,
168
168
  passedShieldedPrivateKey: c,
169
169
  resetCacheBefore: s
170
- }) : await k({
170
+ }) : await N({
171
171
  hinkal: t,
172
172
  tokenWithId: o,
173
173
  minInput: e,
@@ -183,38 +183,38 @@ const b = async (t, o, e, n, r, c, l, a, s) => {
183
183
  console.log("getInputUtxoAndBalancePerToken 3"), p.forEach((g) => {
184
184
  const d = g.getTokenAddress(i);
185
185
  if (v && !v.some(
186
- (y) => R(y.erc20TokenAddress, d) && y.tokenId === g.tokenId
186
+ (I) => R(I.erc20TokenAddress, d) && I.tokenId === g.tokenId
187
187
  ))
188
188
  return;
189
- const m = P(i, { erc20TokenAddress: d, tokenId: g.tokenId }), w = f.get(m) ?? [];
190
- f.set(m, [...w, g]);
189
+ const y = C(i, { erc20TokenAddress: d, tokenId: g.tokenId }), w = f.get(y) ?? [];
190
+ f.set(y, [...w, g]);
191
191
  }), console.log("getInputUtxoAndBalancePerToken 4"), u?.forEach((g) => {
192
- const d = P(i, {
192
+ const d = C(i, {
193
193
  erc20TokenAddress: g.erc20TokenAddress,
194
194
  tokenId: g.tokenId
195
195
  });
196
196
  f.set(d, f.get(d) ?? []);
197
197
  }), console.log("getInputUtxoAndBalancePerToken 5");
198
198
  for (const [g, d] of f) {
199
- const m = g.split("-")[0], w = Number(g.split("-")[1]), y = j(i), B = y ? m : void 0, T = y ? M(m).compressedAddress.toLowerCase() : m.toLowerCase(), x = (U) => U === null ? "null" : typeof U != "object" ? typeof U : U.constructor.name;
199
+ const y = g.split("-")[0], w = Number(g.split("-")[1]), I = j(i), B = I ? y : void 0, T = I ? M(y).compressedAddress.toLowerCase() : y.toLowerCase(), U = (x) => x === null ? "null" : typeof x != "object" ? typeof x : x.constructor.name;
200
200
  console.log(
201
201
  "types",
202
202
  JSON.stringify({
203
- value: x(d),
204
- minInput: x(e),
205
- sliceIfMore6: x(n),
206
- shieldedPrivateKey: x(A),
207
- modifiedErc20TokenAddress: x(T),
208
- tokenId: x(w),
209
- mintAddress: x(B)
203
+ value: U(d),
204
+ minInput: U(e),
205
+ sliceIfMore6: U(n),
206
+ shieldedPrivateKey: U(m),
207
+ modifiedErc20TokenAddress: U(T),
208
+ tokenId: U(w),
209
+ mintAddress: U(B)
210
210
  })
211
- ), console.log("started padding"), V(d, e, n, A, T, w, B), console.log("done padding");
211
+ ), console.log("started padding"), V(d, e, n, m, T, w, B), console.log("done padding");
212
212
  }
213
213
  return console.log("getInputUtxoAndBalancePerToken 6"), f;
214
214
  };
215
215
  export {
216
216
  z as attemptGetInputUtxosRemotely,
217
- k as getInputUtxoAndBalance,
217
+ N as getInputUtxoAndBalance,
218
218
  X as getInputUtxoAndBalanceOfStuckUtxos,
219
219
  ct as getInputUtxoAndBalancePerToken,
220
220
  J as getInputUtxosRemotely
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "h_test_1",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "homepage": "hinkal.io",
5
5
  "author": {
6
6
  "name": "Hinkal Protocol"