@gurge/sdk 0.3.150 → 0.3.151

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 (837) hide show
  1. package/README.md +43 -29
  2. package/common/src/API/API.cjs +1 -1
  3. package/common/src/API/API.d.ts +21 -46
  4. package/common/src/API/API.mjs +96 -121
  5. package/common/src/API/admin-calls.cjs +1 -1
  6. package/common/src/API/admin-calls.d.ts +1 -1
  7. package/common/src/API/admin-calls.mjs +3 -1
  8. package/common/src/API/callLifiAPI.cjs +1 -1
  9. package/common/src/API/callLifiAPI.d.ts +4 -0
  10. package/common/src/API/callLifiAPI.mjs +7 -2
  11. package/common/src/API/callNearIntentsAPI.cjs +1 -1
  12. package/common/src/API/callNearIntentsAPI.mjs +2 -2
  13. package/common/src/API/callRelayer.cjs +1 -1
  14. package/common/src/API/callRelayer.d.ts +36 -1
  15. package/common/src/API/callRelayer.mjs +7 -1
  16. package/common/src/API/dashboardAccountMemberCalls.cjs +1 -1
  17. package/common/src/API/dashboardAccountMemberCalls.d.ts +15 -0
  18. package/common/src/API/dashboardAccountMemberCalls.mjs +5 -2
  19. package/common/src/API/dashboardPayoutCalls.cjs +1 -1
  20. package/common/src/API/dashboardPayoutCalls.d.ts +2 -1
  21. package/common/src/API/dashboardPayoutCalls.mjs +4 -1
  22. package/common/src/API/dashboardTransactionCalls.cjs +1 -1
  23. package/common/src/API/dashboardTransactionCalls.d.ts +4 -1
  24. package/common/src/API/dashboardTransactionCalls.mjs +2 -2
  25. package/common/src/API/enclaveRecipientInfoCalls.d.ts +0 -2
  26. package/common/src/API/enclaveSignatureCalls.cjs +1 -1
  27. package/common/src/API/enclaveSignatureCalls.d.ts +2 -1
  28. package/common/src/API/enclaveSignatureCalls.mjs +5 -8
  29. package/common/src/API/enclaveUtxoCalls.cjs +1 -1
  30. package/common/src/API/enclaveUtxoCalls.d.ts +40 -27
  31. package/common/src/API/enclaveUtxoCalls.mjs +16 -17
  32. package/common/src/API/evm-rpc-fallback.cjs +1 -0
  33. package/common/src/API/evm-rpc-fallback.d.ts +1 -0
  34. package/common/src/API/evm-rpc-fallback.mjs +17 -0
  35. package/common/src/API/evm-token-assets.d.ts +8 -0
  36. package/common/src/API/getOdosPriceForToken.cjs +1 -0
  37. package/common/src/API/getOdosPriceForToken.d.ts +1 -0
  38. package/common/src/API/getOdosPriceForToken.mjs +14 -0
  39. package/common/src/API/getWebsiteURL.d.ts +1 -3
  40. package/common/src/API/index.cjs +1 -1
  41. package/common/src/API/index.d.ts +2 -3
  42. package/common/src/API/index.mjs +4 -5
  43. package/common/src/API/payoutNotificationStateCalls.cjs +1 -0
  44. package/common/src/API/payoutNotificationStateCalls.d.ts +10 -0
  45. package/common/src/API/payoutNotificationStateCalls.mjs +10 -0
  46. package/common/src/API/privateSendRecipientInfoCalls.cjs +1 -1
  47. package/common/src/API/privateSendRecipientInfoCalls.d.ts +3 -6
  48. package/common/src/API/privateSendRecipientInfoCalls.mjs +12 -6
  49. package/common/src/API/proxyAccountsCalls.cjs +1 -1
  50. package/common/src/API/proxyAccountsCalls.d.ts +2 -3
  51. package/common/src/API/proxyAccountsCalls.mjs +11 -10
  52. package/common/src/API/rewardsUserCalls.cjs +1 -1
  53. package/common/src/API/rewardsUserCalls.d.ts +1 -40
  54. package/common/src/API/rewardsUserCalls.mjs +2 -10
  55. package/common/src/API/route-config.cjs +1 -0
  56. package/common/src/API/route-config.d.ts +1 -0
  57. package/common/src/API/route-config.mjs +26 -0
  58. package/common/src/API/scheduled-transactions-calls.cjs +1 -1
  59. package/common/src/API/scheduled-transactions-calls.d.ts +2 -5
  60. package/common/src/API/scheduled-transactions-calls.mjs +2 -6
  61. package/common/src/API/solana-nft-assets.d.ts +1 -0
  62. package/common/src/API/solana-priority-fee.cjs +1 -0
  63. package/common/src/API/solana-priority-fee.d.ts +3 -0
  64. package/common/src/API/solana-priority-fee.mjs +20 -0
  65. package/common/src/API/solana-rpc-fallback.cjs +1 -0
  66. package/common/src/API/solana-rpc-fallback.d.ts +1 -0
  67. package/common/src/API/solana-rpc-fallback.mjs +13 -0
  68. package/common/src/API/temporaryWalletCalls.cjs +1 -1
  69. package/common/src/API/temporaryWalletCalls.d.ts +3 -5
  70. package/common/src/API/temporaryWalletCalls.mjs +8 -9
  71. package/common/src/API/tenderly.api.cjs +1 -1
  72. package/common/src/API/tenderly.api.d.ts +5 -10
  73. package/common/src/API/tenderly.api.mjs +1 -1
  74. package/common/src/API/weeklyAnalyticCalls.cjs +1 -1
  75. package/common/src/API/weeklyAnalyticCalls.d.ts +1 -11
  76. package/common/src/API/weeklyAnalyticCalls.mjs +2 -5
  77. package/common/src/constants/addresses.constants.cjs +1 -1
  78. package/common/src/constants/addresses.constants.d.ts +4 -46
  79. package/common/src/constants/addresses.constants.mjs +19 -60
  80. package/common/src/constants/balance.constants.cjs +1 -0
  81. package/common/src/constants/balance.constants.d.ts +3 -0
  82. package/common/src/constants/balance.constants.mjs +4 -0
  83. package/common/src/constants/bridging.constants.cjs +1 -1
  84. package/common/src/constants/bridging.constants.d.ts +10 -0
  85. package/common/src/constants/bridging.constants.mjs +2 -1
  86. package/common/src/constants/chains.constants.cjs +1 -1
  87. package/common/src/constants/chains.constants.d.ts +21 -19
  88. package/common/src/constants/chains.constants.mjs +175 -198
  89. package/common/src/constants/coingecko.constants.cjs +1 -1
  90. package/common/src/constants/coingecko.constants.d.ts +3 -1
  91. package/common/src/constants/coingecko.constants.mjs +1 -1
  92. package/common/src/constants/contracts.constants.cjs +1 -1
  93. package/common/src/constants/contracts.constants.d.ts +1 -109
  94. package/common/src/constants/contracts.constants.mjs +16 -34
  95. package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
  96. package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.mjs +8 -9
  97. package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
  98. package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.mjs +7 -6
  99. package/common/src/constants/deploy-data/deploy-data-base.json.cjs +1 -1
  100. package/common/src/constants/deploy-data/deploy-data-base.json.mjs +8 -9
  101. package/common/src/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +1 -0
  102. package/common/src/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +12 -0
  103. package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
  104. package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.mjs +8 -9
  105. package/common/src/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
  106. package/common/src/constants/deploy-data/deploy-data-localhost.json.mjs +0 -3
  107. package/common/src/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
  108. package/common/src/constants/deploy-data/deploy-data-optimism.json.mjs +8 -9
  109. package/common/src/constants/deploy-data/deploy-data-optimismTest.json.cjs +1 -1
  110. package/common/src/constants/deploy-data/deploy-data-optimismTest.json.mjs +5 -9
  111. package/common/src/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
  112. package/common/src/constants/deploy-data/deploy-data-polygon.json.mjs +8 -9
  113. package/common/src/constants/deploy-data/deploy-data-sepoliaTestnet.json.cjs +1 -1
  114. package/common/src/constants/deploy-data/deploy-data-sepoliaTestnet.json.mjs +0 -1
  115. package/common/src/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
  116. package/common/src/constants/deploy-data/deploy-data-solana.json.mjs +2 -2
  117. package/common/src/constants/deploy-data/deploy-data-tempo.json.cjs +1 -1
  118. package/common/src/constants/deploy-data/deploy-data-tempo.json.mjs +7 -7
  119. package/common/src/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -1
  120. package/common/src/constants/deploy-data/deploy-data-tronMainnet.json.mjs +2 -4
  121. package/common/src/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -1
  122. package/common/src/constants/deploy-data/deploy-data-tronNile.json.mjs +2 -4
  123. package/common/src/constants/deploy-data/index.cjs +1 -1
  124. package/common/src/constants/deploy-data/index.d.ts +2 -1
  125. package/common/src/constants/deploy-data/index.mjs +16 -15
  126. package/common/src/constants/deploy-data/shared-deploy-data-evm.json.cjs +1 -1
  127. package/common/src/constants/deploy-data/shared-deploy-data-evm.json.mjs +36 -45
  128. package/common/src/constants/deploy-data/shared-deploy-data-solana.json.cjs +1 -1
  129. package/common/src/constants/deploy-data/shared-deploy-data-solana.json.mjs +1 -1
  130. package/common/src/constants/deploy-data/shared-deploy-data-tron.json.cjs +1 -1
  131. package/common/src/constants/deploy-data/shared-deploy-data-tron.json.mjs +2 -46
  132. package/common/src/constants/enclaveAuth.constants.d.ts +5 -0
  133. package/common/src/constants/events.constants.cjs +1 -1
  134. package/common/src/constants/events.constants.mjs +1 -15
  135. package/common/src/constants/fees.constants.cjs +1 -1
  136. package/common/src/constants/fees.constants.mjs +2 -2
  137. package/common/src/constants/index.cjs +1 -1
  138. package/common/src/constants/index.d.ts +1 -3
  139. package/common/src/constants/index.mjs +1 -1
  140. package/common/src/constants/lifi.constants.cjs +1 -1
  141. package/common/src/constants/lifi.constants.mjs +6 -3
  142. package/common/src/constants/mediaUrls.constants.d.ts +0 -1
  143. package/common/src/constants/okx.constants.d.ts +1 -0
  144. package/common/src/constants/pay.constants.d.ts +1 -0
  145. package/common/src/constants/protocol.constants.cjs +2 -1
  146. package/common/src/constants/protocol.constants.d.ts +22 -12
  147. package/common/src/constants/protocol.constants.mjs +3 -15
  148. package/common/src/constants/server.constants.cjs +1 -1
  149. package/common/src/constants/server.constants.d.ts +14 -36
  150. package/common/src/constants/server.constants.mjs +19 -49
  151. package/common/src/constants/tokens.constants.cjs +1 -1
  152. package/common/src/constants/tokens.constants.d.ts +1 -0
  153. package/common/src/constants/tokens.constants.mjs +4 -1
  154. package/common/src/constants/tx-confirmation.constants.cjs +1 -1
  155. package/common/src/constants/tx-confirmation.constants.d.ts +1 -0
  156. package/common/src/constants/tx-confirmation.constants.mjs +2 -2
  157. package/common/src/crypto/ecdh-sealed-keys.cjs +1 -1
  158. package/common/src/crypto/ecdh-sealed-keys.mjs +17 -2
  159. package/common/src/crypto/index.cjs +1 -1
  160. package/common/src/crypto/index.d.ts +0 -1
  161. package/common/src/crypto/index.mjs +1 -2
  162. package/common/src/data-structures/ApprovalDBs/EventsPublicApprovalsDB.d.ts +1 -2
  163. package/common/src/data-structures/Hinkal/Hinkal.cjs +1 -1
  164. package/common/src/data-structures/Hinkal/Hinkal.d.ts +18 -23
  165. package/common/src/data-structures/Hinkal/Hinkal.mjs +142 -174
  166. package/common/src/data-structures/Hinkal/IHinkal.d.ts +18 -24
  167. package/common/src/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
  168. package/common/src/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
  169. package/common/src/data-structures/Hinkal/handleAutoDepositBack.mjs +36 -35
  170. package/common/src/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
  171. package/common/src/data-structures/Hinkal/hinkalActionReceive.mjs +13 -11
  172. package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.cjs +1 -0
  173. package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.d.ts +6 -0
  174. package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.mjs +100 -0
  175. package/common/src/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -1
  176. package/common/src/data-structures/Hinkal/hinkalClaimUtxo.d.ts +1 -1
  177. package/common/src/data-structures/Hinkal/hinkalClaimUtxo.mjs +40 -50
  178. package/common/src/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
  179. package/common/src/data-structures/Hinkal/hinkalDeposit.d.ts +1 -0
  180. package/common/src/data-structures/Hinkal/hinkalDeposit.mjs +50 -119
  181. package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -1
  182. package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.d.ts +2 -2
  183. package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.mjs +113 -109
  184. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
  185. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +3 -2
  186. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +98 -64
  187. package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
  188. package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +20 -7
  189. package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +50 -48
  190. package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.cjs +1 -1
  191. package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.mjs +8 -3
  192. package/common/src/data-structures/Hinkal/hinkalPalEvmDeposit.d.ts +1 -1
  193. package/common/src/data-structures/Hinkal/hinkalPalTronDepositPrepare.d.ts +2 -2
  194. package/common/src/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  195. package/common/src/data-structures/Hinkal/hinkalPrivateWallet.mjs +50 -38
  196. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
  197. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +2 -3
  198. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.mjs +52 -117
  199. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.cjs +1 -1
  200. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.d.ts +3 -0
  201. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.mjs +26 -32
  202. package/common/src/data-structures/Hinkal/hinkalProxySend.cjs +1 -0
  203. package/common/src/data-structures/Hinkal/hinkalProxySend.d.ts +6 -0
  204. package/common/src/data-structures/Hinkal/hinkalProxySend.mjs +16 -0
  205. package/common/src/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
  206. package/common/src/data-structures/Hinkal/hinkalProxySwap.d.ts +1 -1
  207. package/common/src/data-structures/Hinkal/hinkalProxySwap.mjs +13 -12
  208. package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
  209. package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.mjs +19 -17
  210. package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
  211. package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.d.ts +1 -1
  212. package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +50 -79
  213. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
  214. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +2 -2
  215. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.mjs +47 -51
  216. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  217. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +8 -4
  218. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +115 -133
  219. package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -1
  220. package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +1 -1
  221. package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +16 -12
  222. package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
  223. package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.mjs +1 -3
  224. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
  225. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +24 -2
  226. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +82 -56
  227. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
  228. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +1 -1
  229. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +11 -13
  230. package/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.cjs +1 -0
  231. package/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.d.ts +8 -0
  232. package/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.mjs +32 -0
  233. package/common/src/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
  234. package/common/src/data-structures/Hinkal/hinkalSolanaSwap.mjs +58 -79
  235. package/common/src/data-structures/Hinkal/hinkalSolanaTransact.cjs +1 -0
  236. package/common/src/data-structures/Hinkal/hinkalSolanaTransact.d.ts +3 -0
  237. package/common/src/data-structures/Hinkal/hinkalSolanaTransact.mjs +119 -0
  238. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
  239. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +2 -30
  240. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.mjs +46 -77
  241. package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
  242. package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +1 -1
  243. package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +46 -57
  244. package/common/src/data-structures/Hinkal/hinkalSwap.cjs +1 -1
  245. package/common/src/data-structures/Hinkal/hinkalSwap.d.ts +1 -1
  246. package/common/src/data-structures/Hinkal/hinkalSwap.mjs +32 -32
  247. package/common/src/data-structures/Hinkal/hinkalTransact.cjs +1 -0
  248. package/common/src/data-structures/Hinkal/hinkalTransact.d.ts +3 -0
  249. package/common/src/data-structures/Hinkal/hinkalTransact.mjs +106 -0
  250. package/common/src/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
  251. package/common/src/data-structures/Hinkal/hinkalTransfer.mjs +39 -44
  252. package/common/src/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  253. package/common/src/data-structures/Hinkal/hinkalWithdraw.d.ts +1 -1
  254. package/common/src/data-structures/Hinkal/hinkalWithdraw.mjs +38 -49
  255. package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  256. package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +160 -102
  257. package/common/src/data-structures/Hinkal/index.d.ts +2 -1
  258. package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.d.ts +27 -0
  259. package/common/src/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  260. package/common/src/data-structures/Hinkal/resetMerkleTrees.mjs +7 -6
  261. package/common/src/data-structures/IndexedDB/activity-db.cjs +1 -1
  262. package/common/src/data-structures/IndexedDB/activity-db.mjs +34 -34
  263. package/common/src/data-structures/IndexedDB/contact-db.cjs +1 -1
  264. package/common/src/data-structures/IndexedDB/contact-db.d.ts +0 -1
  265. package/common/src/data-structures/IndexedDB/contact-db.mjs +14 -28
  266. package/common/src/data-structures/IndexedDB/index.cjs +1 -1
  267. package/common/src/data-structures/IndexedDB/index.d.ts +1 -0
  268. package/common/src/data-structures/IndexedDB/index.mjs +1 -0
  269. package/common/src/data-structures/IndexedDB/key-val-store.cjs +1 -1
  270. package/common/src/data-structures/IndexedDB/key-val-store.d.ts +2 -0
  271. package/common/src/data-structures/IndexedDB/key-val-store.mjs +14 -0
  272. package/common/src/data-structures/IndexedDB/pay-activity-db.cjs +1 -1
  273. package/common/src/data-structures/IndexedDB/pay-activity-db.mjs +43 -1
  274. package/common/src/data-structures/IndexedDB/private-balances-db.cjs +1 -1
  275. package/common/src/data-structures/IndexedDB/private-balances-db.d.ts +1 -0
  276. package/common/src/data-structures/IndexedDB/private-balances-db.mjs +3 -0
  277. package/common/src/data-structures/IndexedDB/scheduled-transactions-db.cjs +1 -0
  278. package/common/src/data-structures/IndexedDB/scheduled-transactions-db.d.ts +11 -0
  279. package/common/src/data-structures/IndexedDB/scheduled-transactions-db.mjs +34 -0
  280. package/common/src/data-structures/IndexedDB/signatures-db.cjs +1 -1
  281. package/common/src/data-structures/IndexedDB/signatures-db.mjs +11 -11
  282. package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
  283. package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.ts +1 -0
  284. package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +29 -26
  285. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.d.ts +0 -1
  286. package/common/src/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
  287. package/common/src/data-structures/TokenDBs/PrivateTokensDB.mjs +17 -18
  288. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.d.ts +1 -0
  289. package/common/src/data-structures/WalletManager/WalletManager.d.ts +1 -0
  290. package/common/src/data-structures/cacheDevices/BaseCacheDevice.cjs +1 -1
  291. package/common/src/data-structures/cacheDevices/BaseCacheDevice.d.ts +1 -0
  292. package/common/src/data-structures/cacheDevices/BaseCacheDevice.mjs +3 -0
  293. package/common/src/data-structures/cacheDevices/FileCacheDevice.cjs +1 -1
  294. package/common/src/data-structures/cacheDevices/FileCacheDevice.d.ts +3 -0
  295. package/common/src/data-structures/cacheDevices/FileCacheDevice.mjs +12 -3
  296. package/common/src/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
  297. package/common/src/data-structures/crypto-keys/decodeUTXO.d.ts +9 -9
  298. package/common/src/data-structures/crypto-keys/decodeUTXO.mjs +11 -71
  299. package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
  300. package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.d.ts +2 -3
  301. package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.mjs +39 -23
  302. package/common/src/data-structures/crypto-keys/keys.cjs +1 -1
  303. package/common/src/data-structures/crypto-keys/keys.d.ts +13 -27
  304. package/common/src/data-structures/crypto-keys/keys.mjs +64 -79
  305. package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
  306. package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +3 -2
  307. package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.mjs +46 -38
  308. package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +1 -1
  309. package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +1 -1
  310. package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +2 -2
  311. package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
  312. package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +27 -23
  313. package/common/src/data-structures/merkle-tree/MerkleTree.cjs +1 -1
  314. package/common/src/data-structures/merkle-tree/MerkleTree.d.ts +11 -0
  315. package/common/src/data-structures/merkle-tree/MerkleTree.mjs +12 -1
  316. package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.cjs +1 -1
  317. package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.d.ts +4 -0
  318. package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.mjs +100 -86
  319. package/common/src/data-structures/provider-adapter/IProviderAdapter.d.ts +1 -5
  320. package/common/src/data-structures/token-price-fetcher/TokenChecker.cjs +1 -1
  321. package/common/src/data-structures/token-price-fetcher/TokenChecker.d.ts +1 -0
  322. package/common/src/data-structures/token-price-fetcher/TokenChecker.mjs +5 -3
  323. package/common/src/data-structures/utxo/Utxo.cjs +1 -1
  324. package/common/src/data-structures/utxo/Utxo.d.ts +1 -4
  325. package/common/src/data-structures/utxo/Utxo.mjs +7 -17
  326. package/common/src/error-handling/error-codes.constants.cjs +2 -2
  327. package/common/src/error-handling/error-codes.constants.d.ts +14 -14
  328. package/common/src/error-handling/error-codes.constants.mjs +30 -32
  329. package/common/src/error-handling/get-error.message.cjs +1 -1
  330. package/common/src/error-handling/get-error.message.mjs +28 -18
  331. package/common/src/error-handling/index.cjs +1 -1
  332. package/common/src/error-handling/index.d.ts +1 -0
  333. package/common/src/error-handling/index.mjs +1 -0
  334. package/common/src/externalABIs/index.cjs +1 -1
  335. package/common/src/externalABIs/index.d.ts +1 -113
  336. package/common/src/externalABIs/index.mjs +2 -6
  337. package/common/src/functions/auto-deposit-back-helpers/get-gas-token-records.cjs +1 -1
  338. package/common/src/functions/auto-deposit-back-helpers/get-gas-token-records.mjs +7 -6
  339. package/common/src/functions/auto-deposit-back-helpers/select-gas-token.cjs +1 -1
  340. package/common/src/functions/auto-deposit-back-helpers/select-gas-token.mjs +8 -8
  341. package/common/src/functions/index.cjs +1 -1
  342. package/common/src/functions/index.d.ts +0 -1
  343. package/common/src/functions/index.mjs +21 -20
  344. package/common/src/functions/pre-transaction/buildCommitmentValidationData.cjs +1 -1
  345. package/common/src/functions/pre-transaction/buildCommitmentValidationData.mjs +36 -38
  346. package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.cjs +1 -1
  347. package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.mjs +38 -5
  348. package/common/src/functions/pre-transaction/ensureAmountChanges.cjs +1 -1
  349. package/common/src/functions/pre-transaction/ensureAmountChanges.mjs +3 -10
  350. package/common/src/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
  351. package/common/src/functions/pre-transaction/getExternalSwapAddress.mjs +2 -18
  352. package/common/src/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
  353. package/common/src/functions/pre-transaction/getSolanaCalldataHash.d.ts +1 -1
  354. package/common/src/functions/pre-transaction/getSolanaCalldataHash.mjs +11 -10
  355. package/common/src/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
  356. package/common/src/functions/pre-transaction/getVolatileTransferAmount.mjs +1 -1
  357. package/common/src/functions/pre-transaction/index.cjs +1 -1
  358. package/common/src/functions/pre-transaction/index.d.ts +2 -2
  359. package/common/src/functions/pre-transaction/index.mjs +2 -3
  360. package/common/src/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
  361. package/common/src/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +2 -2
  362. package/common/src/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
  363. package/common/src/functions/pre-transaction/outputUtxoProcessing.d.ts +2 -1
  364. package/common/src/functions/pre-transaction/outputUtxoProcessing.mjs +19 -18
  365. package/common/src/functions/pre-transaction/sendV0Transaction.cjs +2 -2
  366. package/common/src/functions/pre-transaction/sendV0Transaction.d.ts +5 -2
  367. package/common/src/functions/pre-transaction/sendV0Transaction.mjs +4 -4
  368. package/common/src/functions/pre-transaction/solana-public-signals.d.ts +1 -0
  369. package/common/src/functions/pre-transaction/solana.cjs +1 -1
  370. package/common/src/functions/pre-transaction/solana.d.ts +13 -0
  371. package/common/src/functions/pre-transaction/solana.mjs +46 -21
  372. package/common/src/functions/pre-transaction/solanaTransfer.utils.cjs +1 -1
  373. package/common/src/functions/pre-transaction/solanaTransfer.utils.mjs +16 -15
  374. package/common/src/functions/pre-transaction/speculativeUtxo.cjs +1 -0
  375. package/common/src/functions/pre-transaction/speculativeUtxo.d.ts +9 -0
  376. package/common/src/functions/pre-transaction/speculativeUtxo.mjs +19 -0
  377. package/common/src/functions/pre-transaction/store-proof.cjs +1 -1
  378. package/common/src/functions/pre-transaction/store-proof.d.ts +1 -1
  379. package/common/src/functions/pre-transaction/store-proof.mjs +1 -0
  380. package/common/src/functions/private-wallet/emporium.helpers.cjs +1 -1
  381. package/common/src/functions/private-wallet/emporium.helpers.d.ts +9 -3
  382. package/common/src/functions/private-wallet/emporium.helpers.mjs +116 -72
  383. package/common/src/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
  384. package/common/src/functions/private-wallet/emporium.swap.helpers.d.ts +0 -1
  385. package/common/src/functions/private-wallet/emporium.swap.helpers.mjs +38 -80
  386. package/common/src/functions/private-wallet/index.cjs +1 -1
  387. package/common/src/functions/private-wallet/index.d.ts +0 -1
  388. package/common/src/functions/private-wallet/index.mjs +0 -1
  389. package/common/src/functions/snarkjs/common.snarkjs.cjs +1 -1
  390. package/common/src/functions/snarkjs/common.snarkjs.d.ts +4 -4
  391. package/common/src/functions/snarkjs/common.snarkjs.mjs +104 -65
  392. package/common/src/functions/snarkjs/constant.cjs +1 -1
  393. package/common/src/functions/snarkjs/constant.d.ts +231 -144
  394. package/common/src/functions/snarkjs/constant.mjs +231 -145
  395. package/common/src/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
  396. package/common/src/functions/snarkjs/constructGeneralZkProof.d.ts +1 -1
  397. package/common/src/functions/snarkjs/constructGeneralZkProof.mjs +85 -69
  398. package/common/src/functions/snarkjs/constructSignatureFromMnemonicProofInput.cjs +1 -0
  399. package/common/src/functions/snarkjs/constructSignatureFromMnemonicProofInput.d.ts +7 -0
  400. package/common/src/functions/snarkjs/constructSignatureFromMnemonicProofInput.mjs +2 -0
  401. package/common/src/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
  402. package/common/src/functions/snarkjs/constructSolanaZkProof.d.ts +4 -1
  403. package/common/src/functions/snarkjs/constructSolanaZkProof.mjs +62 -61
  404. package/common/src/functions/snarkjs/constructTxEnclave.cjs +1 -0
  405. package/common/src/functions/snarkjs/constructTxEnclave.d.ts +34 -0
  406. package/common/src/functions/snarkjs/constructTxEnclave.mjs +95 -0
  407. package/common/src/functions/snarkjs/constructTxEnclaveVerify.cjs +1 -0
  408. package/common/src/functions/snarkjs/constructTxEnclaveVerify.d.ts +5 -0
  409. package/common/src/functions/snarkjs/constructTxEnclaveVerify.mjs +295 -0
  410. package/common/src/functions/snarkjs/fetchMerkleTreeSiblings.d.ts +1 -3
  411. package/common/src/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -1
  412. package/common/src/functions/snarkjs/fetchOnChainRootHashes.d.ts +1 -0
  413. package/common/src/functions/snarkjs/fetchOnChainRootHashes.mjs +16 -18
  414. package/common/src/functions/snarkjs/fetchTronInsertionSiblings.cjs +1 -0
  415. package/common/src/functions/snarkjs/fetchTronInsertionSiblings.d.ts +7 -0
  416. package/common/src/functions/snarkjs/fetchTronInsertionSiblings.mjs +13 -0
  417. package/common/src/functions/snarkjs/generateCircomData.cjs +1 -1
  418. package/common/src/functions/snarkjs/generateCircomData.d.ts +1 -1
  419. package/common/src/functions/snarkjs/generateCircomData.mjs +41 -31
  420. package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.cjs +1 -1
  421. package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.d.ts +1 -1
  422. package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.mjs +7 -7
  423. package/common/src/functions/snarkjs/generateSignatureFromMnemonicProof.cjs +1 -0
  424. package/common/src/functions/snarkjs/generateSignatureFromMnemonicProof.d.ts +2 -0
  425. package/common/src/functions/snarkjs/generateSignatureFromMnemonicProof.mjs +3 -0
  426. package/common/src/functions/snarkjs/generateZkProof.cjs +1 -1
  427. package/common/src/functions/snarkjs/generateZkProof.d.ts +1 -1
  428. package/common/src/functions/snarkjs/generateZkProof.mjs +9 -16
  429. package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -1
  430. package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +4 -2
  431. package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +19 -13
  432. package/common/src/functions/snarkjs/getZKFiles.cjs +1 -1
  433. package/common/src/functions/snarkjs/getZKFiles.mjs +9 -3
  434. package/common/src/functions/snarkjs/index.cjs +1 -1
  435. package/common/src/functions/snarkjs/index.d.ts +2 -0
  436. package/common/src/functions/snarkjs/index.mjs +2 -0
  437. package/common/src/functions/snarkjs/signedMessageHash.cjs +1 -1
  438. package/common/src/functions/snarkjs/signedMessageHash.d.ts +16 -0
  439. package/common/src/functions/snarkjs/signedMessageHash.mjs +36 -7
  440. package/common/src/functions/snarkjs/verifySignedEnclaveResponse.cjs +1 -0
  441. package/common/src/functions/snarkjs/verifySignedEnclaveResponse.d.ts +1 -0
  442. package/common/src/functions/snarkjs/verifySignedEnclaveResponse.mjs +11 -0
  443. package/common/src/functions/utils/addresses.cjs +1 -1
  444. package/common/src/functions/utils/addresses.d.ts +2 -1
  445. package/common/src/functions/utils/addresses.mjs +30 -21
  446. package/common/src/functions/utils/bridge-arrival.utils.cjs +1 -0
  447. package/common/src/functions/utils/bridge-arrival.utils.d.ts +1 -0
  448. package/common/src/functions/utils/bridge-arrival.utils.mjs +16 -0
  449. package/common/src/functions/utils/bridge-claimable-utxo.utils.cjs +1 -0
  450. package/common/src/functions/utils/bridge-claimable-utxo.utils.d.ts +19 -0
  451. package/common/src/functions/utils/bridge-claimable-utxo.utils.mjs +24 -0
  452. package/common/src/functions/utils/bridge-claimable.utils.cjs +1 -0
  453. package/common/src/functions/utils/bridge-claimable.utils.d.ts +15 -0
  454. package/common/src/functions/utils/bridge-claimable.utils.mjs +3 -0
  455. package/common/src/functions/utils/bridge-flow.utils.cjs +1 -0
  456. package/common/src/functions/utils/bridge-flow.utils.d.ts +4 -0
  457. package/common/src/functions/utils/bridge-flow.utils.mjs +2 -0
  458. package/common/src/functions/utils/buildClaimableDepositPlan.d.ts +3 -2
  459. package/common/src/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
  460. package/common/src/functions/utils/convertEmporiumOpToCallInfo.mjs +5 -10
  461. package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
  462. package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.mjs +1 -1
  463. package/common/src/functions/utils/create-provider.cjs +1 -1
  464. package/common/src/functions/utils/create-provider.d.ts +9 -2
  465. package/common/src/functions/utils/create-provider.mjs +45 -9
  466. package/common/src/functions/utils/deposit-claimable.utils.cjs +1 -1
  467. package/common/src/functions/utils/deposit-claimable.utils.d.ts +2 -5
  468. package/common/src/functions/utils/deposit-claimable.utils.mjs +3 -6
  469. package/common/src/functions/utils/enclave-recipient-info-storage.cjs +1 -1
  470. package/common/src/functions/utils/enclave-recipient-info-storage.d.ts +4 -1
  471. package/common/src/functions/utils/enclave-recipient-info-storage.mjs +1 -0
  472. package/common/src/functions/utils/enclave-signature-storage.cjs +1 -1
  473. package/common/src/functions/utils/enclave-signature-storage.d.ts +1 -1
  474. package/common/src/functions/utils/enclave-signature-storage.mjs +3 -3
  475. package/common/src/functions/utils/enclave-utxo-storage.cjs +1 -1
  476. package/common/src/functions/utils/enclave-utxo-storage.d.ts +6 -7
  477. package/common/src/functions/utils/enclave-utxo-storage.mjs +16 -2
  478. package/common/src/functions/utils/enclaveSessionSigning.cjs +1 -0
  479. package/common/src/functions/utils/enclaveSessionSigning.d.ts +16 -0
  480. package/common/src/functions/utils/enclaveSessionSigning.mjs +2 -0
  481. package/common/src/functions/utils/encodeTokenWithId.cjs +1 -1
  482. package/common/src/functions/utils/encodeTokenWithId.d.ts +1 -2
  483. package/common/src/functions/utils/encodeTokenWithId.mjs +2 -5
  484. package/common/src/functions/utils/encryptInputForEnclave.cjs +1 -1
  485. package/common/src/functions/utils/encryptInputForEnclave.d.ts +8 -0
  486. package/common/src/functions/utils/encryptInputForEnclave.mjs +43 -23
  487. package/common/src/functions/utils/erc20tokenFunctions.cjs +1 -1
  488. package/common/src/functions/utils/erc20tokenFunctions.mjs +2 -15
  489. package/common/src/functions/utils/fees.utils.cjs +1 -1
  490. package/common/src/functions/utils/fees.utils.d.ts +3 -0
  491. package/common/src/functions/utils/fees.utils.mjs +42 -29
  492. package/common/src/functions/utils/formatter.d.ts +2 -0
  493. package/common/src/functions/utils/getDataFromTransaction.d.ts +4 -3
  494. package/common/src/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
  495. package/common/src/functions/utils/getRecipientInfoFromUserKeys.mjs +2 -3
  496. package/common/src/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
  497. package/common/src/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
  498. package/common/src/functions/utils/getUtxosFromReceipt.utils.mjs +2 -26
  499. package/common/src/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
  500. package/common/src/functions/utils/getUtxosFromReceiptSolana.mjs +7 -24
  501. package/common/src/functions/utils/index.cjs +1 -1
  502. package/common/src/functions/utils/index.d.ts +17 -3
  503. package/common/src/functions/utils/index.mjs +27 -13
  504. package/common/src/functions/utils/ipfs.d.ts +2 -3
  505. package/common/src/functions/utils/legacyKeys.cjs +1 -0
  506. package/common/src/functions/utils/legacyKeys.d.ts +10 -0
  507. package/common/src/functions/utils/legacyKeys.mjs +8 -0
  508. package/common/src/functions/utils/lifi.utils.d.ts +3 -0
  509. package/common/src/functions/utils/mnemonics.cjs +1 -1
  510. package/common/src/functions/utils/mnemonics.mjs +4 -6
  511. package/common/src/functions/utils/nearIntents.utils.cjs +1 -1
  512. package/common/src/functions/utils/nearIntents.utils.mjs +27 -13
  513. package/common/src/functions/utils/networks.utils.d.ts +1 -0
  514. package/common/src/functions/utils/prepareHinkal.cjs +1 -1
  515. package/common/src/functions/utils/prepareHinkal.d.ts +1 -3
  516. package/common/src/functions/utils/prepareHinkal.mjs +2 -1
  517. package/common/src/functions/utils/process.utils.cjs +1 -1
  518. package/common/src/functions/utils/process.utils.d.ts +0 -1
  519. package/common/src/functions/utils/process.utils.mjs +2 -11
  520. package/common/src/functions/utils/proxyAvatar.utils.cjs +1 -0
  521. package/common/src/functions/utils/proxyAvatar.utils.mjs +3 -0
  522. package/common/src/functions/utils/publicBalance.utils.cjs +1 -1
  523. package/common/src/functions/utils/publicBalance.utils.d.ts +0 -1
  524. package/common/src/functions/utils/publicBalance.utils.mjs +37 -23
  525. package/common/src/functions/utils/recovery-balance.utils.cjs +1 -0
  526. package/common/src/functions/utils/recovery-balance.utils.d.ts +2 -0
  527. package/common/src/functions/utils/recovery-balance.utils.mjs +1 -0
  528. package/common/src/functions/utils/resolve-domain-address.cjs +1 -0
  529. package/common/src/functions/utils/resolve-domain-address.d.ts +4 -0
  530. package/common/src/functions/utils/resolve-domain-address.mjs +3 -0
  531. package/common/src/functions/utils/serialize-utxos.utils.cjs +1 -1
  532. package/common/src/functions/utils/serialize-utxos.utils.mjs +6 -4
  533. package/common/src/functions/utils/solana-program.utils.cjs +1 -0
  534. package/common/src/functions/utils/solana-program.utils.d.ts +3 -0
  535. package/common/src/functions/utils/solana-program.utils.mjs +17 -0
  536. package/common/src/functions/utils/solana-sponsored.utils.cjs +1 -0
  537. package/common/src/functions/utils/solana-sponsored.utils.d.ts +22 -0
  538. package/common/src/functions/utils/solana-sponsored.utils.mjs +30 -0
  539. package/common/src/functions/utils/solanaMint.utils.cjs +1 -1
  540. package/common/src/functions/utils/solanaMint.utils.d.ts +7 -0
  541. package/common/src/functions/utils/solanaMint.utils.mjs +18 -8
  542. package/common/src/functions/utils/sponsored-shield.utils.cjs +1 -0
  543. package/common/src/functions/utils/sponsored-shield.utils.d.ts +3 -0
  544. package/common/src/functions/utils/sponsored-shield.utils.mjs +3 -0
  545. package/common/src/functions/utils/temp-wallet.utils.cjs +1 -0
  546. package/common/src/functions/utils/temp-wallet.utils.d.ts +8 -0
  547. package/common/src/functions/utils/temp-wallet.utils.mjs +43 -0
  548. package/common/src/functions/utils/temporary-wallet-recovery.utils.cjs +1 -0
  549. package/common/src/functions/utils/temporary-wallet-recovery.utils.d.ts +7 -0
  550. package/common/src/functions/utils/temporary-wallet-recovery.utils.mjs +10 -0
  551. package/common/src/functions/utils/transfer-claimable.utils.cjs +1 -1
  552. package/common/src/functions/utils/transfer-claimable.utils.d.ts +1 -2
  553. package/common/src/functions/utils/transfer-claimable.utils.mjs +1 -4
  554. package/common/src/functions/utils/tron.utils.cjs +1 -1
  555. package/common/src/functions/utils/tron.utils.d.ts +5 -14
  556. package/common/src/functions/utils/tron.utils.mjs +89 -152
  557. package/common/src/functions/utils/tronSimulation.utils.cjs +1 -1
  558. package/common/src/functions/utils/tronSimulation.utils.mjs +4 -6
  559. package/common/src/functions/utils/tx-confirmation.utils.cjs +1 -1
  560. package/common/src/functions/utils/tx-confirmation.utils.d.ts +1 -0
  561. package/common/src/functions/utils/tx-confirmation.utils.mjs +16 -13
  562. package/common/src/functions/utils/validateWalletAddress.cjs +1 -0
  563. package/common/src/functions/utils/validateWalletAddress.d.ts +1 -0
  564. package/common/src/functions/utils/validateWalletAddress.mjs +2 -0
  565. package/common/src/functions/utils/voidWallets.utils.cjs +1 -0
  566. package/common/src/functions/utils/voidWallets.utils.d.ts +4 -0
  567. package/common/src/functions/utils/voidWallets.utils.mjs +1 -0
  568. package/common/src/functions/utils/waasStamp.cjs +1 -0
  569. package/common/src/functions/utils/waasStamp.d.ts +5 -0
  570. package/common/src/functions/utils/waasStamp.mjs +2 -0
  571. package/common/src/functions/web3/connectors.utils.d.ts +1 -0
  572. package/common/src/functions/web3/etherFunctions.d.ts +1 -0
  573. package/common/src/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  574. package/common/src/functions/web3/events/getInputUtxoAndBalance.d.ts +5 -12
  575. package/common/src/functions/web3/events/getInputUtxoAndBalance.mjs +50 -61
  576. package/common/src/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
  577. package/common/src/functions/web3/events/getInputUtxosEnclave.d.ts +4 -3
  578. package/common/src/functions/web3/events/getInputUtxosEnclave.mjs +42 -35
  579. package/common/src/functions/web3/events/getShieldedBalance.cjs +1 -1
  580. package/common/src/functions/web3/events/getShieldedBalance.d.ts +4 -4
  581. package/common/src/functions/web3/events/getShieldedBalance.mjs +109 -93
  582. package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
  583. package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +9 -6
  584. package/common/src/functions/web3/functionCalls/approveToken.cjs +1 -1
  585. package/common/src/functions/web3/functionCalls/approveToken.d.ts +1 -1
  586. package/common/src/functions/web3/functionCalls/approveToken.mjs +21 -107
  587. package/common/src/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
  588. package/common/src/functions/web3/functionCalls/constructBatchCall.d.ts +2 -2
  589. package/common/src/functions/web3/functionCalls/constructBatchCall.mjs +23 -18
  590. package/common/src/functions/web3/functionCalls/submitProof.cjs +1 -0
  591. package/common/src/functions/web3/functionCalls/submitProof.d.ts +5 -0
  592. package/common/src/functions/web3/functionCalls/submitProof.mjs +26 -0
  593. package/common/src/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -1
  594. package/common/src/functions/web3/functionCalls/transactCallDirectTron.d.ts +7 -3
  595. package/common/src/functions/web3/functionCalls/transactCallDirectTron.mjs +81 -53
  596. package/common/src/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  597. package/common/src/functions/web3/functionCalls/transactCallRelayer.d.ts +8 -13
  598. package/common/src/functions/web3/functionCalls/transactCallRelayer.mjs +12 -8
  599. package/common/src/functions/web3/getPublicAddressBalance.cjs +1 -1
  600. package/common/src/functions/web3/getPublicAddressBalance.d.ts +1 -2
  601. package/common/src/functions/web3/getPublicAddressBalance.mjs +6 -5
  602. package/common/src/functions/web3/getTokenHolder.cjs +1 -1
  603. package/common/src/functions/web3/getTokenHolder.mjs +3 -2
  604. package/common/src/functions/web3/index.cjs +1 -1
  605. package/common/src/functions/web3/index.d.ts +1 -4
  606. package/common/src/functions/web3/index.mjs +1 -4
  607. package/common/src/functions/web3/lifiAPI.cjs +1 -1
  608. package/common/src/functions/web3/lifiAPI.mjs +38 -7
  609. package/common/src/providers/EthersProviderAdapter.cjs +1 -1
  610. package/common/src/providers/EthersProviderAdapter.d.ts +0 -1
  611. package/common/src/providers/EthersProviderAdapter.mjs +0 -3
  612. package/common/src/providers/SolanaProviderAdapter.cjs +1 -1
  613. package/common/src/providers/SolanaProviderAdapter.d.ts +1 -5
  614. package/common/src/providers/SolanaProviderAdapter.mjs +4 -11
  615. package/common/src/providers/TronProviderAdapter.cjs +1 -1
  616. package/common/src/providers/TronProviderAdapter.d.ts +0 -1
  617. package/common/src/providers/TronProviderAdapter.mjs +7 -4
  618. package/common/src/providers/WagmiProviderAdapter.cjs +1 -1
  619. package/common/src/providers/WagmiProviderAdapter.d.ts +0 -1
  620. package/common/src/providers/WagmiProviderAdapter.mjs +32 -39
  621. package/common/src/types/API.types.d.ts +0 -4
  622. package/common/src/types/WeeklyAnalytics.types.d.ts +1 -26
  623. package/common/src/types/activities.types.cjs +1 -1
  624. package/common/src/types/activities.types.d.ts +0 -9
  625. package/common/src/types/activities.types.mjs +1 -1
  626. package/common/src/types/admin.types.cjs +1 -1
  627. package/common/src/types/admin.types.d.ts +4 -1
  628. package/common/src/types/admin.types.mjs +1 -1
  629. package/common/src/types/bridging-tx.types.d.ts +26 -3
  630. package/common/src/types/cache.types.cjs +1 -1
  631. package/common/src/types/cache.types.d.ts +4 -3
  632. package/common/src/types/cache.types.mjs +1 -1
  633. package/common/src/types/circom-data.types.cjs +1 -1
  634. package/common/src/types/circom-data.types.d.ts +32 -27
  635. package/common/src/types/circom-data.types.mjs +1 -1
  636. package/common/src/types/commitments.types.d.ts +2 -0
  637. package/common/src/types/dashboard-account.d.ts +15 -0
  638. package/common/src/types/dashboard-payout.types.d.ts +1 -0
  639. package/common/src/types/dashboard-transaction.types.d.ts +3 -0
  640. package/common/src/types/enclaveApi.types.d.ts +77 -0
  641. package/common/src/types/ethereum-network.types.cjs +1 -1
  642. package/common/src/types/ethereum-network.types.d.ts +13 -29
  643. package/common/src/types/ethereum-network.types.mjs +1 -1
  644. package/common/src/types/events.types.d.ts +1 -0
  645. package/common/src/types/external-action.types.cjs +1 -1
  646. package/common/src/types/external-action.types.d.ts +4 -7
  647. package/common/src/types/external-action.types.mjs +1 -1
  648. package/common/src/types/hinkal.types.cjs +1 -1
  649. package/common/src/types/hinkal.types.d.ts +12 -29
  650. package/common/src/types/hinkal.types.mjs +12 -20
  651. package/common/src/types/index.cjs +1 -1
  652. package/common/src/types/index.d.ts +6 -5
  653. package/common/src/types/index.mjs +3 -2
  654. package/common/src/types/near-intents.types.d.ts +2 -0
  655. package/common/src/types/new-rewards.type.d.ts +0 -70
  656. package/common/src/types/offscreen.types.cjs +1 -1
  657. package/common/src/types/offscreen.types.d.ts +0 -1
  658. package/common/src/types/offscreen.types.mjs +1 -1
  659. package/common/src/types/pay-activities.types.d.ts +24 -4
  660. package/common/src/types/payout-notification.types.d.ts +11 -0
  661. package/common/src/types/proxy-progress.types.d.ts +5 -0
  662. package/common/src/types/remote-proof.types.d.ts +5 -6
  663. package/common/src/types/remote-tx-build.types.d.ts +298 -0
  664. package/common/src/types/scheduled-transactions.types.d.ts +25 -12
  665. package/common/src/types/snark.types.d.ts +1 -3
  666. package/common/src/types/solana-transact.types.cjs +1 -0
  667. package/common/src/types/solana-transact.types.d.ts +35 -0
  668. package/common/src/types/solana-transact.types.mjs +6 -0
  669. package/common/src/types/solana.types.cjs +1 -0
  670. package/common/src/types/solana.types.d.ts +12 -3
  671. package/common/src/types/solana.types.mjs +6 -0
  672. package/common/src/types/temp-wallet.types.d.ts +9 -0
  673. package/common/src/types/tenderly.api.types.d.ts +70 -0
  674. package/common/src/types/token.types.cjs +1 -1
  675. package/common/src/types/token.types.d.ts +10 -0
  676. package/common/src/types/token.types.mjs +2 -2
  677. package/common/src/types/transact.types.cjs +1 -0
  678. package/common/src/types/transact.types.d.ts +53 -0
  679. package/common/src/types/transact.types.mjs +6 -0
  680. package/common/src/types/transaction.types.d.ts +0 -1
  681. package/common/src/types/transactions.types.d.ts +0 -1
  682. package/common/src/webworker/logError-ScFy7p5w.js +2 -0
  683. package/common/src/webworker/package.json +26 -25
  684. package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.cjs +1 -1
  685. package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.mjs +1 -1
  686. package/common/src/webworker/snarkjsWorkerNode.cjs +1 -1
  687. package/common/src/webworker/utxoWorker/utxoWorker.types.d.ts +4 -2
  688. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
  689. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +1 -1
  690. package/common/src/webworker/utxoWorkerNode.cjs +1 -1
  691. package/common/src/webworker/viteWorkerURL.constant.cjs +3 -3
  692. package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
  693. package/common/src/webworker/workerProxy-B_eSl85g.js +1 -0
  694. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
  695. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +1 -1
  696. package/common/src/webworker/zkProofWorkerNode.cjs +1 -1
  697. package/index.cjs +1 -1
  698. package/index.mjs +1 -1
  699. package/internal/swapApi.cjs +1 -1
  700. package/internal/swapApi.d.ts +3 -3
  701. package/internal/swapApi.mjs +22 -25
  702. package/package.json +26 -25
  703. package/providers/prepareEthersHinkal.cjs +1 -1
  704. package/providers/prepareEthersHinkal.d.ts +1 -0
  705. package/providers/prepareEthersHinkal.mjs +2 -2
  706. package/providers/prepareSolanaHinkal.cjs +1 -1
  707. package/providers/prepareSolanaHinkal.d.ts +1 -0
  708. package/providers/prepareSolanaHinkal.mjs +2 -2
  709. package/providers/prepareTronHinkal.cjs +1 -1
  710. package/providers/prepareTronHinkal.d.ts +1 -0
  711. package/providers/prepareTronHinkal.mjs +2 -2
  712. package/providers/prepareWagmiHinkal.cjs +1 -1
  713. package/providers/prepareWagmiHinkal.d.ts +1 -0
  714. package/providers/prepareWagmiHinkal.mjs +2 -2
  715. package/services/Hinkal.cjs +1 -1
  716. package/services/Hinkal.d.ts +16 -10
  717. package/services/Hinkal.mjs +29 -17
  718. package/types/IHinkal.d.ts +16 -10
  719. package/types/swap.types.d.ts +3 -20
  720. package/common/src/API/accessCodeCalls.cjs +0 -1
  721. package/common/src/API/accessCodeCalls.d.ts +0 -23
  722. package/common/src/API/accessCodeCalls.mjs +0 -13
  723. package/common/src/API/brotherhoodCalls.cjs +0 -1
  724. package/common/src/API/brotherhoodCalls.d.ts +0 -82
  725. package/common/src/API/brotherhoodCalls.mjs +0 -17
  726. package/common/src/API/callOdosAPI.cjs +0 -1
  727. package/common/src/API/callOdosAPI.d.ts +0 -63
  728. package/common/src/API/callOdosAPI.mjs +0 -18
  729. package/common/src/API/callOneInchAPI.cjs +0 -1
  730. package/common/src/API/callOneInchAPI.d.ts +0 -18
  731. package/common/src/API/callOneInchAPI.mjs +0 -13
  732. package/common/src/API/deposit-and-withdraw-status-calls.cjs +0 -1
  733. package/common/src/API/deposit-and-withdraw-status-calls.d.ts +0 -21
  734. package/common/src/API/deposit-and-withdraw-status-calls.mjs +0 -13
  735. package/common/src/API/generate-trading-points.cjs +0 -1
  736. package/common/src/API/generate-trading-points.d.ts +0 -27
  737. package/common/src/API/generate-trading-points.mjs +0 -23
  738. package/common/src/API/getAnyRecipientInfo.d.ts +0 -1
  739. package/common/src/API/leaderboardCalls.cjs +0 -1
  740. package/common/src/API/leaderboardCalls.d.ts +0 -14
  741. package/common/src/API/leaderboardCalls.mjs +0 -8
  742. package/common/src/API/referralsCalls.cjs +0 -1
  743. package/common/src/API/referralsCalls.d.ts +0 -22
  744. package/common/src/API/referralsCalls.mjs +0 -11
  745. package/common/src/API/send-telegram-callback.cjs +0 -1
  746. package/common/src/API/send-telegram-callback.d.ts +0 -7
  747. package/common/src/API/send-telegram-callback.mjs +0 -11
  748. package/common/src/constants/mystery-boxes.constants.d.ts +0 -0
  749. package/common/src/constants/price-impact.constants.d.ts +0 -2
  750. package/common/src/constants/rewards.constants.d.ts +0 -15
  751. package/common/src/constants/tasks.constants.cjs +0 -1
  752. package/common/src/constants/tasks.constants.d.ts +0 -9
  753. package/common/src/constants/tasks.constants.mjs +0 -124
  754. package/common/src/crypto/ecdh-dual-path.cjs +0 -1
  755. package/common/src/crypto/ecdh-dual-path.d.ts +0 -13
  756. package/common/src/crypto/ecdh-dual-path.mjs +0 -6
  757. package/common/src/data-structures/Hinkal/hinkalMultiSend.cjs +0 -1
  758. package/common/src/data-structures/Hinkal/hinkalMultiSend.d.ts +0 -3
  759. package/common/src/data-structures/Hinkal/hinkalMultiSend.mjs +0 -12
  760. package/common/src/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.cjs +0 -1
  761. package/common/src/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.d.ts +0 -6
  762. package/common/src/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.mjs +0 -128
  763. package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.cjs +0 -1
  764. package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.d.ts +0 -22
  765. package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.mjs +0 -34
  766. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +0 -1
  767. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +0 -172
  768. package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.cjs +0 -1
  769. package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.mjs +0 -94
  770. package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.cjs +0 -1
  771. package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.mjs +0 -134
  772. package/common/src/data-structures/TokenDBs/PublicTokensDB.cjs +0 -1
  773. package/common/src/data-structures/TokenDBs/PublicTokensDB.mjs +0 -32
  774. package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.cjs +0 -1
  775. package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.mjs +0 -41
  776. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.cjs +0 -1
  777. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.mjs +0 -47
  778. package/common/src/data-structures/TokenDBs/index.cjs +0 -1
  779. package/common/src/data-structures/TokenDBs/index.mjs +0 -6
  780. package/common/src/externalABIs/IQuoterV2.json.cjs +0 -1
  781. package/common/src/externalABIs/IQuoterV2.json.mjs +0 -203
  782. package/common/src/externalABIs/ISwapRouter.json.cjs +0 -1
  783. package/common/src/externalABIs/ISwapRouter.json.mjs +0 -537
  784. package/common/src/externalABIs/IUniswapV3Factory.json.cjs +0 -1
  785. package/common/src/externalABIs/IUniswapV3Factory.json.mjs +0 -188
  786. package/common/src/externalABIs/IUniswapV3Pool.json.cjs +0 -1
  787. package/common/src/externalABIs/IUniswapV3Pool.json.mjs +0 -938
  788. package/common/src/externalABIs/UniswapV2PoolAbi.json.cjs +0 -1
  789. package/common/src/externalABIs/UniswapV2PoolAbi.json.mjs +0 -78
  790. package/common/src/functions/pre-transaction/interaction-to-action.cjs +0 -1
  791. package/common/src/functions/pre-transaction/interaction-to-action.d.ts +0 -2
  792. package/common/src/functions/pre-transaction/interaction-to-action.mjs +0 -1
  793. package/common/src/functions/pre-transaction/recipientUtxoProcessing.cjs +0 -1
  794. package/common/src/functions/pre-transaction/recipientUtxoProcessing.d.ts +0 -3
  795. package/common/src/functions/pre-transaction/recipientUtxoProcessing.mjs +0 -32
  796. package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs +0 -1
  797. package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +0 -29
  798. package/common/src/functions/private-wallet/opProducer.cjs +0 -1
  799. package/common/src/functions/private-wallet/opProducer.d.ts +0 -5
  800. package/common/src/functions/private-wallet/opProducer.mjs +0 -3
  801. package/common/src/functions/snarkjs/generateZkProofEnclave.cjs +0 -1
  802. package/common/src/functions/snarkjs/generateZkProofEnclave.d.ts +0 -5
  803. package/common/src/functions/snarkjs/generateZkProofEnclave.mjs +0 -27
  804. package/common/src/functions/utils/bit.operations.cjs +0 -1
  805. package/common/src/functions/utils/bit.operations.d.ts +0 -3
  806. package/common/src/functions/utils/bit.operations.mjs +0 -4
  807. package/common/src/functions/utils/get-signature-header.cjs +0 -1
  808. package/common/src/functions/utils/get-signature-header.d.ts +0 -5
  809. package/common/src/functions/utils/get-signature-header.mjs +0 -4
  810. package/common/src/functions/utils/ipfs.cjs +0 -1
  811. package/common/src/functions/utils/ipfs.mjs +0 -1
  812. package/common/src/functions/utils/reloadPage.cjs +0 -1
  813. package/common/src/functions/utils/reloadPage.mjs +0 -4
  814. package/common/src/functions/web3/getSolanaPriorityFee.cjs +0 -1
  815. package/common/src/functions/web3/getSolanaPriorityFee.d.ts +0 -3
  816. package/common/src/functions/web3/getSolanaPriorityFee.mjs +0 -26
  817. package/common/src/functions/web3/odosAPI.cjs +0 -1
  818. package/common/src/functions/web3/odosAPI.d.ts +0 -5
  819. package/common/src/functions/web3/odosAPI.mjs +0 -35
  820. package/common/src/functions/web3/oneInchAPI.cjs +0 -1
  821. package/common/src/functions/web3/oneInchAPI.d.ts +0 -5
  822. package/common/src/functions/web3/oneInchAPI.mjs +0 -34
  823. package/common/src/functions/web3/uniswapAPI.cjs +0 -1
  824. package/common/src/functions/web3/uniswapAPI.d.ts +0 -16
  825. package/common/src/functions/web3/uniswapAPI.mjs +0 -60
  826. package/common/src/types/brotherhood-user.types.d.ts +0 -11
  827. package/common/src/types/crypto.types.d.ts +0 -8
  828. package/common/src/types/generatePoints.d.ts +0 -14
  829. package/common/src/types/new-rewards.type.cjs +0 -1
  830. package/common/src/types/new-rewards.type.mjs +0 -10
  831. package/common/src/types/referral.types.d.ts +0 -12
  832. package/common/src/types/rewards.types.d.ts +0 -34
  833. package/common/src/types/scheduled-transactions.types.cjs +0 -1
  834. package/common/src/types/scheduled-transactions.types.mjs +0 -6
  835. package/common/src/types/token-with-id.types.d.ts +0 -4
  836. package/common/src/webworker/logError-CZYZ3oyV.js +0 -2
  837. package/common/src/webworker/workerProxy-DPeuP2Mg.js +0 -1
