@hinkal/common 0.2.13 → 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 (656) hide show
  1. package/API/API.cjs +1 -1
  2. package/API/API.d.ts +10 -3
  3. package/API/API.mjs +42 -31
  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 +7 -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/rewardsPointsCalls.cjs +1 -1
  27. package/API/rewardsPointsCalls.d.ts +3 -3
  28. package/API/rewardsPointsCalls.mjs +1 -3
  29. package/API/tenderly.api.cjs +1 -0
  30. package/API/tenderly.api.d.ts +12 -0
  31. package/API/tenderly.api.mjs +47 -0
  32. package/API/token-calls.cjs +1 -0
  33. package/API/token-calls.d.ts +2 -0
  34. package/API/token-calls.mjs +9 -0
  35. package/API/userVerifyTransactions.cjs +1 -1
  36. package/API/userVerifyTransactions.d.ts +6 -7
  37. package/API/userVerifyTransactions.mjs +13 -14
  38. package/constants/addresses.constants.cjs +1 -0
  39. package/constants/addresses.constants.d.ts +16 -0
  40. package/constants/addresses.constants.mjs +50 -0
  41. package/constants/assets.constants.cjs +1 -1
  42. package/constants/assets.constants.mjs +13 -13
  43. package/constants/axelar.constants.cjs +1 -1
  44. package/constants/axelar.constants.mjs +5 -5
  45. package/constants/balance.constants.cjs +1 -0
  46. package/constants/balance.constants.d.ts +1 -0
  47. package/constants/balance.constants.mjs +4 -0
  48. package/constants/chains.constants.cjs +1 -1
  49. package/constants/chains.constants.d.ts +0 -2
  50. package/constants/chains.constants.mjs +28 -40
  51. package/constants/contracts.constants.cjs +1 -1
  52. package/constants/contracts.constants.mjs +144 -140
  53. package/constants/conversion.constants.cjs +1 -0
  54. package/constants/conversion.constants.d.ts +1 -0
  55. package/constants/conversion.constants.mjs +4 -0
  56. package/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
  57. package/constants/deploy-data/deploy-data-arbMainnet.json.mjs +846 -11
  58. package/constants/deploy-data/deploy-data-avalanche.json.cjs +1 -1
  59. package/constants/deploy-data/deploy-data-avalanche.json.mjs +848 -13
  60. package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
  61. package/constants/deploy-data/deploy-data-base.json.mjs +852 -17
  62. package/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +1 -1
  63. package/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +855 -20
  64. package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
  65. package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +850 -15
  66. package/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
  67. package/constants/deploy-data/deploy-data-localhost.json.mjs +3208 -1550
  68. package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
  69. package/constants/deploy-data/deploy-data-optimism.json.mjs +10010 -3429
  70. package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
  71. package/constants/deploy-data/deploy-data-polygon.json.mjs +844 -9
  72. package/constants/fees.constants.cjs +1 -1
  73. package/constants/fees.constants.d.ts +5 -3
  74. package/constants/fees.constants.mjs +22 -19
  75. package/constants/index.d.ts +6 -0
  76. package/constants/kyc.constants.cjs +1 -1
  77. package/constants/kyc.constants.mjs +30 -18
  78. package/constants/mediaUrls.constants.cjs +1 -0
  79. package/constants/mediaUrls.constants.d.ts +23 -0
  80. package/constants/mediaUrls.constants.mjs +26 -0
  81. package/constants/permit2.constants.cjs +1 -0
  82. package/constants/permit2.constants.d.ts +2 -0
  83. package/constants/permit2.constants.mjs +5 -0
  84. package/constants/protocol.constants.cjs +1 -1
  85. package/constants/protocol.constants.d.ts +6 -0
  86. package/constants/protocol.constants.mjs +27 -15
  87. package/constants/rewards.constants.cjs +1 -1
  88. package/constants/rewards.constants.mjs +14 -12
  89. package/constants/server.constants.cjs +1 -1
  90. package/constants/server.constants.d.ts +14 -6
  91. package/constants/server.constants.mjs +24 -16
  92. package/constants/token-data/ERC20Registry.cjs +1 -1
  93. package/constants/token-data/ERC20Registry.mjs +49 -48
  94. package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
  95. package/constants/token-data/arbMainnetRegistry.json.mjs +89 -86
  96. package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
  97. package/constants/token-data/arbMainnetRegistryFixed.json.mjs +79 -76
  98. package/constants/token-data/avalancheRegistry.json.cjs +1 -1
  99. package/constants/token-data/avalancheRegistry.json.mjs +51 -48
  100. package/constants/token-data/avalancheRegistryFixed.json.cjs +1 -1
  101. package/constants/token-data/avalancheRegistryFixed.json.mjs +51 -48
  102. package/constants/token-data/baseRegistry.json.cjs +1 -1
  103. package/constants/token-data/baseRegistry.json.mjs +34 -31
  104. package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
  105. package/constants/token-data/baseRegistryFixed.json.mjs +31 -28
  106. package/constants/token-data/bnbMainnetRegistry.json.cjs +1 -1
  107. package/constants/token-data/bnbMainnetRegistry.json.mjs +67 -64
  108. package/constants/token-data/bnbMainnetRegistryFixed.json.cjs +1 -1
  109. package/constants/token-data/bnbMainnetRegistryFixed.json.mjs +67 -64
  110. package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
  111. package/constants/token-data/ethMainnetRegistry.json.mjs +229 -226
  112. package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
  113. package/constants/token-data/ethMainnetRegistryFixed.json.mjs +193 -190
  114. package/constants/token-data/index.cjs +1 -0
  115. package/constants/token-data/index.d.ts +1063 -15
  116. package/constants/token-data/index.mjs +34 -0
  117. package/constants/token-data/localhostRegistry.json.cjs +1 -1
  118. package/constants/token-data/localhostRegistry.json.mjs +296 -276
  119. package/constants/token-data/optimismRegistry.json.cjs +1 -1
  120. package/constants/token-data/optimismRegistry.json.mjs +703 -180
  121. package/constants/token-data/optimismRegistryFixed.json.cjs +1 -1
  122. package/constants/token-data/optimismRegistryFixed.json.mjs +679 -173
  123. package/constants/token-data/polygonRegistry.json.cjs +1 -1
  124. package/constants/token-data/polygonRegistry.json.mjs +110 -107
  125. package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
  126. package/constants/token-data/polygonRegistryFixed.json.mjs +102 -99
  127. package/constants/token.limits.constants.cjs +1 -0
  128. package/constants/token.limits.constants.d.ts +5 -0
  129. package/constants/token.limits.constants.mjs +30 -0
  130. package/constants/vite.constants.cjs +1 -1
  131. package/constants/vite.constants.d.ts +5 -0
  132. package/constants/vite.constants.mjs +26 -22
  133. package/data-structures/Hinkal/Hinkal.cjs +1 -1
  134. package/data-structures/Hinkal/Hinkal.d.ts +48 -20
  135. package/data-structures/Hinkal/Hinkal.mjs +263 -85
  136. package/data-structures/Hinkal/IHinkal.d.ts +37 -10
  137. package/data-structures/Hinkal/hinkalActionBeefy.cjs +1 -1
  138. package/data-structures/Hinkal/hinkalActionBeefy.mjs +25 -23
  139. package/data-structures/Hinkal/hinkalActionConvex.cjs +1 -1
  140. package/data-structures/Hinkal/hinkalActionConvex.mjs +11 -9
  141. package/data-structures/Hinkal/hinkalActionCurve.cjs +1 -1
  142. package/data-structures/Hinkal/hinkalActionCurve.mjs +18 -16
  143. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +1 -0
  144. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +3 -0
  145. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +61 -0
  146. package/data-structures/Hinkal/hinkalActionLidoEth.cjs +1 -1
  147. package/data-structures/Hinkal/hinkalActionLidoEth.mjs +24 -22
  148. package/data-structures/Hinkal/hinkalActionPendle.cjs +1 -1
  149. package/data-structures/Hinkal/hinkalActionPendle.d.ts +1 -1
  150. package/data-structures/Hinkal/hinkalActionPendle.mjs +17 -15
  151. package/data-structures/Hinkal/hinkalActionPendleLP.cjs +1 -1
  152. package/data-structures/Hinkal/hinkalActionPendleLP.mjs +29 -26
  153. package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -0
  154. package/data-structures/Hinkal/hinkalActionReceive.d.ts +4 -0
  155. package/data-structures/Hinkal/hinkalActionReceive.mjs +39 -0
  156. package/data-structures/Hinkal/hinkalActionStake.cjs +1 -1
  157. package/data-structures/Hinkal/hinkalActionStake.d.ts +1 -1
  158. package/data-structures/Hinkal/hinkalActionStake.mjs +15 -11
  159. package/data-structures/Hinkal/hinkalActionVolatile.cjs +1 -1
  160. package/data-structures/Hinkal/hinkalActionVolatile.d.ts +1 -1
  161. package/data-structures/Hinkal/hinkalActionVolatile.mjs +31 -26
  162. package/data-structures/Hinkal/hinkalApprove.cjs +1 -0
  163. package/data-structures/Hinkal/hinkalApprove.d.ts +2 -0
  164. package/data-structures/Hinkal/hinkalApprove.mjs +120 -0
  165. package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -0
  166. package/data-structures/Hinkal/hinkalCheckTokenRegistry.d.ts +3 -0
  167. package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +12 -0
  168. package/data-structures/Hinkal/hinkalDeploySubAccount.cjs +1 -0
  169. package/data-structures/Hinkal/hinkalDeploySubAccount.d.ts +3 -0
  170. package/data-structures/Hinkal/hinkalDeploySubAccount.mjs +15 -0
  171. package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
  172. package/data-structures/Hinkal/hinkalDeposit.d.ts +3 -2
  173. package/data-structures/Hinkal/hinkalDeposit.mjs +116 -52
  174. package/data-structures/Hinkal/hinkalGetRecipientInfo.cjs +1 -0
  175. package/data-structures/Hinkal/hinkalGetRecipientInfo.d.ts +2 -0
  176. package/data-structures/Hinkal/hinkalGetRecipientInfo.mjs +10 -0
  177. package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
  178. package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +6 -17
  179. package/data-structures/Hinkal/hinkalInsideTransact.cjs +1 -0
  180. package/data-structures/Hinkal/hinkalInsideTransact.d.ts +2 -0
  181. package/data-structures/Hinkal/hinkalInsideTransact.mjs +111 -0
  182. package/data-structures/Hinkal/hinkalMultiSend.cjs +1 -0
  183. package/data-structures/Hinkal/hinkalMultiSend.d.ts +3 -0
  184. package/data-structures/Hinkal/hinkalMultiSend.mjs +13 -0
  185. package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  186. package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -1
  187. package/data-structures/Hinkal/hinkalPrivateWallet.mjs +83 -37
  188. package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -0
  189. package/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +4 -0
  190. package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +46 -0
  191. package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -0
  192. package/data-structures/Hinkal/hinkalProxySwap.d.ts +5 -0
  193. package/data-structures/Hinkal/hinkalProxySwap.mjs +36 -0
  194. package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -0
  195. package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +3 -0
  196. package/data-structures/Hinkal/hinkalSignSubAccount.mjs +20 -0
  197. package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
  198. package/data-structures/Hinkal/hinkalSwap.d.ts +2 -1
  199. package/data-structures/Hinkal/hinkalSwap.mjs +69 -60
  200. package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  201. package/data-structures/Hinkal/hinkalWithdraw.d.ts +3 -1
  202. package/data-structures/Hinkal/hinkalWithdraw.mjs +77 -50
  203. package/data-structures/Hinkal/index.d.ts +1 -0
  204. package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  205. package/data-structures/Hinkal/resetMerkleTrees.mjs +18 -11
  206. package/data-structures/IndexedDB/activity-db.cjs +1 -0
  207. package/data-structures/IndexedDB/activity-db.d.ts +16 -0
  208. package/data-structures/IndexedDB/activity-db.mjs +124 -0
  209. package/data-structures/IndexedDB/balances-db.cjs +1 -0
  210. package/data-structures/IndexedDB/balances-db.d.ts +13 -0
  211. package/data-structures/IndexedDB/balances-db.mjs +75 -0
  212. package/data-structures/IndexedDB/contact-db.cjs +1 -0
  213. package/data-structures/IndexedDB/contact-db.d.ts +11 -0
  214. package/data-structures/IndexedDB/contact-db.mjs +44 -0
  215. package/data-structures/IndexedDB/index.d.ts +5 -0
  216. package/data-structures/IndexedDB/prices-db.cjs +1 -0
  217. package/data-structures/IndexedDB/prices-db.d.ts +9 -0
  218. package/data-structures/IndexedDB/prices-db.mjs +62 -0
  219. package/data-structures/IndexedDB/private-balances-db.cjs +1 -0
  220. package/data-structures/IndexedDB/private-balances-db.d.ts +9 -0
  221. package/data-structures/IndexedDB/private-balances-db.mjs +28 -0
  222. package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
  223. package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +47 -44
  224. package/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -0
  225. package/data-structures/TokenDBs/PrivateTokensDB.d.ts +11 -0
  226. package/data-structures/TokenDBs/PrivateTokensDB.mjs +53 -0
  227. package/data-structures/TokenDBs/PublicTokensDB.cjs +1 -0
  228. package/data-structures/TokenDBs/PublicTokensDB.d.ts +13 -0
  229. package/data-structures/TokenDBs/PublicTokensDB.mjs +81 -0
  230. package/data-structures/TokenDBs/index.d.ts +2 -0
  231. package/data-structures/cacheDevices/AttachableMemoryCacheDevice.cjs +1 -0
  232. package/data-structures/cacheDevices/AttachableMemoryCacheDevice.d.ts +8 -0
  233. package/data-structures/cacheDevices/AttachableMemoryCacheDevice.mjs +28 -0
  234. package/data-structures/cacheDevices/BaseCacheDevice.cjs +1 -1
  235. package/data-structures/cacheDevices/BaseCacheDevice.d.ts +9 -6
  236. package/data-structures/cacheDevices/BaseCacheDevice.mjs +13 -4
  237. package/data-structures/cacheDevices/FileCacheDevice.cjs +1 -1
  238. package/data-structures/cacheDevices/FileCacheDevice.d.ts +1 -0
  239. package/data-structures/cacheDevices/FileCacheDevice.mjs +7 -3
  240. package/data-structures/cacheDevices/LocalStorageCacheDevice.cjs +1 -1
  241. package/data-structures/cacheDevices/LocalStorageCacheDevice.d.ts +2 -1
  242. package/data-structures/cacheDevices/LocalStorageCacheDevice.mjs +10 -5
  243. package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
  244. package/data-structures/crypto-keys/decodeUTXO.mjs +13 -12
  245. package/data-structures/crypto-keys/keys.cjs +1 -1
  246. package/data-structures/crypto-keys/keys.d.ts +13 -3
  247. package/data-structures/crypto-keys/keys.mjs +45 -34
  248. package/data-structures/custom-token-registry/CustomTokenRegistry.cjs +1 -1
  249. package/data-structures/custom-token-registry/CustomTokenRegistry.d.ts +2 -3
  250. package/data-structures/custom-token-registry/CustomTokenRegistry.mjs +17 -21
  251. package/data-structures/event-service/AbstractAccessTokenSnapshotService.cjs +1 -1
  252. package/data-structures/event-service/AbstractAccessTokenSnapshotService.mjs +15 -29
  253. package/data-structures/event-service/AbstractApprovalsSnapshotService.cjs +1 -0
  254. package/data-structures/event-service/AbstractApprovalsSnapshotService.d.ts +30 -0
  255. package/data-structures/event-service/AbstractApprovalsSnapshotService.mjs +104 -0
  256. package/data-structures/event-service/AbstractCommitmentsSnapshotService.cjs +1 -1
  257. package/data-structures/event-service/AbstractCommitmentsSnapshotService.mjs +24 -37
  258. package/data-structures/event-service/AbstractEventService.cjs +1 -1
  259. package/data-structures/event-service/AbstractEventService.d.ts +1 -1
  260. package/data-structures/event-service/AbstractEventService.mjs +15 -15
  261. package/data-structures/event-service/index.d.ts +1 -0
  262. package/data-structures/index.d.ts +2 -0
  263. package/data-structures/merkle-tree/MerkleTree.cjs +1 -1
  264. package/data-structures/merkle-tree/MerkleTree.d.ts +6 -1
  265. package/data-structures/merkle-tree/MerkleTree.mjs +79 -65
  266. package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs +1 -0
  267. package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.ts +3 -0
  268. package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +13 -0
  269. package/data-structures/merkle-tree/index.d.ts +1 -0
  270. package/data-structures/provider-adapter/IProviderAdapter.d.ts +2 -0
  271. package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +1 -1
  272. package/data-structures/snapshot/ClientAccessTokenSnapshotService.mjs +3 -2
  273. package/data-structures/snapshot/ClientApprovalsSnapshotService.cjs +1 -0
  274. package/data-structures/snapshot/ClientApprovalsSnapshotService.d.ts +8 -0
  275. package/data-structures/snapshot/ClientApprovalsSnapshotService.mjs +23 -0
  276. package/data-structures/snapshot/ClientCommitmentsSnapshotService.cjs +1 -1
  277. package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +3 -2
  278. package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +1 -1
  279. package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +6 -5
  280. package/data-structures/token-price-fetcher/TokenChecker.cjs +1 -1
  281. package/data-structures/token-price-fetcher/TokenChecker.d.ts +1 -0
  282. package/data-structures/token-price-fetcher/TokenChecker.mjs +4 -2
  283. package/data-structures/transactions-manager/TransactionsManager.cjs +1 -1
  284. package/data-structures/transactions-manager/TransactionsManager.d.ts +8 -6
  285. package/data-structures/transactions-manager/TransactionsManager.mjs +124 -122
  286. package/data-structures/transactions-manager/history/getBeefyData.cjs +1 -1
  287. package/data-structures/transactions-manager/history/getBeefyData.mjs +3 -2
  288. package/data-structures/transactions-manager/history/getConvexData.cjs +1 -1
  289. package/data-structures/transactions-manager/history/getConvexData.mjs +3 -2
  290. package/data-structures/transactions-manager/history/getCurveData.cjs +1 -1
  291. package/data-structures/transactions-manager/history/getCurveData.mjs +3 -2
  292. package/data-structures/transactions-manager/history/getLidoData.cjs +1 -1
  293. package/data-structures/transactions-manager/history/getLidoData.mjs +3 -2
  294. package/data-structures/transactions-manager/history/getPendleData.cjs +1 -1
  295. package/data-structures/transactions-manager/history/getPendleData.mjs +13 -12
  296. package/data-structures/transactions-manager/history/getTxDetails.cjs +1 -1
  297. package/data-structures/transactions-manager/history/getTxDetails.mjs +22 -20
  298. package/data-structures/transactions-manager/history/getVolatileData.cjs +1 -1
  299. package/data-structures/transactions-manager/history/getVolatileData.mjs +11 -10
  300. package/data-structures/transactions-manager/history/history.types.cjs +1 -1
  301. package/data-structures/transactions-manager/history/history.types.mjs +4 -2
  302. package/data-structures/utxo/Utxo.cjs +1 -1
  303. package/data-structures/utxo/Utxo.d.ts +3 -3
  304. package/data-structures/utxo/Utxo.mjs +8 -7
  305. package/error-handling/error-codes.constants.cjs +2 -2
  306. package/error-handling/error-codes.constants.d.ts +22 -1
  307. package/error-handling/error-codes.constants.mjs +129 -112
  308. package/error-handling/get-error.message.cjs +1 -1
  309. package/error-handling/get-error.message.mjs +29 -25
  310. package/error-handling/index.d.ts +1 -0
  311. package/error-handling/logger.cjs +1 -0
  312. package/error-handling/logger.d.ts +5 -0
  313. package/error-handling/logger.mjs +16 -0
  314. package/error-handling/types.cjs +1 -1
  315. package/error-handling/types.d.ts +3 -1
  316. package/error-handling/types.mjs +2 -2
  317. package/externalABIs/BabPassport.json.cjs +1 -1
  318. package/externalABIs/BabPassport.json.mjs +8 -3
  319. package/externalABIs/BeefyRouterAbi.json.cjs +1 -1
  320. package/externalABIs/BeefyRouterAbi.json.mjs +5 -2
  321. package/externalABIs/BeefyStrategyAbi.json.cjs +1 -1
  322. package/externalABIs/BeefyStrategyAbi.json.mjs +5 -2
  323. package/externalABIs/BeefyVaultAbi.json.cjs +1 -1
  324. package/externalABIs/BeefyVaultAbi.json.mjs +5 -2
  325. package/externalABIs/BeefyZapAbi.json.cjs +1 -1
  326. package/externalABIs/BeefyZapAbi.json.mjs +5 -2
  327. package/externalABIs/BeefyZapOneInchAbi.json.cjs +1 -1
  328. package/externalABIs/BeefyZapOneInchAbi.json.mjs +5 -2
  329. package/externalABIs/ConvexBoosterAbi.json.cjs +1 -1
  330. package/externalABIs/ConvexBoosterAbi.json.mjs +5 -2
  331. package/externalABIs/ConvexBoosterAbiMainnet.json.cjs +1 -1
  332. package/externalABIs/ConvexBoosterAbiMainnet.json.mjs +5 -2
  333. package/externalABIs/ConvexRewardPoolAbi.json.cjs +1 -1
  334. package/externalABIs/ConvexRewardPoolAbi.json.mjs +5 -2
  335. package/externalABIs/CurveReadingWrapperAbi.json.cjs +1 -1
  336. package/externalABIs/CurveReadingWrapperAbi.json.mjs +5 -2
  337. package/externalABIs/CurveWrappedMainPool.json.cjs +1 -1
  338. package/externalABIs/CurveWrappedMainPool.json.mjs +5 -2
  339. package/externalABIs/CurveZap.json.cjs +1 -1
  340. package/externalABIs/CurveZap.json.mjs +5 -2
  341. package/externalABIs/CvxCrvUtilities.json.cjs +1 -1
  342. package/externalABIs/CvxCrvUtilities.json.mjs +5 -2
  343. package/externalABIs/ERC20.json.cjs +1 -1
  344. package/externalABIs/ERC20.json.mjs +20 -3
  345. package/externalABIs/GalxePassport.json.cjs +1 -1
  346. package/externalABIs/GalxePassport.json.mjs +8 -3
  347. package/externalABIs/IQuoterV2.json.cjs +1 -1
  348. package/externalABIs/IQuoterV2.json.mjs +20 -3
  349. package/externalABIs/ISwapRouter.json.cjs +1 -1
  350. package/externalABIs/ISwapRouter.json.mjs +5 -2
  351. package/externalABIs/IUniswapV3Factory.json.cjs +1 -1
  352. package/externalABIs/IUniswapV3Factory.json.mjs +20 -3
  353. package/externalABIs/IUniswapV3Pool.json.cjs +1 -1
  354. package/externalABIs/IUniswapV3Pool.json.mjs +20 -3
  355. package/externalABIs/PendleRouterAbi.json.cjs +1 -1
  356. package/externalABIs/PendleRouterAbi.json.mjs +5 -2
  357. package/externalABIs/UniswapV2PoolAbi.json.cjs +1 -1
  358. package/externalABIs/UniswapV2PoolAbi.json.mjs +16 -3
  359. package/externalABIs/index.cjs +1 -0
  360. package/externalABIs/index.d.ts +307 -11
  361. package/externalABIs/index.mjs +23 -0
  362. package/externalABIs/transactionsProver.json.cjs +1 -1
  363. package/externalABIs/transactionsProver.json.mjs +20 -3
  364. package/functions/kyc/zkMeHelper.cjs +1 -1
  365. package/functions/kyc/zkMeHelper.d.ts +0 -1
  366. package/functions/kyc/zkMeHelper.mjs +8 -11
  367. package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -0
  368. package/functions/pre-transaction/getExternalSwapAddress.d.ts +3 -0
  369. package/functions/pre-transaction/getExternalSwapAddress.mjs +26 -0
  370. package/functions/pre-transaction/getFeeStructure.cjs +1 -0
  371. package/functions/pre-transaction/getFeeStructure.d.ts +4 -0
  372. package/functions/pre-transaction/getFeeStructure.mjs +30 -0
  373. package/functions/pre-transaction/getFlatFees.cjs +1 -1
  374. package/functions/pre-transaction/getFlatFees.d.ts +3 -7
  375. package/functions/pre-transaction/getFlatFees.mjs +52 -46
  376. package/functions/pre-transaction/getSignatureDataForTransact.cjs +1 -0
  377. package/functions/pre-transaction/getSignatureDataForTransact.d.ts +3 -0
  378. package/functions/pre-transaction/getSignatureDataForTransact.mjs +6 -0
  379. package/functions/pre-transaction/index.d.ts +1 -0
  380. package/functions/pre-transaction/interaction-to-action.cjs +1 -1
  381. package/functions/pre-transaction/interaction-to-action.mjs +3 -2
  382. package/functions/pre-transaction/merge-with-fee-structure.cjs +1 -0
  383. package/functions/pre-transaction/merge-with-fee-structure.d.ts +2 -0
  384. package/functions/pre-transaction/merge-with-fee-structure.mjs +25 -0
  385. package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -0
  386. package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +16 -0
  387. package/functions/pre-transaction/outputApprovalDataProcessing.mjs +42 -0
  388. package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
  389. package/functions/pre-transaction/outputUtxoProcessing.d.ts +1 -1
  390. package/functions/pre-transaction/outputUtxoProcessing.mjs +19 -30
  391. package/functions/pre-transaction/process-gas-estimates.cjs +1 -1
  392. package/functions/pre-transaction/process-gas-estimates.d.ts +2 -2
  393. package/functions/pre-transaction/process-gas-estimates.mjs +17 -27
  394. package/functions/pre-transaction/processAmountChanges.cjs +1 -1
  395. package/functions/pre-transaction/processAmountChanges.mjs +34 -23
  396. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -0
  397. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +6 -0
  398. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +7 -0
  399. package/functions/private-wallet/emporium.helpers.cjs +1 -1
  400. package/functions/private-wallet/emporium.helpers.d.ts +9 -1
  401. package/functions/private-wallet/emporium.helpers.mjs +117 -22
  402. package/functions/private-wallet/emporium.swap.helpers.cjs +1 -0
  403. package/functions/private-wallet/emporium.swap.helpers.d.ts +5 -0
  404. package/functions/private-wallet/emporium.swap.helpers.mjs +92 -0
  405. package/functions/private-wallet/index.d.ts +1 -0
  406. package/functions/private-wallet/opProducer.cjs +1 -1
  407. package/functions/private-wallet/opProducer.mjs +9 -10
  408. package/functions/private-wallet/smartContractWalletCalculator.cjs +1 -1
  409. package/functions/private-wallet/smartContractWalletCalculator.d.ts +5 -1
  410. package/functions/private-wallet/smartContractWalletCalculator.mjs +22 -17
  411. package/functions/protocols/convex.protocols.cjs +1 -1
  412. package/functions/protocols/convex.protocols.mjs +11 -8
  413. package/functions/protocols/pendle.helpers.cjs +1 -1
  414. package/functions/protocols/pendle.helpers.mjs +20 -15
  415. package/functions/snarkjs/common.snarkjs.cjs +1 -1
  416. package/functions/snarkjs/common.snarkjs.d.ts +8 -5
  417. package/functions/snarkjs/common.snarkjs.mjs +177 -87
  418. package/functions/snarkjs/constant.cjs +1 -1
  419. package/functions/snarkjs/constant.d.ts +223 -1
  420. package/functions/snarkjs/constant.mjs +315 -94
  421. package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
  422. package/functions/snarkjs/constructEmporiumProof.d.ts +6 -3
  423. package/functions/snarkjs/constructEmporiumProof.mjs +148 -84
  424. package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
  425. package/functions/snarkjs/constructGeneralZkProof.d.ts +5 -3
  426. package/functions/snarkjs/constructGeneralZkProof.mjs +142 -86
  427. package/functions/snarkjs/generateCircomData.cjs +1 -1
  428. package/functions/snarkjs/generateCircomData.d.ts +3 -2
  429. package/functions/snarkjs/generateCircomData.mjs +33 -35
  430. package/functions/snarkjs/generateZkProof.cjs +1 -1
  431. package/functions/snarkjs/generateZkProof.d.ts +2 -2
  432. package/functions/snarkjs/generateZkProof.mjs +4 -15
  433. package/functions/snarkjs/generateZkProofEnclave.cjs +1 -0
  434. package/functions/snarkjs/generateZkProofEnclave.d.ts +6 -0
  435. package/functions/snarkjs/generateZkProofEnclave.mjs +26 -0
  436. package/functions/snarkjs/generateZkProofSelf.cjs +1 -0
  437. package/functions/snarkjs/generateZkProofSelf.d.ts +5 -0
  438. package/functions/snarkjs/generateZkProofSelf.mjs +17 -0
  439. package/functions/snarkjs/getOriginalSender.cjs +1 -0
  440. package/functions/snarkjs/getOriginalSender.d.ts +1 -0
  441. package/functions/snarkjs/getOriginalSender.mjs +5 -0
  442. package/functions/snarkjs/getZKFiles.cjs +1 -1
  443. package/functions/snarkjs/getZKFiles.d.ts +3 -2
  444. package/functions/snarkjs/getZKFiles.mjs +14 -5
  445. package/functions/utils/addresses.cjs +1 -0
  446. package/functions/utils/addresses.d.ts +4 -0
  447. package/functions/utils/addresses.mjs +20 -0
  448. package/functions/utils/amounts.utils.cjs +1 -1
  449. package/functions/utils/amounts.utils.d.ts +4 -1
  450. package/functions/utils/amounts.utils.mjs +29 -27
  451. package/functions/utils/arraysMatch.cjs +1 -0
  452. package/functions/utils/arraysMatch.d.ts +1 -0
  453. package/functions/utils/arraysMatch.mjs +4 -0
  454. package/functions/utils/axelar.utils.cjs +1 -1
  455. package/functions/utils/axelar.utils.d.ts +1 -0
  456. package/functions/utils/axelar.utils.mjs +32 -9
  457. package/functions/utils/cacheDevice.utils.cjs +1 -1
  458. package/functions/utils/cacheDevice.utils.mjs +11 -8
  459. package/functions/utils/cacheFunctions.cjs +1 -1
  460. package/functions/utils/cacheFunctions.d.ts +10 -7
  461. package/functions/utils/cacheFunctions.mjs +62 -39
  462. package/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -0
  463. package/functions/utils/convertEmporiumOpToCallInfo.d.ts +2 -0
  464. package/functions/utils/convertEmporiumOpToCallInfo.mjs +10 -0
  465. package/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
  466. package/functions/utils/convertIntegrationProviderToExternalActionId.d.ts +2 -1
  467. package/functions/utils/convertIntegrationProviderToExternalActionId.mjs +7 -10
  468. package/functions/utils/encodeTokenWithId.cjs +1 -0
  469. package/functions/utils/encodeTokenWithId.d.ts +2 -0
  470. package/functions/utils/encodeTokenWithId.mjs +4 -0
  471. package/functions/utils/encryptInputForEnclave.cjs +1 -0
  472. package/functions/utils/encryptInputForEnclave.d.ts +8 -0
  473. package/functions/utils/encryptInputForEnclave.mjs +43 -0
  474. package/functions/utils/erc20tokenFunctions.cjs +1 -1
  475. package/functions/utils/erc20tokenFunctions.d.ts +8 -2
  476. package/functions/utils/erc20tokenFunctions.mjs +23 -14
  477. package/functions/utils/evmNetworkFunctions.cjs +1 -1
  478. package/functions/utils/evmNetworkFunctions.mjs +7 -4
  479. package/functions/utils/external-action.utils.d.ts +2 -2
  480. package/functions/utils/fees.utils.cjs +1 -0
  481. package/functions/utils/fees.utils.d.ts +2 -0
  482. package/functions/utils/fees.utils.mjs +14 -0
  483. package/functions/utils/getBlockExplorerUrl.cjs +1 -0
  484. package/functions/utils/getBlockExplorerUrl.d.ts +1 -0
  485. package/functions/utils/getBlockExplorerUrl.mjs +6 -0
  486. package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -0
  487. package/functions/utils/getRecipientInfoFromUserKeys.d.ts +3 -0
  488. package/functions/utils/getRecipientInfoFromUserKeys.mjs +18 -0
  489. package/functions/utils/index.d.ts +12 -0
  490. package/functions/utils/involves-permit2-op.cjs +1 -0
  491. package/functions/utils/involves-permit2-op.d.ts +1 -0
  492. package/functions/utils/involves-permit2-op.mjs +5 -0
  493. package/functions/utils/merkleTree.utils.cjs +1 -0
  494. package/functions/utils/merkleTree.utils.d.ts +2 -0
  495. package/functions/utils/merkleTree.utils.mjs +19 -0
  496. package/functions/utils/prepareHinkal.d.ts +6 -0
  497. package/functions/utils/processUseApprovalUtxoData.cjs +1 -0
  498. package/functions/utils/processUseApprovalUtxoData.d.ts +3 -0
  499. package/functions/utils/processUseApprovalUtxoData.mjs +19 -0
  500. package/functions/utils/publicBalance.utils.cjs +1 -0
  501. package/functions/utils/publicBalance.utils.d.ts +5 -0
  502. package/functions/utils/publicBalance.utils.mjs +25 -0
  503. package/functions/utils/replaceAddressInCalldata.cjs +1 -0
  504. package/functions/utils/replaceAddressInCalldata.d.ts +1 -0
  505. package/functions/utils/replaceAddressInCalldata.mjs +7 -0
  506. package/functions/utils/rpc-int-encode.cjs +1 -0
  507. package/functions/utils/rpc-int-encode.d.ts +2 -0
  508. package/functions/utils/rpc-int-encode.mjs +8 -0
  509. package/functions/utils/serialize.utils.cjs +1 -1
  510. package/functions/utils/serialize.utils.d.ts +1 -0
  511. package/functions/utils/serialize.utils.mjs +3 -2
  512. package/functions/utils/string.utils.cjs +1 -1
  513. package/functions/utils/string.utils.d.ts +2 -0
  514. package/functions/utils/string.utils.mjs +28 -14
  515. package/functions/utils/time.utils.cjs +1 -1
  516. package/functions/utils/time.utils.d.ts +1 -0
  517. package/functions/utils/time.utils.mjs +4 -3
  518. package/functions/utils/token-check.utils.cjs +1 -0
  519. package/functions/utils/token-check.utils.d.ts +1 -0
  520. package/functions/utils/token-check.utils.mjs +10 -0
  521. package/functions/utils/upToDateState.cjs +1 -0
  522. package/functions/utils/upToDateState.d.ts +2 -0
  523. package/functions/utils/upToDateState.mjs +11 -0
  524. package/functions/utils/userAgent.cjs +1 -1
  525. package/functions/utils/userAgent.mjs +8 -8
  526. package/functions/web3/events/balanceChangedCustomHandler.cjs +1 -0
  527. package/functions/web3/events/balanceChangedCustomHandler.d.ts +2 -0
  528. package/functions/web3/events/balanceChangedCustomHandler.mjs +14 -0
  529. package/functions/web3/events/balanceChangedHandler.cjs +1 -1
  530. package/functions/web3/events/balanceChangedHandler.mjs +5 -4
  531. package/functions/web3/events/getApprovedBalance.cjs +1 -0
  532. package/functions/web3/events/getApprovedBalance.d.ts +7 -0
  533. package/functions/web3/events/getApprovedBalance.mjs +80 -0
  534. package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  535. package/functions/web3/events/getInputUtxoAndBalance.d.ts +16 -3
  536. package/functions/web3/events/getInputUtxoAndBalance.mjs +128 -46
  537. package/functions/web3/events/getShieldedBalance.cjs +2 -2
  538. package/functions/web3/events/getShieldedBalance.d.ts +1 -1
  539. package/functions/web3/events/getShieldedBalance.mjs +70 -65
  540. package/functions/web3/events/index.d.ts +2 -0
  541. package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
  542. package/functions/web3/functionCalls/accessTokenCalls.d.ts +2 -2
  543. package/functions/web3/functionCalls/accessTokenCalls.mjs +20 -18
  544. package/functions/web3/functionCalls/approveToken.cjs +1 -1
  545. package/functions/web3/functionCalls/approveToken.mjs +8 -7
  546. package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -0
  547. package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +4 -0
  548. package/functions/web3/functionCalls/approveTokensToHinkal.mjs +11 -0
  549. package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
  550. package/functions/web3/functionCalls/estimateGasRelayer.d.ts +2 -2
  551. package/functions/web3/functionCalls/estimateGasRelayer.mjs +14 -8
  552. package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +1 -0
  553. package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +5 -0
  554. package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +32 -0
  555. package/functions/web3/functionCalls/relayFunctions.d.ts +1 -15
  556. package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
  557. package/functions/web3/functionCalls/transactCallDirect.d.ts +2 -2
  558. package/functions/web3/functionCalls/transactCallDirect.mjs +31 -30
  559. package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  560. package/functions/web3/functionCalls/transactCallRelayer.d.ts +2 -2
  561. package/functions/web3/functionCalls/transactCallRelayer.mjs +32 -9
  562. package/functions/web3/getContractMetadata.cjs +1 -0
  563. package/functions/web3/getContractMetadata.d.ts +5 -0
  564. package/functions/web3/getContractMetadata.mjs +30 -0
  565. package/functions/web3/odosAPI.cjs +1 -1
  566. package/functions/web3/odosAPI.d.ts +1 -2
  567. package/functions/web3/odosAPI.mjs +23 -19
  568. package/functions/web3/oneInchAPI.cjs +1 -1
  569. package/functions/web3/oneInchAPI.d.ts +1 -2
  570. package/functions/web3/oneInchAPI.mjs +20 -15
  571. package/functions/web3/runContractFunction.cjs +1 -1
  572. package/functions/web3/runContractFunction.mjs +3 -2
  573. package/functions/web3/uniswapAPI.cjs +1 -1
  574. package/functions/web3/uniswapAPI.d.ts +4 -4
  575. package/functions/web3/uniswapAPI.mjs +57 -43
  576. package/index.cjs +1 -1
  577. package/index.mjs +761 -639
  578. package/package.json +19 -8
  579. package/providers/EthersProviderAdapter.cjs +1 -1
  580. package/providers/EthersProviderAdapter.d.ts +8 -3
  581. package/providers/EthersProviderAdapter.mjs +52 -43
  582. package/providers/WagmiProviderAdapter.cjs +1 -1
  583. package/providers/WagmiProviderAdapter.d.ts +4 -1
  584. package/providers/WagmiProviderAdapter.mjs +53 -56
  585. package/providers/prepareEthersHinkal.cjs +1 -1
  586. package/providers/prepareEthersHinkal.mjs +18 -10
  587. package/providers/prepareWagmiHinkal.cjs +1 -1
  588. package/providers/prepareWagmiHinkal.mjs +18 -10
  589. package/types/API.types.d.ts +21 -0
  590. package/types/ICacheDevice.d.ts +4 -3
  591. package/types/TransactionSimulator.types.d.ts +9 -0
  592. package/types/activities.types.cjs +1 -0
  593. package/types/activities.types.d.ts +45 -0
  594. package/types/activities.types.mjs +13 -0
  595. package/types/balances.types.cjs +1 -0
  596. package/types/balances.types.d.ts +17 -0
  597. package/types/balances.types.mjs +4 -0
  598. package/types/cache.types.cjs +1 -0
  599. package/types/cache.types.d.ts +27 -0
  600. package/types/cache.types.mjs +4 -0
  601. package/types/circom-data.types.d.ts +29 -9
  602. package/types/commitments.types.d.ts +6 -0
  603. package/types/contacts.types.d.ts +5 -0
  604. package/types/crypto.types.d.ts +1 -0
  605. package/types/earlyAccessCode.types.d.ts +4 -0
  606. package/types/ethereum-network.types.cjs +1 -1
  607. package/types/ethereum-network.types.d.ts +8 -3
  608. package/types/ethereum-network.types.mjs +1 -1
  609. package/types/external-action.types.cjs +1 -1
  610. package/types/external-action.types.d.ts +2 -1
  611. package/types/external-action.types.mjs +1 -1
  612. package/types/fee.types.d.ts +9 -0
  613. package/types/hinkal.types.cjs +1 -1
  614. package/types/hinkal.types.d.ts +48 -0
  615. package/types/hinkal.types.mjs +38 -13
  616. package/types/index.d.ts +9 -0
  617. package/types/kyc.types.cjs +1 -1
  618. package/types/kyc.types.d.ts +1 -1
  619. package/types/kyc.types.mjs +1 -1
  620. package/types/remote-proof.types.d.ts +15 -0
  621. package/types/rewards.types.d.ts +9 -0
  622. package/types/sandbox.types.cjs +1 -0
  623. package/types/sandbox.types.d.ts +157 -0
  624. package/types/sandbox.types.mjs +4 -0
  625. package/types/tenderly.api.types.d.ts +180 -0
  626. package/types/time.types.cjs +1 -1
  627. package/types/time.types.mjs +1 -1
  628. package/types/token-with-id.types.d.ts +4 -0
  629. package/types/token.types.d.ts +23 -0
  630. package/types/transactions.types.cjs +1 -1
  631. package/types/transactions.types.d.ts +31 -0
  632. package/types/transactions.types.mjs +8 -5
  633. package/types/wc.types.d.ts +89 -0
  634. package/types/with-id.types.d.ts +3 -0
  635. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
  636. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
  637. package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
  638. package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +26 -26
  639. package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
  640. package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
  641. package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
  642. package/webworker/utxoWorker/utxoWorkerLogic.mjs +58 -50
  643. package/webworker/viteWorkerURL.constant.cjs +3 -3
  644. package/webworker/viteWorkerURL.constant.mjs +3 -3
  645. package/webworker/workerFactory.cjs +1 -1
  646. package/webworker/workerFactory.mjs +2 -2
  647. package/webworker/workerProxy.cjs +1 -1
  648. package/webworker/workerProxy.d.ts +11 -11
  649. package/webworker/workerProxy.mjs +24 -26
  650. package/webworker/zkProofWorker/zkProofWorker.types.d.ts +2 -0
  651. package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
  652. package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
  653. package/webworker/zkProofWorker/zkProofWorkerLogic.cjs +1 -1
  654. package/webworker/zkProofWorker/zkProofWorkerLogic.mjs +47 -61
  655. package/functions/utils/memoize.utils.cjs +0 -1
  656. package/functions/utils/memoize.utils.mjs +0 -14
