@hinkal/common 0.2.18 → 0.2.19

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 (454) hide show
  1. package/API/API.cjs +1 -1
  2. package/API/API.d.ts +8 -13
  3. package/API/API.mjs +86 -94
  4. package/API/admin-calls.cjs +1 -1
  5. package/API/admin-calls.d.ts +1 -1
  6. package/API/admin-calls.mjs +4 -4
  7. package/API/callLifiAPI.cjs +1 -1
  8. package/API/callLifiAPI.d.ts +1 -1
  9. package/API/callLifiAPI.mjs +5 -5
  10. package/API/callMonitor.cjs +1 -1
  11. package/API/callMonitor.d.ts +1 -1
  12. package/API/callMonitor.mjs +7 -7
  13. package/API/callOdosAPI.cjs +1 -1
  14. package/API/callOdosAPI.mjs +11 -11
  15. package/API/callOkxAPI.cjs +1 -1
  16. package/API/callOkxAPI.d.ts +1 -1
  17. package/API/callOkxAPI.mjs +5 -5
  18. package/API/callOneInchAPI.cjs +1 -1
  19. package/API/callOneInchAPI.mjs +10 -11
  20. package/API/callRelayer.cjs +1 -1
  21. package/API/callRelayer.d.ts +6 -3
  22. package/API/callRelayer.mjs +11 -11
  23. package/API/checkRisk.cjs +1 -1
  24. package/API/checkRisk.d.ts +1 -1
  25. package/API/checkRisk.mjs +4 -4
  26. package/API/fetchCommitmentsCache.cjs +1 -1
  27. package/API/fetchCommitmentsCache.mjs +9 -9
  28. package/API/get-token-data.cjs +1 -1
  29. package/API/get-token-data.d.ts +1 -1
  30. package/API/get-token-data.mjs +5 -5
  31. package/API/get-token-price-chart-data.cjs +1 -0
  32. package/API/get-token-price-chart-data.d.ts +16 -0
  33. package/API/get-token-price-chart-data.mjs +13 -0
  34. package/API/getGasEstimates.cjs +1 -1
  35. package/API/getGasEstimates.mjs +9 -9
  36. package/API/getServerURL.cjs +1 -1
  37. package/API/getServerURL.d.ts +3 -3
  38. package/API/getServerURL.mjs +51 -67
  39. package/API/getTokenPrice.cjs +1 -1
  40. package/API/getTokenPrice.d.ts +5 -0
  41. package/API/getTokenPrice.mjs +14 -7
  42. package/API/index.d.ts +0 -3
  43. package/API/is-tx-stateless.cjs +1 -1
  44. package/API/is-tx-stateless.d.ts +1 -1
  45. package/API/is-tx-stateless.mjs +10 -12
  46. package/API/kycCalls.cjs +1 -1
  47. package/API/kycCalls.d.ts +4 -8
  48. package/API/kycCalls.mjs +23 -26
  49. package/API/onrampCalls.cjs +1 -0
  50. package/API/onrampCalls.d.ts +20 -0
  51. package/API/onrampCalls.mjs +15 -0
  52. package/API/proxyAccountsCalls.cjs +1 -1
  53. package/API/proxyAccountsCalls.d.ts +2 -2
  54. package/API/proxyAccountsCalls.mjs +19 -19
  55. package/API/relayCalls.cjs +1 -1
  56. package/API/relayCalls.mjs +4 -4
  57. package/API/scheduled-transactions-calls.cjs +1 -1
  58. package/API/scheduled-transactions-calls.d.ts +1 -1
  59. package/API/scheduled-transactions-calls.mjs +4 -4
  60. package/API/simulate-batch-tx.cjs +1 -1
  61. package/API/simulate-batch-tx.d.ts +2 -2
  62. package/API/simulate-batch-tx.mjs +7 -6
  63. package/API/solana-calls.cjs +1 -1
  64. package/API/solana-calls.d.ts +6 -3
  65. package/API/solana-calls.mjs +15 -15
  66. package/API/token-calls.cjs +1 -1
  67. package/API/token-calls.mjs +6 -5
  68. package/API/unspent-utxos-calls.cjs +1 -1
  69. package/API/unspent-utxos-calls.d.ts +1 -1
  70. package/API/unspent-utxos-calls.mjs +15 -18
  71. package/README.md +233 -64
  72. package/constants/addresses.constants.cjs +1 -1
  73. package/constants/addresses.constants.d.ts +0 -1
  74. package/constants/addresses.constants.mjs +7 -8
  75. package/constants/chains.constants.cjs +1 -1
  76. package/constants/chains.constants.d.ts +0 -5
  77. package/constants/chains.constants.mjs +19 -24
  78. package/constants/coingecko.constants.cjs +1 -1
  79. package/constants/coingecko.constants.d.ts +1 -0
  80. package/constants/coingecko.constants.mjs +11 -10
  81. package/constants/contracts.constants.cjs +1 -1
  82. package/constants/contracts.constants.mjs +34 -41
  83. package/constants/function-signatures.constants.cjs +1 -1
  84. package/constants/function-signatures.constants.d.ts +0 -1
  85. package/constants/function-signatures.constants.mjs +3 -4
  86. package/constants/mystery-boxes.constants.d.ts +0 -0
  87. package/constants/permit2.constants.cjs +1 -1
  88. package/constants/permit2.constants.d.ts +0 -1
  89. package/constants/permit2.constants.mjs +10 -11
  90. package/constants/server.constants.cjs +1 -1
  91. package/constants/server.constants.d.ts +14 -122
  92. package/constants/server.constants.mjs +44 -152
  93. package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
  94. package/constants/token-data/ethMainnetRegistry.json.mjs +0 -24
  95. package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
  96. package/constants/token-data/ethMainnetRegistryFixed.json.mjs +0 -24
  97. package/constants/token-data/index.d.ts +32 -88
  98. package/constants/token-data/localhostRegistry.json.cjs +1 -1
  99. package/constants/token-data/localhostRegistry.json.mjs +0 -26
  100. package/constants/token-data/popularTokens.constants.cjs +1 -1
  101. package/constants/token-data/popularTokens.constants.mjs +0 -1
  102. package/data-structures/Hinkal/Hinkal.cjs +1 -1
  103. package/data-structures/Hinkal/Hinkal.d.ts +33 -48
  104. package/data-structures/Hinkal/Hinkal.mjs +237 -300
  105. package/data-structures/Hinkal/IHinkal.d.ts +32 -47
  106. package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
  107. package/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
  108. package/data-structures/Hinkal/handleAutoDepositBack.mjs +42 -42
  109. package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
  110. package/data-structures/Hinkal/hinkalActionReceive.mjs +25 -23
  111. package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
  112. package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +9 -9
  113. package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
  114. package/data-structures/Hinkal/hinkalDeposit.mjs +95 -93
  115. package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
  116. package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +111 -115
  117. package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
  118. package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +1 -2
  119. package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  120. package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +1 -1
  121. package/data-structures/Hinkal/hinkalPrivateWallet.mjs +107 -115
  122. package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
  123. package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +36 -34
  124. package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
  125. package/data-structures/Hinkal/hinkalProxySwap.mjs +34 -33
  126. package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
  127. package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +26 -24
  128. package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
  129. package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +1 -2
  130. package/data-structures/Hinkal/hinkalSignSubAccount.mjs +8 -9
  131. package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
  132. package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -3
  133. package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +86 -97
  134. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  135. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +2 -1
  136. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +146 -146
  137. package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
  138. package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +2 -3
  139. package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +38 -38
  140. package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
  141. package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +57 -56
  142. package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
  143. package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +1 -1
  144. package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +59 -58
  145. package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
  146. package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +1 -1
  147. package/data-structures/Hinkal/hinkalSolanaSwap.mjs +83 -79
  148. package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
  149. package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +49 -48
  150. package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
  151. package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +2 -1
  152. package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +67 -64
  153. package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
  154. package/data-structures/Hinkal/hinkalSwap.mjs +75 -87
  155. package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
  156. package/data-structures/Hinkal/hinkalTransfer.mjs +55 -58
  157. package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  158. package/data-structures/Hinkal/hinkalWithdraw.mjs +80 -82
  159. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  160. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +98 -102
  161. package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  162. package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
  163. package/data-structures/Hinkal/resetMerkleTrees.mjs +105 -53
  164. package/data-structures/IndexedDB/activity-db.cjs +1 -1
  165. package/data-structures/IndexedDB/activity-db.mjs +7 -7
  166. package/data-structures/IndexedDB/balances-db.cjs +1 -1
  167. package/data-structures/IndexedDB/balances-db.mjs +8 -8
  168. package/data-structures/IndexedDB/contact-db.cjs +1 -1
  169. package/data-structures/IndexedDB/contact-db.mjs +10 -10
  170. package/data-structures/IndexedDB/signatures-db.cjs +1 -1
  171. package/data-structures/IndexedDB/signatures-db.mjs +25 -40
  172. package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
  173. package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +10 -11
  174. package/data-structures/TokenDBs/token-visibility-db.cjs +1 -1
  175. package/data-structures/TokenDBs/token-visibility-db.mjs +22 -36
  176. package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
  177. package/data-structures/crypto-keys/encryptDecryptUtxo.d.ts +1 -1
  178. package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +14 -14
  179. package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
  180. package/data-structures/event-service/evm/AbstractEventService.d.ts +1 -0
  181. package/data-structures/event-service/evm/AbstractEventService.mjs +7 -4
  182. package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
  183. package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +0 -1
  184. package/data-structures/event-service/evm/AbstractSnapshotService.mjs +3 -4
  185. package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
  186. package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +3 -1
  187. package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +17 -14
  188. package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
  189. package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +1 -0
  190. package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +9 -6
  191. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
  192. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +0 -1
  193. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +1 -2
  194. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
  195. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +3 -2
  196. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +42 -45
  197. package/data-structures/provider-adapter/IProviderAdapter.d.ts +8 -13
  198. package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
  199. package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +3 -4
  200. package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
  201. package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +3 -4
  202. package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
  203. package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +3 -4
  204. package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
  205. package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +3 -4
  206. package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
  207. package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +3 -4
  208. package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
  209. package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +2 -4
  210. package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
  211. package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +3 -4
  212. package/data-structures/utxo/Utxo.cjs +1 -1
  213. package/data-structures/utxo/Utxo.d.ts +1 -7
  214. package/data-structures/utxo/Utxo.mjs +26 -36
  215. package/error-handling/error-codes.constants.cjs +1 -1
  216. package/error-handling/error-codes.constants.d.ts +1 -0
  217. package/error-handling/error-codes.constants.mjs +2 -1
  218. package/error-handling/get-error.message.cjs +1 -1
  219. package/error-handling/get-error.message.mjs +21 -27
  220. package/error-handling/index.d.ts +0 -1
  221. package/functions/index.d.ts +0 -1
  222. package/functions/kyc/zkMeHelper.cjs +1 -1
  223. package/functions/kyc/zkMeHelper.mjs +18 -17
  224. package/functions/pre-transaction/constructAdminData.cjs +1 -1
  225. package/functions/pre-transaction/constructAdminData.d.ts +2 -2
  226. package/functions/pre-transaction/constructAdminData.mjs +12 -18
  227. package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
  228. package/functions/pre-transaction/getExternalSwapAddress.d.ts +1 -2
  229. package/functions/pre-transaction/getExternalSwapAddress.mjs +8 -8
  230. package/functions/pre-transaction/getFlatFees.cjs +1 -1
  231. package/functions/pre-transaction/getFlatFees.mjs +22 -30
  232. package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
  233. package/functions/pre-transaction/getVolatileTransferAmount.mjs +21 -36
  234. package/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
  235. package/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +1 -1
  236. package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +17 -17
  237. package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
  238. package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +1 -9
  239. package/functions/pre-transaction/outputApprovalDataProcessing.mjs +19 -34
  240. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
  241. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +1 -1
  242. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +4 -4
  243. package/functions/pre-transaction/solana-public-signals.cjs +1 -1
  244. package/functions/pre-transaction/solana-public-signals.d.ts +1 -0
  245. package/functions/pre-transaction/solana-public-signals.mjs +29 -26
  246. package/functions/pre-transaction/solana.cjs +1 -1
  247. package/functions/pre-transaction/solana.d.ts +2 -1
  248. package/functions/pre-transaction/solana.mjs +60 -51
  249. package/functions/private-wallet/emporium.helpers.cjs +1 -1
  250. package/functions/private-wallet/emporium.helpers.d.ts +3 -5
  251. package/functions/private-wallet/emporium.helpers.mjs +95 -135
  252. package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
  253. package/functions/private-wallet/emporium.swap.helpers.d.ts +1 -4
  254. package/functions/private-wallet/emporium.swap.helpers.mjs +100 -102
  255. package/functions/snarkjs/common.snarkjs.cjs +1 -1
  256. package/functions/snarkjs/common.snarkjs.d.ts +1 -1
  257. package/functions/snarkjs/common.snarkjs.mjs +64 -64
  258. package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
  259. package/functions/snarkjs/constructEmporiumProof.mjs +1 -1
  260. package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
  261. package/functions/snarkjs/constructGeneralZkProof.d.ts +1 -2
  262. package/functions/snarkjs/constructGeneralZkProof.mjs +117 -121
  263. package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
  264. package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -1
  265. package/functions/snarkjs/constructSolanaZkProof.mjs +54 -59
  266. package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
  267. package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +11 -10
  268. package/functions/utils/addresses.cjs +1 -1
  269. package/functions/utils/addresses.d.ts +1 -0
  270. package/functions/utils/addresses.mjs +13 -12
  271. package/functions/utils/cacheFunctions.cjs +1 -1
  272. package/functions/utils/cacheFunctions.mjs +2 -2
  273. package/functions/utils/erc20tokenFunctions.cjs +1 -1
  274. package/functions/utils/erc20tokenFunctions.d.ts +0 -1
  275. package/functions/utils/erc20tokenFunctions.mjs +22 -29
  276. package/functions/utils/get-hinkal-approvals.cjs +1 -1
  277. package/functions/utils/get-hinkal-approvals.d.ts +1 -1
  278. package/functions/utils/get-hinkal-approvals.mjs +16 -16
  279. package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
  280. package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
  281. package/functions/utils/getUtxosFromReceipt.utils.mjs +11 -11
  282. package/functions/utils/involves-permit2-op.cjs +1 -1
  283. package/functions/utils/involves-permit2-op.d.ts +0 -1
  284. package/functions/utils/involves-permit2-op.mjs +4 -6
  285. package/functions/utils/mutexes.utils.cjs +1 -1
  286. package/functions/utils/mutexes.utils.d.ts +1 -1
  287. package/functions/utils/mutexes.utils.mjs +3 -3
  288. package/functions/utils/nftTokenFunctions.cjs +1 -1
  289. package/functions/utils/nftTokenFunctions.mjs +8 -23
  290. package/functions/utils/prepareHinkal.cjs +1 -1
  291. package/functions/utils/prepareHinkal.d.ts +0 -6
  292. package/functions/utils/prepareHinkal.mjs +41 -60
  293. package/functions/utils/token-check.utils.cjs +1 -1
  294. package/functions/utils/token-check.utils.d.ts +3 -0
  295. package/functions/utils/token-check.utils.mjs +18 -7
  296. package/functions/utils/upToDateState.cjs +1 -1
  297. package/functions/utils/upToDateState.d.ts +1 -1
  298. package/functions/utils/upToDateState.mjs +4 -4
  299. package/functions/utils/walletBalances.utils.cjs +1 -1
  300. package/functions/utils/walletBalances.utils.d.ts +1 -16
  301. package/functions/utils/walletBalances.utils.mjs +4 -35
  302. package/functions/web3/events/getApprovedBalance.cjs +1 -1
  303. package/functions/web3/events/getApprovedBalance.d.ts +3 -4
  304. package/functions/web3/events/getApprovedBalance.mjs +39 -44
  305. package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  306. package/functions/web3/events/getInputUtxoAndBalance.d.ts +1 -1
  307. package/functions/web3/events/getInputUtxoAndBalance.mjs +114 -121
  308. package/functions/web3/events/getShieldedBalance.cjs +2 -2
  309. package/functions/web3/events/getShieldedBalance.d.ts +1 -1
  310. package/functions/web3/events/getShieldedBalance.mjs +71 -70
  311. package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
  312. package/functions/web3/events/getTransactionLogEvents.mjs +7 -7
  313. package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
  314. package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +7 -7
  315. package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
  316. package/functions/web3/functionCalls/accessTokenCalls.d.ts +1 -6
  317. package/functions/web3/functionCalls/accessTokenCalls.mjs +12 -21
  318. package/functions/web3/functionCalls/approveToken.cjs +1 -1
  319. package/functions/web3/functionCalls/approveToken.d.ts +1 -1
  320. package/functions/web3/functionCalls/approveToken.mjs +50 -46
  321. package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -1
  322. package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +1 -1
  323. package/functions/web3/functionCalls/approveTokensToHinkal.mjs +6 -6
  324. package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
  325. package/functions/web3/functionCalls/estimateGasRelayer.d.ts +1 -2
  326. package/functions/web3/functionCalls/estimateGasRelayer.mjs +10 -10
  327. package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
  328. package/functions/web3/functionCalls/transactCallDirect.d.ts +1 -1
  329. package/functions/web3/functionCalls/transactCallDirect.mjs +38 -42
  330. package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  331. package/functions/web3/functionCalls/transactCallRelayer.d.ts +1 -1
  332. package/functions/web3/functionCalls/transactCallRelayer.mjs +34 -34
  333. package/functions/web3/getPublicAddressBalance.cjs +1 -1
  334. package/functions/web3/getPublicAddressBalance.d.ts +1 -1
  335. package/functions/web3/getPublicAddressBalance.mjs +6 -6
  336. package/functions/web3/getTokenHolder.cjs +1 -1
  337. package/functions/web3/getTokenHolder.mjs +8 -8
  338. package/functions/web3/lifiAPI.cjs +1 -1
  339. package/functions/web3/lifiAPI.d.ts +1 -1
  340. package/functions/web3/lifiAPI.mjs +12 -12
  341. package/functions/web3/odosAPI.cjs +1 -1
  342. package/functions/web3/odosAPI.mjs +6 -19
  343. package/functions/web3/okxAPI.cjs +1 -1
  344. package/functions/web3/okxAPI.mjs +22 -22
  345. package/functions/web3/oneInchAPI.cjs +1 -1
  346. package/functions/web3/oneInchAPI.mjs +7 -20
  347. package/functions/web3/runContractFunction.cjs +1 -1
  348. package/functions/web3/runContractFunction.mjs +38 -56
  349. package/functions/web3/uniswapAPI.cjs +1 -1
  350. package/functions/web3/uniswapAPI.mjs +22 -34
  351. package/index.cjs +1 -1
  352. package/index.mjs +939 -970
  353. package/package.json +1 -1
  354. package/providers/EthersProviderAdapter.cjs +1 -1
  355. package/providers/EthersProviderAdapter.d.ts +10 -17
  356. package/providers/EthersProviderAdapter.mjs +48 -76
  357. package/providers/SolanaProviderAdapter.cjs +1 -1
  358. package/providers/SolanaProviderAdapter.d.ts +7 -11
  359. package/providers/SolanaProviderAdapter.mjs +16 -31
  360. package/providers/WagmiProviderAdapter.cjs +1 -1
  361. package/providers/WagmiProviderAdapter.d.ts +11 -17
  362. package/providers/WagmiProviderAdapter.mjs +86 -117
  363. package/providers/prepareEthersHinkal.cjs +1 -1
  364. package/providers/prepareEthersHinkal.mjs +6 -7
  365. package/providers/prepareWagmiHinkal.cjs +1 -1
  366. package/providers/prepareWagmiHinkal.mjs +5 -5
  367. package/types/TransactionSimulator.types.d.ts +2 -9
  368. package/types/admin.types.cjs +1 -1
  369. package/types/admin.types.d.ts +0 -6
  370. package/types/admin.types.mjs +2 -2
  371. package/types/balances.types.d.ts +0 -1
  372. package/types/cache.types.cjs +1 -1
  373. package/types/cache.types.d.ts +2 -3
  374. package/types/cache.types.mjs +1 -1
  375. package/types/coingecko.types.d.ts +5 -0
  376. package/types/ethereum-network.types.cjs +1 -1
  377. package/types/ethereum-network.types.d.ts +1 -8
  378. package/types/ethereum-network.types.mjs +1 -1
  379. package/types/external-action.types.cjs +1 -1
  380. package/types/external-action.types.d.ts +0 -1
  381. package/types/external-action.types.mjs +1 -1
  382. package/types/hinkal.types.cjs +1 -1
  383. package/types/hinkal.types.d.ts +1 -7
  384. package/types/hinkal.types.mjs +22 -23
  385. package/types/index.d.ts +1 -3
  386. package/types/onramp.types.cjs +1 -0
  387. package/types/onramp.types.d.ts +58 -0
  388. package/types/onramp.types.mjs +4 -0
  389. package/types/proxy.types.d.ts +1 -0
  390. package/types/sandbox.types.cjs +1 -1
  391. package/types/sandbox.types.d.ts +8 -39
  392. package/types/sandbox.types.mjs +2 -2
  393. package/types/session.types.d.ts +2 -0
  394. package/types/solana.types.d.ts +1 -0
  395. package/types/token-prices.types.cjs +1 -1
  396. package/types/token-prices.types.d.ts +7 -0
  397. package/types/token-prices.types.mjs +4 -2
  398. package/types/transactions.types.cjs +1 -1
  399. package/types/transactions.types.d.ts +2 -4
  400. package/types/transactions.types.mjs +3 -3
  401. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
  402. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
  403. package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
  404. package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
  405. package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
  406. package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +2 -2
  407. package/API/ai-calls.cjs +0 -1
  408. package/API/ai-calls.d.ts +0 -17
  409. package/API/ai-calls.mjs +0 -21
  410. package/API/duneAPI.cjs +0 -1
  411. package/API/duneAPI.d.ts +0 -11
  412. package/API/duneAPI.mjs +0 -25
  413. package/API/getBridgeProtocols.cjs +0 -1
  414. package/API/getBridgeProtocols.d.ts +0 -7
  415. package/API/getBridgeProtocols.mjs +0 -8
  416. package/API/getLifiStatus.cjs +0 -1
  417. package/API/getLifiStatus.d.ts +0 -24
  418. package/API/getLifiStatus.mjs +0 -15
  419. package/API/getRelayerURL.cjs +0 -1
  420. package/API/getRelayerURL.d.ts +0 -1
  421. package/API/getRelayerURL.mjs +0 -10
  422. package/API/passwordCalls.cjs +0 -1
  423. package/API/passwordCalls.d.ts +0 -9
  424. package/API/passwordCalls.mjs +0 -13
  425. package/API/restoreSnapshots.cjs +0 -1
  426. package/API/restoreSnapshots.d.ts +0 -1
  427. package/API/restoreSnapshots.mjs +0 -10
  428. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +0 -1
  429. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +0 -7
  430. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +0 -42
  431. package/data-structures/Hinkal/hinkalActionStake.d.ts +0 -3
  432. package/data-structures/Hinkal/hinkalApprove.cjs +0 -1
  433. package/data-structures/Hinkal/hinkalApprove.d.ts +0 -3
  434. package/data-structures/Hinkal/hinkalApprove.mjs +0 -115
  435. package/data-structures/Hinkal/hinkalInsideTransact.cjs +0 -1
  436. package/data-structures/Hinkal/hinkalInsideTransact.d.ts +0 -4
  437. package/data-structures/Hinkal/hinkalInsideTransact.mjs +0 -121
  438. package/error-handling/handleErrorRestore.cjs +0 -1
  439. package/error-handling/handleErrorRestore.d.ts +0 -2
  440. package/error-handling/handleErrorRestore.mjs +0 -11
  441. package/functions/staking/index.cjs +0 -1
  442. package/functions/staking/index.d.ts +0 -11
  443. package/functions/staking/index.mjs +0 -42
  444. package/functions/utils/replaceAddressInCalldata.cjs +0 -1
  445. package/functions/utils/replaceAddressInCalldata.d.ts +0 -1
  446. package/functions/utils/replaceAddressInCalldata.mjs +0 -7
  447. package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +0 -1
  448. package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +0 -5
  449. package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +0 -32
  450. package/types/bridging.types.d.ts +0 -29
  451. package/types/duneAPI.types.d.ts +0 -9
  452. package/types/hinkal.stake.types.cjs +0 -1
  453. package/types/hinkal.stake.types.d.ts +0 -11
  454. package/types/hinkal.stake.types.mjs +0 -4
