@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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../constants/protocol.constants.cjs"),I=require("../../../types/ethereum-network.types.cjs"),E=require("../../utils/time.utils.cjs"),F=require("./approveTokensToHinkal.cjs"),N=require("./constructBatchCall.cjs"),S=require("./recoverTransactionFromError.cjs"),_=async(e,c,i,n,p,A,x,k)=>{const a=Array.isArray(c)?c:[c],o=Array.isArray(i)?i:[i];if(a.length!==o.length)throw new Error("token and amount length mismatch");const v=e.getContractWithSigner(I.ContractType.HinkalContract),q=await e.getEthereumAddress(),m=x??v,r=k??v,w="transact",C=o.findIndex(({erc20TokenAddress:t})=>t===f.zeroAddress),H=o.some(({erc20TokenAddress:t})=>t!==f.zeroAddress),d=C===-1?0n:a[C],l=e.getProviderAdapter();if(H&&await l.supportsBatchCall?.()&&l.sendBatchCallsTransaction){const t=o.map(B=>B.erc20TokenAddress),g=N.buildApproveAndTransactCalls(t,a,m.address,r,n,A,p,d);return await l.sendBatchCallsTransaction(g)}await F.approveTokensToHinkal(e,m,o,a);const T={value:d>0n?BigInt(d).toString():void 0};let s;const y=[n[0],n[1],n[2],A,p,{...T,from:q}];try{s=(await r.estimateGas[w](...y)).toNumber(),console.log({gasCosts:s}),console.log({signerAddress:await r.signer.getAddress(),chainIdHinkal:e.getCurrentChainId(),ethersNetwork:await r.provider.getNetwork()})}catch(t){console.log("hinkalDeposit: gas estimation error",{err:t})}const b=s&&s>=0?Math.ceil(s*12/10):void 0;T.gasLimit=b,await E.waitLittle();let h;try{h=await r[w](...y)}catch(t){if(!t?.transactionHash)throw t;const{provider:g}=r,u=await S.recoverTransactionFromError(g,t.transactionHash);if(!u)throw t;h=u}return h};exports.transactCallDirect=_;
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,64 +1,60 @@
1
- import { zeroAddress as x } from "../../../constants/protocol.constants.mjs";
2
- import { ContractType as E } from "../../../types/ethereum-network.types.mjs";
3
- import { waitLittle as F } from "../../utils/time.utils.mjs";
4
- import { approveTokensToHinkal as N } from "./approveTokensToHinkal.mjs";
5
- import { buildApproveAndTransactCalls as G } from "./constructBatchCall.mjs";
6
- import { recoverTransactionFromError as L } from "./recoverTransactionFromError.mjs";
7
- const q = async (o, i, c, a, g, A, y, H) => {
8
- const n = Array.isArray(i) ? i : [i], s = Array.isArray(c) ? c : [c];
9
- if (n.length !== s.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)
10
10
  throw new Error("token and amount length mismatch");
11
- const v = o.getContractWithSigner(E.HinkalContract), I = await o.getEthereumAddress(), w = y ?? v, r = H ?? v, f = "transact", C = s.findIndex(({ erc20TokenAddress: t }) => t === x), B = s.some(({ erc20TokenAddress: t }) => t !== x), d = C === -1 ? 0n : n[C], l = o.getProviderAdapter();
12
- if (B && await l.supportsBatchCall?.() && l.sendBatchCallsTransaction) {
13
- const t = s.map((k) => k.erc20TokenAddress), h = G(
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(
14
14
  t,
15
- n,
16
- w.address,
17
- r,
18
15
  a,
19
- A,
16
+ w.address,
17
+ n,
18
+ e,
19
+ v,
20
20
  g,
21
- d
21
+ m
22
22
  );
23
- return await l.sendBatchCallsTransaction(h);
23
+ return await l.sendBatchCallsTransaction(s, h);
24
24
  }
25
- await N(o, w, s, n);
26
- const u = {
27
- 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
28
28
  };
29
- let e;
30
- const T = [
31
- a[0],
32
- a[1],
33
- a[2],
34
- A,
29
+ let c;
30
+ const x = [
31
+ e[0],
32
+ e[1],
33
+ e[2],
34
+ v,
35
35
  g,
36
- { ...u, from: I }
36
+ { ...T, from: b }
37
37
  ];
38
38
  try {
39
- e = (await r.estimateGas[f](...T)).toNumber(), console.log({ gasCosts: e }), console.log({
40
- signerAddress: await r.signer.getAddress(),
41
- chainIdHinkal: o.getCurrentChainId(),
42
- ethersNetwork: await r.provider.getNetwork()
43
- });
39
+ c = (await n.estimateGas[u](...x)).toNumber();
44
40
  } catch (t) {
45
41
  console.log("hinkalDeposit: gas estimation error", { err: t });
46
42
  }
47
- const b = e && e >= 0 ? Math.ceil(e * 12 / 10) : void 0;
48
- u.gasLimit = b, await F();
49
- let m;
43
+ const F = c && c >= 0 ? Math.ceil(c * 12 / 10) : void 0;
44
+ T.gasLimit = F, await S();
45
+ let p;
50
46
  try {
51
- m = await r[f](...T);
47
+ p = await n[u](...x);
52
48
  } catch (t) {
53
49
  if (!t?.transactionHash)
54
50
  throw t;
55
- const { provider: h } = r, p = await L(h, t.transactionHash);
56
- if (!p)
51
+ const { provider: h } = n, A = await M(h, t.transactionHash);
52
+ if (!A)
57
53
  throw t;
58
- m = p;
54
+ p = A;
59
55
  }
60
- return m;
56
+ return p;
61
57
  };
62
58
  export {
63
- q as transactCallDirect
59
+ J as transactCallDirect
64
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)},D=async(r,a,t,i,c,s,n,e)=>{const o=l.serializeCircomData(i),h=await u.callRelayerTransactAPI(r,{a:a[0],b:a[1],c:a[2],dimData:t,circomData:o,withPrivateMempool:c,withUniswapWorkAround:s,authorizationData:n,adminData:e});return q(h)},T=async(r,a)=>{const t=await C.httpClient.post(`${w.getRelayerURL(r)}${R.RELAYER_CONFIG.SOLANA_TRANSACT}`,a);return q(t)},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={transactions:a.map((e,o)=>({a:e.zkCallData[0],b:e.zkCallData[1],c:e.zkCallData[2],dimData:e.dimData,circomData:c[o],withPrivateMempool:e.withPrivateMempool,withUniswapWorkAround:e.withUniswapWorkAround,authorizationData:e.authorizationData,adminData:e.adminData})),txCompletionTime:i,hashedEthereumAddress:t},n=await u.callRelayerTransactBatchAPI(r,s);return m(n)},A=async(r,a,t,i)=>{const c={transactions:a,hashedEthereumAddress:t,txCompletionTime:i},s=await u.callRelayerSolanaTransactBatchAPI(r,c);return m(s)};exports.solanaTransactCallRelayer=T;exports.solanaTransactCallRelayerBatch=A;exports.transactCallRelayer=D;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 D } 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 d, callRelayerTransactBatchAPI as y, callRelayerSolanaTransactBatchAPI as A } 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,14 +34,19 @@ 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, a, o, i, c, m, s, r) => {
49
- const p = n(i), h = await d(t, {
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
50
  a: a[0],
51
51
  b: a[1],
52
52
  c: a[2],
@@ -57,22 +57,21 @@ const e = (t) => {
57
57
  authorizationData: s,
58
58
  adminData: r
59
59
  });
60
- return e(h);
61
- }, et = async (t, a) => {
62
- const o = await D.post(
63
- `${f(t)}${w.SOLANA_TRANSACT}`,
64
- a
65
- );
66
- return e(o);
60
+ return e(u);
61
+ }, nt = async (t) => {
62
+ const a = await d.post(`${R}${y.SOLANA_TRANSACT}`, t);
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, a, o, i) => {
68
+ }, et = async (t, a, o, i) => {
72
69
  const c = a.map(
73
70
  (r) => n(r.circomData)
74
71
  ), m = {
72
+ chainId: t,
75
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],
@@ -85,10 +84,11 @@ const e = (t) => {
85
84
  })),
