@hinkal/common 0.2.28 → 0.2.29

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 (1076) hide show
  1. package/API/API.cjs +1 -1
  2. package/API/API.mjs +111 -140
  3. package/API/accessCodeCalls.cjs +1 -1
  4. package/API/accessCodeCalls.mjs +12 -22
  5. package/API/admin-calls.cjs +1 -1
  6. package/API/admin-calls.mjs +8 -9
  7. package/API/brotherhoodCalls.cjs +1 -1
  8. package/API/brotherhoodCalls.mjs +16 -58
  9. package/API/callLifiAPI.cjs +1 -1
  10. package/API/callLifiAPI.d.ts +1 -1
  11. package/API/callLifiAPI.mjs +8 -11
  12. package/API/callMonitor.cjs +1 -1
  13. package/API/callMonitor.mjs +8 -10
  14. package/API/callOdosAPI.cjs +1 -1
  15. package/API/callOdosAPI.mjs +15 -18
  16. package/API/callOkxAPI.cjs +1 -1
  17. package/API/callOkxAPI.d.ts +1 -1
  18. package/API/callOkxAPI.mjs +9 -12
  19. package/API/callOneInchAPI.cjs +1 -1
  20. package/API/callOneInchAPI.mjs +12 -14
  21. package/API/callRelayer.cjs +1 -1
  22. package/API/callRelayer.mjs +12 -14
  23. package/API/checkRisk.cjs +1 -1
  24. package/API/checkRisk.mjs +8 -8
  25. package/API/deposit-and-withdraw-status-calls.cjs +1 -1
  26. package/API/deposit-and-withdraw-status-calls.mjs +12 -17
  27. package/API/enclaveSignatureCalls.cjs +1 -1
  28. package/API/enclaveSignatureCalls.mjs +14 -15
  29. package/API/enclaveUtxoCalls.cjs +1 -1
  30. package/API/enclaveUtxoCalls.d.ts +2 -2
  31. package/API/enclaveUtxoCalls.mjs +21 -23
  32. package/API/fetchCommitmentsCache.cjs +1 -1
  33. package/API/fetchCommitmentsCache.mjs +32 -22
  34. package/API/generate-trading-points.cjs +1 -1
  35. package/API/generate-trading-points.mjs +23 -45
  36. package/API/get-token-data.cjs +1 -1
  37. package/API/get-token-data.mjs +8 -8
  38. package/API/get-token-price-chart-data.cjs +1 -1
  39. package/API/get-token-price-chart-data.mjs +10 -13
  40. package/API/getCoingeckoPrice.cjs +1 -1
  41. package/API/getCoingeckoPrice.mjs +13 -22
  42. package/API/getGasEstimates.cjs +1 -1
  43. package/API/getGasEstimates.mjs +12 -16
  44. package/API/getServerURL.cjs +1 -1
  45. package/API/getServerURL.mjs +38 -60
  46. package/API/getTokenPrice.cjs +1 -1
  47. package/API/getTokenPrice.mjs +11 -17
  48. package/API/getWebsiteURL.cjs +1 -1
  49. package/API/getWebsiteURL.mjs +37 -70
  50. package/API/index.cjs +1 -0
  51. package/API/index.mjs +22 -0
  52. package/API/kycCalls.cjs +1 -1
  53. package/API/kycCalls.mjs +29 -35
  54. package/API/leaderboardCalls.cjs +1 -1
  55. package/API/leaderboardCalls.mjs +7 -15
  56. package/API/onrampCalls.cjs +1 -1
  57. package/API/onrampCalls.mjs +9 -13
  58. package/API/privacy-score-calls.cjs +1 -1
  59. package/API/privacy-score-calls.mjs +16 -27
  60. package/API/privateSendEmailNotificationsCalls.cjs +1 -1
  61. package/API/privateSendEmailNotificationsCalls.mjs +8 -11
  62. package/API/privateSendNonceCalls.cjs +1 -1
  63. package/API/privateSendNonceCalls.mjs +15 -15
  64. package/API/privateSendRecipientInfoCalls.cjs +1 -1
  65. package/API/privateSendRecipientInfoCalls.mjs +7 -14
  66. package/API/proxyAccountsCalls.cjs +1 -1
  67. package/API/proxyAccountsCalls.d.ts +1 -1
  68. package/API/proxyAccountsCalls.mjs +22 -23
  69. package/API/referralsCalls.cjs +1 -1
  70. package/API/referralsCalls.mjs +11 -22
  71. package/API/relayCalls.cjs +1 -1
  72. package/API/relayCalls.mjs +7 -9
  73. package/API/resolve-sns.cjs +1 -1
  74. package/API/resolve-sns.mjs +11 -11
  75. package/API/rewardsUserCalls.cjs +1 -1
  76. package/API/rewardsUserCalls.mjs +16 -50
  77. package/API/scheduled-transactions-calls.cjs +1 -1
  78. package/API/scheduled-transactions-calls.mjs +10 -14
  79. package/API/seedless-calls.cjs +1 -1
  80. package/API/seedless-calls.mjs +8 -12
  81. package/API/send-telegram-callback.cjs +1 -1
  82. package/API/send-telegram-callback.mjs +10 -10
  83. package/API/simulate-batch-tx.cjs +1 -1
  84. package/API/simulate-batch-tx.mjs +11 -14
  85. package/API/simulate-transaction.cjs +1 -1
  86. package/API/simulate-transaction.mjs +14 -18
  87. package/API/snapshot-event-calls.cjs +1 -1
  88. package/API/snapshot-event-calls.mjs +12 -13
  89. package/API/solana-calls.cjs +1 -1
  90. package/API/solana-calls.mjs +8 -19
  91. package/API/temporaryWalletCalls.cjs +1 -1
  92. package/API/temporaryWalletCalls.mjs +15 -19
  93. package/API/tenderly.api.cjs +1 -1
  94. package/API/tenderly.api.d.ts +8 -2
  95. package/API/tenderly.api.mjs +36 -56
  96. package/API/token-calls.cjs +1 -1
  97. package/API/token-calls.mjs +11 -14
  98. package/API/tronSubsidyCalls.cjs +1 -1
  99. package/API/tronSubsidyCalls.mjs +8 -11
  100. package/API/weeklyAnalyticCalls.cjs +1 -1
  101. package/API/weeklyAnalyticCalls.mjs +11 -16
  102. package/_virtual/_rolldown/runtime.cjs +1 -0
  103. package/_virtual/_rolldown/runtime.mjs +7 -0
  104. package/constants/activity.constants.cjs +1 -1
  105. package/constants/activity.constants.mjs +13 -14
  106. package/constants/addresses.constants.cjs +1 -1
  107. package/constants/addresses.constants.d.ts +50 -7
  108. package/constants/addresses.constants.mjs +67 -77
  109. package/constants/assets.constants.cjs +1 -1
  110. package/constants/assets.constants.mjs +15 -15
  111. package/constants/backend.constants.cjs +1 -1
  112. package/constants/backend.constants.mjs +15 -15
  113. package/constants/balance.constants.cjs +1 -1
  114. package/constants/balance.constants.mjs +4 -4
  115. package/constants/bridging.constants.cjs +1 -1
  116. package/constants/bridging.constants.mjs +8 -12
  117. package/constants/chains.constants.cjs +1 -1
  118. package/constants/chains.constants.mjs +221 -241
  119. package/constants/coingecko.constants.cjs +1 -1
  120. package/constants/coingecko.constants.d.ts +26 -2
  121. package/constants/coingecko.constants.mjs +47 -69
  122. package/constants/contracts.constants.cjs +1 -1
  123. package/constants/contracts.constants.mjs +62 -91
  124. package/constants/conversion.constants.cjs +1 -1
  125. package/constants/conversion.constants.mjs +4 -4
  126. package/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
  127. package/constants/deploy-data/deploy-data-arbMainnet.json.mjs +6283 -6911
  128. package/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
  129. package/constants/deploy-data/deploy-data-arcTestnet.json.mjs +6723 -7380
  130. package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
  131. package/constants/deploy-data/deploy-data-base.json.mjs +6295 -6921
  132. package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
  133. package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +6494 -7151
  134. package/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
  135. package/constants/deploy-data/deploy-data-localhost.json.mjs +5351 -5939
  136. package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
  137. package/constants/deploy-data/deploy-data-optimism.json.mjs +6295 -6921
  138. package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
  139. package/constants/deploy-data/deploy-data-polygon.json.mjs +6295 -6921
  140. package/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
  141. package/constants/deploy-data/deploy-data-solana.json.mjs +6 -6491
  142. package/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -1
  143. package/constants/deploy-data/deploy-data-tronMainnet.json.mjs +4266 -4637
  144. package/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -1
  145. package/constants/deploy-data/deploy-data-tronNile.json.mjs +4266 -4637
  146. package/constants/deploy-data/index.d.ts +11 -13
  147. package/constants/events.constants.cjs +1 -1
  148. package/constants/events.constants.mjs +11 -11
  149. package/constants/fees.constants.cjs +1 -1
  150. package/constants/fees.constants.mjs +10 -10
  151. package/constants/function-signatures.constants.cjs +1 -1
  152. package/constants/function-signatures.constants.mjs +4 -7
  153. package/constants/images.constants.cjs +1 -1
  154. package/constants/images.constants.mjs +4 -4
  155. package/constants/index.cjs +1 -0
  156. package/constants/index.mjs +47 -0
  157. package/constants/kyc.constants.cjs +1 -1
  158. package/constants/kyc.constants.d.ts +1 -0
  159. package/constants/kyc.constants.mjs +125 -178
  160. package/constants/lifi.constants.cjs +1 -1
  161. package/constants/lifi.constants.mjs +4 -4
  162. package/constants/link.constant.cjs +1 -1
  163. package/constants/link.constant.mjs +4 -4
  164. package/constants/mediaUrls.constants.cjs +1 -1
  165. package/constants/mediaUrls.constants.mjs +41 -41
  166. package/constants/non-circular-tokens.constants.cjs +1 -1
  167. package/constants/non-circular-tokens.constants.mjs +4 -4
  168. package/constants/oauthUrls.constants.cjs +1 -1
  169. package/constants/oauthUrls.constants.d.ts +0 -3
  170. package/constants/oauthUrls.constants.mjs +6 -9
  171. package/constants/okx.constants.cjs +1 -1
  172. package/constants/okx.constants.mjs +4 -5
  173. package/constants/pay.constants.cjs +1 -1
  174. package/constants/pay.constants.mjs +4 -4
  175. package/constants/permit2.constants.cjs +1 -1
  176. package/constants/permit2.constants.mjs +10 -16
  177. package/constants/presale.constants.cjs +1 -1
  178. package/constants/presale.constants.d.ts +10 -1
  179. package/constants/presale.constants.mjs +447 -502
  180. package/constants/protocol.constants.cjs +1 -1
  181. package/constants/protocol.constants.d.ts +6 -0
  182. package/constants/protocol.constants.mjs +24 -52
  183. package/constants/reorg-depths.constants.cjs +1 -1
  184. package/constants/reorg-depths.constants.d.ts +13 -1
  185. package/constants/reorg-depths.constants.mjs +16 -18
  186. package/constants/rewards.constants.cjs +1 -1
  187. package/constants/rewards.constants.mjs +8 -22
  188. package/constants/save-depths.cjs +1 -1
  189. package/constants/save-depths.d.ts +15 -1
  190. package/constants/save-depths.mjs +18 -20
  191. package/constants/schedule.constants.cjs +1 -1
  192. package/constants/schedule.constants.mjs +9 -13
  193. package/constants/server.constants.cjs +1 -1
  194. package/constants/server.constants.mjs +111 -138
  195. package/constants/tasks.constants.cjs +1 -1
  196. package/constants/tasks.constants.mjs +266 -229
  197. package/constants/token-data/ERC20Registry.cjs +1 -1
  198. package/constants/token-data/ERC20Registry.mjs +69 -107
  199. package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
  200. package/constants/token-data/arbMainnetRegistry.json.mjs +1841 -1845
  201. package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
  202. package/constants/token-data/arbMainnetRegistryFixed.json.mjs +1841 -1845
  203. package/constants/token-data/arcTestnetRegistry.json.cjs +1 -1
  204. package/constants/token-data/arcTestnetRegistry.json.mjs +435 -439
  205. package/constants/token-data/baseRegistry.json.cjs +1 -1
  206. package/constants/token-data/baseRegistry.json.mjs +1134 -1138
  207. package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
  208. package/constants/token-data/baseRegistryFixed.json.mjs +1134 -1138
  209. package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
  210. package/constants/token-data/ethMainnetRegistry.json.mjs +4274 -4278
  211. package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
  212. package/constants/token-data/ethMainnetRegistryFixed.json.mjs +4274 -4278
  213. package/constants/token-data/index.cjs +1 -1
  214. package/constants/token-data/index.d.ts +1 -233
  215. package/constants/token-data/index.mjs +19 -40
  216. package/constants/token-data/localhostRegistry.json.cjs +1 -1
  217. package/constants/token-data/localhostRegistry.json.mjs +2758 -2762
  218. package/constants/token-data/optimismRegistry.json.cjs +1 -1
  219. package/constants/token-data/optimismRegistry.json.mjs +701 -705
  220. package/constants/token-data/optimismRegistryFixed.json.cjs +1 -1
  221. package/constants/token-data/optimismRegistryFixed.json.mjs +701 -705
  222. package/constants/token-data/polygonRegistry.json.cjs +1 -1
  223. package/constants/token-data/polygonRegistry.json.mjs +2309 -2313
  224. package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
  225. package/constants/token-data/polygonRegistryFixed.json.mjs +2309 -2313
  226. package/constants/token-data/solanaLocalnetRegistry.json.cjs +1 -1
  227. package/constants/token-data/solanaLocalnetRegistry.json.mjs +17 -24
  228. package/constants/token-data/solanaMainnetRegistry.json.cjs +1 -1
  229. package/constants/token-data/solanaMainnetRegistry.json.mjs +625 -629
  230. package/constants/token-data/tronMainnetRegistry.json.cjs +1 -1
  231. package/constants/token-data/tronMainnetRegistry.json.mjs +17 -24
  232. package/constants/token-data/tronNileRegistry.json.cjs +1 -1
  233. package/constants/token-data/tronNileRegistry.json.mjs +17 -24
  234. package/constants/token.limits.constants.cjs +1 -1
  235. package/constants/token.limits.constants.mjs +30 -29
  236. package/constants/tokens.constants.cjs +1 -1
  237. package/constants/tokens.constants.mjs +23 -14
  238. package/constants/tx-confirmation.constants.cjs +1 -1
  239. package/constants/tx-confirmation.constants.mjs +4 -7
  240. package/constants/vite.constants.cjs +1 -1
  241. package/constants/vite.constants.d.ts +0 -1
  242. package/constants/vite.constants.mjs +8 -15
  243. package/constants/wallet.constants.cjs +1 -1
  244. package/constants/wallet.constants.mjs +19 -19
  245. package/crypto/babyJub.cjs +1 -1
  246. package/crypto/babyJub.mjs +12 -15
  247. package/crypto/index.cjs +1 -0
  248. package/crypto/index.mjs +3 -0
  249. package/crypto/poseidon.cjs +1 -1
  250. package/crypto/poseidon.mjs +19 -23
  251. package/crypto/preProcessing.cjs +1 -1
  252. package/crypto/preProcessing.mjs +13 -9
  253. package/data-structures/AccountActions/AccountActions.cjs +1 -1
  254. package/data-structures/AccountActions/AccountActions.mjs +63 -66
  255. package/data-structures/AccountActions/index.cjs +1 -0
  256. package/data-structures/AccountActions/index.mjs +1 -0
  257. package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
  258. package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +200 -172
  259. package/data-structures/ApprovalDBs/index.cjs +1 -0
  260. package/data-structures/ApprovalDBs/index.mjs +1 -0
  261. package/data-structures/BlockchainEvent/BlockchainEvent.cjs +1 -1
  262. package/data-structures/BlockchainEvent/BlockchainEvent.mjs +40 -44
  263. package/data-structures/Hinkal/Hinkal.cjs +1 -1
  264. package/data-structures/Hinkal/Hinkal.d.ts +14 -12
  265. package/data-structures/Hinkal/Hinkal.mjs +435 -630
  266. package/data-structures/Hinkal/IHinkal.d.ts +6 -5
  267. package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
  268. package/data-structures/Hinkal/handleAutoDepositBack.mjs +92 -174
  269. package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
  270. package/data-structures/Hinkal/hinkalActionReceive.d.ts +2 -1
  271. package/data-structures/Hinkal/hinkalActionReceive.mjs +20 -44
  272. package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.cjs +1 -1
  273. package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.mjs +14 -27
  274. package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
  275. package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +17 -61
  276. package/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -1
  277. package/data-structures/Hinkal/hinkalClaimUtxo.mjs +53 -118
  278. package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
  279. package/data-structures/Hinkal/hinkalDeposit.d.ts +2 -2
  280. package/data-structures/Hinkal/hinkalDeposit.mjs +64 -156
  281. package/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -1
  282. package/data-structures/Hinkal/hinkalDepositAndBridge.mjs +115 -258
  283. package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
  284. package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +2 -1
  285. package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +77 -190
  286. package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
  287. package/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +1 -1
  288. package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +75 -146
  289. package/data-structures/Hinkal/hinkalGetRecipientInfo.cjs +1 -1
  290. package/data-structures/Hinkal/hinkalGetRecipientInfo.mjs +8 -9
  291. package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
  292. package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +21 -21
  293. package/data-structures/Hinkal/hinkalMultiSend.cjs +1 -1
  294. package/data-structures/Hinkal/hinkalMultiSend.d.ts +2 -2
  295. package/data-structures/Hinkal/hinkalMultiSend.mjs +11 -12
  296. package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  297. package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +1 -1
  298. package/data-structures/Hinkal/hinkalPrivateWallet.mjs +56 -155
  299. package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
  300. package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +166 -196
  301. package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
  302. package/data-structures/Hinkal/hinkalProxySwap.mjs +23 -62
  303. package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
  304. package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +27 -48
  305. package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
  306. package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +3 -2
  307. package/data-structures/Hinkal/hinkalSignSubAccount.mjs +14 -23
  308. package/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
  309. package/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +93 -129
  310. package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
  311. package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +62 -120
  312. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  313. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +2 -1
  314. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +167 -294
  315. package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -1
  316. package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +20 -27
  317. package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
  318. package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +37 -54
  319. package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
  320. package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +72 -99
  321. package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
  322. package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +66 -110
  323. package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
  324. package/data-structures/Hinkal/hinkalSolanaSwap.mjs +97 -140
  325. package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
  326. package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +92 -149
  327. package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
  328. package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +78 -141
  329. package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
  330. package/data-structures/Hinkal/hinkalSwap.d.ts +3 -2
  331. package/data-structures/Hinkal/hinkalSwap.mjs +52 -95
  332. package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
  333. package/data-structures/Hinkal/hinkalTransfer.mjs +61 -127
  334. package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  335. package/data-structures/Hinkal/hinkalWithdraw.d.ts +3 -1
  336. package/data-structures/Hinkal/hinkalWithdraw.mjs +67 -126
  337. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  338. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +142 -235
  339. package/data-structures/Hinkal/index.cjs +1 -0
  340. package/data-structures/Hinkal/index.mjs +17 -0
  341. package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  342. package/data-structures/Hinkal/resetMerkleTrees.mjs +62 -122
  343. package/data-structures/IndexedDB/activity-db.cjs +1 -1
  344. package/data-structures/IndexedDB/activity-db.d.ts +2 -2
  345. package/data-structures/IndexedDB/activity-db.mjs +109 -178
  346. package/data-structures/IndexedDB/balances-db.cjs +1 -1
  347. package/data-structures/IndexedDB/balances-db.mjs +48 -99
  348. package/data-structures/IndexedDB/contact-db.cjs +1 -1
  349. package/data-structures/IndexedDB/contact-db.mjs +46 -103
  350. package/data-structures/IndexedDB/index.cjs +1 -0
  351. package/data-structures/IndexedDB/index.mjs +7 -0
  352. package/data-structures/IndexedDB/pay-activity-db.cjs +1 -1
  353. package/data-structures/IndexedDB/pay-activity-db.mjs +22 -26
  354. package/data-structures/IndexedDB/prices-db.cjs +1 -1
  355. package/data-structures/IndexedDB/prices-db.mjs +54 -62
  356. package/data-structures/IndexedDB/private-balances-db.cjs +1 -1
  357. package/data-structures/IndexedDB/private-balances-db.mjs +23 -28
  358. package/data-structures/IndexedDB/signatures-db.cjs +1 -1
  359. package/data-structures/IndexedDB/signatures-db.mjs +41 -48
  360. package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
  361. package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +72 -80
  362. package/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
  363. package/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +168 -204
  364. package/data-structures/TokenDBs/ArcPublicTokensDB.cjs +1 -1
  365. package/data-structures/TokenDBs/ArcPublicTokensDB.mjs +94 -112
  366. package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
  367. package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +129 -174
  368. package/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
  369. package/data-structures/TokenDBs/PrivateTokensDB.mjs +49 -65
  370. package/data-structures/TokenDBs/PublicTokensDB.cjs +1 -1
  371. package/data-structures/TokenDBs/PublicTokensDB.mjs +28 -32
  372. package/data-structures/TokenDBs/index.cjs +1 -0
  373. package/data-structures/TokenDBs/index.mjs +4 -0
  374. package/data-structures/TokenDBs/token-visibility-db.cjs +1 -1
  375. package/data-structures/TokenDBs/token-visibility-db.mjs +78 -82
  376. package/data-structures/ValueCache/ValueCache.cjs +1 -1
  377. package/data-structures/ValueCache/ValueCache.mjs +23 -24
  378. package/data-structures/cacheDevices/AttachableMemoryCacheDevice.cjs +1 -1
  379. package/data-structures/cacheDevices/AttachableMemoryCacheDevice.mjs +25 -27
  380. package/data-structures/cacheDevices/BaseCacheDevice.cjs +1 -1
  381. package/data-structures/cacheDevices/BaseCacheDevice.mjs +20 -20
  382. package/data-structures/cacheDevices/FileCacheDevice.cjs +1 -1
  383. package/data-structures/cacheDevices/FileCacheDevice.mjs +39 -40
  384. package/data-structures/cacheDevices/LocalStorageCacheDevice.cjs +1 -1
  385. package/data-structures/cacheDevices/LocalStorageCacheDevice.mjs +20 -20
  386. package/data-structures/cacheDevices/index.cjs +1 -0
  387. package/data-structures/cacheDevices/index.mjs +2 -0
  388. package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
  389. package/data-structures/crypto-keys/decodeUTXO.mjs +78 -98
  390. package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
  391. package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +48 -46
  392. package/data-structures/crypto-keys/index.cjs +1 -0
  393. package/data-structures/crypto-keys/index.mjs +4 -0
  394. package/data-structures/crypto-keys/keyUtils.cjs +1 -1
  395. package/data-structures/crypto-keys/keyUtils.mjs +8 -10
  396. package/data-structures/crypto-keys/keys.cjs +1 -1
  397. package/data-structures/crypto-keys/keys.mjs +95 -133
  398. package/data-structures/custom-token-registry/CustomTokenRegistry.cjs +1 -1
  399. package/data-structures/custom-token-registry/CustomTokenRegistry.mjs +25 -29
  400. package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -1
  401. package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.mjs +73 -84
  402. package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -1
  403. package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.mjs +80 -91
  404. package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -1
  405. package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.mjs +92 -102
  406. package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
  407. package/data-structures/event-service/evm/AbstractEventService.mjs +33 -36
  408. package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
  409. package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +41 -47
  410. package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
  411. package/data-structures/event-service/evm/AbstractSnapshotService.mjs +31 -33
  412. package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
  413. package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +103 -119
  414. package/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +1 -1
  415. package/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +20 -24
  416. package/data-structures/event-service/evm/PollingBlockchainEventEmitter.cjs +1 -1
  417. package/data-structures/event-service/evm/PollingBlockchainEventEmitter.mjs +13 -13
  418. package/data-structures/event-service/helpers/ClientEventHelper.cjs +1 -1
  419. package/data-structures/event-service/helpers/ClientEventHelper.mjs +27 -37
  420. package/data-structures/event-service/helpers/PollingEventHelper.cjs +1 -1
  421. package/data-structures/event-service/helpers/PollingEventHelper.mjs +13 -13
  422. package/data-structures/event-service/index.cjs +1 -0
  423. package/data-structures/event-service/index.mjs +17 -0
  424. package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -1
  425. package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +74 -85
  426. package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
  427. package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +97 -112
  428. package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
  429. package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +38 -38
  430. package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
  431. package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +41 -47
  432. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
  433. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +28 -30
  434. package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.cjs +1 -1
  435. package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.d.ts +1 -1
  436. package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.mjs +21 -25
  437. package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.cjs +1 -1
  438. package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.mjs +15 -15
  439. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
  440. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +1 -1
  441. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +177 -203
  442. package/data-structures/http/BasicHttpClient.cjs +1 -1
  443. package/data-structures/http/BasicHttpClient.mjs +24 -24
  444. package/data-structures/http/HttpClient.cjs +1 -1
  445. package/data-structures/http/HttpClient.d.ts +4 -4
  446. package/data-structures/http/HttpClient.mjs +13 -14
  447. package/data-structures/http/index.cjs +1 -0
  448. package/data-structures/http/index.mjs +2 -0
  449. package/data-structures/index.cjs +1 -0
  450. package/data-structures/index.mjs +87 -0
  451. package/data-structures/merkle-tree/MerkleTree.cjs +1 -1
  452. package/data-structures/merkle-tree/MerkleTree.mjs +115 -177
  453. package/data-structures/merkle-tree/MerkleTreeIncompleteError.cjs +1 -1
  454. package/data-structures/merkle-tree/MerkleTreeIncompleteError.mjs +7 -7
  455. package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs +1 -1
  456. package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +12 -12
  457. package/data-structures/merkle-tree/index.cjs +1 -0
  458. package/data-structures/merkle-tree/index.mjs +3 -0
  459. package/data-structures/presale/PresaleContractWrapper.cjs +1 -1
  460. package/data-structures/presale/PresaleContractWrapper.mjs +56 -53
  461. package/data-structures/presale/index.cjs +1 -0
  462. package/data-structures/presale/index.mjs +1 -0
  463. package/data-structures/snapshot/SnapshotFetcherService.cjs +1 -1
  464. package/data-structures/snapshot/SnapshotFetcherService.d.ts +4 -4
  465. package/data-structures/snapshot/SnapshotFetcherService.mjs +39 -41
  466. package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
  467. package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +27 -46
  468. package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
  469. package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +29 -49
  470. package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
  471. package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +22 -40
  472. package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
  473. package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +20 -38
  474. package/data-structures/snapshot/index.cjs +1 -0
  475. package/data-structures/snapshot/index.mjs +8 -0
  476. package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
  477. package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +25 -46
  478. package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
  479. package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +22 -39
  480. package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
  481. package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +20 -38
  482. package/data-structures/token-price-fetcher/TokenChecker.cjs +1 -1
  483. package/data-structures/token-price-fetcher/TokenChecker.mjs +15 -15
  484. package/data-structures/token-price-fetcher/index.cjs +1 -0
  485. package/data-structures/token-price-fetcher/index.mjs +1 -0
  486. package/data-structures/transactions-manager/history/history.types.cjs +1 -1
  487. package/data-structures/transactions-manager/history/history.types.mjs +6 -4
  488. package/data-structures/utxo/Utxo.cjs +1 -1
  489. package/data-structures/utxo/Utxo.mjs +110 -151
  490. package/error-handling/customErrors/ErrorWithAmount.cjs +1 -1
  491. package/error-handling/customErrors/ErrorWithAmount.mjs +8 -8
  492. package/error-handling/customErrors/ErrorWithIndex.cjs +1 -1
  493. package/error-handling/customErrors/ErrorWithIndex.mjs +8 -8
  494. package/error-handling/customErrors/ErrorWithTx.cjs +1 -1
  495. package/error-handling/customErrors/ErrorWithTx.mjs +8 -8
  496. package/error-handling/customErrors/FeeOverTransactionValueError.cjs +1 -1
  497. package/error-handling/customErrors/FeeOverTransactionValueError.mjs +8 -8
  498. package/error-handling/customErrors/SimulationFailureError.cjs +1 -1
  499. package/error-handling/customErrors/SimulationFailureError.d.ts +4 -4
  500. package/error-handling/customErrors/SimulationFailureError.mjs +8 -8
  501. package/error-handling/customErrors/customErrors.helpers.cjs +1 -1
  502. package/error-handling/customErrors/customErrors.helpers.mjs +15 -20
  503. package/error-handling/customErrors/index.cjs +1 -0
  504. package/error-handling/customErrors/index.mjs +6 -0
  505. package/error-handling/error-codes.constants.cjs +2 -2
  506. package/error-handling/error-codes.constants.d.ts +10 -1
  507. package/error-handling/error-codes.constants.mjs +229 -230
  508. package/error-handling/get-error.message.cjs +1 -1
  509. package/error-handling/get-error.message.d.ts +2 -2
  510. package/error-handling/get-error.message.mjs +73 -99
  511. package/error-handling/index.cjs +1 -0
  512. package/error-handling/index.mjs +12 -0
  513. package/error-handling/isInsufficientFundsError.cjs +1 -1
  514. package/error-handling/isInsufficientFundsError.mjs +15 -18
  515. package/error-handling/logError.cjs +1 -1
  516. package/error-handling/logError.mjs +6 -6
  517. package/error-handling/logger.cjs +1 -1
  518. package/error-handling/logger.mjs +17 -14
  519. package/error-handling/types.cjs +1 -1
  520. package/error-handling/types.mjs +6 -4
  521. package/externalABIs/BUSD.cjs +1 -1
  522. package/externalABIs/BUSD.mjs +810 -518
  523. package/externalABIs/BabPassport.json.cjs +1 -1
  524. package/externalABIs/BabPassport.json.mjs +19 -28
  525. package/externalABIs/DAI.cjs +1 -1
  526. package/externalABIs/DAI.mjs +504 -333
  527. package/externalABIs/ERC1155.json.cjs +1 -1
  528. package/externalABIs/ERC1155.json.mjs +287 -320
  529. package/externalABIs/ERC20.json.cjs +1 -1
  530. package/externalABIs/ERC20.json.mjs +256 -307
  531. package/externalABIs/ERC721.json.cjs +1 -1
  532. package/externalABIs/ERC721.json.mjs +299 -338
  533. package/externalABIs/GalxePassport.json.cjs +1 -1
  534. package/externalABIs/GalxePassport.json.mjs +36 -45
  535. package/externalABIs/IQuoterV2.json.cjs +1 -1
  536. package/externalABIs/IQuoterV2.json.mjs +202 -221
  537. package/externalABIs/ISwapRouter.json.cjs +1 -1
  538. package/externalABIs/ISwapRouter.json.mjs +537 -571
  539. package/externalABIs/IUniswapV3Factory.json.cjs +1 -1
  540. package/externalABIs/IUniswapV3Factory.json.mjs +187 -217
  541. package/externalABIs/IUniswapV3Pool.json.cjs +1 -1
  542. package/externalABIs/IUniswapV3Pool.json.mjs +937 -1015
  543. package/externalABIs/NodeInterfaceABI.json.cjs +1 -1
  544. package/externalABIs/NodeInterfaceABI.json.mjs +263 -279
  545. package/externalABIs/OptimismGasPriceOracle.json.cjs +1 -1
  546. package/externalABIs/OptimismGasPriceOracle.json.mjs +173 -205
  547. package/externalABIs/SanctionsList.cjs +1 -1
  548. package/externalABIs/SanctionsList.mjs +161 -88
  549. package/externalABIs/USDC.cjs +1 -1
  550. package/externalABIs/USDC.mjs +1081 -720
  551. package/externalABIs/USDR.cjs +1 -1
  552. package/externalABIs/USDR.mjs +694 -345
  553. package/externalABIs/USDR3CRV.cjs +1 -1
  554. package/externalABIs/USDR3CRV.mjs +1001 -541
  555. package/externalABIs/USDT.cjs +1 -1
  556. package/externalABIs/USDT.mjs +582 -392
  557. package/externalABIs/UniswapV2PoolAbi.json.cjs +1 -1
  558. package/externalABIs/UniswapV2PoolAbi.json.mjs +77 -92
  559. package/externalABIs/WETH.cjs +1 -1
  560. package/externalABIs/WETH.mjs +244 -155
  561. package/externalABIs/amToken.cjs +1 -1
  562. package/externalABIs/amToken.mjs +743 -349
  563. package/externalABIs/index.cjs +1 -1
  564. package/externalABIs/index.d.ts +2 -2
  565. package/externalABIs/index.mjs +23 -20
  566. package/externalABIs/swapAbi.cjs +1 -1
  567. package/externalABIs/swapAbi.mjs +248 -290
  568. package/externalABIs/transactionsProver.json.cjs +1 -1
  569. package/externalABIs/transactionsProver.json.mjs +42 -55
  570. package/functions/auto-deposit-back-helpers/get-gas-token-records.cjs +1 -1
  571. package/functions/auto-deposit-back-helpers/get-gas-token-records.mjs +23 -73
  572. package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.cjs +1 -1
  573. package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.mjs +19 -59
  574. package/functions/auto-deposit-back-helpers/index.cjs +1 -0
  575. package/functions/auto-deposit-back-helpers/index.mjs +4 -0
  576. package/functions/auto-deposit-back-helpers/select-gas-token.cjs +1 -1
  577. package/functions/auto-deposit-back-helpers/select-gas-token.mjs +33 -78
  578. package/functions/auto-deposit-back-helpers/update-hinkal.cjs +1 -1
  579. package/functions/auto-deposit-back-helpers/update-hinkal.mjs +21 -17
  580. package/functions/index.cjs +1 -0
  581. package/functions/index.mjs +122 -0
  582. package/functions/kyc/checkTokenLimitsUSD.cjs +1 -0
  583. package/functions/kyc/checkTokenLimitsUSD.d.ts +1 -0
  584. package/functions/kyc/checkTokenLimitsUSD.mjs +29 -0
  585. package/functions/kyc/index.cjs +1 -0
  586. package/functions/kyc/index.d.ts +1 -0
  587. package/functions/kyc/index.mjs +4 -0
  588. package/functions/kyc/openDefaultPassportWindow.cjs +1 -1
  589. package/functions/kyc/openDefaultPassportWindow.mjs +6 -10
  590. package/functions/kyc/passportHelper.cjs +1 -1
  591. package/functions/kyc/passportHelper.mjs +8 -8
  592. package/functions/kyc/zkMeHelper.cjs +1 -1
  593. package/functions/kyc/zkMeHelper.mjs +40 -51
  594. package/functions/pre-transaction/addressTableLookup.cjs +1 -1
  595. package/functions/pre-transaction/addressTableLookup.d.ts +1 -1
  596. package/functions/pre-transaction/addressTableLookup.mjs +32 -43
  597. package/functions/pre-transaction/constructAdminData.cjs +1 -1
  598. package/functions/pre-transaction/constructAdminData.mjs +25 -26
  599. package/functions/pre-transaction/convert-okx-instructions.cjs +1 -1
  600. package/functions/pre-transaction/convert-okx-instructions.d.ts +0 -1
  601. package/functions/pre-transaction/convert-okx-instructions.mjs +33 -33
  602. package/functions/pre-transaction/ensureAmountChanges.cjs +1 -1
  603. package/functions/pre-transaction/ensureAmountChanges.mjs +9 -10
  604. package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
  605. package/functions/pre-transaction/getExternalSwapAddress.mjs +26 -28
  606. package/functions/pre-transaction/getFeeStructure.cjs +1 -1
  607. package/functions/pre-transaction/getFeeStructure.mjs +19 -29
  608. package/functions/pre-transaction/getFlatFees.cjs +1 -1
  609. package/functions/pre-transaction/getFlatFees.d.ts +4 -1
  610. package/functions/pre-transaction/getFlatFees.mjs +50 -54
  611. package/functions/pre-transaction/getKycAndSignatureData.cjs +1 -1
  612. package/functions/pre-transaction/getKycAndSignatureData.d.ts +1 -1
  613. package/functions/pre-transaction/getKycAndSignatureData.mjs +11 -19
  614. package/functions/pre-transaction/getSignatureDataForTransact.cjs +1 -1
  615. package/functions/pre-transaction/getSignatureDataForTransact.mjs +6 -6
  616. package/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
  617. package/functions/pre-transaction/getSolanaCalldataHash.mjs +37 -35
  618. package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
  619. package/functions/pre-transaction/getVolatileTransferAmount.d.ts +1 -1
  620. package/functions/pre-transaction/getVolatileTransferAmount.mjs +31 -37
  621. package/functions/pre-transaction/index.cjs +1 -0
  622. package/functions/pre-transaction/index.mjs +21 -0
  623. package/functions/pre-transaction/initTokenLimitIfNeeded.cjs +1 -1
  624. package/functions/pre-transaction/initTokenLimitIfNeeded.mjs +16 -19
  625. package/functions/pre-transaction/interaction-to-action.cjs +1 -1
  626. package/functions/pre-transaction/interaction-to-action.mjs +10 -9
  627. package/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
  628. package/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +1 -1
  629. package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +15 -23
  630. package/functions/pre-transaction/merge-with-fee-structure.cjs +1 -1
  631. package/functions/pre-transaction/merge-with-fee-structure.mjs +18 -21
  632. package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
  633. package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +2 -1
  634. package/functions/pre-transaction/outputApprovalDataProcessing.mjs +21 -23
  635. package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
  636. package/functions/pre-transaction/outputUtxoProcessing.mjs +29 -34
  637. package/functions/pre-transaction/process-gas-estimates.cjs +1 -1
  638. package/functions/pre-transaction/process-gas-estimates.mjs +24 -24
  639. package/functions/pre-transaction/recipientUtxoProcessing.cjs +1 -1
  640. package/functions/pre-transaction/recipientUtxoProcessing.mjs +29 -35
  641. package/functions/pre-transaction/sendInitNullifiersTransaction.cjs +1 -1
  642. package/functions/pre-transaction/sendInitNullifiersTransaction.mjs +43 -40
  643. package/functions/pre-transaction/sendV0Transaction.cjs +1 -1
  644. package/functions/pre-transaction/sendV0Transaction.mjs +113 -184
  645. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
  646. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +10 -9
  647. package/functions/pre-transaction/solana-public-signals.cjs +1 -1
  648. package/functions/pre-transaction/solana-public-signals.mjs +55 -62
  649. package/functions/pre-transaction/solana.cjs +1 -1
  650. package/functions/pre-transaction/solana.mjs +91 -104
  651. package/functions/pre-transaction/solanaTransfer.utils.cjs +1 -1
  652. package/functions/pre-transaction/solanaTransfer.utils.mjs +21 -37
  653. package/functions/pre-transaction/store-instructions.cjs +1 -1
  654. package/functions/pre-transaction/store-instructions.mjs +12 -13
  655. package/functions/pre-transaction/store-proof.cjs +1 -1
  656. package/functions/pre-transaction/store-proof.mjs +28 -53
  657. package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs +1 -1
  658. package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +28 -32
  659. package/functions/private-wallet/emporium.helpers.cjs +1 -1
  660. package/functions/private-wallet/emporium.helpers.d.ts +6 -6
  661. package/functions/private-wallet/emporium.helpers.mjs +151 -197
  662. package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
  663. package/functions/private-wallet/emporium.swap.helpers.mjs +106 -154
  664. package/functions/private-wallet/index.cjs +1 -0
  665. package/functions/private-wallet/index.mjs +3 -0
  666. package/functions/private-wallet/opProducer.cjs +1 -1
  667. package/functions/private-wallet/opProducer.mjs +27 -22
  668. package/functions/snarkjs/common.snarkjs.cjs +1 -1
  669. package/functions/snarkjs/common.snarkjs.d.ts +3 -3
  670. package/functions/snarkjs/common.snarkjs.mjs +141 -191
  671. package/functions/snarkjs/constant.cjs +1 -1
  672. package/functions/snarkjs/constant.d.ts +1 -2
  673. package/functions/snarkjs/constant.mjs +432 -475
  674. package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
  675. package/functions/snarkjs/constructEmporiumProof.d.ts +4 -4
  676. package/functions/snarkjs/constructEmporiumProof.mjs +73 -155
  677. package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
  678. package/functions/snarkjs/constructGeneralZkProof.d.ts +3 -3
  679. package/functions/snarkjs/constructGeneralZkProof.mjs +62 -132
  680. package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
  681. package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -1
  682. package/functions/snarkjs/constructSolanaZkProof.mjs +43 -98
  683. package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
  684. package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +17 -22
  685. package/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -1
  686. package/functions/snarkjs/fetchOnChainRootHashes.mjs +11 -14
  687. package/functions/snarkjs/generateCircomData.cjs +1 -1
  688. package/functions/snarkjs/generateCircomData.d.ts +1 -1
  689. package/functions/snarkjs/generateCircomData.mjs +34 -34
  690. package/functions/snarkjs/generateZkProof.cjs +1 -1
  691. package/functions/snarkjs/generateZkProof.d.ts +2 -2
  692. package/functions/snarkjs/generateZkProof.mjs +13 -14
  693. package/functions/snarkjs/generateZkProofEnclave.cjs +1 -1
  694. package/functions/snarkjs/generateZkProofEnclave.d.ts +1 -2
  695. package/functions/snarkjs/generateZkProofEnclave.mjs +29 -26
  696. package/functions/snarkjs/generateZkProofSelf.cjs +1 -1
  697. package/functions/snarkjs/generateZkProofSelf.d.ts +2 -2
  698. package/functions/snarkjs/generateZkProofSelf.mjs +24 -16
  699. package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -1
  700. package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +1 -2
  701. package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +130 -187
  702. package/functions/snarkjs/getOriginalSender.cjs +1 -1
  703. package/functions/snarkjs/getOriginalSender.mjs +5 -5
  704. package/functions/snarkjs/getZKFiles.cjs +1 -1
  705. package/functions/snarkjs/getZKFiles.d.ts +2 -3
  706. package/functions/snarkjs/getZKFiles.mjs +7 -13
  707. package/functions/snarkjs/index.cjs +1 -0
  708. package/functions/snarkjs/index.mjs +6 -0
  709. package/functions/utils/addresses.cjs +1 -1
  710. package/functions/utils/addresses.d.ts +1 -0
  711. package/functions/utils/addresses.mjs +40 -40
  712. package/functions/utils/amounts.utils.cjs +1 -1
  713. package/functions/utils/amounts.utils.d.ts +1 -2
  714. package/functions/utils/amounts.utils.mjs +64 -95
  715. package/functions/utils/arraysMatch.cjs +1 -1
  716. package/functions/utils/arraysMatch.mjs +4 -4
  717. package/functions/utils/buildClaimableDepositPlan.cjs +1 -1
  718. package/functions/utils/buildClaimableDepositPlan.mjs +30 -39
  719. package/functions/utils/bytes32.utils.cjs +1 -1
  720. package/functions/utils/bytes32.utils.mjs +9 -11
  721. package/functions/utils/cacheDevice.utils.cjs +1 -1
  722. package/functions/utils/cacheDevice.utils.d.ts +1 -1
  723. package/functions/utils/cacheDevice.utils.mjs +16 -29
  724. package/functions/utils/cacheFunctions.cjs +1 -1
  725. package/functions/utils/cacheFunctions.d.ts +4 -4
  726. package/functions/utils/cacheFunctions.mjs +68 -82
  727. package/functions/utils/caseInsensitive.utils.cjs +1 -1
  728. package/functions/utils/caseInsensitive.utils.mjs +4 -6
  729. package/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
  730. package/functions/utils/convertEmporiumOpToCallInfo.mjs +18 -10
  731. package/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
  732. package/functions/utils/convertIntegrationProviderToExternalActionId.mjs +14 -14
  733. package/functions/utils/create-provider.cjs +1 -1
  734. package/functions/utils/create-provider.mjs +13 -16
  735. package/functions/utils/enclave-signature-storage.cjs +1 -1
  736. package/functions/utils/enclave-signature-storage.mjs +11 -12
  737. package/functions/utils/enclave-utxo-storage.cjs +1 -1
  738. package/functions/utils/enclave-utxo-storage.mjs +31 -32
  739. package/functions/utils/encodeTokenWithId.cjs +1 -1
  740. package/functions/utils/encodeTokenWithId.mjs +7 -7
  741. package/functions/utils/encryptInputForEnclave.cjs +1 -1
  742. package/functions/utils/encryptInputForEnclave.mjs +40 -44
  743. package/functions/utils/erc20tokenFunctions.cjs +1 -1
  744. package/functions/utils/erc20tokenFunctions.mjs +41 -53
  745. package/functions/utils/evmNetworkFunctions.cjs +1 -1
  746. package/functions/utils/evmNetworkFunctions.mjs +6 -21
  747. package/functions/utils/external-action.utils.cjs +1 -1
  748. package/functions/utils/external-action.utils.mjs +7 -10
  749. package/functions/utils/fees.utils.cjs +1 -1
  750. package/functions/utils/fees.utils.mjs +28 -36
  751. package/functions/utils/get-signature-header.cjs +1 -1
  752. package/functions/utils/get-signature-header.mjs +4 -8
  753. package/functions/utils/getBlockExplorerUrl.cjs +1 -1
  754. package/functions/utils/getBlockExplorerUrl.mjs +6 -6
  755. package/functions/utils/getContractAddress.cjs +1 -1
  756. package/functions/utils/getContractAddress.mjs +7 -8
  757. package/functions/utils/getDataFromTransaction.cjs +1 -1
  758. package/functions/utils/getDataFromTransaction.d.ts +2 -2
  759. package/functions/utils/getDataFromTransaction.mjs +41 -39
  760. package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
  761. package/functions/utils/getRecipientInfoFromUserKeys.mjs +14 -14
  762. package/functions/utils/getSignerFromContract.cjs +1 -1
  763. package/functions/utils/getSignerFromContract.mjs +12 -15
  764. package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
  765. package/functions/utils/getUtxosFromReceipt.utils.mjs +51 -56
  766. package/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
  767. package/functions/utils/getUtxosFromReceiptSolana.mjs +29 -30
  768. package/functions/utils/getWalletGroupKey.utils.cjs +1 -0
  769. package/functions/utils/getWalletGroupKey.utils.d.ts +1 -0
  770. package/functions/utils/getWalletGroupKey.utils.mjs +4 -0
  771. package/functions/utils/inLogicMetadata.cjs +1 -1
  772. package/functions/utils/inLogicMetadata.mjs +15 -8
  773. package/functions/utils/index.cjs +1 -0
  774. package/functions/utils/index.d.ts +1 -0
  775. package/functions/utils/index.mjs +79 -0
  776. package/functions/utils/involves-permit2-op.cjs +1 -1
  777. package/functions/utils/involves-permit2-op.mjs +5 -7
  778. package/functions/utils/ipfs.cjs +1 -1
  779. package/functions/utils/ipfs.mjs +21 -24
  780. package/functions/utils/is-valid-url.cjs +1 -1
  781. package/functions/utils/is-valid-url.mjs +4 -4
  782. package/functions/utils/merkleTree.utils.cjs +1 -1
  783. package/functions/utils/merkleTree.utils.mjs +9 -19
  784. package/functions/utils/mutexes.utils.cjs +1 -1
  785. package/functions/utils/mutexes.utils.mjs +5 -5
  786. package/functions/utils/networks.utils.cjs +1 -1
  787. package/functions/utils/networks.utils.mjs +8 -22
  788. package/functions/utils/nftTokenFunctions.cjs +1 -1
  789. package/functions/utils/nftTokenFunctions.mjs +18 -24
  790. package/functions/utils/nickname.utils.cjs +1 -1
  791. package/functions/utils/nickname.utils.mjs +4 -7
  792. package/functions/utils/postToOffscreen.cjs +1 -1
  793. package/functions/utils/postToOffscreen.mjs +8 -5
  794. package/functions/utils/prepareHinkal.cjs +1 -1
  795. package/functions/utils/prepareHinkal.mjs +41 -60
  796. package/functions/utils/process.utils.cjs +1 -1
  797. package/functions/utils/process.utils.mjs +21 -26
  798. package/functions/utils/processUseApprovalUtxoData.cjs +1 -1
  799. package/functions/utils/processUseApprovalUtxoData.mjs +13 -19
  800. package/functions/utils/proxyAvatar.utils.cjs +1 -1
  801. package/functions/utils/proxyAvatar.utils.mjs +4 -5
  802. package/functions/utils/publicBalance.utils.cjs +1 -1
  803. package/functions/utils/publicBalance.utils.mjs +101 -106
  804. package/functions/utils/reloadPage.cjs +1 -1
  805. package/functions/utils/reloadPage.mjs +4 -4
  806. package/functions/utils/requireEnv.cjs +1 -1
  807. package/functions/utils/requireEnv.mjs +6 -6
  808. package/functions/utils/resolve-sync.utils.cjs +1 -1
  809. package/functions/utils/resolve-sync.utils.mjs +27 -30
  810. package/functions/utils/rpc-int-encode.cjs +1 -1
  811. package/functions/utils/rpc-int-encode.mjs +5 -5
  812. package/functions/utils/serialize-utxos.utils.cjs +1 -1
  813. package/functions/utils/serialize-utxos.utils.mjs +11 -12
  814. package/functions/utils/serialize.utils.cjs +1 -1
  815. package/functions/utils/serialize.utils.d.ts +8 -0
  816. package/functions/utils/serialize.utils.mjs +7 -5
  817. package/functions/utils/solanaMint.utils.cjs +1 -1
  818. package/functions/utils/solanaMint.utils.mjs +17 -13
  819. package/functions/utils/string.utils.cjs +1 -1
  820. package/functions/utils/string.utils.mjs +38 -49
  821. package/functions/utils/time.utils.cjs +1 -1
  822. package/functions/utils/time.utils.mjs +48 -54
  823. package/functions/utils/token-check.utils.cjs +1 -1
  824. package/functions/utils/token-check.utils.mjs +17 -21
  825. package/functions/utils/trimFieldValues.cjs +1 -1
  826. package/functions/utils/trimFieldValues.mjs +22 -16
  827. package/functions/utils/tron.utils.cjs +1 -1
  828. package/functions/utils/tron.utils.d.ts +9 -1
  829. package/functions/utils/tron.utils.mjs +151 -127
  830. package/functions/utils/tronSimulation.utils.cjs +1 -1
  831. package/functions/utils/tronSimulation.utils.mjs +24 -29
  832. package/functions/utils/tx-confirmation.utils.cjs +1 -1
  833. package/functions/utils/tx-confirmation.utils.d.ts +3 -3
  834. package/functions/utils/tx-confirmation.utils.mjs +33 -49
  835. package/functions/utils/upToDateState.cjs +1 -1
  836. package/functions/utils/upToDateState.mjs +8 -10
  837. package/functions/utils/userAgent.cjs +1 -1
  838. package/functions/utils/userAgent.mjs +7 -7
  839. package/functions/utils/validateUsername.cjs +1 -1
  840. package/functions/utils/validateUsername.mjs +21 -15
  841. package/functions/utils/walletBalances.utils.cjs +1 -1
  842. package/functions/utils/walletBalances.utils.mjs +10 -10
  843. package/functions/web3/EIP-712.cjs +1 -1
  844. package/functions/web3/EIP-712.mjs +109 -112
  845. package/functions/web3/connectors.utils.cjs +1 -1
  846. package/functions/web3/connectors.utils.mjs +22 -24
  847. package/functions/web3/crypto.cjs +1 -1
  848. package/functions/web3/crypto.mjs +9 -6
  849. package/functions/web3/etherFunctions.cjs +1 -1
  850. package/functions/web3/etherFunctions.mjs +36 -41
  851. package/functions/web3/events/balanceChangedCustomHandler.cjs +1 -1
  852. package/functions/web3/events/balanceChangedCustomHandler.mjs +8 -11
  853. package/functions/web3/events/balanceChangedHandler.cjs +1 -1
  854. package/functions/web3/events/balanceChangedHandler.mjs +8 -9
  855. package/functions/web3/events/getApprovedBalance.cjs +1 -1
  856. package/functions/web3/events/getApprovedBalance.d.ts +3 -3
  857. package/functions/web3/events/getApprovedBalance.mjs +36 -48
  858. package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  859. package/functions/web3/events/getInputUtxoAndBalance.d.ts +1 -1
  860. package/functions/web3/events/getInputUtxoAndBalance.mjs +108 -189
  861. package/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
  862. package/functions/web3/events/getInputUtxosEnclave.d.ts +2 -2
  863. package/functions/web3/events/getInputUtxosEnclave.mjs +50 -45
  864. package/functions/web3/events/getShieldedBalance.cjs +1 -1
  865. package/functions/web3/events/getShieldedBalance.mjs +97 -106
  866. package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
  867. package/functions/web3/events/getTransactionLogEvents.mjs +34 -78
  868. package/functions/web3/events/index.cjs +1 -0
  869. package/functions/web3/events/index.mjs +6 -0
  870. package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
  871. package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +8 -50
  872. package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
  873. package/functions/web3/functionCalls/accessTokenCalls.mjs +19 -26
  874. package/functions/web3/functionCalls/approveToken.cjs +1 -1
  875. package/functions/web3/functionCalls/approveToken.mjs +112 -145
  876. package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -1
  877. package/functions/web3/functionCalls/approveTokensToHinkal.mjs +10 -10
  878. package/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
  879. package/functions/web3/functionCalls/constructBatchCall.mjs +50 -58
  880. package/functions/web3/functionCalls/estimateGasRelayer.d.ts +1 -1
  881. package/functions/web3/functionCalls/recoverTransactionFromError.cjs +1 -1
  882. package/functions/web3/functionCalls/recoverTransactionFromError.mjs +17 -23
  883. package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
  884. package/functions/web3/functionCalls/transactCallDirect.mjs +59 -78
  885. package/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -1
  886. package/functions/web3/functionCalls/transactCallDirectTron.d.ts +5 -2
  887. package/functions/web3/functionCalls/transactCallDirectTron.mjs +80 -62
  888. package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  889. package/functions/web3/functionCalls/transactCallRelayer.mjs +59 -108
  890. package/functions/web3/functionCalls/waitForErc20Approvals.cjs +1 -1
  891. package/functions/web3/functionCalls/waitForErc20Approvals.d.ts +3 -1
  892. package/functions/web3/functionCalls/waitForErc20Approvals.mjs +40 -53
  893. package/functions/web3/getContractMetadata.cjs +1 -1
  894. package/functions/web3/getContractMetadata.d.ts +1 -1
  895. package/functions/web3/getContractMetadata.mjs +23 -30
  896. package/functions/web3/getPublicAddressBalance.cjs +1 -1
  897. package/functions/web3/getPublicAddressBalance.d.ts +1 -1
  898. package/functions/web3/getPublicAddressBalance.mjs +9 -9
  899. package/functions/web3/getSolanaPriorityFee.cjs +1 -1
  900. package/functions/web3/getSolanaPriorityFee.mjs +24 -30
  901. package/functions/web3/getTokenHolder.cjs +1 -1
  902. package/functions/web3/getTokenHolder.mjs +34 -77
  903. package/functions/web3/index.cjs +1 -0
  904. package/functions/web3/index.d.ts +0 -1
  905. package/functions/web3/index.mjs +21 -0
  906. package/functions/web3/lifiAPI.cjs +1 -1
  907. package/functions/web3/lifiAPI.mjs +28 -29
  908. package/functions/web3/odosAPI.cjs +1 -1
  909. package/functions/web3/odosAPI.mjs +34 -58
  910. package/functions/web3/okxAPI.cjs +1 -1
  911. package/functions/web3/okxAPI.mjs +32 -42
  912. package/functions/web3/oneInchAPI.cjs +1 -1
  913. package/functions/web3/oneInchAPI.mjs +33 -56
  914. package/functions/web3/runContractFunction.cjs +1 -1
  915. package/functions/web3/runContractFunction.mjs +54 -74
  916. package/functions/web3/signAndSendSerializedTransaction.cjs +1 -1
  917. package/functions/web3/signAndSendSerializedTransaction.mjs +13 -10
  918. package/functions/web3/tron-wagmi-adapter.cjs +1 -1
  919. package/functions/web3/tron-wagmi-adapter.mjs +26 -30
  920. package/functions/web3/uniswapAPI.cjs +1 -1
  921. package/functions/web3/uniswapAPI.mjs +59 -98
  922. package/index.cjs +1 -1
  923. package/index.mjs +321 -1092
  924. package/mutexes/index.cjs +1 -0
  925. package/mutexes/index.mjs +1 -0
  926. package/mutexes/mutex.cjs +1 -1
  927. package/mutexes/mutex.mjs +5 -5
  928. package/package.json +26 -7
  929. package/providers/CustomEthersProvider.cjs +1 -1
  930. package/providers/CustomEthersProvider.mjs +26 -27
  931. package/providers/CustomSolanaConnection.cjs +1 -1
  932. package/providers/CustomSolanaConnection.mjs +30 -32
  933. package/providers/EthersProviderAdapter.cjs +1 -1
  934. package/providers/EthersProviderAdapter.mjs +101 -119
  935. package/providers/SolanaProviderAdapter.cjs +1 -1
  936. package/providers/SolanaProviderAdapter.d.ts +3 -1
  937. package/providers/SolanaProviderAdapter.mjs +111 -113
  938. package/providers/TronProviderAdapter.cjs +1 -1
  939. package/providers/TronProviderAdapter.d.ts +5 -3
  940. package/providers/TronProviderAdapter.mjs +97 -145
  941. package/providers/WagmiProviderAdapter.cjs +1 -1
  942. package/providers/WagmiProviderAdapter.d.ts +2 -2
  943. package/providers/WagmiProviderAdapter.mjs +188 -232
  944. package/providers/prepareEthersHinkal.cjs +1 -1
  945. package/providers/prepareEthersHinkal.d.ts +2 -2
  946. package/providers/prepareEthersHinkal.mjs +12 -56
  947. package/providers/prepareSolanaHinkal.cjs +1 -0
  948. package/providers/prepareSolanaHinkal.d.ts +4 -0
  949. package/providers/prepareSolanaHinkal.mjs +14 -0
  950. package/providers/prepareTronHinkal.cjs +1 -0
  951. package/providers/prepareTronHinkal.d.ts +4 -0
  952. package/providers/prepareTronHinkal.mjs +14 -0
  953. package/providers/prepareWagmiHinkal.cjs +1 -1
  954. package/providers/prepareWagmiHinkal.d.ts +1 -1
  955. package/providers/prepareWagmiHinkal.mjs +12 -57
  956. package/types/IMultiThreadedUtxoUtils.d.ts +2 -2
  957. package/types/RewardUserEnums.cjs +1 -1
  958. package/types/RewardUserEnums.mjs +8 -5
  959. package/types/activities.types.cjs +1 -1
  960. package/types/activities.types.mjs +25 -24
  961. package/types/admin.types.cjs +1 -1
  962. package/types/admin.types.mjs +6 -4
  963. package/types/approvals.types.cjs +1 -1
  964. package/types/approvals.types.mjs +6 -4
  965. package/types/balances.types.cjs +1 -1
  966. package/types/balances.types.mjs +6 -4
  967. package/types/cache.types.cjs +1 -1
  968. package/types/cache.types.d.ts +3 -3
  969. package/types/cache.types.mjs +6 -4
  970. package/types/circom-data.types.cjs +1 -1
  971. package/types/circom-data.types.mjs +17 -20
  972. package/types/confirmation-request.types.cjs +1 -1
  973. package/types/confirmation-request.types.mjs +6 -4
  974. package/types/eip5792.types.cjs +1 -1
  975. package/types/eip5792.types.mjs +8 -5
  976. package/types/ethereum-network.types.cjs +1 -1
  977. package/types/ethereum-network.types.d.ts +2 -2
  978. package/types/ethereum-network.types.mjs +6 -4
  979. package/types/events.types.cjs +1 -1
  980. package/types/events.types.mjs +6 -4
  981. package/types/external-action.types.cjs +1 -1
  982. package/types/external-action.types.mjs +6 -4
  983. package/types/fee.types.cjs +1 -1
  984. package/types/fee.types.mjs +6 -4
  985. package/types/generatePoints.cjs +1 -1
  986. package/types/generatePoints.mjs +8 -5
  987. package/types/hinkal.types.cjs +1 -1
  988. package/types/hinkal.types.d.ts +0 -1
  989. package/types/hinkal.types.mjs +34 -34
  990. package/types/index.cjs +1 -0
  991. package/types/index.d.ts +1 -1
  992. package/types/index.mjs +27 -0
  993. package/types/kyc.types.cjs +1 -1
  994. package/types/kyc.types.d.ts +2 -2
  995. package/types/kyc.types.mjs +12 -14
  996. package/types/new-rewards.type.cjs +1 -1
  997. package/types/new-rewards.type.d.ts +0 -3
  998. package/types/new-rewards.type.mjs +12 -7
  999. package/types/offscreen.types.cjs +1 -1
  1000. package/types/offscreen.types.mjs +6 -4
  1001. package/types/onramp.types.cjs +1 -1
  1002. package/types/onramp.types.mjs +6 -4
  1003. package/types/pay-activities.types.cjs +1 -1
  1004. package/types/pay-activities.types.mjs +10 -6
  1005. package/types/rewards.types.cjs +1 -1
  1006. package/types/rewards.types.mjs +8 -5
  1007. package/types/schedule.types.cjs +1 -1
  1008. package/types/schedule.types.mjs +6 -4
  1009. package/types/scheduled-transactions.types.cjs +1 -1
  1010. package/types/scheduled-transactions.types.mjs +8 -5
  1011. package/types/slippage.types.cjs +1 -1
  1012. package/types/slippage.types.mjs +6 -4
  1013. package/types/token-prices.types.cjs +1 -1
  1014. package/types/token-prices.types.mjs +11 -11
  1015. package/types/token.types.cjs +1 -1
  1016. package/types/token.types.mjs +6 -4
  1017. package/types/transaction.types.cjs +1 -0
  1018. package/types/{sandbox.types.d.ts → transaction.types.d.ts} +20 -20
  1019. package/types/transaction.types.mjs +6 -0
  1020. package/types/transactions.types.cjs +1 -1
  1021. package/types/transactions.types.mjs +40 -39
  1022. package/types/tron.types.d.ts +5 -0
  1023. package/webworker/performTaskWithWorker.cjs +1 -1
  1024. package/webworker/performTaskWithWorker.mjs +38 -40
  1025. package/webworker/snarkjsWorker/snarkjsWorker.types.cjs +1 -1
  1026. package/webworker/snarkjsWorker/snarkjsWorker.types.mjs +6 -4
  1027. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.cjs +1 -0
  1028. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.mjs +4 -0
  1029. package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
  1030. package/webworker/snarkjsWorker/snarkjsWorkerLogic.d.ts +0 -5
  1031. package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +29 -41
  1032. package/webworker/utxoWorker/utxoWorker.types.cjs +1 -1
  1033. package/webworker/utxoWorker/utxoWorker.types.mjs +6 -4
  1034. package/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -0
  1035. package/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +4 -0
  1036. package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
  1037. package/webworker/utxoWorker/utxoWorkerLogic.mjs +68 -77
  1038. package/webworker/viteWorkerURL.constant.cjs +3 -3
  1039. package/webworker/viteWorkerURL.constant.mjs +3 -3
  1040. package/webworker/worker.registry.cjs +1 -1
  1041. package/webworker/worker.registry.mjs +7 -4
  1042. package/webworker/workerFactory.cjs +1 -1
  1043. package/webworker/workerFactory.mjs +27 -41
  1044. package/webworker/workerProxy.cjs +1 -1
  1045. package/webworker/workerProxy.d.ts +0 -1
  1046. package/webworker/workerProxy.mjs +32 -53
  1047. package/webworker/zkProofWorker/zkProofWorker.types.cjs +1 -1
  1048. package/webworker/zkProofWorker/zkProofWorker.types.d.ts +1 -4
  1049. package/webworker/zkProofWorker/zkProofWorker.types.mjs +6 -4
  1050. package/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -0
  1051. package/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +4 -0
  1052. package/webworker/zkProofWorker/zkProofWorkerLogic.cjs +1 -1
  1053. package/webworker/zkProofWorker/zkProofWorkerLogic.mjs +44 -50
  1054. package/constants/deploy-data/deploy-data-avalanche.json.cjs +0 -1
  1055. package/constants/deploy-data/deploy-data-avalanche.json.mjs +0 -5940
  1056. package/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +0 -1
  1057. package/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +0 -5940
  1058. package/constants/token-data/avalancheRegistry.json.cjs +0 -1
  1059. package/constants/token-data/avalancheRegistry.json.mjs +0 -733
  1060. package/constants/token-data/avalancheRegistryFixed.json.cjs +0 -1
  1061. package/constants/token-data/avalancheRegistryFixed.json.mjs +0 -733
  1062. package/constants/token-data/bnbMainnetRegistry.json.cjs +0 -1
  1063. package/constants/token-data/bnbMainnetRegistry.json.mjs +0 -904
  1064. package/constants/token-data/bnbMainnetRegistryFixed.json.cjs +0 -1
  1065. package/constants/token-data/bnbMainnetRegistryFixed.json.mjs +0 -904
  1066. package/functions/web3/solana-wagmi-adapter.cjs +0 -1
  1067. package/functions/web3/solana-wagmi-adapter.d.ts +0 -3
  1068. package/functions/web3/solana-wagmi-adapter.mjs +0 -29
  1069. package/types/sandbox.types.cjs +0 -1
  1070. package/types/sandbox.types.mjs +0 -4
  1071. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +0 -1
  1072. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +0 -4
  1073. package/webworker/utxoWorker/utxoWorkerLauncher.cjs +0 -1
  1074. package/webworker/utxoWorker/utxoWorkerLauncher.mjs +0 -4
  1075. package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +0 -1
  1076. package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +0 -4
