@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
@@ -1,121 +1,52 @@
1
- import { isTronLike as e, networkRegistry as t } from "../../constants/chains.constants.mjs";
2
- import { TRON_DEFAULT_FEE_LIMIT_SUN as n, zeroAddress as r } from "../../constants/protocol.constants.mjs";
3
- import { zeroFeeStructure as i } from "../../types/hinkal.types.mjs";
4
- import { transactionErrorCodes as a } from "../../error-handling/error-codes.constants.mjs";
5
- import { getCurrentTimeInSeconds as o } from "../../functions/utils/time.utils.mjs";
6
- import { Utxo as s } from "../utxo/Utxo.mjs";
7
- import { isValidPrivateAddress as c } from "../../functions/utils/addresses.mjs";
8
- import { addressToHexFormat as l, approveTronTokens as u, assertTronSufficientBalance as d, circomDataToArray as f, createTronCallData as p, evmHexToTronBase58Address as m, parseZkCalldata as h, reorderZkCallData as g, splitTronTokensByNative as _ } from "../../functions/utils/tron.utils.mjs";
9
- import { validateAndGetChainId as v } from "../../functions/utils/token-check.utils.mjs";
10
- import { addPaddingToUtxos as y } from "../../functions/web3/events/getShieldedBalance.mjs";
11
- import { outputUtxoProcessing as b } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
12
- import { constructAdminData as x } from "../../functions/pre-transaction/constructAdminData.mjs";
13
- import { simulateTronTransaction as S } from "../../functions/utils/tronSimulation.utils.mjs";
14
- import { constructZkProof as C } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
15
- import { waitForTronErc20Approvals as w } from "../../functions/web3/functionCalls/waitForErc20Approvals.mjs";
16
- import { transactCallDirect as T } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
17
- import { emitTxPublicData as E } from "../../API/admin-calls.mjs";
1
+ import { transactionErrorCodes as e } from "../../error-handling/error-codes.constants.mjs";
2
+ import { addressToHexFormat as t } from "../../functions/utils/tron.utils.mjs";
3
+ import { isValidPrivateAddress as n } from "../../functions/utils/addresses.mjs";
4
+ import { SubmitMode as r } from "../../types/transact.types.mjs";
5
+ import { validateAndGetChainId as i } from "../../functions/utils/token-check.utils.mjs";
6
+ import { constructAdminData as a } from "../../functions/pre-transaction/constructAdminData.mjs";
7
+ import { hinkalTransact as o } from "./hinkalTransact.mjs";
8
+ import { emitTxPublicData as s } from "../../API/admin-calls.mjs";
18
9
  //#region libs/shared/common/src/data-structures/Hinkal/hinkalDeposit.ts
19
- var D = async (e, t) => ({
20
- externalActionData: {
21
- externalActionId: 0n,
22
- externalAddress: l(await e.getEthereumAddressByChain(t)),
23
- externalActionMetadata: "0x00"
24
- },
25
- contractTransaction: void 0,
26
- contractToApprove: void 0
27
- }), O = async (e, t, n, r) => {
28
- let i = [...await y(e, t, n, r)], a = [], s = o().toString();
29
- for (let t = 0; t < n.length; t += 1) {
30
- let { outputUtxos: n } = b(e.userKeys, i[t], r[t], s);
31
- a.push(n);
32
- }
33
- return {
34
- inputUtxosArray: i,
35
- outputUtxosArray: a
36
- };
37
- }, k = async (e, r, i, a, o, s, c, l = !0, v = !1) => {
38
- let y = e.getTronWeb(), { hinkalAddress: b, hinkalABI: x } = t[r].contractData;
39
- if (!x) throw Error("Hinkal ABI not found");
40
- let C = m(b), T = await e.getEthereumAddressByChain(r), { totalTrxValue: E, tokensNeedingApproval: D } = _(i, a), { a: O, b: k, c: A } = h(o), j = await g(!0, o, c, s, !1);
41
- if (!j) throw Error("Tron proof signature not found");
42
- let M = [
43
- j.v,
44
- j.r,
45
- j.s
46
- ], N = [
47
- c.tokenNumber,
48
- c.nullifierAmount,
49
- c.outputAmount
50
- ], P = f(s), F = E > 0n ? Number(E) : 0;
51
- if (v) {
52
- let e = p(x, "transact", [
53
- M,
54
- O,
55
- k,
56
- A,
57
- N,
58
- P
59
- ]), { transaction: t } = await y.transactionBuilder.triggerSmartContract(C, "", {
60
- feeLimit: n,
61
- callValue: F,
62
- input: e
63
- }, [], T);
64
- return t;
65
- }
66
- await u(y, T, C, D), D.size > 0 && await w(y, T, C, Array.from(D.entries()).map(([e, t]) => ({
67
- tokenAddress: e,
68
- requiredAmount: t
69
- }))), l && (await S(r, C, "transact", x, [
70
- M,
71
- O,
72
- k,
73
- A,
74
- N,
75
- P
76
- ], T, E > 0n ? E : void 0), await d(y, r, C, T, p(x, "transact", [
77
- M,
78
- O,
79
- k,
80
- A,
81
- N,
82
- P
83
- ]), E));
84
- let I = await y.contract(x, C).transact(M, O, k, A, N, P).send({
85
- feeLimit: n,
86
- callValue: F
87
- }), L = typeof I == "string" ? I : I?.txid ?? I?.transaction?.txID;
88
- if (!L) throw Error("Tron deposit failed (missing txid)");
89
- return L;
90
- }, A = async (t, n, a, o = !0, s = !1) => {
91
- let c = v(n), l = e(c), u = n.map((e) => e.erc20TokenAddress), [{ externalActionData: d, contractTransaction: f, contractToApprove: p }, { inputUtxosArray: m, outputUtxosArray: h }] = await Promise.all([D(t, c), O(t, c, u, a)]), { zkCallData: g, circomData: _, dimData: y } = await C(t.merkleTreeHinkalByChain[c], m, h, t.userKeys, d.externalActionId, d.externalAddress, d.externalActionMetadata, t.generateProofRemotely, i, r, c);
92
- return l ? await k(t, c, n, a, g, _, y, o, s) : await T(t, c, a, n, g, _, y, p, f, o, s);
93
- }, j = async (t, n, o, l, u = !0, d = !1, f) => {
94
- let p = v(n), m = e(p), h = n.map((e) => e.erc20TokenAddress), [g, _, y, , b] = l.split(",");
95
- if (!c(l)) throw Error(a.RECIPIENT_FORMAT_INCORRECT);
96
- let S = h.map((e) => [new s({
97
- amount: 0n,
98
- erc20TokenAddress: e,
99
- nullifyingKey: t.userKeys.getShieldedPrivateKey(),
100
- spendingPublicKey: t.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,
101
- isNewStyle: !0
102
- }), new s({
103
- amount: 0n,
104
- erc20TokenAddress: e,
105
- nullifyingKey: t.userKeys.getShieldedPrivateKey(),
106
- spendingPublicKey: t.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,
107
- isNewStyle: !0
108
- })]), w = h.map((e, t) => [new s({
109
- amount: o[t],
110
- erc20TokenAddress: e,
111
- H0: [BigInt(_), BigInt(y)],
112
- stealthAddress: g,
113
- encryptionKey: b,
114
- isNewStyle: !0
115
- })]), { externalActionData: O, contractTransaction: A, contractToApprove: j } = await D(t, p), { zkCallData: M, circomData: N, dimData: P } = await C(t.merkleTreeHinkalByChain[p], S, w, t.userKeys, O.externalActionId, O.externalAddress, O.externalActionMetadata, t.generateProofRemotely, i, r, p);
116
- if (m) return await k(t, p, n, o, M, N, P, u, d);
117
- let F = await T(t, p, o, n, M, N, P, j, A, u, d);
118
- return E(x(f, p, h, o, await t.getEthereumAddress())), F;
119
- };
10
+ var c = async (e, n, a, s = !0, c = !1) => {
11
+ let l = i(n);
12
+ return o(e, {
13
+ chainId: l,
14
+ erc20Addresses: n.map((e) => e.erc20TokenAddress),
15
+ amountChanges: a,
16
+ externalAddress: t(await e.getEthereumAddressByChain(l)),
17
+ submit: {
18
+ mode: r.Self,
19
+ erc20Tokens: n,
20
+ approvalAmounts: a,
21
+ preEstimateGas: s,
22
+ returnTxData: c
23
+ }
24
+ });
25
+ }, l = async (c, l, u, d, f = !0, p = !1, m) => {
26
+ if (d.length === 0) throw Error("recipientInfos must not be empty");
27
+ if (u.length !== d.length) throw Error("amountsByRecipient must have one entry per recipientInfo");
28
+ let h = i(l), g = l.map((e) => e.erc20TokenAddress);
29
+ d.forEach((t, r) => {
30
+ if (!n(t)) throw Error(e.RECIPIENT_FORMAT_INCORRECT);
31
+ if (u[r].length !== g.length) throw Error("Each amountsByRecipient entry must have one amount per erc20Token");
32
+ });
33
+ let _ = g.map((e, t) => u.reduce((e, n) => e + n[t], 0n)), v = t(await c.getEthereumAddressByChain(h)), y = await o(c, {
34
+ chainId: h,
35
+ erc20Addresses: g,
36
+ amountChanges: _.map(() => 0n),
37
+ externalAddress: v,
38
+ recipientAddress: d,
39
+ recipientAmounts: u,
40
+ forceEmptyUtxos: !0,
41
+ submit: {
42
+ mode: r.Self,
43
+ erc20Tokens: l,
44
+ approvalAmounts: _,
45
+ preEstimateGas: f,
46
+ returnTxData: p
47
+ }
48
+ });
49
+ return s(a(m, h, g, _, await c.getEthereumAddress())), y;
50
+ }, u = async (e, t, n, r, i = !0, a = !1, o) => l(e, t, [n], [r], i, a, o);
120
51
  //#endregion
