@gurge/sdk 0.3.142 → 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 (1106) 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 +97 -0
  4. package/common/src/API/API.mjs +96 -121
  5. package/common/src/API/TokenCallsCachedHelper.d.ts +15 -0
  6. package/common/src/API/admin-calls.cjs +1 -1
  7. package/common/src/API/admin-calls.d.ts +9 -0
  8. package/common/src/API/admin-calls.mjs +3 -1
  9. package/common/src/API/callLifiAPI.cjs +1 -1
  10. package/common/src/API/callLifiAPI.d.ts +37 -0
  11. package/common/src/API/callLifiAPI.mjs +7 -2
  12. package/common/src/API/callMonitor.d.ts +9 -0
  13. package/common/src/API/callNearIntentsAPI.cjs +1 -1
  14. package/common/src/API/callNearIntentsAPI.d.ts +3 -0
  15. package/common/src/API/callNearIntentsAPI.mjs +2 -2
  16. package/common/src/API/callOkxAPI.d.ts +10 -0
  17. package/common/src/API/callRelayer.cjs +1 -1
  18. package/common/src/API/callRelayer.d.ts +76 -0
  19. package/common/src/API/callRelayer.mjs +7 -1
  20. package/common/src/API/checkRisk.d.ts +1 -0
  21. package/common/src/API/dashboardAccountCalls.d.ts +24 -0
  22. package/common/src/API/dashboardAccountMemberCalls.cjs +1 -1
  23. package/common/src/API/dashboardAccountMemberCalls.d.ts +49 -0
  24. package/common/src/API/dashboardAccountMemberCalls.mjs +5 -2
  25. package/common/src/API/dashboardBalanceCalls.d.ts +12 -0
  26. package/common/src/API/dashboardContactCalls.d.ts +9 -0
  27. package/common/src/API/dashboardPayoutCalls.cjs +1 -1
  28. package/common/src/API/dashboardPayoutCalls.d.ts +15 -0
  29. package/common/src/API/dashboardPayoutCalls.mjs +4 -1
  30. package/common/src/API/dashboardTransactionCalls.cjs +1 -1
  31. package/common/src/API/dashboardTransactionCalls.d.ts +6 -0
  32. package/common/src/API/dashboardTransactionCalls.mjs +2 -2
  33. package/common/src/API/enclaveRecipientInfoCalls.d.ts +12 -0
  34. package/common/src/API/enclaveSignatureCalls.cjs +1 -1
  35. package/common/src/API/enclaveSignatureCalls.d.ts +6 -0
  36. package/common/src/API/enclaveSignatureCalls.mjs +5 -8
  37. package/common/src/API/enclaveUtxoCalls.cjs +1 -1
  38. package/common/src/API/enclaveUtxoCalls.d.ts +59 -0
  39. package/common/src/API/enclaveUtxoCalls.mjs +16 -17
  40. package/common/src/API/evm-rpc-fallback.cjs +1 -0
  41. package/common/src/API/evm-rpc-fallback.d.ts +1 -0
  42. package/common/src/API/evm-rpc-fallback.mjs +17 -0
  43. package/common/src/API/evm-token-assets.d.ts +8 -0
  44. package/common/src/API/fetchCommitmentsCache.d.ts +19 -0
  45. package/common/src/API/get-token-data.d.ts +6 -0
  46. package/common/src/API/get-token-price-chart-data.d.ts +16 -0
  47. package/common/src/API/getCoingeckoPrice.d.ts +21 -0
  48. package/common/src/API/getGasEstimates.d.ts +10 -0
  49. package/common/src/API/getOdosPriceForToken.cjs +1 -0
  50. package/common/src/API/getOdosPriceForToken.d.ts +1 -0
  51. package/common/src/API/getOdosPriceForToken.mjs +14 -0
  52. package/common/src/API/getServerURL.d.ts +7 -0
  53. package/common/src/API/getTokenPrice.d.ts +10 -0
  54. package/common/src/API/getWebsiteURL.d.ts +3 -0
  55. package/common/src/API/index.cjs +1 -1
  56. package/common/src/API/index.d.ts +24 -0
  57. package/common/src/API/index.mjs +4 -5
  58. package/common/src/API/onrampCalls.d.ts +20 -0
  59. package/common/src/API/payoutNotificationStateCalls.cjs +1 -0
  60. package/common/src/API/payoutNotificationStateCalls.d.ts +10 -0
  61. package/common/src/API/payoutNotificationStateCalls.mjs +10 -0
  62. package/common/src/API/privacy-score-calls.d.ts +17 -0
  63. package/common/src/API/privateSendEmailNotificationsCalls.d.ts +8 -0
  64. package/common/src/API/privateSendNonceCalls.d.ts +13 -0
  65. package/common/src/API/privateSendRecipientInfoCalls.cjs +1 -1
  66. package/common/src/API/privateSendRecipientInfoCalls.d.ts +8 -0
  67. package/common/src/API/privateSendRecipientInfoCalls.mjs +12 -6
  68. package/common/src/API/proxyAccountsCalls.cjs +1 -1
  69. package/common/src/API/proxyAccountsCalls.d.ts +5 -0
  70. package/common/src/API/proxyAccountsCalls.mjs +11 -10
  71. package/common/src/API/relayCalls.d.ts +5 -0
  72. package/common/src/API/resolve-sns.d.ts +1 -0
  73. package/common/src/API/rewardsUserCalls.cjs +1 -1
  74. package/common/src/API/rewardsUserCalls.d.ts +21 -0
  75. package/common/src/API/rewardsUserCalls.mjs +2 -10
  76. package/common/src/API/route-config.cjs +1 -0
  77. package/common/src/API/route-config.d.ts +1 -0
  78. package/common/src/API/route-config.mjs +26 -0
  79. package/common/src/API/scheduled-transactions-calls.cjs +1 -1
  80. package/common/src/API/scheduled-transactions-calls.d.ts +17 -0
  81. package/common/src/API/scheduled-transactions-calls.mjs +2 -6
  82. package/common/src/API/seedless-calls.d.ts +53 -0
  83. package/common/src/API/simulate-batch-tx.d.ts +3 -0
  84. package/common/src/API/simulate-transaction.d.ts +5 -0
  85. package/common/src/API/snapshot-event-calls.d.ts +7 -0
  86. package/common/src/API/solana-nft-assets.d.ts +1 -0
  87. package/common/src/API/solana-priority-fee.cjs +1 -0
  88. package/common/src/API/solana-priority-fee.d.ts +3 -0
  89. package/common/src/API/solana-priority-fee.mjs +20 -0
  90. package/common/src/API/solana-rpc-fallback.cjs +1 -0
  91. package/common/src/API/solana-rpc-fallback.d.ts +1 -0
  92. package/common/src/API/solana-rpc-fallback.mjs +13 -0
  93. package/common/src/API/temporaryWalletCalls.cjs +1 -1
  94. package/common/src/API/temporaryWalletCalls.d.ts +11 -0
  95. package/common/src/API/temporaryWalletCalls.mjs +8 -9
  96. package/common/src/API/tenderly.api.cjs +1 -1
  97. package/common/src/API/tenderly.api.d.ts +15 -0
  98. package/common/src/API/tenderly.api.mjs +1 -1
  99. package/common/src/API/token-calls.d.ts +4 -0
  100. package/common/src/API/tronSubsidyCalls.d.ts +13 -0
  101. package/common/src/API/weeklyAnalyticCalls.cjs +1 -1
  102. package/common/src/API/weeklyAnalyticCalls.d.ts +12 -0
  103. package/common/src/API/weeklyAnalyticCalls.mjs +2 -5
  104. package/common/src/constants/activity.constants.d.ts +2 -0
  105. package/common/src/constants/addresses.constants.cjs +1 -1
  106. package/common/src/constants/addresses.constants.d.ts +28 -0
  107. package/common/src/constants/addresses.constants.mjs +19 -60
  108. package/common/src/constants/auth.constants.d.ts +2 -0
  109. package/common/src/constants/backend.constants.d.ts +12 -0
  110. package/common/src/constants/balance.constants.cjs +1 -0
  111. package/common/src/constants/balance.constants.d.ts +4 -0
  112. package/common/src/constants/balance.constants.mjs +4 -0
  113. package/common/src/constants/bridging.constants.cjs +1 -1
  114. package/common/src/constants/bridging.constants.d.ts +35 -0
  115. package/common/src/constants/bridging.constants.mjs +2 -1
  116. package/common/src/constants/chains.constants.cjs +1 -1
  117. package/common/src/constants/chains.constants.d.ts +74 -0
  118. package/common/src/constants/chains.constants.mjs +175 -198
  119. package/common/src/constants/coingecko.constants.cjs +1 -1
  120. package/common/src/constants/coingecko.constants.d.ts +46 -0
  121. package/common/src/constants/coingecko.constants.mjs +1 -1
  122. package/common/src/constants/contracts.constants.cjs +1 -1
  123. package/common/src/constants/contracts.constants.d.ts +11 -0
  124. package/common/src/constants/contracts.constants.mjs +16 -34
  125. package/common/src/constants/conversion.constants.d.ts +1 -0
  126. package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
  127. package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.mjs +8 -9
  128. package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
  129. package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.mjs +7 -6
  130. package/common/src/constants/deploy-data/deploy-data-base.json.cjs +1 -1
  131. package/common/src/constants/deploy-data/deploy-data-base.json.mjs +8 -9
  132. package/common/src/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +1 -0
  133. package/common/src/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +12 -0
  134. package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
  135. package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.mjs +8 -9
  136. package/common/src/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
  137. package/common/src/constants/deploy-data/deploy-data-localhost.json.mjs +0 -3
  138. package/common/src/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
  139. package/common/src/constants/deploy-data/deploy-data-optimism.json.mjs +8 -9
  140. package/common/src/constants/deploy-data/deploy-data-optimismTest.json.cjs +1 -1
  141. package/common/src/constants/deploy-data/deploy-data-optimismTest.json.mjs +5 -9
  142. package/common/src/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
  143. package/common/src/constants/deploy-data/deploy-data-polygon.json.mjs +8 -9
  144. package/common/src/constants/deploy-data/deploy-data-sepoliaTestnet.json.cjs +1 -1
  145. package/common/src/constants/deploy-data/deploy-data-sepoliaTestnet.json.mjs +0 -1
  146. package/common/src/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
  147. package/common/src/constants/deploy-data/deploy-data-solana.json.mjs +2 -2
  148. package/common/src/constants/deploy-data/deploy-data-tempo.json.cjs +1 -1
  149. package/common/src/constants/deploy-data/deploy-data-tempo.json.mjs +7 -7
  150. package/common/src/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -1
  151. package/common/src/constants/deploy-data/deploy-data-tronMainnet.json.mjs +2 -4
  152. package/common/src/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -1
  153. package/common/src/constants/deploy-data/deploy-data-tronNile.json.mjs +2 -4
  154. package/common/src/constants/deploy-data/index.cjs +1 -1
  155. package/common/src/constants/deploy-data/index.d.ts +15 -0
  156. package/common/src/constants/deploy-data/index.mjs +16 -15
  157. package/common/src/constants/deploy-data/mergeDeployData.d.ts +4 -0
  158. package/common/src/constants/deploy-data/shared-deploy-data-evm.json.cjs +1 -1
  159. package/common/src/constants/deploy-data/shared-deploy-data-evm.json.mjs +36 -45
  160. package/common/src/constants/deploy-data/shared-deploy-data-solana.json.cjs +1 -1
  161. package/common/src/constants/deploy-data/shared-deploy-data-solana.json.mjs +1 -1
  162. package/common/src/constants/deploy-data/shared-deploy-data-tron.json.cjs +1 -1
  163. package/common/src/constants/deploy-data/shared-deploy-data-tron.json.mjs +2 -46
  164. package/common/src/constants/enclaveAuth.constants.d.ts +5 -0
  165. package/common/src/constants/events.constants.cjs +1 -1
  166. package/common/src/constants/events.constants.d.ts +1 -0
  167. package/common/src/constants/events.constants.mjs +1 -15
  168. package/common/src/constants/fees.constants.cjs +1 -1
  169. package/common/src/constants/fees.constants.d.ts +9 -0
  170. package/common/src/constants/fees.constants.mjs +2 -2
  171. package/common/src/constants/function-signatures.constants.d.ts +4 -0
  172. package/common/src/constants/images.constants.d.ts +1 -0
  173. package/common/src/constants/index.cjs +1 -1
  174. package/common/src/constants/index.d.ts +32 -0
  175. package/common/src/constants/index.mjs +1 -1
  176. package/common/src/constants/lifi.constants.cjs +1 -1
  177. package/common/src/constants/lifi.constants.d.ts +3 -0
  178. package/common/src/constants/lifi.constants.mjs +6 -3
  179. package/common/src/constants/link.constant.d.ts +1 -0
  180. package/common/src/constants/mediaUrls.constants.d.ts +43 -0
  181. package/common/src/constants/oauthUrls.constants.d.ts +4 -0
  182. package/common/src/constants/okx.constants.d.ts +3 -0
  183. package/common/src/constants/pay.constants.d.ts +2 -0
  184. package/common/src/constants/permit2.constants.d.ts +7 -0
  185. package/common/src/constants/presale.constants.d.ts +87 -0
  186. package/common/src/constants/protocol.constants.cjs +2 -1
  187. package/common/src/constants/protocol.constants.d.ts +74 -0
  188. package/common/src/constants/protocol.constants.mjs +3 -15
  189. package/common/src/constants/reorg-depths.constants.d.ts +17 -0
  190. package/common/src/constants/save-depths.d.ts +19 -0
  191. package/common/src/constants/schedule.constants.d.ts +2 -0
  192. package/common/src/constants/server.constants.cjs +1 -1
  193. package/common/src/constants/server.constants.d.ts +116 -0
  194. package/common/src/constants/server.constants.mjs +19 -49
  195. package/common/src/constants/tokens.constants.cjs +1 -1
  196. package/common/src/constants/tokens.constants.d.ts +5 -0
  197. package/common/src/constants/tokens.constants.mjs +4 -1
  198. package/common/src/constants/tx-confirmation.constants.cjs +1 -1
  199. package/common/src/constants/tx-confirmation.constants.d.ts +5 -0
  200. package/common/src/constants/tx-confirmation.constants.mjs +2 -2
  201. package/common/src/constants/vite.constants.d.ts +16 -0
  202. package/common/src/constants/wallet.constants.d.ts +1 -0
  203. package/common/src/crypto/babyJub.d.ts +16 -0
  204. package/common/src/crypto/ecdh-sealed-keys.cjs +1 -1
  205. package/common/src/crypto/ecdh-sealed-keys.d.ts +22 -0
  206. package/common/src/crypto/ecdh-sealed-keys.mjs +17 -2
  207. package/common/src/crypto/ecdh.d.ts +2 -0
  208. package/common/src/crypto/eddsa.d.ts +8 -0
  209. package/common/src/crypto/index.cjs +1 -1
  210. package/common/src/crypto/index.d.ts +6 -0
  211. package/common/src/crypto/index.mjs +1 -2
  212. package/common/src/crypto/poseidon.d.ts +15 -0
  213. package/common/src/crypto/preProcessing.d.ts +1 -0
  214. package/common/src/data-structures/AccountActions/AccountActions.d.ts +17 -0
  215. package/common/src/data-structures/AccountActions/index.d.ts +1 -0
  216. package/common/src/data-structures/ApprovalDBs/EventsPublicApprovalsDB.d.ts +17 -0
  217. package/common/src/data-structures/ApprovalDBs/index.d.ts +1 -0
  218. package/common/src/data-structures/BlockchainEvent/BlockchainEvent.d.ts +14 -0
  219. package/common/src/data-structures/Hinkal/Hinkal.cjs +1 -1
  220. package/common/src/data-structures/Hinkal/Hinkal.d.ts +120 -0
  221. package/common/src/data-structures/Hinkal/Hinkal.mjs +142 -174
  222. package/common/src/data-structures/Hinkal/IHinkal.d.ts +106 -0
  223. package/common/src/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
  224. package/common/src/data-structures/Hinkal/handleAutoDepositBack.d.ts +3 -0
  225. package/common/src/data-structures/Hinkal/handleAutoDepositBack.mjs +36 -35
  226. package/common/src/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
  227. package/common/src/data-structures/Hinkal/hinkalActionReceive.d.ts +7 -0
  228. package/common/src/data-structures/Hinkal/hinkalActionReceive.mjs +13 -11
  229. package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.cjs +1 -0
  230. package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.d.ts +6 -0
  231. package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.mjs +100 -0
  232. package/common/src/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -1
  233. package/common/src/data-structures/Hinkal/hinkalClaimUtxo.d.ts +5 -0
  234. package/common/src/data-structures/Hinkal/hinkalClaimUtxo.mjs +40 -50
  235. package/common/src/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
  236. package/common/src/data-structures/Hinkal/hinkalDeposit.d.ts +7 -0
  237. package/common/src/data-structures/Hinkal/hinkalDeposit.mjs +50 -119
  238. package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -1
  239. package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.d.ts +4 -0
  240. package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.mjs +113 -109
  241. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
  242. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +7 -0
  243. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +98 -64
  244. package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
  245. package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +21 -0
  246. package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +50 -48
  247. package/common/src/data-structures/Hinkal/hinkalGetRecipientInfo.d.ts +2 -0
  248. package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.cjs +1 -1
  249. package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.d.ts +6 -0
  250. package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.mjs +8 -3
  251. package/common/src/data-structures/Hinkal/hinkalPalEvmDeposit.d.ts +9 -0
  252. package/common/src/data-structures/Hinkal/hinkalPalSolanaDepositPrepare.d.ts +9 -0
  253. package/common/src/data-structures/Hinkal/hinkalPalTronDepositPrepare.d.ts +9 -0
  254. package/common/src/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  255. package/common/src/data-structures/Hinkal/hinkalPrivateWallet.d.ts +6 -0
  256. package/common/src/data-structures/Hinkal/hinkalPrivateWallet.mjs +50 -38
  257. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
  258. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +7 -0
  259. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.mjs +52 -117
  260. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.cjs +1 -1
  261. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.d.ts +10 -0
  262. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.mjs +26 -32
  263. package/common/src/data-structures/Hinkal/hinkalProxySend.cjs +1 -0
  264. package/common/src/data-structures/Hinkal/hinkalProxySend.d.ts +6 -0
  265. package/common/src/data-structures/Hinkal/hinkalProxySend.mjs +16 -0
  266. package/common/src/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
  267. package/common/src/data-structures/Hinkal/hinkalProxySwap.d.ts +7 -0
  268. package/common/src/data-structures/Hinkal/hinkalProxySwap.mjs +13 -12
  269. package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
  270. package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +6 -0
  271. package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.mjs +19 -17
  272. package/common/src/data-structures/Hinkal/hinkalSignSubAccount.d.ts +4 -0
  273. package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
  274. package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.d.ts +5 -0
  275. package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +50 -79
  276. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
  277. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +8 -0
  278. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.mjs +47 -51
  279. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  280. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +28 -0
  281. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +115 -133
  282. package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -1
  283. package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +5 -0
  284. package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +16 -12
  285. package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
  286. package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +6 -0
  287. package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.mjs +1 -3
  288. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
  289. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +28 -0
  290. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +82 -56
  291. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
  292. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +6 -0
  293. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +11 -13
  294. package/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.cjs +1 -0
  295. package/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.d.ts +8 -0
  296. package/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.mjs +32 -0
  297. package/common/src/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
  298. package/common/src/data-structures/Hinkal/hinkalSolanaSwap.d.ts +4 -0
  299. package/common/src/data-structures/Hinkal/hinkalSolanaSwap.mjs +58 -79
  300. package/common/src/data-structures/Hinkal/hinkalSolanaTransact.cjs +1 -0
  301. package/common/src/data-structures/Hinkal/hinkalSolanaTransact.d.ts +3 -0
  302. package/common/src/data-structures/Hinkal/hinkalSolanaTransact.mjs +119 -0
  303. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
  304. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +3 -0
  305. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.mjs +46 -77
  306. package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
  307. package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +4 -0
  308. package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +46 -57
  309. package/common/src/data-structures/Hinkal/hinkalSwap.cjs +1 -1
  310. package/common/src/data-structures/Hinkal/hinkalSwap.d.ts +7 -0
  311. package/common/src/data-structures/Hinkal/hinkalSwap.mjs +32 -32
  312. package/common/src/data-structures/Hinkal/hinkalTransact.cjs +1 -0
  313. package/common/src/data-structures/Hinkal/hinkalTransact.d.ts +3 -0
  314. package/common/src/data-structures/Hinkal/hinkalTransact.mjs +106 -0
  315. package/common/src/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
  316. package/common/src/data-structures/Hinkal/hinkalTransfer.d.ts +4 -0
  317. package/common/src/data-structures/Hinkal/hinkalTransfer.mjs +39 -44
  318. package/common/src/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  319. package/common/src/data-structures/Hinkal/hinkalWithdraw.d.ts +7 -0
  320. package/common/src/data-structures/Hinkal/hinkalWithdraw.mjs +38 -49
  321. package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  322. package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.d.ts +3 -0
  323. package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +160 -102
  324. package/common/src/data-structures/Hinkal/index.d.ts +25 -0
  325. package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.d.ts +27 -0
  326. package/common/src/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  327. package/common/src/data-structures/Hinkal/resetMerkleTrees.d.ts +2 -0
  328. package/common/src/data-structures/Hinkal/resetMerkleTrees.mjs +7 -6
  329. package/common/src/data-structures/IndexedDB/activity-db.cjs +1 -1
  330. package/common/src/data-structures/IndexedDB/activity-db.d.ts +14 -0
  331. package/common/src/data-structures/IndexedDB/activity-db.mjs +34 -34
  332. package/common/src/data-structures/IndexedDB/balances-db.d.ts +13 -0
  333. package/common/src/data-structures/IndexedDB/contact-db.cjs +1 -1
  334. package/common/src/data-structures/IndexedDB/contact-db.d.ts +11 -0
  335. package/common/src/data-structures/IndexedDB/contact-db.mjs +14 -28
  336. package/common/src/data-structures/IndexedDB/index.cjs +1 -1
  337. package/common/src/data-structures/IndexedDB/index.d.ts +9 -0
  338. package/common/src/data-structures/IndexedDB/index.mjs +1 -0
  339. package/common/src/data-structures/IndexedDB/key-val-store.cjs +1 -1
  340. package/common/src/data-structures/IndexedDB/key-val-store.d.ts +8 -0
  341. package/common/src/data-structures/IndexedDB/key-val-store.mjs +14 -0
  342. package/common/src/data-structures/IndexedDB/pay-activity-db.cjs +1 -1
  343. package/common/src/data-structures/IndexedDB/pay-activity-db.d.ts +9 -0
  344. package/common/src/data-structures/IndexedDB/pay-activity-db.mjs +43 -1
  345. package/common/src/data-structures/IndexedDB/prices-db.d.ts +9 -0
  346. package/common/src/data-structures/IndexedDB/private-balances-db.cjs +1 -1
  347. package/common/src/data-structures/IndexedDB/private-balances-db.d.ts +10 -0
  348. package/common/src/data-structures/IndexedDB/private-balances-db.mjs +3 -0
  349. package/common/src/data-structures/IndexedDB/scheduled-transactions-db.cjs +1 -0
  350. package/common/src/data-structures/IndexedDB/scheduled-transactions-db.d.ts +11 -0
  351. package/common/src/data-structures/IndexedDB/scheduled-transactions-db.mjs +34 -0
  352. package/common/src/data-structures/IndexedDB/signatures-db.cjs +1 -1
  353. package/common/src/data-structures/IndexedDB/signatures-db.d.ts +10 -0
  354. package/common/src/data-structures/IndexedDB/signatures-db.mjs +11 -11
  355. package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
  356. package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.ts +21 -0
  357. package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +29 -26
  358. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.d.ts +18 -0
  359. package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.d.ts +11 -0
  360. package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.d.ts +18 -0
  361. package/common/src/data-structures/TokenDBs/IPublicTokensDB.d.ts +6 -0
  362. package/common/src/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
  363. package/common/src/data-structures/TokenDBs/PrivateTokensDB.d.ts +11 -0
  364. package/common/src/data-structures/TokenDBs/PrivateTokensDB.mjs +17 -18
  365. package/common/src/data-structures/TokenDBs/PublicTokensDB.d.ts +9 -0
  366. package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.d.ts +9 -0
  367. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.d.ts +10 -0
  368. package/common/src/data-structures/TokenDBs/index.d.ts +6 -0
  369. package/common/src/data-structures/TokenDBs/token-visibility-db.d.ts +17 -0
  370. package/common/src/data-structures/ValueCache/ValueCache.d.ts +10 -0
  371. package/common/src/data-structures/ValueCache/index.d.ts +1 -0
  372. package/common/src/data-structures/WalletManager/WalletManager.d.ts +52 -0
  373. package/common/src/data-structures/WalletManager/index.d.ts +1 -0
  374. package/common/src/data-structures/cacheDevices/AttachableMemoryCacheDevice.d.ts +8 -0
  375. package/common/src/data-structures/cacheDevices/BaseCacheDevice.cjs +1 -1
  376. package/common/src/data-structures/cacheDevices/BaseCacheDevice.d.ts +12 -0
  377. package/common/src/data-structures/cacheDevices/BaseCacheDevice.mjs +3 -0
  378. package/common/src/data-structures/cacheDevices/FileCacheDevice.cjs +1 -1
  379. package/common/src/data-structures/cacheDevices/FileCacheDevice.d.ts +13 -0
  380. package/common/src/data-structures/cacheDevices/FileCacheDevice.mjs +12 -3
  381. package/common/src/data-structures/cacheDevices/LocalStorageCacheDevice.d.ts +8 -0
  382. package/common/src/data-structures/cacheDevices/index.d.ts +2 -0
  383. package/common/src/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
  384. package/common/src/data-structures/crypto-keys/decodeUTXO.d.ts +28 -0
  385. package/common/src/data-structures/crypto-keys/decodeUTXO.mjs +11 -71
  386. package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
  387. package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.d.ts +17 -0
  388. package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.mjs +39 -23
  389. package/common/src/data-structures/crypto-keys/index.d.ts +4 -0
  390. package/common/src/data-structures/crypto-keys/keyUtils.d.ts +2 -0
  391. package/common/src/data-structures/crypto-keys/keys.cjs +1 -1
  392. package/common/src/data-structures/crypto-keys/keys.d.ts +117 -0
  393. package/common/src/data-structures/crypto-keys/keys.mjs +64 -79
  394. package/common/src/data-structures/custom-token-registry/CustomTokenRegistry.d.ts +12 -0
  395. package/common/src/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.d.ts +34 -0
  396. package/common/src/data-structures/event-service/evm/AbstractEventService.d.ts +14 -0
  397. package/common/src/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +22 -0
  398. package/common/src/data-structures/event-service/evm/AbstractSnapshotService.d.ts +22 -0
  399. package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
  400. package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +38 -0
  401. package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.mjs +46 -38
  402. package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +1 -1
  403. package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +11 -0
  404. package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +2 -2
  405. package/common/src/data-structures/event-service/evm/PollingBlockchainEventEmitter.d.ts +6 -0
  406. package/common/src/data-structures/event-service/helpers/ClientEventHelper.d.ts +10 -0
  407. package/common/src/data-structures/event-service/helpers/PollingEventHelper.d.ts +7 -0
  408. package/common/src/data-structures/event-service/index.d.ts +14 -0
  409. package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
  410. package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +34 -0
  411. package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +27 -23
  412. package/common/src/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +17 -0
  413. package/common/src/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +22 -0
  414. package/common/src/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +21 -0
  415. package/common/src/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.d.ts +11 -0
  416. package/common/src/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.d.ts +6 -0
  417. package/common/src/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +42 -0
  418. package/common/src/data-structures/http/BasicHttpClient.d.ts +11 -0
  419. package/common/src/data-structures/http/HttpClient.d.ts +10 -0
  420. package/common/src/data-structures/http/index.d.ts +2 -0
  421. package/common/src/data-structures/index.d.ts +22 -0
  422. package/common/src/data-structures/merkle-tree/MerkleTree.cjs +1 -1
  423. package/common/src/data-structures/merkle-tree/MerkleTree.d.ts +93 -0
  424. package/common/src/data-structures/merkle-tree/MerkleTree.mjs +12 -1
  425. package/common/src/data-structures/merkle-tree/MerkleTreeIncompleteError.d.ts +3 -0
  426. package/common/src/data-structures/merkle-tree/index.d.ts +2 -0
  427. package/common/src/data-structures/presale/PresaleContractWrapper.d.ts +23 -0
  428. package/common/src/data-structures/presale/index.d.ts +1 -0
  429. package/common/src/data-structures/private-balances/BalanceChangedHandler.d.ts +9 -0
  430. package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.cjs +1 -1
  431. package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.d.ts +25 -0
  432. package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.mjs +100 -86
  433. package/common/src/data-structures/private-balances/index.d.ts +3 -0
  434. package/common/src/data-structures/private-balances/privateBalancesReducer.d.ts +2 -0
  435. package/common/src/data-structures/provider-adapter/IProviderAdapter.d.ts +36 -0
  436. package/common/src/data-structures/snapshot/SnapshotFetcherService.d.ts +14 -0
  437. package/common/src/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.d.ts +8 -0
  438. package/common/src/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.d.ts +8 -0
  439. package/common/src/data-structures/snapshot/index.d.ts +5 -0
  440. package/common/src/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.d.ts +8 -0
  441. package/common/src/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.d.ts +8 -0
  442. package/common/src/data-structures/token-price-fetcher/TokenChecker.cjs +1 -1
  443. package/common/src/data-structures/token-price-fetcher/TokenChecker.d.ts +10 -0
  444. package/common/src/data-structures/token-price-fetcher/TokenChecker.mjs +5 -3
  445. package/common/src/data-structures/token-price-fetcher/index.d.ts +1 -0
  446. package/common/src/data-structures/transactions-manager/history/history.types.d.ts +16 -0
  447. package/common/src/data-structures/transactions-manager/index.d.ts +1 -0
  448. package/common/src/data-structures/utxo/Utxo.cjs +1 -1
  449. package/common/src/data-structures/utxo/Utxo.d.ts +66 -0
  450. package/common/src/data-structures/utxo/Utxo.mjs +7 -17
  451. package/common/src/error-handling/customErrors/ErrorWithAmount.d.ts +4 -0
  452. package/common/src/error-handling/customErrors/ErrorWithIndex.d.ts +4 -0
  453. package/common/src/error-handling/customErrors/ErrorWithTx.d.ts +4 -0
  454. package/common/src/error-handling/customErrors/FeeOverTransactionValueError.d.ts +9 -0
  455. package/common/src/error-handling/customErrors/HttpError.d.ts +4 -0
  456. package/common/src/error-handling/customErrors/SimulationFailureError.d.ts +10 -0
  457. package/common/src/error-handling/customErrors/customErrors.helpers.d.ts +5 -0
  458. package/common/src/error-handling/customErrors/index.d.ts +7 -0
  459. package/common/src/error-handling/error-codes.constants.cjs +2 -2
  460. package/common/src/error-handling/error-codes.constants.d.ts +249 -0
  461. package/common/src/error-handling/error-codes.constants.mjs +30 -32
  462. package/common/src/error-handling/get-error.message.cjs +1 -1
  463. package/common/src/error-handling/get-error.message.d.ts +5 -0
  464. package/common/src/error-handling/get-error.message.mjs +28 -18
  465. package/common/src/error-handling/index.cjs +1 -1
  466. package/common/src/error-handling/index.d.ts +7 -0
  467. package/common/src/error-handling/index.mjs +1 -0
  468. package/common/src/error-handling/isInsufficientFundsError.d.ts +1 -0
  469. package/common/src/error-handling/logError.d.ts +1 -0
  470. package/common/src/error-handling/logger.d.ts +5 -0
  471. package/common/src/error-handling/retrySolanaError.d.ts +1 -0
  472. package/common/src/error-handling/types.d.ts +10 -0
  473. package/common/src/externalABIs/BUSD.d.ts +38 -0
  474. package/common/src/externalABIs/DAI.d.ts +45 -0
  475. package/common/src/externalABIs/SanctionsList.d.ts +35 -0
  476. package/common/src/externalABIs/USDC.d.ts +28 -0
  477. package/common/src/externalABIs/USDR.d.ts +28 -0
  478. package/common/src/externalABIs/USDR3CRV.d.ts +49 -0
  479. package/common/src/externalABIs/USDT.d.ts +41 -0
  480. package/common/src/externalABIs/WETH.d.ts +38 -0
  481. package/common/src/externalABIs/amToken.d.ts +28 -0
  482. package/common/src/externalABIs/index.cjs +1 -1
  483. package/common/src/externalABIs/index.d.ts +107 -0
  484. package/common/src/externalABIs/index.mjs +2 -6
  485. package/common/src/externalABIs/swapAbi.d.ts +77 -0
  486. package/common/src/functions/auto-deposit-back-helpers/get-gas-token-records.cjs +1 -1
  487. package/common/src/functions/auto-deposit-back-helpers/get-gas-token-records.d.ts +9 -0
  488. package/common/src/functions/auto-deposit-back-helpers/get-gas-token-records.mjs +7 -6
  489. package/common/src/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.d.ts +3 -0
  490. package/common/src/functions/auto-deposit-back-helpers/index.d.ts +4 -0
  491. package/common/src/functions/auto-deposit-back-helpers/select-gas-token.cjs +1 -1
  492. package/common/src/functions/auto-deposit-back-helpers/select-gas-token.d.ts +13 -0
  493. package/common/src/functions/auto-deposit-back-helpers/select-gas-token.mjs +8 -8
  494. package/common/src/functions/auto-deposit-back-helpers/update-hinkal.d.ts +2 -0
  495. package/common/src/functions/connectors.types.d.ts +22 -0
  496. package/common/src/functions/index.cjs +1 -1
  497. package/common/src/functions/index.d.ts +11 -0
  498. package/common/src/functions/index.mjs +21 -20
  499. package/common/src/functions/pre-transaction/addressTableLookup.d.ts +4 -0
  500. package/common/src/functions/pre-transaction/buildCommitmentValidationData.cjs +1 -1
  501. package/common/src/functions/pre-transaction/buildCommitmentValidationData.d.ts +14 -0
  502. package/common/src/functions/pre-transaction/buildCommitmentValidationData.mjs +36 -38
  503. package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.cjs +1 -1
  504. package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.d.ts +2 -0
  505. package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.mjs +38 -5
  506. package/common/src/functions/pre-transaction/constructAdminData.d.ts +3 -0
  507. package/common/src/functions/pre-transaction/convert-okx-instructions.d.ts +11 -0
  508. package/common/src/functions/pre-transaction/ensureAmountChanges.cjs +1 -1
  509. package/common/src/functions/pre-transaction/ensureAmountChanges.d.ts +2 -0
  510. package/common/src/functions/pre-transaction/ensureAmountChanges.mjs +3 -10
  511. package/common/src/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
  512. package/common/src/functions/pre-transaction/getExternalSwapAddress.d.ts +2 -0
  513. package/common/src/functions/pre-transaction/getExternalSwapAddress.mjs +2 -18
  514. package/common/src/functions/pre-transaction/getFeeStructure.d.ts +5 -0
  515. package/common/src/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
  516. package/common/src/functions/pre-transaction/getSolanaCalldataHash.d.ts +4 -0
  517. package/common/src/functions/pre-transaction/getSolanaCalldataHash.mjs +11 -10
  518. package/common/src/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
  519. package/common/src/functions/pre-transaction/getVolatileTransferAmount.d.ts +9 -0
  520. package/common/src/functions/pre-transaction/getVolatileTransferAmount.mjs +1 -1
  521. package/common/src/functions/pre-transaction/index.cjs +1 -1
  522. package/common/src/functions/pre-transaction/index.d.ts +19 -0
  523. package/common/src/functions/pre-transaction/index.mjs +2 -3
  524. package/common/src/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
  525. package/common/src/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +3 -0
  526. package/common/src/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +2 -2
  527. package/common/src/functions/pre-transaction/merge-with-fee-structure.d.ts +2 -0
  528. package/common/src/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
  529. package/common/src/functions/pre-transaction/outputUtxoProcessing.d.ts +6 -0
  530. package/common/src/functions/pre-transaction/outputUtxoProcessing.mjs +19 -18
  531. package/common/src/functions/pre-transaction/process-gas-estimates.d.ts +5 -0
  532. package/common/src/functions/pre-transaction/sendInitNullifiersTransaction.d.ts +11 -0
  533. package/common/src/functions/pre-transaction/sendV0Transaction.cjs +2 -2
  534. package/common/src/functions/pre-transaction/sendV0Transaction.d.ts +21 -0
  535. package/common/src/functions/pre-transaction/sendV0Transaction.mjs +4 -4
  536. package/common/src/functions/pre-transaction/solana-public-signals.d.ts +22 -0
  537. package/common/src/functions/pre-transaction/solana.cjs +1 -1
  538. package/common/src/functions/pre-transaction/solana.d.ts +27 -0
  539. package/common/src/functions/pre-transaction/solana.mjs +46 -21
  540. package/common/src/functions/pre-transaction/solanaTransfer.utils.cjs +1 -1
  541. package/common/src/functions/pre-transaction/solanaTransfer.utils.d.ts +6 -0
  542. package/common/src/functions/pre-transaction/solanaTransfer.utils.mjs +16 -15
  543. package/common/src/functions/pre-transaction/speculativeUtxo.cjs +1 -0
  544. package/common/src/functions/pre-transaction/speculativeUtxo.d.ts +9 -0
  545. package/common/src/functions/pre-transaction/speculativeUtxo.mjs +19 -0
  546. package/common/src/functions/pre-transaction/store-instructions.d.ts +4 -0
  547. package/common/src/functions/pre-transaction/store-proof.cjs +1 -1
  548. package/common/src/functions/pre-transaction/store-proof.d.ts +7 -0
  549. package/common/src/functions/pre-transaction/store-proof.mjs +1 -0
  550. package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.d.ts +3 -0
  551. package/common/src/functions/private-wallet/emporium.helpers.cjs +1 -1
  552. package/common/src/functions/private-wallet/emporium.helpers.d.ts +53 -0
  553. package/common/src/functions/private-wallet/emporium.helpers.mjs +116 -72
  554. package/common/src/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
  555. package/common/src/functions/private-wallet/emporium.swap.helpers.d.ts +3 -0
  556. package/common/src/functions/private-wallet/emporium.swap.helpers.mjs +38 -80
  557. package/common/src/functions/private-wallet/index.cjs +1 -1
  558. package/common/src/functions/private-wallet/index.d.ts +2 -0
  559. package/common/src/functions/private-wallet/index.mjs +0 -1
  560. package/common/src/functions/snarkjs/common.snarkjs.cjs +1 -1
  561. package/common/src/functions/snarkjs/common.snarkjs.d.ts +32 -0
  562. package/common/src/functions/snarkjs/common.snarkjs.mjs +104 -65
  563. package/common/src/functions/snarkjs/constant.cjs +1 -1
  564. package/common/src/functions/snarkjs/constant.d.ts +236 -0
  565. package/common/src/functions/snarkjs/constant.mjs +231 -145
  566. package/common/src/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
  567. package/common/src/functions/snarkjs/constructGeneralZkProof.d.ts +13 -0
  568. package/common/src/functions/snarkjs/constructGeneralZkProof.mjs +85 -69
  569. package/common/src/functions/snarkjs/constructSignatureFromMnemonicProofInput.cjs +1 -0
  570. package/common/src/functions/snarkjs/constructSignatureFromMnemonicProofInput.d.ts +7 -0
  571. package/common/src/functions/snarkjs/constructSignatureFromMnemonicProofInput.mjs +2 -0
  572. package/common/src/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
  573. package/common/src/functions/snarkjs/constructSolanaZkProof.d.ts +16 -0
  574. package/common/src/functions/snarkjs/constructSolanaZkProof.mjs +62 -61
  575. package/common/src/functions/snarkjs/constructTxEnclave.cjs +1 -0
  576. package/common/src/functions/snarkjs/constructTxEnclave.d.ts +34 -0
  577. package/common/src/functions/snarkjs/constructTxEnclave.mjs +95 -0
  578. package/common/src/functions/snarkjs/constructTxEnclaveVerify.cjs +1 -0
  579. package/common/src/functions/snarkjs/constructTxEnclaveVerify.d.ts +5 -0
  580. package/common/src/functions/snarkjs/constructTxEnclaveVerify.mjs +295 -0
  581. package/common/src/functions/snarkjs/fetchMerkleTreeSiblings.d.ts +9 -0
  582. package/common/src/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -1
  583. package/common/src/functions/snarkjs/fetchOnChainRootHashes.d.ts +4 -0
  584. package/common/src/functions/snarkjs/fetchOnChainRootHashes.mjs +16 -18
  585. package/common/src/functions/snarkjs/fetchTronInsertionSiblings.cjs +1 -0
  586. package/common/src/functions/snarkjs/fetchTronInsertionSiblings.d.ts +7 -0
  587. package/common/src/functions/snarkjs/fetchTronInsertionSiblings.mjs +13 -0
  588. package/common/src/functions/snarkjs/generateCircomData.cjs +1 -1
  589. package/common/src/functions/snarkjs/generateCircomData.d.ts +5 -0
  590. package/common/src/functions/snarkjs/generateCircomData.mjs +41 -31
  591. package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.cjs +1 -1
  592. package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.d.ts +11 -0
  593. package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.mjs +7 -7
  594. package/common/src/functions/snarkjs/generateSignatureFromMnemonicProof.cjs +1 -0
  595. package/common/src/functions/snarkjs/generateSignatureFromMnemonicProof.d.ts +2 -0
  596. package/common/src/functions/snarkjs/generateSignatureFromMnemonicProof.mjs +3 -0
  597. package/common/src/functions/snarkjs/generateZkProof.cjs +1 -1
  598. package/common/src/functions/snarkjs/generateZkProof.d.ts +5 -0
  599. package/common/src/functions/snarkjs/generateZkProof.mjs +9 -16
  600. package/common/src/functions/snarkjs/generateZkProofSelf.d.ts +5 -0
  601. package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -1
  602. package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +17 -0
  603. package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +19 -13
  604. package/common/src/functions/snarkjs/getOriginalSender.d.ts +1 -0
  605. package/common/src/functions/snarkjs/getZKFiles.cjs +1 -1
  606. package/common/src/functions/snarkjs/getZKFiles.d.ts +3 -0
  607. package/common/src/functions/snarkjs/getZKFiles.mjs +9 -3
  608. package/common/src/functions/snarkjs/index.cjs +1 -1
  609. package/common/src/functions/snarkjs/index.d.ts +10 -0
  610. package/common/src/functions/snarkjs/index.mjs +2 -0
  611. package/common/src/functions/snarkjs/signedMessageHash.cjs +1 -1
  612. package/common/src/functions/snarkjs/signedMessageHash.d.ts +47 -0
  613. package/common/src/functions/snarkjs/signedMessageHash.mjs +36 -7
  614. package/common/src/functions/snarkjs/verifyCommitmentValidationData.d.ts +4 -0
  615. package/common/src/functions/snarkjs/verifySignedEnclaveResponse.cjs +1 -0
  616. package/common/src/functions/snarkjs/verifySignedEnclaveResponse.d.ts +1 -0
  617. package/common/src/functions/snarkjs/verifySignedEnclaveResponse.mjs +11 -0
  618. package/common/src/functions/utils/abi.utils.d.ts +3 -0
  619. package/common/src/functions/utils/addresses.cjs +1 -1
  620. package/common/src/functions/utils/addresses.d.ts +12 -0
  621. package/common/src/functions/utils/addresses.mjs +30 -21
  622. package/common/src/functions/utils/aggregateTokenAmounts.d.ts +2 -0
  623. package/common/src/functions/utils/amounts.utils.d.ts +25 -0
  624. package/common/src/functions/utils/arraysMatch.d.ts +1 -0
  625. package/common/src/functions/utils/auth.utils.d.ts +5 -0
  626. package/common/src/functions/utils/bridge-arrival.utils.cjs +1 -0
  627. package/common/src/functions/utils/bridge-arrival.utils.d.ts +1 -0
  628. package/common/src/functions/utils/bridge-arrival.utils.mjs +16 -0
  629. package/common/src/functions/utils/bridge-claimable-utxo.utils.cjs +1 -0
  630. package/common/src/functions/utils/bridge-claimable-utxo.utils.d.ts +19 -0
  631. package/common/src/functions/utils/bridge-claimable-utxo.utils.mjs +24 -0
  632. package/common/src/functions/utils/bridge-claimable.utils.cjs +1 -0
  633. package/common/src/functions/utils/bridge-claimable.utils.d.ts +15 -0
  634. package/common/src/functions/utils/bridge-claimable.utils.mjs +3 -0
  635. package/common/src/functions/utils/bridge-flow.utils.cjs +1 -0
  636. package/common/src/functions/utils/bridge-flow.utils.d.ts +4 -0
  637. package/common/src/functions/utils/bridge-flow.utils.mjs +2 -0
  638. package/common/src/functions/utils/buildClaimableDepositPlan.d.ts +17 -0
  639. package/common/src/functions/utils/bytes32.utils.d.ts +2 -0
  640. package/common/src/functions/utils/cacheDevice.utils.d.ts +3 -0
  641. package/common/src/functions/utils/cacheFunctions.d.ts +16 -0
  642. package/common/src/functions/utils/caseInsensitive.utils.d.ts +3 -0
  643. package/common/src/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
  644. package/common/src/functions/utils/convertEmporiumOpToCallInfo.d.ts +2 -0
  645. package/common/src/functions/utils/convertEmporiumOpToCallInfo.mjs +5 -10
  646. package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
  647. package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.d.ts +3 -0
  648. package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.mjs +1 -1
  649. package/common/src/functions/utils/create-provider.cjs +1 -1
  650. package/common/src/functions/utils/create-provider.d.ts +11 -0
  651. package/common/src/functions/utils/create-provider.mjs +45 -9
  652. package/common/src/functions/utils/customEnclaveFunctionsRegister.d.ts +18 -0
  653. package/common/src/functions/utils/deposit-claimable.utils.cjs +1 -1
  654. package/common/src/functions/utils/deposit-claimable.utils.d.ts +3 -0
  655. package/common/src/functions/utils/deposit-claimable.utils.mjs +3 -6
  656. package/common/src/functions/utils/dispatchBalanceRefreshes.d.ts +4 -0
  657. package/common/src/functions/utils/enclave-recipient-info-storage.cjs +1 -1
  658. package/common/src/functions/utils/enclave-recipient-info-storage.d.ts +5 -0
  659. package/common/src/functions/utils/enclave-recipient-info-storage.mjs +1 -0
  660. package/common/src/functions/utils/enclave-signature-storage.cjs +1 -1
  661. package/common/src/functions/utils/enclave-signature-storage.d.ts +1 -0
  662. package/common/src/functions/utils/enclave-signature-storage.mjs +3 -3
  663. package/common/src/functions/utils/enclave-utxo-storage.cjs +1 -1
  664. package/common/src/functions/utils/enclave-utxo-storage.d.ts +6 -0
  665. package/common/src/functions/utils/enclave-utxo-storage.mjs +16 -2
  666. package/common/src/functions/utils/enclaveHandshakeService.d.ts +10 -0
  667. package/common/src/functions/utils/enclaveSessionSigning.cjs +1 -0
  668. package/common/src/functions/utils/enclaveSessionSigning.d.ts +16 -0
  669. package/common/src/functions/utils/enclaveSessionSigning.mjs +2 -0
  670. package/common/src/functions/utils/encodeTokenWithId.cjs +1 -1
  671. package/common/src/functions/utils/encodeTokenWithId.d.ts +1 -0
  672. package/common/src/functions/utils/encodeTokenWithId.mjs +2 -5
  673. package/common/src/functions/utils/encryptInputForEnclave.cjs +1 -1
  674. package/common/src/functions/utils/encryptInputForEnclave.d.ts +16 -0
  675. package/common/src/functions/utils/encryptInputForEnclave.mjs +43 -23
  676. package/common/src/functions/utils/enum.utils.d.ts +9 -0
  677. package/common/src/functions/utils/erc20tokenFunctions.cjs +1 -1
  678. package/common/src/functions/utils/erc20tokenFunctions.d.ts +20 -0
  679. package/common/src/functions/utils/erc20tokenFunctions.mjs +2 -15
  680. package/common/src/functions/utils/evmNetworkFunctions.d.ts +4 -0
  681. package/common/src/functions/utils/external-action.utils.d.ts +3 -0
  682. package/common/src/functions/utils/fees.utils.cjs +1 -1
  683. package/common/src/functions/utils/fees.utils.d.ts +9 -0
  684. package/common/src/functions/utils/fees.utils.mjs +42 -29
  685. package/common/src/functions/utils/formatter.d.ts +3 -0
  686. package/common/src/functions/utils/getBlockExplorerUrl.d.ts +1 -0
  687. package/common/src/functions/utils/getContractAddress.d.ts +2 -0
  688. package/common/src/functions/utils/getDataFromTransaction.d.ts +34 -0
  689. package/common/src/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
  690. package/common/src/functions/utils/getRecipientInfoFromUserKeys.d.ts +4 -0
  691. package/common/src/functions/utils/getRecipientInfoFromUserKeys.mjs +2 -3
  692. package/common/src/functions/utils/getSignerFromContract.d.ts +3 -0
  693. package/common/src/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
  694. package/common/src/functions/utils/getUtxosFromReceipt.utils.d.ts +6 -0
  695. package/common/src/functions/utils/getUtxosFromReceipt.utils.mjs +2 -26
  696. package/common/src/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
  697. package/common/src/functions/utils/getUtxosFromReceiptSolana.d.ts +7 -0
  698. package/common/src/functions/utils/getUtxosFromReceiptSolana.mjs +7 -24
  699. package/common/src/functions/utils/getWalletGroupKey.utils.d.ts +1 -0
  700. package/common/src/functions/utils/inLogicMetadata.d.ts +2 -0
  701. package/common/src/functions/utils/index.cjs +1 -1
  702. package/common/src/functions/utils/index.d.ts +89 -0
  703. package/common/src/functions/utils/index.mjs +27 -13
  704. package/common/src/functions/utils/involves-permit2-op.d.ts +7 -0
  705. package/common/src/functions/utils/ipfs.d.ts +7 -0
  706. package/common/src/functions/utils/is-valid-url.d.ts +1 -0
  707. package/common/src/functions/utils/legacyKeys.cjs +1 -0
  708. package/common/src/functions/utils/legacyKeys.d.ts +10 -0
  709. package/common/src/functions/utils/legacyKeys.mjs +8 -0
  710. package/common/src/functions/utils/lifi.utils.d.ts +7 -0
  711. package/common/src/functions/utils/map.utils.d.ts +1 -0
  712. package/common/src/functions/utils/memoize.utils.d.ts +1 -0
  713. package/common/src/functions/utils/merkleTree.utils.d.ts +2 -0
  714. package/common/src/functions/utils/mnemonics.cjs +1 -1
  715. package/common/src/functions/utils/mnemonics.d.ts +1 -0
  716. package/common/src/functions/utils/mnemonics.mjs +4 -6
  717. package/common/src/functions/utils/mutexes.utils.d.ts +2 -0
  718. package/common/src/functions/utils/nearIntents.utils.cjs +1 -1
  719. package/common/src/functions/utils/nearIntents.utils.d.ts +11 -0
  720. package/common/src/functions/utils/nearIntents.utils.mjs +27 -13
  721. package/common/src/functions/utils/networks.utils.d.ts +2 -0
  722. package/common/src/functions/utils/nftTokenFunctions.d.ts +2 -0
  723. package/common/src/functions/utils/nickname.utils.d.ts +1 -0
  724. package/common/src/functions/utils/pay-routing.utils.d.ts +4 -0
  725. package/common/src/functions/utils/postToOffscreen.d.ts +2 -0
  726. package/common/src/functions/utils/prepareHinkal.cjs +1 -1
  727. package/common/src/functions/utils/prepareHinkal.d.ts +9 -0
  728. package/common/src/functions/utils/prepareHinkal.mjs +2 -1
  729. package/common/src/functions/utils/process.utils.cjs +1 -1
  730. package/common/src/functions/utils/process.utils.d.ts +13 -0
  731. package/common/src/functions/utils/process.utils.mjs +2 -11
  732. package/common/src/functions/utils/proxyAvatar.utils.cjs +1 -0
  733. package/common/src/functions/utils/proxyAvatar.utils.d.ts +2 -0
  734. package/common/src/functions/utils/proxyAvatar.utils.mjs +3 -0
  735. package/common/src/functions/utils/publicBalance.utils.cjs +1 -1
  736. package/common/src/functions/utils/publicBalance.utils.d.ts +6 -0
  737. package/common/src/functions/utils/publicBalance.utils.mjs +37 -23
  738. package/common/src/functions/utils/recovery-balance.utils.cjs +1 -0
  739. package/common/src/functions/utils/recovery-balance.utils.d.ts +2 -0
  740. package/common/src/functions/utils/recovery-balance.utils.mjs +1 -0
  741. package/common/src/functions/utils/reloadPage.d.ts +1 -0
  742. package/common/src/functions/utils/requireEnv.d.ts +1 -0
  743. package/common/src/functions/utils/resolve-domain-address.cjs +1 -0
  744. package/common/src/functions/utils/resolve-domain-address.d.ts +4 -0
  745. package/common/src/functions/utils/resolve-domain-address.mjs +3 -0
  746. package/common/src/functions/utils/resolve-sync.utils.d.ts +6 -0
  747. package/common/src/functions/utils/rpc-int-encode.d.ts +1 -0
  748. package/common/src/functions/utils/serialize-utxos.utils.cjs +1 -1
  749. package/common/src/functions/utils/serialize-utxos.utils.d.ts +3 -0
  750. package/common/src/functions/utils/serialize-utxos.utils.mjs +6 -4
  751. package/common/src/functions/utils/serialize.utils.d.ts +10 -0
  752. package/common/src/functions/utils/solana-memo.d.ts +3 -0
  753. package/common/src/functions/utils/solana-program.utils.cjs +1 -0
  754. package/common/src/functions/utils/solana-program.utils.d.ts +3 -0
  755. package/common/src/functions/utils/solana-program.utils.mjs +17 -0
  756. package/common/src/functions/utils/solana-sponsored.utils.cjs +1 -0
  757. package/common/src/functions/utils/solana-sponsored.utils.d.ts +22 -0
  758. package/common/src/functions/utils/solana-sponsored.utils.mjs +30 -0
  759. package/common/src/functions/utils/solanaMint.utils.cjs +1 -1
  760. package/common/src/functions/utils/solanaMint.utils.d.ts +17 -0
  761. package/common/src/functions/utils/solanaMint.utils.mjs +18 -8
  762. package/common/src/functions/utils/solanaSendPreflight.utils.d.ts +6 -0
  763. package/common/src/functions/utils/sponsored-shield.utils.cjs +1 -0
  764. package/common/src/functions/utils/sponsored-shield.utils.d.ts +3 -0
  765. package/common/src/functions/utils/sponsored-shield.utils.mjs +3 -0
  766. package/common/src/functions/utils/string.utils.d.ts +16 -0
  767. package/common/src/functions/utils/temp-wallet.utils.cjs +1 -0
  768. package/common/src/functions/utils/temp-wallet.utils.d.ts +8 -0
  769. package/common/src/functions/utils/temp-wallet.utils.mjs +43 -0
  770. package/common/src/functions/utils/temporary-wallet-recovery.utils.cjs +1 -0
  771. package/common/src/functions/utils/temporary-wallet-recovery.utils.d.ts +7 -0
  772. package/common/src/functions/utils/temporary-wallet-recovery.utils.mjs +10 -0
  773. package/common/src/functions/utils/time.utils.d.ts +20 -0
  774. package/common/src/functions/utils/token-check.utils.d.ts +4 -0
  775. package/common/src/functions/utils/transfer-claimable.utils.cjs +1 -1
  776. package/common/src/functions/utils/transfer-claimable.utils.d.ts +8 -0
  777. package/common/src/functions/utils/transfer-claimable.utils.mjs +1 -4
  778. package/common/src/functions/utils/trimFieldValues.d.ts +4 -0
  779. package/common/src/functions/utils/tron.utils.cjs +1 -1
  780. package/common/src/functions/utils/tron.utils.d.ts +35 -0
  781. package/common/src/functions/utils/tron.utils.mjs +89 -152
  782. package/common/src/functions/utils/tronSimulation.utils.cjs +1 -1
  783. package/common/src/functions/utils/tronSimulation.utils.d.ts +1 -0
  784. package/common/src/functions/utils/tronSimulation.utils.mjs +4 -6
  785. package/common/src/functions/utils/tx-confirmation.utils.cjs +1 -1
  786. package/common/src/functions/utils/tx-confirmation.utils.d.ts +11 -0
  787. package/common/src/functions/utils/tx-confirmation.utils.mjs +16 -13
  788. package/common/src/functions/utils/upToDateState.d.ts +2 -0
  789. package/common/src/functions/utils/userAgent.d.ts +2 -0
  790. package/common/src/functions/utils/validateUsername.d.ts +5 -0
  791. package/common/src/functions/utils/validateWalletAddress.cjs +1 -0
  792. package/common/src/functions/utils/validateWalletAddress.d.ts +1 -0
  793. package/common/src/functions/utils/validateWalletAddress.mjs +2 -0
  794. package/common/src/functions/utils/voidWallets.utils.cjs +1 -0
  795. package/common/src/functions/utils/voidWallets.utils.d.ts +4 -0
  796. package/common/src/functions/utils/voidWallets.utils.mjs +1 -0
  797. package/common/src/functions/utils/waasStamp.cjs +1 -0
  798. package/common/src/functions/utils/waasStamp.d.ts +5 -0
  799. package/common/src/functions/utils/waasStamp.mjs +2 -0
  800. package/common/src/functions/utils/walletBalances.utils.d.ts +2 -0
  801. package/common/src/functions/web3/EIP-712.d.ts +23 -0
  802. package/common/src/functions/web3/connectors.utils.d.ts +9 -0
  803. package/common/src/functions/web3/crypto.d.ts +1 -0
  804. package/common/src/functions/web3/etherFunctions.d.ts +21 -0
  805. package/common/src/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  806. package/common/src/functions/web3/events/getInputUtxoAndBalance.d.ts +31 -0
  807. package/common/src/functions/web3/events/getInputUtxoAndBalance.mjs +50 -61
  808. package/common/src/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
  809. package/common/src/functions/web3/events/getInputUtxosEnclave.d.ts +10 -0
  810. package/common/src/functions/web3/events/getInputUtxosEnclave.mjs +42 -35
  811. package/common/src/functions/web3/events/getShieldedBalance.cjs +1 -1
  812. package/common/src/functions/web3/events/getShieldedBalance.d.ts +18 -0
  813. package/common/src/functions/web3/events/getShieldedBalance.mjs +109 -93
  814. package/common/src/functions/web3/events/getTransactionLogEvents.d.ts +13 -0
  815. package/common/src/functions/web3/events/index.d.ts +3 -0
  816. package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
  817. package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.d.ts +3 -0
  818. package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +9 -6
  819. package/common/src/functions/web3/functionCalls/approveToken.cjs +1 -1
  820. package/common/src/functions/web3/functionCalls/approveToken.d.ts +4 -0
  821. package/common/src/functions/web3/functionCalls/approveToken.mjs +21 -107
  822. package/common/src/functions/web3/functionCalls/approveTokensToHinkal.d.ts +4 -0
  823. package/common/src/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
  824. package/common/src/functions/web3/functionCalls/constructBatchCall.d.ts +7 -0
  825. package/common/src/functions/web3/functionCalls/constructBatchCall.mjs +23 -18
  826. package/common/src/functions/web3/functionCalls/estimateGasRelayer.d.ts +4 -0
  827. package/common/src/functions/web3/functionCalls/getRootHash.d.ts +2 -0
  828. package/common/src/functions/web3/functionCalls/recoverTransactionFromError.d.ts +2 -0
  829. package/common/src/functions/web3/functionCalls/relayFunctions.d.ts +3 -0
  830. package/common/src/functions/web3/functionCalls/submitProof.cjs +1 -0
  831. package/common/src/functions/web3/functionCalls/submitProof.d.ts +5 -0
  832. package/common/src/functions/web3/functionCalls/submitProof.mjs +26 -0
  833. package/common/src/functions/web3/functionCalls/transactCallDirect.d.ts +6 -0
  834. package/common/src/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -1
  835. package/common/src/functions/web3/functionCalls/transactCallDirectTron.d.ts +16 -0
  836. package/common/src/functions/web3/functionCalls/transactCallDirectTron.mjs +81 -53
  837. package/common/src/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  838. package/common/src/functions/web3/functionCalls/transactCallRelayer.d.ts +32 -0
  839. package/common/src/functions/web3/functionCalls/transactCallRelayer.mjs +12 -8
  840. package/common/src/functions/web3/functionCalls/waitForErc20Approvals.d.ts +11 -0
  841. package/common/src/functions/web3/getContractMetadata.d.ts +5 -0
  842. package/common/src/functions/web3/getPublicAddressBalance.cjs +1 -1
  843. package/common/src/functions/web3/getPublicAddressBalance.d.ts +1 -0
  844. package/common/src/functions/web3/getPublicAddressBalance.mjs +6 -5
  845. package/common/src/functions/web3/getTokenHolder.cjs +1 -1
  846. package/common/src/functions/web3/getTokenHolder.d.ts +1 -0
  847. package/common/src/functions/web3/getTokenHolder.mjs +3 -2
  848. package/common/src/functions/web3/index.cjs +1 -1
  849. package/common/src/functions/web3/index.d.ts +11 -0
  850. package/common/src/functions/web3/index.mjs +1 -4
  851. package/common/src/functions/web3/lifiAPI.cjs +1 -1
  852. package/common/src/functions/web3/lifiAPI.d.ts +6 -0
  853. package/common/src/functions/web3/lifiAPI.mjs +38 -7
  854. package/common/src/functions/web3/okxAPI.d.ts +8 -0
  855. package/common/src/functions/web3/runContractFunction.d.ts +16 -0
  856. package/common/src/functions/web3/signAndSendSerializedTransaction.d.ts +2 -0
  857. package/common/src/index.d.ts +9 -0
  858. package/common/src/mutexes/chainBalanceRwLock.d.ts +18 -0
  859. package/common/src/mutexes/index.d.ts +2 -0
  860. package/common/src/mutexes/mutex.d.ts +2 -0
  861. package/common/src/providers/EthersProviderAdapter.cjs +1 -1
  862. package/common/src/providers/EthersProviderAdapter.d.ts +35 -0
  863. package/common/src/providers/EthersProviderAdapter.mjs +0 -3
  864. package/common/src/providers/SolanaProviderAdapter.cjs +1 -1
  865. package/common/src/providers/SolanaProviderAdapter.d.ts +48 -0
  866. package/common/src/providers/SolanaProviderAdapter.mjs +4 -11
  867. package/common/src/providers/TronProviderAdapter.cjs +1 -1
  868. package/common/src/providers/TronProviderAdapter.d.ts +38 -0
  869. package/common/src/providers/TronProviderAdapter.mjs +7 -4
  870. package/common/src/providers/WagmiProviderAdapter.cjs +1 -1
  871. package/common/src/providers/WagmiProviderAdapter.d.ts +47 -0
  872. package/common/src/providers/WagmiProviderAdapter.mjs +32 -39
  873. package/common/src/providers/exportProviers.d.ts +3 -0
  874. package/common/src/types/API.types.d.ts +21 -0
  875. package/common/src/types/ICacheDevice.d.ts +5 -0
  876. package/common/src/types/IMultiThreadedUtxoUtils.d.ts +8 -0
  877. package/common/src/types/RewardUserEnums.d.ts +11 -0
  878. package/common/src/types/TransactionSimulator.types.d.ts +16 -0
  879. package/common/src/types/WeeklyAnalytics.types.d.ts +12 -0
  880. package/common/src/types/activities.types.cjs +1 -1
  881. package/common/src/types/activities.types.d.ts +68 -0
  882. package/common/src/types/activities.types.mjs +1 -1
  883. package/common/src/types/admin.types.cjs +1 -1
  884. package/common/src/types/admin.types.d.ts +45 -0
  885. package/common/src/types/admin.types.mjs +1 -1
  886. package/common/src/types/all-points.types.d.ts +7 -0
  887. package/common/src/types/approvals.types.d.ts +41 -0
  888. package/common/src/types/balances.types.d.ts +39 -0
  889. package/common/src/types/big-intable.types.d.ts +3 -0
  890. package/common/src/types/bridging-tx.types.d.ts +40 -0
  891. package/common/src/types/cache.types.cjs +1 -1
  892. package/common/src/types/cache.types.d.ts +61 -0
  893. package/common/src/types/cache.types.mjs +1 -1
  894. package/common/src/types/chains.types.d.ts +11 -0
  895. package/common/src/types/circom-data.types.cjs +1 -1
  896. package/common/src/types/circom-data.types.d.ts +112 -0
  897. package/common/src/types/circom-data.types.mjs +1 -1
  898. package/common/src/types/coingecko.types.d.ts +220 -0
  899. package/common/src/types/commitments.types.d.ts +34 -0
  900. package/common/src/types/confirmation-request.types.d.ts +10 -0
  901. package/common/src/types/connector.types.d.ts +5 -0
  902. package/common/src/types/contacts.types.d.ts +7 -0
  903. package/common/src/types/dashboard-account.d.ts +116 -0
  904. package/common/src/types/dashboard-payout.types.d.ts +30 -0
  905. package/common/src/types/dashboard-transaction.types.d.ts +25 -0
  906. package/common/src/types/eip5792.types.d.ts +33 -0
  907. package/common/src/types/enclaveApi.types.d.ts +77 -0
  908. package/common/src/types/ethereum-network.types.cjs +1 -1
  909. package/common/src/types/ethereum-network.types.d.ts +46 -0
  910. package/common/src/types/ethereum-network.types.mjs +1 -1
  911. package/common/src/types/events.types.d.ts +6 -0
  912. package/common/src/types/external-action.types.cjs +1 -1
  913. package/common/src/types/external-action.types.d.ts +14 -0
  914. package/common/src/types/external-action.types.mjs +1 -1
  915. package/common/src/types/fee.types.d.ts +13 -0
  916. package/common/src/types/hinkal.types.cjs +1 -1
  917. package/common/src/types/hinkal.types.d.ts +82 -0
  918. package/common/src/types/hinkal.types.mjs +12 -20
  919. package/common/src/types/http.types.d.ts +8 -0
  920. package/common/src/types/index.cjs +1 -1
  921. package/common/src/types/index.d.ts +61 -0
  922. package/common/src/types/index.mjs +3 -2
  923. package/common/src/types/message.types.d.ts +5 -0
  924. package/common/src/types/near-intents.types.d.ts +62 -0
  925. package/common/src/types/new-rewards.type.d.ts +82 -0
  926. package/common/src/types/offscreen.types.cjs +1 -1
  927. package/common/src/types/offscreen.types.d.ts +8 -0
  928. package/common/src/types/offscreen.types.mjs +1 -1
  929. package/common/src/types/okx.types.d.ts +57 -0
  930. package/common/src/types/onramp.types.d.ts +58 -0
  931. package/common/src/types/pay-activities.types.d.ts +52 -0
  932. package/common/src/types/pay-routing.types.d.ts +9 -0
  933. package/common/src/types/payout-notification.types.d.ts +11 -0
  934. package/common/src/types/presaleReferral.types.d.ts +4 -0
  935. package/common/src/types/proxy-progress.types.d.ts +5 -0
  936. package/common/src/types/proxy.types.d.ts +19 -0
  937. package/common/src/types/remote-proof.types.d.ts +14 -0
  938. package/common/src/types/remote-tx-build.types.d.ts +298 -0
  939. package/common/src/types/schedule.types.d.ts +7 -0
  940. package/common/src/types/scheduled-transactions.types.d.ts +67 -0
  941. package/common/src/types/session.types.d.ts +13 -0
  942. package/common/src/types/signature.types.d.ts +10 -0
  943. package/common/src/types/slippage.types.d.ts +3 -0
  944. package/common/src/types/snark.types.d.ts +38 -0
  945. package/common/src/types/solana-transact.types.cjs +1 -0
  946. package/common/src/types/solana-transact.types.d.ts +35 -0
  947. package/common/src/types/solana-transact.types.mjs +6 -0
  948. package/common/src/types/solana.types.cjs +1 -0
  949. package/common/src/types/solana.types.d.ts +96 -0
  950. package/common/src/types/solana.types.mjs +6 -0
  951. package/common/src/types/temp-wallet.types.d.ts +9 -0
  952. package/common/src/types/tenderly.api.types.d.ts +266 -0
  953. package/common/src/types/token-prices.types.d.ts +18 -0
  954. package/common/src/types/token.types.cjs +1 -1
  955. package/common/src/types/token.types.d.ts +98 -0
  956. package/common/src/types/token.types.mjs +2 -2
  957. package/common/src/types/transact.types.cjs +1 -0
  958. package/common/src/types/transact.types.d.ts +53 -0
  959. package/common/src/types/transact.types.mjs +6 -0
  960. package/common/src/types/transaction.types.d.ts +159 -0
  961. package/common/src/types/transactions.types.d.ts +78 -0
  962. package/common/src/types/tron.types.d.ts +15 -0
  963. package/common/src/types/wc.types.d.ts +78 -0
  964. package/common/src/types/with-id.types.d.ts +3 -0
  965. package/common/src/webworker/WorkerWrapper.d.ts +9 -0
  966. package/common/src/webworker/logError-ScFy7p5w.js +2 -0
  967. package/common/src/webworker/package.json +26 -25
  968. package/common/src/webworker/performTaskWithWorker.d.ts +5 -0
  969. package/common/src/webworker/snarkjsWorker/snarkjsWorker.types.d.ts +14 -0
  970. package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.d.ts +1 -0
  971. package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.cjs +1 -1
  972. package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.mjs +1 -1
  973. package/common/src/webworker/snarkjsWorker/snarkjsWorkerLogic.d.ts +2 -0
  974. package/common/src/webworker/snarkjsWorker/snarkjsWorkerNode.d.ts +1 -0
  975. package/common/src/webworker/snarkjsWorkerNode.cjs +1 -1
  976. package/common/src/webworker/utxoWorker/utxoWorker.types.d.ts +33 -0
  977. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.d.ts +1 -0
  978. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
  979. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +1 -1
  980. package/common/src/webworker/utxoWorker/utxoWorkerLogic.d.ts +5 -0
  981. package/common/src/webworker/utxoWorker/utxoWorkerNode.d.ts +1 -0
  982. package/common/src/webworker/utxoWorkerNode.cjs +1 -1
  983. package/common/src/webworker/viteWorkerURL.constant.cjs +3 -3
  984. package/common/src/webworker/viteWorkerURL.constant.d.ts +10 -0
  985. package/common/src/webworker/viteWorkerURL.constant.fallback.d.ts +4 -0
  986. package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
  987. package/common/src/webworker/worker.registry.d.ts +10 -0
  988. package/common/src/webworker/worker.types.d.ts +33 -0
  989. package/common/src/webworker/workerErrorHandler.d.ts +1 -0
  990. package/common/src/webworker/workerFactory.d.ts +11 -0
  991. package/common/src/webworker/workerProxy-B_eSl85g.js +1 -0
  992. package/common/src/webworker/workerProxy.d.ts +39 -0
  993. package/common/src/webworker/zkProofWorker/zkProofWorker.types.d.ts +26 -0
  994. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.d.ts +1 -0
  995. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
  996. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +1 -1
  997. package/common/src/webworker/zkProofWorker/zkProofWorkerLogic.d.ts +4 -0
  998. package/common/src/webworker/zkProofWorker/zkProofWorkerNode.d.ts +1 -0
  999. package/common/src/webworker/zkProofWorkerNode.cjs +1 -1
  1000. package/index.cjs +1 -1
  1001. package/index.mjs +1 -1
  1002. package/internal/swapApi.cjs +1 -1
  1003. package/internal/swapApi.d.ts +3 -3
  1004. package/internal/swapApi.mjs +22 -25
  1005. package/package.json +26 -25
  1006. package/providers/prepareEthersHinkal.cjs +1 -1
  1007. package/providers/prepareEthersHinkal.d.ts +1 -0
  1008. package/providers/prepareEthersHinkal.mjs +2 -2
  1009. package/providers/prepareSolanaHinkal.cjs +1 -1
  1010. package/providers/prepareSolanaHinkal.d.ts +1 -0
  1011. package/providers/prepareSolanaHinkal.mjs +2 -2
  1012. package/providers/prepareTronHinkal.cjs +1 -1
  1013. package/providers/prepareTronHinkal.d.ts +1 -0
  1014. package/providers/prepareTronHinkal.mjs +2 -2
  1015. package/providers/prepareWagmiHinkal.cjs +1 -1
  1016. package/providers/prepareWagmiHinkal.d.ts +1 -0
  1017. package/providers/prepareWagmiHinkal.mjs +2 -2
  1018. package/services/Hinkal.cjs +1 -1
  1019. package/services/Hinkal.d.ts +16 -10
  1020. package/services/Hinkal.mjs +29 -17
  1021. package/types/IHinkal.d.ts +16 -10
  1022. package/types/swap.types.d.ts +3 -20
  1023. package/common/src/API/accessCodeCalls.cjs +0 -1
  1024. package/common/src/API/accessCodeCalls.mjs +0 -13
  1025. package/common/src/API/brotherhoodCalls.cjs +0 -1
  1026. package/common/src/API/brotherhoodCalls.mjs +0 -17
  1027. package/common/src/API/callOdosAPI.cjs +0 -1
  1028. package/common/src/API/callOdosAPI.mjs +0 -18
  1029. package/common/src/API/callOneInchAPI.cjs +0 -1
  1030. package/common/src/API/callOneInchAPI.mjs +0 -13
  1031. package/common/src/API/deposit-and-withdraw-status-calls.cjs +0 -1
  1032. package/common/src/API/deposit-and-withdraw-status-calls.mjs +0 -13
  1033. package/common/src/API/generate-trading-points.cjs +0 -1
  1034. package/common/src/API/generate-trading-points.mjs +0 -23
  1035. package/common/src/API/leaderboardCalls.cjs +0 -1
  1036. package/common/src/API/leaderboardCalls.mjs +0 -8
  1037. package/common/src/API/referralsCalls.cjs +0 -1
  1038. package/common/src/API/referralsCalls.mjs +0 -11
  1039. package/common/src/API/send-telegram-callback.cjs +0 -1
  1040. package/common/src/API/send-telegram-callback.mjs +0 -11
  1041. package/common/src/constants/tasks.constants.cjs +0 -1
  1042. package/common/src/constants/tasks.constants.mjs +0 -124
  1043. package/common/src/crypto/ecdh-dual-path.cjs +0 -1
  1044. package/common/src/crypto/ecdh-dual-path.mjs +0 -6
  1045. package/common/src/data-structures/Hinkal/hinkalMultiSend.cjs +0 -1
  1046. package/common/src/data-structures/Hinkal/hinkalMultiSend.mjs +0 -12
  1047. package/common/src/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.cjs +0 -1
  1048. package/common/src/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.mjs +0 -128
  1049. package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.cjs +0 -1
  1050. package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.mjs +0 -34
  1051. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +0 -1
  1052. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +0 -172
  1053. package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.cjs +0 -1
  1054. package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.mjs +0 -94
  1055. package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.cjs +0 -1
  1056. package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.mjs +0 -134
  1057. package/common/src/data-structures/TokenDBs/PublicTokensDB.cjs +0 -1
  1058. package/common/src/data-structures/TokenDBs/PublicTokensDB.mjs +0 -32
  1059. package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.cjs +0 -1
  1060. package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.mjs +0 -41
  1061. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.cjs +0 -1
  1062. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.mjs +0 -47
  1063. package/common/src/data-structures/TokenDBs/index.cjs +0 -1
  1064. package/common/src/data-structures/TokenDBs/index.mjs +0 -6
  1065. package/common/src/externalABIs/IQuoterV2.json.cjs +0 -1
  1066. package/common/src/externalABIs/IQuoterV2.json.mjs +0 -203
  1067. package/common/src/externalABIs/ISwapRouter.json.cjs +0 -1
  1068. package/common/src/externalABIs/ISwapRouter.json.mjs +0 -537
  1069. package/common/src/externalABIs/IUniswapV3Factory.json.cjs +0 -1
  1070. package/common/src/externalABIs/IUniswapV3Factory.json.mjs +0 -188
  1071. package/common/src/externalABIs/IUniswapV3Pool.json.cjs +0 -1
  1072. package/common/src/externalABIs/IUniswapV3Pool.json.mjs +0 -938
  1073. package/common/src/externalABIs/UniswapV2PoolAbi.json.cjs +0 -1
  1074. package/common/src/externalABIs/UniswapV2PoolAbi.json.mjs +0 -78
  1075. package/common/src/functions/pre-transaction/interaction-to-action.cjs +0 -1
  1076. package/common/src/functions/pre-transaction/interaction-to-action.mjs +0 -1
  1077. package/common/src/functions/pre-transaction/recipientUtxoProcessing.cjs +0 -1
  1078. package/common/src/functions/pre-transaction/recipientUtxoProcessing.mjs +0 -32
  1079. package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs +0 -1
  1080. package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +0 -29
  1081. package/common/src/functions/private-wallet/opProducer.cjs +0 -1
  1082. package/common/src/functions/private-wallet/opProducer.mjs +0 -3
  1083. package/common/src/functions/snarkjs/generateZkProofEnclave.cjs +0 -1
  1084. package/common/src/functions/snarkjs/generateZkProofEnclave.mjs +0 -27
  1085. package/common/src/functions/utils/bit.operations.cjs +0 -1
  1086. package/common/src/functions/utils/bit.operations.mjs +0 -4
  1087. package/common/src/functions/utils/get-signature-header.cjs +0 -1
  1088. package/common/src/functions/utils/get-signature-header.mjs +0 -4
  1089. package/common/src/functions/utils/ipfs.cjs +0 -1
  1090. package/common/src/functions/utils/ipfs.mjs +0 -1
  1091. package/common/src/functions/utils/reloadPage.cjs +0 -1
  1092. package/common/src/functions/utils/reloadPage.mjs +0 -4
  1093. package/common/src/functions/web3/getSolanaPriorityFee.cjs +0 -1
  1094. package/common/src/functions/web3/getSolanaPriorityFee.mjs +0 -26
  1095. package/common/src/functions/web3/odosAPI.cjs +0 -1
  1096. package/common/src/functions/web3/odosAPI.mjs +0 -35
  1097. package/common/src/functions/web3/oneInchAPI.cjs +0 -1
  1098. package/common/src/functions/web3/oneInchAPI.mjs +0 -34
  1099. package/common/src/functions/web3/uniswapAPI.cjs +0 -1
  1100. package/common/src/functions/web3/uniswapAPI.mjs +0 -60
  1101. package/common/src/types/new-rewards.type.cjs +0 -1
  1102. package/common/src/types/new-rewards.type.mjs +0 -10
  1103. package/common/src/types/scheduled-transactions.types.cjs +0 -1
  1104. package/common/src/types/scheduled-transactions.types.mjs +0 -6
  1105. package/common/src/webworker/logError-CZYZ3oyV.js +0 -2
  1106. package/common/src/webworker/workerProxy-DPeuP2Mg.js +0 -1