@@ -1 +1 @@
1
- require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../../functions/web3/etherFunctions.cjs`),i=require(`../crypto-keys/keys.cjs`),a=require(`../../functions/utils/solanaMint.utils.cjs`),o=require(`../../functions/utils/addresses.cjs`),s=require(`../../functions/utils/token-check.utils.cjs`),c=require(`../../functions/snarkjs/common.snarkjs.cjs`),l=require(`../../functions/pre-transaction/solana.cjs`),u=require(`../../functions/pre-transaction/constructAdminData.cjs`),d=require(`../../error-handling/retrySolanaError.cjs`),f=require(`../../API/admin-calls.cjs`),p=require(`../../functions/pre-transaction/solanaTransfer.utils.cjs`),m=require(`./hinkalProoflessDeposit.utils.cjs`);let h=require(`@solana/web3.js`),g=require(`@coral-xyz/anchor`);var _=(n,r)=>{let i=s.validateAndGetChainId([r]),o=r.erc20TokenAddress,{hinkalIdl:c,hinkalAddress:u,originalDeployer:d}=e.networkRegistry[i].contractData;if(!c)throw Error(`No IDL configured for Solana program on this network`);if(!d)throw Error(`missing original deployer`);let f=n.getSolanaProgram(c),p=n.getSolanaPublicKey(),{connection:m,wallet:g}=f.provider;if(!g)throw Error(`missing solana wallet`);let _=new h.PublicKey(d),v=new h.PublicKey(u),{mintPublicKey:y}=a.formatMintAddress(o),b=y.toString()===t.solanaNativeAddress;return{chainId:i,mintAddress:o,program:f,publicKey:p,connection:m,wallet:g,originalDeployer:_,mintPublicKey:y,mint:b?null:y,atasValue:b?null:void 0,storageAccount:l.getStorageAccountPublicKey(v,_),storageVault:l.getStorageVaultPublicKey(v,_),merkleAccount:l.getMerkleAccountPublicKey(v,_)}},v=(e,t,n)=>{let r=n.map(e=>l.buildAnchorStealthAddressStructure(e));return e.program.methods.multiPaymentDeposit(t.map(e=>new g.BN(e.toString())),r,!1).accounts({mint:e.mint,signer:e.publicKey,signerAta:e.atasValue,originalDeployer:e.originalDeployer,storageAccount:e.storageAccount,storageVault:e.storageVault,merkleAccount:e.merkleAccount,storageVaultAta:e.atasValue}).instruction()},y=async(e,t,n,r)=>{for(let i=0;i<10;i+=1){let a=i===9;try{let{blockhash:i,lastValidBlockHeight:a}=await e.getLatestBlockhash(),o=new h.VersionedTransaction(new h.TransactionMessage({payerKey:n,recentBlockhash:i,instructions:r}).compileToV0Message()),s=await t.signTransaction(o),c=await e.sendTransaction(s);return await e.confirmTransaction({signature:c,blockhash:i,lastValidBlockHeight:a},`confirmed`),c}catch(e){if(d.shouldRetryForSolanaError(e)&&!a)continue;throw e}}return``},b=(e,t)=>{if(e.length===0)throw Error(`amounts must not be empty`);if(e.length!==t.length)throw Error(`amounts and stealthAddressStructures length mismatch`);if(e.some(e=>e<=0n))throw Error(`all amounts must be positive`);m.assertNoDuplicateStealthAddressStructures(t)},x=async(e,t,n,r,i,a=!1)=>{b(n,r);let o=_(e,t),s=u.constructAdminData(i,o.chainId,Array(n.length).fill(o.mintAddress),n,await e.getEthereumAddress()),c=await v(o,n,r);if(a){let{blockhash:e}=await o.connection.getLatestBlockhash(),t=new h.Transaction().add(c);return t.recentBlockhash=e,t.feePayer=o.publicKey,Buffer.from(t.serialize({requireAllSignatures:!1})).toString(`base64`)}let l=await y(o.connection,o.wallet,o.publicKey,[c]);return await f.emitTxPublicData(s),l},S=async(e,t,n,r,i,a)=>{b(n,r);let o=_(e,t),s=await e.getRandomRelay(o.chainId,!1);if(!s)throw Error(`No relay available for chainId ${o.chainId}`);let{instructions:c}=await p.buildSolanaTransferInstructions(o.connection,o.publicKey,new h.PublicKey(s),t,i),l=await v(o,n,r),d=u.constructAdminData(a,o.chainId,Array(n.length).fill(o.mintAddress),n,await e.getEthereumAddress()),m=await y(o.connection,o.wallet,o.publicKey,[...c,l]);return await f.emitTxPublicData(d),m},C=async(e,t,n,a=!1)=>{let o=e.userKeys.getShieldedPrivateKey(),s=c.calcStealthAddressStructure(i.UserKeys.findCorrectRandomization(r.randomBigInt(31),o),o,e.userKeys.getSpendingKeyPair().pubSpendingBJJPoint);return x(e,n,[t],[s],void 0,a)},w=async(e,t,r,i,a=!1,s)=>{if(!o.isValidPrivateAddress(i))throw Error(n.transactionErrorCodes.RECIPIENT_FORMAT_INCORRECT);let c=o.constructStealthAddressStructure(i);return x(e,r,[t],[c],s,a)};exports.hinkalSolanaDeposit=C,exports.hinkalSolanaDepositForOther=w,exports.hinkalSolanaProoflessDepositWithPublicFee=S,exports.submitSolanaProoflessDeposit=x;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../../functions/web3/etherFunctions.cjs`),i=require(`../crypto-keys/keys.cjs`),a=require(`../../functions/utils/solanaMint.utils.cjs`),o=require(`../../functions/utils/addresses.cjs`),s=require(`../../functions/utils/token-check.utils.cjs`),c=require(`../../functions/snarkjs/common.snarkjs.cjs`),l=require(`../../functions/pre-transaction/solana.cjs`),u=require(`../../functions/pre-transaction/constructAdminData.cjs`),d=require(`../../error-handling/retrySolanaError.cjs`),f=require(`../../API/admin-calls.cjs`);require(`../../functions/pre-transaction/solanaTransfer.utils.cjs`);const p=require(`./hinkalProoflessDeposit.utils.cjs`);let m=require(`@solana/web3.js`),h=require(`@coral-xyz/anchor`);var g=(n,r)=>{let i=s.validateAndGetChainId([r]),o=r.erc20TokenAddress,{hinkalIdl:c,hinkalAddress:u,originalDeployer:d}=e.networkRegistry[i].contractData;if(!c)throw Error(`No IDL configured for Solana program on this network`);if(!d)throw Error(`missing original deployer`);let f=n.getSolanaProgram(c),p=n.getSolanaPublicKey(),{connection:h,wallet:g}=f.provider;if(!g)throw Error(`missing solana wallet`);let _=new m.PublicKey(d),v=new m.PublicKey(u),{mintPublicKey:y}=a.formatMintAddress(o),b=y.toString()===t.solanaNativeAddress;return{chainId:i,mintAddress:o,program:f,publicKey:p,connection:h,wallet:g,originalDeployer:_,mintPublicKey:y,mint:b?null:y,atasValue:b?null:void 0,storageAccount:l.getStorageAccountPublicKey(v,_),storageVault:l.getStorageVaultPublicKey(v,_),merkleAccount:l.getMerkleAccountPublicKey(v,_)}},_=async(e,t,n,r,i)=>{let a=n.map(e=>l.buildAnchorStealthAddressStructure(e)),o=p.buildProoflessEncryptedOutputs(n,r).map(e=>Buffer.from(e.slice(2),`hex`)),{current:s,next:c}=await l.resolveSolanaRootBuckets(e.program,e.merkleAccount,t.length);return e.program.methods.multiPaymentDeposit(t.map(e=>new h.BN(e.toString())),a,o,i).accounts({mint:e.mint,signer:e.publicKey,signerAta:e.atasValue,originalDeployer:e.originalDeployer,storageAccount:e.storageAccount,storageVault:e.storageVault,merkleAccount:e.merkleAccount,rootBucketCurrent:s,rootBucketNext:c??e.program.programId,storageVaultAta:e.atasValue}).instruction()},v=async(e,t,n,r)=>{for(let i=0;i<10;i+=1){let a=i===9;try{let{blockhash:i,lastValidBlockHeight:a}=await e.getLatestBlockhash(),o=new m.VersionedTransaction(new m.TransactionMessage({payerKey:n,recentBlockhash:i,instructions:r}).compileToV0Message()),s=await t.signTransaction(o),c=await e.sendTransaction(s);return await e.confirmTransaction({signature:c,blockhash:i,lastValidBlockHeight:a},`confirmed`),c}catch(e){if(d.shouldRetryForSolanaError(e)&&!a)continue;throw e}}return``},y=(e,t)=>{if(e.length===0)throw Error(`amounts must not be empty`);if(e.length!==t.length)throw Error(`amounts and stealthAddressStructures length mismatch`);if(e.some(e=>e<=0n))throw Error(`all amounts must be positive`);p.assertNoDuplicateStealthAddressStructures(t)},b=async(e,t,n,r,i,a=!1,o,s=!1)=>{y(n,r);let c=g(e,t),l=u.constructAdminData(o,c.chainId,Array(n.length).fill(c.mintAddress),n,await e.getEthereumAddress()),d=await _(c,n,r,i,a);if(s){let{blockhash:e}=await c.connection.getLatestBlockhash(),t=new m.Transaction().add(d);return t.recentBlockhash=e,t.feePayer=c.publicKey,Buffer.from(t.serialize({requireAllSignatures:!1})).toString(`base64`)}let p=await v(c.connection,c.wallet,c.publicKey,[d]);return await f.emitTxPublicData(l),p},x=async(e,t,n,a=!1)=>{let o=e.userKeys.getShieldedPrivateKey(),s=c.calcStealthAddressStructure(i.UserKeys.findCorrectRandomization(r.randomBigInt(31),o),o,e.userKeys.getSpendingKeyPair().pubSpendingBJJPoint),l=i.UserKeys.getEncryptionKeyPair(o).publicKey;return b(e,n,[t],[s],[l],!1,void 0,a)},S=async(e,t,r,i,a=!1,s)=>{if(!o.isValidPrivateAddress(i))throw Error(n.transactionErrorCodes.RECIPIENT_FORMAT_INCORRECT);let c=o.constructStealthAddressStructure(i),l=o.getEncryptionKeyFromRecipientInfo(i);return b(e,r,[t],[c],[l],!1,s,a)};exports.hinkalSolanaDeposit=x,exports.hinkalSolanaDepositForOther=S,exports.submitSolanaProoflessDeposit=b;
@@ -2,7 +2,7 @@ import { StealthAddressStructure } from '../../types/circom-data.types';
2
2
  import { ERC20Token } from '../../types/token.types';
