@hinkal/common 0.2.17 → 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 (474) 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/getWebsiteURL.d.ts +1 -1
  43. package/API/index.d.ts +0 -3
  44. package/API/is-tx-stateless.cjs +1 -1
  45. package/API/is-tx-stateless.d.ts +1 -1
  46. package/API/is-tx-stateless.mjs +10 -12
  47. package/API/kycCalls.cjs +1 -1
  48. package/API/kycCalls.d.ts +4 -8
  49. package/API/kycCalls.mjs +23 -26
  50. package/API/onrampCalls.cjs +1 -0
  51. package/API/onrampCalls.d.ts +20 -0
  52. package/API/onrampCalls.mjs +15 -0
  53. package/API/proxyAccountsCalls.cjs +1 -1
  54. package/API/proxyAccountsCalls.d.ts +2 -2
  55. package/API/proxyAccountsCalls.mjs +19 -19
  56. package/API/relayCalls.cjs +1 -1
  57. package/API/relayCalls.mjs +4 -4
  58. package/API/scheduled-transactions-calls.cjs +1 -1
  59. package/API/scheduled-transactions-calls.d.ts +1 -1
  60. package/API/scheduled-transactions-calls.mjs +4 -4
  61. package/API/simulate-batch-tx.cjs +1 -1
  62. package/API/simulate-batch-tx.d.ts +2 -2
  63. package/API/simulate-batch-tx.mjs +7 -6
  64. package/API/solana-calls.cjs +1 -1
  65. package/API/solana-calls.d.ts +6 -3
  66. package/API/solana-calls.mjs +15 -15
  67. package/API/token-calls.cjs +1 -1
  68. package/API/token-calls.mjs +6 -5
  69. package/API/unspent-utxos-calls.cjs +1 -1
  70. package/API/unspent-utxos-calls.d.ts +1 -1
  71. package/API/unspent-utxos-calls.mjs +15 -18
  72. package/README.md +237 -61
  73. package/constants/addresses.constants.cjs +1 -1
  74. package/constants/addresses.constants.d.ts +0 -1
  75. package/constants/addresses.constants.mjs +7 -8
  76. package/constants/chains.constants.cjs +1 -1
  77. package/constants/chains.constants.d.ts +0 -5
  78. package/constants/chains.constants.mjs +21 -26
  79. package/constants/coingecko.constants.cjs +1 -1
  80. package/constants/coingecko.constants.d.ts +1 -0
  81. package/constants/coingecko.constants.mjs +11 -10
  82. package/constants/contracts.constants.cjs +1 -1
  83. package/constants/contracts.constants.mjs +34 -41
  84. package/constants/function-signatures.constants.cjs +1 -1
  85. package/constants/function-signatures.constants.d.ts +0 -1
  86. package/constants/function-signatures.constants.mjs +3 -4
  87. package/constants/mediaUrls.constants.cjs +1 -1
  88. package/constants/mediaUrls.constants.d.ts +2 -0
  89. package/constants/mediaUrls.constants.mjs +3 -1
  90. package/constants/mystery-boxes.constants.d.ts +0 -0
  91. package/constants/permit2.constants.cjs +1 -1
  92. package/constants/permit2.constants.d.ts +0 -1
  93. package/constants/permit2.constants.mjs +10 -11
  94. package/constants/server.constants.cjs +1 -1
  95. package/constants/server.constants.d.ts +14 -122
  96. package/constants/server.constants.mjs +44 -152
  97. package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
  98. package/constants/token-data/ethMainnetRegistry.json.mjs +0 -24
  99. package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
  100. package/constants/token-data/ethMainnetRegistryFixed.json.mjs +0 -24
  101. package/constants/token-data/index.d.ts +32 -88
  102. package/constants/token-data/localhostRegistry.json.cjs +1 -1
  103. package/constants/token-data/localhostRegistry.json.mjs +0 -26
  104. package/constants/token-data/popularTokens.constants.cjs +1 -1
  105. package/constants/token-data/popularTokens.constants.mjs +0 -1
  106. package/constants/vite.constants.cjs +1 -1
  107. package/constants/vite.constants.mjs +36 -13
  108. package/data-structures/Hinkal/Hinkal.cjs +1 -1
  109. package/data-structures/Hinkal/Hinkal.d.ts +34 -49
  110. package/data-structures/Hinkal/Hinkal.mjs +238 -301
  111. package/data-structures/Hinkal/IHinkal.d.ts +33 -48
  112. package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
  113. package/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
  114. package/data-structures/Hinkal/handleAutoDepositBack.mjs +42 -42
  115. package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
  116. package/data-structures/Hinkal/hinkalActionReceive.mjs +25 -23
  117. package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
  118. package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +9 -9
  119. package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
  120. package/data-structures/Hinkal/hinkalDeposit.mjs +95 -93
  121. package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
  122. package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +147 -133
  123. package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
  124. package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +1 -2
  125. package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  126. package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +1 -1
  127. package/data-structures/Hinkal/hinkalPrivateWallet.mjs +107 -115
  128. package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
  129. package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +36 -34
  130. package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
  131. package/data-structures/Hinkal/hinkalProxySwap.mjs +34 -33
  132. package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
  133. package/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +1 -1
  134. package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +26 -24
  135. package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
  136. package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +1 -2
  137. package/data-structures/Hinkal/hinkalSignSubAccount.mjs +8 -9
  138. package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
  139. package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -3
  140. package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +86 -97
  141. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  142. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +2 -1
  143. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +146 -146
  144. package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
  145. package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +2 -3
  146. package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +38 -38
  147. package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
  148. package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +57 -56
  149. package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
  150. package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +1 -1
  151. package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +59 -58
  152. package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
  153. package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +1 -1
  154. package/data-structures/Hinkal/hinkalSolanaSwap.mjs +83 -79
  155. package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
  156. package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +1 -1
  157. package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +49 -48
  158. package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
  159. package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +2 -1
  160. package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +67 -64
  161. package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
  162. package/data-structures/Hinkal/hinkalSwap.d.ts +1 -1
  163. package/data-structures/Hinkal/hinkalSwap.mjs +75 -87
  164. package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
  165. package/data-structures/Hinkal/hinkalTransfer.d.ts +1 -1
  166. package/data-structures/Hinkal/hinkalTransfer.mjs +55 -58
  167. package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  168. package/data-structures/Hinkal/hinkalWithdraw.mjs +80 -82
  169. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  170. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.d.ts +2 -2
  171. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +87 -90
  172. package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  173. package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
  174. package/data-structures/Hinkal/resetMerkleTrees.mjs +105 -53
  175. package/data-structures/IndexedDB/activity-db.cjs +1 -1
  176. package/data-structures/IndexedDB/activity-db.mjs +7 -7
  177. package/data-structures/IndexedDB/balances-db.cjs +1 -1
  178. package/data-structures/IndexedDB/balances-db.mjs +8 -8
  179. package/data-structures/IndexedDB/contact-db.cjs +1 -1
  180. package/data-structures/IndexedDB/contact-db.mjs +10 -10
  181. package/data-structures/IndexedDB/signatures-db.cjs +1 -1
  182. package/data-structures/IndexedDB/signatures-db.mjs +25 -40
  183. package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
  184. package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +10 -11
  185. package/data-structures/TokenDBs/token-visibility-db.cjs +1 -1
  186. package/data-structures/TokenDBs/token-visibility-db.mjs +22 -36
  187. package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
  188. package/data-structures/crypto-keys/encryptDecryptUtxo.d.ts +1 -1
  189. package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +14 -14
  190. package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
  191. package/data-structures/event-service/evm/AbstractEventService.d.ts +1 -0
  192. package/data-structures/event-service/evm/AbstractEventService.mjs +7 -4
  193. package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
  194. package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +0 -1
  195. package/data-structures/event-service/evm/AbstractSnapshotService.mjs +3 -4
  196. package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
  197. package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +3 -1
  198. package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +17 -14
  199. package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
  200. package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +1 -0
  201. package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +9 -6
  202. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
  203. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +0 -1
  204. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +1 -2
  205. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
  206. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +3 -2
  207. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +42 -45
  208. package/data-structures/provider-adapter/IProviderAdapter.d.ts +8 -13
  209. package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
  210. package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +3 -4
  211. package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
  212. package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +3 -4
  213. package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
  214. package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +3 -4
  215. package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
  216. package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +3 -4
  217. package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
  218. package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +3 -4
  219. package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
  220. package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +2 -4
  221. package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
  222. package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +3 -4
  223. package/data-structures/utxo/Utxo.cjs +1 -1
  224. package/data-structures/utxo/Utxo.d.ts +1 -7
  225. package/data-structures/utxo/Utxo.mjs +26 -36
  226. package/error-handling/error-codes.constants.cjs +1 -1
  227. package/error-handling/error-codes.constants.d.ts +3 -0
  228. package/error-handling/error-codes.constants.mjs +5 -2
  229. package/error-handling/get-error.message.cjs +1 -1
  230. package/error-handling/get-error.message.mjs +21 -27
  231. package/error-handling/index.d.ts +0 -1
  232. package/functions/index.d.ts +0 -1
  233. package/functions/kyc/zkMeHelper.cjs +1 -1
  234. package/functions/kyc/zkMeHelper.mjs +18 -17
  235. package/functions/pre-transaction/constructAdminData.cjs +1 -1
  236. package/functions/pre-transaction/constructAdminData.d.ts +2 -2
  237. package/functions/pre-transaction/constructAdminData.mjs +12 -18
  238. package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
  239. package/functions/pre-transaction/getExternalSwapAddress.d.ts +1 -2
  240. package/functions/pre-transaction/getExternalSwapAddress.mjs +8 -8
  241. package/functions/pre-transaction/getFlatFees.cjs +1 -1
  242. package/functions/pre-transaction/getFlatFees.mjs +22 -30
  243. package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
  244. package/functions/pre-transaction/getVolatileTransferAmount.mjs +21 -36
  245. package/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
  246. package/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +1 -1
  247. package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +17 -17
  248. package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
  249. package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +1 -9
  250. package/functions/pre-transaction/outputApprovalDataProcessing.mjs +19 -34
  251. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
  252. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +1 -1
  253. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +4 -4
  254. package/functions/pre-transaction/solana-public-signals.cjs +1 -1
  255. package/functions/pre-transaction/solana-public-signals.d.ts +1 -0
  256. package/functions/pre-transaction/solana-public-signals.mjs +29 -26
  257. package/functions/pre-transaction/solana.cjs +1 -1
  258. package/functions/pre-transaction/solana.d.ts +2 -1
  259. package/functions/pre-transaction/solana.mjs +60 -51
  260. package/functions/private-wallet/emporium.helpers.cjs +1 -1
  261. package/functions/private-wallet/emporium.helpers.d.ts +3 -5
  262. package/functions/private-wallet/emporium.helpers.mjs +95 -135
  263. package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
  264. package/functions/private-wallet/emporium.swap.helpers.d.ts +1 -4
  265. package/functions/private-wallet/emporium.swap.helpers.mjs +100 -102
  266. package/functions/snarkjs/common.snarkjs.cjs +1 -1
  267. package/functions/snarkjs/common.snarkjs.d.ts +1 -1
  268. package/functions/snarkjs/common.snarkjs.mjs +64 -64
  269. package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
  270. package/functions/snarkjs/constructEmporiumProof.d.ts +2 -2
  271. package/functions/snarkjs/constructEmporiumProof.mjs +1 -1
  272. package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
  273. package/functions/snarkjs/constructGeneralZkProof.d.ts +2 -3
  274. package/functions/snarkjs/constructGeneralZkProof.mjs +117 -121
  275. package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
  276. package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -1
  277. package/functions/snarkjs/constructSolanaZkProof.mjs +54 -59
  278. package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
  279. package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +11 -10
  280. package/functions/snarkjs/generateCircomData.d.ts +1 -1
  281. package/functions/utils/addresses.cjs +1 -1
  282. package/functions/utils/addresses.d.ts +1 -0
  283. package/functions/utils/addresses.mjs +13 -12
  284. package/functions/utils/cacheFunctions.cjs +1 -1
  285. package/functions/utils/cacheFunctions.mjs +2 -2
  286. package/functions/utils/enum.utils.cjs +1 -0
  287. package/functions/utils/enum.utils.mjs +14 -0
  288. package/functions/utils/erc20tokenFunctions.cjs +1 -1
  289. package/functions/utils/erc20tokenFunctions.d.ts +0 -1
  290. package/functions/utils/erc20tokenFunctions.mjs +22 -29
  291. package/functions/utils/get-hinkal-approvals.cjs +1 -1
  292. package/functions/utils/get-hinkal-approvals.d.ts +1 -1
  293. package/functions/utils/get-hinkal-approvals.mjs +16 -16
  294. package/functions/utils/getDataFromTransaction.d.ts +3 -3
  295. package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
  296. package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
  297. package/functions/utils/getUtxosFromReceipt.utils.mjs +11 -11
  298. package/functions/utils/involves-permit2-op.cjs +1 -1
  299. package/functions/utils/involves-permit2-op.d.ts +0 -1
  300. package/functions/utils/involves-permit2-op.mjs +4 -6
  301. package/functions/utils/mutexes.utils.cjs +1 -1
  302. package/functions/utils/mutexes.utils.d.ts +1 -1
  303. package/functions/utils/mutexes.utils.mjs +3 -3
  304. package/functions/utils/nftTokenFunctions.cjs +1 -1
  305. package/functions/utils/nftTokenFunctions.mjs +8 -23
  306. package/functions/utils/prepareHinkal.cjs +1 -1
  307. package/functions/utils/prepareHinkal.d.ts +0 -6
  308. package/functions/utils/prepareHinkal.mjs +41 -60
  309. package/functions/utils/token-check.utils.cjs +1 -1
  310. package/functions/utils/token-check.utils.d.ts +3 -0
  311. package/functions/utils/token-check.utils.mjs +18 -7
  312. package/functions/utils/upToDateState.cjs +1 -1
  313. package/functions/utils/upToDateState.d.ts +1 -1
  314. package/functions/utils/upToDateState.mjs +4 -4
  315. package/functions/utils/walletBalances.utils.cjs +1 -1
  316. package/functions/utils/walletBalances.utils.d.ts +1 -16
  317. package/functions/utils/walletBalances.utils.mjs +4 -35
  318. package/functions/web3/events/getApprovedBalance.cjs +1 -1
  319. package/functions/web3/events/getApprovedBalance.d.ts +3 -4
  320. package/functions/web3/events/getApprovedBalance.mjs +39 -44
  321. package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  322. package/functions/web3/events/getInputUtxoAndBalance.d.ts +1 -1
  323. package/functions/web3/events/getInputUtxoAndBalance.mjs +114 -121
  324. package/functions/web3/events/getInputUtxosEnclave.d.ts +1 -1
  325. package/functions/web3/events/getShieldedBalance.cjs +2 -2
  326. package/functions/web3/events/getShieldedBalance.d.ts +1 -1
  327. package/functions/web3/events/getShieldedBalance.mjs +71 -70
  328. package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
  329. package/functions/web3/events/getTransactionLogEvents.mjs +7 -7
  330. package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
  331. package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +7 -7
  332. package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
  333. package/functions/web3/functionCalls/accessTokenCalls.d.ts +1 -6
  334. package/functions/web3/functionCalls/accessTokenCalls.mjs +12 -21
  335. package/functions/web3/functionCalls/approveToken.cjs +1 -1
  336. package/functions/web3/functionCalls/approveToken.d.ts +1 -1
  337. package/functions/web3/functionCalls/approveToken.mjs +71 -63
  338. package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -1
  339. package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +1 -1
  340. package/functions/web3/functionCalls/approveTokensToHinkal.mjs +6 -6
  341. package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
  342. package/functions/web3/functionCalls/estimateGasRelayer.d.ts +1 -2
  343. package/functions/web3/functionCalls/estimateGasRelayer.mjs +10 -10
  344. package/functions/web3/functionCalls/recoverTransactionFromError.cjs +1 -0
  345. package/functions/web3/functionCalls/recoverTransactionFromError.d.ts +2 -0
  346. package/functions/web3/functionCalls/recoverTransactionFromError.mjs +23 -0
  347. package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
  348. package/functions/web3/functionCalls/transactCallDirect.d.ts +1 -1
  349. package/functions/web3/functionCalls/transactCallDirect.mjs +45 -36
  350. package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  351. package/functions/web3/functionCalls/transactCallRelayer.d.ts +1 -1
  352. package/functions/web3/functionCalls/transactCallRelayer.mjs +44 -43
  353. package/functions/web3/getPublicAddressBalance.cjs +1 -1
  354. package/functions/web3/getPublicAddressBalance.d.ts +1 -1
  355. package/functions/web3/getPublicAddressBalance.mjs +6 -6
  356. package/functions/web3/getTokenHolder.cjs +1 -1
  357. package/functions/web3/getTokenHolder.mjs +8 -8
  358. package/functions/web3/lifiAPI.cjs +1 -1
  359. package/functions/web3/lifiAPI.d.ts +1 -1
  360. package/functions/web3/lifiAPI.mjs +12 -12
  361. package/functions/web3/odosAPI.cjs +1 -1
  362. package/functions/web3/odosAPI.mjs +6 -19
  363. package/functions/web3/okxAPI.cjs +1 -1
  364. package/functions/web3/okxAPI.mjs +22 -22
  365. package/functions/web3/oneInchAPI.cjs +1 -1
  366. package/functions/web3/oneInchAPI.mjs +7 -20
  367. package/functions/web3/runContractFunction.cjs +1 -1
  368. package/functions/web3/runContractFunction.mjs +38 -56
  369. package/functions/web3/uniswapAPI.cjs +1 -1
  370. package/functions/web3/uniswapAPI.mjs +22 -34
  371. package/index.cjs +1 -1
  372. package/index.mjs +937 -967
  373. package/package.json +2 -2
  374. package/providers/EthersProviderAdapter.cjs +1 -1
  375. package/providers/EthersProviderAdapter.d.ts +10 -17
  376. package/providers/EthersProviderAdapter.mjs +48 -76
  377. package/providers/SolanaProviderAdapter.cjs +1 -1
  378. package/providers/SolanaProviderAdapter.d.ts +7 -11
  379. package/providers/SolanaProviderAdapter.mjs +16 -31
  380. package/providers/WagmiProviderAdapter.cjs +1 -1
  381. package/providers/WagmiProviderAdapter.d.ts +11 -17
  382. package/providers/WagmiProviderAdapter.mjs +86 -117
  383. package/providers/prepareEthersHinkal.cjs +1 -1
  384. package/providers/prepareEthersHinkal.mjs +6 -7
  385. package/providers/prepareWagmiHinkal.cjs +1 -1
  386. package/providers/prepareWagmiHinkal.mjs +5 -5
  387. package/types/TransactionSimulator.types.d.ts +2 -9
  388. package/types/admin.types.cjs +1 -1
  389. package/types/admin.types.d.ts +3 -7
  390. package/types/admin.types.mjs +2 -2
  391. package/types/balances.types.d.ts +0 -1
  392. package/types/cache.types.cjs +1 -1
  393. package/types/cache.types.d.ts +2 -3
  394. package/types/cache.types.mjs +1 -1
  395. package/types/coingecko.types.d.ts +5 -0
  396. package/types/ethereum-network.types.cjs +1 -1
  397. package/types/ethereum-network.types.d.ts +1 -8
  398. package/types/ethereum-network.types.mjs +1 -1
  399. package/types/external-action.types.cjs +1 -1
  400. package/types/external-action.types.d.ts +0 -1
  401. package/types/external-action.types.mjs +1 -1
  402. package/types/hinkal.types.cjs +1 -1
  403. package/types/hinkal.types.d.ts +1 -7
  404. package/types/hinkal.types.mjs +22 -23
  405. package/types/index.d.ts +1 -3
  406. package/types/onramp.types.cjs +1 -0
  407. package/types/onramp.types.d.ts +58 -0
  408. package/types/onramp.types.mjs +4 -0
  409. package/types/proxy.types.d.ts +1 -0
  410. package/types/sandbox.types.cjs +1 -1
  411. package/types/sandbox.types.d.ts +8 -39
  412. package/types/sandbox.types.mjs +2 -2
  413. package/types/session.types.d.ts +2 -0
  414. package/types/solana.types.d.ts +3 -0
  415. package/types/token-prices.types.cjs +1 -1
  416. package/types/token-prices.types.d.ts +7 -0
  417. package/types/token-prices.types.mjs +4 -2
  418. package/types/transactions.types.cjs +1 -1
  419. package/types/transactions.types.d.ts +6 -4
  420. package/types/transactions.types.mjs +4 -3
  421. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
  422. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
  423. package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
  424. package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
  425. package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
  426. package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
  427. package/API/ai-calls.cjs +0 -1
  428. package/API/ai-calls.d.ts +0 -17
  429. package/API/ai-calls.mjs +0 -21
  430. package/API/duneAPI.cjs +0 -1
  431. package/API/duneAPI.d.ts +0 -11
  432. package/API/duneAPI.mjs +0 -25
  433. package/API/getBridgeProtocols.cjs +0 -1
  434. package/API/getBridgeProtocols.d.ts +0 -7
  435. package/API/getBridgeProtocols.mjs +0 -8
  436. package/API/getLifiStatus.cjs +0 -1
  437. package/API/getLifiStatus.d.ts +0 -24
  438. package/API/getLifiStatus.mjs +0 -15
  439. package/API/getRelayerURL.cjs +0 -1
  440. package/API/getRelayerURL.d.ts +0 -1
  441. package/API/getRelayerURL.mjs +0 -10
  442. package/API/passwordCalls.cjs +0 -1
  443. package/API/passwordCalls.d.ts +0 -9
  444. package/API/passwordCalls.mjs +0 -13
  445. package/API/restoreSnapshots.cjs +0 -1
  446. package/API/restoreSnapshots.d.ts +0 -1
  447. package/API/restoreSnapshots.mjs +0 -10
  448. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +0 -1
  449. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +0 -7
  450. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +0 -42
  451. package/data-structures/Hinkal/hinkalActionStake.d.ts +0 -3
  452. package/data-structures/Hinkal/hinkalApprove.cjs +0 -1
  453. package/data-structures/Hinkal/hinkalApprove.d.ts +0 -3
  454. package/data-structures/Hinkal/hinkalApprove.mjs +0 -115
  455. package/data-structures/Hinkal/hinkalInsideTransact.cjs +0 -1
  456. package/data-structures/Hinkal/hinkalInsideTransact.d.ts +0 -4
  457. package/data-structures/Hinkal/hinkalInsideTransact.mjs +0 -121
  458. package/error-handling/handleErrorRestore.cjs +0 -1
  459. package/error-handling/handleErrorRestore.d.ts +0 -2
  460. package/error-handling/handleErrorRestore.mjs +0 -11
  461. package/functions/staking/index.cjs +0 -1
  462. package/functions/staking/index.d.ts +0 -11
  463. package/functions/staking/index.mjs +0 -42
  464. package/functions/utils/replaceAddressInCalldata.cjs +0 -1
  465. package/functions/utils/replaceAddressInCalldata.d.ts +0 -1
  466. package/functions/utils/replaceAddressInCalldata.mjs +0 -7
  467. package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +0 -1
  468. package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +0 -5
  469. package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +0 -32
  470. package/types/bridging.types.d.ts +0 -29
  471. package/types/duneAPI.types.d.ts +0 -9
  472. package/types/hinkal.stake.types.cjs +0 -1
  473. package/types/hinkal.stake.types.d.ts +0 -11
  474. package/types/hinkal.stake.types.mjs +0 -4
