@gurge/sdk 0.3.9 → 0.3.11

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 (54) hide show
  1. package/common/src/API/enclaveSignatureCalls.cjs +1 -1
  2. package/common/src/API/enclaveSignatureCalls.d.ts +1 -1
  3. package/common/src/API/enclaveSignatureCalls.mjs +1 -1
  4. package/common/src/API/getServerURL.cjs +1 -1
  5. package/common/src/API/getServerURL.mjs +2 -2
  6. package/common/src/constants/protocol.constants.cjs +1 -1
  7. package/common/src/constants/protocol.constants.d.ts +2 -0
  8. package/common/src/constants/protocol.constants.mjs +2 -2
  9. package/common/src/constants/server.constants.cjs +1 -1
  10. package/common/src/constants/server.constants.d.ts +1 -1
  11. package/common/src/constants/server.constants.mjs +2 -2
  12. package/common/src/data-structures/Hinkal/Hinkal.cjs +1 -1
  13. package/common/src/data-structures/Hinkal/Hinkal.d.ts +5 -1
  14. package/common/src/data-structures/Hinkal/Hinkal.mjs +125 -112
  15. package/common/src/data-structures/Hinkal/IHinkal.d.ts +5 -1
  16. package/common/src/error-handling/error-codes.constants.cjs +1 -1
  17. package/common/src/error-handling/error-codes.constants.d.ts +2 -0
  18. package/common/src/error-handling/error-codes.constants.mjs +2 -0
  19. package/common/src/functions/pre-transaction/sendV0Transaction.cjs +2 -1
  20. package/common/src/functions/pre-transaction/sendV0Transaction.mjs +2 -2
  21. package/common/src/functions/snarkjs/constant.cjs +1 -1
  22. package/common/src/functions/snarkjs/constant.mjs +1 -1
  23. package/common/src/functions/utils/enclave-signature-storage.cjs +1 -1
  24. package/common/src/functions/utils/enclave-signature-storage.d.ts +1 -1
  25. package/common/src/functions/utils/enclave-signature-storage.mjs +1 -1
  26. package/common/src/functions/utils/erc20tokenFunctions.cjs +1 -1
  27. package/common/src/functions/utils/erc20tokenFunctions.d.ts +1 -0
  28. package/common/src/functions/utils/erc20tokenFunctions.mjs +3 -3
  29. package/common/src/webworker/package.json +1 -1
  30. package/common/src/webworker/viteWorkerURL.constant.cjs +3 -3
  31. package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
  32. package/functions/index.cjs +1 -1
  33. package/functions/index.mjs +0 -1
  34. package/functions/integrations/swapApi.cjs +1 -1
  35. package/functions/integrations/swapApi.d.ts +2 -2
  36. package/functions/integrations/swapApi.mjs +5 -4
  37. package/functions/utils/index.cjs +1 -1
  38. package/functions/utils/index.d.ts +0 -1
  39. package/functions/utils/index.mjs +0 -1
  40. package/index.cjs +1 -1
  41. package/index.mjs +2 -3
  42. package/internal/token.utils.cjs +1 -0
  43. package/internal/token.utils.d.ts +7 -0
  44. package/internal/token.utils.mjs +38 -0
  45. package/package.json +1 -1
  46. package/services/Hinkal.cjs +1 -1
  47. package/services/Hinkal.d.ts +20 -20
  48. package/services/Hinkal.mjs +45 -44
  49. package/types/IHinkal.d.ts +21 -19
  50. package/types/balances.types.d.ts +12 -1
  51. package/types/token.types.d.ts +5 -1
  52. package/functions/utils/getERC20Token.cjs +0 -1
  53. package/functions/utils/getERC20Token.d.ts +0 -2
  54. package/functions/utils/getERC20Token.mjs +0 -5
@@ -1,66 +1,67 @@
1
1
  import { CustomJSONStringify as e } from "../../functions/utils/serialize.utils.mjs";
2
2
  import { isExtension as t } from "../../constants/vite.constants.mjs";
3
3
  import { HINKAL_SUPPORTED_CHAINS as n, WALLET_SUPPORTED_CHAINS as r, chainIds as i, currentSolanaChainId as a, currentTronChainId as o, isSameOnchainNetwork as s, isSolanaLike as c, isTronLike as l, networkRegistry as u, setHinkalTronChainId as d } from "../../constants/chains.constants.mjs";
4
- import { EventType as f, LoginMessageMode as p } from "../../types/hinkal.types.mjs";
5
- import { ContractType as ee } from "../../types/ethereum-network.types.mjs";
6
- import { poseidonFunction as te } from "../../crypto/poseidon.mjs";
7
- import { transactionErrorCodes as ne } from "../../error-handling/error-codes.constants.mjs";
8
- import { UserKeys as m } from "../crypto-keys/keys.mjs";
9
- import { API as h } from "../../API/API.mjs";
10
- import { validateAndGetChainId as g } from "../../functions/utils/token-check.utils.mjs";
11
- import { privateTokensDB as re } from "../TokenDBs/PrivateTokensDB.mjs";
12
- import { getErc20TokensForChainAPI as _ } from "../../functions/utils/erc20tokenFunctions.mjs";
13
- import { getShieldedBalance as v } from "../../functions/web3/events/getShieldedBalance.mjs";
14
- import { getMerkleAccountPublicKey as y } from "../../functions/pre-transaction/solana.mjs";
15
- import { getContractWithFetcherByChainId as b } from "../../functions/web3/getContractMetadata.mjs";
16
- import { supportedPassportLinks as x } from "../../constants/kyc.constants.mjs";
17
- import { reloadPage as S } from "../../functions/utils/reloadPage.mjs";
18
- import { createCacheDevice as C } from "../../functions/utils/cacheDevice.utils.mjs";
19
- import { SolanaProviderAdapter as w } from "../../providers/SolanaProviderAdapter.mjs";
20
- import { storeAndGetSignatureFromEnclave as T } from "../../functions/utils/enclave-signature-storage.mjs";
21
- import { generateHashFromSeedPhrases as E } from "../../functions/utils/mnemonics.mjs";
22
- import { fetchSolanaMerkleTreeRootHash as D } from "../../functions/web3/fetchSolanaMerkleTreeRootHash.mjs";
23
- import { createTransaferEmporiumOpsBatch as O } from "../../functions/private-wallet/emporium.helpers.mjs";
24
- import { hinkalDeposit as k, hinkalDepositForOther as A } from "./hinkalDeposit.mjs";
4
+ import { DETERMINISTIC_SOLANA_LEDGER_BLOCKHASH as f, DETERMINISTIC_SOLANA_LEDGER_LAST_VALID_BLOCK_HEIGHT as p } from "../../constants/protocol.constants.mjs";
5
+ import { EventType as ee, LoginMessageMode as m } from "../../types/hinkal.types.mjs";
6
+ import { ContractType as te } from "../../types/ethereum-network.types.mjs";
7
+ import { poseidonFunction as ne } from "../../crypto/poseidon.mjs";
8
+ import { transactionErrorCodes as re } from "../../error-handling/error-codes.constants.mjs";
9
+ import { UserKeys as h } from "../crypto-keys/keys.mjs";
10
+ import { API as g } from "../../API/API.mjs";
11
+ import { validateAndGetChainId as _ } from "../../functions/utils/token-check.utils.mjs";
12
+ import { privateTokensDB as v } from "../TokenDBs/PrivateTokensDB.mjs";
13
+ import { getErc20TokensForChainAPI as y } from "../../functions/utils/erc20tokenFunctions.mjs";
14
+ import { getShieldedBalance as b } from "../../functions/web3/events/getShieldedBalance.mjs";
15
+ import { getMerkleAccountPublicKey as x } from "../../functions/pre-transaction/solana.mjs";
16
+ import { getContractWithFetcherByChainId as S } from "../../functions/web3/getContractMetadata.mjs";
17
+ import { supportedPassportLinks as C } from "../../constants/kyc.constants.mjs";
18
+ import { reloadPage as w } from "../../functions/utils/reloadPage.mjs";
19
+ import { createCacheDevice as T } from "../../functions/utils/cacheDevice.utils.mjs";
20
+ import { SolanaProviderAdapter as E } from "../../providers/SolanaProviderAdapter.mjs";
21
+ import { storeAndGetSignatureFromEnclave as D } from "../../functions/utils/enclave-signature-storage.mjs";
22
+ import { generateHashFromSeedPhrases as O } from "../../functions/utils/mnemonics.mjs";
23
+ import { fetchSolanaMerkleTreeRootHash as k } from "../../functions/web3/fetchSolanaMerkleTreeRootHash.mjs";
24
+ import { createTransaferEmporiumOpsBatch as A } from "../../functions/private-wallet/emporium.helpers.mjs";
25
+ import { hinkalDeposit as j, hinkalDepositForOther as M } from "./hinkalDeposit.mjs";
25
26
  import "../../API/index.mjs";
26
- import { checkTokenLimitsUSD as j } from "../../functions/kyc/checkTokenLimitsUSD.mjs";
27
+ import { checkTokenLimitsUSD as N } from "../../functions/kyc/checkTokenLimitsUSD.mjs";
27
28
  import "../../functions/index.mjs";
28
- import { hinkalDepositAndWithdraw as M } from "./hinkalDepositAndWithdraw.mjs";
29
- import { hinkalSolanaDeposit as N, hinkalSolanaDepositForOther as P, hinkalSolanaProoflessDepositWithPublicFee as F } from "./hinkalSolanaDeposit.mjs";
30
- import { hinkalSwap as I } from "./hinkalSwap.mjs";
31
- import { hinkalWithdraw as L } from "./hinkalWithdraw.mjs";
32
- import { MerkleTree as R } from "../merkle-tree/MerkleTree.mjs";
29
+ import { hinkalDepositAndWithdraw as P } from "./hinkalDepositAndWithdraw.mjs";
30
+ import { hinkalSolanaDeposit as F, hinkalSolanaDepositForOther as I, hinkalSolanaProoflessDepositWithPublicFee as L } from "./hinkalSolanaDeposit.mjs";
31
+ import { hinkalSwap as R } from "./hinkalSwap.mjs";
32
+ import { hinkalWithdraw as z } from "./hinkalWithdraw.mjs";
33
+ import { MerkleTree as B } from "../merkle-tree/MerkleTree.mjs";
33
34
  import "../merkle-tree/index.mjs";