121
- export { A as hinkalDeposit, j as hinkalDepositForOther };
52
+ export { c as hinkalDeposit, u as hinkalDepositForOther };
@@ -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(`../../error-handling/error-codes.constants.cjs`),i=require(`../../functions/utils/time.utils.cjs`),a=require(`../utxo/Utxo.cjs`),o=require(`../../types/external-action.types.cjs`),s=require(`../../types/scheduled-transactions.types.cjs`);require(`../../types/index.cjs`);const c=require(`../../functions/utils/addresses.cjs`),l=require(`../../API/API.cjs`),u=require(`../../functions/utils/token-check.utils.cjs`),d=require(`../../functions/utils/erc20tokenFunctions.cjs`),f=require(`../../functions/pre-transaction/constructAdminData.cjs`),p=require(`../../functions/pre-transaction/getFeeStructure.cjs`),m=require(`../../functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs`),h=require(`../../constants/addresses.constants.cjs`),g=require(`../../functions/utils/convertEmporiumOpToCallInfo.cjs`),_=require(`../../functions/utils/fees.utils.cjs`);require(`../../functions/utils/index.cjs`);const v=require(`../../functions/private-wallet/emporium.helpers.cjs`),y=require(`../../functions/snarkjs/constructGeneralZkProof.cjs`),b=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),x=require(`../../API/deposit-and-withdraw-status-calls.cjs`),S=require(`./hinkalDepositOnChainUtxos.cjs`);require(`../../functions/index.cjs`);var C=async(c,u,d,p,m,g,S,C,w,T,E)=>{if(p.length===0)throw Error(`No recipients to bridge`);let D=d.erc20TokenAddress,{contractData:O}=e.networkRegistry[u],{emporiumAddress:k}=O;if(!k)throw Error(`No Emporium Address`);let A=h.SWAP_ROUTER_ADDRESSES[o.ExternalActionId.Lifi][u];if(!A)throw Error(`LIFI not configured for chain ${u}`);let j=await c.getRandomRelay(u);if(!j)throw Error(r.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let M=await c.getEthereumAddressByChain(u),N=i.getCurrentTimeInSeconds().toString(),P=c.generateProofRemotely?5:1,F=[];for(let e=0;e<p.length;e+=P){let r=p.slice(e,e+P),i=await Promise.all(r.map(async({utxo:e,nativeUtxo:r,bridgeAmount:i,quote:s,temporarySubAccount:p,recipientAddress:h})=>{await l.API.addTemporaryWalletNonce(u,g,p.index);let b=s.nativeFee>0n&&!n.caseInsensitiveEqual(D,t.zeroAddress),x=[D],S=[-e.amount],C=[!1],w=new a.Utxo({amount:0n,erc20TokenAddress:D,nullifyingKey:c.userKeys.getShieldedPrivateKey(),timeStamp:N,...e.isNewStyle?{spendingPublicKey:c.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,isNewStyle:!0}:{isNewStyle:!1}}),E=[[e,w]],O=[[w]];if(b&&r){let e=new a.Utxo({amount:0n,erc20TokenAddress:t.zeroAddress,nullifyingKey:c.userKeys.getShieldedPrivateKey(),timeStamp:N,...r.isNewStyle?{spendingPublicKey:c.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,isNewStyle:!0}:{isNewStyle:!1}});x.push(t.zeroAddress),S.push(-r.amount),C.push(!1),E.push([r,e]),O.push([e])}let P=v.createLifiBridgeOps(c,u,p.ethAddress,A,D,e.amount,i,s),F=await _.calculateModifiedFeeStructure(u,d,i,m),I=f.constructAdminData(T,u,x,[-e.amount],M),[{zkCallData:L,circomData:R,dimData:z,commitmentValidationData:B},V]=await Promise.all([y.constructZkProof(c.merkleTreeHinkalByChain[u],E,O,c.userKeys,o.ExternalActionId.Emporium,k,P,c.generateProofRemotely,F,j??t.zeroAddress,u,C,void 0,void 0,p.privateKey),v.getAuthorizationDataIfNeeded(u,p.privateKey)]);return{zkCallData:L,dimData:z,circomData:R,commitmentValidationData:B,authorizationData:V,recipientAddress:h,adminData:I}}));F.push(...i)}await x.safeUpdateDepositAndWithdrawStatus({id:S,chainId:u,hashedEthereumAddress:g,phase:s.DepositAndWithdrawPhase.BEFORE_SCHEDULE_WITHDRAW});let I=await b.transactCallRelayerBatch(u,F,g,C,w,E);return await x.safeUpdateDepositAndWithdrawStatus({id:S,chainId:u,hashedEthereumAddress:g,phase:s.DepositAndWithdrawPhase.AFTER_SCHEDULE_WITHDRAW,scheduleId:I}),I},w=async(e,r,i,a,s,l,f,_,y=!0)=>{let b=r.erc20TokenAddress,x=u.validateAndGetChainId([r]),w=_?c.hashString(_):void 0,T=c.hashEthereumAddress(await e.getEthereumAddressByChain(x)),E=h.SWAP_ROUTER_ADDRESSES[o.ExternalActionId.Lifi][x];if(!E)throw Error(`LIFI router not configured`);let D;if(s)D=s;else{let n=i[0],r=v.createLifiBridgeOps(e,x,n.temporarySubAccount.ethAddress,E,b,n.bridgeAmount,n.bridgeAmount,n.quote).map(e=>g.convertEmporiumOpToCallInfo(e,n.temporarySubAccount.ethAddress,x));D=await p.getFeeStructure(x,b,[b],o.ExternalActionId.Emporium,r,t.PAY_SEND_VARIABLE_RATE)}let O={feeToken:D.feeToken,flatFee:0n,variableRate:0n},k=i.reduce((e,t)=>e+t.quote.nativeFee,0n)>0n&&!n.caseInsensitiveEqual(b,t.zeroAddress),A=i.map(e=>e.bridgeAmount),j=i.map(e=>e.recipientAddress),{userDepositedUtxos:M,statusId:N,depositTxHash:P}=await S.hinkalDepositOnChainUtxos(e,x,r,A,j,D,T,y),F=[];if(k){let n=await d.getErc20TokenFromAPI(x,t.zeroAddress);if(!n)throw Error(`No native token`);let{userDepositedUtxos:r}=await S.hinkalDepositOnChainUtxos(e,x,n,i.map(e=>e.quote.nativeFee),j,O,T,y);F=r}return await m.waitForDepositedUtxosInMerkleTree(e,x,[...M,...F]),{depositTxHash:P,scheduleId:await C(e,x,r,i.map((e,t)=>({...e,utxo:M[t].utxo,nativeUtxo:k?F[t]?.utxo:void 0})),D,T,N,a,l,f,w)}};exports.hinkalDepositAndBridge=w;
1
+ const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../functions/utils/caseInsensitive.utils.cjs`),r=require(`../../crypto/poseidon.cjs`),i=require(`../../error-handling/error-codes.constants.cjs`),a=require(`../../functions/web3/etherFunctions.cjs`),o=require(`../../functions/utils/addresses.cjs`),s=require(`../../types/external-action.types.cjs`),c=require(`../../types/transact.types.cjs`),l=require(`../../API/API.cjs`),u=require(`../../functions/utils/token-check.utils.cjs`),d=require(`../../functions/utils/erc20tokenFunctions.cjs`),f=require(`../../functions/pre-transaction/constructAdminData.cjs`),p=require(`../AccountActions/AccountActions.cjs`),m=require(`../../functions/pre-transaction/getFeeStructure.cjs`),h=require(`../../functions/pre-transaction/speculativeUtxo.cjs`),g=require(`../../functions/private-wallet/emporium.helpers.cjs`),_=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),v=require(`./hinkalTransact.cjs`),y=require(`../../constants/addresses.constants.cjs`),b=require(`../../functions/utils/convertEmporiumOpToCallInfo.cjs`),x=require(`../../functions/utils/fees.utils.cjs`);require(`../../functions/utils/index.cjs`);const S=require(`./hinkalDepositOnChainUtxos.cjs`);var C=async(o,u,d,m,_,b,x,S)=>{if(m.length===0)throw Error(`No recipients to bridge`);let C=d.erc20TokenAddress,{contractData:w}=e.networkRegistry[u],{emporiumAddress:T}=w;if(!T)throw Error(`No Emporium Address`);let E=y.SWAP_ROUTER_ADDRESSES[s.ExternalActionId.Lifi][u];if(!E)throw Error(`LIFI not configured for chain ${u}`);let D=await o.getRandomRelay(u);if(!D)throw Error(i.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let O=await o.getEthereumAddressByChain(u),k=o.generateProofRemotely,A=k?5:1,j=[];for(let i=0;i<m.length;i+=A){let d=m.slice(i,i+A),y=await Promise.all(d.map(async({utxo:d,nativeUtxo:m,bridgeAmount:y,quote:w,temporarySubAccount:A,recipientAddress:j,destinationChainId:M,destinationTokenAddress:N},P)=>{let F=_[i+P];await l.API.addTemporaryWalletNonce(u,b,A.index);let I=n.caseInsensitiveEqual(C,t.zeroAddress),L=w.nativeFee>0n&&!I,R=[C],z=[-d.amount],B=[!1],V=[[d]];L&&m&&(R.push(t.zeroAddress),z.push(-m.amount),B.push(!1),V.push([m]));let H=g.createLifiBridgeOps(o,u,A.ethAddress,E,C,d.amount,y,w),U=f.constructAdminData(x,u,R,[-d.amount],O),[W,G]=await Promise.all([(async()=>{let n=a.randomBigInt(31),i=k?await g.encodeEmporiumMetadata(u,T,A.privateKey,H,r.poseidonFunction(n),p.AccountActions.getSignerAddressFromPrivateKey(e.getOnchainChainId(u),A.privateKey),F.flatFee):void 0;return v.hinkalTransact(o,{chainId:u,erc20Addresses:R,amountChanges:z,externalAddress:T,externalActionId:s.ExternalActionId.Emporium,externalActionMetadata:i,onChainCreation:B,feeStructure:F,relay:D??t.zeroAddress,messageSeed:n,inputUtxos:V,useBlockedUtxos:!0,speculative:S&&{pendingLeaves:S,inputUtxos:V.map(e=>e.map(h.toSpeculativeUtxo))},subAccountPrivateKey:A.privateKey,emporiumOps:H,submit:{mode:c.SubmitMode.ProofOnly}})})(),g.getAuthorizationDataIfNeeded(u,A.privateKey)]),{zkCallData:K,circomData:q,dimData:J,commitmentValidationData:Y,tronProofSignature:X}=W;return{zkCallData:K,dimData:J,circomData:q,commitmentValidationData:Y,authorizationData:G,recipientAddress:j,adminData:U,tronProofSignature:X,destinationChainId:M,destinationTokenAddress:N,destinationTokenAmount:w.expectedAmount.toString()}}));j.push(...y)}return j},w=e=>e.map(e=>e.quote.nativeFee),T=async(e,n,r,i)=>{let{chainId:a,hashedEthereumAddress:o,feeStructures:s,mainTokenAmounts:c}=i,{needsNativeDeposit:l,txCompletionTime:u,ref:f,action:p,hashedDashboardAccountId:m,preEstimateGas:h}=i,g=[n],v=[c];if(l){let e=await d.getErc20TokenFromAPI(a,t.zeroAddress);if(!e)throw Error(`No native token`);g.push(e),v.push(w(r))}let y=await S.prepareDepositOnChainUtxos(e,a,g,v),{depositedUtxos:b,pendingLeaves:x}=y,[T,E=[]]=b,D=r.map((e,t)=>({...e,utxo:T[t],nativeUtxo:l?E[t]:void 0})),[O,k]=await Promise.all([S.submitDepositOnChainUtxos(e,y,h),C(e,a,n,D,s,o,p,x)]);return{depositTxHash:O,scheduleId:await _.transactCallRelayerBatch(a,k,o,u,f,m,O)}},E=async(e,r,i,a,c,l,d,f,p=!0)=>{if(i.length===0)throw Error(`No recipients to bridge`);let h=r.erc20TokenAddress,_=u.validateAndGetChainId([r]),v=await e.getEthereumAddressByChain(_),S=y.SWAP_ROUTER_ADDRESSES[s.ExternalActionId.Lifi][_];if(!S)throw Error(`LIFI router not configured`);let C=n.caseInsensitiveEqual(h,t.zeroAddress),w;if(c)w=c;else{let n=i[0],r=C?n.bridgeAmount+n.quote.nativeFee:n.bridgeAmount,a=g.createLifiBridgeOps(e,_,n.temporarySubAccount.ethAddress,S,h,r,n.bridgeAmount,n.quote).map(e=>b.convertEmporiumOpToCallInfo(e,n.temporarySubAccount.ethAddress,_));w=await m.getFeeStructure(_,h,[h],s.ExternalActionId.Emporium,a,t.PAY_SEND_VARIABLE_RATE)}let E=i.reduce((e,t)=>e+t.quote.nativeFee,0n),D=i.map(e=>C?e.bridgeAmount+e.quote.nativeFee:e.bridgeAmount),O=await Promise.all(D.map(e=>x.calculateModifiedFeeStructure(_,r,e,w)));return T(e,r,i,{chainId:_,ethereumAddress:v,hashedEthereumAddress:o.hashEthereumAddress(v),feeStructures:O,mainTokenAmounts:D.map((e,t)=>e+O[t].flatFee),needsNativeDeposit:E>0n&&!C,txCompletionTime:a,ref:l,action:d,hashedDashboardAccountId:f?o.hashString(f):void 0,preEstimateGas:p})};exports.hinkalDepositAndBridge=E;
@@ -0,0 +1,4 @@
1
+ import { IHinkal } from './IHinkal';
2
+ import { AdminTransactionType, DepositAndSendExtendedResult, ERC20Token, PublicBridgeRecipient } from '../../types';
3
+ import { FeeStructure } from '../../types/hinkal.types';
4
+ export declare const hinkalDepositAndBridge: (hinkal: IHinkal, erc20Token: ERC20Token, recipients: PublicBridgeRecipient[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, preEstimateGas?: boolean) => Promise<DepositAndSendExtendedResult>;
@@ -1,120 +1,124 @@
1
- import { networkRegistry as e } from "../../constants/chains.constants.mjs";
2
- import { PAY_SEND_VARIABLE_RATE as t, zeroAddress as n } from "../../constants/protocol.constants.mjs";
3
- import { caseInsensitiveEqual as r } from "../../functions/utils/caseInsensitive.utils.mjs";
4
- import { transactionErrorCodes as i } from "../../error-handling/error-codes.constants.mjs";
5
- import { getCurrentTimeInSeconds as a } from "../../functions/utils/time.utils.mjs";
6
- import { Utxo as o } from "../utxo/Utxo.mjs";
7
- import { ExternalActionId as s } from "../../types/external-action.types.mjs";
8
- import { DepositAndWithdrawPhase as c } from "../../types/scheduled-transactions.types.mjs";
9
- import "../../types/index.mjs";
10
- import { hashEthereumAddress as l, hashString as u } from "../../functions/utils/addresses.mjs";
11
- import { API as d } from "../../API/API.mjs";
12
- import { validateAndGetChainId as f } from "../../functions/utils/token-check.utils.mjs";
13
- import { getErc20TokenFromAPI as p } from "../../functions/utils/erc20tokenFunctions.mjs";
14
- import { constructAdminData as m } from "../../functions/pre-transaction/constructAdminData.mjs";
15
- import { getFeeStructure as h } from "../../functions/pre-transaction/getFeeStructure.mjs";
16
- import { waitForDepositedUtxosInMerkleTree as g } from "../../functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs";
17
- import { SWAP_ROUTER_ADDRESSES as _ } from "../../constants/addresses.constants.mjs";
18
- import { convertEmporiumOpToCallInfo as v } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
19
- import { calculateModifiedFeeStructure as y } from "../../functions/utils/fees.utils.mjs";
1
+ import { getOnchainChainId as e, networkRegistry as t } from "../../constants/chains.constants.mjs";
2
+ import { PAY_SEND_VARIABLE_RATE as n, zeroAddress as r } from "../../constants/protocol.constants.mjs";
3
+ import { caseInsensitiveEqual as i } from "../../functions/utils/caseInsensitive.utils.mjs";
4
+ import { poseidonFunction as a } from "../../crypto/poseidon.mjs";
5
+ import { transactionErrorCodes as o } from "../../error-handling/error-codes.constants.mjs";
6
+ import { randomBigInt as s } from "../../functions/web3/etherFunctions.mjs";
7
+ import { hashEthereumAddress as c, hashString as l } from "../../functions/utils/addresses.mjs";
8
+ import { ExternalActionId as u } from "../../types/external-action.types.mjs";
9
+ import { SubmitMode as d } from "../../types/transact.types.mjs";
10
+ import { API as f } from "../../API/API.mjs";
11
+ import { validateAndGetChainId as p } from "../../functions/utils/token-check.utils.mjs";
12
+ import { getErc20TokenFromAPI as m } from "../../functions/utils/erc20tokenFunctions.mjs";
13
+ import { constructAdminData as h } from "../../functions/pre-transaction/constructAdminData.mjs";
14
+ import { AccountActions as g } from "../AccountActions/AccountActions.mjs";
15
+ import { getFeeStructure as _ } from "../../functions/pre-transaction/getFeeStructure.mjs";
16
+ import { toSpeculativeUtxo as v } from "../../functions/pre-transaction/speculativeUtxo.mjs";
17
+ import { createLifiBridgeOps as y, encodeEmporiumMetadata as b, getAuthorizationDataIfNeeded as x } from "../../functions/private-wallet/emporium.helpers.mjs";
18
+ import { transactCallRelayerBatch as S } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
19
+ import { hinkalTransact as C } from "./hinkalTransact.mjs";
20
+ import { SWAP_ROUTER_ADDRESSES as w } from "../../constants/addresses.constants.mjs";
21
+ import { convertEmporiumOpToCallInfo as T } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
22
+ import { calculateModifiedFeeStructure as E } from "../../functions/utils/fees.utils.mjs";
20
23
  import "../../functions/utils/index.mjs";
21
- import { createLifiBridgeOps as b, getAuthorizationDataIfNeeded as x } from "../../functions/private-wallet/emporium.helpers.mjs";
22
- import { constructZkProof as S } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
23
- import { transactCallRelayerBatch as C } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
24
- import { safeUpdateDepositAndWithdrawStatus as w } from "../../API/deposit-and-withdraw-status-calls.mjs";
25
- import { hinkalDepositOnChainUtxos as T } from "./hinkalDepositOnChainUtxos.mjs";
26
- import "../../functions/index.mjs";
24
+ import { prepareDepositOnChainUtxos as D, submitDepositOnChainUtxos as O } from "./hinkalDepositOnChainUtxos.mjs";
27
25
  //#region libs/shared/common/src/data-structures/Hinkal/hinkalDepositAndBridge.ts
28
- var E = async (t, l, u, f, p, h, g, v, T, E, D) => {
29
- if (f.length === 0) throw Error("No recipients to bridge");
30
- let O = u.erc20TokenAddress, { contractData: k } = e[l], { emporiumAddress: A } = k;
31
- if (!A) throw Error("No Emporium Address");
32
- let j = _[s.Lifi][l];
33
- if (!j) throw Error(`LIFI not configured for chain ${l}`);
34
- let M = await t.getRandomRelay(l);
35
- if (!M) throw Error(i.RELAYER_NOT_AVAILABLE);
36
- let N = await t.getEthereumAddressByChain(l), P = a().toString(), F = t.generateProofRemotely ? 5 : 1, I = [];
37
- for (let e = 0; e < f.length; e += F) {
38
- let i = f.slice(e, e + F), a = await Promise.all(i.map(async ({ utxo: e, nativeUtxo: i, bridgeAmount: a, quote: c, temporarySubAccount: f, recipientAddress: g }) => {
39
- await d.addTemporaryWalletNonce(l, h, f.index);
40
- let _ = c.nativeFee > 0n && !r(O, n), v = [O], C = [-e.amount], w = [!1], T = new o({
41
- amount: 0n,
42
- erc20TokenAddress: O,
43
- nullifyingKey: t.userKeys.getShieldedPrivateKey(),
44
- timeStamp: P,
45
- ...e.isNewStyle ? {
46
- spendingPublicKey: t.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,
47
- isNewStyle: !0
48
- } : { isNewStyle: !1 }
49
- }), D = [[e, T]], k = [[T]];
50
- if (_ && i) {
51
- let e = new o({
52
- amount: 0n,
53
- erc20TokenAddress: n,
54
- nullifyingKey: t.userKeys.getShieldedPrivateKey(),
55
- timeStamp: P,
56
- ...i.isNewStyle ? {
57
- spendingPublicKey: t.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,
58
- isNewStyle: !0
59
- } : { isNewStyle: !1 }
26
+ var k = async (n, c, l, p, m, _, S, T) => {
27
+ if (p.length === 0) throw Error("No recipients to bridge");
28
+ let E = l.erc20TokenAddress, { contractData: D } = t[c], { emporiumAddress: O } = D;
29
+ if (!O) throw Error("No Emporium Address");
30
+ let k = w[u.Lifi][c];
31
+ if (!k) throw Error(`LIFI not configured for chain ${c}`);
32
+ let A = await n.getRandomRelay(c);
33
+ if (!A) throw Error(o.RELAYER_NOT_AVAILABLE);
34
+ let j = await n.getEthereumAddressByChain(c), M = n.generateProofRemotely, N = M ? 5 : 1, P = [];
35
+ for (let t = 0; t < p.length; t += N) {
36
+ let o = p.slice(t, t + N), l = await Promise.all(o.map(async ({ utxo: o, nativeUtxo: l, bridgeAmount: p, quote: w, temporarySubAccount: D, recipientAddress: N, destinationChainId: P, destinationTokenAddress: F }, I) => {
37
+ let L = m[t + I];
38
+ await f.addTemporaryWalletNonce(c, _, D.index);
39
+ let R = i(E, r), z = w.nativeFee > 0n && !R, B = [E], V = [-o.amount], H = [!1], U = [[o]];
40
+ z && l && (B.push(r), V.push(-l.amount), H.push(!1), U.push([l]));
41
+ let W = y(n, c, D.ethAddress, k, E, o.amount, p, w), G = h(S, c, B, [-o.amount], j), [K, q] = await Promise.all([(async () => {
42
+ let t = s(31), i = M ? await b(c, O, D.privateKey, W, a(t), g.getSignerAddressFromPrivateKey(e(c), D.privateKey), L.flatFee) : void 0;
43
+ return C(n, {
44
+ chainId: c,
45
+ erc20Addresses: B,
46
+ amountChanges: V,
47
+ externalAddress: O,
48
+ externalActionId: u.Emporium,
49
+ externalActionMetadata: i,
50
+ onChainCreation: H,
51
+ feeStructure: L,
52
+ relay: A ?? r,
53
+ messageSeed: t,
54
+ inputUtxos: U,
55
+ useBlockedUtxos: !0,
56
+ speculative: T && {
57
+ pendingLeaves: T,
58
+ inputUtxos: U.map((e) => e.map(v))
59
+ },
60
+ subAccountPrivateKey: D.privateKey,
61
+ emporiumOps: W,
62
+ submit: { mode: d.ProofOnly }
60
63
  });
61
- v.push(n), C.push(-i.amount), w.push(!1), D.push([i, e]), k.push([e]);
62
- }
63
- let F = b(t, l, f.ethAddress, j, O, e.amount, a, c), I = await y(l, u, a, p), L = m(E, l, v, [-e.amount], N), [{ zkCallData: R, circomData: z, dimData: B, commitmentValidationData: V }, H] = await Promise.all([S(t.merkleTreeHinkalByChain[l], D, k, t.userKeys, s.Emporium, A, F, t.generateProofRemotely, I, M ?? n, l, w, void 0, void 0, f.privateKey), x(l, f.privateKey)]);
64
+ })(), x(c, D.privateKey)]), { zkCallData: J, circomData: Y, dimData: X, commitmentValidationData: Z, tronProofSignature: Q } = K;
64
65
  return {
65
- zkCallData: R,
66
- dimData: B,
67
- circomData: z,
68
- commitmentValidationData: V,
69
- authorizationData: H,
70
- recipientAddress: g,
71
- adminData: L
66
+ zkCallData: J,
67
+ dimData: X,
68
+ circomData: Y,
69
+ commitmentValidationData: Z,
70
+ authorizationData: q,
71
+ recipientAddress: N,
72
+ adminData: G,
73
+ tronProofSignature: Q,
74
+ destinationChainId: P,
75
+ destinationTokenAddress: F,
76
+ destinationTokenAmount: w.expectedAmount.toString()
72
77
  };
73
78
  }));
74
- I.push(...a);
79
+ P.push(...l);
75
80
  }
76
- await w({
77
- id: g,
78
- chainId: l,
79
- hashedEthereumAddress: h,
80
- phase: c.BEFORE_SCHEDULE_WITHDRAW
81
- });
82
- let L = await C(l, I, h, v, T, D);
83
- return await w({
84
- id: g,
85
- chainId: l,
86
- hashedEthereumAddress: h,
87
- phase: c.AFTER_SCHEDULE_WITHDRAW,
88
- scheduleId: L
89
- }), L;
90
- }, D = async (e, i, a, o, c, d, m, y, x = !0) => {
91
- let S = i.erc20TokenAddress, C = f([i]), w = y ? u(y) : void 0, D = l(await e.getEthereumAddressByChain(C)), O = _[s.Lifi][C];
92
- if (!O) throw Error("LIFI router not configured");
93
- let k;
94
- if (c) k = c;
95
- else {
96
- let n = a[0], r = b(e, C, n.temporarySubAccount.ethAddress, O, S, n.bridgeAmount, n.bridgeAmount, n.quote).map((e) => v(e, n.temporarySubAccount.ethAddress, C));
97
- k = await h(C, S, [S], s.Emporium, r, t);
98
- }
99
- let A = {
100
- feeToken: k.feeToken,
101
- flatFee: 0n,
102
- variableRate: 0n
103
- }, j = a.reduce((e, t) => e + t.quote.nativeFee, 0n) > 0n && !r(S, n), M = a.map((e) => e.bridgeAmount), N = a.map((e) => e.recipientAddress), { userDepositedUtxos: P, statusId: F, depositTxHash: I } = await T(e, C, i, M, N, k, D, x), L = [];
104
- if (j) {
105
- let t = await p(C, n);
106
- if (!t) throw Error("No native token");
107
- let { userDepositedUtxos: r } = await T(e, C, t, a.map((e) => e.quote.nativeFee), N, A, D, x);
108
- L = r;
81
+ return P;
82
+ }, A = (e) => e.map((e) => e.quote.nativeFee), j = async (e, t, n, i) => {
83
+ let { chainId: a, hashedEthereumAddress: o, feeStructures: s, mainTokenAmounts: c } = i, { needsNativeDeposit: l, txCompletionTime: u, ref: d, action: f, hashedDashboardAccountId: p, preEstimateGas: h } = i, g = [t], _ = [c];
84
+ if (l) {
85
+ let e = await m(a, r);
86
+ if (!e) throw Error("No native token");
87
+ g.push(e), _.push(A(n));
109
88
  }
110
- return await g(e, C, [...P, ...L]), {
111
- depositTxHash: I,
112
- scheduleId: await E(e, C, i, a.map((e, t) => ({
113
- ...e,
114
- utxo: P[t].utxo,
115
- nativeUtxo: j ? L[t]?.utxo : void 0
116
- })), k, D, F, o, d, m, w)
89
+ let v = await D(e, a, g, _), { depositedUtxos: y, pendingLeaves: b } = v, [x, C = []] = y, w = n.map((e, t) => ({
90
+ ...e,
91
+ utxo: x[t],
92
+ nativeUtxo: l ? C[t] : void 0
93
+ })), [T, E] = await Promise.all([O(e, v, h), k(e, a, t, w, s, o, f, b)]);
94
+ return {
95
+ depositTxHash: T,
96
+ scheduleId: await S(a, E, o, u, d, p, T)
117
97
  };
98
+ }, M = async (e, t, a, o, s, d, f, m, h = !0) => {
99
+ if (a.length === 0) throw Error("No recipients to bridge");
100
+ let g = t.erc20TokenAddress, v = p([t]), b = await e.getEthereumAddressByChain(v), x = w[u.Lifi][v];
101
+ if (!x) throw Error("LIFI router not configured");
102
+ let S = i(g, r), C;
103
+ if (s) C = s;
104
+ else {
105
+ let t = a[0], r = S ? t.bridgeAmount + t.quote.nativeFee : t.bridgeAmount, i = y(e, v, t.temporarySubAccount.ethAddress, x, g, r, t.bridgeAmount, t.quote).map((e) => T(e, t.temporarySubAccount.ethAddress, v));
106
+ C = await _(v, g, [g], u.Emporium, i, n);
107
+ }
108
+ let D = a.reduce((e, t) => e + t.quote.nativeFee, 0n), O = a.map((e) => S ? e.bridgeAmount + e.quote.nativeFee : e.bridgeAmount), k = await Promise.all(O.map((e) => E(v, t, e, C)));
109
+ return j(e, t, a, {
110
+ chainId: v,
111
+ ethereumAddress: b,
112
+ hashedEthereumAddress: c(b),
113
+ feeStructures: k,
114
+ mainTokenAmounts: O.map((e, t) => e + k[t].flatFee),
115
+ needsNativeDeposit: D > 0n && !S,
116
+ txCompletionTime: o,
117
+ ref: d,
118
+ action: f,
119
+ hashedDashboardAccountId: m ? l(m) : void 0,
120
+ preEstimateGas: h
121
+ });
118
122
  };
119
123
  //#endregion
120
- export { D as hinkalDepositAndBridge };
124
+ export { M as hinkalDepositAndBridge };
@@ -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(`../../error-handling/error-codes.constants.cjs`),i=require(`../../functions/utils/time.utils.cjs`),a=require(`../utxo/Utxo.cjs`),o=require(`../../types/external-action.types.cjs`),s=require(`../../types/scheduled-transactions.types.cjs`);require(`../../types/index.cjs`);const c=require(`../../functions/utils/addresses.cjs`),l=require(`../../functions/utils/tron.utils.cjs`),u=require(`../../functions/utils/token-check.utils.cjs`),d=require(`../../functions/pre-transaction/constructAdminData.cjs`),f=require(`../../functions/pre-transaction/getFeeStructure.cjs`),p=require(`../../functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs`),m=require(`../../functions/utils/fees.utils.cjs`),h=require(`../../functions/snarkjs/constructGeneralZkProof.cjs`),g=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),_=require(`../../API/deposit-and-withdraw-status-calls.cjs`),v=require(`./hinkalDepositOnChainUtxos.cjs`);require(`../../functions/index.cjs`);var y=async(o,c,u,f,p,v,y,b,x,S,C,w)=>{let T=e.isTronLike(c);if(f.length===0)throw Error(`userDepositedUtxos must not be empty`);let E=u.erc20TokenAddress,[D,O]=await Promise.all([o.getRandomRelay(c),o.getEthereumAddressByChain(c)]);if(!D)throw Error(r.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let k=i.getCurrentTimeInSeconds().toString(),A=o.generateProofRemotely&&!T?5:1,j=[],M=l.addressToHexFormat(O);for(let e=0;e<f.length;e+=A){let r=f.slice(e,e+A),i=await Promise.all(r.map(async({recipientAddress:r,utxo:i},s)=>{let f=e+s,g=l.addressToHexFormat(r),_=new a.Utxo({amount:0n,erc20TokenAddress:E,nullifyingKey:o.userKeys.getShieldedPrivateKey(),timeStamp:k,...i.isNewStyle?{spendingPublicKey:o.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,isNewStyle:!0}:{isNewStyle:!1}}),y=[[n.caseInsensitiveEqual(i.erc20TokenAddress,E)?i:a.Utxo.createFrom(i,{erc20TokenAddress:E}),_]],b=[[_]],x={externalActionId:0n,externalAddress:g,externalActionMetadata:`0x00`},S=d.constructAdminData(C,c,[E],[-i.amount],M),w=await m.calculateModifiedFeeStructure(c,u,p[f],v),{zkCallData:O,circomData:A,dimData:j,commitmentValidationData:N}=await h.constructZkProof(o.merkleTreeHinkalByChain[c],y,b,o.userKeys,x.externalActionId,x.externalAddress,x.externalActionMetadata,o.generateProofRemotely,w,D??t.zeroAddress,c);return{zkCallData:O,dimData:j,circomData:A,commitmentValidationData:N,adminData:S,recipientAddress:r,tronProofSignature:await l.reorderZkCallData(T,O,j,A)}}));j.push(...i)}await _.safeUpdateDepositAndWithdrawStatus({id:b,chainId:c,hashedEthereumAddress:y,phase:s.DepositAndWithdrawPhase.BEFORE_SCHEDULE_WITHDRAW});let N=await g.transactCallRelayerBatch(c,j,y,x,S,w);return await _.safeUpdateDepositAndWithdrawStatus({id:b,chainId:c,hashedEthereumAddress:y,phase:s.DepositAndWithdrawPhase.AFTER_SCHEDULE_WITHDRAW,scheduleId:N}),N},b=async(e,t,n,r,i,a,s,d,m,h=!0)=>{let g=u.validateAndGetChainId([t]),_=m?c.hashString(m):void 0,b=t.erc20TokenAddress,x=c.hashEthereumAddress(l.addressToHexFormat(await e.getEthereumAddressByChain(g))),S=a??await f.getFeeStructure(g,b,[b],o.ExternalActionId.Transact,[],10n),{userDepositedUtxos:C,statusId:w,depositTxHash:T}=await v.hinkalDepositOnChainUtxos(e,g,t,n,r,S,x,h);return await p.waitForDepositedUtxosInMerkleTree(e,g,C),{depositTxHash:T,scheduleId:await y(e,g,t,C,n,S,x,w,i,s,d,_)}};exports.hinkalDepositAndWithdraw=b;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../functions/utils/caseInsensitive.utils.cjs`),r=require(`../../error-handling/error-codes.constants.cjs`),i=require(`../utxo/Utxo.cjs`),a=require(`../../functions/utils/tron.utils.cjs`),o=require(`../../functions/utils/addresses.cjs`),s=require(`../../types/external-action.types.cjs`),c=require(`../../types/transact.types.cjs`),l=require(`../../functions/utils/token-check.utils.cjs`),u=require(`../crypto-keys/encryptDecryptUtxo.cjs`),d=require(`../../functions/pre-transaction/constructAdminData.cjs`),f=require(`../../functions/pre-transaction/getFeeStructure.cjs`),p=require(`../../functions/pre-transaction/speculativeUtxo.cjs`),m=require(`../../functions/web3/functionCalls/transactCallDirectTron.cjs`),h=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),g=require(`./hinkalTransact.cjs`);require(`../../functions/index.cjs`);const _=require(`./hinkalDepositOnChainUtxos.cjs`);let v=require(`ethers`);var y=async(e,o,s,l,u,f,m,h)=>{if(l.length===0)throw Error(`userDepositedUtxos must not be empty`);let _=s.erc20TokenAddress,[v,y]=await Promise.all([e.getRandomRelay(o),e.getEthereumAddressByChain(o)]);if(!v)throw Error(r.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let b=e.generateProofRemotely?5:1,x=[],S=a.addressToHexFormat(y);for(let r=0;r<l.length;r+=b){let s=l.slice(r,r+b),y=await Promise.all(s.map(async({recipientAddress:s,utxo:l},y)=>{let b=r+y,x=a.addressToHexFormat(s),C=n.caseInsensitiveEqual(l.erc20TokenAddress,_)?l:i.Utxo.createFrom(l,{erc20TokenAddress:_}),w=d.constructAdminData(f,o,[_],[-l.amount],S),{zkCallData:T,circomData:E,dimData:D,commitmentValidationData:O,tronProofSignature:k}=await g.hinkalTransact(e,{chainId:o,erc20Addresses:[_],amountChanges:[-l.amount],externalAddress:x,feeStructure:u,relay:v??t.zeroAddress,inputUtxos:[[C]],useBlockedUtxos:!0,speculative:h&&{pendingLeaves:h,inputUtxos:[[p.toSpeculativeUtxo(C)]]},submit:{mode:c.SubmitMode.ProofOnly},skipLock:!0});return{zkCallData:T,dimData:D,circomData:E,commitmentValidationData:O,adminData:w,recipientAddress:s,tronProofSignature:k,destinationChainId:m?.chainId,destinationTokenAddress:m?.tokenAddress,destinationTokenAmount:m?.tokenAmounts?.[b]}}));x.push(...y)}return x},b=async(e,t,n,r,i)=>{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),g=await _.prepareDepositOnChainUtxos(e,a,[t],[m]),{depositedUtxos:v,pendingLeaves:b}=g,x=v[0].map((e,t)=>({recipientAddress:r[t],utxo:e})),[S,C]=await Promise.all([_.submitDepositOnChainUtxos(e,g,p),y(e,a,t,x,s,c,l,b)]);return{depositTxHash:S,scheduleId:await h.transactCallRelayerBatch(a,C,o,u,d,f,S)}},x=async(e,t,n,r,i)=>{let{chainId:o,ethereumAddress:s,hashedEthereumAddress:l,feeStructure:d,action:f,destination:p}=i,{txCompletionTime:_,ref:b,hashedDashboardAccountId:x,preEstimateGas:S}=i,C=n.map(e=>e+d.flatFee),w=C.reduce((e,t)=>e+t,0n),T=await g.hinkalTransact(e,{chainId:o,erc20Addresses:[t.erc20TokenAddress],amountChanges:[w],externalAddress:s,selfOutputAmounts:C,createBlockedUtxos:!0,forceEmptyUtxos:!0,submit:{mode:c.SubmitMode.ProofOnly}}),E=T.circomData.encryptedOutputs?.[0];if(!E||E.length!==C.length)throw Error(`Deposit proof is missing encryptedOutputs for the deposited UTXOs`);let D=E.map((t,n)=>({recipientAddress:r[n],utxo:u.decryptUtxo(v.ethers.getBytes(t),e.userKeys)})),O=T.circomData.outCommitments.flat().map(e=>BigInt(e)).filter(e=>e!==0n).map(e=>e.toString()),[k,A]=await Promise.all([(async()=>{a.swapTronBCoordinate(T.zkCallData);let n=await m.transactCallDirectTron(e,o,w,t,T.zkCallData,T.circomData,T.dimData,void 0,void 0,S,T.tronProofSignature);if(!n)throw Error(`Deposit transaction hash not found`);return n})(),y(e,o,t,D,d,f,p,O)]);return{depositTxHash:k,scheduleId:await h.transactCallRelayerBatch(o,A,l,_,b,x,k)}},S=async(t,n,r,i,c,u,d,p,m,h=!0,g)=>{let _=l.validateAndGetChainId([n]),v=n.erc20TokenAddress,y=a.addressToHexFormat(await t.getEthereumAddressByChain(_)),S={chainId:_,ethereumAddress:y,hashedEthereumAddress:o.hashEthereumAddress(y),feeStructure:u??await f.getFeeStructure(_,v,[v],s.ExternalActionId.Transact,[],25n),txCompletionTime:c,ref:d,action:p,hashedDashboardAccountId:m?o.hashString(m):void 0,preEstimateGas:h,destination:g};if(!e.isTronLike(_))return b(t,n,r,i,S);if(r.length>4)throw Error(`Tron supports at most 4 recipients per deposit - no circuit emits more outputs`);return x(t,n,r,i,S)};exports.hinkalDepositAndWithdraw=S;
@@ -0,0 +1,7 @@
1
+ import { IHinkal } from './IHinkal';
2
+ import { AdminTransactionType, DepositAndSendExtendedResult, ERC20Token, RecipientUtxo } from '../../types';
3
+ import { DestinationMetadata } from '../../types/bridging-tx.types';
4
+ import { FeeStructure } from '../../types/hinkal.types';
5
+ export declare const hinkalWithdrawBatch: (hinkal: IHinkal, chainId: number, erc20Token: ERC20Token, userDepositedUtxos: RecipientUtxo[], feeStructure: FeeStructure, hashedEthereumAddress: string, txCompletionTime?: number, ref?: string, action?: AdminTransactionType, hashedDashboardAccountId?: string, destination?: DestinationMetadata) => Promise<string>;
6
+ export declare const hinkalDepositAndWithdraw: (hinkal: IHinkal, erc20Token: ERC20Token, recipientAmounts: bigint[], recipientAddresses: string[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, // Should be passed fee for only one withdraw transaction, multiplication happening in this function
7
+ ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, preEstimateGas?: boolean, destination?: DestinationMetadata) => Promise<DepositAndSendExtendedResult>;