@@ -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"),b=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),P=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),S=require("../../functions/web3/events/getShieldedBalance.cjs"),T=require("../../functions/web3/functionCalls/estimateGasRelayer.cjs"),h=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),c=require("../../types/external-action.types.cjs"),D=(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},F=async(e,s,t,r,p,g=!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=D(e,r),n={externalActionId:r,externalAddress:E,externalActionMetadata:p},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}=b.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 P.constructZkProof(e.merkleTreeHinkal,e.merkleTreeAccessToken,o,l,e.userKeys,f,n.externalActionId,n.externalAddress,n.externalActionMetadata,u,e.getCurrentChainId(),C,i);return g?await T.estimateGasRelayer(e,d,x,A):await h.transactCallRelayer(e.getCurrentChainId(),d,x,A,w)};exports.hinkalSwap=F;
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>;
@@ -1,76 +1,85 @@
1
- import { networkRegistry as R } from "../../constants/chains.constants.mjs";
2
- import { transactionErrorCodes as I } from "../../error-handling/error-codes.constants.mjs";
3
- import { getFlatFees as U } from "../../functions/pre-transaction/getFlatFees.mjs";
4
- import { processAmountChanges as D } from "../../functions/pre-transaction/processAmountChanges.mjs";
5
- import { outputUtxoProcessing as T } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
6
- import { constructZkProof as b } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
7
- import { addPaddingToUtxos as F } from "../../functions/web3/events/getShieldedBalance.mjs";
8
- import { estimateGasRelayer as L } from "../../functions/web3/functionCalls/estimateGasRelayer.mjs";
9
- import { transactCallRelayer as M } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
10
- import { ExternalActionId as i } from "../../types/external-action.types.mjs";
11
- const N = (t, a) => {
12
- const { contractData: e } = R[t.getCurrentChainId()];
13
- let r;
14
- switch (a) {
15
- case i.Uniswap:
16
- r = e?.uniswapExternalActionAddress;
17
- break;
18
- case i.Odos:
19
- r = e?.odosExternalActionInstanceAddress;
20
- break;
21
- case i.OneInch:
22
- r = e?.oneInchExternalActionInstanceAddress;
23
- break;
24
- default:
25
- r = e?.uniswapExternalActionAddress;
26
- break;
1
+ import { transactionErrorCodes as S } from "../../error-handling/error-codes.constants.mjs";
2
+ import { outputUtxoProcessing as U } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
3
+ import { constructZkProof as L } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
4
+ import { addPaddingToUtxos as M } from "../../functions/web3/events/getShieldedBalance.mjs";
5
+ import { estimateGasRelayer as h } from "../../functions/web3/functionCalls/estimateGasRelayer.mjs";
6
+ import { transactCallRelayer as F } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
7
+ import { getFeeStructure as H } from "../../functions/pre-transaction/getFeeStructure.mjs";
8
+ import { mergeWithFeeStructure as K } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
9
+ import { ExternalActionId as N } from "../../types/external-action.types.mjs";
10
+ import { defaultHinkalLogicArgs as W } from "../../types/hinkal.types.mjs";
11
+ import { outputApprovalDataProcessing as _ } from "../../functions/pre-transaction/outputApprovalDataProcessing.mjs";
12
+ import { ContractType as $ } from "../../types/ethereum-network.types.mjs";
13
+ import { shouldPatchAccessTokenMerkleTree as q } from "../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs";
14
+ import { getSignatureDataForTransact as z } from "../../functions/pre-transaction/getSignatureDataForTransact.mjs";
15
+ import { getExternalSwapAddress as B } from "../../functions/pre-transaction/getExternalSwapAddress.mjs";
16
+ const st = async (t, o, r, n, x, d, C, y = !1, T = !1) => {
17
+ const c = C ?? await H(t.getCurrentChainId(), d, o, N.Transact);
18
+ K(t.getCurrentChainId(), o, r, c);
19
+ const w = B(t, n), s = {
20
+ externalActionId: n,
21
+ externalAddress: w,
22
+ externalActionMetadata: x
23
+ }, a = [...await M(t, o, r)], A = `swapperM${r.length.toString()}x${a[0].length}x1`, v = [!1, !0, !1].slice(0, r.length), p = [], i = W(r.length, t.userKeys);
24
+ for (let e = 0; e < o.length; e += 1) {
25
+ const { outputUtxos: P } = U(
26
+ t.userKeys,
27
+ a[e],
28
+ r[e],
29
+ void 0,
30
+ void 0,
31
+ !1
32
+ );
33
+ p.push(P);
34
+ const { useApprovalUtxoData: l } = _(t, a[e], r[e]);
35
+ l && (i.useApprovalUtxoData[e] = l, i.doPreTxApproval = !0);
27
36
  }
28
- if (!r)
29
- throw new Error("No external Address set during swap");
30
- return r;
31
- }, H = async (t, a, e, r, u, A = !1, x = !1) => {
32
- const { flatFees: c, feeUnit: w } = await U(
37
+ const m = await t.getRandomRelay();
38
+ if (!m)
39
+ throw Error(S.RELAYER_NOT_AVAILABLE);
40
+ const { patchAccessTokenMerkleTree: E, kycRequired: R, hasAccessToken: D } = await q(
41
+ t,
42
+ o,
43
+ r
44
+ ), I = await z(
33
45
  t.getCurrentChainId(),
34
- a,
35
- r,
36
- e
37
- );
38
- e = D({ erc20Addresses: a, amountChanges: e, flatFees: c, feeUnit: w, externalActionId: r });
39
- const E = N(t, r), s = {
40
- externalActionId: r,
41
- externalAddress: E,
42
- externalActionMetadata: u
43
- }, n = [...await F(t, a, e)], g = `swapperM${e.length.toString()}x${n[0].length}x1`, y = [!1, !0], d = [];
44
- for (let o = 0; o < a.length; o += 1) {
45
- const { outputUtxos: C } = T(t.userKeys, n[o], e[o]);
46
- d.push(C);
47
- }
48
- const l = await t.getRandomRelay();
49
- if (!l)
50
- throw Error(I.RELAYER_NOT_AVAILABLE);
51
- const { zkCallData: p, circomData: m, dimData: f } = await b(
46
+ await t.getEthereumAddress(),
47
+ t.userKeys,
48
+ R,
49
+ D
50
+ ), { zkCallData: u, circomData: g, dimData: f } = await L(
51
+ "v1x1",
52
52
  t.merkleTreeHinkal,
53
53
  t.merkleTreeAccessToken,
54
- n,
55
- d,
54
+ a,
55
+ p,
56
56
  t.userKeys,
57
- g,
57
+ A,
58
58
  s.externalActionId,
59
59
  s.externalAddress,
60
60
  s.externalActionMetadata,
61
- l,
61
+ t.generateProofRemotely,
62
+ m,
62
63
  t.getCurrentChainId(),
63
- y,
64
- c
64
+ v,
65
+ void 0,
66
+ void 0,
67
+ void 0,
68
+ E,
69
+ i,
70
+ void 0,
71
+ c,
72
+ t.getContractWithFetcher($.HinkalHelperContract),
73
+ I
65
74
  );
66
- return A ? await L(t, p, f, m) : await M(
75
+ return y ? await h(t, u, f, g) : await F(
67
76
  t.getCurrentChainId(),
68
- p,
77
+ u,
69
78
  f,
70
- m,
71
- x
79
+ g,
80
+ T
72
81
  );
73
82
  };
74
83
  export {
75
- H as hinkalSwap
84
+ st as hinkalSwap
76
85
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../../constants/protocol.constants.cjs"),I=require("../../error-handling/error-codes.constants.cjs"),f=require("../../functions/utils/erc20tokenFunctions.cjs"),m=require("../../functions/pre-transaction/getFlatFees.cjs"),F=require("../../functions/pre-transaction/processAmountChanges.cjs"),D=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),U=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),P=require("../../functions/web3/events/getShieldedBalance.cjs"),R=require("../../functions/web3/functionCalls/estimateGasRelayer.cjs"),_=require("../../functions/web3/functionCalls/transactCallDirect.cjs"),h=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),g=require("../../types/external-action.types.cjs"),M=async(t,o,e,C,n,p=!1)=>{const{flatFees:d,feeUnit:w}=await m.getFlatFees(t.getCurrentChainId(),o,g.ExternalActionId.Transact,e);n||F.processAmountChanges({erc20Addresses:o,amountChanges:e,flatFees:d,feeUnit:w,externalActionId:g.ExternalActionId.Transact});const a=f.getERC20Token(o[0],t.getCurrentChainId());if(!a)throw Error("Deposit Action: No Token Found");const s={externalActionId:0n,externalAddress:C,externalActionMetadata:"0x00"},c=[...await P.addPaddingToUtxos(t,o,e)],q=`swapperM${e.length.toString()}x${c[0].length}x1`,E=[!1],x=[];for(let r=0;r<o.length;r+=1){const{outputUtxos:y}=D.outputUtxoProcessing(t.userKeys,c[r],e[r]);x.push(y)}const A=await t.getRandomRelay();if(!n&&!A)throw Error(I.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const{zkCallData:i,circomData:u,dimData:l}=await U.constructZkProof(t.merkleTreeHinkal,t.merkleTreeAccessToken,c,x,t.userKeys,q,s.externalActionId,s.externalAddress,s.externalActionMetadata,n?T.zeroAddress:A,t.getCurrentChainId(),E,d);if(p)return await R.estimateGasRelayer(t,i,l,u);if(n){if(!a)throw Error("Withdraw Action: No Token Found");return await _.transactCallDirect(t,e[0],a,i,u,l)}return await h.transactCallRelayer(t.getCurrentChainId(),i,l,u)};exports.hinkalWithdraw=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../constants/protocol.constants.cjs"),m=require("../../error-handling/error-codes.constants.cjs"),F=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),I=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),U=require("../../functions/web3/events/getShieldedBalance.cjs"),M=require("../../functions/web3/functionCalls/estimateGasRelayer.cjs"),R=require("../../functions/web3/functionCalls/transactCallDirect.cjs"),_=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),k=require("../../types/external-action.types.cjs"),W=require("../../types/hinkal.types.cjs"),L=require("../../functions/pre-transaction/outputApprovalDataProcessing.cjs"),N=require("../../functions/pre-transaction/getFeeStructure.cjs"),H=require("../../functions/pre-transaction/merge-with-fee-structure.cjs");require("../../types/circom-data.types.cjs");const K=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("../../types/activities.types.cjs");const G=require("../../functions/pre-transaction/getSignatureDataForTransact.cjs"),b=require("../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs"),z=async(e,p,r,C,a,T,w,y=!1)=>{const o=p.map(t=>t.erc20TokenAddress);let c;a||(c=w??await N.getFeeStructure(e.getCurrentChainId(),T,o,k.ExternalActionId.Transact),H.mergeWithFeeStructure(e.getCurrentChainId(),o,r,c));const n=p[0];if(!n)throw Error("Deposit Action: No Token Found");const i={externalActionId:0n,externalAddress:C,externalActionMetadata:"0x00"},s=[...await U.addPaddingToUtxos(e,o,r)],h=`swapperM${r.length.toString()}x${s[0].length}x1`,x=[],u=W.defaultHinkalLogicArgs(r.length,e.userKeys);for(let t=0;t<o.length;t+=1){const{outputUtxos:S}=F.outputUtxoProcessing(e.userKeys,s[t],r[t],void 0,void 0,!1);x.push(S);const{useApprovalUtxoData:q}=L.outputApprovalDataProcessing(e,s[t],r[t]);q&&(u.useApprovalUtxoData[t]=q,u.doPreTxApproval=!0)}const A=await e.getRandomRelay();if(!a&&!A)throw Error(m.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const{patchAccessTokenMerkleTree:v,kycRequired:D,hasAccessToken:P}=await b.shouldPatchAccessTokenMerkleTree(e,o,r),E=await G.getSignatureDataForTransact(e.getCurrentChainId(),await e.getEthereumAddress(),e.userKeys,D,P),{zkCallData:d,circomData:g,dimData:l}=await I.constructZkProof("v1x1",e.merkleTreeHinkal,e.merkleTreeAccessToken,s,x,e.userKeys,h,i.externalActionId,i.externalAddress,i.externalActionMetadata,e.generateProofRemotely,a?f.zeroAddress:A,e.getCurrentChainId(),void 0,void 0,void 0,void 0,v,u,void 0,c,e.getContractWithFetcher(K.ContractType.HinkalHelperContract),E);if(y)return await M.estimateGasRelayer(e,d,l,g);if(a){if(!n)throw Error("Withdraw Action: No Token Found");return await R.transactCallDirect(e,r[0],n,d,g,l)}return await _.transactCallRelayer(e.getCurrentChainId(),d,l,g)};exports.hinkalWithdraw=z;
@@ -1,2 +1,4 @@
1
1
  import { IHinkal } from './IHinkal';
2
- export declare const hinkalWithdraw: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], recipientAddress: string, isRelayerOff: boolean, onlyGasEstimate?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction | import("ethers").ContractTransaction>;
2
+ import { FeeStructure } from '../../types/hinkal.types';
3
+ import { ERC20Token } from '../../types';
4
+ export declare const hinkalWithdraw: (hinkal: IHinkal, erc20Tokens: ERC20Token[], deltaAmounts: bigint[], recipientAddress: string, isRelayerOff: boolean, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean) => Promise<any>;
@@ -1,68 +1,95 @@
1
- import { zeroAddress as T } from "../../constants/protocol.constants.mjs";
2
- import { transactionErrorCodes as I } from "../../error-handling/error-codes.constants.mjs";
3
- import { getERC20Token as y } from "../../functions/utils/erc20tokenFunctions.mjs";
4
- import { getFlatFees as D } from "../../functions/pre-transaction/getFlatFees.mjs";
5
- import { processAmountChanges as U } from "../../functions/pre-transaction/processAmountChanges.mjs";
1
+ import { zeroAddress as U } from "../../constants/protocol.constants.mjs";
2
+ import { transactionErrorCodes as h } from "../../error-handling/error-codes.constants.mjs";
6
3
  import { outputUtxoProcessing as F } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
7
- import { constructZkProof as N } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
8
- import { addPaddingToUtxos as R } from "../../functions/web3/events/getShieldedBalance.mjs";
9
- import { estimateGasRelayer as L } from "../../functions/web3/functionCalls/estimateGasRelayer.mjs";
10
- import { transactCallDirect as M } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
11
- import { transactCallRelayer as P } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
12
- import { ExternalActionId as l } from "../../types/external-action.types.mjs";
13
- const h = async (t, e, r, u, a, A = !1) => {
14
- const { flatFees: x, feeUnit: w } = await D(
15
- t.getCurrentChainId(),
16
- e,
17
- l.Transact,
18
- r
19
- );
20
- a || U({
21
- erc20Addresses: e,
22
- amountChanges: r,
23
- flatFees: x,
24
- feeUnit: w,
25
- externalActionId: l.Transact
26
- });
27
- const n = y(e[0], t.getCurrentChainId());
28
- if (!n)
4
+ import { constructZkProof as L } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
5
+ import { addPaddingToUtxos as M } from "../../functions/web3/events/getShieldedBalance.mjs";
6
+ import { estimateGasRelayer as R } from "../../functions/web3/functionCalls/estimateGasRelayer.mjs";
7
+ import { transactCallDirect as S } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
8
+ import { transactCallRelayer as H } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
9
+ import { ExternalActionId as K } from "../../types/external-action.types.mjs";
10
+ import { defaultHinkalLogicArgs as N } from "../../types/hinkal.types.mjs";
11
+ import { outputApprovalDataProcessing as W } from "../../functions/pre-transaction/outputApprovalDataProcessing.mjs";
12
+ import { getFeeStructure as z } from "../../functions/pre-transaction/getFeeStructure.mjs";
13
+ import { mergeWithFeeStructure as _ } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
14
+ import "../../types/circom-data.types.mjs";
15
+ import { ContractType as $ } from "../../types/ethereum-network.types.mjs";
16
+ import "../../types/transactions.types.mjs";
17
+ import "../../types/curve.types.mjs";
18
+ import "../../types/activities.types.mjs";
19
+ import { getSignatureDataForTransact as q } from "../../functions/pre-transaction/getSignatureDataForTransact.mjs";
20
+ import { shouldPatchAccessTokenMerkleTree as B } from "../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs";
21
+ const pt = async (t, g, e, C, a, w, T, l = !1) => {
22
+ const o = g.map((r) => r.erc20TokenAddress);
23
+ let i;
24
+ a || (i = T ?? await z(t.getCurrentChainId(), w, o, K.Transact), _(t.getCurrentChainId(), o, e, i));
25
+ const c = g[0];
26
+ if (!c)
29
27
  throw Error("Deposit Action: No Token Found");
30
- const i = {
28
+ const n = {
31
29
  externalActionId: 0n,
32
- externalAddress: u,
30
+ externalAddress: C,
33
31
  externalActionMetadata: "0x00"
34
- }, c = [...await R(t, e, r)], g = `swapperM${r.length.toString()}x${c[0].length}x1`, C = [!1], d = [];
35
- for (let o = 0; o < e.length; o += 1) {
36
- const { outputUtxos: E } = F(t.userKeys, c[o], r[o]);
37
- d.push(E);
32
+ }, s = [...await M(t, o, e)], v = `swapperM${e.length.toString()}x${s[0].length}x1`, x = [], m = N(e.length, t.userKeys);
33
+ for (let r = 0; r < o.length; r += 1) {
34
+ const { outputUtxos: P } = F(
35
+ t.userKeys,
36
+ s[r],
37
+ e[r],
38
+ void 0,
39
+ void 0,
40
+ !1
41
+ );
42
+ x.push(P);
43
+ const { useApprovalUtxoData: A } = W(t, s[r], e[r]);
44
+ A && (m.useApprovalUtxoData[r] = A, m.doPreTxApproval = !0);
38
45
  }
39
46
  const f = await t.getRandomRelay();
40
47
  if (!a && !f)
41
- throw Error(I.RELAYER_NOT_AVAILABLE);
42
- const { zkCallData: s, circomData: m, dimData: p } = await N(
48
+ throw Error(h.RELAYER_NOT_AVAILABLE);
49
+ const { patchAccessTokenMerkleTree: y, kycRequired: D, hasAccessToken: E } = await B(
50
+ t,
51
+ o,
52
+ e
53
+ ), I = await q(
54
+ t.getCurrentChainId(),
55
+ await t.getEthereumAddress(),
56
+ t.userKeys,
57
+ D,
58
+ E
59
+ ), { zkCallData: p, circomData: d, dimData: u } = await L(
60
+ "v1x1",
43
61
  t.merkleTreeHinkal,
44
62
  t.merkleTreeAccessToken,
45
- c,
46
- d,
63
+ s,
64
+ x,
47
65
  t.userKeys,
48
- g,
49
- i.externalActionId,
50
- i.externalAddress,
51
- i.externalActionMetadata,
52
- a ? T : f,
66
+ v,
67
+ n.externalActionId,
68
+ n.externalAddress,
69
+ n.externalActionMetadata,
70
+ t.generateProofRemotely,
71
+ a ? U : f,
53
72
  t.getCurrentChainId(),
54
- C,
55
- x
73
+ void 0,
74
+ void 0,
75
+ void 0,
76
+ void 0,
77
+ y,
78
+ m,
79
+ void 0,
80
+ i,
81
+ t.getContractWithFetcher($.HinkalHelperContract),
82
+ I
56
83
  );
57
- if (A)
58
- return await L(t, s, p, m);
84
+ if (l)
85
+ return await R(t, p, u, d);
59
86
  if (a) {
60
- if (!n)
87
+ if (!c)
61
88
  throw Error("Withdraw Action: No Token Found");
62
- return await M(t, r[0], n, s, m, p);
89
+ return await S(t, e[0], c, p, d, u);
63
90
  }
64
- return await P(t.getCurrentChainId(), s, p, m);
91
+ return await H(t.getCurrentChainId(), p, u, d);
65
92
  };
66
93
  export {
67
- h as hinkalWithdraw
94
+ pt as hinkalWithdraw
68
95
  };
@@ -10,3 +10,4 @@ export * from './hinkalTransfer';
10
10
  export * from './hinkalWithdraw';
11
11
  export * from './hinkalPrivateWallet';
12
12
  export * from './resetMerkleTrees';
13
+ export * from './hinkalProxySwap';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../constants/chains.constants.cjs"),n=require("../../functions/web3/events/balanceChangedHandler.cjs");require("../../types/circom-data.types.cjs");const r=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");const s=require("../snapshot/ClientAccessTokenSnapshotService.cjs"),i=require("../snapshot/ClientCommitmentsSnapshotService.cjs"),o=require("../snapshot/ClientNullifierSnapshotService.cjs"),a=async e=>{const{maxPageSize:t}=c.networkRegistry[e.getCurrentChainId()];e.commitmentsSnapshotService?.intervalClear(),e.commitmentsSnapshotService=new i.ClientCommitmentsSnapshotService(e.getContractWithFetcher(r.ContractType.HinkalContract),t),e.nullifierSnapshotService?.intervalClear(),e.nullifierSnapshotService=new o.ClientNullifierSnapshotService(e.getContractWithFetcher(r.ContractType.HinkalContract),t),e.accessTokenSnapshotService?.intervalClear(),e.accessTokenSnapshotService=new s.ClientAccessTokenSnapshotService(e.getContractWithFetcher(r.ContractType.CrossChainAccessTokenContract),t),await Promise.all([e.commitmentsSnapshotService.init(),e.nullifierSnapshotService.init(),e.accessTokenSnapshotService.init()]),e.merkleTreeHinkal=e.commitmentsSnapshotService.merkleTree,e.merkleTreeAccessToken=e.accessTokenSnapshotService.merkleTree,e.nullifiers=e.nullifierSnapshotService.nullifiers,e.encryptedOutputs=e.commitmentsSnapshotService.encryptedOutputs,e.commitmentsSnapshotService.onNewEvent=n.balanceChangedHandler,e.nullifierSnapshotService.onNewEvent=n.balanceChangedHandler};exports.resetMerkleTrees=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../constants/chains.constants.cjs"),n=require("../../functions/web3/events/balanceChangedHandler.cjs");require("../../types/circom-data.types.cjs");const r=require("../../types/ethereum-network.types.cjs");require("../../constants/vite.constants.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("../../types/activities.types.cjs");const c=require("../snapshot/ClientAccessTokenSnapshotService.cjs"),o=require("../snapshot/ClientApprovalsSnapshotService.cjs"),i=require("../snapshot/ClientCommitmentsSnapshotService.cjs"),a=require("../snapshot/ClientNullifierSnapshotService.cjs"),S=async e=>{const{maxPageSize:t}=s.networkRegistry[e.getCurrentChainId()];e.commitmentsSnapshotService?.intervalClear(),e.commitmentsSnapshotService=new i.ClientCommitmentsSnapshotService(e.getContractWithFetcher(r.ContractType.HinkalContract),t),e.nullifierSnapshotService?.intervalClear(),e.nullifierSnapshotService=new a.ClientNullifierSnapshotService(e.getContractWithFetcher(r.ContractType.HinkalContract),t),e.accessTokenSnapshotService?.intervalClear(),e.accessTokenSnapshotService=new c.ClientAccessTokenSnapshotService(e.getContractWithFetcher(r.ContractType.AccessTokenContract),t),e.approvalsSnapshotService?.intervalClear(),e.approvalsSnapshotService=new o.ClientApprovalsSnapshotService(e.getContractWithFetcher(r.ContractType.HinkalContract),t),await Promise.all([e.commitmentsSnapshotService.init(),e.nullifierSnapshotService.init(),e.accessTokenSnapshotService.init(),e.approvalsSnapshotService.init()]),e.merkleTreeHinkal=e.commitmentsSnapshotService.merkleTree,e.merkleTreeAccessToken=e.accessTokenSnapshotService.merkleTree,e.nullifiers=e.nullifierSnapshotService.nullifiers,e.encryptedOutputs=e.commitmentsSnapshotService.encryptedOutputs,e.approvals=e.approvalsSnapshotService.approvals,e.commitmentsSnapshotService.onNewEvent=n.balanceChangedHandler,e.nullifierSnapshotService.onNewEvent=n.balanceChangedHandler};exports.resetMerkleTrees=S;
@@ -1,29 +1,36 @@
1
- import { networkRegistry as n } from "../../constants/chains.constants.mjs";
1
+ import { networkRegistry as c } from "../../constants/chains.constants.mjs";
2
2
  import { balanceChangedHandler as o } from "../../functions/web3/events/balanceChangedHandler.mjs";
3
3
  import "../../types/circom-data.types.mjs";
4
4
  import { ContractType as r } from "../../types/ethereum-network.types.mjs";
5
+ import "../../constants/vite.constants.mjs";
5
6
  import "../../types/transactions.types.mjs";
6
7
  import "../../types/curve.types.mjs";
7
- import { ClientAccessTokenSnapshotService as c } from "../snapshot/ClientAccessTokenSnapshotService.mjs";
8
+ import "../../types/activities.types.mjs";
9
+ import { ClientAccessTokenSnapshotService as s } from "../snapshot/ClientAccessTokenSnapshotService.mjs";
10
+ import { ClientApprovalsSnapshotService as n } from "../snapshot/ClientApprovalsSnapshotService.mjs";
8
11
  import { ClientCommitmentsSnapshotService as i } from "../snapshot/ClientCommitmentsSnapshotService.mjs";
9
- import { ClientNullifierSnapshotService as s } from "../snapshot/ClientNullifierSnapshotService.mjs";
10
- const T = async (e) => {
11
- const { maxPageSize: t } = n[e.getCurrentChainId()];
12
+ import { ClientNullifierSnapshotService as p } from "../snapshot/ClientNullifierSnapshotService.mjs";
13
+ const h = async (e) => {
14
+ const { maxPageSize: t } = c[e.getCurrentChainId()];
12
15
  e.commitmentsSnapshotService?.intervalClear(), e.commitmentsSnapshotService = new i(
13
16
  e.getContractWithFetcher(r.HinkalContract),
14
17
  t
15
- ), e.nullifierSnapshotService?.intervalClear(), e.nullifierSnapshotService = new s(
18
+ ), e.nullifierSnapshotService?.intervalClear(), e.nullifierSnapshotService = new p(
16
19
  e.getContractWithFetcher(r.HinkalContract),
17
20
  t
18
- ), e.accessTokenSnapshotService?.intervalClear(), e.accessTokenSnapshotService = new c(
19
- e.getContractWithFetcher(r.CrossChainAccessTokenContract),
21
+ ), e.accessTokenSnapshotService?.intervalClear(), e.accessTokenSnapshotService = new s(
22
+ e.getContractWithFetcher(r.AccessTokenContract),
23
+ t
24
+ ), e.approvalsSnapshotService?.intervalClear(), e.approvalsSnapshotService = new n(
25
+ e.getContractWithFetcher(r.HinkalContract),
20
26
  t
21
27
  ), await Promise.all([
22
28
  e.commitmentsSnapshotService.init(),
23
29
  e.nullifierSnapshotService.init(),
24
- e.accessTokenSnapshotService.init()
25
- ]), e.merkleTreeHinkal = e.commitmentsSnapshotService.merkleTree, e.merkleTreeAccessToken = e.accessTokenSnapshotService.merkleTree, e.nullifiers = e.nullifierSnapshotService.nullifiers, e.encryptedOutputs = e.commitmentsSnapshotService.encryptedOutputs, e.commitmentsSnapshotService.onNewEvent = o, e.nullifierSnapshotService.onNewEvent = o;
30
+ e.accessTokenSnapshotService.init(),
31
+ e.approvalsSnapshotService.init()
32
+ ]), e.merkleTreeHinkal = e.commitmentsSnapshotService.merkleTree, e.merkleTreeAccessToken = e.accessTokenSnapshotService.merkleTree, e.nullifiers = e.nullifierSnapshotService.nullifiers, e.encryptedOutputs = e.commitmentsSnapshotService.encryptedOutputs, e.approvals = e.approvalsSnapshotService.approvals, e.commitmentsSnapshotService.onNewEvent = o, e.nullifierSnapshotService.onNewEvent = o;
26
33
  };
27
34
  export {
28
- T as resetMerkleTrees
35
+ h as resetMerkleTrees
29
36
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("idb-keyval"),h=require("ethers");require("../../types/circom-data.types.cjs");require("../../constants/vite.constants.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");const y=require("../../types/activities.types.cjs");class S{STORAGE_KEY="tx-activity";generateTxId(){const t=new Date().getTime(),e=Math.random().toString(36).substring(2,15);return`tx_${t}_${e}`}async getTransactionRecord(){return await l.get(this.STORAGE_KEY)||{}}async saveTransactionRecord(t){await l.set(this.STORAGE_KEY,t)}async saveTxRequest(t){const{from:e,to:a,gas:i,gasPrice:s,value:n,chainId:o,status:c,txHash:r,activityType:u,tokensReceive:d,tokensSpend:m,ownerPublicAddress:v,activityIcon:w,dappUrl:p,integrationProvider:x}=t,g=this.generateTxId(),T=await this.getTransactionRecord(),R={id:g,from:e,to:a,gas:i,gasPrice:s,value:n,chainId:o,txHash:r,activityType:u,status:c??y.ActivityStatus.PENDING,timestamp:new Date,tokensReceive:d,tokensSpend:m,ownerPublicAddress:v,activityIcon:w,dappUrl:p,integrationProvider:x};return T[g]=R,console.log({record:T}),await this.saveTransactionRecord(T),g}async getTxRequest(t){return(await this.getTransactionRecord())[t]||null}async getAllTxRequests(t){const e=await this.getTransactionRecord();return Object.values(e).filter(a=>a.chainId===t).sort((a,i)=>new Date(i.timestamp).getTime()-new Date(a.timestamp).getTime())}async updateTxStatusAndHash(t,e,a,i,s,n,o,c){const r=await this.getTxRequest(t);if(!r)throw new Error("Transaction not found");const u=await this.getTransactionRecord(),d={...r,status:e,txHash:a,value:r.value??i,from:r.from??s,to:r.to??n,gas:o,gasPrice:c,timestamp:new Date};return u[t]=d,await this.saveTransactionRecord(u),d}async updateActivity(t,e,a,i,s,n,o,c){try{await this.updateTxStatusAndHash(t,e,a,i,s,n,o,c)}catch(r){console.log("error in updating tx request",r)}}async removePendingTransactions(t){try{const e=await this.getTransactionRecord();delete e[t],await this.saveTransactionRecord(e)}catch(e){console.log("error in deleting tx requests",e)}}async updatePendingTransactions(t,e){try{if(!t.success){await this.updateActivity(e,y.ActivityStatus.FAILED);return}if("tx"in t){const{tx:a}=t;await this.updateActivity(e,y.ActivityStatus.CONFIRMED,a.hash,h.BigNumber.from(a.value??0n).toHexString(),a.from,a.to,h.BigNumber.from(a.gas??0n),h.BigNumber.from(a.gasPrice??0n))}}catch(a){console.log("error in updating pending transactions",a)}}}const A=new S;exports.activityStorage=A;
@@ -0,0 +1,16 @@
1
+ import { Activity, ActivityAddRequest, SandboxResponse } from '../../types';
2
+ declare class ActivityStorage {
3
+ private readonly STORAGE_KEY;
4
+ private generateTxId;
5
+ private getTransactionRecord;
6
+ private saveTransactionRecord;
7
+ saveTxRequest(txRequest: ActivityAddRequest): Promise<string>;
8
+ private getTxRequest;
9
+ getAllTxRequests(chainId: number): Promise<Activity[]>;
10
+ private updateTxStatusAndHash;
11
+ private updateActivity;
12
+ removePendingTransactions(pendingActivityId: string): Promise<void>;
13
+ updatePendingTransactions(transactionResponse: SandboxResponse, pendingActivityId: string): Promise<void>;
14
+ }
15
+ export declare const activityStorage: ActivityStorage;
16
+ export {};