@@ -2,78 +2,112 @@ import { isTronLike as e } from "../../constants/chains.constants.mjs";
2
2
  import { zeroAddress as t } from "../../constants/protocol.constants.mjs";
3
3
  import { caseInsensitiveEqual as n } from "../../functions/utils/caseInsensitive.utils.mjs";
4
4
  import { transactionErrorCodes as r } from "../../error-handling/error-codes.constants.mjs";
5
- import { getCurrentTimeInSeconds as i } from "../../functions/utils/time.utils.mjs";
6
- import { Utxo as a } from "../utxo/Utxo.mjs";
7
- import { ExternalActionId as o } from "../../types/external-action.types.mjs";
8
- import { DepositAndWithdrawPhase as s } from "../../types/scheduled-transactions.types.mjs";
9
- import "../../types/index.mjs";
10
- import { hashEthereumAddress as c, hashString as l } from "../../functions/utils/addresses.mjs";
11
- import { addressToHexFormat as u, reorderZkCallData as d } from "../../functions/utils/tron.utils.mjs";
12
- import { validateAndGetChainId as f } from "../../functions/utils/token-check.utils.mjs";
5
+ import { Utxo as i } from "../utxo/Utxo.mjs";
6
+ import { addressToHexFormat as a, swapTronBCoordinate as o } from "../../functions/utils/tron.utils.mjs";
7
+ import { hashEthereumAddress as s, hashString as c } from "../../functions/utils/addresses.mjs";
8
+ import { ExternalActionId as l } from "../../types/external-action.types.mjs";
9
+ import { SubmitMode as u } from "../../types/transact.types.mjs";
10
+ import { validateAndGetChainId as d } from "../../functions/utils/token-check.utils.mjs";
11
+ import { decryptUtxo as f } from "../crypto-keys/encryptDecryptUtxo.mjs";
13
12
  import { constructAdminData as p } from "../../functions/pre-transaction/constructAdminData.mjs";