34
- import { resetMerkleTrees as z } from "./resetMerkleTrees.mjs";
35
- import { MultiThreadedUtxoUtils as B } from "../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs";
36
- import { hinkalPrivateWallet as ie } from "./hinkalPrivateWallet.mjs";
37
- import { getRecipientInfo as V } from "./hinkalGetRecipientInfo.mjs";
38
- import { hinkalSignSubAccount as H } from "./hinkalSignSubAccount.mjs";
39
- import { hinkalActionReceive as U } from "./hinkalActionReceive.mjs";
35
+ import { resetMerkleTrees as V } from "./resetMerkleTrees.mjs";
36
+ import { MultiThreadedUtxoUtils as ie } from "../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs";
37
+ import { hinkalPrivateWallet as H } from "./hinkalPrivateWallet.mjs";
38
+ import { getRecipientInfo as U } from "./hinkalGetRecipientInfo.mjs";
39
+ import { hinkalSignSubAccount as W } from "./hinkalSignSubAccount.mjs";
40
+ import { hinkalActionReceive as G } from "./hinkalActionReceive.mjs";
40
41
  import "../TokenDBs/index.mjs";
41
- import { hinkalProoflessDeposit as W, hinkalProoflessDepositWithPublicFee as G } from "./hinkalProoflessDeposit.mjs";
42
- import { hinkalProxySwap as K } from "./hinkalProxySwap.mjs";
43
- import { hinkalMultiSendPrivateRecipients as q } from "./hinkalMultiSend.mjs";
44
- import { hinkalTransfer as J } from "./hinkalTransfer.mjs";
45
- import { hinkalProxyToPrivate as Y } from "./hinkalProxyToPrivate.mjs";
42
+ import { hinkalProoflessDeposit as K, hinkalProoflessDepositWithPublicFee as q } from "./hinkalProoflessDeposit.mjs";
43
+ import { hinkalProxySwap as J } from "./hinkalProxySwap.mjs";
44
+ import { hinkalMultiSendPrivateRecipients as Y } from "./hinkalMultiSend.mjs";
45
+ import { hinkalTransfer as ae } from "./hinkalTransfer.mjs";
46
+ import { hinkalProxyToPrivate as oe } from "./hinkalProxyToPrivate.mjs";
46
47
  import { TronProviderAdapter as X } from "../../providers/TronProviderAdapter.mjs";
47
- import { hinkalSolanaDepositAndWithdraw as ae } from "./hinkalSolanaDepositAndWithdraw.mjs";
48
- import { hinkalSolanaWithdraw as oe } from "./hinkalSolanaWithdraw.mjs";
49
- import { hinkalSolanaTransfer as se } from "./hinkalSolanaTransfer.mjs";
50
- import { hinkalSolanaSwap as ce } from "./hinkalSolanaSwap.mjs";
51
- import { hinkalSolanaProxySend as le } from "./hinkalSolanaProxySend.mjs";
52
- import { hinkalSolanaProxySwap as ue } from "./hinkalSolanaProxySwap.mjs";
48
+ import { hinkalSolanaDepositAndWithdraw as se } from "./hinkalSolanaDepositAndWithdraw.mjs";
49
+ import { hinkalSolanaWithdraw as ce } from "./hinkalSolanaWithdraw.mjs";
50
+ import { hinkalSolanaTransfer as le } from "./hinkalSolanaTransfer.mjs";
51
+ import { hinkalSolanaSwap as ue } from "./hinkalSolanaSwap.mjs";
52
+ import { hinkalSolanaProxySend as de } from "./hinkalSolanaProxySend.mjs";
53
+ import { hinkalSolanaProxySwap as fe } from "./hinkalSolanaProxySwap.mjs";
53
54
  import { hinkalSolanaProxyShield as Z } from "./hinkalSolanaProxyShield.mjs";
54
- import { hinkalDepositAndBridge as de } from "./hinkalDepositAndBridge.mjs";
55
- import { hinkalNearDepositAndBridge as fe } from "./hinkalNearDepositAndBridge.mjs";
56
- import { hinkalClaimUtxo as pe } from "./hinkalClaimUtxo.mjs";
57
- import { hinkalSolanaProoflessDeposit as me } from "./hinkalSolanaProoflessDeposit.mjs";
58
- import { hinkalSolanaClaimUtxo as Q } from "./hinkalSolanaClaimUtxo.mjs";
59
- import { hinkalWithdrawStuckUtxos as he } from "./hinkalWithdrawStuckUtxos.mjs";
60
- import { HinkalPrivateBalanceController as ge } from "./HinkalPrivateBalanceController.mjs";
61
- import { PublicKey as $ } from "@solana/web3.js";
55
+ import { hinkalDepositAndBridge as pe } from "./hinkalDepositAndBridge.mjs";
56
+ import { hinkalNearDepositAndBridge as me } from "./hinkalNearDepositAndBridge.mjs";
57
+ import { hinkalClaimUtxo as Q } from "./hinkalClaimUtxo.mjs";
58
+ import { hinkalSolanaProoflessDeposit as he } from "./hinkalSolanaProoflessDeposit.mjs";
59
+ import { hinkalSolanaClaimUtxo as ge } from "./hinkalSolanaClaimUtxo.mjs";
60
+ import { hinkalWithdrawStuckUtxos as _e } from "./hinkalWithdrawStuckUtxos.mjs";
61
+ import { HinkalPrivateBalanceController as ve } from "./HinkalPrivateBalanceController.mjs";
62
+ import { PublicKey as $, Transaction as ye } from "@solana/web3.js";
62
63
  //#region libs/shared/common/src/data-structures/Hinkal/Hinkal.ts