@@ -1,632 +1,437 @@
1
- import { ethers as R } from "ethers";
2
- import { LoginMessageMode as P, EventType as W } from "../../types/hinkal.types.mjs";
3
- import { ContractType as S } from "../../types/ethereum-network.types.mjs";
4
- import { hinkalCheckSolanaTokenRegistry as F } from "./hinkalCheckSolanaTokenRegistry.mjs";
5
- import { checkHinkalAccessToken as K } from "../../functions/web3/functionCalls/accessTokenCalls.mjs";
6
- import { getShieldedBalance as x } from "../../functions/web3/events/getShieldedBalance.mjs";
7
- import { UserKeys as A } from "../crypto-keys/keys.mjs";
8
- import { hinkalDeposit as L, hinkalDepositForOther as N } from "./hinkalDeposit.mjs";
9
- import { hinkalDepositAndWithdraw as O } from "./hinkalDepositAndWithdraw.mjs";
10
- import { hinkalSolanaDeposit as I, hinkalSolanaDepositForOther as _ } from "./hinkalSolanaDeposit.mjs";
11
- import { hinkalSwap as z } from "./hinkalSwap.mjs";
12
- import { hinkalWithdraw as j } from "./hinkalWithdraw.mjs";
13
- import { resetMerkleTrees as G } from "./resetMerkleTrees.mjs";
1
+ import { ContractType as e } from "../../types/ethereum-network.types.mjs";
2
+ import { CustomJSONStringify as t } from "../../functions/utils/serialize.utils.mjs";
3
+ import { isExtension as n } from "../../constants/vite.constants.mjs";
4
+ import { HINKAL_SUPPORTED_CHAINS as r, WALLET_SUPPORTED_CHAINS as i, chainIds as a, currentTronChainId as o, isSolanaLike as s, isTronLike as c, networkRegistry as l } from "../../constants/chains.constants.mjs";
5
+ import { EventType as u, LoginMessageMode as d } from "../../types/hinkal.types.mjs";
6
+ import { API as f } from "../../API/API.mjs";
7
+ import { supportedPassportLinks as p } from "../../constants/kyc.constants.mjs";
8
+ import { transactionErrorCodes as ee } from "../../error-handling/error-codes.constants.mjs";
9
+ import { getErc20TokensForChain as te } from "../../functions/utils/erc20tokenFunctions.mjs";
10
+ import "../../API/index.mjs";
11
+ import { poseidonFunction as m } from "../../crypto/poseidon.mjs";
12
+ import { UserKeys as h } from "../crypto-keys/keys.mjs";
13
+ import { getAccessTokenMerkleAccountPublicKey as g, getMerkleAccountPublicKey as _ } from "../../functions/pre-transaction/solana.mjs";
14
+ import { hinkalCheckSolanaTokenRegistry as v } from "./hinkalCheckSolanaTokenRegistry.mjs";
15
+ import { checkHinkalAccessToken as ne } from "../../functions/web3/functionCalls/accessTokenCalls.mjs";
16
+ import { validateAndGetChainId as y } from "../../functions/utils/token-check.utils.mjs";
17
+ import { privateTokensDB as re } from "../TokenDBs/PrivateTokensDB.mjs";
18
+ import { getShieldedBalance as ie } from "../../functions/web3/events/getShieldedBalance.mjs";
19
+ import { reloadPage as b } from "../../functions/utils/reloadPage.mjs";
20
+ import { createCacheDevice as x } from "../../functions/utils/cacheDevice.utils.mjs";
21
+ import { getContractWithFetcherByChainId as S } from "../../functions/web3/getContractMetadata.mjs";
22
+ import { SolanaProviderAdapter as C } from "../../providers/SolanaProviderAdapter.mjs";
23
+ import { hinkalCheckTokenRegistry as w, hinkalCheckTronTokenRegistry as T } from "./hinkalCheckTokenRegistry.mjs";
14
24
  import { MerkleTree as E } from "../merkle-tree/MerkleTree.mjs";
