@hinkal/common 0.2.17 → 0.2.18

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.
Files changed (62) hide show
  1. package/API/getWebsiteURL.d.ts +1 -1
  2. package/README.md +9 -2
  3. package/constants/chains.constants.cjs +1 -1
  4. package/constants/chains.constants.mjs +2 -2
  5. package/constants/mediaUrls.constants.cjs +1 -1
  6. package/constants/mediaUrls.constants.d.ts +2 -0
  7. package/constants/mediaUrls.constants.mjs +3 -1
  8. package/constants/vite.constants.cjs +1 -1
  9. package/constants/vite.constants.mjs +36 -13
  10. package/data-structures/Hinkal/Hinkal.cjs +1 -1
  11. package/data-structures/Hinkal/Hinkal.d.ts +1 -1
  12. package/data-structures/Hinkal/Hinkal.mjs +2 -2
  13. package/data-structures/Hinkal/IHinkal.d.ts +1 -1
  14. package/data-structures/Hinkal/hinkalApprove.d.ts +1 -1
  15. package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
  16. package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +136 -118
  17. package/data-structures/Hinkal/hinkalInsideTransact.d.ts +1 -1
  18. package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +1 -1
  19. package/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +1 -1
  20. package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +1 -1
  21. package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +1 -1
  22. package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +1 -1
  23. package/data-structures/Hinkal/hinkalSwap.d.ts +1 -1
  24. package/data-structures/Hinkal/hinkalTransfer.d.ts +1 -1
  25. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  26. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.d.ts +2 -2
  27. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +59 -58
  28. package/error-handling/error-codes.constants.cjs +1 -1
  29. package/error-handling/error-codes.constants.d.ts +2 -0
  30. package/error-handling/error-codes.constants.mjs +3 -1
  31. package/functions/snarkjs/constructEmporiumProof.d.ts +2 -2
  32. package/functions/snarkjs/constructGeneralZkProof.d.ts +2 -2
  33. package/functions/snarkjs/generateCircomData.d.ts +1 -1
  34. package/functions/utils/enum.utils.cjs +1 -0
  35. package/functions/utils/enum.utils.mjs +14 -0
  36. package/functions/utils/getDataFromTransaction.d.ts +3 -3
  37. package/functions/web3/events/getInputUtxosEnclave.d.ts +1 -1
  38. package/functions/web3/functionCalls/approveToken.cjs +1 -1
  39. package/functions/web3/functionCalls/approveToken.mjs +51 -47
  40. package/functions/web3/functionCalls/recoverTransactionFromError.cjs +1 -0
  41. package/functions/web3/functionCalls/recoverTransactionFromError.d.ts +2 -0
  42. package/functions/web3/functionCalls/recoverTransactionFromError.mjs +23 -0
  43. package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
  44. package/functions/web3/functionCalls/transactCallDirect.mjs +45 -32
  45. package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  46. package/functions/web3/functionCalls/transactCallRelayer.mjs +23 -22
  47. package/index.cjs +1 -1
  48. package/index.mjs +116 -115
  49. package/package.json +2 -2
  50. package/types/admin.types.cjs +1 -1
  51. package/types/admin.types.d.ts +3 -1
  52. package/types/admin.types.mjs +1 -1
  53. package/types/solana.types.d.ts +2 -0
  54. package/types/transactions.types.cjs +1 -1
  55. package/types/transactions.types.d.ts +4 -0
  56. package/types/transactions.types.mjs +5 -4
  57. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
  58. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
  59. package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
  60. package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
  61. package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
  62. package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +2 -2
@@ -1,188 +1,206 @@
1
- import { ethers as B } from "ethers";
2
- import { zeroAddress as b } from "../../constants/protocol.constants.mjs";
3
- import { transactionErrorCodes as L } from "../../error-handling/error-codes.constants.mjs";
4
- import { outputUtxoProcessing as N } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
5
- import { constructZkProof as W } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
6
- import { addPaddingToUtxos as Z } from "../../functions/web3/events/getShieldedBalance.mjs";
7
- import { transactCallDirect as _ } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
8
- import { transactCallRelayerBatch as V } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
9
- import { ExternalActionId as F } from "../../types/external-action.types.mjs";
10
- import { Utxo as X } from "../utxo/Utxo.mjs";
1
+ import { ethers as _ } from "ethers";
2
+ import { zeroAddress as W } from "../../constants/protocol.constants.mjs";
3
+ import { transactionErrorCodes as V } from "../../error-handling/error-codes.constants.mjs";
4
+ import { outputUtxoProcessing as X } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
5
+ import { constructZkProof as F } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
6
+ import { addPaddingToUtxos as Y } from "../../functions/web3/events/getShieldedBalance.mjs";
7
+ import { transactCallDirect as j } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
8
+ import { transactCallRelayerBatch as G } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
9
+ import { ExternalActionId as z } from "../../types/external-action.types.mjs";
10
+ import { Utxo as J } from "../utxo/Utxo.mjs";
11
11
  import "../../types/circom-data.types.mjs";
12
- import { ContractType as v } from "../../types/ethereum-network.types.mjs";
12
+ import { ContractType as I } from "../../types/ethereum-network.types.mjs";
13
13
  import "../../types/transactions.types.mjs";
14
+ import { AdminTransactionType as k } from "../../types/admin.types.mjs";
14
15
  import "../../types/activities.types.mjs";