3
3
  import { IHinkal } from './IHinkal';
4
4
  import { AdminTransactionType } from '../../types/admin.types';
5
- export declare const submitSolanaProoflessDeposit: (hinkal: IHinkal, token: ERC20Token, amounts: bigint[], stealthAddressStructures: StealthAddressStructure[], action?: AdminTransactionType, returnTxData?: boolean) => Promise<string>;
6
- export declare const hinkalSolanaProoflessDepositWithPublicFee: (hinkal: IHinkal, token: ERC20Token, amounts: bigint[], stealthAddressStructures: StealthAddressStructure[], feeAmount: bigint, action?: AdminTransactionType) => Promise<string>;
5
+ export declare const submitSolanaProoflessDeposit: (hinkal: IHinkal, token: ERC20Token, amounts: bigint[], stealthAddressStructures: StealthAddressStructure[], recipientEncryptionKeys: string[], createBlockedUtxos?: boolean, action?: AdminTransactionType, returnTxData?: boolean) => Promise<string>;
6
+ export declare const hinkalSolanaProoflessDepositWithPublicFee: (hinkal: IHinkal, token: ERC20Token, amounts: bigint[], stealthAddressStructures: StealthAddressStructure[], recipientEncryptionKeys: string[], feeAmount: bigint, createBlockedUtxos?: boolean, action?: AdminTransactionType) => Promise<string>;
7
7
  export declare const hinkalSolanaDeposit: (hinkal: IHinkal, amount: bigint, token: ERC20Token, returnTxData?: boolean) => Promise<string>;