@@ -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
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../utils/time.utils.cjs");require("../../../types/circom-data.types.cjs");const s=require("../../../types/transactions.types.cjs");require("../../../types/activities.types.cjs");const n=1*1e3,u=30*1e3,l=async(t,e,i=0)=>{if((await t.getTransactionReceipt(e))?.status!==s.TransactionReceiptStatus.Succeeded)return;i>0&&await t.waitForTransaction(e,i);const c=u/n;let r=null;for(let a=0;a<c;a+=1){try{if(r=await t.getTransaction(e),r)break}catch{}a<c-1&&await o.waitLittle(n)}return r??void 0};exports.recoverTransactionFromError=l;
@@ -0,0 +1,2 @@
1
+ import { ethers } from 'ethers';
2
+ export declare const recoverTransactionFromError: (provider: ethers.providers.Provider, transactionHash: string, confirmations?: number) => Promise<ethers.providers.TransactionResponse | undefined>;
@@ -0,0 +1,23 @@
1
+ import { waitLittle as n } from "../../utils/time.utils.mjs";
2
+ import "../../../types/circom-data.types.mjs";
3
+ import { TransactionReceiptStatus as s } from "../../../types/transactions.types.mjs";
4
+ import "../../../types/activities.types.mjs";
5
+ const c = 1 * 1e3, m = 30 * 1e3, L = async (t, e, i = 0) => {
6
+ if ((await t.getTransactionReceipt(e))?.status !== s.Succeeded)
7
+ return;
8
+ i > 0 && await t.waitForTransaction(e, i);
9
+ const o = m / c;
10
+ let a = null;
11
+ for (let r = 0; r < o; r += 1) {
12
+ try {
13
+ if (a = await t.getTransaction(e), a)
14
+ break;
15
+ } catch {
16
+ }
17
+ r < o - 1 && await n(c);
18
+ }
19
+ return a ?? void 0;
20
+ };
21
+ export {
22
+ L as recoverTransactionFromError
23
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../../constants/protocol.constants.cjs"),B=require("../../../types/ethereum-network.types.cjs"),I=require("../../utils/time.utils.cjs"),H=require("./approveTokensToHinkal.cjs"),N=require("./constructBatchCall.cjs"),S=async(e,c,i,n,g,u,y,T)=>{const a=Array.isArray(c)?c:[c],r=Array.isArray(i)?i:[i];if(a.length!==r.length)throw new Error("token and amount length mismatch");const h=e.getContractWithSigner(B.ContractType.HinkalContract),x=await e.getEthereumAddress(),p=y??h,s=T??h,A="transact",m=r.findIndex(({erc20TokenAddress:t})=>t===w.zeroAddress),k=r.some(({erc20TokenAddress:t})=>t!==w.zeroAddress),d=m===-1?0n:a[m],l=e.getProviderAdapter();if(k&&await l.supportsBatchCall?.()&&l.sendBatchCallsTransaction){const t=r.map(q=>q.erc20TokenAddress),f=N.buildApproveAndTransactCalls(t,a,p.address,s,n,u,g,d);return await l.sendBatchCallsTransaction(f)}await H.approveTokensToHinkal(e,p,r,a);const v={value:d>0n?BigInt(d).toString():void 0};let o;const C=[n[0],n[1],n[2],u,g,{...v,from:x}];try{o=(await s.estimateGas[A](...C)).toNumber(),console.log({gasCosts:o}),console.log({signerAddress:await s.signer.getAddress(),chainIdHinkal:e.getCurrentChainId(),ethersNetwork:await s.provider.getNetwork()})}catch(t){console.log("hinkalDeposit: gas estimation error",{err:t})}const b=o&&o>=0?Math.ceil(o*12/10):void 0;return v.gasLimit=b,await I.waitLittle(),await s[A](...C)};exports.transactCallDirect=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../../../constants/protocol.constants.cjs"),F=require("../../../types/ethereum-network.types.cjs"),S=require("../../utils/time.utils.cjs"),_=require("./approveTokensToHinkal.cjs"),z=require("./constructBatchCall.cjs"),G=require("./recoverTransactionFromError.cjs"),L=async(e,o,i,d,s,v,A,q,b)=>{const n=Array.isArray(i)?i:[i],r=Array.isArray(d)?d:[d];if(n.length!==r.length)throw new Error("token and amount length mismatch");const g=e.getContractWithSigner(o,F.ContractType.HinkalContract),B=await e.getEthereumAddress(),T=q??g,a=b??g,w="transact",y=r.findIndex(({erc20TokenAddress:t})=>t===x.zeroAddress),H=r.some(({erc20TokenAddress:t})=>t!==x.zeroAddress),l=y===-1?0n:n[y],u=e.getProviderAdapter();if(H&&await u.supportsBatchCall?.(o)&&u.sendBatchCallsTransaction){const t=r.map(E=>E.erc20TokenAddress),p=z.buildApproveAndTransactCalls(t,n,T.address,a,s,A,v,l);return await u.sendBatchCallsTransaction(o,p)}await _.approveTokensToHinkal(e,o,T,r,n);const C={value:l>0n?BigInt(l).toString():void 0};let c;const f=[s[0],s[1],s[2],A,v,{...C,from:B}];try{c=(await a.estimateGas[w](...f)).toNumber()}catch(t){console.log("hinkalDeposit: gas estimation error",{err:t})}const k=c&&c>=0?Math.ceil(c*12/10):void 0;C.gasLimit=k,await S.waitLittle();let h;try{h=await a[w](...f)}catch(t){if(!t?.transactionHash)throw t;const{provider:p}=a,m=await G.recoverTransactionFromError(p,t.transactionHash);if(!m)throw t;h=m}return h};exports.transactCallDirect=L;
@@ -3,4 +3,4 @@ import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
3
3
  import { CircomDataBaseType, DimDataType } from '../../../types/circom-data.types';