@@ -1,101 +1,102 @@
1
- import { getErc20TokensForChain as x, getERC20Token as U } from "../../utils/erc20tokenFunctions.mjs";
1
+ import { getErc20TokensForChain as U, getERC20Token as P } from "../../utils/erc20tokenFunctions.mjs";
2
2
  import { caseInsensitiveEqual as h } from "../../utils/caseInsensitive.utils.mjs";
3
- import { Utxo as P } from "../../../data-structures/utxo/Utxo.mjs";
4
- import { getAmountWithPrecision as E } from "../etherFunctions.mjs";
3
+ import { Utxo as E } from "../../../data-structures/utxo/Utxo.mjs";
4
+ import { getAmountWithPrecision as M } from "../etherFunctions.mjs";
5
5
  import { ErrorWithAmount as S } from "../../../error-handling/customErrors/ErrorWithAmount.mjs";
6
6
  import "../../../error-handling/error-codes.constants.mjs";
7
- import { getInputUtxoAndBalanceOfStuckUtxos as C, getInputUtxoAndBalance as v, getInputUtxoAndBalancePerToken as M } from "./getInputUtxoAndBalance.mjs";
7
+ import { getInputUtxoAndBalanceOfStuckUtxos as B, getInputUtxoAndBalance as v, getInputUtxoAndBalancePerToken as b } from "./getInputUtxoAndBalance.mjs";
8
8
  import { privateTokensDB as y } from "../../../data-structures/TokenDBs/PrivateTokensDB.mjs";