8
8
  export declare const hinkalSolanaDepositForOther: (hinkal: IHinkal, amount: bigint, token: ERC20Token, recipientInfo: string, returnTxData?: boolean, action?: AdminTransactionType) => Promise<string>;
@@ -4,43 +4,43 @@ import { transactionErrorCodes as n } from "../../error-handling/error-codes.con
4
4
  import { randomBigInt as r } from "../../functions/web3/etherFunctions.mjs";
5
5
  import { UserKeys as i } from "../crypto-keys/keys.mjs";
6
6
  import { formatMintAddress as a } from "../../functions/utils/solanaMint.utils.mjs";
7
- import { constructStealthAddressStructure as o, isValidPrivateAddress as s } from "../../functions/utils/addresses.mjs";
8
- import { validateAndGetChainId as c } from "../../functions/utils/token-check.utils.mjs";
9
- import { calcStealthAddressStructure as l } from "../../functions/snarkjs/common.snarkjs.mjs";
10
- import { buildAnchorStealthAddressStructure as u, getMerkleAccountPublicKey as d, getStorageAccountPublicKey as f, getStorageVaultPublicKey as p } from "../../functions/pre-transaction/solana.mjs";
11
- import { constructAdminData as m } from "../../functions/pre-transaction/constructAdminData.mjs";
12
- import { shouldRetryForSolanaError as h } from "../../error-handling/retrySolanaError.mjs";
13
- import { emitTxPublicData as g } from "../../API/admin-calls.mjs";
14
- import { buildSolanaTransferInstructions as _ } from "../../functions/pre-transaction/solanaTransfer.utils.mjs";
15
- import { assertNoDuplicateStealthAddressStructures as v } from "./hinkalProoflessDeposit.utils.mjs";
16
- import { PublicKey as y, Transaction as b, TransactionMessage as x, VersionedTransaction as S } from "@solana/web3.js";
17
- import { BN as C } from "@coral-xyz/anchor";
7
+ import { constructStealthAddressStructure as o, getEncryptionKeyFromRecipientInfo as s, isValidPrivateAddress as c } from "../../functions/utils/addresses.mjs";
8
+ import { validateAndGetChainId as l } from "../../functions/utils/token-check.utils.mjs";
9
+ import { calcStealthAddressStructure as u } from "../../functions/snarkjs/common.snarkjs.mjs";
10
+ import { buildAnchorStealthAddressStructure as d, getMerkleAccountPublicKey as f, getStorageAccountPublicKey as p, getStorageVaultPublicKey as m, resolveSolanaRootBuckets as h } from "../../functions/pre-transaction/solana.mjs";
11
+ import { constructAdminData as g } from "../../functions/pre-transaction/constructAdminData.mjs";
12
+ import { shouldRetryForSolanaError as _ } from "../../error-handling/retrySolanaError.mjs";
13
+ import { emitTxPublicData as v } from "../../API/admin-calls.mjs";
14
+ import "../../functions/pre-transaction/solanaTransfer.utils.mjs";
15
+ import { assertNoDuplicateStealthAddressStructures as y, buildProoflessEncryptedOutputs as b } from "./hinkalProoflessDeposit.utils.mjs";
16
+ import { PublicKey as x, Transaction as S, TransactionMessage as C, VersionedTransaction as w } from "@solana/web3.js";
17
+ import { BN as T } from "@coral-xyz/anchor";
18
18
  //#region libs/shared/common/src/data-structures/Hinkal/hinkalSolanaDeposit.ts