86
85
  txCompletionTime: i,
87
86
  hashedEthereumAddress: o
88
- }, s = await y(t, m);
87
+ }, s = await D(m);
89
88
  return l(s);
90
- }, ht = async (t, a, o, i) => {
91
- const m = await A(t, {
89
+ }, lt = async (t, a, o, i) => {
90
+ const m = await A({
91
+ chainId: t,
92
92
  transactions: a,
93
93
  hashedEthereumAddress: o,
94
94
  txCompletionTime: i
@@ -96,8 +96,8 @@ const e = (t) => {
96
96
  return l(m);
97
97
  };
98
98
  export {
99
- et as solanaTransactCallRelayer,
100
- ht as solanaTransactCallRelayerBatch,
101
- nt as transactCallRelayer,
102
- lt as transactCallRelayerBatch
99
+ nt as solanaTransactCallRelayer,
100
+ lt as solanaTransactCallRelayerBatch,
101
+ pt as transactCallRelayer,
102
+ et as transactCallRelayerBatch
103
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;
@@ -1,43 +1,43 @@
1
- import { PublicKey as r } from "@solana/web3.js";
2
- import { getAmountInWei as P } from "./etherFunctions.mjs";
3
- import { isSolanaLike as h, networkRegistry as K } from "../../constants/chains.constants.mjs";
4
- import { getSwapperAccountPublicKey as O } from "../pre-transaction/solana.mjs";
5
- import { callOkxAPI as T } from "../../API/callOkxAPI.mjs";
6
- const D = (o, e, n, s, i = 0.7) => ({
1
+ import { PublicKey as o } from "@solana/web3.js";
2
+ import { randomBigInt as P, getAmountInWei as I } from "./etherFunctions.mjs";
3
+ import { isSolanaLike as K, networkRegistry as O } from "../../constants/chains.constants.mjs";
4
+ import { getSwapperAccountPublicKeyFromSalt as T } from "../pre-transaction/solana.mjs";
5
+ import { callOkxAPI as D } from "../../API/callOkxAPI.mjs";
6
+ const E = (r, t, n, s, i = 0.7) => ({
7
7
  amount: `${n}`,
8
8
  chainIndex: "501",
9
9
  // Solana mainnet
10
- fromTokenAddress: o.toString(),
11
- toTokenAddress: e.toString(),
10
+ fromTokenAddress: r.toString(),
11
+ toTokenAddress: t.toString(),
12
12
  userWalletAddress: s,
13
13
  slippagePercent: `${i}`,
14
14
  directRoute: !0
15
- }), $ = async (o, e, n, s, i = 0.5, a, c) => {
16
- if (!h(o))
15
+ }), q = async (r, t, n, s, i = 0.5, a, c) => {
16
+ if (!K(r))
17
17
  throw new Error("OKX is only supported on Solana");
18
- const d = P(e, s), { hinkalAddress: l, originalDeployer: u } = K[o].contractData;
19
- if (!u)
18
+ const u = P(31), p = I(t, s), { hinkalAddress: d, originalDeployer: l } = O[r].contractData;
19
+ if (!l)
20
20
  throw new Error("No original deployer configured for Solana program");
21
21
  if (c && !a)
22
22
  throw new Error("Proxy wallet address is required");
23
- const w = new r(l), g = new r(u), m = c && a ? new r(a) : O(w, g), p = new r(e.erc20TokenAddress), f = new r(n.erc20TokenAddress), A = D(
24
- p,
23
+ const w = new o(d), g = new o(l), m = c && a ? new o(a) : T(w, g, u), A = new o(t.erc20TokenAddress), f = new o(n.erc20TokenAddress), S = E(
24
+ A,
25
25
  f,
26
- d,
26
+ p,
27
27
  m.toString(),
28
28
  i
29
- ), { okxResponse: t, status: k } = await T(o, { quote: A });
29
+ ), { okxResponse: e, status: k } = await D({ quote: S });
30
30
  if (k !== "success")
31
31
  throw Error("OKX API Fetch Error");
32
- if (t.code !== "0")
33
- throw new Error(`OKX API error: ${t.msg}`);
34
- const S = BigInt(t.data.routerResult.toTokenAmount), y = JSON.stringify(t);
32
+ if (e.code !== "0")
33
+ throw new Error(`OKX API error: ${e.msg}`);
34
+ const h = BigInt(e.data.routerResult.toTokenAmount), y = JSON.stringify({ ...e, swapperAccountSalt: u.toString() });
35
35
  return {
36
- outSwapAmountValue: S,
36
+ outSwapAmountValue: h,
37
37
  okxDataValue: y
38
38
  };
39
39
  };
40
40
  export {
41
- D as createOKXQuote,
42
- $ as getOKXPrice
41
+ E as createOKXQuote,
42
+ q as getOKXPrice
43
43
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../API/callOneInchAPI.cjs");require("../../constants/token-data/index.cjs");require("../../constants/chains.constants.cjs");const e=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"),a=require("./etherFunctions.cjs");require("../../types/circom-data.types.cjs");const d=require("../../types/ethereum-network.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");const l=require("../../error-handling/logger.cjs");require("@solana/web3.js");require("../../data-structures/crypto-keys/keys.cjs");const A=require("./getContractMetadata.cjs"),I=async(s,t,i,n,u=.7)=>{try{const o={fromTokenAddress:t.erc20TokenAddress!==e.zeroAddress?t.erc20TokenAddress:e.oneInchZeroAddress,toTokenAddress:i.erc20TokenAddress!==e.zeroAddress?i.erc20TokenAddress:e.oneInchZeroAddress,fromAddress:e.zeroAddress,destReceiver:A.getContractMetadata(d.ContractType.OneInchExternalActionContract,s).address,amount:a.getAmountInWei(t,n),slippage:u,disableEstimate:!0,allowPartialFill:!1},r=await c.callOneInchAPI(s,o);if(!r||!r.tx)throw Error("OneInch API price fetch error");return{outSwapAmountValue:BigInt(r.toAmount),oneInchDataValue:r.tx.data}}catch(o){throw l.Logger.log({error:o}),Error(q.transactionErrorCodes.NO_ONEINCH_PRICE)}};exports.getOneInchPrice=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../API/callOneInchAPI.cjs");require("../../constants/token-data/index.cjs");require("../../constants/chains.constants.cjs");const e=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 a=require("../../error-handling/error-codes.constants.cjs"),d=require("./etherFunctions.cjs");require("../../types/circom-data.types.cjs");const q=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");const l=require("../../error-handling/logger.cjs"),A=require("./getContractMetadata.cjs"),I=async(s,t,n,c,i=.7)=>{try{const o={fromTokenAddress:t.erc20TokenAddress!==e.zeroAddress?t.erc20TokenAddress:e.oneInchZeroAddress,toTokenAddress:n.erc20TokenAddress!==e.zeroAddress?n.erc20TokenAddress:e.oneInchZeroAddress,fromAddress:e.zeroAddress,destReceiver:A.getContractMetadata(q.ContractType.OneInchExternalActionContract,s).address,amount:d.getAmountInWei(t,c),slippage:i,disableEstimate:!0,allowPartialFill:!1},r=await u.callOneInchAPI(s,o);if(!r||!r.tx)throw Error("OneInch API price fetch error");return{outSwapAmountValue:BigInt(r.toAmount),oneInchDataValue:r.tx.data}}catch(o){throw l.Logger.log({error:o}),Error(a.transactionErrorCodes.NO_ONEINCH_PRICE)}};exports.getOneInchPrice=I;