@hinkal/common 0.2.12 → 0.2.14

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 (574) hide show
  1. package/API/API.cjs +1 -1
  2. package/API/API.d.ts +9 -3
  3. package/API/API.mjs +44 -34
  4. package/API/ai-calls.cjs +1 -0
  5. package/API/ai-calls.d.ts +9 -0
  6. package/API/ai-calls.mjs +13 -0
  7. package/API/callCurveAPI.cjs +1 -1
  8. package/API/callCurveAPI.mjs +28 -22
  9. package/API/callRelayer.d.ts +3 -2
  10. package/API/dataServerCalls.cjs +1 -1
  11. package/API/dataServerCalls.d.ts +4 -0
  12. package/API/dataServerCalls.mjs +11 -7
  13. package/API/duneAPI.cjs +1 -1
  14. package/API/duneAPI.mjs +6 -4
  15. package/API/fetchCommitmentsCache.cjs +1 -1
  16. package/API/fetchCommitmentsCache.d.ts +9 -1
  17. package/API/fetchCommitmentsCache.mjs +6 -5
  18. package/API/getGasEstimates.cjs +1 -1
  19. package/API/getGasEstimates.d.ts +2 -1
  20. package/API/getGasEstimates.mjs +10 -9
  21. package/API/getServerURL.d.ts +1 -1
  22. package/API/index.d.ts +2 -0
  23. package/API/is-tx-stateless.cjs +1 -0
  24. package/API/is-tx-stateless.d.ts +3 -0
  25. package/API/is-tx-stateless.mjs +9 -0
  26. package/API/kycCalls.cjs +1 -1
  27. package/API/kycCalls.d.ts +0 -4
  28. package/API/kycCalls.mjs +11 -15
  29. package/API/rewardsPointsCalls.d.ts +0 -3
  30. package/API/tenderly.api.cjs +1 -0
  31. package/API/tenderly.api.d.ts +12 -0
  32. package/API/tenderly.api.mjs +47 -0
  33. package/API/token-calls.cjs +1 -0
  34. package/API/token-calls.d.ts +2 -0
  35. package/API/token-calls.mjs +9 -0
  36. package/README.md +0 -61
  37. package/constants/addresses.constants.cjs +1 -0
  38. package/constants/addresses.constants.d.ts +16 -0
  39. package/constants/addresses.constants.mjs +50 -0
  40. package/constants/assets.constants.cjs +1 -1
  41. package/constants/assets.constants.mjs +13 -13
  42. package/constants/axelar.constants.cjs +1 -1
  43. package/constants/axelar.constants.mjs +5 -5
  44. package/constants/balance.constants.cjs +1 -0
  45. package/constants/balance.constants.d.ts +1 -0
  46. package/constants/balance.constants.mjs +4 -0
  47. package/constants/chains.constants.cjs +1 -1
  48. package/constants/chains.constants.d.ts +0 -2
  49. package/constants/chains.constants.mjs +26 -38
  50. package/constants/contracts.constants.cjs +1 -1
  51. package/constants/contracts.constants.mjs +108 -108
  52. package/constants/conversion.constants.cjs +1 -0
  53. package/constants/conversion.constants.d.ts +1 -0
  54. package/constants/conversion.constants.mjs +4 -0
  55. package/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
  56. package/constants/deploy-data/deploy-data-localhost.json.mjs +1652 -829
  57. package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
  58. package/constants/deploy-data/deploy-data-optimism.json.mjs +9707 -3957
  59. package/constants/fees.constants.cjs +1 -1
  60. package/constants/fees.constants.d.ts +5 -3
  61. package/constants/fees.constants.mjs +22 -19
  62. package/constants/index.d.ts +6 -0
  63. package/constants/mediaUrls.constants.cjs +1 -0
  64. package/constants/mediaUrls.constants.d.ts +23 -0
  65. package/constants/mediaUrls.constants.mjs +26 -0
  66. package/constants/permit2.constants.cjs +1 -0
  67. package/constants/permit2.constants.d.ts +2 -0
  68. package/constants/permit2.constants.mjs +5 -0
  69. package/constants/protocol.constants.cjs +1 -1
  70. package/constants/protocol.constants.d.ts +6 -0
  71. package/constants/protocol.constants.mjs +27 -15
  72. package/constants/rewards.constants.cjs +1 -1
  73. package/constants/rewards.constants.d.ts +0 -1
  74. package/constants/rewards.constants.mjs +14 -13
  75. package/constants/server.constants.cjs +1 -1
  76. package/constants/server.constants.d.ts +8 -3
  77. package/constants/server.constants.mjs +16 -11
  78. package/constants/token-data/ERC20Registry.cjs +1 -1
  79. package/constants/token-data/ERC20Registry.mjs +10 -9
  80. package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
  81. package/constants/token-data/arbMainnetRegistry.json.mjs +88 -88
  82. package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
  83. package/constants/token-data/arbMainnetRegistryFixed.json.mjs +78 -78
  84. package/constants/token-data/avalancheRegistry.json.cjs +1 -1
  85. package/constants/token-data/avalancheRegistry.json.mjs +49 -49
  86. package/constants/token-data/avalancheRegistryFixed.json.cjs +1 -1
  87. package/constants/token-data/avalancheRegistryFixed.json.mjs +49 -49
  88. package/constants/token-data/baseRegistry.json.cjs +1 -1
  89. package/constants/token-data/baseRegistry.json.mjs +32 -32
  90. package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
  91. package/constants/token-data/baseRegistryFixed.json.mjs +29 -29
  92. package/constants/token-data/bnbMainnetRegistry.json.cjs +1 -1
  93. package/constants/token-data/bnbMainnetRegistry.json.mjs +65 -65
  94. package/constants/token-data/bnbMainnetRegistryFixed.json.cjs +1 -1
  95. package/constants/token-data/bnbMainnetRegistryFixed.json.mjs +65 -65
  96. package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
  97. package/constants/token-data/ethMainnetRegistry.json.mjs +227 -227
  98. package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
  99. package/constants/token-data/ethMainnetRegistryFixed.json.mjs +191 -191
  100. package/constants/token-data/index.d.ts +91 -0
  101. package/constants/token-data/localhostRegistry.json.cjs +1 -1
  102. package/constants/token-data/localhostRegistry.json.mjs +294 -277
  103. package/constants/token-data/optimismRegistry.json.cjs +1 -1
  104. package/constants/token-data/optimismRegistry.json.mjs +702 -182
  105. package/constants/token-data/optimismRegistryFixed.json.cjs +1 -1
  106. package/constants/token-data/optimismRegistryFixed.json.mjs +678 -175
  107. package/constants/token-data/polygonRegistry.json.cjs +1 -1
  108. package/constants/token-data/polygonRegistry.json.mjs +109 -109
  109. package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
  110. package/constants/token-data/polygonRegistryFixed.json.mjs +101 -101
  111. package/constants/token.limits.constants.cjs +1 -0
  112. package/constants/token.limits.constants.d.ts +5 -0
  113. package/constants/token.limits.constants.mjs +30 -0
  114. package/constants/vite.constants.cjs +1 -1
  115. package/constants/vite.constants.d.ts +5 -0
  116. package/constants/vite.constants.mjs +26 -22
  117. package/data-structures/Hinkal/Hinkal.cjs +1 -1
  118. package/data-structures/Hinkal/Hinkal.d.ts +46 -21
  119. package/data-structures/Hinkal/Hinkal.mjs +260 -92
  120. package/data-structures/Hinkal/IHinkal.d.ts +35 -11
  121. package/data-structures/Hinkal/hinkalActionBeefy.cjs +1 -1
  122. package/data-structures/Hinkal/hinkalActionBeefy.mjs +5 -4
  123. package/data-structures/Hinkal/hinkalActionConvex.cjs +1 -1
  124. package/data-structures/Hinkal/hinkalActionConvex.mjs +4 -3
  125. package/data-structures/Hinkal/hinkalActionCurve.cjs +1 -1
  126. package/data-structures/Hinkal/hinkalActionCurve.mjs +5 -4
  127. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +1 -0
  128. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +3 -0
  129. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +61 -0
  130. package/data-structures/Hinkal/hinkalActionLidoEth.cjs +1 -1
  131. package/data-structures/Hinkal/hinkalActionLidoEth.mjs +9 -8
  132. package/data-structures/Hinkal/hinkalActionPendle.cjs +1 -1
  133. package/data-structures/Hinkal/hinkalActionPendle.mjs +17 -16
  134. package/data-structures/Hinkal/hinkalActionPendleLP.cjs +1 -1
  135. package/data-structures/Hinkal/hinkalActionPendleLP.mjs +14 -12
  136. package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -0
  137. package/data-structures/Hinkal/hinkalActionReceive.d.ts +4 -0
  138. package/data-structures/Hinkal/hinkalActionReceive.mjs +39 -0
  139. package/data-structures/Hinkal/hinkalActionStake.cjs +1 -1
  140. package/data-structures/Hinkal/hinkalActionStake.mjs +12 -9
  141. package/data-structures/Hinkal/hinkalActionVolatile.cjs +1 -1
  142. package/data-structures/Hinkal/hinkalActionVolatile.mjs +25 -21
  143. package/data-structures/Hinkal/hinkalApprove.cjs +1 -0
  144. package/data-structures/Hinkal/hinkalApprove.d.ts +2 -0
  145. package/data-structures/Hinkal/hinkalApprove.mjs +120 -0
  146. package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -0
  147. package/data-structures/Hinkal/hinkalCheckTokenRegistry.d.ts +3 -0
  148. package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +12 -0
  149. package/data-structures/Hinkal/hinkalDeploySubAccount.cjs +1 -0
  150. package/data-structures/Hinkal/hinkalDeploySubAccount.d.ts +3 -0
  151. package/data-structures/Hinkal/hinkalDeploySubAccount.mjs +15 -0
  152. package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
  153. package/data-structures/Hinkal/hinkalDeposit.d.ts +3 -2
  154. package/data-structures/Hinkal/hinkalDeposit.mjs +96 -71
  155. package/data-structures/Hinkal/hinkalGetRecipientInfo.cjs +1 -1
  156. package/data-structures/Hinkal/hinkalGetRecipientInfo.d.ts +1 -1
  157. package/data-structures/Hinkal/hinkalGetRecipientInfo.mjs +5 -11
  158. package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
  159. package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +6 -18
  160. package/data-structures/Hinkal/hinkalInsideTransact.cjs +1 -0
  161. package/data-structures/Hinkal/hinkalInsideTransact.d.ts +2 -0
  162. package/data-structures/Hinkal/hinkalInsideTransact.mjs +111 -0
  163. package/data-structures/Hinkal/hinkalMultiSend.cjs +1 -0
  164. package/data-structures/Hinkal/hinkalMultiSend.d.ts +3 -0
  165. package/data-structures/Hinkal/hinkalMultiSend.mjs +13 -0
  166. package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  167. package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -1
  168. package/data-structures/Hinkal/hinkalPrivateWallet.mjs +83 -38
  169. package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -0
  170. package/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +4 -0
  171. package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +46 -0
  172. package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -0
  173. package/data-structures/Hinkal/hinkalProxySwap.d.ts +5 -0
  174. package/data-structures/Hinkal/hinkalProxySwap.mjs +36 -0
  175. package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -0
  176. package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +3 -0
  177. package/data-structures/Hinkal/hinkalSignSubAccount.mjs +20 -0
  178. package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
  179. package/data-structures/Hinkal/hinkalSwap.d.ts +2 -1
  180. package/data-structures/Hinkal/hinkalSwap.mjs +68 -60
  181. package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  182. package/data-structures/Hinkal/hinkalWithdraw.d.ts +3 -1
  183. package/data-structures/Hinkal/hinkalWithdraw.mjs +76 -50
  184. package/data-structures/Hinkal/index.d.ts +1 -0
  185. package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  186. package/data-structures/Hinkal/resetMerkleTrees.mjs +18 -11
  187. package/data-structures/IndexedDB/activity-db.cjs +1 -0
  188. package/data-structures/IndexedDB/activity-db.d.ts +16 -0
  189. package/data-structures/IndexedDB/activity-db.mjs +124 -0
  190. package/data-structures/IndexedDB/balances-db.cjs +1 -0
  191. package/data-structures/IndexedDB/balances-db.d.ts +13 -0
  192. package/data-structures/IndexedDB/balances-db.mjs +75 -0
  193. package/data-structures/IndexedDB/contact-db.cjs +1 -0
  194. package/data-structures/IndexedDB/contact-db.d.ts +11 -0
  195. package/data-structures/IndexedDB/contact-db.mjs +44 -0
  196. package/data-structures/IndexedDB/index.d.ts +5 -0
  197. package/data-structures/IndexedDB/prices-db.cjs +1 -0
  198. package/data-structures/IndexedDB/prices-db.d.ts +9 -0
  199. package/data-structures/IndexedDB/prices-db.mjs +62 -0
  200. package/data-structures/IndexedDB/private-balances-db.cjs +1 -0
  201. package/data-structures/IndexedDB/private-balances-db.d.ts +9 -0
  202. package/data-structures/IndexedDB/private-balances-db.mjs +28 -0
  203. package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
  204. package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +47 -44
  205. package/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -0
  206. package/data-structures/TokenDBs/PrivateTokensDB.d.ts +11 -0
  207. package/data-structures/TokenDBs/PrivateTokensDB.mjs +53 -0
  208. package/data-structures/TokenDBs/PublicTokensDB.cjs +1 -0
  209. package/data-structures/TokenDBs/PublicTokensDB.d.ts +13 -0
  210. package/data-structures/TokenDBs/PublicTokensDB.mjs +81 -0
  211. package/data-structures/TokenDBs/index.d.ts +2 -0
  212. package/data-structures/cacheDevices/AttachableMemoryCacheDevice.cjs +1 -0
  213. package/data-structures/cacheDevices/AttachableMemoryCacheDevice.d.ts +8 -0
  214. package/data-structures/cacheDevices/AttachableMemoryCacheDevice.mjs +28 -0
  215. package/data-structures/cacheDevices/BaseCacheDevice.cjs +1 -1
  216. package/data-structures/cacheDevices/BaseCacheDevice.d.ts +9 -6
  217. package/data-structures/cacheDevices/BaseCacheDevice.mjs +13 -4
  218. package/data-structures/cacheDevices/FileCacheDevice.cjs +1 -1
  219. package/data-structures/cacheDevices/FileCacheDevice.d.ts +1 -0
  220. package/data-structures/cacheDevices/FileCacheDevice.mjs +7 -3
  221. package/data-structures/cacheDevices/LocalStorageCacheDevice.cjs +1 -1
  222. package/data-structures/cacheDevices/LocalStorageCacheDevice.d.ts +2 -1
  223. package/data-structures/cacheDevices/LocalStorageCacheDevice.mjs +10 -5
  224. package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
  225. package/data-structures/crypto-keys/decodeUTXO.mjs +13 -12
  226. package/data-structures/crypto-keys/keys.cjs +1 -1
  227. package/data-structures/crypto-keys/keys.d.ts +13 -3
  228. package/data-structures/crypto-keys/keys.mjs +45 -34
  229. package/data-structures/custom-token-registry/CustomTokenRegistry.cjs +1 -1
  230. package/data-structures/custom-token-registry/CustomTokenRegistry.d.ts +2 -3
  231. package/data-structures/custom-token-registry/CustomTokenRegistry.mjs +17 -21
  232. package/data-structures/event-service/AbstractAccessTokenSnapshotService.cjs +1 -1
  233. package/data-structures/event-service/AbstractAccessTokenSnapshotService.mjs +15 -29
  234. package/data-structures/event-service/AbstractApprovalsSnapshotService.cjs +1 -0
  235. package/data-structures/event-service/AbstractApprovalsSnapshotService.d.ts +30 -0
  236. package/data-structures/event-service/AbstractApprovalsSnapshotService.mjs +104 -0
  237. package/data-structures/event-service/AbstractCommitmentsSnapshotService.cjs +1 -1
  238. package/data-structures/event-service/AbstractCommitmentsSnapshotService.mjs +24 -37
  239. package/data-structures/event-service/AbstractEventService.cjs +1 -1
  240. package/data-structures/event-service/AbstractEventService.d.ts +1 -1
  241. package/data-structures/event-service/AbstractEventService.mjs +34 -46
  242. package/data-structures/event-service/index.d.ts +1 -0
  243. package/data-structures/index.d.ts +2 -0
  244. package/data-structures/merkle-tree/MerkleTree.cjs +1 -1
  245. package/data-structures/merkle-tree/MerkleTree.d.ts +4 -1
  246. package/data-structures/merkle-tree/MerkleTree.mjs +66 -65
  247. package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs +1 -1
  248. package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.ts +1 -1
  249. package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +10 -6
  250. package/data-structures/provider-adapter/IProviderAdapter.d.ts +2 -0
  251. package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +1 -1
  252. package/data-structures/snapshot/ClientAccessTokenSnapshotService.mjs +6 -10
  253. package/data-structures/snapshot/ClientApprovalsSnapshotService.cjs +1 -0
  254. package/data-structures/snapshot/ClientApprovalsSnapshotService.d.ts +8 -0
  255. package/data-structures/snapshot/ClientApprovalsSnapshotService.mjs +23 -0
  256. package/data-structures/snapshot/ClientCommitmentsSnapshotService.cjs +1 -1
  257. package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +6 -10
  258. package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +1 -1
  259. package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +6 -10
  260. package/data-structures/token-price-fetcher/TokenChecker.cjs +1 -1
  261. package/data-structures/token-price-fetcher/TokenChecker.d.ts +1 -0
  262. package/data-structures/token-price-fetcher/TokenChecker.mjs +4 -2
  263. package/data-structures/transactions-manager/TransactionsManager.cjs +1 -1
  264. package/data-structures/transactions-manager/TransactionsManager.d.ts +6 -5
  265. package/data-structures/transactions-manager/TransactionsManager.mjs +95 -100
  266. package/data-structures/transactions-manager/history/getBeefyData.cjs +1 -1
  267. package/data-structures/transactions-manager/history/getBeefyData.mjs +3 -2
  268. package/data-structures/transactions-manager/history/getConvexData.cjs +1 -1
  269. package/data-structures/transactions-manager/history/getConvexData.mjs +3 -2
  270. package/data-structures/transactions-manager/history/getCurveData.cjs +1 -1
  271. package/data-structures/transactions-manager/history/getCurveData.mjs +3 -2
  272. package/data-structures/transactions-manager/history/getLidoData.cjs +1 -1
  273. package/data-structures/transactions-manager/history/getLidoData.mjs +3 -2
  274. package/data-structures/transactions-manager/history/getPendleData.cjs +1 -1
  275. package/data-structures/transactions-manager/history/getPendleData.mjs +13 -12
  276. package/data-structures/transactions-manager/history/getTxDetails.cjs +1 -1
  277. package/data-structures/transactions-manager/history/getTxDetails.mjs +22 -20
  278. package/data-structures/transactions-manager/history/getVolatileData.cjs +1 -1
  279. package/data-structures/transactions-manager/history/getVolatileData.mjs +11 -10
  280. package/data-structures/transactions-manager/history/history.types.cjs +1 -1
  281. package/data-structures/transactions-manager/history/history.types.mjs +4 -2
  282. package/data-structures/utxo/Utxo.cjs +1 -1
  283. package/data-structures/utxo/Utxo.d.ts +3 -3
  284. package/data-structures/utxo/Utxo.mjs +8 -7
  285. package/error-handling/error-codes.constants.cjs +2 -2
  286. package/error-handling/error-codes.constants.d.ts +20 -3
  287. package/error-handling/error-codes.constants.mjs +139 -126
  288. package/error-handling/get-error.message.cjs +1 -1
  289. package/error-handling/get-error.message.mjs +29 -25
  290. package/error-handling/index.d.ts +1 -0
  291. package/error-handling/logger.cjs +1 -0
  292. package/error-handling/logger.d.ts +5 -0
  293. package/error-handling/logger.mjs +16 -0
  294. package/error-handling/types.cjs +1 -1
  295. package/error-handling/types.d.ts +3 -1
  296. package/error-handling/types.mjs +2 -2
  297. package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -0
  298. package/functions/pre-transaction/getExternalSwapAddress.d.ts +3 -0
  299. package/functions/pre-transaction/getExternalSwapAddress.mjs +26 -0
  300. package/functions/pre-transaction/getFeeStructure.cjs +1 -0
  301. package/functions/pre-transaction/getFeeStructure.d.ts +4 -0
  302. package/functions/pre-transaction/getFeeStructure.mjs +30 -0
  303. package/functions/pre-transaction/getFlatFees.cjs +1 -1
  304. package/functions/pre-transaction/getFlatFees.d.ts +3 -7
  305. package/functions/pre-transaction/getFlatFees.mjs +52 -46
  306. package/functions/pre-transaction/getSignatureDataForTransact.cjs +1 -0
  307. package/functions/pre-transaction/getSignatureDataForTransact.d.ts +3 -0
  308. package/functions/pre-transaction/getSignatureDataForTransact.mjs +6 -0
  309. package/functions/pre-transaction/index.d.ts +1 -0
  310. package/functions/pre-transaction/interaction-to-action.cjs +1 -1
  311. package/functions/pre-transaction/interaction-to-action.mjs +3 -2
  312. package/functions/pre-transaction/merge-with-fee-structure.cjs +1 -0
  313. package/functions/pre-transaction/merge-with-fee-structure.d.ts +2 -0
  314. package/functions/pre-transaction/merge-with-fee-structure.mjs +25 -0
  315. package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -0
  316. package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +16 -0
  317. package/functions/pre-transaction/outputApprovalDataProcessing.mjs +42 -0
  318. package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
  319. package/functions/pre-transaction/outputUtxoProcessing.d.ts +1 -1
  320. package/functions/pre-transaction/outputUtxoProcessing.mjs +19 -30
  321. package/functions/pre-transaction/process-gas-estimates.cjs +1 -1
  322. package/functions/pre-transaction/process-gas-estimates.d.ts +2 -2
  323. package/functions/pre-transaction/process-gas-estimates.mjs +17 -28
  324. package/functions/pre-transaction/processAmountChanges.cjs +1 -1
  325. package/functions/pre-transaction/processAmountChanges.mjs +34 -23
  326. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -0
  327. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +6 -0
  328. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +7 -0
  329. package/functions/private-wallet/emporium.helpers.cjs +1 -1
  330. package/functions/private-wallet/emporium.helpers.d.ts +17 -4
  331. package/functions/private-wallet/emporium.helpers.mjs +119 -12
  332. package/functions/private-wallet/emporium.swap.helpers.cjs +1 -0
  333. package/functions/private-wallet/emporium.swap.helpers.d.ts +5 -0
  334. package/functions/private-wallet/emporium.swap.helpers.mjs +92 -0
  335. package/functions/private-wallet/index.d.ts +2 -0
  336. package/functions/private-wallet/opProducer.cjs +1 -1
  337. package/functions/private-wallet/opProducer.mjs +1 -1
  338. package/functions/private-wallet/smartContractWalletCalculator.cjs +1 -0
  339. package/functions/private-wallet/smartContractWalletCalculator.d.ts +5 -0
  340. package/functions/private-wallet/smartContractWalletCalculator.mjs +25 -0
  341. package/functions/protocols/convex.protocols.cjs +1 -1
  342. package/functions/protocols/convex.protocols.mjs +10 -8
  343. package/functions/protocols/pendle.helpers.cjs +1 -1
  344. package/functions/protocols/pendle.helpers.mjs +16 -12
  345. package/functions/snarkjs/common.snarkjs.cjs +1 -1
  346. package/functions/snarkjs/common.snarkjs.d.ts +8 -5
  347. package/functions/snarkjs/common.snarkjs.mjs +177 -87
  348. package/functions/snarkjs/constant.cjs +1 -1
  349. package/functions/snarkjs/constant.d.ts +223 -2
  350. package/functions/snarkjs/constant.mjs +313 -93
  351. package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
  352. package/functions/snarkjs/constructEmporiumProof.d.ts +6 -3
  353. package/functions/snarkjs/constructEmporiumProof.mjs +148 -84
  354. package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
  355. package/functions/snarkjs/constructGeneralZkProof.d.ts +5 -3
  356. package/functions/snarkjs/constructGeneralZkProof.mjs +141 -86
  357. package/functions/snarkjs/generateCircomData.cjs +1 -1
  358. package/functions/snarkjs/generateCircomData.d.ts +3 -2
  359. package/functions/snarkjs/generateCircomData.mjs +33 -35
  360. package/functions/snarkjs/generateZkProof.cjs +1 -1
  361. package/functions/snarkjs/generateZkProof.d.ts +2 -2
  362. package/functions/snarkjs/generateZkProof.mjs +4 -4
  363. package/functions/snarkjs/generateZkProofEnclave.cjs +1 -1
  364. package/functions/snarkjs/generateZkProofEnclave.d.ts +2 -1
  365. package/functions/snarkjs/generateZkProofEnclave.mjs +22 -29
  366. package/functions/snarkjs/generateZkProofSelf.cjs +1 -1
  367. package/functions/snarkjs/generateZkProofSelf.d.ts +2 -2
  368. package/functions/snarkjs/generateZkProofSelf.mjs +10 -10
  369. package/functions/snarkjs/getOriginalSender.cjs +1 -0
  370. package/functions/snarkjs/getOriginalSender.d.ts +1 -0
  371. package/functions/snarkjs/getOriginalSender.mjs +5 -0
  372. package/functions/snarkjs/getZKFiles.cjs +1 -1
  373. package/functions/snarkjs/getZKFiles.d.ts +3 -2
  374. package/functions/snarkjs/getZKFiles.mjs +14 -5
  375. package/functions/utils/addresses.cjs +1 -0
  376. package/functions/utils/addresses.d.ts +4 -0
  377. package/functions/utils/addresses.mjs +20 -0
  378. package/functions/utils/amounts.utils.cjs +1 -1
  379. package/functions/utils/amounts.utils.d.ts +4 -1
  380. package/functions/utils/amounts.utils.mjs +29 -27
  381. package/functions/utils/arraysMatch.cjs +1 -0
  382. package/functions/utils/arraysMatch.d.ts +1 -0
  383. package/functions/utils/arraysMatch.mjs +4 -0
  384. package/functions/utils/axelar.utils.cjs +1 -1
  385. package/functions/utils/axelar.utils.d.ts +1 -0
  386. package/functions/utils/axelar.utils.mjs +31 -9
  387. package/functions/utils/cacheDevice.utils.cjs +1 -1
  388. package/functions/utils/cacheDevice.utils.mjs +5 -3
  389. package/functions/utils/cacheFunctions.cjs +1 -1
  390. package/functions/utils/cacheFunctions.d.ts +10 -7
  391. package/functions/utils/cacheFunctions.mjs +62 -39
  392. package/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -0
  393. package/functions/utils/convertEmporiumOpToCallInfo.d.ts +2 -0
  394. package/functions/utils/convertEmporiumOpToCallInfo.mjs +10 -0
  395. package/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
  396. package/functions/utils/convertIntegrationProviderToExternalActionId.d.ts +2 -1
  397. package/functions/utils/convertIntegrationProviderToExternalActionId.mjs +7 -10
  398. package/functions/utils/encodeTokenWithId.cjs +1 -0
  399. package/functions/utils/encodeTokenWithId.d.ts +2 -0
  400. package/functions/utils/encodeTokenWithId.mjs +4 -0
  401. package/functions/utils/encryptInputForEnclave.cjs +1 -0
  402. package/functions/utils/encryptInputForEnclave.d.ts +8 -0
  403. package/functions/utils/encryptInputForEnclave.mjs +43 -0
  404. package/functions/utils/erc20tokenFunctions.cjs +1 -1
  405. package/functions/utils/erc20tokenFunctions.d.ts +8 -2
  406. package/functions/utils/erc20tokenFunctions.mjs +22 -14
  407. package/functions/utils/evmNetworkFunctions.cjs +1 -1
  408. package/functions/utils/evmNetworkFunctions.mjs +6 -4
  409. package/functions/utils/external-action.utils.d.ts +2 -2
  410. package/functions/utils/fees.utils.cjs +1 -0
  411. package/functions/utils/fees.utils.d.ts +2 -0
  412. package/functions/utils/fees.utils.mjs +14 -0
  413. package/functions/utils/getBlockExplorerUrl.cjs +1 -0
  414. package/functions/utils/getBlockExplorerUrl.d.ts +1 -0
  415. package/functions/utils/getBlockExplorerUrl.mjs +6 -0
  416. package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -0
  417. package/functions/utils/getRecipientInfoFromUserKeys.d.ts +3 -0
  418. package/functions/utils/getRecipientInfoFromUserKeys.mjs +18 -0
  419. package/functions/utils/index.d.ts +12 -0
  420. package/functions/utils/involves-permit2-op.cjs +1 -0
  421. package/functions/utils/involves-permit2-op.d.ts +1 -0
  422. package/functions/utils/involves-permit2-op.mjs +5 -0
  423. package/functions/utils/merkleTree.utils.cjs +1 -0
  424. package/functions/utils/merkleTree.utils.d.ts +2 -0
  425. package/functions/utils/merkleTree.utils.mjs +19 -0
  426. package/functions/utils/prepareHinkal.d.ts +6 -0
  427. package/functions/utils/processUseApprovalUtxoData.cjs +1 -0
  428. package/functions/utils/processUseApprovalUtxoData.d.ts +3 -0
  429. package/functions/utils/processUseApprovalUtxoData.mjs +19 -0
  430. package/functions/utils/publicBalance.utils.cjs +1 -0
  431. package/functions/utils/publicBalance.utils.d.ts +5 -0
  432. package/functions/utils/publicBalance.utils.mjs +25 -0
  433. package/functions/utils/replaceAddressInCalldata.cjs +1 -0
  434. package/functions/utils/replaceAddressInCalldata.d.ts +1 -0
  435. package/functions/utils/replaceAddressInCalldata.mjs +7 -0
  436. package/functions/utils/rpc-int-encode.cjs +1 -0
  437. package/functions/utils/rpc-int-encode.d.ts +2 -0
  438. package/functions/utils/rpc-int-encode.mjs +8 -0
  439. package/functions/utils/serialize.utils.cjs +1 -1
  440. package/functions/utils/serialize.utils.d.ts +1 -0
  441. package/functions/utils/serialize.utils.mjs +3 -2
  442. package/functions/utils/string.utils.cjs +1 -1
  443. package/functions/utils/string.utils.d.ts +3 -0
  444. package/functions/utils/string.utils.mjs +31 -7
  445. package/functions/utils/time.utils.cjs +1 -1
  446. package/functions/utils/time.utils.d.ts +1 -0
  447. package/functions/utils/time.utils.mjs +4 -3
  448. package/functions/utils/token-check.utils.cjs +1 -0
  449. package/functions/utils/token-check.utils.d.ts +1 -0
  450. package/functions/utils/token-check.utils.mjs +10 -0
  451. package/functions/utils/upToDateState.cjs +1 -0
  452. package/functions/utils/upToDateState.d.ts +2 -0
  453. package/functions/utils/upToDateState.mjs +11 -0
  454. package/functions/web3/events/balanceChangedCustomHandler.cjs +1 -0
  455. package/functions/web3/events/balanceChangedCustomHandler.d.ts +2 -0
  456. package/functions/web3/events/balanceChangedCustomHandler.mjs +14 -0
  457. package/functions/web3/events/balanceChangedHandler.cjs +1 -1
  458. package/functions/web3/events/balanceChangedHandler.mjs +5 -4
  459. package/functions/web3/events/getApprovedBalance.cjs +1 -0
  460. package/functions/web3/events/getApprovedBalance.d.ts +7 -0
  461. package/functions/web3/events/getApprovedBalance.mjs +80 -0
  462. package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  463. package/functions/web3/events/getInputUtxoAndBalance.d.ts +16 -3
  464. package/functions/web3/events/getInputUtxoAndBalance.mjs +128 -46
  465. package/functions/web3/events/getShieldedBalance.cjs +2 -2
  466. package/functions/web3/events/getShieldedBalance.d.ts +1 -1
  467. package/functions/web3/events/getShieldedBalance.mjs +79 -82
  468. package/functions/web3/events/index.d.ts +2 -0
  469. package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
  470. package/functions/web3/functionCalls/accessTokenCalls.d.ts +2 -2
  471. package/functions/web3/functionCalls/accessTokenCalls.mjs +19 -17
  472. package/functions/web3/functionCalls/approveToken.cjs +1 -1
  473. package/functions/web3/functionCalls/approveToken.mjs +8 -7
  474. package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -0
  475. package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +4 -0
  476. package/functions/web3/functionCalls/approveTokensToHinkal.mjs +11 -0
  477. package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
  478. package/functions/web3/functionCalls/estimateGasRelayer.d.ts +2 -2
  479. package/functions/web3/functionCalls/estimateGasRelayer.mjs +14 -8
  480. package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +1 -0
  481. package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +5 -0
  482. package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +32 -0
  483. package/functions/web3/functionCalls/relayFunctions.d.ts +1 -15
  484. package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
  485. package/functions/web3/functionCalls/transactCallDirect.d.ts +2 -2
  486. package/functions/web3/functionCalls/transactCallDirect.mjs +29 -42
  487. package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  488. package/functions/web3/functionCalls/transactCallRelayer.d.ts +2 -2
  489. package/functions/web3/functionCalls/transactCallRelayer.mjs +26 -5
  490. package/functions/web3/odosAPI.cjs +1 -1
  491. package/functions/web3/odosAPI.mjs +6 -3
  492. package/functions/web3/oneInchAPI.cjs +1 -1
  493. package/functions/web3/oneInchAPI.mjs +6 -3
  494. package/functions/web3/runContractFunction.cjs +1 -1
  495. package/functions/web3/runContractFunction.mjs +3 -2
  496. package/functions/web3/uniswapAPI.cjs +1 -1
  497. package/functions/web3/uniswapAPI.mjs +6 -3
  498. package/index.cjs +1 -1
  499. package/index.mjs +756 -612
  500. package/package.json +6 -2
  501. package/providers/EthersProviderAdapter.cjs +1 -1
  502. package/providers/EthersProviderAdapter.d.ts +7 -3
  503. package/providers/EthersProviderAdapter.mjs +31 -11
  504. package/providers/WagmiProviderAdapter.cjs +1 -1
  505. package/providers/WagmiProviderAdapter.d.ts +3 -1
  506. package/providers/WagmiProviderAdapter.mjs +12 -4
  507. package/providers/prepareEthersHinkal.cjs +1 -1
  508. package/providers/prepareEthersHinkal.mjs +17 -11
  509. package/providers/prepareWagmiHinkal.cjs +1 -1
  510. package/providers/prepareWagmiHinkal.mjs +17 -11
  511. package/types/API.types.d.ts +21 -0
  512. package/types/ICacheDevice.d.ts +4 -3
  513. package/types/TransactionSimulator.types.d.ts +9 -0
  514. package/types/activities.types.cjs +1 -0
  515. package/types/activities.types.d.ts +45 -0
  516. package/types/activities.types.mjs +13 -0
  517. package/types/balances.types.cjs +1 -0
  518. package/types/balances.types.d.ts +17 -0
  519. package/types/balances.types.mjs +4 -0
  520. package/types/cache.types.cjs +1 -0
  521. package/types/cache.types.d.ts +27 -0
  522. package/types/cache.types.mjs +4 -0
  523. package/types/circom-data.types.d.ts +29 -9
  524. package/types/commitments.types.d.ts +6 -0
  525. package/types/contacts.types.d.ts +5 -0
  526. package/types/crypto.types.d.ts +1 -0
  527. package/types/earlyAccessCode.types.d.ts +4 -0
  528. package/types/ethereum-network.types.cjs +1 -1
  529. package/types/ethereum-network.types.d.ts +66 -62
  530. package/types/ethereum-network.types.mjs +1 -1
  531. package/types/external-action.types.cjs +1 -1
  532. package/types/external-action.types.d.ts +2 -1
  533. package/types/external-action.types.mjs +1 -1
  534. package/types/fee.types.d.ts +9 -0
  535. package/types/hinkal.types.cjs +1 -1
  536. package/types/hinkal.types.d.ts +43 -5
  537. package/types/hinkal.types.mjs +37 -13
  538. package/types/index.d.ts +9 -0
  539. package/types/rewards.types.cjs +1 -1
  540. package/types/rewards.types.d.ts +3 -4
  541. package/types/rewards.types.mjs +12 -12
  542. package/types/sandbox.types.cjs +1 -0
  543. package/types/sandbox.types.d.ts +157 -0
  544. package/types/sandbox.types.mjs +4 -0
  545. package/types/tenderly.api.types.d.ts +180 -0
  546. package/types/token-with-id.types.d.ts +4 -0
  547. package/types/token.types.d.ts +23 -0
  548. package/types/transactions.types.cjs +1 -1
  549. package/types/transactions.types.d.ts +31 -0
  550. package/types/transactions.types.mjs +8 -5
  551. package/types/wc.types.d.ts +89 -0
  552. package/types/with-id.types.d.ts +3 -0
  553. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
  554. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
  555. package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
  556. package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +26 -31
  557. package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
  558. package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
  559. package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
  560. package/webworker/utxoWorker/utxoWorkerLogic.mjs +58 -50
  561. package/webworker/viteWorkerURL.constant.cjs +3 -3
  562. package/webworker/viteWorkerURL.constant.mjs +3 -3
  563. package/webworker/workerFactory.cjs +1 -1
  564. package/webworker/workerFactory.mjs +2 -2
  565. package/webworker/workerProxy.cjs +1 -1
  566. package/webworker/workerProxy.d.ts +11 -11
  567. package/webworker/workerProxy.mjs +24 -26
  568. package/webworker/zkProofWorker/zkProofWorker.types.d.ts +2 -0
  569. package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
  570. package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
  571. package/webworker/zkProofWorker/zkProofWorkerLogic.cjs +1 -1
  572. package/webworker/zkProofWorker/zkProofWorkerLogic.mjs +47 -61
  573. package/functions/utils/memoize.utils.cjs +0 -1
  574. package/functions/utils/memoize.utils.mjs +0 -14