19
- var w = (n, r) => {
20
- let i = c([r]), o = r.erc20TokenAddress, { hinkalIdl: s, hinkalAddress: l, originalDeployer: u } = e[i].contractData;
19
+ var E = (n, r) => {
20
+ let i = l([r]), o = r.erc20TokenAddress, { hinkalIdl: s, hinkalAddress: c, originalDeployer: u } = e[i].contractData;
21
21
  if (!s) throw Error("No IDL configured for Solana program on this network");
22
22
  if (!u) throw Error("missing original deployer");
23
- let m = n.getSolanaProgram(s), h = n.getSolanaPublicKey(), { connection: g, wallet: _ } = m.provider;
23
+ let d = n.getSolanaProgram(s), h = n.getSolanaPublicKey(), { connection: g, wallet: _ } = d.provider;
24
24
  if (!_) throw Error("missing solana wallet");
25
- let v = new y(u), b = new y(l), { mintPublicKey: x } = a(o), S = x.toString() === t;
25
+ let v = new x(u), y = new x(c), { mintPublicKey: b } = a(o), S = b.toString() === t;
26
26
  return {
27
27
  chainId: i,
28
28
  mintAddress: o,
29
- program: m,
29
+ program: d,
30
30
  publicKey: h,
31
31
  connection: g,
32
32
  wallet: _,
33
33
  originalDeployer: v,
34
- mintPublicKey: x,
35
- mint: S ? null : x,
34
+ mintPublicKey: b,
35
+ mint: S ? null : b,
36
36
  atasValue: S ? null : void 0,
37
- storageAccount: f(b, v),
38
- storageVault: p(b, v),
39
- merkleAccount: d(b, v)
37
+ storageAccount: p(y, v),
38
+ storageVault: m(y, v),
39
+ merkleAccount: f(y, v)
40
40
  };
41
- }, T = (e, t, n) => {
42
- let r = n.map((e) => u(e));
43
- return e.program.methods.multiPaymentDeposit(t.map((e) => new C(e.toString())), r, !1).accounts({
41
+ }, D = async (e, t, n, r, i) => {
42
+ let a = n.map((e) => d(e)), o = b(n, r).map((e) => Buffer.from(e.slice(2), "hex")), { current: s, next: c } = await h(e.program, e.merkleAccount, t.length);
43
+ return e.program.methods.multiPaymentDeposit(t.map((e) => new T(e.toString())), a, o, i).accounts({
44
44
  mint: e.mint,
45
45
  signer: e.publicKey,
46
46
  signerAta: e.atasValue,
@@ -48,13 +48,15 @@ var w = (n, r) => {
48
48
  storageAccount: e.storageAccount,
49
49
  storageVault: e.storageVault,
50
50
  merkleAccount: e.merkleAccount,
51
+ rootBucketCurrent: s,
52
+ rootBucketNext: c ?? e.program.programId,
51
53
  storageVaultAta: e.atasValue
52
54
  }).instruction();
53
- }, E = async (e, t, n, r) => {
55
+ }, O = async (e, t, n, r) => {
54
56
  for (let i = 0; i < 10; i += 1) {
55
57
  let a = i === 9;
56
58
  try {
57
- let { blockhash: i, lastValidBlockHeight: a } = await e.getLatestBlockhash(), o = new S(new x({
59
+ let { blockhash: i, lastValidBlockHeight: a } = await e.getLatestBlockhash(), o = new w(new C({
58
60
  payerKey: n,
59
61
  recentBlockhash: i,
60
62
  instructions: r
@@ -65,38 +67,32 @@ var w = (n, r) => {
65
67
  lastValidBlockHeight: a
66
68
  }, "confirmed"), c;
67
69
  } catch (e) {
68
- if (h(e) && !a) continue;
70
+ if (_(e) && !a) continue;
69
71
  throw e;
70
72
  }
71
73
  }
72
74
  return "";
73
- }, D = (e, t) => {
75
+ }, k = (e, t) => {
74
76
  if (e.length === 0) throw Error("amounts must not be empty");
75
77
  if (e.length !== t.length) throw Error("amounts and stealthAddressStructures length mismatch");
76
78
  if (e.some((e) => e <= 0n)) throw Error("all amounts must be positive");
77
- v(t);
78
- }, O = async (e, t, n, r, i, a = !1) => {
79
- D(n, r);
80
- let o = w(e, t), s = m(i, o.chainId, Array(n.length).fill(o.mintAddress), n, await e.getEthereumAddress()), c = await T(o, n, r);
81
- if (a) {
82
- let { blockhash: e } = await o.connection.getLatestBlockhash(), t = new b().add(c);
83
- return t.recentBlockhash = e, t.feePayer = o.publicKey, Buffer.from(t.serialize({ requireAllSignatures: !1 })).toString("base64");
79
+ y(t);
80
+ }, A = async (e, t, n, r, i, a = !1, o, s = !1) => {
81
+ k(n, r);
82
+ let c = E(e, t), l = g(o, c.chainId, Array(n.length).fill(c.mintAddress), n, await e.getEthereumAddress()), u = await D(c, n, r, i, a);
83
+ if (s) {
84
+ let { blockhash: e } = await c.connection.getLatestBlockhash(), t = new S().add(u);
85
+ return t.recentBlockhash = e, t.feePayer = c.publicKey, Buffer.from(t.serialize({ requireAllSignatures: !1 })).toString("base64");
84
86
  }
85
- let l = await E(o.connection, o.wallet, o.publicKey, [c]);
86
- return await g(s), l;
87
- }, k = async (e, t, n, r, i, a) => {
88
- D(n, r);
89
- let o = w(e, t), s = await e.getRandomRelay(o.chainId, !1);
90
- if (!s) throw Error(`No relay available for chainId ${o.chainId}`);
91
- let { instructions: c } = await _(o.connection, o.publicKey, new y(s), t, i), l = await T(o, n, r), u = m(a, o.chainId, Array(n.length).fill(o.mintAddress), n, await e.getEthereumAddress()), d = await E(o.connection, o.wallet, o.publicKey, [...c, l]);
92
- return await g(u), d;
93
- }, A = async (e, t, n, a = !1) => {
94
- let o = e.userKeys.getShieldedPrivateKey(), s = l(i.findCorrectRandomization(r(31), o), o, e.userKeys.getSpendingKeyPair().pubSpendingBJJPoint);
95
- return O(e, n, [t], [s], void 0, a);
96
- }, j = async (e, t, r, i, a = !1, c) => {
97
- if (!s(i)) throw Error(n.RECIPIENT_FORMAT_INCORRECT);
98
- let l = o(i);
99
- return O(e, r, [t], [l], c, a);
87
+ let d = await O(c.connection, c.wallet, c.publicKey, [u]);
88
+ return await v(l), d;
89
+ }, j = async (e, t, n, a = !1) => {
90
+ let o = e.userKeys.getShieldedPrivateKey(), s = u(i.findCorrectRandomization(r(31), o), o, e.userKeys.getSpendingKeyPair().pubSpendingBJJPoint), c = i.getEncryptionKeyPair(o).publicKey;
91
+ return A(e, n, [t], [s], [c], !1, void 0, a);
92
+ }, M = async (e, t, r, i, a = !1, l) => {
93
+ if (!c(i)) throw Error(n.RECIPIENT_FORMAT_INCORRECT);
94
+ let u = o(i), d = s(i);
95
+ return A(e, r, [t], [u], [d], !1, l, a);
100
96
  };
101
97
  //#endregion
102
- export { A as hinkalSolanaDeposit, j as hinkalSolanaDepositForOther, k as hinkalSolanaProoflessDepositWithPublicFee, O as submitSolanaProoflessDeposit };
98
+ export { j as hinkalSolanaDeposit, M as hinkalSolanaDepositForOther, A as submitSolanaProoflessDeposit };
@@ -1 +1 @@
1
- require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../../functions/web3/etherFunctions.cjs`),i=require(`../crypto-keys/keys.cjs`),a=require(`../../functions/utils/time.utils.cjs`),o=require(`../utxo/Utxo.cjs`),s=require(`../../types/external-action.types.cjs`),c=require(`../../types/scheduled-transactions.types.cjs`);require(`../../types/index.cjs`);const l=require(`../../functions/utils/solanaMint.utils.cjs`),u=require(`../../functions/utils/addresses.cjs`),d=require(`../../functions/utils/token-check.utils.cjs`),f=require(`../../functions/snarkjs/common.snarkjs.cjs`),p=require(`../../functions/pre-transaction/solana.cjs`),m=require(`../../functions/pre-transaction/constructAdminData.cjs`),h=require(`../../functions/pre-transaction/sendV0Transaction.cjs`),g=require(`../../functions/pre-transaction/getFeeStructure.cjs`),_=require(`../../functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs`);require(`../../functions/pre-transaction/index.cjs`);const v=require(`../../functions/utils/getUtxosFromReceiptSolana.cjs`),y=require(`../../functions/utils/fees.utils.cjs`);require(`../../functions/web3/index.cjs`);const b=require(`../../functions/snarkjs/constructSolanaZkProof.cjs`),x=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),S=require(`../../API/deposit-and-withdraw-status-calls.cjs`);require(`../../functions/index.cjs`);let C=require(`ethers`),w=require(`@solana/web3.js`),T=require(`@coral-xyz/anchor`);var E=(n,a,o,s)=>{let{hinkalIdl:c,hinkalAddress:u,originalDeployer:d}=e.networkRegistry[a].contractData;if(!c)throw Error(`No IDL configured for Solana program on this network`);if(!d)throw Error(`missing original deployer`);let m=n.userKeys.getShieldedPrivateKey(),h=n.getSolanaProgram(c),g=n.getSolanaPublicKey(),_=new w.PublicKey(d),v=new w.PublicKey(u),{mintPublicKey:y}=l.formatMintAddress(o.erc20TokenAddress),b=y.toString(),x=p.getStorageAccountPublicKey(v,_),S=p.getStorageVaultPublicKey(v,_),C=p.getMerkleAccountPublicKey(v,_),T=s.map(()=>p.buildAnchorStealthAddressStructure(f.calcStealthAddressStructure(i.UserKeys.findCorrectRandomization(r.randomBigInt(31),m),m,n.userKeys.getSpendingKeyPair().pubSpendingBJJPoint))),E=b===t.solanaNativeAddress;return{program:h,publicKey:g,originalDeployer:_,mint:E?null:y,atasValue:E?null:void 0,storageAccount:x,storageVault:S,merkleAccount:C,amounts:s,anchorStealthStructures:T}},D=e=>e.program.methods.multiPaymentDeposit(e.amounts.map(e=>new T.BN(e.toString())),e.anchorStealthStructures,!0).accounts({mint:e.mint,signer:e.publicKey,signerAta:e.atasValue,originalDeployer:e.originalDeployer,storageAccount:e.storageAccount,storageVault:e.storageVault,merkleAccount:e.merkleAccount,storageVaultAta:e.atasValue}),O=async(e,t,n,r,i,a,o)=>{let s=r.map(e=>e+y.calculateTotalFee(e,a)),u=E(e,t,n,s),d=(await S.updateDepositAndWithdrawStatus({chainId:t,hashedEthereumAddress:o,phase:c.DepositAndWithdrawPhase.BEFORE_DEPOSIT})).id??void 0,f=await D(u).rpc(),p=await u.program.provider.connection.getLatestBlockhash();await u.program.provider.connection.confirmTransaction({blockhash:p.blockhash,lastValidBlockHeight:p.lastValidBlockHeight,signature:f},`finalized`);let m=await h.fetchSolanaTransaction(u.program.provider.connection,f,`finalized`);if(!m)throw Error(`Transaction missing`);await S.safeUpdateDepositAndWithdrawStatus({id:d,chainId:t,hashedEthereumAddress:o,phase:c.DepositAndWithdrawPhase.AFTER_DEPOSIT,depositTxHash:f});let{compressedAddress:g}=l.formatMintAddress(n.erc20TokenAddress),_=v.getOnChainUtxosFromReceiptSolana(m,u.program,e.userKeys,g),b=[],x=[..._];return i.forEach((e,t)=>{let n=s[t],r=x.find(e=>e.amount===n);if(!r)throw Error(`Could not find newly created UTXO with amount ${n} for recipient ${e}.`);b.push({recipientAddress:e,utxo:r}),x.splice(x.indexOf(r),1)}),{userDepositedUtxos:b,depositTxHash:f,statusId:d}},k=async(s,u,d,p,h,g,_,v,w,T,E,D,O)=>{let k=d.erc20TokenAddress;if(p.length===0)throw Error(`userDepositedUtxos must not be empty`);let{originalDeployer:A}=e.networkRegistry[u].contractData;if(!A)throw Error(`missing data`);let j=await s.getRandomRelay(u,!0);if(!j)throw Error(n.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let M=a.getCurrentTimeInSeconds().toString(),N=s.generateProofRemotely?5:1,P=[];for(let e=0;e<p.length;e+=N){let n=p.slice(e,e+N),a=await Promise.all(n.map(async({recipientAddress:e,utxo:n},a)=>{let{compressedAddress:c}=l.formatMintAddress(t.solanaNativeAddress),p=new o.Utxo({amount:0n,mintAddress:k,erc20TokenAddress:c,nullifyingKey:s.userKeys.getShieldedPrivateKey(),timeStamp:M,...n.isNewStyle?{spendingPublicKey:s.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,isNewStyle:!0}:{isNewStyle:!1}}),g=[n,p],v=[p],x=i.UserKeys.findCorrectRandomization(r.randomBigInt(31),s.userKeys.getShieldedPrivateKey()),S={tokenNumber:1,nullifierAmount:g.length,outputAmount:v.length},w=f.calcEncryptedOutputs([v])[0][0],T=Array.from(C.ethers.getBytes(w)),D=await y.calculateModifiedFeeStructure(u,d,_[a],h),A=m.constructAdminData(E,u,[k],[_[a]],await s.getEthereumAddress()),{proofAArr:N,proofBArr:P,proofCArr:F,publicInputsArr:I,commitmentValidationData:L}=await b.constructSolanaZkProof(s.generateProofRemotely,s.merkleTreeHinkalByChain[u],s.userKeys,[k],[g],[v],x,D.flatFee,D.variableRate,e,j,S,[T],u),R={recipient:e,mint:k===`11111111111111111111111111111111`?void 0:k};return{relayAddress:j,functionName:`transact`,chainId:u,recipientAmount:_[a].toString(),args:{proofAArr:N,proofBArr:P,proofCArr:F,publicInputsArr:I,encryptedOutputs:[T],relayerFee:D.flatFee.toString(),dimensions:S},accounts:R,adminData:A,commitmentValidationData:L,displayRecipient:O?.[a]}}));P.push(...a)}await S.safeUpdateDepositAndWithdrawStatus({id:v,chainId:u,hashedEthereumAddress:g,phase:c.DepositAndWithdrawPhase.BEFORE_SCHEDULE_WITHDRAW});let F=await x.solanaTransactCallRelayerBatch(u,P,g,w,T,D);return await S.safeUpdateDepositAndWithdrawStatus({id:v,chainId:u,hashedEthereumAddress:g,phase:c.DepositAndWithdrawPhase.AFTER_SCHEDULE_WITHDRAW,scheduleId:F}),F},A=async(e,t,n,r,i,a,o,c,l,f)=>{let p=d.validateAndGetChainId([t]),m=t.erc20TokenAddress,h=u.hashEthereumAddress(await e.getEthereumAddressByChain(p)),v=l?u.hashString(l):void 0,y=a??await g.getFeeStructure(p,m,[m],s.ExternalActionId.Transact,[],5n),{userDepositedUtxos:b,depositTxHash:x,statusId:S}=await O(e,p,t,n,r,y,h);return await _.waitForDepositedUtxosInMerkleTree(e,p,b),{depositTxHash:x,scheduleId:await k(e,p,t,b,y,h,n,S,i,o,c,v,f)}};exports.hinkalSolanaDepositAndWithdraw=A;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../../functions/web3/etherFunctions.cjs`),i=require(`../crypto-keys/keys.cjs`),a=require(`../../functions/utils/time.utils.cjs`),o=require(`../utxo/Utxo.cjs`),s=require(`../../functions/utils/solanaMint.utils.cjs`),c=require(`../../functions/utils/addresses.cjs`),l=require(`../../types/external-action.types.cjs`),u=require(`../../types/solana-transact.types.cjs`),d=require(`../../functions/utils/token-check.utils.cjs`),f=require(`../../functions/snarkjs/common.snarkjs.cjs`),p=require(`../../functions/pre-transaction/solana.cjs`),m=require(`../../functions/pre-transaction/constructAdminData.cjs`),h=require(`../../functions/pre-transaction/getFeeStructure.cjs`),g=require(`../../functions/pre-transaction/speculativeUtxo.cjs`);require(`../../functions/pre-transaction/index.cjs`);const _=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),v=require(`../../functions/utils/fees.utils.cjs`);require(`../../functions/web3/index.cjs`);const y=require(`./hinkalProoflessDeposit.utils.cjs`),b=require(`./hinkalSolanaTransact.cjs`);let x=require(`ethers`),S=require(`@solana/web3.js`),C=require(`@coral-xyz/anchor`);var w=(n,a,o,c)=>{let{hinkalIdl:l,hinkalAddress:u,originalDeployer:d}=e.networkRegistry[a].contractData;if(!l)throw Error(`No IDL configured for Solana program on this network`);if(!d)throw Error(`missing original deployer`);let m=n.userKeys.getShieldedPrivateKey(),h=n.getSolanaProgram(l),g=n.getSolanaPublicKey(),_=new S.PublicKey(d),v=new S.PublicKey(u),{mintPublicKey:y}=s.formatMintAddress(o.erc20TokenAddress),b=y.toString(),x=p.getStorageAccountPublicKey(v,_),C=p.getStorageVaultPublicKey(v,_),w=p.getMerkleAccountPublicKey(v,_),T=c.map(()=>f.calcStealthAddressStructure(i.UserKeys.findCorrectRandomization(r.randomBigInt(31),m),m,n.userKeys.getSpendingKeyPair().pubSpendingBJJPoint)),E=T.map(e=>p.buildAnchorStealthAddressStructure(e)),D=i.UserKeys.getEncryptionKeyPair(m).publicKey,O=b===t.solanaNativeAddress;return{program:h,publicKey:g,originalDeployer:_,mint:O?null:y,atasValue:O?null:void 0,storageAccount:x,storageVault:C,merkleAccount:w,amounts:c,mintAddressString:b,stealthAddressStructures:T,anchorStealthStructures:E,ownEncryptionKey:D}},T=async(e,t)=>{let n=y.buildProoflessEncryptedOutputs(e.stealthAddressStructures,e.amounts.map(()=>e.ownEncryptionKey)).map(e=>Buffer.from(e.slice(2),`hex`)),{current:r,next:i}=await p.resolveSolanaRootBuckets(e.program,e.merkleAccount,e.amounts.length);return e.program.methods.multiPaymentDepositAt(e.amounts.map(e=>new C.BN(e.toString())),e.anchorStealthStructures,n,!0,t?new C.BN(t):null).accounts({mint:e.mint,signer:e.publicKey,signerAta:e.atasValue,originalDeployer:e.originalDeployer,storageAccount:e.storageAccount,storageVault:e.storageVault,merkleAccount:e.merkleAccount,rootBucketCurrent:r,rootBucketNext:i??e.program.programId,storageVaultAta:e.atasValue})},E=async(r,i,c,l,d,f,p,h,_,y)=>{let x=c.erc20TokenAddress;if(l.length===0)throw Error(`userDepositedUtxos must not be empty`);let{originalDeployer:S}=e.networkRegistry[i].contractData;if(!S)throw Error(`missing data`);let C=await r.getRandomRelay(i,!0);if(!C)throw Error(n.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let w=a.getCurrentTimeInSeconds().toString(),T=r.generateProofRemotely?5:1,E=[];for(let e=0;e<l.length;e+=T){let n=l.slice(e,e+T),a=await Promise.all(n.map(async({recipientAddress:n,utxo:a},l)=>{let S=e+l,T={recipient:n,mint:x===`11111111111111111111111111111111`?void 0:x},E=await v.calculateModifiedFeeStructure(i,c,f[S],d),D=m.constructAdminData(p,i,[x],[f[S]],await r.getEthereumAddress()),{compressedAddress:O}=s.formatMintAddress(t.solanaNativeAddress),k=new o.Utxo({amount:0n,mintAddress:x,erc20TokenAddress:O,nullifyingKey:r.userKeys.getShieldedPrivateKey(),timeStamp:w,spendingPublicKey:r.userKeys.getSpendingKeyPair().pubSpendingBJJPoint}),{args:A,commitmentValidationData:j}=await b.hinkalSolanaTransact(r,{chainId:i,mintAddresses:[x],amountChanges:[-a.amount],relayAddress:C,recipient:n,signer:C,functionName:`transact`,accounts:T,relayerFee:E.flatFee,variableRate:E.variableRate,inputUtxos:[[a,k]],useBlockedUtxos:!0,speculative:y&&{pendingLeaves:y,inputUtxos:[[g.toSpeculativeUtxo(a)]]},submit:{mode:u.SolanaSubmitMode.ProofOnly}});return{relayAddress:C,functionName:`transact`,chainId:i,recipientAmount:f[S].toString(),args:A,accounts:T,adminData:D,commitmentValidationData:j,displayRecipient:h?.[S],destinationChainId:_?.chainId,destinationTokenAddress:_?.tokenAddress,destinationTokenAmount:_?.tokenAmounts?.[S]}}));E.push(...a)}return E},D=async(e,t,n,r,i,u,f,p,m,g,y)=>{let b=d.validateAndGetChainId([t]),S=t.erc20TokenAddress,C=c.hashEthereumAddress(await e.getEthereumAddressByChain(b)),D=m?c.hashString(m):void 0,O=u??await h.getFeeStructure(b,S,[S],l.ExternalActionId.Transact,[],25n,{mintTo:S,recipient:r[0],nullifierCount:1}),k=n.map(e=>e+v.calculateTotalFee(e,O)),A=w(e,b,t,k),j=a.getCurrentTimeInSeconds().toString(),{compressedAddress:M}=s.formatMintAddress(S),N=A.stealthAddressStructures.map((t,n)=>({recipientAddress:r[n],utxo:new o.Utxo({amount:k[n],timeStamp:j,nullifyingKey:e.userKeys.getShieldedPrivateKey(),mintAddress:S,erc20TokenAddress:M,stealthAddress:x.ethers.toBeHex(t.stealthAddress),H0:[t.H0x,t.H0y]})})),{connection:P,wallet:F}=A.program.provider,I=async()=>{let e=await(await T(A,j)).transaction();return e.recentBlockhash=(await P.getLatestBlockhash()).blockhash,e.feePayer=A.publicKey,P.sendRawTransaction((await F.signTransaction(e)).serialize())},L=N.map(({utxo:e})=>BigInt(e.getCommitment()).toString()),[R,z]=await Promise.all([I(),E(e,b,t,N,O,n,p,g,y,L)]);return{depositTxHash:R,scheduleId:await _.solanaTransactCallRelayerBatch(b,z,C,i,f,D,R)}};exports.hinkalSolanaDepositAndWithdraw=D;
@@ -1,3 +1,4 @@
1
+ import { DestinationMetadata } from '../../types/bridging-tx.types';
1
2
  import { FeeStructure } from '../../types/hinkal.types';
2
3
  import { IHinkal } from './IHinkal';
3
4
  import { PublicKey } from '@solana/web3.js';
@@ -13,12 +14,15 @@ export declare const buildMultiPaymentDepositSetup: (hinkal: IHinkal, chainId: n
13
14
  storageVault: PublicKey;
14
15
  merkleAccount: PublicKey;
15
16
  amounts: bigint[];
17
+ mintAddressString: string;
18
+ stealthAddressStructures: import('../..').StealthAddressStructure[];
16
19
  anchorStealthStructures: import('../..').AnchorStealthAddressStructure[];
20
+ ownEncryptionKey: string;
17
21
  };
18
22
  export type MultiPaymentDepositSetup = ReturnType<typeof buildMultiPaymentDepositSetup>;
19
- export declare const buildMultiPaymentDepositBuilder: (setup: MultiPaymentDepositSetup) => import('@coral-xyz/anchor/dist/cjs/program/namespace/methods').MethodsBuilder<import('@coral-xyz/anchor').Idl, import('@coral-xyz/anchor/dist/cjs/idl').IdlInstruction & {
23
+ export declare const buildMultiPaymentDepositBuilder: (setup: MultiPaymentDepositSetup, timeStamp?: string) => Promise<import('@coral-xyz/anchor/dist/cjs/program/namespace/methods').MethodsBuilder<import('@coral-xyz/anchor').Idl, import('@coral-xyz/anchor/dist/cjs/idl').IdlInstruction & {
20
24
  name: string;
21
- }, import('@coral-xyz/anchor/dist/cjs/idl').IdlInstructionAccountItem>;
22
- export declare const hinkalSolanaWithdrawBatch: (hinkal: IHinkal, chainId: number, token: ERC20Token, userDepositedUtxos: RecipientUtxo[], feeStructure: FeeStructure, hashedEthereumAddress: string, recipientAmounts: bigint[], statusId: string | undefined, txCompletionTime?: number, ref?: string, action?: AdminTransactionType, hashedDashboardAccountId?: string, displayRecipients?: string[]) => Promise<string>;
25
+ }, import('@coral-xyz/anchor/dist/cjs/idl').IdlInstructionAccountItem>>;
26
+ export declare const hinkalSolanaWithdrawBatch: (hinkal: IHinkal, chainId: number, token: ERC20Token, userDepositedUtxos: RecipientUtxo[], feeStructure: FeeStructure, hashedEthereumAddress: string, recipientAmounts: bigint[], txCompletionTime?: number, ref?: string, action?: AdminTransactionType, hashedDashboardAccountId?: string, displayRecipients?: string[], destination?: DestinationMetadata, pendingLeaves?: string[], dependsOnTxHash?: string) => Promise<string>;
23
27
  export declare const hinkalSolanaDepositAndWithdraw: (hinkal: IHinkal, token: ERC20Token, recipientAmounts: bigint[], recipientAddresses: string[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, // Should be passed fee for only one withdraw transaction, multiplication happening in this function
24
- ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, displayRecipients?: string[]) => Promise<DepositAndSendExtendedResult>;
28
+ ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, displayRecipients?: string[], destination?: DestinationMetadata) => Promise<DepositAndSendExtendedResult>;
@@ -5,159 +5,141 @@ import { randomBigInt as r } from "../../functions/web3/etherFunctions.mjs";
5
5
  import { UserKeys as i } from "../crypto-keys/keys.mjs";
6
6
  import { getCurrentTimeInSeconds as a } from "../../functions/utils/time.utils.mjs";
7
7
  import { Utxo as o } from "../utxo/Utxo.mjs";
8
- import { ExternalActionId as s } from "../../types/external-action.types.mjs";
9
- import { DepositAndWithdrawPhase as c } from "../../types/scheduled-transactions.types.mjs";
10
- import "../../types/index.mjs";
11
- import { formatMintAddress as l } from "../../functions/utils/solanaMint.utils.mjs";
12
- import { hashEthereumAddress as u, hashString as d } from "../../functions/utils/addresses.mjs";
8
+ import { formatMintAddress as s } from "../../functions/utils/solanaMint.utils.mjs";
9
+ import { hashEthereumAddress as c, hashString as l } from "../../functions/utils/addresses.mjs";
10
+ import { ExternalActionId as u } from "../../types/external-action.types.mjs";
11
+ import { SolanaSubmitMode as d } from "../../types/solana-transact.types.mjs";
13
12
  import { validateAndGetChainId as f } from "../../functions/utils/token-check.utils.mjs";
14
- import { calcEncryptedOutputs as p, calcStealthAddressStructure as m } from "../../functions/snarkjs/common.snarkjs.mjs";
15
- import { buildAnchorStealthAddressStructure as h, getMerkleAccountPublicKey as g, getStorageAccountPublicKey as _, getStorageVaultPublicKey as v } from "../../functions/pre-transaction/solana.mjs";
13
+ import { calcStealthAddressStructure as p } from "../../functions/snarkjs/common.snarkjs.mjs";
14
+ import { buildAnchorStealthAddressStructure as m, getMerkleAccountPublicKey as h, getStorageAccountPublicKey as g, getStorageVaultPublicKey as _, resolveSolanaRootBuckets as v } from "../../functions/pre-transaction/solana.mjs";
16
15
  import { constructAdminData as y } from "../../functions/pre-transaction/constructAdminData.mjs";
17
- import { fetchSolanaTransaction as b } from "../../functions/pre-transaction/sendV0Transaction.mjs";
18
- import { getFeeStructure as x } from "../../functions/pre-transaction/getFeeStructure.mjs";
19
- import { waitForDepositedUtxosInMerkleTree as S } from "../../functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs";
16
+ import { getFeeStructure as b } from "../../functions/pre-transaction/getFeeStructure.mjs";
17
+ import { toSpeculativeUtxo as x } from "../../functions/pre-transaction/speculativeUtxo.mjs";
20
18
  import "../../functions/pre-transaction/index.mjs";
21
- import { getOnChainUtxosFromReceiptSolana as C } from "../../functions/utils/getUtxosFromReceiptSolana.mjs";
22
- import { calculateModifiedFeeStructure as w, calculateTotalFee as T } from "../../functions/utils/fees.utils.mjs";
19
+ import { solanaTransactCallRelayerBatch as S } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
20
+ import { calculateModifiedFeeStructure as C, calculateTotalFee as w } from "../../functions/utils/fees.utils.mjs";
23
21
  import "../../functions/web3/index.mjs";
24
- import { constructSolanaZkProof as E } from "../../functions/snarkjs/constructSolanaZkProof.mjs";
25
- import { solanaTransactCallRelayerBatch as D } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
26
- import { safeUpdateDepositAndWithdrawStatus as O, updateDepositAndWithdrawStatus as k } from "../../API/deposit-and-withdraw-status-calls.mjs";
27
- import "../../functions/index.mjs";
28
- import { ethers as A } from "ethers";
29
- import { PublicKey as j } from "@solana/web3.js";
30
- import { BN as M } from "@coral-xyz/anchor";
22
+ import { buildProoflessEncryptedOutputs as T } from "./hinkalProoflessDeposit.utils.mjs";
23
+ import { hinkalSolanaTransact as E } from "./hinkalSolanaTransact.mjs";
24
+ import { ethers as D } from "ethers";
25
+ import { PublicKey as O } from "@solana/web3.js";
26
+ import { BN as k } from "@coral-xyz/anchor";
31
27
  //#region libs/shared/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.ts
32
- var N = (n, a, o, s) => {
33
- let { hinkalIdl: c, hinkalAddress: u, originalDeployer: d } = e[a].contractData;
34
- if (!c) throw Error("No IDL configured for Solana program on this network");
28
+ var A = (n, a, o, c) => {
29
+ let { hinkalIdl: l, hinkalAddress: u, originalDeployer: d } = e[a].contractData;
30
+ if (!l) throw Error("No IDL configured for Solana program on this network");
35
31
  if (!d) throw Error("missing original deployer");
36
- let f = n.userKeys.getShieldedPrivateKey(), p = n.getSolanaProgram(c), y = n.getSolanaPublicKey(), b = new j(d), x = new j(u), { mintPublicKey: S } = l(o.erc20TokenAddress), C = S.toString(), w = _(x, b), T = v(x, b), E = g(x, b), D = s.map(() => h(m(i.findCorrectRandomization(r(31), f), f, n.userKeys.getSpendingKeyPair().pubSpendingBJJPoint))), O = C === t;
32
+ let f = n.userKeys.getShieldedPrivateKey(), v = n.getSolanaProgram(l), y = n.getSolanaPublicKey(), b = new O(d), x = new O(u), { mintPublicKey: S } = s(o.erc20TokenAddress), C = S.toString(), w = g(x, b), T = _(x, b), E = h(x, b), D = c.map(() => p(i.findCorrectRandomization(r(31), f), f, n.userKeys.getSpendingKeyPair().pubSpendingBJJPoint)), k = D.map((e) => m(e)), A = i.getEncryptionKeyPair(f).publicKey, j = C === t;
37
33
  return {
38
- program: p,
34
+ program: v,
39
35
  publicKey: y,
40
36
  originalDeployer: b,
41
- mint: O ? null : S,
42
- atasValue: O ? null : void 0,
37
+ mint: j ? null : S,
38
+ atasValue: j ? null : void 0,
43
39
  storageAccount: w,
44
40
  storageVault: T,
45
41
  merkleAccount: E,
46
- amounts: s,
47
- anchorStealthStructures: D
42
+ amounts: c,
43
+ mintAddressString: C,
44
+ stealthAddressStructures: D,
45
+ anchorStealthStructures: k,
46
+ ownEncryptionKey: A
48
47
  };
49
- }, P = (e) => e.program.methods.multiPaymentDeposit(e.amounts.map((e) => new M(e.toString())), e.anchorStealthStructures, !0).accounts({
50
- mint: e.mint,
51
- signer: e.publicKey,
52
- signerAta: e.atasValue,
53
- originalDeployer: e.originalDeployer,
54
- storageAccount: e.storageAccount,
55
- storageVault: e.storageVault,
56
- merkleAccount: e.merkleAccount,
57
- storageVaultAta: e.atasValue
58
- }), F = async (e, t, n, r, i, a, o) => {
59
- let s = r.map((e) => e + T(e, a)), u = N(e, t, n, s), d = (await k({
60
- chainId: t,
61
- hashedEthereumAddress: o,
62
- phase: c.BEFORE_DEPOSIT
63
- })).id ?? void 0, f = await P(u).rpc(), p = await u.program.provider.connection.getLatestBlockhash();
64
- await u.program.provider.connection.confirmTransaction({
65
- blockhash: p.blockhash,
66
- lastValidBlockHeight: p.lastValidBlockHeight,
67
- signature: f
68
- }, "finalized");
69
- let m = await b(u.program.provider.connection, f, "finalized");
70
- if (!m) throw Error("Transaction missing");
71
- await O({
72
- id: d,
73
- chainId: t,
74
- hashedEthereumAddress: o,
75
- phase: c.AFTER_DEPOSIT,
76
- depositTxHash: f
48
+ }, j = async (e, t) => {
49
+ let n = T(e.stealthAddressStructures, e.amounts.map(() => e.ownEncryptionKey)).map((e) => Buffer.from(e.slice(2), "hex")), { current: r, next: i } = await v(e.program, e.merkleAccount, e.amounts.length);
50
+ return e.program.methods.multiPaymentDepositAt(e.amounts.map((e) => new k(e.toString())), e.anchorStealthStructures, n, !0, t ? new k(t) : null).accounts({
51
+ mint: e.mint,
52
+ signer: e.publicKey,
53
+ signerAta: e.atasValue,
54
+ originalDeployer: e.originalDeployer,
55
+ storageAccount: e.storageAccount,
56
+ storageVault: e.storageVault,
57
+ merkleAccount: e.merkleAccount,
58
+ rootBucketCurrent: r,
59
+ rootBucketNext: i ?? e.program.programId,
60
+ storageVaultAta: e.atasValue
77
61
  });
78
- let { compressedAddress: h } = l(n.erc20TokenAddress), g = C(m, u.program, e.userKeys, h), _ = [], v = [...g];
79
- return i.forEach((e, t) => {
80
- let n = s[t], r = v.find((e) => e.amount === n);
81
- if (!r) throw Error(`Could not find newly created UTXO with amount ${n} for recipient ${e}.`);
82
- _.push({
83
- recipientAddress: e,
84
- utxo: r
85
- }), v.splice(v.indexOf(r), 1);
86
- }), {
87
- userDepositedUtxos: _,
88
- depositTxHash: f,
89
- statusId: d
90
- };
91
- }, I = async (s, u, d, f, m, h, g, _, v, b, x, S, C) => {
92
- let T = d.erc20TokenAddress;
93
- if (f.length === 0) throw Error("userDepositedUtxos must not be empty");
94
- let { originalDeployer: k } = e[u].contractData;
95
- if (!k) throw Error("missing data");
96
- let j = await s.getRandomRelay(u, !0);
97
- if (!j) throw Error(n.RELAYER_NOT_AVAILABLE);
98
- let M = a().toString(), N = s.generateProofRemotely ? 5 : 1, P = [];
99
- for (let e = 0; e < f.length; e += N) {
100
- let n = f.slice(e, e + N), a = await Promise.all(n.map(async ({ recipientAddress: e, utxo: n }, a) => {
101
- let { compressedAddress: c } = l(t), f = new o({
62
+ }, M = async (r, i, c, l, u, f, p, m, h, g) => {
63
+ let _ = c.erc20TokenAddress;
64
+ if (l.length === 0) throw Error("userDepositedUtxos must not be empty");
65
+ let { originalDeployer: v } = e[i].contractData;
66
+ if (!v) throw Error("missing data");
67
+ let b = await r.getRandomRelay(i, !0);
68
+ if (!b) throw Error(n.RELAYER_NOT_AVAILABLE);
69
+ let S = a().toString(), w = r.generateProofRemotely ? 5 : 1, T = [];
70
+ for (let e = 0; e < l.length; e += w) {
71
+ let n = l.slice(e, e + w), a = await Promise.all(n.map(async ({ recipientAddress: n, utxo: a }, l) => {
72
+ let v = e + l, w = {
73
+ recipient: n,
74
+ mint: _ === "11111111111111111111111111111111" ? void 0 : _
75
+ }, T = await C(i, c, f[v], u), D = y(p, i, [_], [f[v]], await r.getEthereumAddress()), { compressedAddress: O } = s(t), k = new o({
102
76
  amount: 0n,
103
- mintAddress: T,
104
- erc20TokenAddress: c,
105
- nullifyingKey: s.userKeys.getShieldedPrivateKey(),
106
- timeStamp: M,
107
- ...n.isNewStyle ? {
108
- spendingPublicKey: s.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,
109
- isNewStyle: !0
110
- } : { isNewStyle: !1 }
111
- }), h = [n, f], _ = [f], v = i.findCorrectRandomization(r(31), s.userKeys.getShieldedPrivateKey()), b = {
112
- tokenNumber: 1,
113
- nullifierAmount: h.length,
114
- outputAmount: _.length
115
- }, S = p([_])[0][0], D = Array.from(A.getBytes(S)), O = await w(u, d, g[a], m), k = y(x, u, [T], [g[a]], await s.getEthereumAddress()), { proofAArr: N, proofBArr: P, proofCArr: F, publicInputsArr: I, commitmentValidationData: L } = await E(s.generateProofRemotely, s.merkleTreeHinkalByChain[u], s.userKeys, [T], [h], [_], v, O.flatFee, O.variableRate, e, j, b, [D], u), R = {
116
- recipient: e,
117
- mint: T === "11111111111111111111111111111111" ? void 0 : T
118
- };
119
- return {
120
- relayAddress: j,
77
+ mintAddress: _,
78
+ erc20TokenAddress: O,
79
+ nullifyingKey: r.userKeys.getShieldedPrivateKey(),
80
+ timeStamp: S,
81
+ spendingPublicKey: r.userKeys.getSpendingKeyPair().pubSpendingBJJPoint
82
+ }), { args: A, commitmentValidationData: j } = await E(r, {
83
+ chainId: i,
84
+ mintAddresses: [_],
85
+ amountChanges: [-a.amount],
86
+ relayAddress: b,
87
+ recipient: n,
88
+ signer: b,
121
89
  functionName: "transact",
122
- chainId: u,
123
- recipientAmount: g[a].toString(),
124
- args: {
125
- proofAArr: N,
126
- proofBArr: P,
127
- proofCArr: F,
128
- publicInputsArr: I,
129
- encryptedOutputs: [D],
130
- relayerFee: O.flatFee.toString(),
131
- dimensions: b
90
+ accounts: w,
91
+ relayerFee: T.flatFee,
92
+ variableRate: T.variableRate,
93
+ inputUtxos: [[a, k]],
94
+ useBlockedUtxos: !0,
95
+ speculative: g && {
96
+ pendingLeaves: g,
97
+ inputUtxos: [[x(a)]]
132
98
  },
133
- accounts: R,
134
- adminData: k,
135
- commitmentValidationData: L,
136
- displayRecipient: C?.[a]
99
+ submit: { mode: d.ProofOnly }
100
+ });
101
+ return {
102
+ relayAddress: b,
103
+ functionName: "transact",
104
+ chainId: i,
105
+ recipientAmount: f[v].toString(),
106
+ args: A,
107
+ accounts: w,
108
+ adminData: D,
109
+ commitmentValidationData: j,
110
+ displayRecipient: m?.[v],
111
+ destinationChainId: h?.chainId,
112
+ destinationTokenAddress: h?.tokenAddress,
113
+ destinationTokenAmount: h?.tokenAmounts?.[v]
137
114
  };
138
115
  }));
139
- P.push(...a);
116
+ T.push(...a);
140
117
  }
141
- await O({
142
- id: _,
143
- chainId: u,
144
- hashedEthereumAddress: h,
145
- phase: c.BEFORE_SCHEDULE_WITHDRAW
146
- });
147
- let F = await D(u, P, h, v, b, S);
148
- return await O({
149
- id: _,
150
- chainId: u,
151
- hashedEthereumAddress: h,
152
- phase: c.AFTER_SCHEDULE_WITHDRAW,
153
- scheduleId: F
154
- }), F;
155
- }, L = async (e, t, n, r, i, a, o, c, l, p) => {
156
- let m = f([t]), h = t.erc20TokenAddress, g = u(await e.getEthereumAddressByChain(m)), _ = l ? d(l) : void 0, v = a ?? await x(m, h, [h], s.Transact, [], 5n), { userDepositedUtxos: y, depositTxHash: b, statusId: C } = await F(e, m, t, n, r, v, g);
157
- return await S(e, m, y), {
158
- depositTxHash: b,
159
- scheduleId: await I(e, m, t, y, v, g, n, C, i, o, c, _, p)
118
+ return T;
119
+ }, N = async (e, t, n, r, i, d, p, m, h, g, _) => {
120
+ let v = f([t]), y = t.erc20TokenAddress, x = c(await e.getEthereumAddressByChain(v)), C = h ? l(h) : void 0, T = d ?? await b(v, y, [y], u.Transact, [], 25n, {
121
+ mintTo: y,
122
+ recipient: r[0],
123
+ nullifierCount: 1
124
+ }), E = n.map((e) => e + w(e, T)), O = A(e, v, t, E), k = a().toString(), { compressedAddress: N } = s(y), P = O.stealthAddressStructures.map((t, n) => ({
125
+ recipientAddress: r[n],
126
+ utxo: new o({
127
+ amount: E[n],
128
+ timeStamp: k,
129
+ nullifyingKey: e.userKeys.getShieldedPrivateKey(),
130
+ mintAddress: y,
131
+ erc20TokenAddress: N,
132
+ stealthAddress: D.toBeHex(t.stealthAddress),
133
+ H0: [t.H0x, t.H0y]
134
+ })
135
+ })), { connection: F, wallet: I } = O.program.provider, L = async () => {
136
+ let e = await (await j(O, k)).transaction();
137
+ return e.recentBlockhash = (await F.getLatestBlockhash()).blockhash, e.feePayer = O.publicKey, F.sendRawTransaction((await I.signTransaction(e)).serialize());
138
+ }, R = P.map(({ utxo: e }) => BigInt(e.getCommitment()).toString()), [z, B] = await Promise.all([L(), M(e, v, t, P, T, n, m, g, _, R)]);
139
+ return {
140
+ depositTxHash: z,
141
+ scheduleId: await S(v, B, x, i, p, C, z)
160
142
  };
161
143
  };
162
144
  //#endregion
163
- export { L as hinkalSolanaDepositAndWithdraw };
145
+ export { N as hinkalSolanaDepositAndWithdraw };
@@ -1 +1 @@
1
- const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/token-check.utils.cjs`),n=require(`../../functions/utils/getRecipientInfoFromUserKeys.cjs`),r=require(`./hinkalSolanaDeposit.cjs`);var i=async(i,a,o,s,c,l=!1)=>{if(a.length===0)throw Error(`erc20Tokens must not be empty`);if(a.length!==o.length)throw Error(`erc20Tokens and amountChanges length mismatch`);if(!e.isSolanaLike(t.validateAndGetChainId(a)))throw Error(`hinkalSolanaProoflessDepositHash: non-Solana chain`);let u=a[0];if(!a.every(e=>e.erc20TokenAddress===u.erc20TokenAddress))throw Error(`Solana prooflessDeposit supports one mint per transaction`);if(s&&s.length!==o.length)throw Error(`Stealth address structures length mismatch`);return r.submitSolanaProoflessDeposit(i,u,o,s??o.map(()=>n.getStealthAddressStructureFromUserKeys(i.userKeys)),c,l)};exports.hinkalSolanaProoflessDeposit=i;
1
+ const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/addresses.cjs`),n=require(`../../functions/utils/token-check.utils.cjs`),r=require(`../../functions/utils/getRecipientInfoFromUserKeys.cjs`),i=require(`./hinkalSolanaDeposit.cjs`);var a=async(a,o,s,c,l,u=!1,d,f=!1)=>{if(o.length===0)throw Error(`erc20Tokens must not be empty`);if(o.length!==s.length)throw Error(`erc20Tokens and amountChanges length mismatch`);if(!e.isSolanaLike(n.validateAndGetChainId(o)))throw Error(`hinkalSolanaProoflessDepositHash: non-Solana chain`);let p=o[0];if(!o.every(e=>e.erc20TokenAddress===p.erc20TokenAddress))throw Error(`Solana prooflessDeposit supports one mint per transaction`);if(c&&c.length!==s.length)throw Error(`Stealth address structures length mismatch`);if(l&&l.length!==s.length)throw Error(`Recipient encryption keys length mismatch`);if(c&&!l)throw Error(`recipientEncryptionKeysOverride is required when stealthAddressStructuresOverride is provided`);let m=r.getRecipientInfoFromUserKeys(a.userKeys);return i.submitSolanaProoflessDeposit(a,p,s,c??s.map(()=>t.constructStealthAddressStructure(m)),l??s.map(()=>t.getEncryptionKeyFromRecipientInfo(m)),u,d,f)};exports.hinkalSolanaProoflessDeposit=a;
@@ -2,4 +2,4 @@ import { StealthAddressStructure } from '../../types/circom-data.types';
2
2
  import { ERC20Token } from '../../types/token.types';
3
3
  import { IHinkal } from './IHinkal';
4
4
  import { AdminTransactionType } from '../../types/admin.types';
5
- export declare const hinkalSolanaProoflessDeposit: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], stealthAddressStructuresOverride?: StealthAddressStructure[], action?: AdminTransactionType, returnTxData?: boolean) => Promise<string>;
5
+ export declare const hinkalSolanaProoflessDeposit: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], stealthAddressStructuresOverride?: StealthAddressStructure[], recipientEncryptionKeysOverride?: string[], createBlockedUtxos?: boolean, action?: AdminTransactionType, returnTxData?: boolean) => Promise<string>;
@@ -1,16 +1,20 @@
1
1
  import { isSolanaLike as e } from "../../constants/chains.constants.mjs";
2
- import { validateAndGetChainId as t } from "../../functions/utils/token-check.utils.mjs";
3
- import { getStealthAddressStructureFromUserKeys as n } from "../../functions/utils/getRecipientInfoFromUserKeys.mjs";
4
- import { submitSolanaProoflessDeposit as r } from "./hinkalSolanaDeposit.mjs";
2
+ import { constructStealthAddressStructure as t, getEncryptionKeyFromRecipientInfo as n } from "../../functions/utils/addresses.mjs";
3
+ import { validateAndGetChainId as r } from "../../functions/utils/token-check.utils.mjs";
4
+ import { getRecipientInfoFromUserKeys as i } from "../../functions/utils/getRecipientInfoFromUserKeys.mjs";
5
+ import { submitSolanaProoflessDeposit as a } from "./hinkalSolanaDeposit.mjs";
5
6
  //#region libs/shared/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.ts
6
- var i = async (i, a, o, s, c, l = !1) => {
7
- if (a.length === 0) throw Error("erc20Tokens must not be empty");
8
- if (a.length !== o.length) throw Error("erc20Tokens and amountChanges length mismatch");
9
- if (!e(t(a))) throw Error("hinkalSolanaProoflessDepositHash: non-Solana chain");
10
- let u = a[0];
11
- if (!a.every((e) => e.erc20TokenAddress === u.erc20TokenAddress)) throw Error("Solana prooflessDeposit supports one mint per transaction");
12
- if (s && s.length !== o.length) throw Error("Stealth address structures length mismatch");
13
- return r(i, u, o, s ?? o.map(() => n(i.userKeys)), c, l);
7
+ var o = async (o, s, c, l, u, d = !1, f, p = !1) => {
8
+ if (s.length === 0) throw Error("erc20Tokens must not be empty");
9
+ if (s.length !== c.length) throw Error("erc20Tokens and amountChanges length mismatch");
10
+ if (!e(r(s))) throw Error("hinkalSolanaProoflessDepositHash: non-Solana chain");
11
+ let m = s[0];
12
+ if (!s.every((e) => e.erc20TokenAddress === m.erc20TokenAddress)) throw Error("Solana prooflessDeposit supports one mint per transaction");
13
+ if (l && l.length !== c.length) throw Error("Stealth address structures length mismatch");
14
+ if (u && u.length !== c.length) throw Error("Recipient encryption keys length mismatch");
15
+ if (l && !u) throw Error("recipientEncryptionKeysOverride is required when stealthAddressStructuresOverride is provided");
16
+ let h = i(o.userKeys);
17
+ return a(o, m, c, l ?? c.map(() => t(h)), u ?? c.map(() => n(h)), d, f, p);
14
18
  };
15
19
  //#endregion
16
- export { i as hinkalSolanaProoflessDeposit };
20
+ export { o as hinkalSolanaProoflessDeposit };
@@ -1 +1 @@
1
- require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/token-check.utils.cjs`),n=require(`../../functions/pre-transaction/constructAdminData.cjs`),r=require(`../../functions/utils/create-provider.cjs`),i=require(`../AccountActions/AccountActions.cjs`),a=require(`../../functions/pre-transaction/sendV0Transaction.cjs`),o=require(`../../API/admin-calls.cjs`),s=require(`../../functions/pre-transaction/solanaTransfer.utils.cjs`);let c=require(`@solana/web3.js`);var l=async(n,a,o,l)=>{let u=t.validateAndGetChainId([n]),d=i.AccountActions.getAddressFromSubAccount(u,o);if(!d)throw Error(`Public account address is not available`);let{fetchRpcUrl:f}=e.networkRegistry[u];if(!f)throw Error(`RPC URL not found for the specified chain ID`);let p=r.createCustomSolanaConnection(f),m=new c.PublicKey(d),{instructions:h,programId:g}=await s.buildSolanaTransferInstructions(p,m,new c.PublicKey(l),n,a);return{connection:p,chainId:u,senderAddress:d,senderPublickey:m,programId:g,instructions:h}},u=async(e,t,r,i,s,c)=>{let[{connection:u,chainId:d,senderPublickey:f,instructions:p},m]=await Promise.all([l(t,r,i,s),e.getEthereumAddress()]),h=await a.sendProxyV0Transaction({connection:u,chainId:d,subAccount:i,payerPublicKey:f,instructions:p});return o.emitTxPublicData(n.constructAdminData(c,d,[t.erc20TokenAddress],[r],m)),h};exports.hinkalSolanaProxySend=u;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/token-check.utils.cjs`),n=require(`../../functions/pre-transaction/constructAdminData.cjs`),r=require(`../../functions/utils/create-provider.cjs`),i=require(`../AccountActions/AccountActions.cjs`),a=require(`../../functions/pre-transaction/sendV0Transaction.cjs`),o=require(`../../API/admin-calls.cjs`),s=require(`../../functions/pre-transaction/solanaTransfer.utils.cjs`);let c=require(`@solana/web3.js`);var l=async(n,a,o,l)=>{let u=t.validateAndGetChainId([n]),d=i.AccountActions.getAddressFromSubAccount(u,o);if(!d)throw Error(`Public account address is not available`);let{rpcUrl:f}=e.networkRegistry[u],p=r.createCustomSolanaConnection(f),m=new c.PublicKey(d),{instructions:h,programId:g}=await s.buildSolanaTransferInstructions(p,m,new c.PublicKey(l),n,a);return{connection:p,chainId:u,senderAddress:d,senderPublickey:m,programId:g,instructions:h}},u=async(e,t,r,i,s,c)=>{let[{connection:u,chainId:d,senderPublickey:f,instructions:p},m]=await Promise.all([l(t,r,i,s),e.getEthereumAddress()]),h=await a.sendProxyV0Transaction({connection:u,chainId:d,subAccount:i,payerPublicKey:f,instructions:p});return o.emitTxPublicData(n.constructAdminData(c,d,[t.erc20TokenAddress],[r],m)),h};exports.hinkalSolanaProxySend=u;