15
- import { transactionErrorCodes as $ } from "../../error-handling/error-codes.constants.mjs";
16
- import { poseidonFunction as M } from "../../crypto/poseidon.mjs";
17
- import { HINKAL_SUPPORTED_CHAINS as w, chainIds as c, isSolanaLike as h, isTronLike as v, WALLET_SUPPORTED_CHAINS as q, networkRegistry as C } from "../../constants/chains.constants.mjs";
18
- import "../../API/getServerURL.mjs";
19
- import "axios";
20
- import "../../constants/coingecko.constants.mjs";
21
- import "../../constants/server.constants.mjs";
22
- import "../http/HttpClient.mjs";
23
- import { API as T } from "../../API/API.mjs";
24
- import "../../API/tenderly.api.mjs";
25
- import "../../constants/token-data/index.mjs";
26
- import "../../constants/contracts.constants.mjs";
27
- import { supportedPassportLinks as J } from "../../constants/kyc.constants.mjs";
28
- import { isExtension as V } from "../../constants/vite.constants.mjs";
29
- import "../../constants/reorg-depths.constants.mjs";
30
- import "../../constants/addresses.constants.mjs";
31
- import "../../constants/token.limits.constants.mjs";
32
- import "../../constants/presale.constants.mjs";
33
- import "../../constants/activity.constants.mjs";
34
- import "../../constants/tasks.constants.mjs";
35
- import "../../constants/events.constants.mjs";
36
- import "../../constants/schedule.constants.mjs";
37
- import "../../constants/tokens.constants.mjs";
38
- import { reloadPage as Q } from "../../functions/utils/reloadPage.mjs";
39
- import { MultiThreadedUtxoUtils as X } from "../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs";
40
- import { hinkalPrivateWallet as Y } from "./hinkalPrivateWallet.mjs";
41
- import { createCacheDevice as Z } from "../../functions/utils/cacheDevice.utils.mjs";
42
- import { getContractWithFetcherByChainId as ee } from "../../functions/web3/getContractMetadata.mjs";
43
- import { getRecipientInfo as te } from "./hinkalGetRecipientInfo.mjs";
44
- import { getApprovedBalance as re, getApprovedUtxos as ie, getApprovedUtxosForToken as ae } from "../../functions/web3/events/getApprovedBalance.mjs";
45
- import { hinkalSignSubAccount as oe } from "./hinkalSignSubAccount.mjs";
46
- import { hinkalCheckTronTokenRegistry as ne, hinkalCheckTokenRegistry as se } from "./hinkalCheckTokenRegistry.mjs";
47
- import { hinkalActionReceive as he } from "./hinkalActionReceive.mjs";
48
- import { privateTokensDB as le } from "../TokenDBs/PrivateTokensDB.mjs";
49
- import "idb-keyval";
50
- import { getErc20TokensForChain as pe } from "../../functions/utils/erc20tokenFunctions.mjs";
51
- import "multiformats";
52
- import { PublicKey as u } from "@solana/web3.js";
53
- import "@solana/spl-token";
54
- import "tronweb";
55
- import { validateAndGetChainId as d } from "../../functions/utils/token-check.utils.mjs";
56
- import "async-mutex";
57
- import "../../functions/utils/convertIntegrationProviderToExternalActionId.mjs";
58
- import "../../types/circom-data.types.mjs";
59
- import "../../types/activities.types.mjs";
60
- import { getMerkleAccountPublicKey as de, getAccessTokenMerkleAccountPublicKey as ce } from "../../functions/pre-transaction/solana.mjs";
61
- import "tweetnacl";
62
- import "bs58";
63
- import "@coral-xyz/anchor";
64
- import "buffer";
65
- import "libsodium-wrappers";
66
- import "lodash";
67
- import "../../functions/utils/userAgent.mjs";
68
- import "circomlibjs-hinkal-fork";
69
- import "process";
70
- import "../../providers/EthersProviderAdapter.mjs";
71
- import { SolanaProviderAdapter as me } from "../../providers/SolanaProviderAdapter.mjs";
72
- import "node-forge";
73
- import "../../API/enclaveUtxoCalls.mjs";
74
- import "../../functions/web3/events/getInputUtxoAndBalance.mjs";
75
- import "../../functions/web3/getTokenHolder.mjs";
76
- import { createTransaferEmporiumOpsBatch as ge } from "../../functions/private-wallet/emporium.helpers.mjs";
77
- import { hinkalProoflessDeposit as fe } from "./hinkalProoflessDeposit.mjs";
78
- import { hinkalProxySwap as ve } from "./hinkalProxySwap.mjs";
79
- import { hinkalMultiSendPrivateRecipients as ue } from "./hinkalMultiSend.mjs";
80
- import { hinkalTransfer as ye } from "./hinkalTransfer.mjs";
81
- import { hinkalProxyToPrivate as Pe } from "./hinkalProxyToPrivate.mjs";
82
- import { TronProviderAdapter as H } from "../../providers/TronProviderAdapter.mjs";
83
- import { hinkalSolanaDepositAndWithdraw as Ae } from "./hinkalSolanaDepositAndWithdraw.mjs";
84
- import { hinkalSolanaWithdraw as we } from "./hinkalSolanaWithdraw.mjs";
85
- import { hinkalSolanaTransfer as Ce } from "./hinkalSolanaTransfer.mjs";
86
- import { hinkalSolanaSwap as ke } from "./hinkalSolanaSwap.mjs";
87
- import { hinkalSolanaProxySend as Se } from "./hinkalSolanaProxySend.mjs";
88
- import { hinkalSolanaProxySwap as Te } from "./hinkalSolanaProxySwap.mjs";
89
- import { hinkalSolanaProxyShield as b } from "./hinkalSolanaProxyShield.mjs";
90
- import { fetchSolanaMerkleTreeRootHash as D } from "../../functions/web3/fetchSolanaMerkleTreeRootHash.mjs";
91
- import { hinkalDepositAndBridge as Be } from "./hinkalDepositAndBridge.mjs";
92
- import { hinkalClaimUtxo as Re } from "./hinkalClaimUtxo.mjs";
93
- import { hinkalSolanaProoflessDeposit as Ee } from "./hinkalSolanaProoflessDeposit.mjs";
94
- import { hinkalSolanaClaimUtxo as Me } from "./hinkalSolanaClaimUtxo.mjs";
95
- import { hinkalWithdrawStuckUtxos as He } from "./hinkalWithdrawStuckUtxos.mjs";
96
- class Pr {
97
- ethereumProviderAdapter;
98
- solanaProviderAdapter;
99
- tronProviderAdapter;
100
- userKeys;
101
- signingMessage = "Login to Hinkal Protocol";
102
- privateTransferSigningMessage = "Login to Hinkal's Private Transfer App";
103
- merkleTreeHinkalByChain = {};
104
- merkleTreeAccessTokenByChain = {};
105
- nullifiersByChain = {};
106
- encryptedOutputsByChain = {};
107
- approvalsByChain = {};
108
- commitmentsSnapshotServiceByChain = {};
109
- nullifierSnapshotServiceByChain = {};
110
- accessTokenSnapshotServiceByChain = {};
111
- approvalsSnapshotServiceByChain = {};
112
- utxoUtils;
113
- cacheDevice;
114
- generateProofRemotely;
115
- disableMerkleTreeUpdates;
116
- constructor(e) {
117
- this.userKeys = new A(void 0), w.forEach((t) => {
118
- this.merkleTreeHinkalByChain[t] = E.create(M, 0n), this.merkleTreeAccessTokenByChain[t] = E.create(M, 0n), this.nullifiersByChain[t] = /* @__PURE__ */ new Set(), this.encryptedOutputsByChain[t] = [], this.approvalsByChain[t] = /* @__PURE__ */ new Map();
119
- }), this.generateProofRemotely = e?.generateProofRemotely ?? !0, this.utxoUtils = new X(), this.cacheDevice = Z(e), this.disableMerkleTreeUpdates = e?.disableMerkleTreeUpdates ?? !1;
120
- }
121
- async initProviderAdapter(e, t) {
122
- const r = t instanceof me, i = t instanceof H;
123
- let a = c.ethMainnet;
124
- r ? a = c.solanaMainnet : i && (a = c.tronMainnet), await this.updateProviderAdapter(a, t), r ? this.solanaProviderAdapter?.initConnector(e) : i ? this.tronProviderAdapter?.initConnector(e) : this.ethereumProviderAdapter?.initConnector(e);
125
- let o;
126
- r ? o = await this.connectAndPatchProvider(!0, e) : i ? o = await t.connectAndPatchProvider(e) : o = await this.connectAndPatchProvider(!1, e), await t.init(o), await this.setListeners();
127
- }
128
- getSigningMessage(e = P.PROTOCOL) {
129
- switch (e) {
130
- case P.PRIVATE_TRANSFER:
131
- return this.privateTransferSigningMessage;
132
- case P.PROTOCOL:
133
- default:
134
- return this.signingMessage;
135
- }
136
- }
137
- async initUserKeys(e = P.PROTOCOL) {
138
- const t = this.getSigningMessage(e);
139
- this.userKeys = new A(await this.getProviderAdapter().signMessage(t));
140
- }
141
- initUserKeysWithSignature(e) {
142
- this.userKeys = new A(e);
143
- }
144
- async initUserKeysFromSeedPhrases(e) {
145
- const t = e.join(" "), r = R.toUtf8Bytes(t), i = R.keccak256(r);
146
- this.userKeys = new A(i);
147
- }
148
- async resetMerkle(e) {
149
- if (this.disableMerkleTreeUpdates)
150
- return;
151
- (e?.every((r) => this.isSelectedNetworkSupported(r)) ?? !0) && await G(this, e);
152
- }
153
- // If chainId is not provided, use the ethereum provider, if it is initialized. In other case, use the solana provider.
154
- getProviderAdapter(e) {
155
- let t = e;
156
- t || (this.ethereumProviderAdapter ? t = c.ethMainnet : this.solanaProviderAdapter ? t = c.solanaMainnet : t = c.tronMainnet);
157
- let r;
158
- if (h(t) ? r = this.solanaProviderAdapter : v(t) ? r = this.tronProviderAdapter : r = this.ethereumProviderAdapter, !r)
159
- throw new Error("ProviderAdapter is not initialized");
160
- return r;
161
- }
162
- getTronWeb() {
163
- const e = this.tronProviderAdapter;
164
- if (!e)
165
- throw new Error("Tron provider adapter not initialized");
166
- if (!(e instanceof H))
167
- throw new Error("Tron provider adapter is not a TronProviderAdapter");
168
- const t = e.getTronWeb();
169
- if (!t)
170
- throw new Error("TronWeb not available");
171
- return t;
172
- }
173
- getSupportedChains() {
174
- return this.ethereumProviderAdapter && this.solanaProviderAdapter ? q : this.ethereumProviderAdapter ? w.filter((e) => !h(e) && !v(e)) : this.solanaProviderAdapter ? w.filter((e) => h(e)) : this.tronProviderAdapter ? w.filter((e) => v(e)) : [];
175
- }
176
- async waitForTransaction(e, t, r = 1) {
177
- return !!await this.getProviderAdapter(e).waitForTransaction(e, t, r);
178
- }
179
- getContract(e, t, r = void 0) {
180
- return this.getProviderAdapter(e).getContract(e, t, r);
181
- }
182
- getContractWithFetcherByChainId(e, t, r = void 0) {
183
- return ee(e, t, r);
184
- }
185
- async signMessage(e) {
186
- return await this.getProviderAdapter().signMessage(e);
187
- }
188
- async signTypedData(e, t, r) {
189
- return await this.getProviderAdapter().signTypedData(e, t, r);
190
- }
191
- async signWithSubAccount(e, t, r, i) {
192
- return oe(e, t, r, i);
193
- }
194
- getContractWithSigner(e, t, r = "") {
195
- return this.getProviderAdapter(e).getContractWithSigner(e, t, r);
196
- }
197
- getContractWithFetcher(e, t, r = "") {
198
- return this.getProviderAdapter(e).getContractWithFetcher(e, t, r);
199
- }
200
- isSelectedNetworkSupported(e) {
201
- return !!C[e];
202
- }
203
- async switchNetwork(e) {
204
- try {
205
- await this.getProviderAdapter().switchNetwork(e);
206
- } catch {
207
- throw new Error($.FAILED_TO_SWITCH_NETWORKS);
208
- }
209
- }
210
- isPermitterAvailable(e) {
211
- return this.getProviderAdapter(e).isPermitterAvailable();
212
- }
213
- async connectAndPatchProvider(e, t) {
214
- return await this.getProviderAdapter(
215
- e ? c.solanaMainnet : c.ethMainnet
216
- ).connectAndPatchProvider(t);
217
- }
218
- async disconnectFromConnector() {
219
- await this.ethereumProviderAdapter?.disconnectFromConnector(), await this.solanaProviderAdapter?.disconnectFromConnector(), await this.tronProviderAdapter?.disconnectFromConnector();
220
- }
221
- async resetProviderAdapters() {
222
- this.ethereumProviderAdapter = void 0, this.solanaProviderAdapter = void 0, this.tronProviderAdapter = void 0;
223
- }
224
- async updateProviderAdapter(e, t) {
225
- try {
226
- h(e) ? (this.solanaProviderAdapter && this.solanaProviderAdapter.release(), this.solanaProviderAdapter = t) : v(e) ? (this.tronProviderAdapter && this.tronProviderAdapter.release(), this.tronProviderAdapter = t) : (this.ethereumProviderAdapter && this.ethereumProviderAdapter.release(), this.ethereumProviderAdapter = t);
227
- } catch (r) {
228
- throw console.error(r), Error("updateProviderAdapter failed, please try again.");
229
- }
230
- }
231
- async setListeners() {
232
- this.ethereumProviderAdapter?.setChainEventListener({
233
- onAccountChanged: () => {
234
- this.onAccountChanged();
235
- },
236
- onChainChanged: (e) => {
237
- this.onChainChanged(e);
238
- }
239
- }), this.solanaProviderAdapter?.setChainEventListener({
240
- onAccountChanged: () => {
241
- this.onAccountChanged();
242
- },
243
- onChainChanged: (e) => {
244
- this.onChainChanged(e);
245
- }
246
- }), this.tronProviderAdapter?.setChainEventListener({
247
- onAccountChanged: () => {
248
- this.onAccountChanged();
249
- },
250
- onChainChanged: (e) => {
251
- this.onChainChanged(e);
252
- }
253
- });
254
- }
255
- async onAccountChanged() {
256
- await this.ethereumProviderAdapter?.onAccountChanged(), await this.solanaProviderAdapter?.onAccountChanged(), await this.tronProviderAdapter?.onAccountChanged();
257
- const e = W.AccountChanged;
258
- typeof document < "u" ? document?.dispatchEvent(new Event(e)) : process?.emit("message", e, void 0);
259
- }
260
- async onChainChanged(e) {
261
- e ? await this.getProviderAdapter(e).onChainChanged(e) : (await this.disconnectFromConnector(), Q());
262
- }
263
- async monitorConnectedAddress(e) {
264
- await T.monitor(await this.getEthereumAddressByChain(e));
265
- }
266
- async getBalances(e, t, r, i, a = !1, o, n = !1) {
267
- return x(
268
- this,
269
- e,
270
- t,
271
- r,
272
- i,
273
- a,
274
- this.generateProofRemotely,
275
- o,
276
- n
277
- );
278
- }
279
- async getApprovedBalances(e, t = !1, r = !1) {
280
- return re(this, e, t, r);
281
- }
282
- async getTotalBalance(e, t, r, i = !1, a, o = !1) {
283
- const n = r ?? await this.getEthereumAddressByChain(e), s = t ?? this.userKeys, l = await this.getBalances(
284
- e,
285
- s.getShieldedPrivateKey(),
286
- s.getShieldedPublicKey(),
287
- n,
288
- i,
289
- a,
290
- o
291
- ), m = !h(e) && !o ? await this.getApprovedBalances(e, i, a) : /* @__PURE__ */ new Map(), g = V ? await le.getPrivateTokens(e, n) : pe(e), p = [];
292
- return g.forEach((f) => {
293
- const y = f.erc20TokenAddress.toLowerCase(), k = l.get(y), B = m.get(y), U = {
294
- token: f,
295
- balance: (k?.balance ?? 0n) + (B?.balance ?? 0n),
296
- timestamp: k?.timestamp || B?.timestamp || "0",
297
- nfts: k?.nfts || []
298
- };
299
- p.push(U);
300
- }), p;
301
- }
302
- async getStuckShieldedBalances(e, t, r) {
303
- return (await this.getTotalBalance(e, t, r, !1, !1, !0)).filter((a) => a.balance > 0n);
304
- }
305
- getSupportedPassportLinks() {
306
- return J;
307
- }
308
- checkAccessToken(e, t) {
309
- return K(this, e, t);
310
- }
311
- async getHinkalTreeRootHash(e) {
312
- if (h(e)) {
313
- const { hinkalIdl: r, hinkalAddress: i, originalDeployer: a } = C[e].contractData;
314
- if (!r || !i || !a)
315
- throw new Error(`Missing Solana configuration for chain ${e}`);
316
- const o = new u(a), n = new u(i), s = de(n, o), l = this.getSolanaProgram(r);
317
- return D(l, s);
318
- }
319
- return this.getContractWithFetcherByChainId(e, S.HinkalContract).getRootHash();
320
- }
321
- async getAccessTokenTreeRootHash(e) {
322
- if (h(e)) {
323
- const { hinkalIdl: r, hinkalAddress: i, originalDeployer: a } = C[e].contractData;
324
- if (!r || !i || !a)
325
- throw new Error(`Missing Solana configuration for chain ${e}`);
326
- const o = new u(a), n = new u(i), s = ce(n, o), l = this.getSolanaProgram(r);
327
- return D(l, s);
328
- }
329
- return this.getContractWithFetcherByChainId(e, S.AccessTokenContract).getRootHash();
330
- }
331
- async resetMerkleTreesIfNecessary(e) {
332
- const r = (await Promise.all(
333
- (e ?? this.getSupportedChains()).map(async (i) => {
334
- const [a, o] = await Promise.all([
335
- this.getHinkalTreeRootHash(i),
336
- this.getAccessTokenTreeRootHash(i)
337
- ]), n = BigInt(a) !== this.merkleTreeHinkalByChain[i].getRootHash() || BigInt(o) !== this.merkleTreeAccessTokenByChain[i].getRootHash();
338
- return { chainId: i, needsReset: n };
339
- })
340
- )).filter((i) => i.needsReset).map((i) => i.chainId);
341
- r.length > 0 && (console.log("resetting merkle tree in resetMerkleTreesIfNecessary for chains:", r), await this.resetMerkle(r));
342
- }
343
- async getEthereumAddress() {
344
- const e = this.ethereumProviderAdapter ?? this.solanaProviderAdapter ?? this.tronProviderAdapter;
345
- if (!e)
346
- throw new Error("No provider adapter initialized");
347
- return e.getAddress();
348
- }
349
- getEthereumAddressByChain(e) {
350
- return this.getProviderAdapter(e).getAddress();
351
- }
352
- async getRandomRelay(e, t = !1) {
353
- return (await T.getIdleRelay(e, t)).relay;
354
- }
355
- getGasPrice(e) {
356
- const t = this.getProviderAdapter(e);
357
- if (!t)
358
- throw new Error("Illegal State of providerAdapter in Hinkal: no providerAdapter initialized");
359
- return t.getGasPrice(e);
360
- }
361
- getAPI() {
362
- return T;
363
- }
364
- snapshotsClearInterval() {
365
- this.getSupportedChains().forEach((e) => {
366
- this.commitmentsSnapshotServiceByChain[e]?.intervalClear(), this.accessTokenSnapshotServiceByChain[e]?.intervalClear(), this.nullifierSnapshotServiceByChain[e]?.intervalClear(), this.approvalsSnapshotServiceByChain[e]?.intervalClear();
367
- });
368
- }
369
- checkTokenRegistry(e, t, r) {
370
- if (h(e)) {
371
- const {
372
- hinkalIdl: a,
373
- hinkalAddress: o,
374
- originalDeployer: n
375
- } = C[e].contractData;
376
- if (!a || !o || !n)
377
- throw new Error("missing solana data");
378
- const s = this.getSolanaProgram(a), l = new u(n);
379
- return F(s, l, t, r);
380
- }
381
- if (v(e))
382
- return ne(t, r, e);
383
- const i = this.getContractWithFetcher(e, S.HinkalHelperContract);
384
- return se(i, t, r);
385
- }
386
- getRecipientInfo() {
387
- return te(this);
388
- }
389
- getApprovedUtxos(e, t = !1) {
390
- return ie(this, e, t);
391
- }
392
- getApprovedUtxosForToken(e, t, r = !1) {
393
- return ae(this, e, t, r);
394
- }
395
- async deposit(e, t, r = !0, i = !1) {
396
- return L(this, e, t, r, i);
397
- }
398
- async depositSolana(e, t) {
399
- return I(this, e, t);
400
- }
401
- async depositForOther(e, t, r, i = !0, a = !1) {
402
- return N(this, e, t, r, i, a);
403
- }
404
- async depositSolanaForOther(e, t, r) {
405
- return _(this, e, t, r);
406
- }
407
- async depositAndWithdraw(e, t, r, i, a, o, n, s = !0) {
408
- const l = d([e]);
409
- return h(l) ? Ae(
410
- this,
411
- e,
412
- t,
413
- r,
414
- i,
415
- a,
416
- o,
417
- n
418
- ) : O(
419
- this,
420
- e,
421
- t,
422
- r,
423
- i,
424
- a,
425
- o,
426
- n,
427
- s
428
- );
429
- }
430
- async claimUtxo(e, t, r, i) {
431
- const a = d([e]);
432
- return h(a) ? Me(this, e, t, r, i) : Re(this, e, t, r, i);
433
- }
434
- async depositAndBridge(e, t, r, i, a, o, n = !0) {
435
- return Be(
436
- this,
437
- e,
438
- t,
439
- r,
440
- i,
441
- a,
442
- o,
443
- n
444
- );
445
- }
446
- async prooflessDeposit(e, t, r, i) {
447
- const a = d(e);
448
- return h(a) ? Ee(this, e, t, r, i) : fe(this, e, t, r, i);
449
- }
450
- getSolanaProgram(e) {
451
- if (!this.solanaProviderAdapter)
452
- throw new Error("No provider adapter initialized");
453
- if (!("getSolanaProgram" in this.solanaProviderAdapter))
454
- throw new Error("Current provider adapter is not a Solana provider adapter");
455
- return this.solanaProviderAdapter.getSolanaProgram(e);
456
- }
457
- getSolanaPublicKey() {
458
- if (!this.solanaProviderAdapter)
459
- throw new Error("No provider adapter initialized");
460
- if (!("getSolanaPublicKey" in this.solanaProviderAdapter))
461
- throw new Error("Current provider adapter is not a Solana provider adapter");
462
- return this.solanaProviderAdapter.getSolanaPublicKey();
463
- }
464
- async transfer(e, t, r, i, a, o) {
465
- const n = d(e);
466
- return h(n) ? Ce(
467
- this,
468
- e,
469
- t,
470
- r,
471
- i,
472
- a,
473
- o
474
- ) : ye(this, e, t, r, i, a, o);
475
- }
476
- async withdraw(e, t, r, i, a, o, n) {
477
- const s = d(e);
478
- return h(s) ? we(
479
- this,
480
- e,
481
- t,
482
- r,
483
- a,
484
- o,
485
- n
486
- ) : j(
487
- this,
488
- e,
489
- t,
490
- r,
491
- i,
492
- a,
493
- o,
494
- n
495
- );
496
- }
497
- async withdrawStuckUtxos(e, t) {
498
- return He(this, e, t);
499
- }
500
- async swap(e, t, r, i, a, o, n) {
501
- const s = d(e);
502
- return h(s) ? this.swapSolana(e, t, i, a, o) : z(
503
- this,
504
- e,
505
- t,
506
- r,
507
- i,
508
- a,
509
- o,
510
- n
511
- );
512
- }
513
- async swapSolana(e, t, r, i, a) {
514
- const o = JSON.parse(r), n = BigInt(o.swapperAccountSalt), { instructionLists: s, addressLookupTableAccount: l } = o.data;
515
- return ke(
516
- this,
517
- e,
518
- t,
519
- n,
520
- s,
521
- l,
522
- i,
523
- a
524
- );
525
- }
526
- async actionReceive(e, t, r, i, a, o) {
527
- if (!a)
528
- throw new Error("subAccount is required");
529
- const n = d(e);
530
- return h(n) ? b(this, e[0], t[0], a, void 0, o) : he(this, e, t, r, i, a, o);
531
- }
532
- async actionPrivateWallet(e, t, r, i, a, o, n, s, l, m, g = !1, p, f, y) {
533
- return Y(
534
- this,
535
- e,
536
- t,
537
- r,
538
- i,
539
- a,
540
- o,
541
- n,
542
- s,
543
- l,
544
- m,
545
- g,
546
- p,
547
- f,
548
- y
549
- );
550
- }
551
- async proxySwap(e, t, r, i, a, o, n, s, l = !1, m, g) {
552
- const p = d(e);
553
- return h(p) ? Te(
554
- this,
555
- e,
556
- t,
557
- i,
558
- o,
559
- n,
560
- s
561
- ) : ve(
562
- this,
563
- e,
564
- t,
565
- r,
566
- i,
567
- a,
568
- o,
569
- n,
570
- s,
571
- l,
572
- m,
573
- g
574
- );
575
- }
576
- async proxyToPrivate(e, t, r, i, a, o, n) {
577
- const s = d(e);
578
- return h(s) ? b(this, e[0], t[0], r, i, n) : Pe(
579
- this,
580
- e,
581
- t,
582
- i,
583
- a,
584
- o,
585
- r,
586
- n
587
- );
588
- }
589
- async proxySend(e, t, r, i, a, o, n) {
590
- const s = d(e);
591
- if (h(s))
592
- return Se(this, e[0], t[0], r, i, n);
593
- const l = ge(
594
- this,
595
- s,
596
- e.map((p) => p.erc20TokenAddress),
597
- t,
598
- i
599
- ), m = e.map((p, f) => ({
600
- token: p,
601
- amount: -1n * t[f]
602
- }));
603
- return await this.actionPrivateWallet(
604
- s,
605
- [],
606
- [],
607
- [],
608
- l,
609
- m,
610
- r,
611
- a,
612
- o,
613
- void 0,
614
- void 0,
615
- void 0,
616
- n,
617
- void 0
618
- );
619
- }
620
- async multiSendPrivateRecipients(e, t, r) {
621
- return ue(this, e, t, r);
622
- }
623
- areMerkleTreeUpdatesDisabled() {
624
- return this.disableMerkleTreeUpdates;
625
- }
626
- updateMerkleTreeUpdates(e) {
627
- this.disableMerkleTreeUpdates = e;
628
- }
629
- }
630
- export {
631
- Pr as Hinkal
25
+ import "../merkle-tree/index.mjs";
26
+ import { hinkalDeposit as D, hinkalDepositForOther as O } from "./hinkalDeposit.mjs";
27
+ import { createTransaferEmporiumOpsBatch as k } from "../../functions/private-wallet/emporium.helpers.mjs";
28
+ import { getApprovedBalance as A, getApprovedUtxos as j, getApprovedUtxosForToken as M } from "../../functions/web3/events/getApprovedBalance.mjs";
29
+ import { checkTokenLimitsUSD as N } from "../../functions/kyc/checkTokenLimitsUSD.mjs";
30
+ import { hinkalDepositAndWithdraw as P } from "./hinkalDepositAndWithdraw.mjs";
31
+ import { hinkalSolanaDeposit as F, hinkalSolanaDepositForOther as I } from "./hinkalSolanaDeposit.mjs";
32
+ import { hinkalSwap as L } from "./hinkalSwap.mjs";
33
+ import { hinkalWithdraw as R } from "./hinkalWithdraw.mjs";
34
+ import { resetMerkleTrees as z } from "./resetMerkleTrees.mjs";
35
+ import { MultiThreadedUtxoUtils as B } from "../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs";
36
+ import { hinkalPrivateWallet as V } from "./hinkalPrivateWallet.mjs";
37
+ import { getRecipientInfo as H } from "./hinkalGetRecipientInfo.mjs";
38
+ import { hinkalSignSubAccount as ae } from "./hinkalSignSubAccount.mjs";
39
+ import { hinkalActionReceive as U } from "./hinkalActionReceive.mjs";
40
+ import "../TokenDBs/index.mjs";
41
+ import { hinkalProoflessDeposit as W } from "./hinkalProoflessDeposit.mjs";
42
+ import { hinkalProxySwap as G } from "./hinkalProxySwap.mjs";
43
+ import { hinkalMultiSendPrivateRecipients as K } from "./hinkalMultiSend.mjs";
44
+ import { hinkalTransfer as q } from "./hinkalTransfer.mjs";
45
+ import { hinkalProxyToPrivate as J } from "./hinkalProxyToPrivate.mjs";
46
+ import { TronProviderAdapter as Y } from "../../providers/TronProviderAdapter.mjs";
47
+ import { hinkalSolanaDepositAndWithdraw as oe } from "./hinkalSolanaDepositAndWithdraw.mjs";
48
+ import { hinkalSolanaWithdraw as se } from "./hinkalSolanaWithdraw.mjs";
49
+ import { hinkalSolanaTransfer as ce } from "./hinkalSolanaTransfer.mjs";
50
+ import { hinkalSolanaSwap as le } from "./hinkalSolanaSwap.mjs";
51
+ import { hinkalSolanaProxySend as ue } from "./hinkalSolanaProxySend.mjs";
52
+ import { hinkalSolanaProxySwap as de } from "./hinkalSolanaProxySwap.mjs";
53
+ import { hinkalSolanaProxyShield as X } from "./hinkalSolanaProxyShield.mjs";
54
+ import { fetchSolanaMerkleTreeRootHash as Z } from "../../functions/web3/fetchSolanaMerkleTreeRootHash.mjs";
55
+ import { hinkalDepositAndBridge as fe } from "./hinkalDepositAndBridge.mjs";
56
+ import { hinkalClaimUtxo as pe } from "./hinkalClaimUtxo.mjs";
57
+ import { hinkalSolanaProoflessDeposit as me } from "./hinkalSolanaProoflessDeposit.mjs";
58
+ import { hinkalSolanaClaimUtxo as he } from "./hinkalSolanaClaimUtxo.mjs";
59
+ import { hinkalWithdrawStuckUtxos as ge } from "./hinkalWithdrawStuckUtxos.mjs";
60
+ import { ethers as Q } from "ethers";
61
+ import { PublicKey as $ } from "@solana/web3.js";
62
+ //#region ../shared/common/src/data-structures/Hinkal/Hinkal.ts
63
+ var _e = class {
64
+ ethereumProviderAdapter;
65
+ solanaProviderAdapter;
66
+ tronProviderAdapter;
67
+ userKeys;
68
+ signingMessage = "Login to Hinkal Protocol";
69
+ privateTransferSigningMessage = "Login to Hinkal's Private Transfer App";
70
+ merkleTreeHinkalByChain = {};
71
+ merkleTreeAccessTokenByChain = {};
72
+ nullifiersByChain = {};
73
+ encryptedOutputsByChain = {};
74
+ approvalsByChain = {};
75
+ commitmentsSnapshotServiceByChain = {};
76
+ nullifierSnapshotServiceByChain = {};
77
+ accessTokenSnapshotServiceByChain = {};
78
+ approvalsSnapshotServiceByChain = {};
79
+ utxoUtils;
80
+ lastCallState = /* @__PURE__ */ new Map();
81
+ cacheDevice;
82
+ generateProofRemotely;
83
+ disableMerkleTreeUpdates;
84
+ constructor(e) {
85
+ this.userKeys = new h(void 0), r.forEach((e) => {
86
+ this.merkleTreeHinkalByChain[e] = E.create(m, 0n), this.merkleTreeAccessTokenByChain[e] = E.create(m, 0n), this.nullifiersByChain[e] = /* @__PURE__ */ new Set(), this.encryptedOutputsByChain[e] = [], this.approvalsByChain[e] = /* @__PURE__ */ new Map();
87
+ }), this.generateProofRemotely = e?.generateProofRemotely ?? !0, this.utxoUtils = new B(), this.cacheDevice = x(e), this.disableMerkleTreeUpdates = e?.disableMerkleTreeUpdates ?? !1;
88
+ }
89
+ enforceRateLimit(e, n, r = 1e3) {
90
+ let i = Date.now(), a = t(n), o = this.lastCallState.get(e);
91
+ if (o && o.argsKey === a && i - o.timestamp < r) throw Error(`${e} was already called with the same arguments`);
92
+ this.lastCallState.set(e, {
93
+ timestamp: i,
94
+ argsKey: a
95
+ });
96
+ }
97
+ getProviderAdapter(e) {
98
+ let t = e;
99
+ t ||= this.ethereumProviderAdapter ? a.ethMainnet : this.solanaProviderAdapter ? a.solanaMainnet : a.tronMainnet;
100
+ let n;
101
+ if (n = s(t) ? this.solanaProviderAdapter : c(t) ? this.tronProviderAdapter : this.ethereumProviderAdapter, !n) throw Error("ProviderAdapter is not initialized");
102
+ return n;
103
+ }
104
+ async initProviderAdapter(e, t) {
105
+ let n = a.ethMainnet;
106
+ t instanceof C ? n = a.solanaMainnet : t instanceof Y && (n = o), await this.updateProviderAdapter(n, t), t.initConnector(e);
107
+ let r = await t.connectAndPatchProvider(e);
108
+ await t.init(r), await this.setListeners();
109
+ }
110
+ getSigningMessage(e = d.PROTOCOL) {
111
+ switch (e) {
112
+ case d.PRIVATE_TRANSFER: return this.privateTransferSigningMessage;
113
+ case d.PROTOCOL:
114
+ default: return this.signingMessage;
115
+ }
116
+ }
117
+ async initUserKeys(e = d.PROTOCOL) {
118
+ let t = this.getSigningMessage(e);
119
+ this.userKeys = new h(await this.getProviderAdapter().signMessage(t));
120
+ }
121
+ initUserKeysWithSignature(e) {
122
+ this.userKeys = new h(e);
123
+ }
124
+ async initUserKeysFromSeedPhrases(e) {
125
+ let t = e.join(" "), n = Q.toUtf8Bytes(t);
126
+ this.userKeys = new h(Q.keccak256(n));
127
+ }
128
+ async resetMerkle(e) {
129
+ this.disableMerkleTreeUpdates || (e?.every((e) => this.isSelectedNetworkSupported(e)) ?? !0) && await z(this, e);
130
+ }
131
+ getTronWeb() {
132
+ let e = this.tronProviderAdapter;
133
+ if (!e) throw Error("Tron provider adapter not initialized");
134
+ if (!(e instanceof Y)) throw Error("Tron provider adapter is not a TronProviderAdapter");
135
+ let t = e.getTronWeb();
136
+ if (!t) throw Error("TronWeb not available");
137
+ return t;
138
+ }
139
+ getSupportedChains() {
140
+ return this.ethereumProviderAdapter && this.solanaProviderAdapter ? i : this.ethereumProviderAdapter ? r.filter((e) => !s(e) && !c(e)) : this.solanaProviderAdapter ? r.filter((e) => s(e)) : this.tronProviderAdapter ? r.filter((e) => c(e)) : [];
141
+ }
142
+ async waitForTransaction(e, t, n = 1) {
143
+ return !!await this.getProviderAdapter(e).waitForTransaction(e, t, n);
144
+ }
145
+ getContract(e, t, n = void 0) {
146
+ return this.getProviderAdapter(e).getContract(e, t, n);
147
+ }
148
+ getContractWithFetcherByChainId(e, t, n = void 0) {
149
+ return S(e, t, n);
150
+ }
151
+ async signMessage(e) {
152
+ return await this.getProviderAdapter().signMessage(e);
153
+ }
154
+ async signTypedData(e, t, n) {
155
+ return await this.getProviderAdapter().signTypedData(e, t, n);
156
+ }
157
+ async signWithSubAccount(e, t, n, r) {
158
+ return ae(e, t, n, r);
159
+ }
160
+ getContractWithSigner(e, t, n = "") {
161
+ return this.getProviderAdapter(e).getContractWithSigner(e, t, n);
162
+ }
163
+ getContractWithFetcher(e, t, n = "") {
164
+ return this.getProviderAdapter(e).getContractWithFetcher(e, t, n);
165
+ }
166
+ isSelectedNetworkSupported(e) {
167
+ return !!l[e];
168
+ }
169
+ async switchNetwork(e) {
170
+ try {
171
+ await this.getProviderAdapter().switchNetwork(e);
172
+ } catch {
173
+ throw Error(ee.FAILED_TO_SWITCH_NETWORKS);
174
+ }
175
+ }
176
+ isPermitterAvailable(e) {
177
+ return this.getProviderAdapter(e).isPermitterAvailable();
178
+ }
179
+ async disconnectFromConnector() {
180
+ await this.ethereumProviderAdapter?.disconnectFromConnector(), await this.solanaProviderAdapter?.disconnectFromConnector(), await this.tronProviderAdapter?.disconnectFromConnector();
181
+ }
182
+ async resetProviderAdapters() {
183
+ this.ethereumProviderAdapter = void 0, this.solanaProviderAdapter = void 0, this.tronProviderAdapter = void 0;
184
+ }
185
+ async updateProviderAdapter(e, t) {
186
+ try {
187
+ s(e) ? (this.solanaProviderAdapter && this.solanaProviderAdapter.release(), this.solanaProviderAdapter = t) : c(e) ? (this.tronProviderAdapter && this.tronProviderAdapter.release(), this.tronProviderAdapter = t) : (this.ethereumProviderAdapter && this.ethereumProviderAdapter.release(), this.ethereumProviderAdapter = t);
188
+ } catch (e) {
189
+ throw console.error(e), Error("updateProviderAdapter failed, please try again.");
190
+ }
191
+ }
192
+ async setListeners() {
193
+ this.ethereumProviderAdapter?.setChainEventListener({
194
+ onAccountChanged: () => {
195
+ this.onAccountChanged();
196
+ },
197
+ onChainChanged: (e) => {
198
+ this.onChainChanged(e);
199
+ }
200
+ }), this.solanaProviderAdapter?.setChainEventListener({
201
+ onAccountChanged: () => {
202
+ this.onAccountChanged();
203
+ },
204
+ onChainChanged: (e) => {
205
+ this.onChainChanged(e);
206
+ }
207
+ }), this.tronProviderAdapter?.setChainEventListener({
208
+ onAccountChanged: () => {
209
+ this.onAccountChanged();
210
+ },
211
+ onChainChanged: (e) => {
212
+ this.onChainChanged(e);
213
+ }
214
+ });
215
+ }
216
+ async onAccountChanged() {
217
+ await this.ethereumProviderAdapter?.onAccountChanged(), await this.solanaProviderAdapter?.onAccountChanged(), await this.tronProviderAdapter?.onAccountChanged();
218
+ let e = u.AccountChanged;
219
+ typeof document < "u" ? document?.dispatchEvent(new Event(e)) : process?.emit("message", e, void 0);
220
+ }
221
+ async onChainChanged(e) {
222
+ e ? await this.getProviderAdapter(e).onChainChanged(e) : (await this.disconnectFromConnector(), b());
223
+ }
224
+ async monitorConnectedAddress(e) {
225
+ await f.monitor(await this.getEthereumAddressByChain(e));
226
+ }
227
+ async getBalances(e, t, n, r, i = !1, a, o = !1) {
228
+ return ie(this, e, t, n, r, i, this.generateProofRemotely, a, o);
229
+ }
230
+ async getApprovedBalances(e, t = !1, n = !1) {
231
+ return A(this, e, t, n);
232
+ }
233
+ async getTotalBalance(e, t, r, i = !1, a, o = !1) {
234
+ let c = r ?? await this.getEthereumAddressByChain(e), l = t ?? this.userKeys, u = await this.getBalances(e, l.getShieldedPrivateKey(), l.getShieldedPublicKey(), c, i, a, o), d = !s(e) && !o ? await this.getApprovedBalances(e, i, a) : /* @__PURE__ */ new Map(), f = n ? await re.getPrivateTokens(e, c) : te(e), p = [];
235
+ return f.forEach((e) => {
236
+ let t = e.erc20TokenAddress.toLowerCase(), n = u.get(t), r = d.get(t), i = {
237
+ token: e,
238
+ balance: (n?.balance ?? 0n) + (r?.balance ?? 0n),
239
+ timestamp: n?.timestamp || r?.timestamp || "0",
240
+ nfts: n?.nfts || []
241
+ };
242
+ p.push(i);
243
+ }), p;
244
+ }
245
+ async getStuckShieldedBalances(e, t, n) {
246
+ return (await this.getTotalBalance(e, t, n, !1, !1, !0)).filter((e) => e.balance > 0n);
247
+ }
248
+ getSupportedPassportLinks() {
249
+ return p;
250
+ }
251
+ checkAccessToken(e, t) {
252
+ return ne(this, e, t);
253
+ }
254
+ checkExternalTokenLimitsUSD(e, t, n) {
255
+ return N(e, t, n);
256
+ }
257
+ async getHinkalTreeRootHash(t) {
258
+ if (s(t)) {
259
+ let { hinkalIdl: e, hinkalAddress: n, originalDeployer: r } = l[t].contractData;
260
+ if (!e || !n || !r) throw Error(`Missing Solana configuration for chain ${t}`);
261
+ let i = new $(r), a = _(new $(n), i);
262
+ return Z(this.getSolanaProgram(e), a);
263
+ }
264
+ return this.getContractWithFetcherByChainId(t, e.HinkalContract).getRootHash();
265
+ }
266
+ async getAccessTokenTreeRootHash(t) {
267
+ if (s(t)) {
268
+ let { hinkalIdl: e, hinkalAddress: n, originalDeployer: r } = l[t].contractData;
269
+ if (!e || !n || !r) throw Error(`Missing Solana configuration for chain ${t}`);
270
+ let i = new $(r), a = g(new $(n), i);
271
+ return Z(this.getSolanaProgram(e), a);
272
+ }
273
+ return this.getContractWithFetcherByChainId(t, e.AccessTokenContract).getRootHash();
274
+ }
275
+ async resetMerkleTreesIfNecessary(e) {
276
+ let t = (await Promise.all((e ?? this.getSupportedChains()).map(async (e) => {
277
+ let [t, n] = await Promise.all([this.getHinkalTreeRootHash(e), this.getAccessTokenTreeRootHash(e)]);
278
+ return {
279
+ chainId: e,
280
+ needsReset: BigInt(t) !== this.merkleTreeHinkalByChain[e].getRootHash() || BigInt(n) !== this.merkleTreeAccessTokenByChain[e].getRootHash()
281
+ };
282
+ }))).filter((e) => e.needsReset).map((e) => e.chainId);
283
+ t.length > 0 && (console.log("resetting merkle tree in resetMerkleTreesIfNecessary for chains:", t), await this.resetMerkle(t));
284
+ }
285
+ async getEthereumAddress() {
286
+ let e = this.ethereumProviderAdapter ?? this.solanaProviderAdapter ?? this.tronProviderAdapter;
287
+ if (!e) throw Error("No provider adapter initialized");
288
+ return e.getAddress();
289
+ }
290
+ getEthereumAddressByChain(e) {
291
+ return this.getProviderAdapter(e).getAddress();
292
+ }
293
+ async getRandomRelay(e, t = !1) {
294
+ return (await f.getIdleRelay(e, t)).relay;
295
+ }
296
+ getGasPrice(e) {
297
+ let t = this.getProviderAdapter(e);
298
+ if (!t) throw Error("Illegal State of providerAdapter in Hinkal: no providerAdapter initialized");
299
+ return t.getGasPrice(e);
300
+ }
301
+ getAPI() {
302
+ return f;
303
+ }
304
+ snapshotsClearInterval() {
305
+ this.getSupportedChains().forEach((e) => {
306
+ this.commitmentsSnapshotServiceByChain[e]?.intervalClear(), this.accessTokenSnapshotServiceByChain[e]?.intervalClear(), this.nullifierSnapshotServiceByChain[e]?.intervalClear(), this.approvalsSnapshotServiceByChain[e]?.intervalClear();
307
+ });
308
+ }
309
+ checkTokenRegistry(t, n, r) {
310
+ if (s(t)) {
311
+ let { hinkalIdl: e, hinkalAddress: i, originalDeployer: a } = l[t].contractData;
312
+ if (!e || !i || !a) throw Error("missing solana data");
313
+ return v(this.getSolanaProgram(e), new $(a), n, r);
314
+ }
315
+ return c(t) ? T(n, r, t) : w(this.getContractWithFetcher(t, e.HinkalHelperContract), n, r);
316
+ }
317
+ getRecipientInfo() {
318
+ return H(this);
319
+ }
320
+ getApprovedUtxos(e, t = !1) {
321
+ return j(this, e, t);
322
+ }
323
+ getApprovedUtxosForToken(e, t, n = !1) {
324
+ return M(this, e, t, n);
325
+ }
326
+ async deposit(e, t, n = !0, r = !1) {
327
+ return D(this, e, t, n, r);
328
+ }
329
+ async depositSolana(e, t) {
330
+ return F(this, e, t);
331
+ }
332
+ async depositForOther(e, t, n, r = !0, i = !1) {
333
+ return this.enforceRateLimit(this.depositForOther.name, [
334
+ e,
335
+ t,
336
+ n
337
+ ]), O(this, e, t, n, r, i);
338
+ }
339
+ async depositSolanaForOther(e, t, n) {
340
+ return this.enforceRateLimit(this.depositSolanaForOther.name, [
341
+ e,
342
+ t,
343
+ n
344
+ ]), I(this, e, t, n);
345
+ }
346
+ async depositAndWithdraw(e, t, n, r, i, a, o, c = !0) {
347
+ return s(y([e])) ? oe(this, e, t, n, r, i, a, o) : P(this, e, t, n, r, i, a, o, c);
348
+ }
349
+ async claimUtxo(e, t, n, r) {
350
+ return s(y([e])) ? he(this, e, t, n, r) : pe(this, e, t, n, r);
351
+ }
352
+ async depositAndBridge(e, t, n, r, i, a, o = !0) {
353
+ return fe(this, e, t, n, r, i, a, o);
354
+ }
355
+ async prooflessDeposit(e, t, n, r) {
356
+ return s(y(e)) ? me(this, e, t, n, r) : W(this, e, t, n, r);
357
+ }
358
+ getSolanaProgram(e) {
359
+ if (!this.solanaProviderAdapter) throw Error("No provider adapter initialized");
360
+ if (!("getSolanaProgram" in this.solanaProviderAdapter)) throw Error("Current provider adapter is not a Solana provider adapter");
361
+ return this.solanaProviderAdapter.getSolanaProgram(e);
362
+ }
363
+ getSolanaPublicKey() {
364
+ if (!this.solanaProviderAdapter) throw Error("No provider adapter initialized");
365
+ if (!("getSolanaPublicKey" in this.solanaProviderAdapter)) throw Error("Current provider adapter is not a Solana provider adapter");
366
+ return this.solanaProviderAdapter.getSolanaPublicKey();
367
+ }
368
+ async transfer(e, t, n, r, i, a) {
369
+ return s(y(e)) ? ce(this, e, t, n, r, i, a) : q(this, e, t, n, r, i, a);
370
+ }
371
+ async withdraw(e, t, n, r, i, a, o) {
372
+ return s(y(e)) ? se(this, e, t, n, i, a, o) : R(this, e, t, n, r, i, a, o);
373
+ }
374
+ async withdrawStuckUtxos(e, t) {
375
+ return ge(this, e, t);
376
+ }
377
+ async swap(e, t, n, r, i, a, o) {
378
+ return s(y(e)) ? this.swapSolana(e, t, r, i, a) : L(this, e, t, n, r, i, a, o);
379
+ }
380
+ async swapSolana(e, t, n, r, i) {
381
+ let a = JSON.parse(n), o = BigInt(a.swapperAccountSalt), { instructionLists: s, addressLookupTableAccount: c } = a.data;
382
+ return le(this, e, t, o, s, c, r, i);
383
+ }
384
+ async actionReceive(e, t, n, r, i, a) {
385
+ if (!i) throw Error("subAccount is required");
386
+ return s(y(e)) ? X(this, e[0], t[0], i, void 0, a) : U(this, e, t, n, r, i, a);
387
+ }
388
+ async actionPrivateWallet(e, t, n, r, i, a, o, s, c, l, u = !1, d, f, p) {
389
+ return this.enforceRateLimit(this.actionPrivateWallet.name, [
390
+ e,
391
+ t,
392
+ n,
393
+ r,
394
+ i,
395
+ a,
396
+ o,
397
+ s,
398
+ c,
399
+ p
400
+ ]), V(this, e, t, n, r, i, a, o, s, c, l, u, d, f, p);
401
+ }
402
+ async proxySwap(e, t, n, r, i, a, o, c, l = !1, u, d) {
403
+ return s(y(e)) ? de(this, e, t, r, a, o, c) : G(this, e, t, n, r, i, a, o, c, l, u, d);
404
+ }
405
+ async proxyToPrivate(e, t, n, r, i, a, o) {
406
+ return s(y(e)) ? (this.enforceRateLimit(this.proxyToPrivate.name, [
407
+ e[0],
408
+ t[0],
409
+ n,
410
+ r
411
+ ]), X(this, e[0], t[0], n, r, o)) : J(this, e, t, r, i, a, n, o);
412
+ }
413
+ async proxySend(e, t, n, r, i, a, o) {
414
+ let c = y(e);
415
+ if (s(c)) return ue(this, e[0], t[0], n, r, o);
416
+ let l = k(this, c, e.map((e) => e.erc20TokenAddress), t, r), u = e.map((e, n) => ({
417
+ token: e,
418
+ amount: -1n * t[n]
419
+ }));
420
+ return await this.actionPrivateWallet(c, [], [], [], l, u, n, i, a, void 0, void 0, void 0, o, void 0);
421
+ }
422
+ async multiSendPrivateRecipients(e, t, n) {
423
+ return this.enforceRateLimit(this.multiSendPrivateRecipients.name, [
424
+ e,
425
+ t,
426
+ n
427
+ ]), K(this, e, t, n);
428
+ }
429
+ areMerkleTreeUpdatesDisabled() {
430
+ return this.disableMerkleTreeUpdates;
431
+ }
432
+ updateMerkleTreeUpdates(e) {
433
+ this.disableMerkleTreeUpdates = e;
434
+ }
632
435
  };
436
+ //#endregion
437
+ export { _e as Hinkal };