14
13
  import { getFeeStructure as m } from "../../functions/pre-transaction/getFeeStructure.mjs";
15
- import { waitForDepositedUtxosInMerkleTree as h } from "../../functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs";
16
- import { calculateModifiedFeeStructure as g } from "../../functions/utils/fees.utils.mjs";
17
- import { constructZkProof as _ } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
18
- import { transactCallRelayerBatch as v } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
19
- import { safeUpdateDepositAndWithdrawStatus as y } from "../../API/deposit-and-withdraw-status-calls.mjs";
20
- import { hinkalDepositOnChainUtxos as b } from "./hinkalDepositOnChainUtxos.mjs";
14
+ import { toSpeculativeUtxo as h } from "../../functions/pre-transaction/speculativeUtxo.mjs";
15
+ import { transactCallDirectTron as g } from "../../functions/web3/functionCalls/transactCallDirectTron.mjs";
16
+ import { transactCallRelayerBatch as _ } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
17
+ import { hinkalTransact as v } from "./hinkalTransact.mjs";
21
18
  import "../../functions/index.mjs";
19
+ import { prepareDepositOnChainUtxos as y, submitDepositOnChainUtxos as b } from "./hinkalDepositOnChainUtxos.mjs";
20
+ import { ethers as x } from "ethers";
22
21
  //#region libs/shared/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.ts