4
4
  import { ERC20Token } from '../../../types/token.types';
5
5
  import { NewZkCallDataType } from '../../../types/snark.types';
6
- export declare const transactCallDirect: (hinkal: IHinkal, amount: bigint | bigint[], tokenToApprove: ERC20Token | ERC20Token[], newZkCallData: NewZkCallDataType, circomData: CircomDataBaseType, dimData: DimDataType, contractApproval?: ethers.Contract, contractTransaction?: ethers.Contract) => Promise<any>;
6
+ export declare const transactCallDirect: (hinkal: IHinkal, chainId: number, amount: bigint | bigint[], tokenToApprove: ERC20Token | ERC20Token[], newZkCallData: NewZkCallDataType, circomData: CircomDataBaseType, dimData: DimDataType, contractApproval?: ethers.Contract, contractTransaction?: ethers.Contract) => Promise<any>;
@@ -1,51 +1,60 @@
1
- import { zeroAddress as u } from "../../../constants/protocol.constants.mjs";
2
- import { ContractType as k } from "../../../types/ethereum-network.types.mjs";
3
- import { waitLittle as H } from "../../utils/time.utils.mjs";
4
- import { approveTokensToHinkal as N } from "./approveTokensToHinkal.mjs";
5
- import { buildApproveAndTransactCalls as E } from "./constructBatchCall.mjs";
6
- const W = async (r, i, c, n, m, p, f, x) => {
7
- const a = Array.isArray(i) ? i : [i], o = Array.isArray(c) ? c : [c];
8
- if (a.length !== o.length)
1
+ import { zeroAddress as y } from "../../../constants/protocol.constants.mjs";
2
+ import { ContractType as L } from "../../../types/ethereum-network.types.mjs";
3
+ import { waitLittle as S } from "../../utils/time.utils.mjs";
4
+ import { approveTokensToHinkal as k } from "./approveTokensToHinkal.mjs";
5
+ import { buildApproveAndTransactCalls as z } from "./constructBatchCall.mjs";
6
+ import { recoverTransactionFromError as M } from "./recoverTransactionFromError.mjs";
7
+ const J = async (o, s, i, d, e, g, v, B, H) => {
8
+ const a = Array.isArray(i) ? i : [i], r = Array.isArray(d) ? d : [d];
9
+ if (a.length !== r.length)
9
10
  throw new Error("token and amount length mismatch");
10
- const g = r.getContractWithSigner(k.HinkalContract), y = await r.getEthereumAddress(), h = f ?? g, s = x ?? g, A = "transact", v = o.findIndex(({ erc20TokenAddress: t }) => t === u), T = o.some(({ erc20TokenAddress: t }) => t !== u), d = v === -1 ? 0n : a[v], l = r.getProviderAdapter();
11
- if (T && await l.supportsBatchCall?.() && l.sendBatchCallsTransaction) {
12
- const t = o.map((b) => b.erc20TokenAddress), B = E(
11
+ const f = o.getContractWithSigner(s, L.HinkalContract), b = await o.getEthereumAddress(), w = B ?? f, n = H ?? f, u = "transact", C = r.findIndex(({ erc20TokenAddress: t }) => t === y), E = r.some(({ erc20TokenAddress: t }) => t !== y), m = C === -1 ? 0n : a[C], l = o.getProviderAdapter();
12
+ if (E && await l.supportsBatchCall?.(s) && l.sendBatchCallsTransaction) {
13
+ const t = r.map((G) => G.erc20TokenAddress), h = z(
13
14
  t,
14
15
  a,
15
- h.address,
16
- s,
16
+ w.address,
17
17
  n,
18
- p,
19
- m,
20
- d
18
+ e,
19
+ v,
20
+ g,
21
+ m
21
22
  );
22
- return await l.sendBatchCallsTransaction(B);
23
+ return await l.sendBatchCallsTransaction(s, h);
23
24
  }
24
- await N(r, h, o, a);
25
- const w = {
26
- value: d > 0n ? BigInt(d).toString() : void 0
25
+ await k(o, s, w, r, a);
26
+ const T = {
27
+ value: m > 0n ? BigInt(m).toString() : void 0
27
28
  };
28
- let e;
29
- const C = [
30
- n[0],
31
- n[1],
32
- n[2],
33
- p,
34
- m,
35
- { ...w, from: y }
29
+ let c;
30
+ const x = [
31
+ e[0],
32
+ e[1],
33
+ e[2],
34
+ v,
35
+ g,
36
+ { ...T, from: b }
36
37
  ];
37
38
  try {
38
- e = (await s.estimateGas[A](...C)).toNumber(), console.log({ gasCosts: e }), console.log({
39
- signerAddress: await s.signer.getAddress(),
40
- chainIdHinkal: r.getCurrentChainId(),
41
- ethersNetwork: await s.provider.getNetwork()
42
- });
39
+ c = (await n.estimateGas[u](...x)).toNumber();
43
40
  } catch (t) {
44
41
  console.log("hinkalDeposit: gas estimation error", { err: t });
45
42
  }
46
- const I = e && e >= 0 ? Math.ceil(e * 12 / 10) : void 0;
47
- return w.gasLimit = I, await H(), await s[A](...C);
43
+ const F = c && c >= 0 ? Math.ceil(c * 12 / 10) : void 0;
44
+ T.gasLimit = F, await S();
45
+ let p;
46
+ try {
47
+ p = await n[u](...x);
48
+ } catch (t) {
49
+ if (!t?.transactionHash)
50
+ throw t;
51
+ const { provider: h } = n, A = await M(h, t.transactionHash);
52
+ if (!A)
53
+ throw t;
54
+ p = A;
55
+ }
56
+ return p;
48
57
  };
49
58
  export {
50
- W as transactCallDirect
59
+ J as transactCallDirect
51
60
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../error-handling/error-codes.constants.cjs");require("ethers");const y=require("../../../error-handling/customErrors/ErrorWithTx.cjs");require("../../../types/circom-data.types.cjs");require("../../../types/transactions.types.cjs");require("../../../types/activities.types.cjs");const R=require("../../../constants/server.constants.cjs");require("../../../API/getServerURL.cjs");const C=require("../../../data-structures/http/HttpClient.cjs");require("axios");require("../../../constants/chains.constants.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../../constants/vite.constants.cjs");require("../../../constants/save-depths.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("@solana/web3.js");require("../../../data-structures/crypto-keys/keys.cjs");const u=require("../../../API/callRelayer.cjs"),l=require("../../snarkjs/common.snarkjs.cjs");require("node-forge");require("../../../constants/token-data/index.cjs");require("idb-keyval");require("../../utils/convertIntegrationProviderToExternalActionId.cjs");const w=require("../../../API/getRelayerURL.cjs");require("@solana/spl-token");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");require("ethers-v6h");const q=r=>{if(r.status==="success")return r.message;throw r.message&&r.error?new y.ErrorWithRelayerTransaction(r.error,r.message):new Error(r.error)},T=async(r,a,t,i,c,s,o,e)=>{const n=l.serializeCircomData(i),m=await u.callRelayerTransactAPI(r,{a:a[0],b:a[1],c:a[2],dimData:t,circomData:n,withPrivateMempool:c,withUniswapWorkAround:s,authorizationData:o,adminData:e});return q(m)},D=async(r,a)=>{const t=await C.httpClient.post(`${w.getRelayerURL(r)}${R.RELAYER_CONFIG.SOLANA_TRANSACT}`,a);return q(t)},h=r=>{if(r.status==="success")return r.message.scheduleId;throw new Error(r.error||"Batch transaction failed")},d=async(r,a,t,i)=>{const c=a.map(e=>l.serializeCircomData(e.circomData)),s={transactions:a.map((e,n)=>({a:e.zkCallData[0],b:e.zkCallData[1],c:e.zkCallData[2],dimData:e.dimData,circomData:c[n],withPrivateMempool:e.withPrivateMempool,withUniswapWorkAround:e.withUniswapWorkAround,authorizationData:e.authorizationData})),txCompletionTime:i,hashedEthereumAddress:t},o=await u.callRelayerTransactBatchAPI(r,s);return h(o)},A=async(r,a,t,i)=>{const c={transactions:a,hashedEthereumAddress:t,txCompletionTime:i},s=await u.callRelayerSolanaTransactBatchAPI(r,c);return h(s)};exports.solanaTransactCallRelayer=D;exports.solanaTransactCallRelayerBatch=A;exports.transactCallRelayer=T;exports.transactCallRelayerBatch=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../error-handling/error-codes.constants.cjs");require("ethers");const y=require("../../../error-handling/customErrors/ErrorWithTx.cjs");require("../../../types/circom-data.types.cjs");require("../../../types/transactions.types.cjs");require("../../../types/activities.types.cjs");require("../../../constants/vite.constants.cjs");const u=require("../../../API/callRelayer.cjs");require("../../../constants/chains.constants.cjs");require("circomlibjs-hinkal-fork");require("../../../data-structures/crypto-keys/keys.cjs");const l=require("../../snarkjs/common.snarkjs.cjs");require("node-forge");require("libsodium-wrappers");const R=require("../../../data-structures/http/HttpClient.cjs");require("axios");require("../../../constants/token-data/index.cjs");require("idb-keyval");require("@solana/web3.js");require("../../utils/convertIntegrationProviderToExternalActionId.cjs");const C=require("../../../constants/server.constants.cjs"),w=require("../../../API/getServerURL.cjs");require("@coral-xyz/anchor");require("@solana/spl-token");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("multiformats");require("async-mutex");require("../../../API/tenderly.api.cjs");require("process");require("buffer");require("../../../providers/EthersProviderAdapter.cjs");require("ethers-v6h");const q=r=>{if(r.status==="success")return r.message;throw r.message&&r.error?new y.ErrorWithRelayerTransaction(r.error,r.message):new Error(r.error)},D=async(r,a,t,i,c,s,o,e)=>{const n=l.serializeCircomData(i),h=await u.callRelayerTransactAPI({chainId:r,a:a[0],b:a[1],c:a[2],dimData:t,circomData:n,withPrivateMempool:c,withUniswapWorkAround:s,authorizationData:o,adminData:e});return q(h)},T=async r=>{const a=await R.httpClient.post(`${w.RELAYER_URL}${C.RELAYER_CONFIG.SOLANA_TRANSACT}`,r);return q(a)},m=r=>{if(r.status==="success")return r.message.scheduleId;throw new Error(r.error||"Batch transaction failed")},d=async(r,a,t,i)=>{const c=a.map(e=>l.serializeCircomData(e.circomData)),s={chainId:r,transactions:a.map((e,n)=>({chainId:r,a:e.zkCallData[0],b:e.zkCallData[1],c:e.zkCallData[2],dimData:e.dimData,circomData:c[n],withPrivateMempool:e.withPrivateMempool,withUniswapWorkAround:e.withUniswapWorkAround,authorizationData:e.authorizationData,adminData:e.adminData})),txCompletionTime:i,hashedEthereumAddress:t},o=await u.callRelayerTransactBatchAPI(s);return m(o)},A=async(r,a,t,i)=>{const c={chainId:r,transactions:a,hashedEthereumAddress:t,txCompletionTime:i},s=await u.callRelayerSolanaTransactBatchAPI(c);return m(s)};exports.solanaTransactCallRelayer=T;exports.solanaTransactCallRelayerBatch=A;exports.transactCallRelayer=D;exports.transactCallRelayerBatch=d;
@@ -6,7 +6,7 @@ export interface RelayerResponseInterface {
6
6
  error?: string;
7
7
  }
8
8
  export declare const transactCallRelayer: (chainId: number, newZkCallData: NewZkCallDataType, dimData: DimDataType, circomData: CircomDataBaseType, withPrivateMempool?: boolean, withUniswapWorkAround?: boolean, authorizationData?: AuthorizationData, adminData?: AdminDataType) => Promise<RelayerTransaction>;
9
- export declare const solanaTransactCallRelayer: (chainId: number, body: SolanaTransactionBody) => Promise<RelayerTransaction>;
9
+ export declare const solanaTransactCallRelayer: (body: SolanaTransactionBody) => Promise<RelayerTransaction>;
10
10
  export interface RelayerBatchResponseInterface {
11
11
  status: string;
12
12
  message: {
@@ -1,36 +1,31 @@
1
1
  import "../../../error-handling/error-codes.constants.mjs";
2
2
  import "ethers";
3
- import { ErrorWithRelayerTransaction as u } from "../../../error-handling/customErrors/ErrorWithTx.mjs";
3
+ import { ErrorWithRelayerTransaction as h } from "../../../error-handling/customErrors/ErrorWithTx.mjs";
4
4
  import "../../../types/circom-data.types.mjs";
5
5
  import "../../../types/transactions.types.mjs";
6
6
  import "../../../types/activities.types.mjs";
7
- import { RELAYER_CONFIG as w } from "../../../constants/server.constants.mjs";
8
- import "../../../API/getServerURL.mjs";
9
- import { httpClient as y } from "../../../data-structures/http/HttpClient.mjs";
10
- import "axios";
7
+ import "../../../constants/vite.constants.mjs";
8
+ import { callRelayerTransactAPI as w, callRelayerTransactBatchAPI as D, callRelayerSolanaTransactBatchAPI as A } from "../../../API/callRelayer.mjs";
11
9
  import "../../../constants/chains.constants.mjs";
12
10
  import "circomlibjs-hinkal-fork";
13
- import "libsodium-wrappers";
14
- import "process";
15
- import "buffer";
16
- import "../../../constants/vite.constants.mjs";
17
- import "../../../constants/save-depths.mjs";
18
- import "../../../constants/reorg-depths.constants.mjs";
19
- import "../../utils/mutexes.utils.mjs";
20
- import "@coral-xyz/anchor";
21
- import "@solana/web3.js";
22
11
  import "../../../data-structures/crypto-keys/keys.mjs";
23
- import { callRelayerTransactAPI as A, callRelayerTransactBatchAPI as D, callRelayerSolanaTransactBatchAPI as d } from "../../../API/callRelayer.mjs";
24
12
  import { serializeCircomData as n } from "../../snarkjs/common.snarkjs.mjs";
25
13
  import "node-forge";
14
+ import "libsodium-wrappers";
15
+ import { httpClient as d } from "../../../data-structures/http/HttpClient.mjs";
16
+ import "axios";
26
17
  import "../../../constants/token-data/index.mjs";
27
18
  import "idb-keyval";
19
+ import "@solana/web3.js";
28
20
  import "../../utils/convertIntegrationProviderToExternalActionId.mjs";
29
- import { getRelayerURL as f } from "../../../API/getRelayerURL.mjs";
21
+ import { RELAYER_CONFIG as y } from "../../../constants/server.constants.mjs";
22
+ import { RELAYER_URL as R } from "../../../API/getServerURL.mjs";
23
+ import "@coral-xyz/anchor";
30
24
  import "@solana/spl-token";
31
25
  import "../../../constants/contracts.constants.mjs";
32
26
  import "../../../constants/kyc.constants.mjs";
33
27
  import "../../../constants/coingecko.constants.mjs";
28
+ import "../../../constants/reorg-depths.constants.mjs";
34
29
  import "../../../constants/addresses.constants.mjs";
35
30
  import "../../../constants/token.limits.constants.mjs";
36
31
  import "../../../constants/presale.constants.mjs";
@@ -39,40 +34,44 @@ import "../../../constants/tasks.constants.mjs";
39
34
  import "../../../constants/events.constants.mjs";
40
35
  import "../../utils/userAgent.mjs";
41
36
  import "multiformats";
37
+ import "async-mutex";
42
38
  import "../../../API/tenderly.api.mjs";
39
+ import "process";
40
+ import "buffer";
41
+ import "../../../providers/EthersProviderAdapter.mjs";
43
42
  import "ethers-v6h";
44
43
  const e = (t) => {
45
44
  if (t.status === "success")
46
45
  return t.message;
47
- throw t.message && t.error ? new u(t.error, t.message) : new Error(t.error);
48
- }, nt = async (t, o, a, i, c, m, s, r) => {
49
- const p = n(i), h = await A(t, {
50
- a: o[0],
51
- b: o[1],
52
- c: o[2],
53
- dimData: a,
46
+ throw t.message && t.error ? new h(t.error, t.message) : new Error(t.error);
47
+ }, pt = async (t, a, o, i, c, m, s, r) => {
48
+ const p = n(i), u = await w({
49
+ chainId: t,
50
+ a: a[0],
51
+ b: a[1],
52
+ c: a[2],
53
+ dimData: o,
54
54
  circomData: p,
55
55
  withPrivateMempool: c,
56
56
  withUniswapWorkAround: m,
57
57
  authorizationData: s,
58
58
  adminData: r
59
59
  });
60
- return e(h);
61
- }, et = async (t, o) => {
62
- const a = await y.post(
63
- `${f(t)}${w.SOLANA_TRANSACT}`,
64
- o
65
- );
60
+ return e(u);
61
+ }, nt = async (t) => {
62
+ const a = await d.post(`${R}${y.SOLANA_TRANSACT}`, t);
66
63
  return e(a);
67
64
  }, l = (t) => {
68
65
  if (t.status === "success")
69
66
  return t.message.scheduleId;
70
67
  throw new Error(t.error || "Batch transaction failed");
71
- }, lt = async (t, o, a, i) => {
72
- const c = o.map(
68
+ }, et = async (t, a, o, i) => {
69
+ const c = a.map(
73
70
  (r) => n(r.circomData)
74
71
  ), m = {
75
- transactions: o.map((r, p) => ({
72
+ chainId: t,
73
+ transactions: a.map((r, p) => ({
74
+ chainId: t,
76
75
  a: r.zkCallData[0],
77
76
  b: r.zkCallData[1],
78
77
  c: r.zkCallData[2],
@@ -80,23 +79,25 @@ const e = (t) => {
80
79
  circomData: c[p],
81
80
  withPrivateMempool: r.withPrivateMempool,
82
81
  withUniswapWorkAround: r.withUniswapWorkAround,
83
- authorizationData: r.authorizationData
82
+ authorizationData: r.authorizationData,
83
+ adminData: r.adminData
84
84
  })),
85
85
  txCompletionTime: i,
86
- hashedEthereumAddress: a
87
- }, s = await D(t, m);
86
+ hashedEthereumAddress: o
87
+ }, s = await D(m);
88
88
  return l(s);
89
- }, ht = async (t, o, a, i) => {
90
- const m = await d(t, {
91
- transactions: o,
92
- hashedEthereumAddress: a,
89
+ }, lt = async (t, a, o, i) => {
90
+ const m = await A({
91
+ chainId: t,
92
+ transactions: a,
93
+ hashedEthereumAddress: o,
93
94
  txCompletionTime: i
94
95
  });
95
96
  return l(m);
96
97
  };
97
98
  export {
98
- et as solanaTransactCallRelayer,
99
- ht as solanaTransactCallRelayerBatch,
100
- nt as transactCallRelayer,
101
- lt as transactCallRelayerBatch
99
+ nt as solanaTransactCallRelayer,
100
+ lt as solanaTransactCallRelayerBatch,
101
+ pt as transactCallRelayer,
102
+ et as transactCallRelayerBatch
102
103
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../constants/protocol.constants.cjs"),a=require("../../types/ethereum-network.types.cjs"),c=async(n,t,e)=>{const r=n.getContractWithFetcher(a.ContractType.ERC20Contract,t);return t===o.zeroAddress?(await r.provider.getBalance(e)).toBigInt():(await r.balanceOf(e)).toBigInt()};exports.getPublicAddressBalance=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../constants/protocol.constants.cjs"),c=require("../../types/ethereum-network.types.cjs"),i=async(n,o,t,e)=>{const r=n.getContractWithFetcher(o,c.ContractType.ERC20Contract,t);return t===a.zeroAddress?(await r.provider.getBalance(e)).toBigInt():(await r.balanceOf(e)).toBigInt()};exports.getPublicAddressBalance=i;
@@ -1,2 +1,2 @@
1
1
  import { type IHinkal } from '../../data-structures/Hinkal/IHinkal';
2
- export declare const getPublicAddressBalance: (hinkal: IHinkal, tokenAddress: string, ethereumAddress: string) => Promise<bigint>;
2
+ export declare const getPublicAddressBalance: (hinkal: IHinkal, chainId: number, tokenAddress: string, ethereumAddress: string) => Promise<bigint>;
@@ -1,9 +1,9 @@
1
- import { zeroAddress as n } from "../../constants/protocol.constants.mjs";
2
- import { ContractType as c } from "../../types/ethereum-network.types.mjs";
3
- const g = async (o, t, r) => {
4
- const a = o.getContractWithFetcher(c.ERC20Contract, t);
5
- return t === n ? (await a.provider.getBalance(r)).toBigInt() : (await a.balanceOf(r)).toBigInt();
1
+ import { zeroAddress as c } from "../../constants/protocol.constants.mjs";
2
+ import { ContractType as e } from "../../types/ethereum-network.types.mjs";
3
+ const p = async (o, n, t, r) => {
4
+ const a = o.getContractWithFetcher(n, e.ERC20Contract, t);
5
+ return t === c ? (await a.provider.getBalance(r)).toBigInt() : (await a.balanceOf(r)).toBigInt();
6
6
  };
7
7
  export {
8
- g as getPublicAddressBalance
8
+ p as getPublicAddressBalance
9
9
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("ethers"),o=require("../../constants/chains.constants.cjs"),h=require("../../externalABIs/index.cjs"),c=require("../../data-structures/http/HttpClient.cjs");require("axios");require("idb-keyval");const p=require("../utils/create-provider.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("../../constants/vite.constants.cjs");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/web3.js");require("@solana/spl-token");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 a={[o.chainIds.base]:"base",[o.chainIds.optimism]:"optimism",[o.chainIds.arbMainnet]:"arbitrum",[o.chainIds.polygon]:"polygon",[o.chainIds.ethMainnet]:"eth"},k=async(e,r)=>{const i=`https://${a[e]}.blockscout.com/api?module=token&action=getTokenHolders&contractaddress=${r}&page=0&offset=10`,{result:q}=await c.httpClient.get(i),{fetchRpcUrl:n}=o.networkRegistry[e];if(!n)throw new Error("RPC URL not found for the specified chain ID");const l=p.createCustomRpcProvider(n),d=new u.ethers.Contract(r,h.ERC20ABI,l);for(const{address:s}of q)if((await d.balanceOf(s)).toBigInt()!==0n)return s},m=async(e,r)=>{const t=`https://api.routescan.io/v2/network/mainnet/evm/${e}/etherscan/api?module=token&action=tokenholderlist&contractaddress=${r}&page=1&offset=10&apikey=YourApiKeyToken`,{result:i}=await c.httpClient.get(t);return i.at(0)?.TokenHolderAddress},f=async(e,r)=>{try{if(!(e in a))throw new Error("Chain is not supported by blockscout");const t=await k(e,r);if(!t||!u.ethers.utils.isAddress(t))throw new Error("Token holder not found in blockscout");return t}catch{return await m(e,r)}};exports.getTokenHolder=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("ethers"),o=require("../../constants/chains.constants.cjs"),h=require("../../externalABIs/index.cjs"),c=require("../../data-structures/http/HttpClient.cjs");require("axios");require("idb-keyval");const p=require("../utils/create-provider.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("../../constants/vite.constants.cjs");require("@solana/web3.js");require("@coral-xyz/anchor");require("@solana/spl-token");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 a={[o.chainIds.base]:"base",[o.chainIds.optimism]:"optimism",[o.chainIds.arbMainnet]:"arbitrum",[o.chainIds.polygon]:"polygon",[o.chainIds.ethMainnet]:"eth"},k=async(e,r)=>{const i=`https://${a[e]}.blockscout.com/api?module=token&action=getTokenHolders&contractaddress=${r}&page=0&offset=10`,{result:q}=await c.httpClient.get(i),{fetchRpcUrl:n}=o.networkRegistry[e];if(!n)throw new Error("RPC URL not found for the specified chain ID");const l=p.createCustomRpcProvider(n),d=new u.ethers.Contract(r,h.ERC20ABI,l);for(const{address:s}of q)if((await d.balanceOf(s)).toBigInt()!==0n)return s},m=async(e,r)=>{const t=`https://api.routescan.io/v2/network/mainnet/evm/${e}/etherscan/api?module=token&action=tokenholderlist&contractaddress=${r}&page=1&offset=10&apikey=YourApiKeyToken`,{result:i}=await c.httpClient.get(t);return i.at(0)?.TokenHolderAddress},f=async(e,r)=>{try{if(!(e in a))throw new Error("Chain is not supported by blockscout");const t=await k(e,r);if(!t||!u.ethers.utils.isAddress(t))throw new Error("Token holder not found in blockscout");return t}catch{return await m(e,r)}};exports.getTokenHolder=f;
@@ -14,20 +14,15 @@ import "../../types/activities.types.mjs";
14
14
  import "circomlibjs-hinkal-fork";
15
15
  import "../../data-structures/crypto-keys/keys.mjs";
16
16
  import "../../constants/server.constants.mjs";
17
- import "../../constants/vite.constants.mjs";
18
17
  import "../../API/getServerURL.mjs";
19
- import "libsodium-wrappers";
20
- import "process";
21
- import "buffer";
22
- import "../../constants/save-depths.mjs";
23
- import "../../constants/reorg-depths.constants.mjs";
24
- import "../utils/mutexes.utils.mjs";
25
- import "@coral-xyz/anchor";
18
+ import "../../constants/vite.constants.mjs";
26
19
  import "@solana/web3.js";
20
+ import "@coral-xyz/anchor";
27
21
  import "@solana/spl-token";
28
22
  import "../../constants/contracts.constants.mjs";
29
23
  import "../../constants/kyc.constants.mjs";
30
24
  import "../../constants/coingecko.constants.mjs";
25
+ import "../../constants/reorg-depths.constants.mjs";
31
26
  import "../../constants/addresses.constants.mjs";
32
27
  import "../../constants/token.limits.constants.mjs";
33
28
  import "../../constants/presale.constants.mjs";
@@ -35,8 +30,13 @@ import "../../constants/activity.constants.mjs";
35
30
  import "../../constants/tasks.constants.mjs";
36
31
  import "../../constants/events.constants.mjs";
37
32
  import "../utils/userAgent.mjs";
33
+ import "libsodium-wrappers";
38
34
  import "multiformats";
35
+ import "async-mutex";
39
36
  import "../../API/tenderly.api.mjs";
37
+ import "process";
38
+ import "buffer";
39
+ import "../../providers/EthersProviderAdapter.mjs";
40
40
  const c = {
41
41
  [i.base]: "base",
42
42
  [i.optimism]: "optimism",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../error-handling/error-codes.constants.cjs"),d=require("../../API/callLifiAPI.cjs"),f=require("./etherFunctions.cjs"),m=require("../../constants/protocol.constants.cjs"),A=async(i,e,o,s,a,c,n)=>{try{const r=f.getAmountInWei(e,s),u={fromChain:e.chainId,toChain:o.chainId,fromToken:e.erc20TokenAddress,toToken:o.erc20TokenAddress,fromAddress:c,fromAmount:r.toString(),order:"FASTEST",slippage:a,...n&&{toAddress:n}},{lifiResponse:t}=await d.callLifiAPI(i,u);return{lifiDataValue:t.transactionRequest.data,outSwapAmountValue:BigInt(t.estimate.toAmount),extraNativeTokenFee:e.erc20TokenAddress===m.zeroAddress?BigInt(t.transactionRequest.value)-r:BigInt(t.transactionRequest.value)}}catch{throw Error(l.transactionErrorCodes.NO_LIFI_PRICE)}};exports.getLifiPrice=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../error-handling/error-codes.constants.cjs"),l=require("../../API/callLifiAPI.cjs"),d=require("./etherFunctions.cjs"),f=require("../../constants/protocol.constants.cjs"),m=async(e,o,i,s,a,n)=>{try{const r=d.getAmountInWei(e,i),c={fromChain:e.chainId,toChain:o.chainId,fromToken:e.erc20TokenAddress,toToken:o.erc20TokenAddress,fromAddress:a,fromAmount:r.toString(),order:"FASTEST",slippage:s,...n&&{toAddress:n}},{lifiResponse:t}=await l.callLifiAPI(c);return{lifiDataValue:t.transactionRequest.data,outSwapAmountValue:BigInt(t.estimate.toAmount),extraNativeTokenFee:e.erc20TokenAddress===f.zeroAddress?BigInt(t.transactionRequest.value)-r:BigInt(t.transactionRequest.value)}}catch{throw Error(u.transactionErrorCodes.NO_LIFI_PRICE)}};exports.getLifiPrice=m;
@@ -1,5 +1,5 @@
1
1
  import { ERC20Token } from '../../types/token.types';
2
- export declare const getLifiPrice: (chainId: number, inSwapToken: ERC20Token, outSwapToken: ERC20Token, inSwapAmount: string, bridgingSlippage: number, fromAddress: string, toAddress?: string) => Promise<{
2
+ export declare const getLifiPrice: (inSwapToken: ERC20Token, outSwapToken: ERC20Token, inSwapAmount: string, bridgingSlippage: number, fromAddress: string, toAddress?: string) => Promise<{
3
3
  lifiDataValue: string;
4
4
  outSwapAmountValue: bigint;
5
5
  extraNativeTokenFee: bigint;
@@ -1,30 +1,30 @@
1
- import { transactionErrorCodes as u } from "../../error-handling/error-codes.constants.mjs";
2
- import { callLifiAPI as f } from "../../API/callLifiAPI.mjs";
3
- import { getAmountInWei as d } from "./etherFunctions.mjs";
4
- import { zeroAddress as A } from "../../constants/protocol.constants.mjs";
5
- const p = async (i, t, o, a, s, c, n) => {
1
+ import { transactionErrorCodes as m } from "../../error-handling/error-codes.constants.mjs";
2
+ import { callLifiAPI as u } from "../../API/callLifiAPI.mjs";
3
+ import { getAmountInWei as f } from "./etherFunctions.mjs";
4
+ import { zeroAddress as d } from "../../constants/protocol.constants.mjs";
5
+ const h = async (t, o, i, a, s, n) => {
6
6
  try {
7
- const e = d(t, a), m = {
7
+ const e = f(t, i), c = {
8
8
  fromChain: t.chainId,
9
9
  toChain: o.chainId,
10
10
  fromToken: t.erc20TokenAddress,
11
11
  toToken: o.erc20TokenAddress,
12
- fromAddress: c,
12
+ fromAddress: s,
13
13
  fromAmount: e.toString(),
14
14
  order: "FASTEST",
15
15
  // TO BE DECIDED
16
- slippage: s,
16
+ slippage: a,
17
17
  ...n && { toAddress: n }
18
- }, { lifiResponse: r } = await f(i, m);
18
+ }, { lifiResponse: r } = await u(c);
19
19
  return {
20
20
  lifiDataValue: r.transactionRequest.data,
21
21
  outSwapAmountValue: BigInt(r.estimate.toAmount),
22
- extraNativeTokenFee: t.erc20TokenAddress === A ? BigInt(r.transactionRequest.value) - e : BigInt(r.transactionRequest.value)
22
+ extraNativeTokenFee: t.erc20TokenAddress === d ? BigInt(r.transactionRequest.value) - e : BigInt(r.transactionRequest.value)
23
23
  };
24
24
  } catch {
25
- throw Error(u.NO_LIFI_PRICE);
25
+ throw Error(m.NO_LIFI_PRICE);
26
26
  }
27
27
  };
28
28
  export {
29
- p as getLifiPrice
29
+ h as getLifiPrice
30
30
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../../API/callOdosAPI.cjs");require("../../constants/token-data/index.cjs");const u=require("../../constants/chains.constants.cjs"),a=require("../../constants/protocol.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 d=require("../../error-handling/error-codes.constants.cjs"),l=require("./etherFunctions.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");require("../../API/getServerURL.cjs");require("../../data-structures/http/HttpClient.cjs");require("axios");require("ethers");require("circomlibjs-hinkal-fork");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("../../data-structures/crypto-keys/keys.cjs");const A=async(r,e,t,i,n=.7)=>{try{const o={chainId:r!==31337?r:u.localhostNetwork,inputTokens:[{tokenAddress:e?.wrappedErc20TokenAddress??e.erc20TokenAddress,amount:l.getAmountInWei(e,i).toString()}],outputTokens:[{tokenAddress:t?.wrappedErc20TokenAddress??t.erc20TokenAddress,proportion:1}],userAddr:u.networkRegistry[r].contractData.odosExternalActionInstanceAddress||a.zeroAddress,slippageLimitPercent:n,disableRFQs:!0},{odosResponse:s,status:c}=await q.callOdosAPI(r,o);if(c!=="success")throw Error("Odos API Fetch Error");return{outSwapAmountValue:BigInt(s.outputTokens[0].amount),odosDataValue:s.transaction.data}}catch(o){throw console.log({error:o}),Error(d.transactionErrorCodes.NO_ODOS_PRICE)}};exports.getOdosPrice=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../API/callOdosAPI.cjs");require("../../constants/token-data/index.cjs");const n=require("../../constants/chains.constants.cjs"),d=require("../../constants/protocol.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 q=require("../../error-handling/error-codes.constants.cjs"),l=require("./etherFunctions.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");const A=async(r,e,t,u,i=.7)=>{try{const o={chainId:r!==31337?r:n.localhostNetwork,inputTokens:[{tokenAddress:e?.wrappedErc20TokenAddress??e.erc20TokenAddress,amount:l.getAmountInWei(e,u).toString()}],outputTokens:[{tokenAddress:t?.wrappedErc20TokenAddress??t.erc20TokenAddress,proportion:1}],userAddr:n.networkRegistry[r].contractData.odosExternalActionInstanceAddress||d.zeroAddress,slippageLimitPercent:i,disableRFQs:!0},{odosResponse:s,status:c}=await a.callOdosAPI(r,o);if(c!=="success")throw Error("Odos API Fetch Error");return{outSwapAmountValue:BigInt(s.outputTokens[0].amount),odosDataValue:s.transaction.data}}catch(o){throw console.log({error:o}),Error(q.transactionErrorCodes.NO_ODOS_PRICE)}};exports.getOdosPrice=A;
@@ -19,27 +19,14 @@ import { getAmountInWei as A } from "./etherFunctions.mjs";
19
19
  import "../../types/circom-data.types.mjs";
20
20
  import "../../types/transactions.types.mjs";
21
21
  import "../../types/activities.types.mjs";
22
- import "../../API/getServerURL.mjs";
23
- import "../../data-structures/http/HttpClient.mjs";
24
- import "axios";
25
- import "ethers";
26
- import "circomlibjs-hinkal-fork";
27
- import "libsodium-wrappers";
28
- import "process";
29
- import "buffer";
30
- import "../../constants/save-depths.mjs";
31
- import "../utils/mutexes.utils.mjs";
32
- import "@coral-xyz/anchor";
33
- import "@solana/web3.js";
34
- import "../../data-structures/crypto-keys/keys.mjs";
35
- const S = async (r, o, s, e, p = 0.7) => {
22
+ const z = async (r, o, s, i, p = 0.7) => {
36
23
  try {
37
24
  const t = {
38
25
  chainId: r !== 31337 ? r : d,
39
26
  inputTokens: [
40
27
  {
41
28
  tokenAddress: o?.wrappedErc20TokenAddress ?? o.erc20TokenAddress,
42
- amount: A(o, e).toString()
29
+ amount: A(o, i).toString()
43
30
  }
44
31
  ],
45
32
  outputTokens: [
@@ -52,20 +39,20 @@ const S = async (r, o, s, e, p = 0.7) => {
52
39
  slippageLimitPercent: p,
53
40
  disableRFQs: !0
54
41
  // sometimes swap fails because of RFQs
55
- }, { odosResponse: i, status: m } = await n(
42
+ }, { odosResponse: e, status: m } = await n(
56
43
  r,
57
44
  t
58
45
  );
59
46
  if (m !== "success")
60
47
  throw Error("Odos API Fetch Error");
61
48
  return {
62
- outSwapAmountValue: BigInt(i.outputTokens[0].amount),
63
- odosDataValue: i.transaction.data
49
+ outSwapAmountValue: BigInt(e.outputTokens[0].amount),
50
+ odosDataValue: e.transaction.data
64
51
  };
65
52
  } catch (t) {
66
53
  throw console.log({ error: t }), Error(u.NO_ODOS_PRICE);
67
54
  }
68
55
  };
69
56
  export {
70
- S as getOdosPrice
57
+ z as getOdosPrice
71
58
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@solana/web3.js"),m=require("./etherFunctions.cjs"),l=require("../../constants/chains.constants.cjs"),b=require("../pre-transaction/solana.cjs"),h=require("../../API/callOkxAPI.cjs"),d=(e,o,n,s,c=.7)=>({amount:`${n}`,chainIndex:"501",fromTokenAddress:e.toString(),toTokenAddress:o.toString(),userWalletAddress:s,slippagePercent:`${c}`,directRoute:!0}),q=async(e,o,n,s,c=.5,i,a)=>{if(!l.isSolanaLike(e))throw new Error("OKX is only supported on Solana");const g=m.getAmountInWei(o,s),{hinkalAddress:w,originalDeployer:u}=l.networkRegistry[e].contractData;if(!u)throw new Error("No original deployer configured for Solana program");if(a&&!i)throw new Error("Proxy wallet address is required");const A=new r.PublicKey(w),P=new r.PublicKey(u),k=a&&i?new r.PublicKey(i):b.getSwapperAccountPublicKey(A,P),p=new r.PublicKey(o.erc20TokenAddress),y=new r.PublicKey(n.erc20TokenAddress),K=d(p,y,g,k.toString(),c),{okxResponse:t,status:S}=await h.callOkxAPI(e,{quote:K});if(S!=="success")throw Error("OKX API Fetch Error");if(t.code!=="0")throw new Error(`OKX API error: ${t.msg}`);const f=BigInt(t.data.routerResult.toTokenAmount),O=JSON.stringify(t);return{outSwapAmountValue:f,okxDataValue:O}};exports.createOKXQuote=d;exports.getOKXPrice=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@solana/web3.js"),d=require("./etherFunctions.cjs"),g=require("../../constants/chains.constants.cjs"),b=require("../pre-transaction/solana.cjs"),I=require("../../API/callOkxAPI.cjs"),w=(o,r,n,s,c=.7)=>({amount:`${n}`,chainIndex:"501",fromTokenAddress:o.toString(),toTokenAddress:r.toString(),userWalletAddress:s,slippagePercent:`${c}`,directRoute:!0}),q=async(o,r,n,s,c=.5,i,a)=>{if(!g.isSolanaLike(o))throw new Error("OKX is only supported on Solana");const u=d.randomBigInt(31),p=d.getAmountInWei(r,s),{hinkalAddress:A,originalDeployer:l}=g.networkRegistry[o].contractData;if(!l)throw new Error("No original deployer configured for Solana program");if(a&&!i)throw new Error("Proxy wallet address is required");const S=new e.PublicKey(A),P=new e.PublicKey(l),k=a&&i?new e.PublicKey(i):b.getSwapperAccountPublicKeyFromSalt(S,P,u),y=new e.PublicKey(r.erc20TokenAddress),K=new e.PublicKey(n.erc20TokenAddress),m=w(y,K,p,k.toString(),c),{okxResponse:t,status:f}=await I.callOkxAPI({quote:m});if(f!=="success")throw Error("OKX API Fetch Error");if(t.code!=="0")throw new Error(`OKX API error: ${t.msg}`);const O=BigInt(t.data.routerResult.toTokenAmount),h=JSON.stringify({...t,swapperAccountSalt:u.toString()});return{outSwapAmountValue:O,okxDataValue:h}};exports.createOKXQuote=w;exports.getOKXPrice=q;