15
- import { getSignatureDataForTransact as k } from "../../functions/pre-transaction/getSignatureDataForTransact.mjs";
16
- import { shouldPatchAccessTokenMerkleTree as z } from "../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs";
17
- import { getCurrentTimeInSeconds as Y } from "../../functions/utils/time.utils.mjs";
18
- import { getUtxosFromReceipt as j } from "../../functions/utils/getUtxosFromReceipt.utils.mjs";
19
- import { getFeeStructure as G } from "../../functions/pre-transaction/getFeeStructure.mjs";
20
- import { calculateTotalFee as J } from "../../functions/utils/fees.utils.mjs";
21
- import { storeUnspentUtxos as Q } from "../../API/unspent-utxos-calls.mjs";
22
- import { hashEthereumAddress as tt } from "../../functions/utils/addresses.mjs";
23
- const et = async (t, o, n, u, p, w) => {
24
- const r = o.erc20TokenAddress, s = n.map((e) => e + J(e, p)), c = [r], a = [0n], i = [!0], { patchAccessTokenMerkleTree: g, kycRequired: d, hasAccessToken: E } = await z(
16
+ import { getSignatureDataForTransact as $ } from "../../functions/pre-transaction/getSignatureDataForTransact.mjs";
17
+ import { shouldPatchAccessTokenMerkleTree as q } from "../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs";
18
+ import { getCurrentTimeInSeconds as Q } from "../../functions/utils/time.utils.mjs";
19
+ import { getUtxosFromReceipt as tt } from "../../functions/utils/getUtxosFromReceipt.utils.mjs";
20
+ import { getFeeStructure as et } from "../../functions/pre-transaction/getFeeStructure.mjs";
21
+ import { calculateTotalFee as ot } from "../../functions/utils/fees.utils.mjs";
22
+ import { storeUnspentUtxos as rt } from "../../API/unspent-utxos-calls.mjs";
23
+ import { hashEthereumAddress as st } from "../../functions/utils/addresses.mjs";
24
+ import { constructAdminData as B } from "../../functions/pre-transaction/constructAdminData.mjs";
25
+ import { emitTxPublicData as at } from "../../API/admin-calls.mjs";
26
+ const nt = async (t, s, c, p, A, w) => {
27
+ const o = s.erc20TokenAddress, d = await t.getEthereumAddress(), r = c.map((e) => e + ot(e, A)), a = [o], n = [0n], g = [!0], { patchAccessTokenMerkleTree: m, kycRequired: E, hasAccessToken: R } = await q(
25
28
  t,
26
- c,
27
- a
28
- ), I = await k(
29
+ a,
30
+ n
31
+ ), P = await $(
29
32
  t.getCurrentChainId(),
30
- await t.getEthereumAddress(),
31
- t.userKeys,
32
33
  d,
33
- E
34
- ), m = [...await Z(t, c, a)], A = [];
35
- for (let e = 0; e < m.length; e += 1) {
36
- const { outputUtxos: l } = N(t.userKeys, m[e], a[e]);
37
- A.push(l);
34
+ t.userKeys,
35
+ E,
36
+ R
37
+ ), i = [...await Y(t, a, n)], l = [];
38
+ for (let e = 0; e < i.length; e += 1) {
39
+ const { outputUtxos: f } = X(t.userKeys, i[e], n[e]);
40
+ l.push(f);
38
41
  }
39
- const R = s.reduce((e, l) => e + l, 0n), f = B.utils.defaultAbiCoder.encode(["uint256[]"], [s]), x = t.getContractWithSigner(v.HinkalWrapper), T = t.getContractWithSigner(v.DepositOnChainUtxos), {
40
- zkCallData: S,
41
- circomData: h,
42
- dimData: P
43
- } = await W(
42
+ const h = r.reduce((e, f) => e + f, 0n), T = _.utils.defaultAbiCoder.encode(["uint256[]"], [r]), y = t.getContractWithSigner(I.HinkalWrapper), D = t.getContractWithSigner(I.DepositOnChainUtxos), {
43
+ zkCallData: x,
44
+ circomData: S,
45
+ dimData: O
46
+ } = await F(
44
47
  "v1x1",
45
48
  t.merkleTreeHinkal,
46
49
  t.merkleTreeAccessToken,
47
- m,
48
- A,
50
+ i,
51
+ l,
49
52
  t.userKeys,
50
- `swapperM1x${m[0].length}x1`,
51
- F.DepositOnChainUtxos,
52
- T.address,
53
- f,
53
+ `swapperM1x${i[0].length}x1`,
54
+ z.DepositOnChainUtxos,
55
+ D.address,
56
+ T,
54
57
  t.generateProofRemotely,
55
- b,
58
+ W,
56
59
  t.getCurrentChainId(),
57
- i,
60
+ g,
58
61
  void 0,
59
62
  void 0,
60
63
  void 0,
61
- g,
64
+ m,
62
65
  void 0,
63
66
  void 0,
64
67
  void 0,
65
- t.getContractWithFetcher(v.HinkalHelperContract),
66
- I,
67
- x.address,
68
+ t.getContractWithFetcher(I.HinkalHelperContract),
69
+ P,
70
+ y.address,
68
71
  !1
69
- ), K = await (await _(
72
+ ), K = await (await j(
70
73
  t,
71
- R,
72
- o,
73
- S,
74
74
  h,
75
- P,
76
- T,
77
- x
78
- )).wait(), y = j(K, t, r), U = [], C = [...y];
79
- u.forEach((e, l) => {
80
- const O = s[l], H = C.find((q) => q.amount === O);
81
- if (!H)
82
- throw new Error(`Could not find newly created UTXO with amount ${O} for recipient ${e}.`);
83
- U.push({
75
+ s,
76
+ x,
77
+ S,
78
+ O,
79
+ D,
80
+ y
81
+ )).wait(), U = tt(K, t, o), v = [], C = [...U];
82
+ p.forEach((e, f) => {
83
+ const M = r[f], b = C.find((Z) => Z.amount === M);
84
+ if (!b)
85
+ throw new Error(`Could not find newly created UTXO with amount ${M} for recipient ${e}.`);
86
+ v.push({
84
87
  recipientAddress: e,
85
- utxo: H
88
+ utxo: b
86
89
  });
87
- const $ = C.indexOf(H);
88
- C.splice($, 1);
90
+ const N = C.indexOf(b);
91
+ C.splice(N, 1);
89
92
  });
90
- const D = t.getCurrentChainId();
91
- return await Q(D, {
93
+ const u = t.getCurrentChainId();
94
+ await rt(u, {
92
95
  hashedEthereumAddress: w,
93
- chainId: D,
94
- utxos: y
95
- }), U;
96
- }, ot = async (t, o, n, u, p, w) => {
97
- if (n.length === 0)
96
+ chainId: u,
97
+ utxos: U
98
+ });
99
+ const L = B(
100
+ k.DepositOnChainUtxos,
101
+ u,
102
+ a,
103
+ [h],
104
+ d
105
+ );
106
+ return at(u, L), v;
107
+ }, it = async (t, s, c, p, A, w) => {
108
+ if (c.length === 0)
98
109
  throw new Error("userDepositedUtxos must not be empty");
99
- const r = o.erc20TokenAddress, s = await t.getRandomRelay();
100
- if (!s)
101
- throw Error(L.RELAYER_NOT_AVAILABLE);
102
- const c = await t.getEthereumAddress(), a = Y().toString(), i = t.generateProofRemotely ? 5 : 1, g = [];
103
- for (let d = 0; d < n.length; d += i) {
104
- const E = n.slice(d, d + i), I = await Promise.all(
105
- E.map(async ({ recipientAddress: m, utxo: A }) => {
106
- const R = [-A.amount], f = new X({
110
+ const o = s.erc20TokenAddress, d = await t.getRandomRelay();
111
+ if (!d)
112
+ throw Error(V.RELAYER_NOT_AVAILABLE);
113
+ const r = await t.getEthereumAddress(), a = Q().toString(), n = t.generateProofRemotely ? 5 : 1, g = [];
114
+ for (let m = 0; m < c.length; m += n) {
115
+ const E = c.slice(m, m + n), R = await Promise.all(
116
+ E.map(async ({ recipientAddress: P, utxo: i }) => {
117
+ const l = [-i.amount], h = new J({
107
118
  amount: 0n,
108
- erc20TokenAddress: r,
119
+ erc20TokenAddress: o,
109
120
  shieldedPrivateKey: t.userKeys.getShieldedPrivateKey(),
110
121
  timeStamp: a,
111
122
  tokenId: 0
112
- }), x = [[A, f]], T = [[f]], S = `swapperM1x${x[0].length}x1`, h = {
123
+ }), T = [[i, h]], y = [[h]], D = `swapperM1x${T[0].length}x1`, x = {
113
124
  externalActionId: 0n,
114
- externalAddress: m,
125
+ externalAddress: P,
115
126
  externalActionMetadata: "0x00"
116
127
  }, {
117
- patchAccessTokenMerkleTree: P,
118
- kycRequired: M,
119
- hasAccessToken: K
120
- } = await z(t, [r], R), y = await k(
128
+ patchAccessTokenMerkleTree: S,
129
+ kycRequired: O,
130
+ hasAccessToken: H
131
+ } = await q(t, [o], l), K = await $(
121
132
  t.getCurrentChainId(),
122
- c,
133
+ r,
123
134
  t.userKeys,
124
- M,
125
- K
126
- ), { zkCallData: U, circomData: C, dimData: D } = await W(
135
+ O,
136
+ H
137
+ ), U = B(
138
+ k.WithdrawOnChainUtxos,
139
+ t.getCurrentChainId(),
140
+ [o],
141
+ [-i.amount],
142
+ r
143
+ ), { zkCallData: v, circomData: C, dimData: u } = await F(
127
144
  "v1x1",
128
145
  t.merkleTreeHinkal,
129
146
  t.merkleTreeAccessToken,
130
- x,
131
147
  T,
148
+ y,
132
149
  t.userKeys,
133
- S,
134
- h.externalActionId,
135
- h.externalAddress,
136
- h.externalActionMetadata,
150
+ D,
151
+ x.externalActionId,
152
+ x.externalAddress,
153
+ x.externalActionMetadata,
137
154
  t.generateProofRemotely,
138
- s ?? b,
155
+ d ?? W,
139
156
  t.getCurrentChainId(),
140
157
  void 0,
141
158
  void 0,
142
159
  void 0,
143
160
  void 0,
144
- P,
161
+ S,
145
162
  void 0,
146
163
  void 0,
147
- u,
148
- t.getContractWithFetcher(v.HinkalHelperContract),
149
- y,
164
+ p,
165
+ t.getContractWithFetcher(I.HinkalHelperContract),
166
+ K,
150
167
  void 0,
151
168
  !1
152
169
  );
153
170
  return {
154
- zkCallData: U,
155
- dimData: D,
156
- circomData: C
171
+ zkCallData: v,
172
+ dimData: u,
173
+ circomData: C,
174
+ adminData: U
157
175
  };
158
176
  })
159
177
  );
160
- g.push(...I);
178
+ g.push(...R);
161
179
  }
162
- return V(
180
+ return G(
163
181
  t.getCurrentChainId(),
164
182
  g,
165
- p,
183
+ A,
166
184
  w
167
185
  );
168
- }, vt = async (t, o, n, u, p, w) => {
169
- const r = o.erc20TokenAddress, s = t.getCurrentChainId(), c = tt(await t.getEthereumAddress()), a = w ?? await G(s, r, [r], F.Transact), i = await et(
186
+ }, bt = async (t, s, c, p, A, w) => {
187
+ const o = s.erc20TokenAddress, d = t.getCurrentChainId(), r = st(await t.getEthereumAddress()), a = w ?? await et(d, o, [o], z.Transact), n = await nt(
170
188
  t,
171
- o,
172
- n,
173
- u,
189
+ s,
190
+ c,
191
+ p,
174
192
  a,
175
- c
193
+ r
176
194
  );
177
- return ot(
195
+ return it(
178
196
  t,
179
- o,
180
- i,
197
+ s,
198
+ n,
181
199
  a,
182
- c,
183
- p
200
+ r,
201
+ A
184
202
  );
185
203
  };
186
204
  export {
187
- vt as hinkalDepositAndWithdraw
205
+ bt as hinkalDepositAndWithdraw
188
206
  };
@@ -1,4 +1,4 @@
1
1
  import { IHinkal } from './IHinkal';
2
2
  import { FeeStructure, type ParsedInLogicMetadata } from '../../types/hinkal.types';
3
3
  import { AdminTransactionType } from '../../types/admin.types';
4
- export declare const hinkalInsideTransact: (hinkal: IHinkal, erc20Addresses: string[], deltaChanges: bigint[], approvalChanges: bigint[], externalAddress: string, externalActionMetadata: string, parsedInLogicMetadata: ParsedInLogicMetadata, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean) => Promise<bigint | import("../..").RelayerTransaction>;
4
+ export declare const hinkalInsideTransact: (hinkal: IHinkal, erc20Addresses: string[], deltaChanges: bigint[], approvalChanges: bigint[], externalAddress: string, externalActionMetadata: string, parsedInLogicMetadata: ParsedInLogicMetadata, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
@@ -3,4 +3,4 @@ import { FeeStructure } from '../../types/hinkal.types';
3
3
  import { PrivateRecipientInfo, TokenChanges } from '../../types/token.types';
4
4
  import { SubAccount } from '../../types/proxy.types';
5
5
  import { AdminTransactionType } from '../../types/admin.types';
6
- export declare const hinkalPrivateWallet: (hinkal: IHinkal, erc20Addresses: string[], deltaChanges: bigint[], onChainCreation: boolean[], ops: string[], emporiumTokenChanges: TokenChanges<bigint>[], subAccount: SubAccount, feeToken?: string, feeStructureOverride?: FeeStructure, relayOverride?: string, autoDepositBack?: boolean, maxGasInDollar?: string, action?: AdminTransactionType, privateRecipientInfo?: PrivateRecipientInfo, onlyGasEstimate?: boolean) => Promise<bigint | import("../..").RelayerTransaction>;
6
+ export declare const hinkalPrivateWallet: (hinkal: IHinkal, erc20Addresses: string[], deltaChanges: bigint[], onChainCreation: boolean[], ops: string[], emporiumTokenChanges: TokenChanges<bigint>[], subAccount: SubAccount, feeToken?: string, feeStructureOverride?: FeeStructure, relayOverride?: string, autoDepositBack?: boolean, maxGasInDollar?: string, action?: AdminTransactionType, privateRecipientInfo?: PrivateRecipientInfo, onlyGasEstimate?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
@@ -3,4 +3,4 @@ import { FeeStructure } from '../../types/hinkal.types';
3
3
  import { AdminTransactionType } from '../../types/admin.types';
4
4
  import { IHinkal } from './IHinkal';
5
5
  import { SubAccount } from '../../types/proxy.types';
6
- export declare const hinkalProxyToPrivate: (hinkal: IHinkal, erc20Tokens: ERC20Token[], deltaAmountsBase: bigint[], recipientInfo: string, feeToken?: string, feeStructureOverride?: FeeStructure, subAccount?: SubAccount, action?: AdminTransactionType, onlyGasEstimate?: boolean) => Promise<bigint | import("../..").RelayerTransaction>;
6
+ export declare const hinkalProxyToPrivate: (hinkal: IHinkal, erc20Tokens: ERC20Token[], deltaAmountsBase: bigint[], recipientInfo: string, feeToken?: string, feeStructureOverride?: FeeStructure, subAccount?: SubAccount, action?: AdminTransactionType, onlyGasEstimate?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
@@ -1,4 +1,4 @@
1
1
  import { FeeStructure, OKXSwapResponseInstruction } from '../../types';
2
2
  import { IHinkal } from './IHinkal';
3
3
  import { ERC20Token } from '../../types/token.types';
4
- export declare const hinkalSolanaSwap: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], instructionLists: OKXSwapResponseInstruction[], addressLookupTableAccount: string[], feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean) => Promise<import("../../types").RelayerTransaction>;
4
+ export declare const hinkalSolanaSwap: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], instructionLists: OKXSwapResponseInstruction[], addressLookupTableAccount: string[], feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean) => Promise<import('../../types/relayer.types').RelayerTransaction>;
@@ -1,3 +1,3 @@
1
1
  import { ERC20Token, FeeStructure } from '../../types';
2
2
  import { IHinkal } from './IHinkal';
3
- export declare const hinkalSolanaTransfer: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean) => Promise<import("../../types").RelayerTransaction>;
3
+ export declare const hinkalSolanaTransfer: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean) => Promise<import('../../types/relayer.types').RelayerTransaction>;
@@ -1,3 +1,3 @@
1
1
  import { FeeStructure } from '../../types';
2
2
  import { IHinkal } from './IHinkal';
3
- export declare const hinkalSolanaWithdraw: (hinkal: IHinkal, mintAddresses: string[], amountChanges: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean) => Promise<import("../../types").RelayerTransaction>;
3
+ export declare const hinkalSolanaWithdraw: (hinkal: IHinkal, mintAddresses: string[], amountChanges: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean) => Promise<import('../../types/relayer.types').RelayerTransaction>;
@@ -3,4 +3,4 @@ import { IHinkal } from './IHinkal';
3
3
  import { FeeStructure } from '../../types/hinkal.types';
4
4
  import { type ERC20Token } from '../../types/token.types';
5
5
  import { AdminTransactionType } from '../../types/admin.types';
6
- export declare const hinkalSwap: (hinkal: IHinkal, erc20tokens: ERC20Token[], deltaAmounts: bigint[], externalActionId: ExternalActionId, data: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean, withPrivateMempool?: boolean) => Promise<bigint | import("../..").RelayerTransaction>;
6
+ export declare const hinkalSwap: (hinkal: IHinkal, erc20tokens: ERC20Token[], deltaAmounts: bigint[], externalActionId: ExternalActionId, data: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean, withPrivateMempool?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
@@ -1,4 +1,4 @@
1
1
  import { FeeStructure } from '../../types/hinkal.types';
2
2
  import { AdminTransactionType, ERC20Token } from '../../types';
3
3
  import { IHinkal } from './IHinkal';
4
- export declare const hinkalTransfer: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChangesBase: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean) => Promise<bigint | import("../../types").RelayerTransaction>;
4
+ export declare const hinkalTransfer: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChangesBase: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean) => Promise<bigint | import('../../types/relayer.types').RelayerTransaction>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../../error-handling/error-codes.constants.cjs"),D=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),E=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),F=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),R=require("../../types/external-action.types.cjs"),M=require("../../types/hinkal.types.cjs"),_=require("../../functions/pre-transaction/outputApprovalDataProcessing.cjs"),W=require("../../functions/pre-transaction/getFeeStructure.cjs"),B=require("../../functions/pre-transaction/merge-with-fee-structure.cjs");require("../../types/circom-data.types.cjs");const b=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");const K=require("../../functions/pre-transaction/getSignatureDataForTransact.cjs"),L=require("../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs");require("../../constants/server.constants.cjs");require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../http/HttpClient.cjs");require("axios");const H=require("../../functions/utils/amounts.utils.cjs");require("ethers");require("../../constants/token-data/index.cjs");require("../../API/getServerURL.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/save-depths.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../functions/utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("@solana/web3.js");require("../crypto-keys/keys.cjs");const N=require("../../functions/utils/time.utils.cjs"),$=require("../../functions/pre-transaction/constructAdminData.cjs");require("@solana/spl-token");const O=require("../../functions/web3/events/getInputUtxoAndBalance.cjs"),Z=require("../../functions/web3/events/getShieldedBalance.cjs"),j=require("../../functions/utils/encodeTokenWithId.cjs"),z=require("../../API/unspent-utxos-calls.cjs"),G=require("../../functions/utils/addresses.cjs"),V=async(e,c,d,g,l)=>{const o=[c.erc20TokenAddress],A=c.erc20TokenAddress,a=await W.getFeeStructure(e.getCurrentChainId(),A,o,R.ExternalActionId.Transact),i=d-a.flatFee;if(i<=0n)throw new Error(`Insufficient balance to cover fee. Balance: ${d}, Fee: ${a.flatFee}`);const t=[-i];B.mergeWithFeeStructure(e.getCurrentChainId(),o,t,a);const u={externalActionId:0n,externalAddress:g,externalActionMetadata:"0x00"},s=[...await Z.addPaddingToUtxos(e,o,t,void 0,void 0,!1,!0)],q=`swapperM${t.length.toString()}x${s[0].length}x1`,r=M.defaultHinkalLogicArgs(t.length,e.userKeys),p=N.getCurrentTimeInSeconds().toString(),x=[];for(let n=0;n<o.length;n+=1){const{outputUtxos:k}=D.outputUtxoProcessing(e.userKeys,s[n],t[n],p,void 0,!1);x.push(k);const{useApprovalUtxoData:T}=_.outputApprovalDataProcessing(e,s[n],t[n]);T&&(r.useApprovalUtxoData[n]=T,r.doPreTxApproval=!0)}const m=await e.getRandomRelay(!0);if(!m)throw Error(P.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const{patchAccessTokenMerkleTree:h,kycRequired:C,hasAccessToken:w}=await L.shouldPatchAccessTokenMerkleTree(e,o,t),y=await K.getSignatureDataForTransact(e.getCurrentChainId(),await e.getEthereumAddress(),e.userKeys,C,w),{zkCallData:v,circomData:I,dimData:S}=await E.constructZkProof("v1x1",e.merkleTreeHinkal,e.merkleTreeAccessToken,s,x,e.userKeys,q,u.externalActionId,u.externalAddress,u.externalActionMetadata,e.generateProofRemotely,m,e.getCurrentChainId(),void 0,void 0,void 0,void 0,h,r,void 0,a,e.getContractWithFetcher(b.ContractType.HinkalHelperContract),y,void 0,!1),U=$.constructAdminData(l,e.getCurrentChainId(),o,t,await e.getEthereumAddress());return{tx:await F.transactCallRelayer(e.getCurrentChainId(),v,S,I,void 0,void 0,void 0,U),amountToRecipient:i}},Y=async(e,c,d,g)=>{const l=[],o=e.getCurrentChainId(),A=j.encodeTokenWithId(o,{erc20TokenAddress:c.erc20TokenAddress,tokenId:0}),a=await e.getEthereumAddress(),i=G.hashEthereumAddress(a);for(;;){const t=((await O.getInputUtxoAndBalancePerToken({hinkal:e,sliceIfMore6:!1,useBlockedUtxos:!0}))?.get(A)??[]).filter(r=>r.amount>0n).slice(0,6).sort((r,p)=>Number(p.amount-r.amount)),u=H.countTotalAmountInUtxos(t);if(!u)break;const s=t.map(r=>r.nullifier).filter(r=>!!r),{tx:q}=await V(e,c,u,d,g);s.length>0&&await z.deleteUnspentUtxos(o,i,s),l.push(q)}return l};exports.hinkalWithdrawStuckUtxos=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../../error-handling/error-codes.constants.cjs"),P=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),D=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),E=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),F=require("../../types/external-action.types.cjs"),R=require("../../types/hinkal.types.cjs"),_=require("../../functions/pre-transaction/outputApprovalDataProcessing.cjs"),M=require("../../functions/pre-transaction/getFeeStructure.cjs"),W=require("../../functions/pre-transaction/merge-with-fee-structure.cjs");require("../../types/circom-data.types.cjs");const B=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");const b=require("../../types/admin.types.cjs");require("../../types/activities.types.cjs");const K=require("../../functions/pre-transaction/getSignatureDataForTransact.cjs"),L=require("../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs");require("../../constants/server.constants.cjs");require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../http/HttpClient.cjs");require("axios");const H=require("../../functions/utils/amounts.utils.cjs");require("ethers");require("../../constants/token-data/index.cjs");require("../../API/getServerURL.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/save-depths.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../functions/utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("@solana/web3.js");require("../crypto-keys/keys.cjs");const N=require("../../functions/utils/time.utils.cjs"),$=require("../../functions/pre-transaction/constructAdminData.cjs");require("@solana/spl-token");const O=require("../../functions/web3/events/getInputUtxoAndBalance.cjs"),Z=require("../../functions/web3/events/getShieldedBalance.cjs"),j=require("../../functions/utils/encodeTokenWithId.cjs"),z=require("../../API/unspent-utxos-calls.cjs"),G=require("../../functions/utils/addresses.cjs"),V=async(e,c,d,l)=>{const o=[c.erc20TokenAddress],A=c.erc20TokenAddress,a=await M.getFeeStructure(e.getCurrentChainId(),A,o,F.ExternalActionId.Transact),i=d-a.flatFee;if(i<=0n)throw new Error(`Insufficient balance to cover fee. Balance: ${d}, Fee: ${a.flatFee}`);const t=[-i];W.mergeWithFeeStructure(e.getCurrentChainId(),o,t,a);const u={externalActionId:0n,externalAddress:l,externalActionMetadata:"0x00"},s=[...await Z.addPaddingToUtxos(e,o,t,void 0,void 0,!1,!0)],g=`swapperM${t.length.toString()}x${s[0].length}x1`,r=R.defaultHinkalLogicArgs(t.length,e.userKeys),q=N.getCurrentTimeInSeconds().toString(),p=[];for(let n=0;n<o.length;n+=1){const{outputUtxos:S}=P.outputUtxoProcessing(e.userKeys,s[n],t[n],q,void 0,!1);p.push(S);const{useApprovalUtxoData:x}=_.outputApprovalDataProcessing(e,s[n],t[n]);x&&(r.useApprovalUtxoData[n]=x,r.doPreTxApproval=!0)}const m=await e.getRandomRelay(!0);if(!m)throw Error(k.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const{patchAccessTokenMerkleTree:h,kycRequired:f,hasAccessToken:C}=await L.shouldPatchAccessTokenMerkleTree(e,o,t),w=await K.getSignatureDataForTransact(e.getCurrentChainId(),await e.getEthereumAddress(),e.userKeys,f,C),{zkCallData:y,circomData:v,dimData:I}=await D.constructZkProof("v1x1",e.merkleTreeHinkal,e.merkleTreeAccessToken,s,p,e.userKeys,g,u.externalActionId,u.externalAddress,u.externalActionMetadata,e.generateProofRemotely,m,e.getCurrentChainId(),void 0,void 0,void 0,void 0,h,r,void 0,a,e.getContractWithFetcher(B.ContractType.HinkalHelperContract),w,void 0,!1),U=$.constructAdminData(b.AdminTransactionType.WithdrawOnChainUtxos,e.getCurrentChainId(),o,t,await e.getEthereumAddress());return{tx:await E.transactCallRelayer(e.getCurrentChainId(),y,I,v,void 0,void 0,void 0,U),amountToRecipient:i}},Y=async(e,c,d)=>{const l=[],o=e.getCurrentChainId(),A=j.encodeTokenWithId(o,{erc20TokenAddress:c.erc20TokenAddress,tokenId:0}),a=await e.getEthereumAddress(),i=G.hashEthereumAddress(a);for(;;){const t=((await O.getInputUtxoAndBalancePerToken({hinkal:e,sliceIfMore6:!1,useBlockedUtxos:!0}))?.get(A)??[]).filter(r=>r.amount>0n).slice(0,6).sort((r,q)=>Number(q.amount-r.amount)),u=H.countTotalAmountInUtxos(t);if(!u)break;const s=t.map(r=>r.nullifier).filter(r=>!!r),{tx:g}=await V(e,c,u,d);s.length>0&&await z.deleteUnspentUtxos(o,i,s),l.push(g)}return l};exports.hinkalWithdrawStuckUtxos=Y;
@@ -1,4 +1,4 @@
1
1
  import { IHinkal } from './IHinkal';
2
- import { AdminTransactionType, ERC20Token } from '../../types';
2
+ import { ERC20Token } from '../../types';
3
3
  import { RelayerTransaction } from '../../types/relayer.types';
4
- export declare const hinkalWithdrawStuckUtxos: (hinkal: IHinkal, erc20Token: ERC20Token, recipientAddress: string, action?: AdminTransactionType) => Promise<RelayerTransaction[]>;
4
+ export declare const hinkalWithdrawStuckUtxos: (hinkal: IHinkal, erc20Token: ERC20Token, recipientAddress: string) => Promise<RelayerTransaction[]>;
@@ -1,15 +1,16 @@
1
- import { transactionErrorCodes as P } from "../../error-handling/error-codes.constants.mjs";
2
- import { outputUtxoProcessing as R } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
3
- import { constructZkProof as k } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
4
- import { transactCallRelayer as F } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
5
- import { ExternalActionId as M } from "../../types/external-action.types.mjs";
6
- import { defaultHinkalLogicArgs as K } from "../../types/hinkal.types.mjs";
7
- import { outputApprovalDataProcessing as L } from "../../functions/pre-transaction/outputApprovalDataProcessing.mjs";
8
- import { getFeeStructure as B } from "../../functions/pre-transaction/getFeeStructure.mjs";
9
- import { mergeWithFeeStructure as H } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
1
+ import { transactionErrorCodes as S } from "../../error-handling/error-codes.constants.mjs";
2
+ import { outputUtxoProcessing as P } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
3
+ import { constructZkProof as R } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
4
+ import { transactCallRelayer as k } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
5
+ import { ExternalActionId as F } from "../../types/external-action.types.mjs";
6
+ import { defaultHinkalLogicArgs as M } from "../../types/hinkal.types.mjs";
7
+ import { outputApprovalDataProcessing as K } from "../../functions/pre-transaction/outputApprovalDataProcessing.mjs";
8
+ import { getFeeStructure as L } from "../../functions/pre-transaction/getFeeStructure.mjs";
9
+ import { mergeWithFeeStructure as W } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
10
10
  import "../../types/circom-data.types.mjs";
11
- import { ContractType as W } from "../../types/ethereum-network.types.mjs";
11
+ import { ContractType as B } from "../../types/ethereum-network.types.mjs";
12
12
  import "../../types/transactions.types.mjs";
13
+ import { AdminTransactionType as H } from "../../types/admin.types.mjs";
13
14
  import "../../types/activities.types.mjs";
14
15
  import { getSignatureDataForTransact as $ } from "../../functions/pre-transaction/getSignatureDataForTransact.mjs";
15
16
  import { shouldPatchAccessTokenMerkleTree as b } from "../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs";
@@ -32,116 +33,116 @@ import "../../functions/utils/mutexes.utils.mjs";
32
33
  import "@coral-xyz/anchor";
33
34
  import "@solana/web3.js";
34
35
  import "../crypto-keys/keys.mjs";
35
- import { getCurrentTimeInSeconds as _ } from "../../functions/utils/time.utils.mjs";
36
- import { constructAdminData as q } from "../../functions/pre-transaction/constructAdminData.mjs";
36
+ import { getCurrentTimeInSeconds as O } from "../../functions/utils/time.utils.mjs";
37
+ import { constructAdminData as _ } from "../../functions/pre-transaction/constructAdminData.mjs";
37
38
  import "@solana/spl-token";
38
- import { getInputUtxoAndBalancePerToken as z } from "../../functions/web3/events/getInputUtxoAndBalance.mjs";
39
- import { addPaddingToUtxos as O } from "../../functions/web3/events/getShieldedBalance.mjs";
39
+ import { getInputUtxoAndBalancePerToken as q } from "../../functions/web3/events/getInputUtxoAndBalance.mjs";
40
+ import { addPaddingToUtxos as z } from "../../functions/web3/events/getShieldedBalance.mjs";
40
41
  import { encodeTokenWithId as V } from "../../functions/utils/encodeTokenWithId.mjs";
41
42
  import { deleteUnspentUtxos as Y } from "../../API/unspent-utxos-calls.mjs";
42
43
  import { hashEthereumAddress as Z } from "../../functions/utils/addresses.mjs";
43
- const j = async (t, c, d, p, u) => {
44
- const o = [c.erc20TokenAddress], f = c.erc20TokenAddress, a = await B(
44
+ const j = async (t, m, d, u) => {
45
+ const o = [m.erc20TokenAddress], p = m.erc20TokenAddress, a = await L(
45
46
  t.getCurrentChainId(),
46
- f,
47
+ p,
47
48
  o,
48
- M.Transact
49
- ), m = d - a.flatFee;
50
- if (m <= 0n)
49
+ F.Transact
50
+ ), c = d - a.flatFee;
51
+ if (c <= 0n)
51
52
  throw new Error(`Insufficient balance to cover fee. Balance: ${d}, Fee: ${a.flatFee}`);
52
- const e = [-m];
53
- H(t.getCurrentChainId(), o, e, a);
53
+ const e = [-c];
54
+ W(t.getCurrentChainId(), o, e, a);
54
55
  const i = {
55
56
  externalActionId: 0n,
56
- externalAddress: p,
57
+ externalAddress: u,
57
58
  externalActionMetadata: "0x00"
58
59
  }, s = [
59
- ...await O(t, o, e, void 0, void 0, !1, !0)
60
- ], l = `swapperM${e.length.toString()}x${s[0].length}x1`, r = K(e.length, t.userKeys), A = _().toString(), g = [];
60
+ ...await z(t, o, e, void 0, void 0, !1, !0)
61
+ ], f = `swapperM${e.length.toString()}x${s[0].length}x1`, r = M(e.length, t.userKeys), l = O().toString(), A = [];
61
62
  for (let n = 0; n < o.length; n += 1) {
62
- const { outputUtxos: S } = R(
63
+ const { outputUtxos: D } = P(
63
64
  t.userKeys,
64
65
  s[n],
65
66
  e[n],
66
- A,
67
+ l,
67
68
  void 0,
68
69
  !1
69
70
  );
70
- g.push(S);
71
- const { useApprovalUtxoData: T } = L(t, s[n], e[n]);
72
- T && (r.useApprovalUtxoData[n] = T, r.doPreTxApproval = !0);
71
+ A.push(D);
72
+ const { useApprovalUtxoData: x } = K(t, s[n], e[n]);
73
+ x && (r.useApprovalUtxoData[n] = x, r.doPreTxApproval = !0);
73
74
  }
74
- const x = await t.getRandomRelay(!0);
75
- if (!x)
76
- throw Error(P.RELAYER_NOT_AVAILABLE);
77
- const { patchAccessTokenMerkleTree: C, kycRequired: h, hasAccessToken: v } = await b(
75
+ const g = await t.getRandomRelay(!0);
76
+ if (!g)
77
+ throw Error(S.RELAYER_NOT_AVAILABLE);
78
+ const { patchAccessTokenMerkleTree: w, kycRequired: C, hasAccessToken: h } = await b(
78
79
  t,
79
80
  o,
80
81
  e
81
- ), I = await $(
82
+ ), v = await $(
82
83
  t.getCurrentChainId(),
83
84
  await t.getEthereumAddress(),
84
85
  t.userKeys,
85
- h,
86
- v
87
- ), { zkCallData: y, circomData: U, dimData: E } = await k(
86
+ C,
87
+ h
88
+ ), { zkCallData: I, circomData: y, dimData: U } = await R(
88
89
  "v1x1",
89
90
  t.merkleTreeHinkal,
90
91
  t.merkleTreeAccessToken,
91
92
  s,
92
- g,
93
+ A,
93
94
  t.userKeys,
94
- l,
95
+ f,
95
96
  i.externalActionId,
96
97
  i.externalAddress,
97
98
  i.externalActionMetadata,
98
99
  t.generateProofRemotely,
99
- x,
100
+ g,
100
101
  t.getCurrentChainId(),
101
102
  void 0,
102
103
  void 0,
103
104
  void 0,
104
105
  void 0,
105
- C,
106
+ w,
106
107
  r,
107
108
  void 0,
108
109
  a,
109
- t.getContractWithFetcher(W.HinkalHelperContract),
110
- I,
110
+ t.getContractWithFetcher(B.HinkalHelperContract),
111
+ v,
111
112
  void 0,
112
113
  !1
113
- ), D = q(
114
- u,
114
+ ), E = _(
115
+ H.WithdrawOnChainUtxos,
115
116
  t.getCurrentChainId(),
116
117
  o,
117
118
  e,
118
119
  await t.getEthereumAddress()
119
120
  );
120
- return { tx: await F(
121
+ return { tx: await k(
121
122
  t.getCurrentChainId(),
122
- y,
123
- E,
123
+ I,
124
124
  U,
125
+ y,
125
126
  void 0,
126
127
  void 0,
127
128
  void 0,
128
- D
129
- ), amountToRecipient: m };
130
- }, $t = async (t, c, d, p) => {
131
- const u = [], o = t.getCurrentChainId(), f = V(o, { erc20TokenAddress: c.erc20TokenAddress, tokenId: 0 }), a = await t.getEthereumAddress(), m = Z(a);
129
+ E
130
+ ), amountToRecipient: c };
131
+ }, bt = async (t, m, d) => {
132
+ const u = [], o = t.getCurrentChainId(), p = V(o, { erc20TokenAddress: m.erc20TokenAddress, tokenId: 0 }), a = await t.getEthereumAddress(), c = Z(a);
132
133
  for (; ; ) {
133
- const e = ((await z({
134
+ const e = ((await q({
134
135
  hinkal: t,
135
136
  sliceIfMore6: !1,
136
137
  useBlockedUtxos: !0
137
- }))?.get(f) ?? []).filter((r) => r.amount > 0n).slice(0, 6).sort((r, A) => Number(A.amount - r.amount)), i = N(e);
138
+ }))?.get(p) ?? []).filter((r) => r.amount > 0n).slice(0, 6).sort((r, l) => Number(l.amount - r.amount)), i = N(e);
138
139
  if (!i)
139
140
  break;
140
- const s = e.map((r) => r.nullifier).filter((r) => !!r), { tx: l } = await j(t, c, i, d, p);
141
- s.length > 0 && await Y(o, m, s), u.push(l);
141
+ const s = e.map((r) => r.nullifier).filter((r) => !!r), { tx: f } = await j(t, m, i, d);
142
+ s.length > 0 && await Y(o, c, s), u.push(f);
142
143
  }
143
144
  return u;
144
145
  };
145
146
  export {
146
- $t as hinkalWithdrawStuckUtxos
147
+ bt as hinkalWithdrawStuckUtxos
147
148
  };