63
- var _e = class {
64
+ var be = class {
64
65
  ethereumProviderAdapter;
65
66
  solanaProviderAdapter;
66
67
  tronProviderAdapter;
@@ -77,11 +78,11 @@ var _e = class {
77
78
  cacheDevice;
78
79
  generateProofRemotely;
79
80
  disableMerkleTreeUpdates;
80
- privateBalances = new ge(this);
81
+ privateBalances = new ve(this);
81
82
  constructor(e) {
82
- this.userKeys = new m(void 0), e?.tronChainOverride && d(e.tronChainOverride), n.forEach((e) => {
83
- this.merkleTreeHinkalByChain[e] = R.create(te, 0n), this.nullifiersByChain[e] = /* @__PURE__ */ new Set(), this.encryptedOutputsByChain[e] = [];
84
- }), this.generateProofRemotely = e?.generateProofRemotely ?? !0, this.utxoUtils = new B(), this.cacheDevice = C(e), this.disableMerkleTreeUpdates = e?.disableMerkleTreeUpdates ?? !1;
83
+ this.userKeys = new h(void 0), e?.tronChainOverride && d(e.tronChainOverride), n.forEach((e) => {
84
+ this.merkleTreeHinkalByChain[e] = B.create(ne, 0n), this.nullifiersByChain[e] = /* @__PURE__ */ new Set(), this.encryptedOutputsByChain[e] = [];
85
+ }), this.generateProofRemotely = e?.generateProofRemotely ?? !0, this.utxoUtils = new ie(), this.cacheDevice = T(e), this.disableMerkleTreeUpdates = e?.disableMerkleTreeUpdates ?? !1;
85
86
  }
86
87
  enforceRateLimit(t, n, r = 1e3) {
87
88
  let i = Date.now(), a = e(n), o = this.lastCallState.get(t);
@@ -100,38 +101,50 @@ var _e = class {
100
101
  }
101
102
  async initProviderAdapter(e, t) {
102
103
  let n = i.ethMainnet;
103
- t instanceof w ? n = a : t instanceof X && (n = o), await this.updateProviderAdapter(n, t), t.initConnector(e);
104
+ t instanceof E ? n = a : t instanceof X && (n = o), await this.updateProviderAdapter(n, t), t.initConnector(e);
104
105
  let r = await t.connectAndPatchProvider(e);
105
106
  await t.init(r), await this.setListeners();
106
107
  }
107
- getSigningMessage(e = p.PROTOCOL) {
108
+ getSigningMessage(e = m.PROTOCOL) {
108
109
  switch (e) {
109
- case p.PRIVATE_TRANSFER: return this.privateTransferSigningMessage;
110
- case p.PROTOCOL:
110
+ case m.PRIVATE_TRANSFER: return this.privateTransferSigningMessage;
111
+ case m.PROTOCOL:
111
112
  default: return this.signingMessage;
112
113
  }
113
114
  }
114
- async signHinkalMessage(e = p.PROTOCOL) {
115
+ async signHinkalMessage(e = m.PROTOCOL) {
115
116
  let t = this.getSigningMessage(e);
116
117
  return this.getProviderAdapter().signMessage(t);
117
118
  }
118
- async initUserKeys(e = p.PROTOCOL) {
119
- this.userKeys = new m(await this.signHinkalMessage(e));
119
+ async signSolanaLedgerMessage() {
120
+ let e = new ye({
121
+ blockhash: f,
122
+ lastValidBlockHeight: p,
123
+ feePayer: this.getSolanaPublicKey()
124
+ }), t = await this.getProviderAdapter().signTransactionWithoutBroadcast?.(e);
125
+ if (!t) throw Error("Failed to sign transaction without broadcast");
126
+ return {
127
+ signature: t.signature,
128
+ txMessageForSolanaLedger: t.transactionMessageB64
129
+ };
130
+ }
131
+ async initUserKeys(e = m.PROTOCOL) {
132
+ this.userKeys = new h(await this.signHinkalMessage(e));
120
133
  }
121
134
  initUserKeysWithSignature(e) {
122
- this.userKeys = new m(e);
135
+ this.userKeys = new h(e);
123
136
  }
124
137
  async initUserKeysFromSeedPhrases(e) {
125
- let t = E(e);
126
- this.userKeys = new m(t);
138
+ let t = O(e);
139
+ this.userKeys = new h(t);
127
140
  }
128
- async storeAndGetInitialSignature(e, t, n) {
141
+ async storeAndGetInitialSignature(e, t = !1, n) {
129
142
  let r = await this.getEthereumAddress();
130
143
  if (!r) throw Error("Connected address not found");
131
- return await T(r, e, t, n);
144
+ return await D(r, e, t, n);
132
145
  }
133
146
  async resetMerkle(e) {
134
- this.disableMerkleTreeUpdates || (e?.every((e) => this.isSelectedNetworkSupported(e)) ?? !0) && await z(this, e);
147
+ this.disableMerkleTreeUpdates || (e?.every((e) => this.isSelectedNetworkSupported(e)) ?? !0) && await V(this, e);
135
148
  }
136
149
  getTronWeb() {
137
150
  let e = this.tronProviderAdapter;
@@ -151,7 +164,7 @@ var _e = class {
151
164
  return this.getProviderAdapter(e).getContract(e, t, n);
152
165
  }
153
166
  getContractWithFetcherByChainId(e, t, n = void 0) {
154
- return b(e, t, n);
167
+ return S(e, t, n);
155
168
  }
156
169
  async signMessage(e) {
157
170
  return await this.getProviderAdapter().signMessage(e);
@@ -160,7 +173,7 @@ var _e = class {
160
173
  return await this.getProviderAdapter().signTypedData(e, t, n);
161
174
  }
162
175
  async signWithSubAccount(e, t, n, r) {
163
- return H(e, t, n, r);
176
+ return W(e, t, n, r);
164
177
  }
165
178
  getContractWithSigner(e, t, n = "") {
166
179
  return this.getProviderAdapter(e).getContractWithSigner(e, t, n);
@@ -176,7 +189,7 @@ var _e = class {
176
189
  if (!(e.chainId === n || r)) try {
177
190
  await t.switchNetwork(e);
178
191
  } catch {
179
- throw Error(ne.FAILED_TO_SWITCH_NETWORKS);
192
+ throw Error(re.FAILED_TO_SWITCH_NETWORKS);
180
193
  }
181
194
  }
182
195
  isPermitterAvailable(e) {
@@ -221,20 +234,20 @@ var _e = class {
221
234
  }
222
235
  async onAccountChanged() {
223
236
  await this.ethereumProviderAdapter?.onAccountChanged(), await this.solanaProviderAdapter?.onAccountChanged(), await this.tronProviderAdapter?.onAccountChanged();
224
- let e = f.AccountChanged;
237
+ let e = ee.AccountChanged;
225
238
  typeof document < "u" ? document?.dispatchEvent(new Event(e)) : process?.emit("message", e, void 0);
226
239
  }
227
240
  async onChainChanged(e) {
228
- e ? await this.getProviderAdapter(e).onChainChanged(e) : (await this.disconnectFromConnector(), S());
241
+ e ? await this.getProviderAdapter(e).onChainChanged(e) : (await this.disconnectFromConnector(), w());
229
242
  }
230
243
  async monitorConnectedAddress(e) {
231
- await h.monitor(await this.getEthereumAddressByChain(e));
244
+ await g.monitor(await this.getEthereumAddressByChain(e));
232
245
  }
233
246
  async getBalances(e, t, n, r, i = !1, a, o = !1) {
234
- return v(this, e, t, n, r, i, this.generateProofRemotely, a, o);
247
+ return b(this, e, t, n, r, i, this.generateProofRemotely, a, o);
235
248
  }
236
249
  async getTotalBalance(e, n, r, i = !1, a, o = !1) {
237
- let s = r ?? await this.getEthereumAddressByChain(e), c = n ?? this.userKeys, l = await this.getBalances(e, c.getShieldedPrivateKey(), c.getShieldedPublicKey(), s, i, a, o), u = t ? await re.getPrivateTokens(e, s) : await _(e), d = [];
250
+ let s = r ?? await this.getEthereumAddressByChain(e), c = n ?? this.userKeys, l = await this.getBalances(e, c.getShieldedPrivateKey(), c.getShieldedPublicKey(), s, i, a, o), u = t ? await v.getPrivateTokens(e, s) : await y(e), d = [];
238
251
  return u.forEach((e) => {
239
252
  let t = e.erc20TokenAddress.toLowerCase(), n = l.get(t), r = {
240
253
  token: e,
@@ -255,22 +268,22 @@ var _e = class {
255
268
  return this.privateBalances.onPrivateBalancesWithUSDChange(e);
256
269
  }
257
270
  getSupportedPassportLinks() {
258
- return x;
271
+ return C;
259
272
  }
260
273
  checkAccessToken(e, t) {
261
274
  return Promise.resolve(!0);
262
275
  }
263
276
  checkExternalTokenLimitsUSD(e, t, n) {
264
- return j(e, t, n);
277
+ return N(e, t, n);
265
278
  }
266
279
  async getHinkalTreeRootHash(e) {
267
280
  if (c(e)) {
268
281
  let { hinkalIdl: t, hinkalAddress: n, originalDeployer: r } = u[e].contractData;
269
282
  if (!t || !n || !r) throw Error(`Missing Solana configuration for chain ${e}`);
270
- let i = new $(r), a = y(new $(n), i);
271
- return D(this.getSolanaProgram(t), a);
283
+ let i = new $(r), a = x(new $(n), i);
284
+ return k(this.getSolanaProgram(t), a);
272
285
  }
273
- return this.getContractWithFetcherByChainId(e, ee.HinkalContract).getRootHash();
286
+ return this.getContractWithFetcherByChainId(e, te.HinkalContract).getRootHash();
274
287
  }
275
288
  async resetMerkleTreesIfNecessary(e) {
276
289
  let t = (await Promise.all((e ?? this.getSupportedChains()).map(async (e) => {
@@ -291,7 +304,7 @@ var _e = class {
291
304
  return this.getProviderAdapter(e).getAddress();
292
305
  }
293
306
  async getRandomRelay(e, t = !1) {
294
- return (await h.getIdleRelay(e, t)).relay;
307
+ return (await g.getIdleRelay(e, t)).relay;
295
308
  }
296
309
  getGasPrice(e) {
297
310
  let t = this.getProviderAdapter(e);
@@ -299,7 +312,7 @@ var _e = class {
299
312
  return t.getGasPrice(e);
300
313
  }
301
314
  getAPI() {
302
- return h;
315
+ return g;
303
316
  }
304
317
  snapshotsClearInterval() {
305
318
  this.getSupportedChains().forEach((e) => {
@@ -307,36 +320,36 @@ var _e = class {
307
320
  });
308
321
  }
309
322
  getRecipientInfo() {
310
- return V(this);
323
+ return U(this);
311
324
  }
312
325
  async deposit(e, t, n = !0, r = !1) {
313
- return k(this, e, t, n, r);
326
+ return j(this, e, t, n, r);
314
327
  }
315
328
  async depositSolana(e, t, n = !1) {
316
- return N(this, e, t, n);
329
+ return F(this, e, t, n);
317
330
  }
318
331
  async depositForOther(e, t, n, r = !0, i = !1, a) {
319
332
  return this.enforceRateLimit(this.depositForOther.name, [
320
333
  e,
321
334
  t,
322
335
  n
323
- ]), A(this, e, t, n, r, i, a);
336
+ ]), M(this, e, t, n, r, i, a);
324
337
  }
325
338
  async depositSolanaForOther(e, t, n, r = !1, i) {
326
339
  return this.enforceRateLimit(this.depositSolanaForOther.name, [
327
340
  e,
328
341
  t,
329
342
  n
330
- ]), P(this, e, t, n, r, i);
343
+ ]), I(this, e, t, n, r, i);
331
344
  }
332
345
  async depositAndWithdraw(e, t, n, r, i, a, o, s, l = !0) {
333
- return c(g([e])) ? ae(this, e, t, n, r, i, a, o, s) : M(this, e, t, n, r, i, a, o, s, l);
346
+ return c(_([e])) ? se(this, e, t, n, r, i, a, o, s) : P(this, e, t, n, r, i, a, o, s, l);
334
347
  }
335
348
  async claimUtxo(e, t, n, r) {
336
- return c(g([e])) ? Q(this, e, t, n, r) : pe(this, e, t, n, r);
349
+ return c(_([e])) ? ge(this, e, t, n, r) : Q(this, e, t, n, r);
337
350
  }
338
351
  async depositAndBridge(e, t, n, r, i, a, o, s = !0) {
339
- return de(this, e, t, n, r, i, a, o, s);
352
+ return pe(this, e, t, n, r, i, a, o, s);
340
353
  }
341
354
  async nearDepositAndBridge(e, t, n, r, i, a, o, s, c) {
342
355
  return this.enforceRateLimit(this.nearDepositAndBridge.name, [
@@ -344,14 +357,14 @@ var _e = class {
344
357
  t,
345
358
  n,
346
359
  r
347
- ]), fe(this, e, t, n, r, i, a, o, s, c);
360
+ ]), me(this, e, t, n, r, i, a, o, s, c);
348
361
  }
349
362
  async prooflessDeposit(e, t, n, r, i = !1) {
350
- return c(g(e)) ? me(this, e, t, n, r, i) : W(this, e, t, n, r, i);
363
+ return c(_(e)) ? he(this, e, t, n, r, i) : K(this, e, t, n, r, i);
351
364
  }
352
365
  async prooflessDepositWithPublicFee(e, t, n, r, i) {
353
- let a = g([e]);
354
- return c(a) ? F(this, e, t, n, r, i) : G(this, a, e, t, n, r, i);
366
+ let a = _([e]);
367
+ return c(a) ? L(this, e, t, n, r, i) : q(this, a, e, t, n, r, i);
355
368
  }
356
369
  getSolanaProgram(e) {
357
370
  if (!this.solanaProviderAdapter) throw Error("No provider adapter initialized");
@@ -368,24 +381,24 @@ var _e = class {
368
381
  e,
369
382
  t,
370
383
  n
371
- ]), c(g(e)) ? se(this, e, t, n, r, i, a) : J(this, e, t, n, r, i, a);
384
+ ]), c(_(e)) ? le(this, e, t, n, r, i, a) : ae(this, e, t, n, r, i, a);
372
385
  }
373
386
  async withdraw(e, t, n, r, i, a, o) {
374
- return c(g(e)) ? oe(this, e, t, n, i, a, o) : L(this, e, t, n, r, i, a, o);
387
+ return c(_(e)) ? ce(this, e, t, n, i, a, o) : z(this, e, t, n, r, i, a, o);
375
388
  }
376
389
  async withdrawStuckUtxos(e, t) {
377
- return he(this, e, t);
390
+ return _e(this, e, t);
378
391
  }
379
392
  async swap(e, t, n, r, i, a, o) {
380
- return c(g(e)) ? this.swapSolana(e, t, r, i, a, o) : I(this, e, t, n, r, i, a, o);
393
+ return c(_(e)) ? this.swapSolana(e, t, r, i, a, o) : R(this, e, t, n, r, i, a, o);
381
394
  }
382
395
  async swapSolana(e, t, n, r, i, a) {
383
396
  let o = JSON.parse(n), s = BigInt(o.swapperAccountSalt), { instructionLists: c, addressLookupTableAccount: l } = o.data;
384
- return ce(this, e, t, s, c, l, r, i, a);
397
+ return ue(this, e, t, s, c, l, r, i, a);
385
398
  }
386
399
  async actionReceive(e, t, n, r, i, a) {
387
400
  if (!i) throw Error("subAccount is required");
388
- return c(g(e)) ? Z(this, e[0], t[0], i, void 0, a) : U(this, e, t, n, r, i, a);
401
+ return c(_(e)) ? Z(this, e[0], t[0], i, void 0, a) : G(this, e, t, n, r, i, a);
389
402
  }
390
403
  async actionPrivateWallet(e, t, n, r, i, a, o, s, c, l, u = !1, d, f, p) {
391
404
  return this.enforceRateLimit(this.actionPrivateWallet.name, [
@@ -399,23 +412,23 @@ var _e = class {
399
412
  s,
400
413
  c,
401
414
  p
402
- ]), ie(this, e, t, n, r, i, a, o, s, c, l, u, d, f, p);
415
+ ]), H(this, e, t, n, r, i, a, o, s, c, l, u, d, f, p);
403
416
  }
404
417
  async proxySwap(e, t, n, r, i, a, o, s, l = !1, u, d) {
405
- return c(g(e)) ? ue(this, e, t, r, a, n, o, s, d) : K(this, e, t, n, r, i, a, o, s, l, u, d);
418
+ return c(_(e)) ? fe(this, e, t, r, a, n, o, s, d) : J(this, e, t, n, r, i, a, o, s, l, u, d);
406
419
  }
407
420
  async proxyToPrivate(e, t, n, r, i, a, o) {
408
- return c(g(e)) ? (this.enforceRateLimit(this.proxyToPrivate.name, [
421
+ return c(_(e)) ? (this.enforceRateLimit(this.proxyToPrivate.name, [
409
422
  e[0],
410
423
  t[0],
411
424
  n,
412
425
  r
413
- ]), Z(this, e[0], t[0], n, r, o)) : Y(this, e, t, r, i, a, n, o);
426
+ ]), Z(this, e[0], t[0], n, r, o)) : oe(this, e, t, r, i, a, n, o);
414
427
  }
415
428
  async proxySend(e, t, n, r, i, a, o) {
416
- let s = g(e);
417
- if (c(s)) return le(this, e[0], t[0], n, r, o);
418
- let l = O(this, s, e.map((e) => e.erc20TokenAddress), t, r), u = e.map((e, n) => ({
429
+ let s = _(e);
430
+ if (c(s)) return de(this, e[0], t[0], n, r, o);
431
+ let l = A(this, s, e.map((e) => e.erc20TokenAddress), t, r), u = e.map((e, n) => ({
419
432
  token: e,
420
433
  amount: -1n * t[n]
421
434
  }));
@@ -426,7 +439,7 @@ var _e = class {
426
439
  e,
427
440
  t,
428
441
  n
429
- ]), q(this, e, t, n);
442
+ ]), Y(this, e, t, n);
430
443
  }
431
444
  areMerkleTreeUpdatesDisabled() {
432
445
  return this.disableMerkleTreeUpdates;
@@ -436,4 +449,4 @@ var _e = class {
436
449
  }
437
450
  };
438
451
  //#endregion
439
- export { _e as Hinkal };
452
+ export { be as Hinkal };
@@ -72,10 +72,14 @@ export interface IHinkal<ConnectorType = unknown> {
72
72
  getTronWeb(): TronWeb;
73
73
  getSigningMessage(mode?: LoginMessageMode): string;
74
74
  signHinkalMessage(mode?: LoginMessageMode): Promise<string>;
75
+ signSolanaLedgerMessage(): Promise<{
76
+ signature: string;
77
+ txMessageForSolanaLedger: string;
78
+ }>;
75
79
  initUserKeys(mode?: LoginMessageMode): Promise<void>;
76
80
  initUserKeysWithSignature(signature: string): void;
77
81
  initUserKeysFromSeedPhrases(seedPhrases: string[]): Promise<void>;
78
- storeAndGetInitialSignature(authSignature: string, isSolanaLedger: boolean, txMessageForSolanaLedger?: string): Promise<string>;
82
+ storeAndGetInitialSignature(authSignature: string, isSolanaLedger?: boolean, txMessageForSolanaLedger?: string): Promise<string>;
79
83
  initProviderAdapter(connector: ConnectorType, providerAdapter: IProviderAdapter<ConnectorType>): Promise<void>;
80
84
  disconnectFromConnector(): Promise<void>;
81
85
  resetProviderAdapters(): Promise<void>;
@@ -1,2 +1,2 @@
1
1
  var e={CANNOT_CERTIFY_FOR_PAST_WEEK:`Certification for the past week is not available`,CYCLICAL_REFERRALS_FORBIDDEN:`Cyclical referrals are forbidden`,USER_IS_UNRANKED:`Please certify transactions to see rank`},t={WC_NO_MATCHING_KEY:`creating the transaction failed
2
- version`,CONNECTION_PROBLEM:`Failed to connect wallet. Please try again.`,REQUEST_PENDING:`request of type 'wallet_requestpermissions' already pending for origin`},n={INSUFFICIENT_FUNDS:`Insufficient funds`,INSUFFICIENT_FUNDS_WITHDRAW:`Not enough funds to withdraw`,INSUFFICIENT_FUNDS_TRANSFER:`Not enough funds to transfer`,INSUFFICIENT_FUNDS_TO_TRANSACT:`Not enough funds to transact`,INSUFFICIENT_FUNDS_GAS:`Insufficient funds for gas * price`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Insufficient TRX balance to cover transfer amount and transaction fee reserve`,INSUFFICIENT_SOL_BALANCE:`Insufficient SOL balance`},r={GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT:`Skipped shielding due to gas fee exceeding your limit.`,AUTO_SHIELD_INSUFFICIENT_GAS:`Auto-Shield skipped due to insufficient gas.`},i={...e,...t,...n,...r,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`ApproxParamsInvalid`,NOT_ENOUGH_TOKENS:`Transfer amount exceeds balance`,TRANSACTION_NOT_CONFIRMED:`The transaction was not confirmed by the network. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Non-200 status code: '429'`,RELAYER_NOT_AVAILABLE:`All relayers are busy, please try in a few seconds`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,CONNECT_ERROR:`Connection error`,CONNECT_ERROR2:`DOMException: Failed`,USER_REJECTED_TX:`Transaction rejected`,USER_REJECTED_SIGN:`User rejected signing`,USER_REJECTED_TRANSACTION:`user rejected transaction`,USER_REJECTED_SIGN2:`User rejected the request`,USER_REJECTED_CONNECTION:`The user rejected connection.`,USER_REJECTED_RPC:`User has rejected`,SIMULATION_FAILED:`Simulation failed:`,USER_DENIED_TRANSACTION_SIGNATURE:`User denied transaction signature.`,SIGNING_FAILED:`The signing failed. Please, try again`,SIGNATURE_UNSUPPORTED_CHAINS:`Details: Unsupported chains`,SIGNATURE_UNSUPPORTED_CHAINS2:`User disapproved requested chains`,SIGNATURE_REQUEST_EXPIRED:`Request expired. Please try again`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`The method personal_sign does not exist`,USER_DISAPPROVED_REQUESTED_METHODS:`User disapproved requested methods`,INVALID_AUTHORIZATION:`The requested account and/or method has not been authorized by the user`,INVALID_NULLIFIER:`Nullifier cannot be reused`,SANCTIONED_ADDRESS:`Address is sanctioned`,INVALID_AMOUNT:`Please, select correct amount`,RECIPIENT_FORMAT_INCORRECT:`Recipient Information format is incorrect`,INVALID_TOKEN:`Invalid token provided`,STATE_TO_UPDATE:`Error in template Verifier_219 line: 121`,HAS_TOKEN:`User already has an access token`,INVALID_RECEIVER:`Receiver address doesn't match`,INVALID_RELAYER:`Relayer address doesn't match`,INVALID_RELAYER_FEE:`Relayer fee amount is not valid`,TIMESTAMP_STALE:`Timestamp provided does not align with current time`,INVALID_ZKP:`Proof must be valid`,NO_TRANSACTIONS_TO_CERTIFY:`This week, you do not have transactions to certify`,RECIPIENT_AMOUNT_INVALID:`Recipient amount is invalid`,UNSUPPORTED_NETWORK:`The selected network is not supported. Please switch to another network to continue.`,SIG_BY_OWNER:`Signature must be signed by the owner of the contract`,AMOUNT_EMPTY:`Please, specify amount`,UNVERIFIED_USER:`Please, pass KYC verification`,RELAYER_ISSUE:`Relayer has some issues. Try again later`,RELAYER_GAS_ESTIMATE:`Relayer was not able to estimate the gas costs of tx. Please, try later`,RECEIVER_EMPTY:`Please, enter recipient address`,VALID_ETHEREUM_ADDRESS:`Please, input valid ethereum address`,METAMASK_NOT_INSTALLED:`Please, install Metamask Wallet`,VIABLE_TX:`The transaction is not viable. Please increase the swap amount to swap with Relayer`,TRANSACTION_REPLACED:`transaction was replaced`,TRANSACTION_REPLACED2:`replacement fee too low`,TRANSACTION_CANCELED:`Transaction was cancelled. Please try again`,NONCE_HIGH:`Nonce too high`,WALLET_CONNECT_MATCHING_KEYS:`No matching key. keychain`,UNKNOWN_PROVIDER:`Unknown provider`,SAFE_ERC:`SafeERC20: low-level call failed`,SAFE_ERC_APPROVE:`SafeERC20: approve from non-zero to non-zero allowance`,SWAP_RELAYER_MIN:`Relayer minimum fee is not satisfied`,LOW_LEVEL_CALL:`low-level delegate call failed`,INTEGRAL_CURVE_ZERO:`previous integral cannot be zero`,ODOS_FETCH:`Odos API Fetch Error`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,SLIPPAGE_LIMIT:`Slippage Limit Exceeded`,SLIPPAGE_LIMIT_1:`Slippage screwed you`,QUOTE_EXPIRED:`Quote has expired`,REVERT_NO_STRING:`Transaction reverted without a reason string`,UNISWAP_NOT_ENOUGH_LIQUIDITY:`Not Enough Liquidity`,CONNECTION_FAILED:`Failed to connect`,FAILED_TO_SWITCH_NETWORKS:`Please switch networks in your wallet settings`,INVALID_FROM:`Invalid from token`,INVALID_TO:`Invalid to token`,Invalid_Password:`Invalid password`,INTERNAL_ERROR:`Internal error: please, try again`,INVALID_MERKLE_ROOT:`Invalid merkle tree root`,ACCESS_TOKEN_INVALID_HASH:`Access Token not minted`,MERLE_TREE_SNARK:`Error in template ForceEqualIfEnabled`,ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED:`Chain/address changed: balance updated canceled`,DECIMALS_LIMIT:`Number of decimals exceed maximum`,MERKLE_TREE_INCOMPLETE:`Merkle tree is incomplete`,FAIL_ESTIMATE_GAS:`Failed to estimate gas: check the transaction parameters`,LEDGER_IS_LOCKED:`Ledger device: Locked device`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Ledger device: UNKNOWN_ERROR (0x6a8c)`,LEDGER_IS_NOT_AVAILABLE:`Ledger device: UNKNOWN_ERROR`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,ODOS_SWAP_FAILED:`Odos swap call failed`,ONEINCH_SWAP_FAILED:`One inch swap failed`,GAS_ESTIMATION_ERROR:`Failed Gas Estimates Response`,GAS_ESTIMATE_INCORRECT_PARAMETERS:`Incorrect Parameters for Gas Estimate`,CONNECTIVITY_ERROR:`Request failed with status code 500`,TRANSACTION_FAILED:`Transaction Failed: Revert`,NO_UNISWAP_PRICE:`Cannot get Uniswap Price`,NO_ODOS_PRICE:`Cannot get Odos Price`,NO_ONEINCH_PRICE:`Cannot get OneInch Price`,NO_LIFI_PRICE:`Cannot get LiFi Price`,FEES_OVER_TRANSACTION_VALUE:`Fees are over transaction value. Please, increase the amount`,GAS_STATION_NOT_AVAILABLE:`Gas Station Not Available`,INBALANCE_IN_TOKEN:`Inbalance in token detected`,BALANCE_EQUATION_FAILED:`Balance Diff Should be equal to sum of onchain and offchain created commitments`,TOKEN_ADD_ERROR:`Error occoured while adding token. Please make sure you are adding a valid ERC-20 token`,CANNOT_ESTIMATE_GAS:`transaction may require manual gas limit`,NETWORK_ERROR:`Network Error`,MAX_FEE_GAS_ERROR:`max fee per gas less than block base fee`,CORS_ERROR:`has been blocked by CORS policy`,CANNOT_ESTIMATE_GAS2:`transaction may fail or may require manual gas limit`,NO_RESPONSE_PRIVATE:`No resonse from private relay`,TRY_AGAIN_AFTER_TRANSACTION:`Please, try again`,ALREADY_SUBSCRIBED:`User Already Subscribed`,PREFERRED_TOKEN_OR_ADDRESS_MISSING:`Please, specify both the preferred token and public wallet address`,SNAPSHOT_FILE_NOT_FOUND:`We are updating our servers. Please try again in some time`,SAME_ADDRESS_FORBIDDEN:`You cannot recieve staked tokens on the same ethereum address`,NOT_VALID_ETHEREUM_ADDRESS:`Please enter a valid Ethereum address`,MUST_STAKE_AT_LEAST_ONE_ETH:`Amount too low, Please stake at least 1 ETH`,OUT_OF_MEMORY:`Out of memory: Cannot allocate Wasm memory`,OUT_OF_MEMORY2:`could not allocate memory`,OUT_OF_MEMORY3:`out of memory`,UNKNOWN:`Unknown error`,TRANSACTION_WRONG_REQUEST:`The requested Transaction type is not supported`,INSUFFICIENT_LAMPORTS:`insufficient lamports`,TOKENS_DO_NOT_BELONG_SAME_CHAIN:`Tokens belong to different chains. All tokens must belong to the same chain`,OKX_MIN_RETURN_NOT_REACHED:`custom program error: 0x177a`,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:`ReceivedAmountLowerThanExpected`,AUTO_SHIELD_SKIPPED:`We skipped auto-shield because the asset was an NFT or the remaining token was used as gas.`,LOW_OUTPUT_AMOUNT:`Gas fees exceed received amount. Please try adjusting amount or lowering slippage.`,EXECUTION_REVERTED:`execution reverted`,SOLANA_TRANSACTION_LOG_SIZE_LIMIT:`Transaction logs are too large. Please try again later`,COMPUTATIONAL_BUDGET_EXCEEDED:`ComputationalBudgetExceeded`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Relay Fee is over withdraw amount`,TRON_CONFIRMATION_DECLINED:`Confirmation declined by user`,KYC_PRICE_FETCH_FAILED:`We’re having trouble verifying your wallet address. Please try again.`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`One of the source addresses is restricted from private transactions`,ACCOUNT_RESOURCE_INSUFFICIENT_ERROR:`Account resource insufficient error`},a=`Not enough memory. Please, close some tabs/applications to free up memory and try again`,o=`Your transaction didn’t go through due to price slippage. Try increasing your slippage tolerance`,s={USER_REJECTED_TRANSACTION:`You cancelled the transaction`,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`The amount you provided is too high, please adjust the amount`,WC_NO_MATCHING_KEY:`Wallet Connect error. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Rate Limit: please, use different rpc provider in your wallet`,INSUFFICIENT_FUNDS_GAS:`Your balance is too low to cover the transaction fees. Please add funds to proceed`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Your TRX balance is too low to cover amount and transaction fee`,INVALID_NULLIFIER:`There seems to be an issue with syncing your balance. Please press the refresh icon next to your shielded balance`,STATE_TO_UPDATE:`A technical issue has occurred. Please create a ticket on Hinkal discord server`,INVALID_ZKP:`The Zero Knowledge Proof provided is invalid. Please check and try again`,NONCE_HIGH:`To resolve this issue, please reset your wallet in the Settings`,UNKNOWN_PROVIDER:`The provider is not recognized. Please check your settings`,TRANSACTION_REPLACED:`Your transaction was replaced by another. Please submit your transaction again`,TRANSACTION_REPLACED2:`This transaction was replaced. Please try submitting again`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,SAFE_ERC:`Your approved amount is lower than what you’re trying to send. Increase the approval or adjust the amount, then try again.`,SIMULATION_FAILED:`Transaction simulation failed. Please try again.`,SAFE_ERC_APPROVE:`The selected ERC20 Token could not be approved. Please contact the Hinkal support team`,INTEGRAL_CURVE_ZERO:`There's an issue with the pool's staking function. Please contact the Hinkal support team for assistance`,LOW_LEVEL_CALL:`A technical issue occurred. Please contact the Hinkal team for assistance`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,USER_REJECTED_SIGN2:`You canceled the request`,USER_REJECTED_RPC:`You canceled the request`,USER_DENIED_TRANSACTION_SIGNATURE:`You canceled the request`,ODOS_FETCH:`Current Odos price is unavailable. Please try again`,ODOS_SWAP_FAILED:`Your Odos Swap transaction didn’t go through. Please try again`,ONEINCH_SWAP_FAILED:`Your 1inch Swap transaction didn’t go through. Please try again`,CONNECT_ERROR2:`Oops, there are connectivity issues. Please check your internet connection and try again`,WALLET_CONNECT_MATCHING_KEYS:`An internal WalletConnect error occurred. Please try reconnecting`,SIGNATURE_UNSUPPORTED_CHAINS:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_CHAINS2:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`Your active wallet doesn't support personal signatures. Please use a different wallet`,REVERT_NO_STRING:`Your transaction didn’t go through due to technical issues. Please submit a ticket on Hinkal discord server`,INVALID_MERKLE_ROOT:`There's an issue with the merkle tree root. Please submit a ticket on Hinkal discord server`,MERLE_TREE_SNARK:`An error occurred in the circuit processing. Please submit a ticket on Hinkal discord server`,MAX_FEE_GAS_ERROR:`Your transaction was rejected due to high network congestion`,MERKLE_TREE_INCOMPLETE:`A technical issue has occurred. Please submit a ticket on Hinkal discord server`,CORS_ERROR:`Unable to reach the remote client. Please submit a ticket on Hinkal discord server`,NETWORK_ERROR:`Connection error. Please, check back later`,CONNECTIVITY_ERROR:`A connectivity issue occurred. Please check your network connection`,LEDGER_IS_LOCKED:`Your wallet is locked. Please unlock your wallet`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Your ledger is not allowed to sign transactions. Please allow blind signing`,LEDGER_IS_NOT_AVAILABLE:`Access denied to use Ledger device.`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,INBALANCE_IN_TOKEN:o,OKX_MIN_RETURN_NOT_REACHED:o,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:o,BALANCE_EQUATION_FAILED:`There's an issue with the balance calculation. Please adjust your transaction parameters`,SLIPPAGE_LIMIT_1:`Your transaction didn’t go through due to price slippage. Adjust slippage settings and retry`,CANNOT_ESTIMATE_GAS:`Unable to estimate the gas required. Please set the gas limit manually`,CANNOT_ESTIMATE_GAS2:`Your transaction didn’t go through. Please try setting gas limit manually`,GAS_STATION_NOT_AVAILABLE:`The Gas Station service is currently unavailable. Please submit a ticket on Hinkal discord server`,TIMESTAMP_STALE:`This transaction is outdated. Please initiate a new transaction`,ALREADY_SUBSCRIBED:`This email is already subscribed to the Hinkal newsletter`,OUT_OF_MEMORY:a,OUT_OF_MEMORY2:a,OUT_OF_MEMORY3:a,INVALID_RECOVERY_PHRASE:`Invalid recovery phrase`,PHRASES_DONT_MATCH:`Phrases do not match. You can go back and verify your recovery phrase.`,PASSWORDS_DONT_MATCH:`Passwords do not match`,PASSWORD_SAME_AS_OLD:`Password cannot be the same as the old one`,PASSWORD_TOO_SMALL:`Password must be at least 8 characters`,PASSWORD_NOT_CORRECT:`Incorrect current password`,CODE_ALREADY_USED:`This code has already been used`,ACCESS_CODE_REQUIRED:`Access code is required`,ACCESS_CODE_IS_ALREADY_IN_USE:`Access code is already in use`,ACCESS_CODE_IS_ALREADY_IN_USE1:`Access code already in use. Import or connect existing wallet`,ERROR_DURING_PHRASE_CONFIRMATION:`Error during Phrase confirmation`,INSUFFICIENT_LAMPORTS:`Your SOL balance is too low to complete this transaction`,EXECUTION_REVERTED:`Your transaction reverted.`,COMPUTATIONAL_BUDGET_EXCEEDED:`Your transaction exceeded the limited compute units. Please try again.`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Your transaction didn’t go through because the relay fee exceeded the transaction amount`,TRON_CONFIRMATION_DECLINED:`You canceled the request`,INVALID_RELAYER_FEE:`The transaction fee changed while submitting. Please try again.`,REQUEST_PENDING:`A request is already pending in your wallet. Please confirm to connect.`,KYC_PRICE_FETCH_FAILED:`We’re having trouble verifying your wallet address. Please try again.`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`The funds you’re trying to use have been flagged as sanctioned.`},c={UTXO_LIMITATIONS:`Your transaction exceeds the UTXO limit`,INSUFFICIENT_BALANCE_FOR_FEES:`Fees are high right now and would consume a large portion of your balance. Consider reducing the amount or retrying later.`,HIGH_FEE_WARNING:`Total fees exceed your available balance. Consider adding funds or retry later when fees decrease.`};exports.DIRECTLY_SHOW_MESSAGE_ERROR_CODES=c,exports.UserFriendlyErrorCodes=s,exports.gasErrorCodes=r,exports.insufficientResourcesErrorCodes=n,exports.transactionErrorCodes=i;
2
+ version`,CONNECTION_PROBLEM:`Failed to connect wallet. Please try again.`,REQUEST_PENDING:`request of type 'wallet_requestpermissions' already pending for origin`},n={INSUFFICIENT_FUNDS:`Insufficient funds`,INSUFFICIENT_FUNDS_WITHDRAW:`Not enough funds to withdraw`,INSUFFICIENT_FUNDS_TRANSFER:`Not enough funds to transfer`,INSUFFICIENT_FUNDS_TO_TRANSACT:`Not enough funds to transact`,INSUFFICIENT_FUNDS_GAS:`Insufficient funds for gas * price`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Insufficient TRX balance to cover transfer amount and transaction fee reserve`,INSUFFICIENT_SOL_BALANCE:`Insufficient SOL balance`},r={GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT:`Skipped shielding due to gas fee exceeding your limit.`,AUTO_SHIELD_INSUFFICIENT_GAS:`Auto-Shield skipped due to insufficient gas.`},i={...e,...t,...n,...r,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`ApproxParamsInvalid`,NOT_ENOUGH_TOKENS:`Transfer amount exceeds balance`,TRANSACTION_NOT_CONFIRMED:`The transaction was not confirmed by the network. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Non-200 status code: '429'`,RELAYER_NOT_AVAILABLE:`All relayers are busy, please try in a few seconds`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,CONNECT_ERROR:`Connection error`,CONNECT_ERROR2:`DOMException: Failed`,USER_REJECTED_TX:`Transaction rejected`,USER_REJECTED_SIGN:`User rejected signing`,USER_REJECTED_TRANSACTION:`user rejected transaction`,USER_REJECTED_SIGN2:`User rejected the request`,USER_REJECTED_CONNECTION:`The user rejected connection.`,USER_REJECTED_RPC:`User has rejected`,SIMULATION_FAILED:`Simulation failed:`,USER_DENIED_TRANSACTION_SIGNATURE:`User denied transaction signature.`,SIGNING_FAILED:`The signing failed. Please, try again`,SIGNATURE_UNSUPPORTED_CHAINS:`Details: Unsupported chains`,SIGNATURE_UNSUPPORTED_CHAINS2:`User disapproved requested chains`,SIGNATURE_REQUEST_EXPIRED:`Request expired. Please try again`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`The method personal_sign does not exist`,USER_DISAPPROVED_REQUESTED_METHODS:`User disapproved requested methods`,INVALID_AUTHORIZATION:`The requested account and/or method has not been authorized by the user`,INVALID_NULLIFIER:`Nullifier cannot be reused`,SANCTIONED_ADDRESS:`Address is sanctioned`,INVALID_AMOUNT:`Please, select correct amount`,RECIPIENT_FORMAT_INCORRECT:`Recipient Information format is incorrect`,INVALID_TOKEN:`Invalid token provided`,STATE_TO_UPDATE:`Error in template Verifier_219 line: 121`,HAS_TOKEN:`User already has an access token`,INVALID_RECEIVER:`Receiver address doesn't match`,INVALID_RELAYER:`Relayer address doesn't match`,INVALID_RELAYER_FEE:`Relayer fee amount is not valid`,TIMESTAMP_STALE:`Timestamp provided does not align with current time`,INVALID_ZKP:`Proof must be valid`,NO_TRANSACTIONS_TO_CERTIFY:`This week, you do not have transactions to certify`,RECIPIENT_AMOUNT_INVALID:`Recipient amount is invalid`,UNSUPPORTED_NETWORK:`The selected network is not supported. Please switch to another network to continue.`,SIG_BY_OWNER:`Signature must be signed by the owner of the contract`,AMOUNT_EMPTY:`Please, specify amount`,UNVERIFIED_USER:`Please, pass KYC verification`,RELAYER_ISSUE:`Relayer has some issues. Try again later`,RELAYER_GAS_ESTIMATE:`Relayer was not able to estimate the gas costs of tx. Please, try later`,RECEIVER_EMPTY:`Please, enter recipient address`,VALID_ETHEREUM_ADDRESS:`Please, input valid ethereum address`,METAMASK_NOT_INSTALLED:`Please, install Metamask Wallet`,VIABLE_TX:`The transaction is not viable. Please increase the swap amount to swap with Relayer`,TRANSACTION_REPLACED:`transaction was replaced`,TRANSACTION_REPLACED2:`replacement fee too low`,TRANSACTION_CANCELED:`Transaction was cancelled. Please try again`,NONCE_HIGH:`Nonce too high`,WALLET_CONNECT_MATCHING_KEYS:`No matching key. keychain`,UNKNOWN_PROVIDER:`Unknown provider`,SAFE_ERC:`SafeERC20: low-level call failed`,SAFE_ERC_APPROVE:`SafeERC20: approve from non-zero to non-zero allowance`,SWAP_RELAYER_MIN:`Relayer minimum fee is not satisfied`,LOW_LEVEL_CALL:`low-level delegate call failed`,INTEGRAL_CURVE_ZERO:`previous integral cannot be zero`,ODOS_FETCH:`Odos API Fetch Error`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,SLIPPAGE_LIMIT:`Slippage Limit Exceeded`,SLIPPAGE_LIMIT_1:`Slippage screwed you`,QUOTE_EXPIRED:`Quote has expired`,REVERT_NO_STRING:`Transaction reverted without a reason string`,UNISWAP_NOT_ENOUGH_LIQUIDITY:`Not Enough Liquidity`,CONNECTION_FAILED:`Failed to connect`,FAILED_TO_SWITCH_NETWORKS:`Please switch networks in your wallet settings`,INVALID_FROM:`Invalid from token`,INVALID_TO:`Invalid to token`,Invalid_Password:`Invalid password`,INTERNAL_ERROR:`Internal error: please, try again`,INVALID_MERKLE_ROOT:`Invalid merkle tree root`,ACCESS_TOKEN_INVALID_HASH:`Access Token not minted`,MERLE_TREE_SNARK:`Error in template ForceEqualIfEnabled`,ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED:`Chain/address changed: balance updated canceled`,DECIMALS_LIMIT:`Number of decimals exceed maximum`,MERKLE_TREE_INCOMPLETE:`Merkle tree is incomplete`,FAIL_ESTIMATE_GAS:`Failed to estimate gas: check the transaction parameters`,LEDGER_IS_LOCKED:`Ledger device: Locked device`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Ledger device: UNKNOWN_ERROR (0x6a8c)`,LEDGER_IS_NOT_AVAILABLE:`Ledger device: UNKNOWN_ERROR`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,ODOS_SWAP_FAILED:`Odos swap call failed`,ONEINCH_SWAP_FAILED:`One inch swap failed`,GAS_ESTIMATION_ERROR:`Failed Gas Estimates Response`,GAS_ESTIMATE_INCORRECT_PARAMETERS:`Incorrect Parameters for Gas Estimate`,CONNECTIVITY_ERROR:`Request failed with status code 500`,TRANSACTION_FAILED:`Transaction Failed: Revert`,NO_UNISWAP_PRICE:`Cannot get Uniswap Price`,NO_ODOS_PRICE:`Cannot get Odos Price`,NO_ONEINCH_PRICE:`Cannot get OneInch Price`,NO_LIFI_PRICE:`Cannot get LiFi Price`,FEES_OVER_TRANSACTION_VALUE:`Fees are over transaction value. Please, increase the amount`,GAS_STATION_NOT_AVAILABLE:`Gas Station Not Available`,INBALANCE_IN_TOKEN:`Inbalance in token detected`,BALANCE_EQUATION_FAILED:`Balance Diff Should be equal to sum of onchain and offchain created commitments`,TOKEN_ADD_ERROR:`Error occoured while adding token. Please make sure you are adding a valid ERC-20 token`,CANNOT_ESTIMATE_GAS:`transaction may require manual gas limit`,NETWORK_ERROR:`Network Error`,MAX_FEE_GAS_ERROR:`max fee per gas less than block base fee`,CORS_ERROR:`has been blocked by CORS policy`,CANNOT_ESTIMATE_GAS2:`transaction may fail or may require manual gas limit`,NO_RESPONSE_PRIVATE:`No resonse from private relay`,TRY_AGAIN_AFTER_TRANSACTION:`Please, try again`,ALREADY_SUBSCRIBED:`User Already Subscribed`,PREFERRED_TOKEN_OR_ADDRESS_MISSING:`Please, specify both the preferred token and public wallet address`,SNAPSHOT_FILE_NOT_FOUND:`We are updating our servers. Please try again in some time`,SAME_ADDRESS_FORBIDDEN:`You cannot recieve staked tokens on the same ethereum address`,NOT_VALID_ETHEREUM_ADDRESS:`Please enter a valid Ethereum address`,MUST_STAKE_AT_LEAST_ONE_ETH:`Amount too low, Please stake at least 1 ETH`,OUT_OF_MEMORY:`Out of memory: Cannot allocate Wasm memory`,OUT_OF_MEMORY2:`could not allocate memory`,OUT_OF_MEMORY3:`out of memory`,UNKNOWN:`Unknown error`,TRANSACTION_WRONG_REQUEST:`The requested Transaction type is not supported`,INSUFFICIENT_LAMPORTS:`insufficient lamports`,TOKENS_DO_NOT_BELONG_SAME_CHAIN:`Tokens belong to different chains. All tokens must belong to the same chain`,OKX_MIN_RETURN_NOT_REACHED:`custom program error: 0x177a`,MIN_RETURNED_NOT_REACHED:`MinReturnNotReached`,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:`ReceivedAmountLowerThanExpected`,AUTO_SHIELD_SKIPPED:`We skipped auto-shield because the asset was an NFT or the remaining token was used as gas.`,LOW_OUTPUT_AMOUNT:`Gas fees exceed received amount. Please try adjusting amount or lowering slippage.`,EXECUTION_REVERTED:`execution reverted`,SOLANA_TRANSACTION_LOG_SIZE_LIMIT:`Transaction logs are too large. Please try again later`,COMPUTATIONAL_BUDGET_EXCEEDED:`ComputationalBudgetExceeded`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Relay Fee is over withdraw amount`,TRON_CONFIRMATION_DECLINED:`Confirmation declined by user`,KYC_PRICE_FETCH_FAILED:`We’re having trouble verifying your wallet address. Please try again.`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`One of the source addresses is restricted from private transactions`,ACCOUNT_RESOURCE_INSUFFICIENT_ERROR:`Account resource insufficient error`},a=`Not enough memory. Please, close some tabs/applications to free up memory and try again`,o=`Your transaction didn’t go through due to price slippage. Try increasing your slippage tolerance`,s={USER_REJECTED_TRANSACTION:`You cancelled the transaction`,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`The amount you provided is too high, please adjust the amount`,WC_NO_MATCHING_KEY:`Wallet Connect error. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Rate Limit: please, use different rpc provider in your wallet`,INSUFFICIENT_FUNDS_GAS:`Your balance is too low to cover the transaction fees. Please add funds to proceed`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Your TRX balance is too low to cover amount and transaction fee`,INVALID_NULLIFIER:`There seems to be an issue with syncing your balance. Please press the refresh icon next to your shielded balance`,STATE_TO_UPDATE:`A technical issue has occurred. Please create a ticket on Hinkal discord server`,INVALID_ZKP:`The Zero Knowledge Proof provided is invalid. Please check and try again`,NONCE_HIGH:`To resolve this issue, please reset your wallet in the Settings`,UNKNOWN_PROVIDER:`The provider is not recognized. Please check your settings`,TRANSACTION_REPLACED:`Your transaction was replaced by another. Please submit your transaction again`,TRANSACTION_REPLACED2:`This transaction was replaced. Please try submitting again`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,SAFE_ERC:`Your approved amount is lower than what you’re trying to send. Increase the approval or adjust the amount, then try again.`,SIMULATION_FAILED:`Transaction simulation failed. Please try again.`,SAFE_ERC_APPROVE:`The selected ERC20 Token could not be approved. Please contact the Hinkal support team`,INTEGRAL_CURVE_ZERO:`There's an issue with the pool's staking function. Please contact the Hinkal support team for assistance`,LOW_LEVEL_CALL:`A technical issue occurred. Please contact the Hinkal team for assistance`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,USER_REJECTED_SIGN2:`You canceled the request`,USER_REJECTED_RPC:`You canceled the request`,USER_DENIED_TRANSACTION_SIGNATURE:`You canceled the request`,ODOS_FETCH:`Current Odos price is unavailable. Please try again`,ODOS_SWAP_FAILED:`Your Odos Swap transaction didn’t go through. Please try again`,ONEINCH_SWAP_FAILED:`Your 1inch Swap transaction didn’t go through. Please try again`,CONNECT_ERROR2:`Oops, there are connectivity issues. Please check your internet connection and try again`,WALLET_CONNECT_MATCHING_KEYS:`An internal WalletConnect error occurred. Please try reconnecting`,SIGNATURE_UNSUPPORTED_CHAINS:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_CHAINS2:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`Your active wallet doesn't support personal signatures. Please use a different wallet`,REVERT_NO_STRING:`Your transaction didn’t go through due to technical issues. Please submit a ticket on Hinkal discord server`,INVALID_MERKLE_ROOT:`There's an issue with the merkle tree root. Please submit a ticket on Hinkal discord server`,MERLE_TREE_SNARK:`An error occurred in the circuit processing. Please submit a ticket on Hinkal discord server`,MAX_FEE_GAS_ERROR:`Your transaction was rejected due to high network congestion`,MERKLE_TREE_INCOMPLETE:`A technical issue has occurred. Please submit a ticket on Hinkal discord server`,CORS_ERROR:`Unable to reach the remote client. Please submit a ticket on Hinkal discord server`,NETWORK_ERROR:`Connection error. Please, check back later`,CONNECTIVITY_ERROR:`A connectivity issue occurred. Please check your network connection`,LEDGER_IS_LOCKED:`Your wallet is locked. Please unlock your wallet`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Your ledger is not allowed to sign transactions. Please allow blind signing`,LEDGER_IS_NOT_AVAILABLE:`Access denied to use Ledger device.`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,INBALANCE_IN_TOKEN:o,OKX_MIN_RETURN_NOT_REACHED:o,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:o,MIN_RETURNED_NOT_REACHED:o,BALANCE_EQUATION_FAILED:`There's an issue with the balance calculation. Please adjust your transaction parameters`,SLIPPAGE_LIMIT_1:`Your transaction didn’t go through due to price slippage. Adjust slippage settings and retry`,CANNOT_ESTIMATE_GAS:`Unable to estimate the gas required. Please set the gas limit manually`,CANNOT_ESTIMATE_GAS2:`Your transaction didn’t go through. Please try setting gas limit manually`,GAS_STATION_NOT_AVAILABLE:`The Gas Station service is currently unavailable. Please submit a ticket on Hinkal discord server`,TIMESTAMP_STALE:`This transaction is outdated. Please initiate a new transaction`,ALREADY_SUBSCRIBED:`This email is already subscribed to the Hinkal newsletter`,OUT_OF_MEMORY:a,OUT_OF_MEMORY2:a,OUT_OF_MEMORY3:a,INVALID_RECOVERY_PHRASE:`Invalid recovery phrase`,PHRASES_DONT_MATCH:`Phrases do not match. You can go back and verify your recovery phrase.`,PASSWORDS_DONT_MATCH:`Passwords do not match`,PASSWORD_SAME_AS_OLD:`Password cannot be the same as the old one`,PASSWORD_TOO_SMALL:`Password must be at least 8 characters`,PASSWORD_NOT_CORRECT:`Incorrect current password`,CODE_ALREADY_USED:`This code has already been used`,ACCESS_CODE_REQUIRED:`Access code is required`,ACCESS_CODE_IS_ALREADY_IN_USE:`Access code is already in use`,ACCESS_CODE_IS_ALREADY_IN_USE1:`Access code already in use. Import or connect existing wallet`,ERROR_DURING_PHRASE_CONFIRMATION:`Error during Phrase confirmation`,INSUFFICIENT_LAMPORTS:`Your SOL balance is too low to complete this transaction`,EXECUTION_REVERTED:`Your transaction reverted.`,COMPUTATIONAL_BUDGET_EXCEEDED:`Your transaction exceeded the limited compute units. Please try again.`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Your transaction didn’t go through because the relay fee exceeded the transaction amount`,TRON_CONFIRMATION_DECLINED:`You canceled the request`,INVALID_RELAYER_FEE:`The transaction fee changed while submitting. Please try again.`,REQUEST_PENDING:`A request is already pending in your wallet. Please confirm to connect.`,KYC_PRICE_FETCH_FAILED:`We’re having trouble verifying your wallet address. Please try again.`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`The funds you’re trying to use have been flagged as sanctioned.`},c={UTXO_LIMITATIONS:`Your transaction exceeds the UTXO limit`,INSUFFICIENT_BALANCE_FOR_FEES:`Fees are high right now and would consume a large portion of your balance. Consider reducing the amount or retrying later.`,HIGH_FEE_WARNING:`Total fees exceed your available balance. Consider adding funds or retry later when fees decrease.`};exports.DIRECTLY_SHOW_MESSAGE_ERROR_CODES=c,exports.UserFriendlyErrorCodes=s,exports.gasErrorCodes=r,exports.insufficientResourcesErrorCodes=n,exports.transactionErrorCodes=i;
@@ -136,6 +136,7 @@ export declare const transactionErrorCodes: {
136
136
  INSUFFICIENT_LAMPORTS: string;
137
137
  TOKENS_DO_NOT_BELONG_SAME_CHAIN: string;
138
138
  OKX_MIN_RETURN_NOT_REACHED: string;
139
+ MIN_RETURNED_NOT_REACHED: string;
139
140
  SOLANA_RECEIVED_LOWER_THAN_EXPECTED: string;
140
141
  AUTO_SHIELD_SKIPPED: string;
141
142
  LOW_OUTPUT_AMOUNT: string;
@@ -212,6 +213,7 @@ export declare const UserFriendlyErrorCodes: {
212
213
  INBALANCE_IN_TOKEN: string;
213
214
  OKX_MIN_RETURN_NOT_REACHED: string;
214
215
  SOLANA_RECEIVED_LOWER_THAN_EXPECTED: string;
216
+ MIN_RETURNED_NOT_REACHED: string;
215
217
  BALANCE_EQUATION_FAILED: string;
216
218
  SLIPPAGE_LIMIT_1: string;
217
219
  CANNOT_ESTIMATE_GAS: string;
@@ -143,6 +143,7 @@ var e = {
143
143
  INSUFFICIENT_LAMPORTS: "insufficient lamports",
144
144
  TOKENS_DO_NOT_BELONG_SAME_CHAIN: "Tokens belong to different chains. All tokens must belong to the same chain",
145
145
  OKX_MIN_RETURN_NOT_REACHED: "custom program error: 0x177a",
146
+ MIN_RETURNED_NOT_REACHED: "MinReturnNotReached",
146
147
  SOLANA_RECEIVED_LOWER_THAN_EXPECTED: "ReceivedAmountLowerThanExpected",
147
148
  AUTO_SHIELD_SKIPPED: "We skipped auto-shield because the asset was an NFT or the remaining token was used as gas.",
148
149
  LOW_OUTPUT_AMOUNT: "Gas fees exceed received amount. Please try adjusting amount or lowering slippage.",
@@ -203,6 +204,7 @@ var e = {
203
204
  INBALANCE_IN_TOKEN: o,
204
205
  OKX_MIN_RETURN_NOT_REACHED: o,
205
206
  SOLANA_RECEIVED_LOWER_THAN_EXPECTED: o,
207
+ MIN_RETURNED_NOT_REACHED: o,
206
208
  BALANCE_EQUATION_FAILED: "There's an issue with the balance calculation. Please adjust your transaction parameters",
207
209
  SLIPPAGE_LIMIT_1: "Your transaction didn’t go through due to price slippage. Adjust slippage settings and retry",
208
210
  CANNOT_ESTIMATE_GAS: "Unable to estimate the gas required. Please set the gas limit manually",
@@ -1 +1,2 @@
1
- require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/serialize.utils.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../data-structures/AccountActions/AccountActions.cjs`),r=require(`../../types/fee.types.cjs`),i=require(`../web3/getSolanaPriorityFee.cjs`),a=require(`../utils/process.utils.cjs`),o=require(`../../error-handling/retrySolanaError.cjs`);let s=require(`@solana/web3.js`);require(`@solana/spl-token`);var c=5e3,l=6e4,u=async(e,t,n=`confirmed`)=>await a.pollForValue(()=>e.getTransaction(t,{commitment:n,maxSupportedTransactionVersion:0}),{timeoutMs:l,intervalMs:c})??null,d=async(e,n,r,i,a=!1)=>{try{let{blockhash:o}=await e.getLatestBlockhash(),c=new s.VersionedTransaction(new s.TransactionMessage({payerKey:n,recentBlockhash:o,instructions:[s.ComputeBudgetProgram.setComputeUnitLimit({units:t.MAX_COMPUTE_UNIT_LIMIT}),...a?[s.ComputeBudgetProgram.requestHeapFrame({bytes:t.MAX_SOLANA_HEAP_FRAME_BYTES})]:[],...r]}).compileToV0Message(i)),{unitsConsumed:l}=(await e.simulateTransaction(c,{sigVerify:!1,replaceRecentBlockhash:!0})).value;if(!l)return t.MAX_COMPUTE_UNIT_LIMIT;let u=Math.ceil(l*(1+t.COMPUTE_UNIT_PADDING_PERCENTAGE));return Math.max(t.MIN_COMPUTE_UNIT_LIMIT,Math.min(u,t.MAX_COMPUTE_UNIT_LIMIT))}catch{return t.MAX_COMPUTE_UNIT_LIMIT}},f=(e,t,n,r)=>{let i=new Set;return t&&i.add(t.toBase58()),n?.forEach(e=>i.add(e.toBase58())),e.forEach(e=>{i.add(e.programId.toBase58()),e.keys.forEach(e=>{i.add(e.pubkey.toBase58())})}),r&&r.forEach(e=>{i.add(e.key.toBase58()),e.state.addresses.forEach(e=>{i.add(e.toBase58())})}),[...i].map(e=>new s.PublicKey(e))},p=t=>{if(!t)throw Error(`Failed to fetch Solana transaction details for signature`);if(t.meta?.err){let n=e.safeJsonStringify(t.meta.err);throw Error(`Solana transaction failed on-chain: ${n}`)}},m=async(e,n,r,a,o,c=!1)=>{if(r.some(e=>e.programId.equals(s.ComputeBudgetProgram.programId)))return r.map(e=>e.programId.equals(s.ComputeBudgetProgram.programId)&&e.data[0]===2?s.ComputeBudgetProgram.setComputeUnitLimit({units:t.MAX_COMPUTE_UNIT_LIMIT}):e);let l=r.filter(e=>!e.programId.equals(s.ComputeBudgetProgram.programId)),u=await d(e,n,l,a,c),p=s.ComputeBudgetProgram.setComputeUnitLimit({units:u}),m=e.rpcEndpoint.includes(`helius`)?await i.getSolanaPriorityFee(f(l,n,[s.ComputeBudgetProgram.programId],a),o):0;return[p,s.ComputeBudgetProgram.setComputeUnitPrice({microLamports:m}),...c?[s.ComputeBudgetProgram.requestHeapFrame({bytes:t.MAX_SOLANA_HEAP_FRAME_BYTES})]:[],...l]},h=async({connection:e,chainId:t,subAccount:i,payerPublicKey:a,instructions:c,lookupTableAccounts:l})=>{let d=n.AccountActions.getPrivateKeyFromSubAccount(t,i);if(!d)throw Error(`Private key is not available`);for(let t=0;t<10;t+=1){let i=t===9;try{let t=await m(e,a,c,l,i?r.SolanaPriorityFeeMode.HIGH:r.SolanaPriorityFeeMode.RECOMMENDED),{blockhash:o,lastValidBlockHeight:f}=await e.getLatestBlockhash(),h=new s.VersionedTransaction(new s.TransactionMessage({payerKey:a,recentBlockhash:o,instructions:t}).compileToV0Message(l)),g=await n.AccountActions.sendAndSignSolanaTransactionFromPrivateKey(e,d,h,!0);return await e.confirmTransaction({signature:g,blockhash:o,lastValidBlockHeight:f},`confirmed`),p(await u(e,g)),g}catch(e){if(o.shouldRetryForSolanaError(e)&&!i)continue;throw e}}throw Error(`Failed to send proxy v0 transaction due to expired blockheight after all retries`)};exports.estimateComputeUnitLimit=d,exports.fetchSolanaTransaction=u,exports.getAccountsFromInstructions=f,exports.sendProxyV0Transaction=h;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/serialize.utils.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../data-structures/AccountActions/AccountActions.cjs`),r=require(`../../types/fee.types.cjs`),i=require(`../web3/getSolanaPriorityFee.cjs`),a=require(`../utils/process.utils.cjs`),o=require(`../../error-handling/retrySolanaError.cjs`);let s=require(`@solana/web3.js`);require(`@solana/spl-token`);var c=5e3,l=6e4,u=async(e,t,n=`confirmed`)=>await a.pollForValue(()=>e.getTransaction(t,{commitment:n,maxSupportedTransactionVersion:0}),{timeoutMs:l,intervalMs:c})??null,d=async(e,n,r,i,a=!1)=>{try{let{blockhash:o}=await e.getLatestBlockhash(),c=new s.VersionedTransaction(new s.TransactionMessage({payerKey:n,recentBlockhash:o,instructions:[s.ComputeBudgetProgram.setComputeUnitLimit({units:t.MAX_COMPUTE_UNIT_LIMIT}),...a?[s.ComputeBudgetProgram.requestHeapFrame({bytes:t.MAX_SOLANA_HEAP_FRAME_BYTES})]:[],...r]}).compileToV0Message(i)),{unitsConsumed:l}=(await e.simulateTransaction(c,{sigVerify:!1,replaceRecentBlockhash:!0})).value;if(!l)return t.MAX_COMPUTE_UNIT_LIMIT;let u=Math.ceil(l*(1+t.COMPUTE_UNIT_PADDING_PERCENTAGE));return Math.max(t.MIN_COMPUTE_UNIT_LIMIT,Math.min(u,t.MAX_COMPUTE_UNIT_LIMIT))}catch{return t.MAX_COMPUTE_UNIT_LIMIT}},f=(e,t,n,r)=>{let i=new Set;return t&&i.add(t.toBase58()),n?.forEach(e=>i.add(e.toBase58())),e.forEach(e=>{i.add(e.programId.toBase58()),e.keys.forEach(e=>{i.add(e.pubkey.toBase58())})}),r&&r.forEach(e=>{i.add(e.key.toBase58()),e.state.addresses.forEach(e=>{i.add(e.toBase58())})}),[...i].map(e=>new s.PublicKey(e))},p=t=>{if(!t)throw Error(`Failed to fetch Solana transaction details for signature`);if(t.meta?.err){let n=e.safeJsonStringify(t.meta.err),r=t.meta.logMessages?.join(`
2
+ `);throw Error(r?`Solana transaction failed on-chain: ${n}\n${r}`:`Solana transaction failed on-chain: ${n}`)}},m=async(e,n,r,a,o,c=!1)=>{if(r.some(e=>e.programId.equals(s.ComputeBudgetProgram.programId)))return r.map(e=>e.programId.equals(s.ComputeBudgetProgram.programId)&&e.data[0]===2?s.ComputeBudgetProgram.setComputeUnitLimit({units:t.MAX_COMPUTE_UNIT_LIMIT}):e);let l=r.filter(e=>!e.programId.equals(s.ComputeBudgetProgram.programId)),u=await d(e,n,l,a,c),p=s.ComputeBudgetProgram.setComputeUnitLimit({units:u}),m=e.rpcEndpoint.includes(`helius`)?await i.getSolanaPriorityFee(f(l,n,[s.ComputeBudgetProgram.programId],a),o):0;return[p,s.ComputeBudgetProgram.setComputeUnitPrice({microLamports:m}),...c?[s.ComputeBudgetProgram.requestHeapFrame({bytes:t.MAX_SOLANA_HEAP_FRAME_BYTES})]:[],...l]},h=async({connection:e,chainId:t,subAccount:i,payerPublicKey:a,instructions:c,lookupTableAccounts:l})=>{let d=n.AccountActions.getPrivateKeyFromSubAccount(t,i);if(!d)throw Error(`Private key is not available`);for(let t=0;t<10;t+=1){let i=t===9;try{let t=await m(e,a,c,l,i?r.SolanaPriorityFeeMode.HIGH:r.SolanaPriorityFeeMode.RECOMMENDED),{blockhash:o,lastValidBlockHeight:f}=await e.getLatestBlockhash(),h=new s.VersionedTransaction(new s.TransactionMessage({payerKey:a,recentBlockhash:o,instructions:t}).compileToV0Message(l)),g=await n.AccountActions.sendAndSignSolanaTransactionFromPrivateKey(e,d,h,!0);return await e.confirmTransaction({signature:g,blockhash:o,lastValidBlockHeight:f},`confirmed`),p(await u(e,g)),g}catch(e){if(o.shouldRetryForSolanaError(e)&&!i)continue;throw e}}throw Error(`Failed to send proxy v0 transaction due to expired blockheight after all retries`)};exports.estimateComputeUnitLimit=d,exports.fetchSolanaTransaction=u,exports.getAccountsFromInstructions=f,exports.sendProxyV0Transaction=h;
@@ -48,8 +48,8 @@ var m = 5e3, h = 6e4, g = async (e, t, n = "confirmed") => await c(() => e.getTr
48
48
  }, y = (t) => {
49
49
  if (!t) throw Error("Failed to fetch Solana transaction details for signature");
50
50
  if (t.meta?.err) {
51
- let n = e(t.meta.err);
52
- throw Error(`Solana transaction failed on-chain: ${n}`);
51
+ let n = e(t.meta.err), r = t.meta.logMessages?.join("\n");
52
+ throw Error(r ? `Solana transaction failed on-chain: ${n}\n${r}` : `Solana transaction failed on-chain: ${n}`);
53
53
  }
54
54
  }, b = async (e, t, i, a, o, c = !1) => {
55
55
  if (i.some((e) => e.programId.equals(u.programId))) return i.map((e) => e.programId.equals(u.programId) && e.data[0] === 2 ? u.setComputeUnitLimit({ units: n }) : e);