9
9
  import { isExtension as A } from "../../../constants/vite.constants.mjs";
10
- import { encodeTokenWithId as B } from "../../utils/encodeTokenWithId.mjs";
11
- import { balanceFetchingMutex as b } from "../../utils/mutexes.utils.mjs";
12
- import { formatMintAddress as I } from "../../utils/solanaMint.utils.mjs";
13
- import { isSolanaLike as R } from "../../../constants/chains.constants.mjs";
14
- const G = async (i, e, p, d, a, u = !1, g, k = !1, l = !1) => b.runExclusive(async () => {
15
- const { inputUtxos: r } = l ? await C({
16
- hinkal: i,
17
- chainId: e,
18
- ethAddress: a
10
+ import { encodeTokenWithId as C } from "../../utils/encodeTokenWithId.mjs";
11
+ import { getChainBalanceFetchingMutex as R } from "../../utils/mutexes.utils.mjs";
12
+ import { formatMintAddress as W } from "../../utils/solanaMint.utils.mjs";
13
+ import { isSolanaLike as K } from "../../../constants/chains.constants.mjs";
14
+ const J = async (l, o, s, p, r, c = !1, k, g = !1, T = !1) => R(o).runExclusive(async () => {
15
+ const { inputUtxos: a } = T ? await B({
16
+ hinkal: l,
17
+ chainId: o,
18
+ ethAddress: r
19
19
  }) : await v({
20
- hinkal: i,
20
+ hinkal: l,
21
21
  sliceIfMore6: !1,
22
- chainId: e,
23
- passedShieldedPrivateKey: p,
24
- passedShieldedPublicKey: d,
25
- ethAddress: a,
26
- resetCacheBefore: u,
27
- allowRemoteDecryption: g
22
+ chainId: o,
23
+ passedShieldedPrivateKey: s,
24
+ passedShieldedPublicKey: p,
25
+ ethAddress: r,
26
+ resetCacheBefore: c,
27
+ allowRemoteDecryption: k
28
28
  });
29
- k && A && await y.fetchAndUpdatePrivateTokens(
30
- r.map((t) => t.getTokenAddress(e)).filter((t) => t !== void 0),
31
- e,
32
- a
29
+ g && A && await y.fetchAndUpdatePrivateTokens(
30
+ a.map((e) => e.getTokenAddress(o)).filter((e) => e !== void 0),
31
+ o,
32
+ r
33
33
  );
34
- const c = (A ? await y.getPrivateTokens(e, a) : x(e)).map((t) => ({
35
- token: t,
36
- balance: r.reduce((o, m) => {
37
- const s = t.erc20TokenAddress, f = m.getTokenAddress(e);
38
- return h(s, f) ? o + m.amount : o;
34
+ const d = (A ? await y.getPrivateTokens(o, r) : U(o)).map((e) => ({
35
+ token: e,
36
+ balance: a.reduce((t, m) => {
37
+ const i = e.erc20TokenAddress, f = m.getTokenAddress(o);
38
+ return h(i, f) ? t + m.amount : t;
39
39
  }, 0n),
40
- timestamp: r.filter(
41
- (o) => h(o.getTokenAddress(e), t.erc20TokenAddress)
40
+ timestamp: a.filter(
41
+ (t) => h(t.getTokenAddress(o), e.erc20TokenAddress)
42
42
  )[0]?.timeStamp,
43
- nfts: r.filter(
44
- (o) => h(o.getTokenAddress(e), t.erc20TokenAddress) && o.tokenId !== 0
45
- ).map((o) => ({ tokenId: o.tokenId, timestamp: o.timeStamp }))
43
+ nfts: a.filter(
44
+ (t) => h(t.getTokenAddress(o), e.erc20TokenAddress) && t.tokenId !== 0
45
+ ).map((t) => ({ tokenId: t.tokenId, timestamp: t.timeStamp }))
46
46
  })), n = /* @__PURE__ */ new Map();
47
- return c.forEach((t) => {
48
- n.set(t.token.erc20TokenAddress.toLowerCase(), t);
47
+ return d.forEach((e) => {
48
+ n.set(e.token.erc20TokenAddress.toLowerCase(), e);
49
49
  }), n;
50
- }), H = async (i, e, p, d = 6, a = e.map(() => 0), u = !1, g = !1) => {
51
- const { userKeys: k } = i, l = [], r = [], w = await M({
52
- hinkal: i,
50
+ }), Q = async (l, o, s, p, r = 6, c = s.map(() => 0), k = !1, g = !1) => {
51
+ const { userKeys: T } = l, u = [], a = [], w = await b({
52
+ hinkal: l,
53
53
  sliceIfMore6: !1,
54
- ensuredTokensWithId: e.map((n, t) => ({ erc20TokenAddress: e[t], tokenId: a[t] })),
54
+ ensuredTokensWithId: s.map((n, e) => ({ erc20TokenAddress: s[e], tokenId: c[e] })),
55
55
  allowRemoteDecryption: !1,
56
- useBlockedUtxos: g
56
+ useBlockedUtxos: g,
57
+ chainId: o
57
58
  });
58
- let c = 0;
59
- for (let n = 0; n < e.length; n += 1)
60
- if (u === !1) {
61
- const t = w.get(
62
- B(i.getCurrentChainId(), { erc20TokenAddress: e[n], tokenId: a[n] })
59
+ let d = 0;
60
+ for (let n = 0; n < s.length; n += 1)
61
+ if (k === !1) {
62
+ const e = w.get(
63
+ C(o, { erc20TokenAddress: s[n], tokenId: c[n] })
63
64
  ) ?? [];
64
- if (!t)
65
+ if (!e)
65
66
  throw new Error("Missing utxos for token");
66
- c = Math.max(t.length, c), r.push(t);
67
+ d = Math.max(e.length, d), a.push(e);
67
68
  } else
68
- r.push([]);
69
- return c === 2 ? r : (r.forEach((n, t) => {
70
- if (n.length > d) {
71
- const o = n.slice(0, d), m = o.reduce((s, f) => s + f.amount, 0n);
72
- if (p[t] < 0n && m < -p[t]) {
73
- const s = U(e[t], i.getCurrentChainId()), f = Number(E(m, s, 2)), T = `Unfortunately your transaction did not go through due to UTXOs limitations.
74
- Please try again with ${s.symbol}`;
75
- throw new S(f, T);
69
+ a.push([]);
70
+ return d === 2 ? a : (a.forEach((n, e) => {
71
+ if (n.length > r) {
72
+ const t = n.slice(0, r), m = t.reduce((i, f) => i + f.amount, 0n);
73
+ if (p[e] < 0n && m < -p[e]) {
74
+ const i = P(s[e], o), f = Number(M(m, i, 2)), x = `Unfortunately your transaction did not go through due to UTXOs limitations.
75
+ Please try again with ${i.symbol}`;
76
+ throw new S(f, x);
76
77
  }
77
- l.push(o);
78
- } else if (n.length <= d) {
79
- const o = [...n];
80
- let m = d - n.length;
78
+ u.push(t);
79
+ } else if (n.length <= r) {
80
+ const t = [...n];
81
+ let m = r - n.length;
81
82
  for (; m > 0; ) {
82
83
  m -= 1;
83
- const s = R(i.getCurrentChainId()), f = s ? e[t] : void 0, T = s ? I(e[t]).compressedAddress : e[t];
84
- o.push(
85
- new P({
84
+ const i = K(o), f = i ? s[e] : void 0, x = i ? W(s[e]).compressedAddress : s[e];
85
+ t.push(
86
+ new E({
86
87
  amount: 0n,
87
- erc20TokenAddress: T,
88
+ erc20TokenAddress: x,
88
89
  mintAddress: f,
89
- shieldedPrivateKey: k.getShieldedPrivateKey(),
90
- tokenId: a[t]
90
+ shieldedPrivateKey: T.getShieldedPrivateKey(),
91
+ tokenId: c[e]
91
92
  })
92
93
  );
93
94
  }
94
- l.push(o);
95
+ u.push(t);
95
96
  }
96
- }), l);
97
+ }), u);
97
98
  };
98
99
  export {
99
- H as addPaddingToUtxos,
100
- G as getShieldedBalance
100
+ Q as addPaddingToUtxos,
101
+ J as getShieldedBalance
101
102
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../constants/token-data/index.cjs");const c=require("../../../constants/chains.constants.cjs");require("../../../constants/contracts.constants.cjs");require("../../../constants/kyc.constants.cjs");require("../../../constants/server.constants.cjs");require("../../../constants/vite.constants.cjs");require("../../../constants/coingecko.constants.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../../constants/addresses.constants.cjs");require("../../../constants/token.limits.constants.cjs");require("../../../constants/presale.constants.cjs");require("../../../constants/activity.constants.cjs");require("../../../constants/tasks.constants.cjs");require("../../../constants/events.constants.cjs");const a=require("ethers");require("idb-keyval");const q=require("../../utils/create-provider.cjs");require("../../../error-handling/error-codes.constants.cjs");require("../../utils/convertIntegrationProviderToExternalActionId.cjs");require("../../../types/circom-data.types.cjs");require("../../../types/transactions.types.cjs");require("../../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");require("../../../data-structures/crypto-keys/keys.cjs");require("../../../data-structures/http/HttpClient.cjs");require("axios");require("../../../API/getServerURL.cjs");require("libsodium-wrappers");require("process");require("buffer");require("../../../constants/save-depths.cjs");require("../../utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("@solana/web3.js");require("@solana/spl-token");require("../../utils/userAgent.cjs");require("multiformats");require("../../../API/tenderly.api.cjs");const l=(o,n)=>{const u=new a.ethers.utils.Interface(n);try{const e=u.parseLog(o);return{name:e.name,args:e.args}}catch{return console.warn("Could not decode log"),null}};async function d(o,n,u,e){try{const t=c.networkRegistry[o].fetchRpcUrl;if(!t)throw new Error("RPC URL not found for the specified chain ID");const r=await q.createCustomRpcProvider(t).getTransactionReceipt(n);if(!r)throw new Error("Transaction receipt not found");if(r.status!==1)throw new Error("Transaction failed");const s=r.logs.filter(i=>i.address.toLowerCase()===u.toLowerCase()).map(i=>l(i,e)).filter(i=>i!==null);return{transactionHash:r.transactionHash,from:r.from,to:r.to,blockNumber:r.blockNumber,events:s}}catch(t){throw console.error("Error retrieving transaction events:",t),t}}exports.getTransactionLogEvents=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../constants/token-data/index.cjs");const c=require("../../../constants/chains.constants.cjs");require("../../../constants/contracts.constants.cjs");require("../../../constants/kyc.constants.cjs");require("../../../constants/server.constants.cjs");require("../../../constants/vite.constants.cjs");require("../../../constants/coingecko.constants.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../../constants/addresses.constants.cjs");require("../../../constants/token.limits.constants.cjs");require("../../../constants/presale.constants.cjs");require("../../../constants/activity.constants.cjs");require("../../../constants/tasks.constants.cjs");require("../../../constants/events.constants.cjs");const a=require("ethers");require("idb-keyval");const q=require("../../utils/create-provider.cjs");require("../../../error-handling/error-codes.constants.cjs");require("../../utils/convertIntegrationProviderToExternalActionId.cjs");require("../../../types/circom-data.types.cjs");require("../../../types/transactions.types.cjs");require("../../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");require("../../../data-structures/crypto-keys/keys.cjs");require("../../../API/getServerURL.cjs");require("../../../data-structures/http/HttpClient.cjs");require("axios");require("@solana/web3.js");require("@coral-xyz/anchor");require("@solana/spl-token");require("../../utils/userAgent.cjs");require("libsodium-wrappers");require("multiformats");require("async-mutex");require("../../../API/tenderly.api.cjs");require("process");require("buffer");require("../../../providers/EthersProviderAdapter.cjs");const l=(o,n)=>{const u=new a.ethers.utils.Interface(n);try{const e=u.parseLog(o);return{name:e.name,args:e.args}}catch{return console.warn("Could not decode log"),null}};async function d(o,n,u,e){try{const t=c.networkRegistry[o].fetchRpcUrl;if(!t)throw new Error("RPC URL not found for the specified chain ID");const r=await q.createCustomRpcProvider(t).getTransactionReceipt(n);if(!r)throw new Error("Transaction receipt not found");if(r.status!==1)throw new Error("Transaction failed");const s=r.logs.filter(i=>i.address.toLowerCase()===u.toLowerCase()).map(i=>l(i,e)).filter(i=>i!==null);return{transactionHash:r.transactionHash,from:r.from,to:r.to,blockNumber:r.blockNumber,events:s}}catch(t){throw console.error("Error retrieving transaction events:",t),t}}exports.getTransactionLogEvents=d;
@@ -22,20 +22,20 @@ import "../../../types/transactions.types.mjs";
22
22
  import "../../../types/activities.types.mjs";
23
23
  import "circomlibjs-hinkal-fork";
24
24
  import "../../../data-structures/crypto-keys/keys.mjs";
25
+ import "../../../API/getServerURL.mjs";
25
26
  import "../../../data-structures/http/HttpClient.mjs";
26
27
  import "axios";
27
- import "../../../API/getServerURL.mjs";
28
- import "libsodium-wrappers";
29
- import "process";
30
- import "buffer";
31
- import "../../../constants/save-depths.mjs";
32
- import "../../utils/mutexes.utils.mjs";
33
- import "@coral-xyz/anchor";
34
28
  import "@solana/web3.js";
29
+ import "@coral-xyz/anchor";
35
30
  import "@solana/spl-token";
36
31
  import "../../utils/userAgent.mjs";
32
+ import "libsodium-wrappers";
37
33
  import "multiformats";
34
+ import "async-mutex";
38
35
  import "../../../API/tenderly.api.mjs";
36
+ import "process";
37
+ import "buffer";
38
+ import "../../../providers/EthersProviderAdapter.mjs";
39
39
  const f = (e, n) => {
40
40
  const p = new a.utils.Interface(n);
41
41
  try {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("ethers");require("idb-keyval");require("../../constants/chains.constants.cjs");require("@solana/web3.js");require("../../data-structures/http/HttpClient.cjs");require("../../constants/vite.constants.cjs");require("../../constants/token-data/index.cjs");require("../../error-handling/error-codes.constants.cjs");require("../utils/convertIntegrationProviderToExternalActionId.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");require("../../data-structures/crypto-keys/keys.cjs");require("../../constants/server.constants.cjs");require("axios");require("../../API/getServerURL.cjs");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/save-depths.cjs");require("../../constants/reorg-depths.constants.cjs");require("../utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("@solana/spl-token");const r=require("../utils/bytes32.utils.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");require("../../constants/presale.constants.cjs");require("../../constants/activity.constants.cjs");require("../../constants/tasks.constants.cjs");require("../../constants/events.constants.cjs");require("../utils/userAgent.cjs");require("multiformats");require("../../API/tenderly.api.cjs");const n=async(i,u)=>{const e=await i.account.merkle.fetch(u,"confirmed"),q=Number(r.convertBytes32ToBigInt(e.rootIndex)),t=e.roots.at(q-1);return o.ethers.BigNumber.from(r.convertBytes32ToBigInt(t).toString())};exports.fetchSolanaMerkleTreeRootHash=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("ethers");require("idb-keyval");require("../../constants/chains.constants.cjs");require("@solana/web3.js");require("../../data-structures/http/HttpClient.cjs");require("../../constants/vite.constants.cjs");require("../../constants/token-data/index.cjs");require("../../error-handling/error-codes.constants.cjs");require("../utils/convertIntegrationProviderToExternalActionId.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");require("../../data-structures/crypto-keys/keys.cjs");require("../../constants/server.constants.cjs");require("../../API/getServerURL.cjs");require("axios");require("@coral-xyz/anchor");require("@solana/spl-token");const r=require("../utils/bytes32.utils.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");require("../../constants/presale.constants.cjs");require("../../constants/activity.constants.cjs");require("../../constants/tasks.constants.cjs");require("../../constants/events.constants.cjs");require("../utils/userAgent.cjs");require("libsodium-wrappers");require("multiformats");require("async-mutex");require("../../API/tenderly.api.cjs");require("process");require("buffer");require("../../providers/EthersProviderAdapter.cjs");const n=async(i,u)=>{const e=await i.account.merkle.fetch(u,"confirmed"),q=Number(r.convertBytes32ToBigInt(e.rootIndex)),t=e.roots.at(q-1);return o.ethers.BigNumber.from(r.convertBytes32ToBigInt(t).toString())};exports.fetchSolanaMerkleTreeRootHash=n;
@@ -13,20 +13,15 @@ import "../../types/activities.types.mjs";
13
13
  import "circomlibjs-hinkal-fork";
14
14
  import "../../data-structures/crypto-keys/keys.mjs";
15
15
  import "../../constants/server.constants.mjs";
16
- import "axios";
17
16
  import "../../API/getServerURL.mjs";
18
- import "libsodium-wrappers";
19
- import "process";
20
- import "buffer";
21
- import "../../constants/save-depths.mjs";
22
- import "../../constants/reorg-depths.constants.mjs";
23
- import "../utils/mutexes.utils.mjs";
17
+ import "axios";
24
18
  import "@coral-xyz/anchor";
25
19
  import "@solana/spl-token";
26
20
  import { convertBytes32ToBigInt as t } from "../utils/bytes32.utils.mjs";
27
21
  import "../../constants/contracts.constants.mjs";
28
22
  import "../../constants/kyc.constants.mjs";
29
23
  import "../../constants/coingecko.constants.mjs";
24
+ import "../../constants/reorg-depths.constants.mjs";
30
25
  import "../../constants/addresses.constants.mjs";
31
26
  import "../../constants/token.limits.constants.mjs";
32
27
  import "../../constants/presale.constants.mjs";
@@ -34,8 +29,13 @@ import "../../constants/activity.constants.mjs";
34
29
  import "../../constants/tasks.constants.mjs";
35
30
  import "../../constants/events.constants.mjs";
36
31
  import "../utils/userAgent.mjs";
32
+ import "libsodium-wrappers";
37
33
  import "multiformats";
34
+ import "async-mutex";
38
35
  import "../../API/tenderly.api.mjs";
36
+ import "process";
37
+ import "buffer";
38
+ import "../../providers/EthersProviderAdapter.mjs";
39
39
  const Q = async (r, m) => {
40
40
  const o = await r.account.merkle.fetch(m, "confirmed"), i = Number(t(o.rootIndex)), p = o.roots.at(i - 1);
41
41
  return e.BigNumber.from(t(p).toString());
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../types/circom-data.types.cjs");const r=require("../../../types/ethereum-network.types.cjs");require("../../../types/transactions.types.cjs");require("../../../types/activities.types.cjs");const a=require("../../../constants/chains.constants.cjs"),l=require("../../pre-transaction/solana.cjs"),g=require("@solana/web3.js"),i=async e=>(await e.getContractWithFetcher(r.ContractType.AccessTokenContract).functions.hasToken(e.userKeys.getAccessKey()))[0],k=async e=>{const{hinkalIdl:c,originalDeployer:n}=a.networkRegistry[e.getCurrentChainId()].contractData;if(!c||!n)throw new Error("missing hinkal data");const o=new g.PublicKey(n),t=e.getSolanaProgram(c),s=l.getAccessTokenAccountPublicKey(BigInt(e.userKeys.getAccessKey()),t.programId,o);if(!await t.provider.connection.getAccountInfo(s))return!1;const{isAdded:u}=await t.account.accesskeyAccount.fetch(s);return u},y=async e=>a.isSolanaLike(e.getCurrentChainId())?k(e):i(e),T=async(e,c,n)=>{const o=e.getContractWithSigner(r.ContractType.AccessTokenContract),t={value:0n,...n&&{type:0}};return await o.addToken(c,t)};exports.checkHinkalAccessToken=y;exports.checkHinkalAccessTokenEVM=i;exports.checkHinkalAccessTokenSolana=k;exports.mintAccessToken=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../types/circom-data.types.cjs");const u=require("../../../types/ethereum-network.types.cjs");require("../../../types/transactions.types.cjs");require("../../../types/activities.types.cjs");const r=require("../../../constants/chains.constants.cjs"),k=require("../../pre-transaction/solana.cjs"),l=require("@solana/web3.js"),g=async(e,c)=>(await e.getContractWithFetcher(c,u.ContractType.AccessTokenContract).functions.hasToken(e.userKeys.getAccessKey()))[0],y=async(e,c)=>{const{hinkalIdl:n,originalDeployer:t}=r.networkRegistry[c].contractData;if(!n||!t)throw new Error("missing hinkal data");const a=new l.PublicKey(t),o=e.getSolanaProgram(n),s=k.getAccessTokenAccountPublicKey(BigInt(e.userKeys.getAccessKey()),o.programId,a);if(!await o.provider.connection.getAccountInfo(s))return!1;const{isAdded:i}=await o.account.accesskeyAccount.fetch(s);return i},A=async(e,c)=>r.isSolanaLike(c)?y(e,c):g(e,c);exports.checkHinkalAccessToken=A;
@@ -1,7 +1,2 @@
1
- import { ethers } from 'ethers';
2
1
  import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
3
- import { SignatureData } from '../../../types';
4
- export declare const checkHinkalAccessTokenEVM: (hinkal: IHinkal) => Promise<any>;
5
- export declare const checkHinkalAccessTokenSolana: (hinkal: IHinkal) => Promise<any>;
6
- export declare const checkHinkalAccessToken: (hinkal: IHinkal) => Promise<any>;
7
- export declare const mintAccessToken: (hinkal: IHinkal, signatureData: SignatureData, fromWallet?: boolean) => Promise<ethers.ContractTransaction>;
2
+ export declare const checkHinkalAccessToken: (hinkal: IHinkal, chainId: number) => Promise<any>;
@@ -1,33 +1,24 @@
1
1
  import "../../../types/circom-data.types.mjs";
2
- import { ContractType as r } from "../../../types/ethereum-network.types.mjs";
2
+ import { ContractType as i } from "../../../types/ethereum-network.types.mjs";
3
3
  import "../../../types/transactions.types.mjs";
4
4
  import "../../../types/activities.types.mjs";
5
- import { networkRegistry as i, isSolanaLike as g } from "../../../constants/chains.constants.mjs";
6
- import { getAccessTokenAccountPublicKey as k } from "../../pre-transaction/solana.mjs";
5
+ import { isSolanaLike as k, networkRegistry as g } from "../../../constants/chains.constants.mjs";
6
+ import { getAccessTokenAccountPublicKey as l } from "../../pre-transaction/solana.mjs";
7
7
  import { PublicKey as u } from "@solana/web3.js";
8
- const y = async (c) => (await c.getContractWithFetcher(r.AccessTokenContract).functions.hasToken(c.userKeys.getAccessKey()))[0], m = async (c) => {
9
- const { hinkalIdl: t, originalDeployer: e } = i[c.getCurrentChainId()].contractData;
10
- if (!t || !e)
8
+ const m = async (c, o) => (await c.getContractWithFetcher(o, i.AccessTokenContract).functions.hasToken(c.userKeys.getAccessKey()))[0], y = async (c, o) => {
9
+ const { hinkalIdl: e, originalDeployer: t } = g[o].contractData;
10
+ if (!e || !t)
11
11
  throw new Error("missing hinkal data");
12
- const o = new u(e), n = c.getSolanaProgram(t), s = k(
12
+ const s = new u(t), n = c.getSolanaProgram(e), r = l(
13
13
  BigInt(c.userKeys.getAccessKey()),
14
14
  n.programId,
15
- o
15
+ s
16
16
  );
17
- if (!await n.provider.connection.getAccountInfo(s))
17
+ if (!await n.provider.connection.getAccountInfo(r))
18
18
  return !1;
19
- const { isAdded: a } = await n.account.accesskeyAccount.fetch(s);
19
+ const { isAdded: a } = await n.account.accesskeyAccount.fetch(r);
20
20
  return a;
21
- }, w = async (c) => g(c.getCurrentChainId()) ? m(c) : y(c), I = async (c, t, e) => {
22
- const o = c.getContractWithSigner(r.AccessTokenContract), n = {
23
- value: 0n,
24
- ...e && { type: 0 }
25
- };
26
- return await o.addToken(t, n);
27
- };
21
+ }, D = async (c, o) => k(o) ? y(c, o) : m(c, o);
28
22
  export {
29
- w as checkHinkalAccessToken,
30
- y as checkHinkalAccessTokenEVM,
31
- m as checkHinkalAccessTokenSolana,
32
- I as mintAccessToken
23
+ D as checkHinkalAccessToken
33
24
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("ethers"),u=require("../../../constants/chains.constants.cjs"),A=require("../../../constants/protocol.constants.cjs"),d=require("../../../types/token.types.cjs"),l=require("../../../types/ethereum-network.types.cjs"),b=require("./recoverTransactionFromError.cjs"),x=async(e,n,s)=>BigInt(await s.allowance(await s.signer.getAddress(),n.address))>=e,F=async(e,n,s,r)=>{if(u.getNonLocalhostChainId(e.getCurrentChainId())!==u.chainIds.ethMainnet||s.symbol.toLowerCase()!=="usdt"||BigInt(await r.allowance(await r.signer.getAddress(),n.address))===0n)return;const o=await r.approve(n.address,0n);o&&"hash"in o&&await e.waitForTransaction(o.hash)},q=async(e,n,s,r)=>{const c=e.getContractWithSigner(l.ContractType.ERC20Contract,r.erc20TokenAddress),o=r.approvalType??d.ApprovalType.Classic;if(o===d.ApprovalType.Classic||!e.isPermitterAvailable()){if(await x(s,n,c))return;await F(e,n,r,c);const f=e.getCurrentChainId()===u.chainIds.base?2:1;try{const i=await c.approve(n.address,s);i&&"hash"in i&&await e.waitForTransaction(i.hash,f)}catch(i){if(!i?.transactionHash)throw i;const{provider:I}=c;if(!await b.recoverTransactionFromError(I,i.transactionHash,f))throw i}return}const p=await e.getEthereumAddress(),C=e.getContract(l.ContractType.PermitterContract),g=await e.getContractWithFetcher(l.ContractType.ContractWithNonces,r.erc20TokenAddress).nonces(p),y=BigInt(Date.now()+A.permitSignatureValidFor)/1000n,t={owner:p,holder:p,spender:C.address,value:s,nonce:g,deadline:y,expiry:y,allowed:!0},{v:w,r:h,s:m}=a.ethers.utils.splitSignature(await e.signTypedData({name:await c.name(),chainId:e.getCurrentChainId(),version:"1",verifyingContract:r.erc20TokenAddress},{Permit:o===d.ApprovalType.ERC20Permit?[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]:[{name:"holder",type:"address"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"expiry",type:"uint256"},{name:"allowed",type:"bool"}]},t));if(o===d.ApprovalType.ERC20Permit){const v=new a.ethers.utils.Interface(["function permit(address owner,address spender,uint256 value,uint256 deadline,uint8 v,bytes32 r,bytes32 s) external"]);return a.ethers.utils.arrayify(v.encodeFunctionData("permit",[t.owner,t.spender,t.value,t.deadline,w,a.ethers.utils.arrayify(h),a.ethers.utils.arrayify(m)])).slice(4)}const T=new a.ethers.utils.Interface(["function permit(address holder,address spender,uint256 nonce,uint256 expiry,bool allowed,uint8 v,bytes32 r,bytes32 s) external"]);return a.ethers.utils.arrayify(T.encodeFunctionData("permit",[t.holder,t.spender,t.nonce,t.expiry,t.allowed,w,a.ethers.utils.arrayify(h),a.ethers.utils.arrayify(m)])).slice(4)};exports.approveTokenToHinkal=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("ethers"),u=require("../../../constants/chains.constants.cjs"),x=require("../../../constants/protocol.constants.cjs"),p=require("../../../types/token.types.cjs"),y=require("../../../types/ethereum-network.types.cjs"),F=require("./recoverTransactionFromError.cjs"),q=async(e,r,a)=>BigInt(await a.allowance(await a.signer.getAddress(),r.address))>=e,E=async(e,r,a,c,n)=>{if(u.getNonLocalhostChainId(r)!==u.chainIds.ethMainnet||c.symbol.toLowerCase()!=="usdt"||BigInt(await n.allowance(await n.signer.getAddress(),a.address))===0n)return;const i=await n.approve(a.address,0n);i&&"hash"in i&&await e.waitForTransaction(r,i.hash)},P=async(e,r,a,c,n)=>{const d=e.getContractWithSigner(r,y.ContractType.ERC20Contract,n.erc20TokenAddress),i=n.approvalType??p.ApprovalType.Classic;if(i===p.ApprovalType.Classic||!e.isPermitterAvailable()){if(await q(c,a,d))return;await E(e,r,a,n,d);const T=r===u.chainIds.base?2:1;try{const o=await d.approve(a.address,c);o&&"hash"in o&&await e.waitForTransaction(r,o.hash,T)}catch(o){if(!o?.transactionHash)throw o;const{provider:b}=d;if(!await F.recoverTransactionFromError(b,o.transactionHash,T))throw o}return}const l=await e.getEthereumAddress(),g=e.getContract(r,y.ContractType.PermitterContract),C=await e.getContractWithFetcher(r,y.ContractType.ContractWithNonces,n.erc20TokenAddress).nonces(l),w=BigInt(Date.now()+x.permitSignatureValidFor)/1000n,t={owner:l,holder:l,spender:g.address,value:c,nonce:C,deadline:w,expiry:w,allowed:!0},{v:m,r:v,s:f}=s.ethers.utils.splitSignature(await e.signTypedData({name:await d.name(),chainId:r,version:"1",verifyingContract:n.erc20TokenAddress},{Permit:i===p.ApprovalType.ERC20Permit?[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]:[{name:"holder",type:"address"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"expiry",type:"uint256"},{name:"allowed",type:"bool"}]},t));if(i===p.ApprovalType.ERC20Permit){const h=new s.ethers.utils.Interface(["function permit(address owner,address spender,uint256 value,uint256 deadline,uint8 v,bytes32 r,bytes32 s) external"]);return s.ethers.utils.arrayify(h.encodeFunctionData("permit",[t.owner,t.spender,t.value,t.deadline,m,s.ethers.utils.arrayify(v),s.ethers.utils.arrayify(f)])).slice(4)}const A=new s.ethers.utils.Interface(["function permit(address holder,address spender,uint256 nonce,uint256 expiry,bool allowed,uint8 v,bytes32 r,bytes32 s) external"]);return s.ethers.utils.arrayify(A.encodeFunctionData("permit",[t.holder,t.spender,t.nonce,t.expiry,t.allowed,m,s.ethers.utils.arrayify(v),s.ethers.utils.arrayify(f)])).slice(4)};exports.approveTokenToHinkal=P;
@@ -1,4 +1,4 @@
1
1
  import { ethers } from 'ethers';
2
2
  import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
3
3
  import { ERC20Token } from '../../../types/token.types';
4
- export declare const approveTokenToHinkal: (hinkal: IHinkal, contractToApprove: ethers.Contract, amount: bigint, token: ERC20Token) => Promise<Uint8Array | undefined>;
4
+ export declare const approveTokenToHinkal: (hinkal: IHinkal, chainId: number, contractToApprove: ethers.Contract, amount: bigint, token: ERC20Token) => Promise<Uint8Array | undefined>;
@@ -1,60 +1,64 @@
1
- import { ethers as a } from "ethers";
2
- import { chainIds as C, getNonLocalhostChainId as x } from "../../../constants/chains.constants.mjs";
3
- import { permitSignatureValidFor as A } from "../../../constants/protocol.constants.mjs";
4
- import { ApprovalType as c } from "../../../types/token.types.mjs";
5
- import { ContractType as l } from "../../../types/ethereum-network.types.mjs";
6
- import { recoverTransactionFromError as b } from "./recoverTransactionFromError.mjs";
7
- const F = async (e, n, s) => BigInt(
8
- await s.allowance(await s.signer.getAddress(), n.address)
9
- ) >= e, E = async (e, n, s, r) => {
10
- if (x(e.getCurrentChainId()) !== C.ethMainnet || s.symbol.toLowerCase() !== "usdt" || BigInt(
11
- await r.allowance(await r.signer.getAddress(), n.address)
1
+ import { ethers as s } from "ethers";
2
+ import { chainIds as C, getNonLocalhostChainId as b } from "../../../constants/chains.constants.mjs";
3
+ import { permitSignatureValidFor as F } from "../../../constants/protocol.constants.mjs";
4
+ import { ApprovalType as l } from "../../../types/token.types.mjs";
5
+ import { ContractType as y } from "../../../types/ethereum-network.types.mjs";
6
+ import { recoverTransactionFromError as E } from "./recoverTransactionFromError.mjs";
7
+ const P = async (e, r, a) => BigInt(
8
+ await a.allowance(await a.signer.getAddress(), r.address)
9
+ ) >= e, D = async (e, r, a, c, n) => {
10
+ if (b(r) !== C.ethMainnet || c.symbol.toLowerCase() !== "usdt" || BigInt(
11
+ await n.allowance(await n.signer.getAddress(), a.address)
12
12
  ) === 0n)
13
13
  return;
14
- const o = await r.approve(n.address, 0n);
15
- o && "hash" in o && await e.waitForTransaction(o.hash);
16
- }, L = async (e, n, s, r) => {
17
- const d = e.getContractWithSigner(l.ERC20Contract, r.erc20TokenAddress), o = r.approvalType ?? c.Classic;
18
- if (o === c.Classic || !e.isPermitterAvailable()) {
19
- if (await F(s, n, d))
14
+ const o = await n.approve(a.address, 0n);
15
+ o && "hash" in o && await e.waitForTransaction(r, o.hash);
16
+ }, M = async (e, r, a, c, n) => {
17
+ const d = e.getContractWithSigner(r, y.ERC20Contract, n.erc20TokenAddress), o = n.approvalType ?? l.Classic;
18
+ if (o === l.Classic || !e.isPermitterAvailable()) {
19
+ if (await P(c, a, d))
20
20
  return;
21
- await E(e, n, r, d);
22
- const v = e.getCurrentChainId() === C.base ? 2 : 1;
21
+ await D(e, r, a, n, d);
22
+ const g = r === C.base ? 2 : 1;
23
23
  try {
24
24
  const i = await d.approve(
25
- n.address,
26
- s
25
+ a.address,
26
+ c
27
27
  // { gasLimit: 10000000 }
28
28
  );
29
- i && "hash" in i && await e.waitForTransaction(i.hash, v);
29
+ i && "hash" in i && await e.waitForTransaction(r, i.hash, g);
30
30
  } catch (i) {
31
31
  if (!i?.transactionHash)
32
32
  throw i;
33
- const { provider: T } = d;
34
- if (!await b(T, i.transactionHash, v))
33
+ const { provider: A } = d;
34
+ if (!await E(A, i.transactionHash, g))
35
35
  throw i;
36
36
  }
37
37
  return;
38
38
  }
39
- const p = await e.getEthereumAddress(), g = e.getContract(l.PermitterContract), h = await e.getContractWithFetcher(l.ContractWithNonces, r.erc20TokenAddress).nonces(p), u = BigInt(Date.now() + A) / 1000n, t = {
39
+ const p = await e.getEthereumAddress(), h = e.getContract(r, y.PermitterContract), T = await e.getContractWithFetcher(
40
+ r,
41
+ y.ContractWithNonces,
42
+ n.erc20TokenAddress
43
+ ).nonces(p), u = BigInt(Date.now() + F) / 1000n, t = {
40
44
  owner: p,
41
45
  holder: p,
42
- spender: g.address,
43
- value: s,
44
- nonce: h,
46
+ spender: h.address,
47
+ value: c,
48
+ nonce: T,
45
49
  deadline: u,
46
50
  expiry: u,
47
51
  allowed: !0
48
- }, { v: y, r: m, s: w } = a.utils.splitSignature(
52
+ }, { v: m, r: w, s: f } = s.utils.splitSignature(
49
53
  await e.signTypedData(
50
54
  {
51
55
  name: await d.name(),
52
- chainId: e.getCurrentChainId(),
56
+ chainId: r,
53
57
  version: "1",
54
- verifyingContract: r.erc20TokenAddress
58
+ verifyingContract: n.erc20TokenAddress
55
59
  },
56
60
  {
57
- Permit: o === c.ERC20Permit ? [
61
+ Permit: o === l.ERC20Permit ? [
58
62
  {
59
63
  name: "owner",
60
64
  type: "address"
@@ -101,38 +105,38 @@ const F = async (e, n, s) => BigInt(
101
105
  t
102
106
  )
103
107
  );
104
- if (o === c.ERC20Permit) {
105
- const f = new a.utils.Interface([
108
+ if (o === l.ERC20Permit) {
109
+ const v = new s.utils.Interface([
106
110
  "function permit(address owner,address spender,uint256 value,uint256 deadline,uint8 v,bytes32 r,bytes32 s) external"
107
111
  ]);
108
- return a.utils.arrayify(
109
- f.encodeFunctionData("permit", [
112
+ return s.utils.arrayify(
113
+ v.encodeFunctionData("permit", [
110
114
  t.owner,
111
115
  t.spender,
112
116
  t.value,
113
117
  t.deadline,
114
- y,
115
- a.utils.arrayify(m),
116
- a.utils.arrayify(w)
118
+ m,
119
+ s.utils.arrayify(w),
120
+ s.utils.arrayify(f)
117
121
  ])
118
122
  ).slice(4);
119
123
  }
120
- const I = new a.utils.Interface([
124
+ const x = new s.utils.Interface([
121
125
  "function permit(address holder,address spender,uint256 nonce,uint256 expiry,bool allowed,uint8 v,bytes32 r,bytes32 s) external"
122
126
  ]);
123
- return a.utils.arrayify(
124
- I.encodeFunctionData("permit", [
127
+ return s.utils.arrayify(
128
+ x.encodeFunctionData("permit", [
125
129
  t.holder,
126
130
  t.spender,
127
131
  t.nonce,
128
132
  t.expiry,
129
133
  t.allowed,
130
- y,
131
- a.utils.arrayify(m),
132
- a.utils.arrayify(w)
134
+ m,
135
+ s.utils.arrayify(w),
136
+ s.utils.arrayify(f)
133
137
  ])
134
138
  ).slice(4);
135
139
  };
136
140
  export {
137
- L as approveTokenToHinkal
141
+ M as approveTokenToHinkal
138
142
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../constants/protocol.constants.cjs"),i=require("./approveToken.cjs"),p=async(t,s,c,o)=>{for(let e=0;e<o.length;e+=1){const n=o[e],r=c[e];n>0n&&r.erc20TokenAddress!==a.zeroAddress&&await i.approveTokenToHinkal(t,s,n,r)}};exports.approveTokensToHinkal=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../constants/protocol.constants.cjs"),p=require("./approveToken.cjs"),T=async(t,s,c,a,o)=>{for(let e=0;e<o.length;e+=1){const n=o[e],r=a[e];n>0n&&r.erc20TokenAddress!==i.zeroAddress&&await p.approveTokenToHinkal(t,s,c,n,r)}};exports.approveTokensToHinkal=T;
@@ -1,4 +1,4 @@
1
1
  import { ethers } from 'ethers';
2
2
  import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
3
3
  import { ERC20Token } from '../../../types/token.types';
4
- export declare const approveTokensToHinkal: (hinkal: IHinkal, contractForApproval: ethers.Contract, tokensToApprove: ERC20Token[], amounts: bigint[]) => Promise<void>;
4
+ export declare const approveTokensToHinkal: (hinkal: IHinkal, chainId: number, contractForApproval: ethers.Contract, tokensToApprove: ERC20Token[], amounts: bigint[]) => Promise<void>;
@@ -1,11 +1,11 @@
1
- import { zeroAddress as i } from "../../../constants/protocol.constants.mjs";
2
- import { approveTokenToHinkal as p } from "./approveToken.mjs";
3
- const T = async (t, s, c, r) => {
1
+ import { zeroAddress as p } from "../../../constants/protocol.constants.mjs";
2
+ import { approveTokenToHinkal as a } from "./approveToken.mjs";
3
+ const d = async (t, s, c, i, r) => {
4
4
  for (let o = 0; o < r.length; o += 1) {
5
- const e = r[o], n = c[o];
6
- e > 0n && n.erc20TokenAddress !== i && await p(t, s, e, n);
5
+ const e = r[o], n = i[o];
6
+ e > 0n && n.erc20TokenAddress !== p && await a(t, s, c, e, n);
7
7
  }
8
8
  };
9
9
  export {
10
- T as approveTokensToHinkal
10
+ d as approveTokensToHinkal
11
11
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("ethers-v6h"),g=require("../../private-wallet/emporium.helpers.cjs"),i=require("../../../constants/chains.constants.cjs"),m=async(r,t,c,s,n)=>{const{hinkalAddress:h,hinkalABI:u}=i.networkRegistry[r.getCurrentChainId()].contractData,d=new a.ethers.JsonRpcProvider(i.networkRegistry[r.getCurrentChainId()].fetchRpcUrl),l=new a.ethers.Contract(h,u,d),y="transact";let e={from:s.relay};if(n){const o=g.recoverAuthorizationData(n);o&&(e={...e,authorizationList:[o],type:4})}return await l[y].estimateGas(t[0],t[1],t[2],c,s,e)};exports.estimateGasRelayer=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("ethers-v6h"),p=require("../../private-wallet/emporium.helpers.cjs"),i=require("../../../constants/chains.constants.cjs"),d=async(r,t,c,s,o)=>{const{hinkalAddress:h,hinkalABI:u}=i.networkRegistry[r].contractData,l=new a.ethers.JsonRpcProvider(i.networkRegistry[r].fetchRpcUrl),y=new a.ethers.Contract(h,u,l),m="transact";let e={from:s.relay};if(o){const n=p.recoverAuthorizationData(o);n&&(e={...e,authorizationList:[n],type:4})}return await y[m].estimateGas(t[0],t[1],t[2],c,s,e)};exports.estimateGasRelayer=d;
@@ -1,5 +1,4 @@
1
- import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
2
1
  import { CircomDataBaseType, DimDataType } from '../../../types/circom-data.types';
3
2
  import { NewZkCallDataType } from '../../../types/snark.types';
4
3
  import { type AuthorizationData } from '../../../types/hinkal.types';
5
- export declare const estimateGasRelayer: (hinkal: IHinkal, newZkCallData: NewZkCallDataType, dimData: DimDataType, circomData: CircomDataBaseType, authorizationData?: AuthorizationData) => Promise<bigint>;
4
+ export declare const estimateGasRelayer: (chainId: number, newZkCallData: NewZkCallDataType, dimData: DimDataType, circomData: CircomDataBaseType, authorizationData?: AuthorizationData) => Promise<bigint>;
@@ -1,22 +1,22 @@
1
- import { ethers as a } from "ethers-v6h";
2
- import { recoverAuthorizationData as u } from "../../private-wallet/emporium.helpers.mjs";
1
+ import { ethers as n } from "ethers-v6h";
2
+ import { recoverAuthorizationData as y } from "../../private-wallet/emporium.helpers.mjs";
3
3
  import { networkRegistry as i } from "../../../constants/chains.constants.mjs";
4
- const C = async (e, t, c, o, s) => {
5
- const { hinkalAddress: m, hinkalABI: h } = i[e.getCurrentChainId()].contractData, p = new a.JsonRpcProvider(i[e.getCurrentChainId()].fetchRpcUrl), d = new a.Contract(m, h, p), f = "transact";
6
- let r = { from: o.relay };
4
+ const g = async (o, t, c, e, s) => {
5
+ const { hinkalAddress: m, hinkalABI: p } = i[o].contractData, f = new n.JsonRpcProvider(i[o].fetchRpcUrl), h = new n.Contract(m, p, f), l = "transact";
6
+ let r = { from: e.relay };
7
7
  if (s) {
8
- const n = u(s);
9
- n && (r = { ...r, authorizationList: [n], type: 4 });
8
+ const a = y(s);
9
+ a && (r = { ...r, authorizationList: [a], type: 4 });
10
10
  }
11
- return await d[f].estimateGas(
11
+ return await h[l].estimateGas(
12
12
  t[0],
13
13
  t[1],
14
14
  t[2],
15
15
  c,
16
- o,
16
+ e,
17
17
  r
18
18
  );
19
19
  };
20
20
  export {
21
- C as estimateGasRelayer
21
+ g as estimateGasRelayer
22
22
  };