@@ -1,16 +1,10 @@
1
- import { zeroAddress as d } from "../../constants/protocol.constants.mjs";
2
- import { Utxo as c } from "../utxo/Utxo.mjs";
3
- import "ethers";
4
- import { UserKeys as p } from "../crypto-keys/keys.mjs";
5
- import "libsodium-wrappers";
6
- const h = (e) => {
1
+ import { getExtendedRecipientInfoFromUserKeys as t, getRecipientInfoFromUserKeys as n } from "../../functions/utils/getRecipientInfoFromUserKeys.mjs";
2
+ const s = (e, o = !1) => {
7
3
  if (!e)
8
4
  throw Error("No hinkal provided");
9
- const { userKeys: s } = e, t = s.getShieldedPrivateKey(), r = p.getEncryptionKeyPair(t).publicKey, o = new c({ amount: 0n, erc20TokenAddress: d, shieldedPrivateKey: t }), { randomization: n } = o, i = o.getStealthAddress();
10
- if (!n || !i || !r)
11
- throw Error("Cannot get recipient information");
12
- return `${n},${i},${r}`;
5
+ const { userKeys: r } = e;
6
+ return o ? t(r) : n(r);
13
7
  };
14
8
  export {
15
- h as getRecipientInfo
9
+ s as getRecipientInfo
16
10
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("axios");require("../../constants/coingecko.constants.cjs");const s=require("../../API/API.cjs");require("ethers");require("../../types/curve.types.cjs");require("../../constants/token-data/index.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const a=r=>({async getAccessToken(){const e=r.getCurrentChainId();return s.API.getZkMeAccessToken(e)},async getUserAccounts(){return[await r.getEthereumAddress()]},async delegateTransaction(e){const t=await r.getProviderAdapter(),i={...e,chainId:Number(e.chainId),type:e.type?e.type:void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?e.maxPriorityFeePerGas:void 0,maxFeePerGas:e.maxFeePerGas?e.maxFeePerGas:void 0};return(await t.sendTransaction(i)).hash}});exports.getHinkalZkMeProvider=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../API/API.cjs"),n=r=>({async getAccessToken(){const e=r.getCurrentChainId();return a.API.getZkMeAccessToken(e)},async getUserAccounts(){return[await r.getEthereumAddress()]},async delegateTransaction(e){const t=await r.getProviderAdapter(),s={...e,chainId:Number(e.chainId),type:e.type?e.type:void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?e.maxPriorityFeePerGas:void 0,maxFeePerGas:e.maxFeePerGas?e.maxFeePerGas:void 0};return(await t.sendTransaction(s)).hash}});exports.getHinkalZkMeProvider=n;
@@ -1,35 +1,23 @@
1
- import "../../constants/chains.constants.mjs";
2
- import "../../constants/vite.constants.mjs";
3
- import "axios";
4
- import "../../constants/coingecko.constants.mjs";
5
- import { API as s } from "../../API/API.mjs";
6
- import "ethers";
7
- import "../../types/curve.types.mjs";
8
- import "../../constants/token-data/index.mjs";
9
- import "../../constants/contracts.constants.mjs";
10
- import "../../constants/kyc.constants.mjs";
11
- import "../../constants/axelar.constants.mjs";
12
- import "../../constants/rewards.constants.mjs";
13
- import "../../constants/reorg-depths.constants.mjs";
14
- const G = (r) => ({
1
+ import { API as a } from "../../API/API.mjs";
2
+ const d = (r) => ({
15
3
  async getAccessToken() {
16
4
  const e = r.getCurrentChainId();
17
- return s.getZkMeAccessToken(e);
5
+ return a.getZkMeAccessToken(e);
18
6
  },
19
7
  async getUserAccounts() {
20
8
  return [await r.getEthereumAddress()];
21
9
  },
22
10
  async delegateTransaction(e) {
23
- const t = await r.getProviderAdapter(), o = {
11
+ const s = await r.getProviderAdapter(), t = {
24
12
  ...e,
25
13
  chainId: Number(e.chainId),
26
14
  type: e.type ? e.type : void 0,
27
15
  maxPriorityFeePerGas: e.maxPriorityFeePerGas ? e.maxPriorityFeePerGas : void 0,
28
16
  maxFeePerGas: e.maxFeePerGas ? e.maxFeePerGas : void 0
29
17
  };
30
- return (await t.sendTransaction(o)).hash;
18
+ return (await s.sendTransaction(t)).hash;
31
19
  }
32
20
  });
33
21
  export {
34
- G as getHinkalZkMeProvider
22
+ d as getHinkalZkMeProvider
35
23
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("../../error-handling/error-codes.constants.cjs"),L=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),W=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),N=require("../../functions/web3/events/getShieldedBalance.cjs"),b=require("../../functions/web3/functionCalls/estimateGasRelayer.cjs"),B=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),v=require("../../types/external-action.types.cjs"),P=require("../../types/hinkal.types.cjs"),f=require("../../functions/utils/amounts.utils.cjs"),K=require("../../functions/pre-transaction/outputApprovalDataProcessing.cjs"),M=require("../../constants/conversion.constants.cjs"),G=require("../../constants/protocol.constants.cjs"),V=require("../../functions/pre-transaction/merge-with-fee-structure.cjs"),X=require("../../functions/pre-transaction/getFeeStructure.cjs"),D=require("../../types/ethereum-network.types.cjs"),E=require("../../error-handling/logger.cjs"),z=require("../../functions/utils/involves-permit2-op.cjs"),Z=require("../../functions/pre-transaction/getSignatureDataForTransact.cjs"),$=require("../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs"),j=async(t,n,r,o,c,i,U,w=!1)=>{const u={externalActionId:v.ExternalActionId.Wallet,externalAddress:c,externalActionMetadata:i},C=t.getContractWithFetcher(D.ContractType.HinkalContract),l=n.findIndex(e=>e===G.zeroAddress),R=l!==-1&&r[l]<0n?r[l]:0n,p=await X.getFeeStructure(t.getCurrentChainId(),U,n,v.ExternalActionId.Wallet,void 0,[{from:C.address,to:c,value:R,calldata:i}]);V.mergeWithFeeStructure(t.getCurrentChainId(),n,r,p),o=[...o],o.length<r.length&&o.push(0n);const a=[...await N.addPaddingToUtxos(t,n,r)],S=`swapperMHA${r.length.toString()}x${a[0].length}x1`,A=r.map(e=>!(e<0n)),d=[],s={inHinkalAddress:t.userKeys.getInHinkalAddress(c),executeApprovalChanges:o,hinkalLogicAction:P.HinkalLogicAction.EXECUTE,doPreTxApproval:!1,useApprovalUtxoData:[]};for(let e=0;e<n.length;e+=1){const q=A[e]?0n:-(f.absBigInt(r[e])-f.absBigInt(o[e])),{outputUtxos:F}=L.outputUtxoProcessing(t.userKeys,a[e],q,void 0,void 0,!1);d.push(F);const{useApprovalUtxoData:I}=K.outputApprovalDataProcessing(t,a[e],q,c);s.useApprovalUtxoData.push(I??P.defaultUseApprovalUTXOData(M.APPROVED_UTXO_CONVERSION_COUNT,0n)),I&&(s.doPreTxApproval=!0)}const T=await t.getRandomRelay();if(!T)throw Error(H.transactionErrorCodes.RELAYER_NOT_AVAILABLE);E.Logger.log("hinkaInAction",{hinkalLogicArgs:s,deltaChanges:r,approvalChanges:o});const{patchAccessTokenMerkleTree:_,kycRequired:k,hasAccessToken:O}=await $.shouldPatchAccessTokenMerkleTree(t,n,r),h=await Z.getSignatureDataForTransact(t.getCurrentChainId(),await t.getEthereumAddress(),t.userKeys,k,O),{zkCallData:m,circomData:g,dimData:x}=await W.constructZkProof("v1x1",t.merkleTreeHinkal,t.merkleTreeAccessToken,a,d,t.userKeys,S,u.externalActionId,u.externalAddress,u.externalActionMetadata,t.generateProofRemotely,T,t.getCurrentChainId(),A,void 0,void 0,void 0,_,s,void 0,p,t.getContractWithFetcher(D.ContractType.HinkalHelperContract),h),y=z.involvesPermit2Op([i]);return E.Logger.log("hinkalInAction circomData",{circomData:g,withUniswapWorkAround:y}),w?await b.estimateGasRelayer(t,m,x,g):await B.transactCallRelayer(t.getCurrentChainId(),m,x,g,y)};exports.hinkalInsideTransact=j;
@@ -0,0 +1,2 @@
1
+ import { IHinkal } from './IHinkal';
2
+ export declare const hinkalInsideTransact: (hinkal: IHinkal, erc20Addresses: string[], deltaChanges: bigint[], approvalChanges: bigint[], externalAddress: string, externalActionMetadata: string, feeToken?: string, onlyGasEstimate?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
@@ -0,0 +1,111 @@
1
+ import { transactionErrorCodes as F } from "../../error-handling/error-codes.constants.mjs";
2
+ import { outputUtxoProcessing as N } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
3
+ import { constructZkProof as _ } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
4
+ import { addPaddingToUtxos as K } from "../../functions/web3/events/getShieldedBalance.mjs";
5
+ import { estimateGasRelayer as V } from "../../functions/web3/functionCalls/estimateGasRelayer.mjs";
6
+ import { transactCallRelayer as X } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
7
+ import { ExternalActionId as D } from "../../types/external-action.types.mjs";
8
+ import { HinkalLogicAction as z, defaultUseApprovalUTXOData as B } from "../../types/hinkal.types.mjs";
9
+ import { absBigInt as E } from "../../functions/utils/amounts.utils.mjs";
10
+ import { outputApprovalDataProcessing as M } from "../../functions/pre-transaction/outputApprovalDataProcessing.mjs";
11
+ import { APPROVED_UTXO_CONVERSION_COUNT as $ } from "../../constants/conversion.constants.mjs";
12
+ import { zeroAddress as b } from "../../constants/protocol.constants.mjs";
13
+ import { mergeWithFeeStructure as h } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
14
+ import { getFeeStructure as q } from "../../functions/pre-transaction/getFeeStructure.mjs";
15
+ import { ContractType as U } from "../../types/ethereum-network.types.mjs";
16
+ import { Logger as v } from "../../error-handling/logger.mjs";
17
+ import { involvesPermit2Op as G } from "../../functions/utils/involves-permit2-op.mjs";
18
+ import { getSignatureDataForTransact as Y } from "../../functions/pre-transaction/getSignatureDataForTransact.mjs";
19
+ import { shouldPatchAccessTokenMerkleTree as Z } from "../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs";
20
+ const xt = async (t, i, r, e, n, m, w, C = !1) => {
21
+ const s = {
22
+ externalActionId: D.Wallet,
23
+ externalAddress: n,
24
+ externalActionMetadata: m
25
+ }, P = t.getContractWithFetcher(U.HinkalContract), u = i.findIndex((o) => o === b), R = u !== -1 && r[u] < 0n ? r[u] : 0n, f = await q(
26
+ t.getCurrentChainId(),
27
+ w,
28
+ i,
29
+ D.Wallet,
30
+ void 0,
31
+ [{ from: P.address, to: n, value: R, calldata: m }]
32
+ );
33
+ h(t.getCurrentChainId(), i, r, f), e = [...e], e.length < r.length && e.push(0n);
34
+ const a = [...await K(t, i, r)], H = `swapperMHA${r.length.toString()}x${a[0].length}x1`, A = r.map((o) => !(o < 0n)), g = [], c = {
35
+ inHinkalAddress: t.userKeys.getInHinkalAddress(n),
36
+ executeApprovalChanges: e,
37
+ hinkalLogicAction: z.EXECUTE,
38
+ doPreTxApproval: !1,
39
+ useApprovalUtxoData: []
40
+ };
41
+ for (let o = 0; o < i.length; o += 1) {
42
+ const I = A[o] ? 0n : -(E(r[o]) - E(e[o])), { outputUtxos: k } = N(
43
+ t.userKeys,
44
+ a[o],
45
+ I,
46
+ void 0,
47
+ void 0,
48
+ !1
49
+ );
50
+ g.push(k);
51
+ const { useApprovalUtxoData: y } = M(
52
+ t,
53
+ a[o],
54
+ I,
55
+ n
56
+ );
57
+ c.useApprovalUtxoData.push(
58
+ y ?? B($, 0n)
59
+ ), y && (c.doPreTxApproval = !0);
60
+ }
61
+ const l = await t.getRandomRelay();
62
+ if (!l)
63
+ throw Error(F.RELAYER_NOT_AVAILABLE);
64
+ v.log("hinkaInAction", { hinkalLogicArgs: c, deltaChanges: r, approvalChanges: e });
65
+ const { patchAccessTokenMerkleTree: O, kycRequired: L, hasAccessToken: S } = await Z(
66
+ t,
67
+ i,
68
+ r
69
+ ), W = await Y(
70
+ t.getCurrentChainId(),
71
+ await t.getEthereumAddress(),
72
+ t.userKeys,
73
+ L,
74
+ S
75
+ ), { zkCallData: d, circomData: p, dimData: x } = await _(
76
+ "v1x1",
77
+ t.merkleTreeHinkal,
78
+ t.merkleTreeAccessToken,
79
+ a,
80
+ g,
81
+ t.userKeys,
82
+ H,
83
+ s.externalActionId,
84
+ s.externalAddress,
85
+ s.externalActionMetadata,
86
+ t.generateProofRemotely,
87
+ l,
88
+ t.getCurrentChainId(),
89
+ A,
90
+ void 0,
91
+ void 0,
92
+ void 0,
93
+ // stakeArgs
94
+ O,
95
+ c,
96
+ void 0,
97
+ f,
98
+ t.getContractWithFetcher(U.HinkalHelperContract),
99
+ W
100
+ ), T = G([m]);
101
+ return v.log("hinkalInAction circomData", { circomData: p, withUniswapWorkAround: T }), C ? await V(t, d, x, p) : await X(
102
+ t.getCurrentChainId(),
103
+ d,
104
+ x,
105
+ p,
106
+ T
107
+ );
108
+ };
109
+ export {
110
+ xt as hinkalInsideTransact
111
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../error-handling/error-codes.constants.cjs"),s=require("../../functions/utils/addresses.cjs"),d=async(i,a,o,t)=>{let r;return t&&(r=t.map(e=>{if(!s.isValidExtendedPrivateAddress(e))throw Error(n.transactionErrorCodes.RECIPIENT_FORMAT_INCORRECT);return s.constructStealthAddressStructure(e)})),await i.prooflessDeposit(a,o,r)};exports.hinkalMultiSendPrivateRecipients=d;
@@ -0,0 +1,3 @@
1
+ import { type IHinkal } from './IHinkal';
2
+ import { type ERC20Token } from '../../types/token.types';
3
+ export declare const hinkalMultiSendPrivateRecipients: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amounts: bigint[], extendedRecipientInfos?: string[]) => Promise<import("ethers").ContractTransaction>;
@@ -0,0 +1,13 @@
1
+ import { transactionErrorCodes as i } from "../../error-handling/error-codes.constants.mjs";
2
+ import { isValidExtendedPrivateAddress as d, constructStealthAddressStructure as u } from "../../functions/utils/addresses.mjs";
3
+ const E = async (e, o, a, r) => {
4
+ let t;
5
+ return r && (t = r.map((s) => {
6
+ if (!d(s))
7
+ throw Error(i.RECIPIENT_FORMAT_INCORRECT);
8
+ return u(s);
9
+ })), await e.prooflessDeposit(o, a, t);
10
+ };
11
+ export {
12
+ E as hinkalMultiSendPrivateRecipients
13
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../constants/chains.constants.cjs"),x=require("../../error-handling/error-codes.constants.cjs");require("ethers");require("axios");require("../../constants/vite.constants.cjs");require("../../types/circom-data.types.cjs");const A=require("../../types/external-action.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/reorg-depths.constants.cjs");const P=require("../../functions/snarkjs/constructEmporiumProof.cjs"),R=require("../../functions/pre-transaction/processAmountChanges.cjs"),C=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),w=require("../../functions/web3/events/getShieldedBalance.cjs"),U=require("../../functions/web3/functionCalls/estimateGasRelayer.cjs"),I=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),T=async(e,o,r,q,d=[],p,y=!1)=>{const a=o.map(t=>0n);r=R.processAmountChanges({erc20Addresses:o,amountChanges:r,flatFees:a,feeUnit:void 0,externalActionId:A.ExternalActionId.Emporium});const s=[...await w.addPaddingToUtxos(e,o,r)],i=[];for(let t=0;t<o.length;t+=1){const{outputUtxos:E}=C.outputUtxoProcessing(e.userKeys,s[t],r[t]);i.push(E)}const n=await e.getRandomRelay();if(!n)throw Error(x.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const{contractData:g}=f.networkRegistry[e.getCurrentChainId()],{emporiumAddress:c}=g;if(!c)throw Error("No Emporium Address Provided");const{zkCallData:u,circomData:l,dimData:m}=await P.constructEmporiumProof(e.merkleTreeHinkal,e.merkleTreeAccessToken,s,i,e.userKeys,r.length,s[0].length,c,d,e.generateProofRemotely,n,e.getCurrentChainId(),q,a,p);return y?await U.estimateGasRelayer(e,u,m,l):await I.transactCallRelayer(e.getCurrentChainId(),u,m,l)};exports.hinkalPrivateWallet=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("../../constants/chains.constants.cjs"),S=require("../../error-handling/error-codes.constants.cjs");require("ethers");require("axios");require("../../constants/vite.constants.cjs");require("../../types/circom-data.types.cjs");const U=require("../../types/ethereum-network.types.cjs"),_=require("../../types/external-action.types.cjs"),F=require("../../types/hinkal.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/reorg-depths.constants.cjs");const H=require("../../functions/snarkjs/constructEmporiumProof.cjs"),K=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),O=require("../../functions/web3/events/getShieldedBalance.cjs"),W=require("../../functions/web3/functionCalls/estimateGasRelayer.cjs"),h=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),L=require("../../functions/utils/involves-permit2-op.cjs"),M=require("../../functions/pre-transaction/outputApprovalDataProcessing.cjs"),k=require("../../functions/utils/convertEmporiumOpToCallInfo.cjs"),b=require("../../functions/private-wallet/smartContractWalletCalculator.cjs"),B=require("../../functions/pre-transaction/getFeeStructure.cjs"),G=require("../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs"),N=require("../../functions/pre-transaction/getSignatureDataForTransact.cjs"),j=async(e,n,t,q,i=[],u,A,y,v=!1)=>{const C=u===0n?void 0:await b.calculateSmartContractWalletAddressFromNonce(e.getCurrentChainId(),e.userKeys,u??0n),{contractData:T}=R.networkRegistry[e.getCurrentChainId()],{emporiumAddress:o}=T;if(!o)throw Error("No Emporium Address Provided");const P=y??await B.getFeeStructure(e.getCurrentChainId(),A,n,_.ExternalActionId.Emporium,void 0,i.map(r=>k.convertEmporiumOpToCallInfo(r,C??"",o))),s=[...await O.addPaddingToUtxos(e,n,t)],c=[],a=F.defaultHinkalLogicArgs(t.length,e.userKeys);for(let r=0;r<n.length;r+=1){const{outputUtxos:I}=K.outputUtxoProcessing(e.userKeys,s[r],t[r],void 0,void 0,!1);c.push(I);const{useApprovalUtxoData:m}=M.outputApprovalDataProcessing(e,s[r],t[r]);m&&(a.doPreTxApproval=!0,a.useApprovalUtxoData[r]=m,a.interactionAddress=o,a.inHinkalAddress=e.userKeys.getInHinkalAddress(o))}const l=await e.getRandomRelay();if(!l)throw Error(S.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const{patchAccessTokenMerkleTree:f,kycRequired:E,hasAccessToken:w}=await G.shouldPatchAccessTokenMerkleTree(e,n,t),x=await N.getSignatureDataForTransact(e.getCurrentChainId(),await e.getEthereumAddress(),e.userKeys,E,w),{zkCallData:d,circomData:p,dimData:g}=await H.constructEmporiumProof("v1x1",e.merkleTreeHinkal,e.merkleTreeAccessToken,s,c,e.userKeys,t.length,s.length>0?s[0].length:0,o,i,e.generateProofRemotely,l,e.getCurrentChainId(),q,void 0,u,a,f,void 0,P,e.getContractWithFetcher(U.ContractType.HinkalHelperContract),x),D=L.involvesPermit2Op(i);return v?await W.estimateGasRelayer(e,d,g,p):await h.transactCallRelayer(e.getCurrentChainId(),d,g,p,!1,D)};exports.hinkalPrivateWallet=j;
@@ -1,2 +1,3 @@
1
1
  import { IHinkal } from './IHinkal';
2
- export declare const hinkalPrivateWallet: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], onChainCreation: boolean[], ops?: string[], walletNonce?: bigint, onlyGasEstimate?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
2
+ import { FeeStructure } from '../../types/hinkal.types';
3
+ export declare const hinkalPrivateWallet: (hinkal: IHinkal, erc20Addresses: string[], deltaChanges: bigint[], onChainCreation: boolean[], ops?: string[], walletNonce?: bigint, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
@@ -1,62 +1,107 @@
1
- import { networkRegistry as x } from "../../constants/chains.constants.mjs";
2
- import { transactionErrorCodes as A } from "../../error-handling/error-codes.constants.mjs";
1
+ import { networkRegistry as U } from "../../constants/chains.constants.mjs";
2
+ import { transactionErrorCodes as H } from "../../error-handling/error-codes.constants.mjs";
3
3
  import "ethers";
4
4
  import "axios";
5
5
  import "../../constants/vite.constants.mjs";
6
6
  import "../../types/circom-data.types.mjs";
7
- import { ExternalActionId as w } from "../../types/external-action.types.mjs";
7
+ import { ContractType as K } from "../../types/ethereum-network.types.mjs";
8
+ import { ExternalActionId as L } from "../../types/external-action.types.mjs";
9
+ import { defaultHinkalLogicArgs as F } from "../../types/hinkal.types.mjs";
8
10
  import "../../types/transactions.types.mjs";
9
11
  import "../../types/curve.types.mjs";
12
+ import "../../types/activities.types.mjs";
10
13
  import "circomlibjs-hinkal-fork";
11
14
  import "libsodium-wrappers";
12
15
  import "process";
13
16
  import "buffer";
14
17
  import "../../constants/reorg-depths.constants.mjs";
15
- import { constructEmporiumProof as R } from "../../functions/snarkjs/constructEmporiumProof.mjs";
16
- import { processAmountChanges as U } from "../../functions/pre-transaction/processAmountChanges.mjs";
17
- import { outputUtxoProcessing as C } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
18
- import { addPaddingToUtxos as I } from "../../functions/web3/events/getShieldedBalance.mjs";
19
- import { estimateGasRelayer as P } from "../../functions/web3/functionCalls/estimateGasRelayer.mjs";
20
- import { transactCallRelayer as T } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
21
- const X = async (t, e, o, u, d = [], l, E = !1) => {
22
- const m = e.map((r) => 0n);
23
- o = U({
24
- erc20Addresses: e,
25
- amountChanges: o,
26
- flatFees: m,
27
- feeUnit: void 0,
28
- externalActionId: w.Emporium
29
- });
30
- const i = [...await I(t, e, o)], a = [];
31
- for (let r = 0; r < e.length; r += 1) {
32
- const { outputUtxos: g } = C(t.userKeys, i[r], o[r]);
33
- a.push(g);
34
- }
35
- const s = await t.getRandomRelay();
36
- if (!s)
37
- throw Error(A.RELAYER_NOT_AVAILABLE);
38
- const { contractData: y } = x[t.getCurrentChainId()], { emporiumAddress: p } = y;
39
- if (!p)
18
+ import { constructEmporiumProof as S } from "../../functions/snarkjs/constructEmporiumProof.mjs";
19
+ import { outputUtxoProcessing as W } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
20
+ import { addPaddingToUtxos as O } from "../../functions/web3/events/getShieldedBalance.mjs";
21
+ import { estimateGasRelayer as M } from "../../functions/web3/functionCalls/estimateGasRelayer.mjs";
22
+ import { transactCallRelayer as _ } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
23
+ import { involvesPermit2Op as q } from "../../functions/utils/involves-permit2-op.mjs";
24
+ import { outputApprovalDataProcessing as z } from "../../functions/pre-transaction/outputApprovalDataProcessing.mjs";
25
+ import { convertEmporiumOpToCallInfo as B } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
26
+ import { calculateSmartContractWalletAddressFromNonce as G } from "../../functions/private-wallet/smartContractWalletCalculator.mjs";
27
+ import { getFeeStructure as N } from "../../functions/pre-transaction/getFeeStructure.mjs";
28
+ import { shouldPatchAccessTokenMerkleTree as V } from "../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs";
29
+ import { getSignatureDataForTransact as Y } from "../../functions/pre-transaction/getSignatureDataForTransact.mjs";
30
+ const Et = async (t, s, o, A, m = [], p, l, y, v = !1) => {
31
+ const C = p === 0n ? void 0 : await G(
32
+ t.getCurrentChainId(),
33
+ t.userKeys,
34
+ p ?? 0n
35
+ ), { contractData: w } = U[t.getCurrentChainId()], { emporiumAddress: e } = w;
36
+ if (!e)
40
37
  throw Error("No Emporium Address Provided");
41
- const { zkCallData: n, circomData: c, dimData: f } = await R(
38
+ const E = y ?? await N(
39
+ t.getCurrentChainId(),
40
+ l,
41
+ s,
42
+ L.Emporium,
43
+ void 0,
44
+ m.map((r) => B(r, C ?? "", e))
45
+ ), i = [...await O(t, s, o)], n = [], a = F(o.length, t.userKeys);
46
+ for (let r = 0; r < s.length; r += 1) {
47
+ const { outputUtxos: R } = W(
48
+ t.userKeys,
49
+ i[r],
50
+ o[r],
51
+ void 0,
52
+ void 0,
53
+ !1
54
+ );
55
+ n.push(R);
56
+ const { useApprovalUtxoData: g } = z(t, i[r], o[r]);
57
+ g && (a.doPreTxApproval = !0, a.useApprovalUtxoData[r] = g, a.interactionAddress = e, a.inHinkalAddress = t.userKeys.getInHinkalAddress(e));
58
+ }
59
+ const c = await t.getRandomRelay();
60
+ if (!c)
61
+ throw Error(H.RELAYER_NOT_AVAILABLE);
62
+ const { patchAccessTokenMerkleTree: T, kycRequired: x, hasAccessToken: I } = await V(
63
+ t,
64
+ s,
65
+ o
66
+ ), P = await Y(
67
+ t.getCurrentChainId(),
68
+ await t.getEthereumAddress(),
69
+ t.userKeys,
70
+ x,
71
+ I
72
+ ), { zkCallData: u, circomData: d, dimData: f } = await S(
73
+ "v1x1",
42
74
  t.merkleTreeHinkal,
43
75
  t.merkleTreeAccessToken,
44
76
  i,
45
- a,
77
+ n,
46
78
  t.userKeys,
47
79
  o.length,
48
- i[0].length,
49
- p,
50
- d,
80
+ i.length > 0 ? i[0].length : 0,
81
+ e,
82
+ m,
51
83
  t.generateProofRemotely,
52
- s,
84
+ c,
85
+ t.getCurrentChainId(),
86
+ A,
87
+ void 0,
88
+ p,
89
+ a,
90
+ T,
91
+ void 0,
92
+ E,
93
+ t.getContractWithFetcher(K.HinkalHelperContract),
94
+ P
95
+ ), D = q(m);
96
+ return v ? await M(t, u, f, d) : await _(
53
97
  t.getCurrentChainId(),
54
98
  u,
55
- m,
56
- l
99
+ f,
100
+ d,
101
+ !1,
102
+ D
57
103
  );
58
- return E ? await P(t, n, f, c) : await T(t.getCurrentChainId(), n, f, c);
59
104
  };
60
105
  export {
61
- X as hinkalPrivateWallet
106
+ Et as hinkalPrivateWallet
62
107
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../functions/snarkjs/common.snarkjs.cjs"),C=require("../../functions/web3/etherFunctions.cjs"),l=require("../../types/ethereum-network.types.cjs"),k=require("../utxo/Utxo.cjs"),u=require("../../constants/protocol.constants.cjs"),h=require("../../functions/utils/caseInsensitive.utils.cjs"),A=(n,e)=>{const r=[];let o=0;for(let s=0;s<n.length;s+=1){let a=!1;for(let t=0;t<o;t+=1)if(h.caseInsensitiveEqual(r[t].token.erc20TokenAddress,n[s].erc20TokenAddress)){r[t].balance+=e[s],a=!0;break}a||(r[o]={token:n[s],balance:e[s]},o+=1)}return r},y=async(n,e,r)=>{const o=A(e,r),a=n.getContractWithSigner(l.ContractType.HinkalContract).address;for(let t=0;t<o.length;t+=1)h.caseInsensitiveEqual(o[t].token.erc20TokenAddress,u.zeroAddress)&&await n.getContractWithSigner(l.ContractType.ERC20Contract,o[t].token.erc20TokenAddress).approve(a,o[t].balance)},q=async(n,e,r,o)=>{const s=n.getContractWithSigner(l.ContractType.HinkalContract),a=n.userKeys.getShieldedPrivateKey(),t=k.Utxo.findCorrectRandomization(C.randomBigInt(31),a),c=o??Array(e.length).fill(f.calcStealthAddressStructure(t,a));if(c.length!==e.length)throw new Error("Stealth address structures length must be equal to erc20 tokens length");await y(n,e,r);const g=e.findIndex(i=>i.erc20TokenAddress===u.zeroAddress),p=r[g]??0n,d=await s.prooflessDeposit(e.map(({erc20TokenAddress:i})=>i),r,e.map(()=>0n),c,{value:p});return await d.wait(),d};exports.hinkalProoflessDeposit=q;
@@ -0,0 +1,4 @@
1
+ import { ERC20Token } from '../../types/token.types';
2
+ import { IHinkal } from './IHinkal';
3
+ import { StealthAddressStructure } from '../../types/circom-data.types';
4
+ export declare const hinkalProoflessDeposit: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], stealthAddressStructuresOverride?: StealthAddressStructure[]) => Promise<any>;
@@ -0,0 +1,46 @@
1
+ import { calcStealthAddressStructure as m } from "../../functions/snarkjs/common.snarkjs.mjs";
2
+ import { randomBigInt as g } from "../../functions/web3/etherFunctions.mjs";
3
+ import { ContractType as l } from "../../types/ethereum-network.types.mjs";
4
+ import { Utxo as A } from "../utxo/Utxo.mjs";
5
+ import { zeroAddress as f } from "../../constants/protocol.constants.mjs";
6
+ import { caseInsensitiveEqual as h } from "../../functions/utils/caseInsensitive.utils.mjs";
7
+ const C = (r, e) => {
8
+ const n = [];
9
+ let o = 0;
10
+ for (let a = 0; a < r.length; a += 1) {
11
+ let s = !1;
12
+ for (let t = 0; t < o; t += 1)
13
+ if (h(n[t].token.erc20TokenAddress, r[a].erc20TokenAddress)) {
14
+ n[t].balance += e[a], s = !0;
15
+ break;
16
+ }
17
+ s || (n[o] = {
18
+ token: r[a],
19
+ balance: e[a]
20
+ }, o += 1);
21
+ }
22
+ return n;
23
+ }, k = async (r, e, n) => {
24
+ const o = C(e, n), s = r.getContractWithSigner(l.HinkalContract).address;
25
+ for (let t = 0; t < o.length; t += 1)
26
+ h(o[t].token.erc20TokenAddress, f) && await r.getContractWithSigner(
27
+ l.ERC20Contract,
28
+ o[t].token.erc20TokenAddress
29
+ ).approve(s, o[t].balance);
30
+ }, q = async (r, e, n, o) => {
31
+ const a = r.getContractWithSigner(l.HinkalContract), s = r.userKeys.getShieldedPrivateKey(), t = A.findCorrectRandomization(g(31), s), i = o ?? Array(e.length).fill(m(t, s));
32
+ if (i.length !== e.length)
33
+ throw new Error("Stealth address structures length must be equal to erc20 tokens length");
34
+ await k(r, e, n);
35
+ const p = e.findIndex((c) => c.erc20TokenAddress === f), u = n[p] ?? 0n, d = await a.prooflessDeposit(
36
+ e.map(({ erc20TokenAddress: c }) => c),
37
+ n,
38
+ e.map(() => 0n),
39
+ i,
40
+ { value: u }
41
+ );
42
+ return await d.wait(), d;
43
+ };
44
+ export {
45
+ q as hinkalProoflessDeposit
46
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../../constants/addresses.constants.cjs"),w=require("../../functions/pre-transaction/getFeeStructure.cjs"),E=require("../../functions/private-wallet/emporium.swap.helpers.cjs"),h=require("../../functions/private-wallet/smartContractWalletCalculator.cjs"),y=require("../../functions/utils/convertEmporiumOpToCallInfo.cjs"),q=require("../../types/ethereum-network.types.cjs"),v=require("../../types/external-action.types.cjs"),_=async(t,e,n,c,u,r,o,l,p=!1)=>{if(!r)throw Error("hinkalActionReceive: wallet nonce should be provided");if(!o)throw new Error("Fee token is required in hinkalActionReceive");const a=t.getCurrentChainId(),i=await h.calculateSmartContractWalletAddressFromNonce(a,t.userKeys,r),s=E.createSwapToEmporiumOps(t,c,C.SWAP_ROUTER_ADDRESSES[c][a],u,e[0],n[0],e[1],n[1],i,!0),m=t.getContractWithFetcher(q.ContractType.HinkalContract),S=l??await w.getFeeStructure(a,o,e,v.ExternalActionId.Emporium,void 0,s.map(d=>y.convertEmporiumOpToCallInfo(d,i,m.address)));return t.actionPrivateWallet([],[],[],s,r,o,S,p)};exports.hinkalProxySwap=_;
@@ -0,0 +1,5 @@
1
+ import { ExternalActionId } from '../../types/external-action.types';
2
+ import { FeeStructure } from '../../types/hinkal.types';
3
+ import { RelayerTransaction } from '../../types/relayer.types';
4
+ import { IHinkal } from './IHinkal';
5
+ export declare const hinkalProxySwap: (hinkal: IHinkal, erc20Addresses: string[], deltaAmounts: bigint[], externalActionId: ExternalActionId, data: string, walletNonce: bigint, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean) => Promise<RelayerTransaction | bigint>;
@@ -0,0 +1,36 @@
1
+ import { SWAP_ROUTER_ADDRESSES as S } from "../../constants/addresses.constants.mjs";
2
+ import { getFeeStructure as d } from "../../functions/pre-transaction/getFeeStructure.mjs";
3
+ import { createSwapToEmporiumOps as C } from "../../functions/private-wallet/emporium.swap.helpers.mjs";
4
+ import { calculateSmartContractWalletAddressFromNonce as w } from "../../functions/private-wallet/smartContractWalletCalculator.mjs";
5
+ import { convertEmporiumOpToCallInfo as h } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
6
+ import { ContractType as v } from "../../types/ethereum-network.types.mjs";
7
+ import { ExternalActionId as R } from "../../types/external-action.types.mjs";
8
+ const P = async (r, t, a, m, p, o, e, s, u = !1) => {
9
+ if (!o)
10
+ throw Error("hinkalActionReceive: wallet nonce should be provided");
11
+ if (!e)
12
+ throw new Error("Fee token is required in hinkalActionReceive");
13
+ const i = r.getCurrentChainId(), c = await w(i, r.userKeys, o), n = C(
14
+ r,
15
+ m,
16
+ S[m][i],
17
+ p,
18
+ t[0],
19
+ a[0],
20
+ t[1],
21
+ a[1],
22
+ c,
23
+ !0
24
+ ), f = r.getContractWithFetcher(v.HinkalContract), l = s ?? await d(
25
+ i,
26
+ e,
27
+ t,
28
+ R.Emporium,
29
+ void 0,
30
+ n.map((E) => h(E, c, f.address))
31
+ );
32
+ return r.actionPrivateWallet([], [], [], n, o, e, l, u);
33
+ };
34
+ export {
35
+ P as hinkalProxySwap
36
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("ethers"),d=require("../../functions/snarkjs/generateZkProofSelf.cjs");require("../../constants/vite.constants.cjs");const g=require("../../functions/private-wallet/smartContractWalletCalculator.cjs"),y=async(e,r,t,i,n)=>{const{userKeys:o}=e,a=o.getShieldedPrivateKey();i&&(await g.isProxyDeployed(e,t)||await e.deploySubAccount(t,n));const u={dataHash:BigInt(r),shieldedPrivateKey:a,hinkalWalletNonce:t},s="EmporiumSignatureCalculator",{zkCallData:c}=await d.generateZkProofSelf("v1x1",e.getCurrentChainId(),s,u);return l.ethers.utils.defaultAbiCoder.encode(["uint256[2]","uint256[2][2]","uint256[2]","uint256[2]"],c)};exports.hinkalSignSubAccount=y;
@@ -0,0 +1,3 @@
1
+ import { type IHinkal } from './IHinkal';
2
+ export declare const checkValidityOfSignature: (hinkal: IHinkal, walletSalt: string, dataHash: string, signature: string) => Promise<boolean>;
3
+ export declare const hinkalSignSubAccount: (hinkal: IHinkal, dataHash: string, walletNonce: bigint, shouldBeProxyDeployed?: boolean, feeToken?: string) => Promise<string>;
@@ -0,0 +1,20 @@
1
+ import { ethers as d } from "ethers";
2
+ import { generateZkProofSelf as p } from "../../functions/snarkjs/generateZkProofSelf.mjs";
3
+ import "../../constants/vite.constants.mjs";
4
+ import { isProxyDeployed as l } from "../../functions/private-wallet/smartContractWalletCalculator.mjs";
5
+ const h = async (t, i, e, o, r) => {
6
+ const { userKeys: n } = t, a = n.getShieldedPrivateKey();
7
+ o && (await l(t, e) || await t.deploySubAccount(e, r));
8
+ const s = {
9
+ dataHash: BigInt(i),
10
+ shieldedPrivateKey: a,
11
+ hinkalWalletNonce: e
12
+ }, u = "EmporiumSignatureCalculator", { zkCallData: c } = await p("v1x1", t.getCurrentChainId(), u, s);
13
+ return d.utils.defaultAbiCoder.encode(
14
+ ["uint256[2]", "uint256[2][2]", "uint256[2]", "uint256[2]"],
15
+ c
16
+ );
17
+ };
18
+ export {
19
+ h as hinkalSignSubAccount
20
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../../constants/chains.constants.cjs"),I=require("../../error-handling/error-codes.constants.cjs"),m=require("../../functions/pre-transaction/getFlatFees.cjs"),U=require("../../functions/pre-transaction/processAmountChanges.cjs"),P=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),b=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),S=require("../../functions/web3/events/getShieldedBalance.cjs"),T=require("../../functions/web3/functionCalls/estimateGasRelayer.cjs"),D=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),c=require("../../types/external-action.types.cjs"),F=(e,s)=>{const{contractData:t}=q.networkRegistry[e.getCurrentChainId()];let r;switch(s){case c.ExternalActionId.Uniswap:r=t?.uniswapExternalActionAddress;break;case c.ExternalActionId.Odos:r=t?.odosExternalActionInstanceAddress;break;case c.ExternalActionId.OneInch:r=t?.oneInchExternalActionInstanceAddress;break;default:r=t?.uniswapExternalActionAddress;break}if(!r)throw new Error("No external Address set during swap");return r},_=async(e,s,t,r,g,p=!1,w=!1)=>{const{flatFees:i,feeUnit:y}=await m.getFlatFees(e.getCurrentChainId(),s,r,t);t=U.processAmountChanges({erc20Addresses:s,amountChanges:t,flatFees:i,feeUnit:y,externalActionId:r});const E=F(e,r),n={externalActionId:r,externalAddress:E,externalActionMetadata:g},o=[...await S.addPaddingToUtxos(e,s,t)],f=`swapperM${t.length.toString()}x${o[0].length}x1`,C=[!1,!0],l=[];for(let a=0;a<s.length;a+=1){const{outputUtxos:R}=P.outputUtxoProcessing(e.userKeys,o[a],t[a]);l.push(R)}const u=await e.getRandomRelay();if(!u)throw Error(I.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const{zkCallData:d,circomData:A,dimData:x}=await b.constructZkProof(e.merkleTreeHinkal,e.merkleTreeAccessToken,o,l,e.userKeys,f,n.externalActionId,n.externalAddress,n.externalActionMetadata,e.generateProofRemotely,u,e.getCurrentChainId(),C,i);return p?await T.estimateGasRelayer(e,d,x,A):await D.transactCallRelayer(e.getCurrentChainId(),d,x,A,w)};exports.hinkalSwap=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../error-handling/error-codes.constants.cjs"),m=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),U=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),F=require("../../functions/web3/events/getShieldedBalance.cjs"),I=require("../../functions/web3/functionCalls/estimateGasRelayer.cjs"),M=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),_=require("../../functions/pre-transaction/getFeeStructure.cjs"),L=require("../../functions/pre-transaction/merge-with-fee-structure.cjs"),H=require("../../types/external-action.types.cjs"),K=require("../../types/hinkal.types.cjs"),k=require("../../functions/pre-transaction/outputApprovalDataProcessing.cjs"),G=require("../../types/ethereum-network.types.cjs"),N=require("../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs"),W=require("../../functions/pre-transaction/getSignatureDataForTransact.cjs"),b=require("../../functions/pre-transaction/getExternalSwapAddress.cjs"),B=async(e,a,t,c,x,C,T,A=!1,q=!1)=>{const i=T??await _.getFeeStructure(e.getCurrentChainId(),C,a,H.ExternalActionId.Transact);L.mergeWithFeeStructure(e.getCurrentChainId(),a,t,i);const w=b.getExternalSwapAddress(e,c),s={externalActionId:c,externalAddress:w,externalActionMetadata:x},o=[...await F.addPaddingToUtxos(e,a,t)],f=`swapperM${t.length.toString()}x${o[0].length}x1`,S=[!1,!0,!1].slice(0,t.length),u=[],n=K.defaultHinkalLogicArgs(t.length,e.userKeys);for(let r=0;r<a.length;r+=1){const{outputUtxos:D}=m.outputUtxoProcessing(e.userKeys,o[r],t[r],void 0,void 0,!1);u.push(D);const{useApprovalUtxoData:y}=k.outputApprovalDataProcessing(e,o[r],t[r]);y&&(n.useApprovalUtxoData[r]=y,n.doPreTxApproval=!0)}const g=await e.getRandomRelay();if(!g)throw Error(E.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const{patchAccessTokenMerkleTree:v,kycRequired:P,hasAccessToken:R}=await N.shouldPatchAccessTokenMerkleTree(e,a,t),h=await W.getSignatureDataForTransact(e.getCurrentChainId(),await e.getEthereumAddress(),e.userKeys,P,R),{zkCallData:l,circomData:p,dimData:d}=await U.constructZkProof("v1x1",e.merkleTreeHinkal,e.merkleTreeAccessToken,o,u,e.userKeys,f,s.externalActionId,s.externalAddress,s.externalActionMetadata,e.generateProofRemotely,g,e.getCurrentChainId(),S,void 0,void 0,void 0,v,n,void 0,i,e.getContractWithFetcher(G.ContractType.HinkalHelperContract),h);return A?await I.estimateGasRelayer(e,l,d,p):await M.transactCallRelayer(e.getCurrentChainId(),l,d,p,q)};exports.hinkalSwap=B;
@@ -1,3 +1,4 @@
1
1
  import { ExternalActionId } from '../../types/external-action.types';
2
2
  import { IHinkal } from './IHinkal';
3
- export declare const hinkalSwap: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], externalActionId: ExternalActionId, data: string, onlyGasEstimate?: boolean, withPrivateMempool?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
3
+ import { FeeStructure } from '../../types/hinkal.types';
4
+ export declare const hinkalSwap: (hinkal: IHinkal, erc20Addresses: string[], deltaAmounts: bigint[], externalActionId: ExternalActionId, data: string, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean, withPrivateMempool?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;