23
- var x = async (o, c, l, f, m, h, b, x, S, C, w, T) => {
24
- let E = e(c);
25
- if (f.length === 0) throw Error("userDepositedUtxos must not be empty");
26
- let D = l.erc20TokenAddress, [O, k] = await Promise.all([o.getRandomRelay(c), o.getEthereumAddressByChain(c)]);
27
- if (!O) throw Error(r.RELAYER_NOT_AVAILABLE);
28
- let A = i().toString(), j = o.generateProofRemotely && !E ? 5 : 1, M = [], N = u(k);
29
- for (let e = 0; e < f.length; e += j) {
30
- let r = f.slice(e, e + j), i = await Promise.all(r.map(async ({ recipientAddress: r, utxo: i }, s) => {
31
- let f = e + s, v = u(r), y = new a({
32
- amount: 0n,
33
- erc20TokenAddress: D,
34
- nullifyingKey: o.userKeys.getShieldedPrivateKey(),
35
- timeStamp: A,
36
- ...i.isNewStyle ? {
37
- spendingPublicKey: o.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,
38
- isNewStyle: !0
39
- } : { isNewStyle: !1 }
40
- }), b = [[n(i.erc20TokenAddress, D) ? i : a.createFrom(i, { erc20TokenAddress: D }), y]], x = [[y]], S = {
41
- externalActionId: 0n,
42
- externalAddress: v,
43
- externalActionMetadata: "0x00"
44
- }, C = p(w, c, [D], [-i.amount], N), T = await g(c, l, m[f], h), { zkCallData: k, circomData: j, dimData: M, commitmentValidationData: P } = await _(o.merkleTreeHinkalByChain[c], b, x, o.userKeys, S.externalActionId, S.externalAddress, S.externalActionMetadata, o.generateProofRemotely, T, O ?? t, c);
22
+ var S = async (e, o, s, c, l, d, f, m) => {
23
+ if (c.length === 0) throw Error("userDepositedUtxos must not be empty");
24
+ let g = s.erc20TokenAddress, [_, y] = await Promise.all([e.getRandomRelay(o), e.getEthereumAddressByChain(o)]);
25
+ if (!_) throw Error(r.RELAYER_NOT_AVAILABLE);
26
+ let b = e.generateProofRemotely ? 5 : 1, x = [], S = a(y);
27
+ for (let r = 0; r < c.length; r += b) {
28
+ let s = c.slice(r, r + b), y = await Promise.all(s.map(async ({ recipientAddress: s, utxo: c }, y) => {
29
+ let b = r + y, x = a(s), C = n(c.erc20TokenAddress, g) ? c : i.createFrom(c, { erc20TokenAddress: g }), w = p(d, o, [g], [-c.amount], S), { zkCallData: T, circomData: E, dimData: D, commitmentValidationData: O, tronProofSignature: k } = await v(e, {
30
+ chainId: o,
31
+ erc20Addresses: [g],
32
+ amountChanges: [-c.amount],
33
+ externalAddress: x,
34
+ feeStructure: l,
35
+ relay: _ ?? t,
36
+ inputUtxos: [[C]],
37
+ useBlockedUtxos: !0,
38
+ speculative: m && {
39
+ pendingLeaves: m,
40
+ inputUtxos: [[h(C)]]
41
+ },
42
+ submit: { mode: u.ProofOnly },
43
+ skipLock: !0
44
+ });
45
45
  return {
46
- zkCallData: k,
47
- dimData: M,
48
- circomData: j,
49
- commitmentValidationData: P,
50
- adminData: C,
51
- recipientAddress: r,
52
- tronProofSignature: await d(E, k, M, j)
46
+ zkCallData: T,
47
+ dimData: D,
48
+ circomData: E,
49
+ commitmentValidationData: O,
50
+ adminData: w,
51
+ recipientAddress: s,
52
+ tronProofSignature: k,
53
+ destinationChainId: f?.chainId,
54
+ destinationTokenAddress: f?.tokenAddress,
55
+ destinationTokenAmount: f?.tokenAmounts?.[b]
53
56
  };
54
57
  }));
55
- M.push(...i);
58
+ x.push(...y);
56
59
  }
57
- await y({
58
- id: x,
59
- chainId: c,
60
- hashedEthereumAddress: b,
61
- phase: s.BEFORE_SCHEDULE_WITHDRAW
62
- });
63
- let P = await v(c, M, b, S, C, T);
64
- return await y({
65
- id: x,
66
- chainId: c,
67
- hashedEthereumAddress: b,
68
- phase: s.AFTER_SCHEDULE_WITHDRAW,
69
- scheduleId: P
70
- }), P;
71
- }, S = async (e, t, n, r, i, a, s, d, p, g = !0) => {
72
- let _ = f([t]), v = p ? l(p) : void 0, y = t.erc20TokenAddress, S = c(u(await e.getEthereumAddressByChain(_))), C = a ?? await m(_, y, [y], o.Transact, [], 10n), { userDepositedUtxos: w, statusId: T, depositTxHash: E } = await b(e, _, t, n, r, C, S, g);
73
- return await h(e, _, w), {
74
- depositTxHash: E,
75
- scheduleId: await x(e, _, t, w, n, C, S, T, i, s, d, v)
60
+ return x;
61
+ }, C = async (e, t, n, r, i) => {
62
+ let { chainId: a, hashedEthereumAddress: o, feeStructure: s, action: c, destination: l } = i, { txCompletionTime: u, ref: d, hashedDashboardAccountId: f, preEstimateGas: p } = i, m = n.map((e) => e + s.flatFee), h = await y(e, a, [t], [m]), { depositedUtxos: g, pendingLeaves: v } = h, x = g[0].map((e, t) => ({
63
+ recipientAddress: r[t],
64
+ utxo: e
65
+ })), [C, w] = await Promise.all([b(e, h, p), S(e, a, t, x, s, c, l, v)]);
66
+ return {
67
+ depositTxHash: C,
68
+ scheduleId: await _(a, w, o, u, d, f, C)
76
69
  };
70
+ }, w = async (e, t, n, r, i) => {
71
+ let { chainId: a, ethereumAddress: s, hashedEthereumAddress: c, feeStructure: l, action: d, destination: p } = i, { txCompletionTime: m, ref: h, hashedDashboardAccountId: y, preEstimateGas: b } = i, C = n.map((e) => e + l.flatFee), w = C.reduce((e, t) => e + t, 0n), T = await v(e, {
72
+ chainId: a,
73
+ erc20Addresses: [t.erc20TokenAddress],
74
+ amountChanges: [w],
75
+ externalAddress: s,
76
+ selfOutputAmounts: C,
77
+ createBlockedUtxos: !0,
78
+ forceEmptyUtxos: !0,
79
+ submit: { mode: u.ProofOnly }
80
+ }), E = T.circomData.encryptedOutputs?.[0];
81
+ if (!E || E.length !== C.length) throw Error("Deposit proof is missing encryptedOutputs for the deposited UTXOs");
82
+ let D = E.map((t, n) => ({
83
+ recipientAddress: r[n],
84
+ utxo: f(x.getBytes(t), e.userKeys)
85
+ })), O = T.circomData.outCommitments.flat().map((e) => BigInt(e)).filter((e) => e !== 0n).map((e) => e.toString()), [k, A] = await Promise.all([(async () => {
86
+ o(T.zkCallData);
87
+ let n = await g(e, a, w, t, T.zkCallData, T.circomData, T.dimData, void 0, void 0, b, T.tronProofSignature);
88
+ if (!n) throw Error("Deposit transaction hash not found");
89
+ return n;
90
+ })(), S(e, a, t, D, l, d, p, O)]);
91
+ return {
92
+ depositTxHash: k,
93
+ scheduleId: await _(a, A, c, m, h, y, k)
94
+ };
95
+ }, T = async (t, n, r, i, o, u, f, p, h, g = !0, _) => {
96
+ let v = d([n]), y = n.erc20TokenAddress, b = a(await t.getEthereumAddressByChain(v)), x = {
97
+ chainId: v,
98
+ ethereumAddress: b,
99
+ hashedEthereumAddress: s(b),
100
+ feeStructure: u ?? await m(v, y, [y], l.Transact, [], 25n),
101
+ txCompletionTime: o,
102
+ ref: f,
103
+ action: p,
104
+ hashedDashboardAccountId: h ? c(h) : void 0,
105
+ preEstimateGas: g,
106
+ destination: _
107
+ };
108
+ if (!e(v)) return C(t, n, r, i, x);
109
+ if (r.length > 4) throw Error("Tron supports at most 4 recipients per deposit - no circuit emits more outputs");
110
+ return w(t, n, r, i, x);
77
111
  };
78
112
  //#endregion
79
- export { S as hinkalDepositAndWithdraw };
113
+ export { T as hinkalDepositAndWithdraw };
@@ -1 +1 @@
1
- const e=require(`../../constants/chains.constants.cjs`),t=require(`../../types/ethereum-network.types.cjs`),n=require(`../../types/scheduled-transactions.types.cjs`);require(`../../types/index.cjs`);const r=require(`../../functions/utils/tron.utils.cjs`),i=require(`../../functions/utils/getUtxosFromReceipt.utils.cjs`),a=require(`../../functions/utils/tx-confirmation.utils.cjs`),o=require(`../../functions/web3/functionCalls/transactCallDirect.cjs`),s=require(`../../functions/web3/functionCalls/transactCallDirectTron.cjs`),c=require(`../../API/deposit-and-withdraw-status-calls.cjs`),l=require(`./prepareDepositOnChainUtxosZkProof.cjs`);var u=async(u,d,f,p,m,h,g,_=!0)=>{let v=e.isTronLike(d),y=f.erc20TokenAddress,{zkCallData:b,circomData:x,dimData:S,totalAmount:C,utxoAmounts:w,hinkalWrapperAddress:T,hinkalWrapperABI:E,depositOnChainUtxosExternalActionAddress:D,depositOnChainUtxosExternalActionABI:O}=await l.prepareDepositOnChainUtxosZkProof(u,d,f,p,h),k=(await c.updateDepositAndWithdrawStatus({chainId:d,hashedEthereumAddress:g,phase:n.DepositAndWithdrawPhase.BEFORE_DEPOSIT})).id??void 0,A;if(v){let e=u.getTronWeb();A=await s.transactCallDirectTron(u,d,C,f,b,x,S,e.contract(O,r.evmHexToTronBase58Address(D)),e.contract(E,r.evmHexToTronBase58Address(T)),_)}else{let e=u.getContractWithSigner(d,t.ContractType.HinkalWrapper);A=(await o.transactCallDirect(u,d,C,f,b,x,S,u.getContractWithSigner(d,t.ContractType.DepositOnChainUtxos),e,_)).hash}if(!A)throw Error(`Deposit transaction hash not found`);let j=await a.waitForEthereumTransactionConfirmation(d,A);await c.safeUpdateDepositAndWithdrawStatus({id:k,chainId:d,hashedEthereumAddress:g,phase:n.DepositAndWithdrawPhase.AFTER_DEPOSIT,depositTxHash:A});let M=i.getOnChainUtxosFromReceipt(j,u,d,y);if(M.length===0)throw Error(`No UTXOs found in deposit transaction. Check contract address and ABI.`);let N=[],P=[...M];return m.forEach((e,t)=>{let n=w[t],r=P.find(e=>e.amount===n);if(!r)throw Error(`Could not find newly created UTXO with amount ${n} for recipient ${e}.`);N.push({recipientAddress:e,utxo:r});let i=P.indexOf(r);P.splice(i,1)}),{userDepositedUtxos:N,statusId:k,depositTxHash:A}};exports.hinkalDepositOnChainUtxos=u;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../utxo/Utxo.cjs`),t=require(`../../functions/utils/tron.utils.cjs`),n=require(`../../types/ethereum-network.types.cjs`),r=require(`../../types/external-action.types.cjs`),i=require(`../../types/transact.types.cjs`),a=require(`../../constants/contracts.constants.cjs`),o=require(`../../functions/web3/functionCalls/transactCallDirect.cjs`),s=require(`./hinkalTransact.cjs`);let c=require(`ethers`);var l=async(n,o,l,u)=>{if(l.length!==u.length)throw Error(`erc20Tokens and utxoAmounts length mismatch`);if(u.some(e=>e.length===0))throw Error(`every token must deposit at least one UTXO`);let d=a.getDepositOnChainUtxosAddress(o);if(!d)throw Error(`DepositOnChainUtxos action is not deployed on chain ${o}`);let f=l.map(({erc20TokenAddress:e})=>e),p=u.map(e=>e.reduce((e,t)=>e+t,0n)),m=c.ethers.AbiCoder.defaultAbiCoder().encode([`uint256[][]`],[u]),h=t.addressToHexFormat(await n.getEthereumAddressByChain(o)),g=await s.hinkalTransact(n,{chainId:o,erc20Addresses:f,amountChanges:f.map(()=>0n),externalAddress:d,externalActionId:r.ExternalActionId.DepositOnChainUtxos,externalActionMetadata:m,onChainCreation:f.map(()=>!0),originalSender:h,forceEmptyUtxos:!0,submit:{mode:i.SubmitMode.ProofOnly}}),{timeStamp:_,stealthAddressStructure:v}=g.circomData;if(!_)throw Error(`Deposit proof is missing the timestamp the on-chain UTXOs are stamped with`);let y=c.ethers.toBeHex(BigInt(v.stealthAddress)),b=n.userKeys.getShieldedPrivateKey(),x=0n,S=u.map((t,n)=>t.map(t=>{let r=new e.Utxo({amount:t,erc20TokenAddress:f[n],timeStamp:(BigInt(_)+x).toString(),nullifyingKey:b,stealthAddress:y,H0:[v.H0x,v.H0y],isBlocked:!0});return x+=1n,r}));return{chainId:o,erc20Tokens:l,externalAddress:d,depositProof:g,depositedUtxos:S,pendingLeaves:S.flat().map(e=>BigInt(e.getCommitment()).toString()),totalAmounts:p}},u=async(e,t,r=!0)=>{let{chainId:i,erc20Tokens:a,depositProof:s,totalAmounts:c}=t,{zkCallData:l,circomData:u,dimData:d}=s,f=await o.transactCallDirect(e,i,c,a,l,u,d,e.getContractWithSigner(i,n.ContractType.DepositOnChainUtxosContract),void 0,r);if(!f.hash)throw Error(`Deposit transaction hash not found`);return f.hash};exports.prepareDepositOnChainUtxos=l,exports.submitDepositOnChainUtxos=u;
@@ -0,0 +1,21 @@
1
+ import { IHinkal } from './IHinkal';
2
+ import { ERC20Token } from '../../types';
3
+ import { TransactProof } from '../../types/transact.types';
4
+ import { Utxo } from '../utxo/Utxo';
5
+ export interface PreparedDepositOnChainUtxos {
6
+ chainId: number;
7
+ erc20Tokens: ERC20Token[];
8
+ externalAddress: string;
9
+ depositProof: TransactProof;
10
+ depositedUtxos: Utxo[][];
11
+ pendingLeaves: string[];
12
+ totalAmounts: bigint[];
13
+ }
14
+ /**
15
+ * Builds a deposit that creates on-chain UTXOs through the DepositOnChainUtxos external
16
+ * action. The action stamps each UTXO with circomData.timeStamp instead of block.timestamp,
17
+ * so every commitment is known before the transaction is submitted and dependent proofs can
18
+ * be generated against a speculative Merkle tree while the deposit is still confirming.
19
+ */
20
+ export declare const prepareDepositOnChainUtxos: (hinkal: IHinkal, chainId: number, erc20Tokens: ERC20Token[], utxoAmounts: bigint[][]) => Promise<PreparedDepositOnChainUtxos>;
21
+ export declare const submitDepositOnChainUtxos: (hinkal: IHinkal, prepared: PreparedDepositOnChainUtxos, preEstimateGas?: boolean) => Promise<string>;
@@ -1,54 +1,56 @@
1
- import { isTronLike as e } from "../../constants/chains.constants.mjs";
2
- import { ContractType as t } from "../../types/ethereum-network.types.mjs";
3
- import { DepositAndWithdrawPhase as n } from "../../types/scheduled-transactions.types.mjs";
4
- import "../../types/index.mjs";
5
- import { evmHexToTronBase58Address as r } from "../../functions/utils/tron.utils.mjs";
6
- import { getOnChainUtxosFromReceipt as i } from "../../functions/utils/getUtxosFromReceipt.utils.mjs";
7
- import { waitForEthereumTransactionConfirmation as a } from "../../functions/utils/tx-confirmation.utils.mjs";
1
+ import { Utxo as e } from "../utxo/Utxo.mjs";
2
+ import { addressToHexFormat as t } from "../../functions/utils/tron.utils.mjs";
3
+ import { ContractType as n } from "../../types/ethereum-network.types.mjs";
4
+ import { ExternalActionId as r } from "../../types/external-action.types.mjs";
5
+ import { SubmitMode as i } from "../../types/transact.types.mjs";
6
+ import { getDepositOnChainUtxosAddress as a } from "../../constants/contracts.constants.mjs";
8
7
  import { transactCallDirect as o } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
9
- import { transactCallDirectTron as s } from "../../functions/web3/functionCalls/transactCallDirectTron.mjs";
10
- import { safeUpdateDepositAndWithdrawStatus as c, updateDepositAndWithdrawStatus as l } from "../../API/deposit-and-withdraw-status-calls.mjs";
11
- import { prepareDepositOnChainUtxosZkProof as u } from "./prepareDepositOnChainUtxosZkProof.mjs";
8
+ import { hinkalTransact as s } from "./hinkalTransact.mjs";
9
+ import { ethers as c } from "ethers";
12
10
  //#region libs/shared/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.ts
13
- var d = async (d, f, p, m, h, g, _, v = !0) => {
14
- let y = e(f), b = p.erc20TokenAddress, { zkCallData: x, circomData: S, dimData: C, totalAmount: w, utxoAmounts: T, hinkalWrapperAddress: E, hinkalWrapperABI: D, depositOnChainUtxosExternalActionAddress: O, depositOnChainUtxosExternalActionABI: k } = await u(d, f, p, m, g), A = (await l({
15
- chainId: f,
16
- hashedEthereumAddress: _,
17
- phase: n.BEFORE_DEPOSIT
18
- })).id ?? void 0, j;
19
- if (y) {
20
- let e = d.getTronWeb();
21
- j = await s(d, f, w, p, x, S, C, e.contract(k, r(O)), e.contract(D, r(E)), v);
22
- } else {
23
- let e = d.getContractWithSigner(f, t.HinkalWrapper);
24
- j = (await o(d, f, w, p, x, S, C, d.getContractWithSigner(f, t.DepositOnChainUtxos), e, v)).hash;
25
- }
26
- if (!j) throw Error("Deposit transaction hash not found");
27
- let M = await a(f, j);
28
- await c({
29
- id: A,
30
- chainId: f,
31
- hashedEthereumAddress: _,
32
- phase: n.AFTER_DEPOSIT,
33
- depositTxHash: j
34
- });
35
- let N = i(M, d, f, b);
36
- if (N.length === 0) throw Error("No UTXOs found in deposit transaction. Check contract address and ABI.");
37
- let P = [], F = [...N];
38
- return h.forEach((e, t) => {
39
- let n = T[t], r = F.find((e) => e.amount === n);
40
- if (!r) throw Error(`Could not find newly created UTXO with amount ${n} for recipient ${e}.`);
41
- P.push({
42
- recipientAddress: e,
43
- utxo: r
11
+ var l = async (n, o, l, u) => {
12
+ if (l.length !== u.length) throw Error("erc20Tokens and utxoAmounts length mismatch");
13
+ if (u.some((e) => e.length === 0)) throw Error("every token must deposit at least one UTXO");
14
+ let d = a(o);
15
+ if (!d) throw Error(`DepositOnChainUtxos action is not deployed on chain ${o}`);
16
+ let f = l.map(({ erc20TokenAddress: e }) => e), p = u.map((e) => e.reduce((e, t) => e + t, 0n)), m = c.AbiCoder.defaultAbiCoder().encode(["uint256[][]"], [u]), h = t(await n.getEthereumAddressByChain(o)), g = await s(n, {
17
+ chainId: o,
18
+ erc20Addresses: f,
19
+ amountChanges: f.map(() => 0n),
20
+ externalAddress: d,
21
+ externalActionId: r.DepositOnChainUtxos,
22
+ externalActionMetadata: m,
23
+ onChainCreation: f.map(() => !0),
24
+ originalSender: h,
25
+ forceEmptyUtxos: !0,
26
+ submit: { mode: i.ProofOnly }
27
+ }), { timeStamp: _, stealthAddressStructure: v } = g.circomData;
28
+ if (!_) throw Error("Deposit proof is missing the timestamp the on-chain UTXOs are stamped with");
29
+ let y = c.toBeHex(BigInt(v.stealthAddress)), b = n.userKeys.getShieldedPrivateKey(), x = 0n, S = u.map((t, n) => t.map((t) => {
30
+ let r = new e({
31
+ amount: t,
32
+ erc20TokenAddress: f[n],
33
+ timeStamp: (BigInt(_) + x).toString(),
34
+ nullifyingKey: b,
35
+ stealthAddress: y,
36
+ H0: [v.H0x, v.H0y],
37
+ isBlocked: !0
44
38
  });
45
- let i = F.indexOf(r);
46
- F.splice(i, 1);
47
- }), {
48
- userDepositedUtxos: P,
49
- statusId: A,
50
- depositTxHash: j
39
+ return x += 1n, r;
40
+ }));
41
+ return {
42
+ chainId: o,
43
+ erc20Tokens: l,
44
+ externalAddress: d,
45
+ depositProof: g,
46
+ depositedUtxos: S,
47
+ pendingLeaves: S.flat().map((e) => BigInt(e.getCommitment()).toString()),
48
+ totalAmounts: p
51
49
  };
50
+ }, u = async (e, t, r = !0) => {
51
+ let { chainId: i, erc20Tokens: a, depositProof: s, totalAmounts: c } = t, { zkCallData: l, circomData: u, dimData: d } = s, f = await o(e, i, c, a, l, u, d, e.getContractWithSigner(i, n.DepositOnChainUtxosContract), void 0, r);
52
+ if (!f.hash) throw Error("Deposit transaction hash not found");
53
+ return f.hash;
52
54
  };
53
55
  //#endregion
54
- export { d as hinkalDepositOnChainUtxos };
56
+ export { l as prepareDepositOnChainUtxos, u as submitDepositOnChainUtxos };
@@ -0,0 +1,2 @@
1
+ import { IHinkal } from './IHinkal';
2
+ export declare const getRecipientInfo: (hinkal: IHinkal) => string;
@@ -1 +1 @@
1
- const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/time.utils.cjs`),n=require(`../../functions/utils/token-check.utils.cjs`),r=require(`../../constants/bridging.constants.cjs`),i=require(`../../API/callNearIntentsAPI.cjs`),a=require(`../../functions/utils/nearIntents.utils.cjs`),o=require(`./hinkalDepositAndWithdraw.cjs`),s=require(`./hinkalSolanaDepositAndWithdraw.cjs`);var c=async(c,l,u,d,f,p,m,h,g,_)=>{if(u.length!==d.length)throw Error(`recipientAmounts and recipientAddresses length mismatch`);if(u.length===0)throw Error(`No recipients to bridge`);let v=n.validateAndGetChainId([l]),y=t.secondsToMs(p),b=new Date(y+r.NEAR_BRIDGE_QUOTE_DEADLINE_BUFFER_MS).toISOString(),x=await Promise.all(d.map(async(e,t)=>{let n=u[t],{quote:r}=await i.getNearIntentsQuote({dry:!1,swapType:`EXACT_INPUT`,slippageTolerance:f.slippageBps??100,originAsset:f.originAsset,depositType:`ORIGIN_CHAIN`,destinationAsset:f.destinationAsset,amount:n.toString(),recipient:e,recipientType:`DESTINATION_CHAIN`,refundTo:c.userKeys.getNearIntentsAccountId(),refundType:`INTENTS`,deadline:b});if(!r.depositAddress)throw Error(`NEAR Intents quote returned no deposit address for recipient ${e}`);if(r.deadline&&new Date(r.deadline).getTime()<y)throw Error(`Bridge quote expires before the scheduled execution time. Choose a sooner time.`);return{destinationRecipient:e,amount:n,depositAddress:r.depositAddress,quote:r}})),S=m??await a.buildNearBridgeFeeStructure(v,l,x[0].depositAddress),C=x.map(e=>e.amount),w=x.map(e=>e.depositAddress),T;return e.isSolanaLike(v)?{depositTxHash:T}=await s.hinkalSolanaDepositAndWithdraw(c,l,C,w,p,S,h,g,_,x.map(e=>e.destinationRecipient)):{depositTxHash:T}=await o.hinkalDepositAndWithdraw(c,l,C,w,p,S,h,g,_),{depositTxHash:T,legs:x}};exports.hinkalNearDepositAndBridge=c;
1
+ const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/time.utils.cjs`),n=require(`../../functions/utils/token-check.utils.cjs`),r=require(`../../constants/bridging.constants.cjs`),i=require(`../../API/callNearIntentsAPI.cjs`),a=require(`../../functions/utils/nearIntents.utils.cjs`),o=require(`./hinkalDepositAndWithdraw.cjs`),s=require(`./hinkalSolanaDepositAndWithdraw.cjs`);var c=async(c,l,u,d,f,p,m,h,g,_)=>{if(u.length!==d.length)throw Error(`recipientAmounts and recipientAddresses length mismatch`);if(u.length===0)throw Error(`No recipients to bridge`);let v=n.validateAndGetChainId([l]),y=t.secondsToMs(p),b=new Date(y+r.NEAR_BRIDGE_QUOTE_DEADLINE_BUFFER_MS).toISOString(),x=await Promise.all(d.map(async(e,t)=>{let n=u[t],{quote:r}=await i.getNearIntentsQuote({dry:!1,swapType:`EXACT_INPUT`,slippageTolerance:f.slippageBps??100,originAsset:f.originAsset,depositType:`ORIGIN_CHAIN`,destinationAsset:f.destinationAsset,amount:n.toString(),recipient:e,recipientType:`DESTINATION_CHAIN`,refundTo:c.userKeys.getNearIntentsAccountId(),refundType:`INTENTS`,deadline:b});if(!r.depositAddress)throw Error(`NEAR Intents quote returned no deposit address for recipient ${e}`);if(r.deadline&&new Date(r.deadline).getTime()<y)throw Error(`Bridge quote expires before the scheduled execution time. Choose a sooner time.`);return{destinationRecipient:e,amount:n,depositAddress:r.depositAddress,quote:r}})),S=m??await a.buildNearBridgeFeeStructure(v,l,x[0].depositAddress),C=x.map(e=>e.amount),w=x.map(e=>e.depositAddress),T={chainId:f.destinationChainId===v?void 0:f.destinationChainId,tokenAddress:f.destinationTokenAddress,tokenAmounts:x.map(e=>e.quote.amountOut)},E,D;return e.isSolanaLike(v)?{depositTxHash:E,scheduleId:D}=await s.hinkalSolanaDepositAndWithdraw(c,l,C,w,p,S,h,g,_,x.map(e=>e.destinationRecipient),T):{depositTxHash:E,scheduleId:D}=await o.hinkalDepositAndWithdraw(c,l,C,w,p,S,h,g,_,void 0,T),{depositTxHash:E,scheduleId:D,legs:x}};exports.hinkalNearDepositAndBridge=c;
@@ -0,0 +1,6 @@
1
+ import { AdminTransactionType } from '../../types';
2
+ import { FeeStructure } from '../../types/hinkal.types';
3
+ import { NearBridgeParams, NearBridgeResult } from '../../types/near-intents.types';
4
+ import { ERC20Token } from '../../types/token.types';
5
+ import { IHinkal } from './IHinkal';
6
+ export declare const hinkalNearDepositAndBridge: (hinkal: IHinkal, token: ERC20Token, recipientAmounts: bigint[], recipientAddresses: string[], params: NearBridgeParams, txCompletionTime?: number, feeStructureOverride?: FeeStructure, ref?: string, action?: AdminTransactionType, dashboardAccountId?: string) => Promise<NearBridgeResult>;
@@ -33,9 +33,14 @@ var c = async (c, l, u, d, f, p, m, h, g, _) => {
33
33
  depositAddress: r.depositAddress,
34
34
  quote: r
35
35
  };
36
- })), S = m ?? await a(v, l, x[0].depositAddress), C = x.map((e) => e.amount), w = x.map((e) => e.depositAddress), T;
37
- return e(v) ? {depositTxHash: T} = await s(c, l, C, w, p, S, h, g, _, x.map((e) => e.destinationRecipient)) : {depositTxHash: T} = await o(c, l, C, w, p, S, h, g, _), {
38
- depositTxHash: T,
36
+ })), S = m ?? await a(v, l, x[0].depositAddress), C = x.map((e) => e.amount), w = x.map((e) => e.depositAddress), T = {
37
+ chainId: f.destinationChainId === v ? void 0 : f.destinationChainId,
38
+ tokenAddress: f.destinationTokenAddress,
39
+ tokenAmounts: x.map((e) => e.quote.amountOut)
40
+ }, E, D;
41
+ return e(v) ? {depositTxHash: E, scheduleId: D} = await s(c, l, C, w, p, S, h, g, _, x.map((e) => e.destinationRecipient), T) : {depositTxHash: E, scheduleId: D} = await o(c, l, C, w, p, S, h, g, _, void 0, T), {
42
+ depositTxHash: E,
43
+ scheduleId: D,
39
44
  legs: x
40
45
  };
41
46
  };
@@ -0,0 +1,9 @@
1
+ import { ethers } from 'ethers';
2
+ import { IHinkal } from './IHinkal';
3
+ import { ERC20Token } from '../../types';
4
+ import { FeeStructure } from '../../types/hinkal.types';
5
+ export type PalEvmDepositPrepareResult = {
6
+ unsignedTx: ethers.TransactionRequest;
7
+ utxoAmounts: bigint[];
8
+ };
9
+ export declare const hinkalPalEvmDepositPrepare: (hinkal: IHinkal, token: ERC20Token, recipientAmounts: bigint[], feeStructure: FeeStructure, orderId: string) => Promise<PalEvmDepositPrepareResult>;
@@ -0,0 +1,9 @@
1
+ import { VersionedTransaction } from '@solana/web3.js';
2
+ import { FeeStructure } from '../../types/hinkal.types';
3
+ import { ERC20Token } from '../../types/token.types';
4
+ import { IHinkal } from './IHinkal';
5
+ export type PalSolanaDepositPrepareResult = {
6
+ unsignedTx: VersionedTransaction;
7
+ utxoAmounts: bigint[];
8
+ };
9
+ export declare const hinkalPalSolanaDepositPrepare: (hinkal: IHinkal, chainId: number, token: ERC20Token, recipientAmounts: bigint[], feeStructure: FeeStructure, orderId: string) => Promise<PalSolanaDepositPrepareResult>;
@@ -0,0 +1,9 @@
1
+ import { Types as TronWebTypes } from 'tronweb';
2
+ import { IHinkal } from './IHinkal';
3
+ import { ERC20Token } from '../../types';
4
+ import { FeeStructure } from '../../types/hinkal.types';
5
+ export type PalTronDepositPrepareResult = {
6
+ unsignedTx: TronWebTypes.Transaction;
7
+ utxoAmounts: bigint[];
8
+ };
9
+ export declare const hinkalPalTronDepositPrepare: (hinkal: IHinkal, token: ERC20Token, recipientAmounts: bigint[], feeStructure: FeeStructure, orderId: string) => Promise<PalTronDepositPrepareResult>;
@@ -1 +1 @@
1
- const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/caseInsensitive.utils.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../../functions/utils/time.utils.cjs`),i=require(`../../types/external-action.types.cjs`),a=require(`../../types/admin.types.cjs`),o=require(`../../functions/utils/addresses.cjs`),s=require(`../../functions/web3/events/getShieldedBalance.cjs`),c=require(`../../functions/pre-transaction/outputUtxoProcessing.cjs`);require(`../../error-handling/index.cjs`);const l=require(`../../functions/pre-transaction/constructAdminData.cjs`),u=require(`../AccountActions/AccountActions.cjs`),d=require(`../../functions/pre-transaction/recipientUtxoProcessing.cjs`),f=require(`../../functions/pre-transaction/getFeeStructure.cjs`);require(`../../functions/pre-transaction/index.cjs`);const p=require(`../../functions/utils/involves-permit2-op.cjs`),m=require(`../../functions/utils/convertEmporiumOpToCallInfo.cjs`),h=require(`../../functions/private-wallet/emporium.helpers.cjs`),g=require(`../../functions/snarkjs/constructGeneralZkProof.cjs`),_=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),v=require(`../../functions/pre-transaction/merge-with-fee-structure.cjs`),y=require(`../../functions/pre-transaction/merge-with-fee-structure-emporium.cjs`),b=require(`./handleAutoDepositBack.cjs`);var x=async(e,t,n,i,a)=>{let o=[...await s.addPaddingToUtxos(e,t,n,i)],l=[],u=r.getCurrentTimeInSeconds().toString();for(let t=0;t<n.length;t+=1){let{outputUtxos:n}=c.outputUtxoProcessing(e.userKeys,o[t],i[t],u);l.push(n)}return a&&d.recipientUtxoProcessing(a,l,i,u),{inputUtxosArray:o,outputUtxosArray:l}},S=async(r,s,c,d,S,C,w,T,E,D,O,k=!1,A,j,M)=>{if(M&&!o.isValidPrivateAddress(M.recipientInfo))throw Error(n.transactionErrorCodes.RECIPIENT_FORMAT_INCORRECT);if(w.length>0&&!T)throw Error(`Subaccount is required for private wallet transactions`);let N=c.map(e=>e.erc20TokenAddress),P=await r.getEthereumAddressByChain(s),F=T?u.AccountActions.getAddressFromSubAccount(s,T):void 0,{contractData:I}=e.networkRegistry[s],{emporiumAddress:L}=I;if(!L)throw Error(`No Emporium Address Provided`);let R=D??await f.getFeeStructure(s,E,N,i.ExternalActionId.Emporium,C.map(e=>m.convertEmporiumOpToCallInfo(e,F??``,s)));for(F?await y.mergeWithFeeStructureEmporium(r,s,F,C,N,d,R,w.find(e=>t.caseInsensitiveEqual(e.token.erc20TokenAddress,R.feeToken))?.amount??0n):await v.mergeWithFeeStructure(s,N,d,R);S.length<N.length;)S.push(!1);let[{inputUtxosArray:z,outputUtxosArray:B},V]=await Promise.all([x(r,s,N,d,M),O??await r.getRandomRelay(s,!0)]);if(!V)throw Error(n.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let H=T?u.AccountActions.getPrivateKeyFromSubAccount(s,T):void 0,[{zkCallData:U,circomData:W,dimData:G,commitmentValidationData:K},q]=await Promise.all([g.constructZkProof(r.merkleTreeHinkalByChain[s],z,B,r.userKeys,i.ExternalActionId.Emporium,L,C,r.generateProofRemotely,R,V,s,S,void 0,void 0,H),h.getAuthorizationDataIfNeeded(s,H)]),J=await _.transactCallRelayer(s,U,G,W,K,p.uniswapWorkaround(C),q,l.constructAdminData(j,s,w.map(e=>e.token.erc20TokenAddress),w.map(e=>e.amount),P,j===a.AdminTransactionType.PublicSwap?w.map(({token:e})=>e):void 0));return k&&T&&b.handleAutoDepositBack(r,s,F,T,R.feeToken,A,w,W),J};exports.hinkalPrivateWallet=S;
1
+ const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/caseInsensitive.utils.cjs`),n=require(`../../crypto/poseidon.cjs`),r=require(`../../error-handling/error-codes.constants.cjs`),i=require(`../../functions/web3/etherFunctions.cjs`),a=require(`../../functions/utils/addresses.cjs`),o=require(`../../types/external-action.types.cjs`),s=require(`../../types/admin.types.cjs`),c=require(`../../types/transact.types.cjs`);require(`../../error-handling/index.cjs`);const l=require(`../../functions/pre-transaction/constructAdminData.cjs`),u=require(`../AccountActions/AccountActions.cjs`),d=require(`../../functions/pre-transaction/getFeeStructure.cjs`);require(`../../functions/pre-transaction/index.cjs`);const f=require(`../../functions/private-wallet/emporium.helpers.cjs`),p=require(`./hinkalTransact.cjs`),m=require(`../../functions/utils/involves-permit2-op.cjs`),h=require(`../../functions/utils/convertEmporiumOpToCallInfo.cjs`),g=require(`../../functions/pre-transaction/merge-with-fee-structure.cjs`),_=require(`../../functions/pre-transaction/merge-with-fee-structure-emporium.cjs`),v=require(`./handleAutoDepositBack.cjs`);var y=async(y,b,x,S,C,w,T,E,D,O,k,A=!1,j,M,N)=>{if(N&&!a.isValidPrivateAddress(N.recipientInfo))throw Error(r.transactionErrorCodes.RECIPIENT_FORMAT_INCORRECT);if(T.length>0&&!E)throw Error(`Subaccount is required for private wallet transactions`);let P=x.map(e=>e.erc20TokenAddress),F=await y.getEthereumAddress(),I=E?u.AccountActions.getAddressFromSubAccount(b,E):void 0,{contractData:L}=e.networkRegistry[b],{emporiumAddress:R}=L;if(!R)throw Error(`No Emporium Address Provided`);let z=O??await d.getFeeStructure(b,D,P,o.ExternalActionId.Emporium,w.map(e=>h.convertEmporiumOpToCallInfo(e,I??``,b)));for(I?await _.mergeWithFeeStructureEmporium(y,b,I,w,P,S,z,T.find(e=>t.caseInsensitiveEqual(e.token.erc20TokenAddress,z.feeToken))?.amount??0n):await g.mergeWithFeeStructure(b,P,S,z);C.length<P.length;)C.push(!1);let B=k??await y.getRandomRelay(b,!0);if(!B)throw Error(r.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let V=E?u.AccountActions.getPrivateKeyFromSubAccount(b,E):void 0,H=e.getOnchainChainId(b),U=V?u.AccountActions.getSignerAddressFromPrivateKey(H,V):void 0,W=i.randomBigInt(31),G=y.generateProofRemotely?await f.encodeEmporiumMetadata(b,R,V,w,n.poseidonFunction(W),U,z.flatFee):void 0,K=await f.getAuthorizationDataIfNeeded(b,V),q=m.uniswapWorkaround(w),J=l.constructAdminData(M,b,T.map(e=>e.token.erc20TokenAddress),T.map(e=>e.amount),F,M===s.AdminTransactionType.PublicSwap?T.map(({token:e})=>e):void 0),Y,X=await p.hinkalTransact(y,{chainId:b,erc20Addresses:P,amountChanges:S,externalAddress:R,externalActionId:o.ExternalActionId.Emporium,externalActionMetadata:G,onChainCreation:C,feeStructure:z,relay:B,messageSeed:W,recipientAddress:N?[N.recipientInfo]:void 0,recipientAmounts:N?[P.map(e=>t.caseInsensitiveEqual(e,N.token.erc20TokenAddress)?N.amount:0n)]:void 0,subAccountPrivateKey:V,emporiumOps:w,onTxSubmitLocally:e=>{Y=e},submit:{mode:c.SubmitMode.Relayer,adminData:J,authorizationData:K,withUniswapWorkAround:q}});return A&&E&&v.handleAutoDepositBack(y,b,I,E,z.feeToken,j,T,Y),X};exports.hinkalPrivateWallet=y;
@@ -0,0 +1,6 @@
1
+ import { IHinkal } from './IHinkal';
2
+ import { FeeStructure } from '../../types/hinkal.types';
3
+ import { ERC20Token, PrivateRecipientInfo, TokenChanges } from '../../types/token.types';
4
+ import { SubAccount } from '../../types/proxy.types';
5
+ import { AdminTransactionType } from '../../types/admin.types';
6
+ export declare const hinkalPrivateWallet: (hinkal: IHinkal, chainId: number, erc20Tokens: ERC20Token[], deltaChanges: bigint[], onChainCreation: boolean[], ops: string[], emporiumTokenChanges: TokenChanges<bigint>[], subAccount?: SubAccount, feeToken?: string, feeStructureOverride?: FeeStructure, relayOverride?: string, autoDepositBack?: boolean, maxGasInDollar?: string, action?: AdminTransactionType, privateRecipientInfo?: PrivateRecipientInfo) => Promise<string>;
@@ -1,48 +1,60 @@
1
- import { networkRegistry as e } from "../../constants/chains.constants.mjs";
2
- import { caseInsensitiveEqual as t } from "../../functions/utils/caseInsensitive.utils.mjs";
3
- import { transactionErrorCodes as n } from "../../error-handling/error-codes.constants.mjs";
4
- import { getCurrentTimeInSeconds as r } from "../../functions/utils/time.utils.mjs";
5
- import { ExternalActionId as i } from "../../types/external-action.types.mjs";
6
- import { AdminTransactionType as a } from "../../types/admin.types.mjs";
1
+ import { getOnchainChainId as e, networkRegistry as t } from "../../constants/chains.constants.mjs";
2
+ import { caseInsensitiveEqual as n } from "../../functions/utils/caseInsensitive.utils.mjs";
3
+ import { poseidonFunction as r } from "../../crypto/poseidon.mjs";
4
+ import { transactionErrorCodes as i } from "../../error-handling/error-codes.constants.mjs";
5
+ import { randomBigInt as a } from "../../functions/web3/etherFunctions.mjs";
7
6
  import { isValidPrivateAddress as o } from "../../functions/utils/addresses.mjs";
8
- import { addPaddingToUtxos as s } from "../../functions/web3/events/getShieldedBalance.mjs";
9
- import { outputUtxoProcessing as c } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
7
+ import { ExternalActionId as s } from "../../types/external-action.types.mjs";
8
+ import { AdminTransactionType as c } from "../../types/admin.types.mjs";
9
+ import { SubmitMode as l } from "../../types/transact.types.mjs";
10
10
  import "../../error-handling/index.mjs";
11
- import { constructAdminData as l } from "../../functions/pre-transaction/constructAdminData.mjs";
12
- import { AccountActions as u } from "../AccountActions/AccountActions.mjs";
13
- import { recipientUtxoProcessing as d } from "../../functions/pre-transaction/recipientUtxoProcessing.mjs";
11
+ import { constructAdminData as u } from "../../functions/pre-transaction/constructAdminData.mjs";
12
+ import { AccountActions as d } from "../AccountActions/AccountActions.mjs";
14
13
  import { getFeeStructure as f } from "../../functions/pre-transaction/getFeeStructure.mjs";
15
14
  import "../../functions/pre-transaction/index.mjs";
16
- import { uniswapWorkaround as p } from "../../functions/utils/involves-permit2-op.mjs";
17
- import { convertEmporiumOpToCallInfo as m } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
18
- import { getAuthorizationDataIfNeeded as h } from "../../functions/private-wallet/emporium.helpers.mjs";
19
- import { constructZkProof as g } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
20
- import { transactCallRelayer as _ } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
15
+ import { encodeEmporiumMetadata as p, getAuthorizationDataIfNeeded as m } from "../../functions/private-wallet/emporium.helpers.mjs";
16
+ import { hinkalTransact as h } from "./hinkalTransact.mjs";
17
+ import { uniswapWorkaround as g } from "../../functions/utils/involves-permit2-op.mjs";
18
+ import { convertEmporiumOpToCallInfo as _ } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
21
19
  import { mergeWithFeeStructure as v } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
22
20
  import { mergeWithFeeStructureEmporium as y } from "../../functions/pre-transaction/merge-with-fee-structure-emporium.mjs";
23
21
  import { handleAutoDepositBack as b } from "./handleAutoDepositBack.mjs";
24
22
  //#region libs/shared/common/src/data-structures/Hinkal/hinkalPrivateWallet.ts
25
- var x = async (e, t, n, i, a) => {
26
- let o = [...await s(e, t, n, i)], l = [], u = r().toString();
27
- for (let t = 0; t < n.length; t += 1) {
28
- let { outputUtxos: n } = c(e.userKeys, o[t], i[t], u);
29
- l.push(n);
30
- }
31
- return a && d(a, l, i, u), {
32
- inputUtxosArray: o,
33
- outputUtxosArray: l
34
- };
35
- }, S = async (r, s, c, d, S, C, w, T, E, D, O, k = !1, A, j, M) => {
36
- if (M && !o(M.recipientInfo)) throw Error(n.RECIPIENT_FORMAT_INCORRECT);
37
- if (w.length > 0 && !T) throw Error("Subaccount is required for private wallet transactions");
38
- let N = c.map((e) => e.erc20TokenAddress), P = await r.getEthereumAddressByChain(s), F = T ? u.getAddressFromSubAccount(s, T) : void 0, { contractData: I } = e[s], { emporiumAddress: L } = I;
39
- if (!L) throw Error("No Emporium Address Provided");
40
- let R = D ?? await f(s, E, N, i.Emporium, C.map((e) => m(e, F ?? "", s)));
41
- for (F ? await y(r, s, F, C, N, d, R, w.find((e) => t(e.token.erc20TokenAddress, R.feeToken))?.amount ?? 0n) : await v(s, N, d, R); S.length < N.length;) S.push(!1);
42
- let [{ inputUtxosArray: z, outputUtxosArray: B }, V] = await Promise.all([x(r, s, N, d, M), O ?? await r.getRandomRelay(s, !0)]);
43
- if (!V) throw Error(n.RELAYER_NOT_AVAILABLE);
44
- let H = T ? u.getPrivateKeyFromSubAccount(s, T) : void 0, [{ zkCallData: U, circomData: W, dimData: G, commitmentValidationData: K }, q] = await Promise.all([g(r.merkleTreeHinkalByChain[s], z, B, r.userKeys, i.Emporium, L, C, r.generateProofRemotely, R, V, s, S, void 0, void 0, H), h(s, H)]), J = await _(s, U, G, W, K, p(C), q, l(j, s, w.map((e) => e.token.erc20TokenAddress), w.map((e) => e.amount), P, j === a.PublicSwap ? w.map(({ token: e }) => e) : void 0));
45
- return k && T && b(r, s, F, T, R.feeToken, A, w, W), J;
23
+ var x = async (x, S, C, w, T, E, D, O, k, A, j, M = !1, N, P, F) => {
24
+ if (F && !o(F.recipientInfo)) throw Error(i.RECIPIENT_FORMAT_INCORRECT);
25
+ if (D.length > 0 && !O) throw Error("Subaccount is required for private wallet transactions");
26
+ let I = C.map((e) => e.erc20TokenAddress), L = await x.getEthereumAddress(), R = O ? d.getAddressFromSubAccount(S, O) : void 0, { contractData: z } = t[S], { emporiumAddress: B } = z;
27
+ if (!B) throw Error("No Emporium Address Provided");
28
+ let V = A ?? await f(S, k, I, s.Emporium, E.map((e) => _(e, R ?? "", S)));
29
+ for (R ? await y(x, S, R, E, I, w, V, D.find((e) => n(e.token.erc20TokenAddress, V.feeToken))?.amount ?? 0n) : await v(S, I, w, V); T.length < I.length;) T.push(!1);
30
+ let H = j ?? await x.getRandomRelay(S, !0);
31
+ if (!H) throw Error(i.RELAYER_NOT_AVAILABLE);
32
+ let U = O ? d.getPrivateKeyFromSubAccount(S, O) : void 0, W = e(S), G = U ? d.getSignerAddressFromPrivateKey(W, U) : void 0, K = a(31), q = x.generateProofRemotely ? await p(S, B, U, E, r(K), G, V.flatFee) : void 0, J = await m(S, U), Y = g(E), X = u(P, S, D.map((e) => e.token.erc20TokenAddress), D.map((e) => e.amount), L, P === c.PublicSwap ? D.map(({ token: e }) => e) : void 0), Z, Q = await h(x, {
33
+ chainId: S,
34
+ erc20Addresses: I,
35
+ amountChanges: w,
36
+ externalAddress: B,
37
+ externalActionId: s.Emporium,
38
+ externalActionMetadata: q,
39
+ onChainCreation: T,
40
+ feeStructure: V,
41
+ relay: H,
42
+ messageSeed: K,
43
+ recipientAddress: F ? [F.recipientInfo] : void 0,
44
+ recipientAmounts: F ? [I.map((e) => n(e, F.token.erc20TokenAddress) ? F.amount : 0n)] : void 0,
45
+ subAccountPrivateKey: U,
46
+ emporiumOps: E,
47
+ onTxSubmitLocally: (e) => {
48
+ Z = e;
49
+ },
50
+ submit: {
51
+ mode: l.Relayer,
52
+ adminData: X,
53
+ authorizationData: J,
54
+ withUniswapWorkAround: Y
55
+ }
56
+ });
57
+ return M && O && b(x, S, R, O, V.feeToken, N, D, Z), Q;
46
58
  };
47
59
  //#endregion
48
- export { S as hinkalPrivateWallet };
60
+ export { x as hinkalPrivateWallet };
@@ -1 +1 @@
1
- const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../functions/utils/caseInsensitive.utils.cjs`),r=require(`../../types/ethereum-network.types.cjs`),i=require(`../../error-handling/logger.cjs`),a=require(`../../functions/utils/tron.utils.cjs`),o=require(`../../functions/utils/token-check.utils.cjs`),s=require(`../../functions/pre-transaction/constructAdminData.cjs`),c=require(`../../functions/utils/getRecipientInfoFromUserKeys.cjs`),l=require(`../../functions/utils/getContractAddress.cjs`),u=require(`../../functions/utils/tronSimulation.utils.cjs`),d=require(`../../functions/web3/functionCalls/constructBatchCall.cjs`),f=require(`../../functions/web3/functionCalls/waitForErc20Approvals.cjs`),p=require(`../../API/admin-calls.cjs`),m=require(`./hinkalProoflessDeposit.utils.cjs`),h=require(`./hinkalProoflessDepositViaWrapper.cjs`);var g=async(n,r,o,s,c,l=!1)=>{let d=n.getTronWeb(),{hinkalAddress:p}=e.networkRegistry[r].contractData,h=a.evmHexToTronBase58Address(p),g=await n.getEthereumAddressByChain(r),_=o.map(e=>e.erc20TokenAddress),v=o.map(()=>0n),{totalTrxValue:y,tokensNeedingApproval:b}=a.splitTronTokensByNative(o,s),x=c.map(e=>({extraRandomization:e.extraRandomization.toString(),stealthAddress:e.stealthAddress.toString(),H0:e.H0.toString(),H1:e.H1.toString()}));if(y>0n){let{hinkalABI:t}=e.networkRegistry[r].contractData;if(!t)throw Error(`Hinkal ABI not found`);await a.assertTronSufficientBalance(d,r,h,g,a.createTronCallData(t,`prooflessDeposit`,[_,s.map(String),v.map(String),c.map(e=>[e.extraRandomization.toString(),e.stealthAddress.toString(),e.H0.toString(),e.H1.toString()])]),y)}let{transaction:S}=await d.transactionBuilder.triggerSmartContract(h,`prooflessDeposit(address[],uint256[],uint256[],(uint256,uint256,uint256,uint256)[])`,{feeLimit:t.TRON_DEFAULT_FEE_LIMIT_SUN,callValue:y>0n?Number(y):0},[{type:`address[]`,value:_},{type:`uint256[]`,value:s.map(String)},{type:`uint256[]`,value:v.map(String)},{type:`tuple(uint256,uint256,uint256,uint256)[]`,value:x.map(e=>[e.extraRandomization,e.stealthAddress,e.H0,e.H1])}],g);if(l)return S;await m.approveTronTokens(d,g,h,b),await f.waitForTronErc20Approvals(d,g,h,Array.from(b.entries()).map(([e,t])=>({tokenAddress:e,requiredAmount:t}))),await u.simulateTronTransaction(r,h,`prooflessDeposit`,e.networkRegistry[r].contractData.hinkalABI,[_,s.map(String),v.map(String),c.map(e=>[e.extraRandomization.toString(),e.stealthAddress.toString(),e.H0.toString(),e.H1.toString()])],g,y>0n?y:void 0);let C=await d.trx.sign(S),w=await d.trx.sendRawTransaction(C);if(!w.result)throw i.Logger.error(`Tron prooflessDeposit broadcast failed`,w),Error(`Tron prooflessDeposit broadcast failed`);let T=typeof w==`string`?w:w?.txid??w?.transaction?.txID;if(!T)throw Error(`Tron prooflessDeposit failed (missing txid)`);return T},_=async(i,a,u,h,_,v=!1)=>{let y=o.validateAndGetChainId(a),b=e.isTronLike(y),x=await i.getEthereumAddressByChain(y),S=h??a.map(()=>c.getStealthAddressStructureFromUserKeys(i.userKeys));if(S.length!==a.length)throw Error(`Stealth address structures length must be equal to erc20 tokens length`);m.assertNoDuplicateStealthAddressStructures(S);let C;if(b){let e=await g(i,y,a,u,S,v);if(v)return e;C=e}else{let e=i.getContractWithSigner(y,r.ContractType.HinkalContract),o=[a.map(({erc20TokenAddress:e})=>e),u,a.map(()=>0n),S];if(v)return e.prooflessDeposit.populateTransaction(...o);let s=i.getProviderAdapter(y),c=m.aggregateAmountsForApproval(a,u),p=a.reduce((e,r,i)=>n.caseInsensitiveEqual(r.erc20TokenAddress,t.zeroAddress)?e+u[i]:e,0n),h=c.filter(({token:e,balance:r})=>!n.caseInsensitiveEqual(e.erc20TokenAddress,t.zeroAddress)&&r>0n),g;if(h.length>0&&await s.supportsBatchCall?.(y)&&s.sendBatchCallsTransaction){let t=d.buildApproveAndProoflessDepositCalls(h.map(({token:e})=>e.erc20TokenAddress),h.map(({balance:e})=>e),l.getContractAddress(e),e,...o,p);g=await s.sendBatchCallsTransaction(y,t)}else{await m.approveTokens(i,y,l.getContractAddress(e),c);let t=await i.getEthereumAddressByChain(y),n=c.map(({token:e,balance:t})=>({tokenAddress:e.erc20TokenAddress,requiredAmount:t}));await f.waitForErc20Approvals(i,y,t,l.getContractAddress(e),n),g=await e.prooflessDeposit(...o,{value:p>0n?p:void 0})}C=g.hash}return p.emitTxPublicData(s.constructAdminData(_,y,a.map(({erc20TokenAddress:e})=>e),u,x)),C},v=async(t,n,r,i,a,o,s)=>{let c=i.map(()=>r),l=r.erc20TokenAddress;return e.isTronLike(n)?h.hinkalTronProoflessDepositViaWrapper(t,n,l,o,c,i,a,s):e.networkRegistry[n]?.contractData?.hinkalWrapperAddress?h.hinkalEvmProoflessDepositViaWrapper(t,n,l,o,c,i,a,s):await _(t,c,i,a,s,!0)};exports.hinkalProoflessDeposit=_,exports.hinkalProoflessDepositWithPublicFee=v;
1
+ const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../types/hinkal.types.cjs`),r=require(`../../functions/utils/caseInsensitive.utils.cjs`),i=require(`../../types/ethereum-network.types.cjs`),a=require(`../../functions/utils/token-check.utils.cjs`),o=require(`../../functions/pre-transaction/constructAdminData.cjs`),s=require(`../../functions/utils/getContractAddress.cjs`),c=require(`../../functions/web3/functionCalls/constructBatchCall.cjs`),l=require(`../../functions/web3/functionCalls/waitForErc20Approvals.cjs`),u=require(`../../API/admin-calls.cjs`),d=require(`../../functions/utils/getRecipientInfoFromUserKeys.cjs`),f=require(`./hinkalProoflessDeposit.utils.cjs`);var p=async(p,m,h,g,_,v=!1,y=n.zeroProoflessFeeStructure,b=``,x,S=!1)=>{let C=a.validateAndGetChainId(m);if(e.isTronLike(C))throw Error(`Proofless deposit is not supported on Tron`);let w=await p.getEthereumAddressByChain(C),T=g??m.map(()=>d.getStealthAddressStructureFromUserKeys(p.userKeys));if(T.length!==m.length)throw Error(`Stealth address structures length must be equal to erc20 tokens length`);if(f.assertNoDuplicateStealthAddressStructures(T),g&&!_)throw Error(`recipientEncryptionKeysOverride is required whenever stealthAddressStructuresOverride is provided`);if(_&&_.length!==m.length)throw Error(`recipientEncryptionKeysOverride length must be equal to erc20 tokens length`);let E=f.buildProoflessEncryptedOutputs(T,_??f.getOwnRecipientEncryptionKeys(p.userKeys,m.length)),D=y.feeAmount>0n,O=D?p.getContractWithSigner(C,i.ContractType.HinkalWrapperContract):p.getContractWithSigner(C,i.ContractType.HinkalContract),k=D?[m.map(({erc20TokenAddress:e})=>e),h,T,E,v,y,b]:[m.map(({erc20TokenAddress:e})=>e),h,T,E,v,b],A=r.caseInsensitiveEqual(y.feeToken,t.zeroAddress),j=m.reduce((e,n,i)=>r.caseInsensitiveEqual(n.erc20TokenAddress,t.zeroAddress)?e+h[i]:e,0n)+(A?y.feeAmount:0n);if(S)return O.prooflessDeposit.populateTransaction(...k,{value:j>0n?j:void 0});let M=p.getProviderAdapter(C),N=f.aggregateAmountsForApproval(!A&&y.feeAmount>0n?[...m,{erc20TokenAddress:y.feeToken,chainId:C}]:m,!A&&y.feeAmount>0n?[...h,y.feeAmount]:h),P=N.filter(({token:e,balance:n})=>!r.caseInsensitiveEqual(e.erc20TokenAddress,t.zeroAddress)&&n>0n),F;if(P.length>0&&await M.supportsBatchCall?.(C)&&M.sendBatchCallsTransaction){let e=c.buildApproveAndProoflessDepositCalls(P.map(({token:e})=>e.erc20TokenAddress),P.map(({balance:e})=>e),s.getContractAddress(O),O,m.map(({erc20TokenAddress:e})=>e),h,T,E,v,D?y:void 0,b,j);F=await M.sendBatchCallsTransaction(C,e)}else{await f.approveTokens(p,C,s.getContractAddress(O),N);let e=await p.getEthereumAddressByChain(C),t=N.map(({token:e,balance:t})=>({tokenAddress:e.erc20TokenAddress,requiredAmount:t}));await l.waitForErc20Approvals(p,C,e,s.getContractAddress(O),t),F=await O.prooflessDeposit(...k,{value:j>0n?j:void 0})}let I=F.hash;return u.emitTxPublicData(o.constructAdminData(x,C,m.map(({erc20TokenAddress:e})=>e),h,w)),I};exports.hinkalProoflessDeposit=p;
@@ -0,0 +1,7 @@
1
+ import { ethers } from 'ethers';
2
+ import { ERC20Token } from '../../types/token.types';
3
+ import { IHinkal } from './IHinkal';
4
+ import { StealthAddressStructure } from '../../types/circom-data.types';
5
+ import { ProoflessFeeStructure } from '../../types/hinkal.types';
6
+ import { AdminTransactionType } from '../../types/admin.types';
7
+ export declare const hinkalProoflessDeposit: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], stealthAddressStructuresOverride?: StealthAddressStructure[], recipientEncryptionKeysOverride?: string[], createBlockedUtxos?: boolean, feeStructure?: ProoflessFeeStructure, orderId?: string, action?: AdminTransactionType, returnTxData?: boolean) => Promise<string | ethers.TransactionRequest>;