@hinkal/common 0.3.2 → 0.3.3

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 (446) hide show
  1. package/README.md +15 -18
  2. package/common/src/API/API.cjs +1 -1
  3. package/common/src/API/API.d.ts +5 -5
  4. package/common/src/API/API.mjs +78 -78
  5. package/common/src/API/callRelayer.d.ts +3 -0
  6. package/common/src/API/enclaveUtxoCalls.cjs +1 -1
  7. package/common/src/API/enclaveUtxoCalls.d.ts +8 -7
  8. package/common/src/API/enclaveUtxoCalls.mjs +5 -3
  9. package/common/src/API/getOdosPriceForToken.cjs +1 -0
  10. package/common/src/API/getOdosPriceForToken.d.ts +1 -0
  11. package/common/src/API/getOdosPriceForToken.mjs +14 -0
  12. package/common/src/API/getWebsiteURL.d.ts +0 -1
  13. package/common/src/API/index.cjs +1 -1
  14. package/common/src/API/index.d.ts +0 -1
  15. package/common/src/API/index.mjs +1 -2
  16. package/common/src/API/rewardsUserCalls.cjs +1 -1
  17. package/common/src/API/rewardsUserCalls.d.ts +0 -2
  18. package/common/src/API/rewardsUserCalls.mjs +2 -3
  19. package/common/src/API/tenderly.api.cjs +1 -1
  20. package/common/src/API/tenderly.api.d.ts +5 -10
  21. package/common/src/API/tenderly.api.mjs +1 -1
  22. package/common/src/constants/addresses.constants.cjs +1 -1
  23. package/common/src/constants/addresses.constants.d.ts +4 -46
  24. package/common/src/constants/addresses.constants.mjs +19 -60
  25. package/common/src/constants/balance.constants.cjs +1 -0
  26. package/common/src/constants/balance.constants.d.ts +1 -0
  27. package/common/src/constants/balance.constants.mjs +4 -0
  28. package/common/src/constants/chains.constants.cjs +1 -1
  29. package/common/src/constants/chains.constants.d.ts +3 -1
  30. package/common/src/constants/chains.constants.mjs +117 -131
  31. package/common/src/constants/coingecko.constants.cjs +1 -1
  32. package/common/src/constants/coingecko.constants.d.ts +2 -0
  33. package/common/src/constants/coingecko.constants.mjs +1 -1
  34. package/common/src/constants/contracts.constants.cjs +1 -1
  35. package/common/src/constants/contracts.constants.d.ts +0 -109
  36. package/common/src/constants/contracts.constants.mjs +13 -22
  37. package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
  38. package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.mjs +1 -3
  39. package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
  40. package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.mjs +6 -6
  41. package/common/src/constants/deploy-data/deploy-data-base.json.cjs +1 -1
  42. package/common/src/constants/deploy-data/deploy-data-base.json.mjs +1 -3
  43. package/common/src/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +1 -0
  44. package/common/src/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +10 -0
  45. package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
  46. package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.mjs +1 -3
  47. package/common/src/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
  48. package/common/src/constants/deploy-data/deploy-data-localhost.json.mjs +0 -3
  49. package/common/src/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
  50. package/common/src/constants/deploy-data/deploy-data-optimism.json.mjs +6 -8
  51. package/common/src/constants/deploy-data/deploy-data-optimismTest.json.cjs +1 -1
  52. package/common/src/constants/deploy-data/deploy-data-optimismTest.json.mjs +1 -4
  53. package/common/src/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
  54. package/common/src/constants/deploy-data/deploy-data-polygon.json.mjs +1 -3
  55. package/common/src/constants/deploy-data/deploy-data-sepoliaTestnet.json.cjs +1 -1
  56. package/common/src/constants/deploy-data/deploy-data-sepoliaTestnet.json.mjs +0 -1
  57. package/common/src/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
  58. package/common/src/constants/deploy-data/deploy-data-solana.json.mjs +2 -2
  59. package/common/src/constants/deploy-data/deploy-data-tempo.json.cjs +1 -1
  60. package/common/src/constants/deploy-data/deploy-data-tempo.json.mjs +6 -7
  61. package/common/src/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -1
  62. package/common/src/constants/deploy-data/deploy-data-tronMainnet.json.mjs +2 -4
  63. package/common/src/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -1
  64. package/common/src/constants/deploy-data/deploy-data-tronNile.json.mjs +2 -4
  65. package/common/src/constants/deploy-data/index.cjs +1 -1
  66. package/common/src/constants/deploy-data/index.d.ts +2 -1
  67. package/common/src/constants/deploy-data/index.mjs +16 -15
  68. package/common/src/constants/deploy-data/shared-deploy-data-solana.json.cjs +1 -1
  69. package/common/src/constants/deploy-data/shared-deploy-data-solana.json.mjs +1 -1
  70. package/common/src/constants/deploy-data/shared-deploy-data-tron.json.cjs +1 -1
  71. package/common/src/constants/deploy-data/shared-deploy-data-tron.json.mjs +2 -35
  72. package/common/src/constants/events.constants.cjs +1 -1
  73. package/common/src/constants/events.constants.mjs +3 -2
  74. package/common/src/constants/fees.constants.cjs +1 -1
  75. package/common/src/constants/fees.constants.mjs +2 -2
  76. package/common/src/constants/index.cjs +1 -1
  77. package/common/src/constants/index.d.ts +0 -1
  78. package/common/src/constants/index.mjs +1 -0
  79. package/common/src/constants/protocol.constants.cjs +2 -2
  80. package/common/src/constants/protocol.constants.d.ts +3 -1
  81. package/common/src/constants/protocol.constants.mjs +2 -2
  82. package/common/src/constants/server.constants.cjs +1 -1
  83. package/common/src/constants/server.constants.d.ts +1 -2
  84. package/common/src/constants/server.constants.mjs +1 -2
  85. package/common/src/constants/tokens.constants.cjs +1 -1
  86. package/common/src/constants/tokens.constants.mjs +1 -1
  87. package/common/src/data-structures/Hinkal/Hinkal.cjs +1 -1
  88. package/common/src/data-structures/Hinkal/Hinkal.mjs +26 -22
  89. package/common/src/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
  90. package/common/src/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
  91. package/common/src/data-structures/Hinkal/handleAutoDepositBack.mjs +36 -35
  92. package/common/src/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
  93. package/common/src/data-structures/Hinkal/hinkalActionReceive.mjs +3 -3
  94. package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.cjs +1 -1
  95. package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.mjs +60 -58
  96. package/common/src/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -1
  97. package/common/src/data-structures/Hinkal/hinkalClaimUtxo.mjs +42 -47
  98. package/common/src/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
  99. package/common/src/data-structures/Hinkal/hinkalDeposit.d.ts +1 -0
  100. package/common/src/data-structures/Hinkal/hinkalDeposit.mjs +50 -116
  101. package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -1
  102. package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.mjs +102 -92
  103. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
  104. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +3 -2
  105. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +104 -59
  106. package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
  107. package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +4 -4
  108. package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.cjs +1 -1
  109. package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.mjs +7 -3
  110. package/common/src/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  111. package/common/src/data-structures/Hinkal/hinkalPrivateWallet.mjs +51 -39
  112. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
  113. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +1 -2
  114. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.mjs +53 -131
  115. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.cjs +1 -1
  116. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.d.ts +1 -1
  117. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.mjs +29 -47
  118. package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
  119. package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.mjs +3 -3
  120. package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
  121. package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +70 -45
  122. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
  123. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +2 -2
  124. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.mjs +47 -45
  125. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  126. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +8 -4
  127. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +133 -81
  128. package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -1
  129. package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +1 -1
  130. package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +16 -12
  131. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
  132. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +2 -2
  133. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +61 -54
  134. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
  135. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +1 -1
  136. package/common/src/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
  137. package/common/src/data-structures/Hinkal/hinkalSolanaSwap.mjs +87 -51
  138. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
  139. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +1 -0
  140. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.mjs +95 -50
  141. package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
  142. package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +60 -34
  143. package/common/src/data-structures/Hinkal/hinkalSwap.cjs +1 -1
  144. package/common/src/data-structures/Hinkal/hinkalSwap.mjs +29 -32
  145. package/common/src/data-structures/Hinkal/hinkalTransact.cjs +1 -0
  146. package/common/src/data-structures/Hinkal/hinkalTransact.d.ts +3 -0
  147. package/common/src/data-structures/Hinkal/hinkalTransact.mjs +90 -0
  148. package/common/src/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
  149. package/common/src/data-structures/Hinkal/hinkalTransfer.mjs +40 -45
  150. package/common/src/data-structures/Hinkal/hinkalTronDepositToSelf.cjs +1 -0
  151. package/common/src/data-structures/Hinkal/hinkalTronDepositToSelf.d.ts +8 -0
  152. package/common/src/data-structures/Hinkal/hinkalTronDepositToSelf.mjs +30 -0
  153. package/common/src/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  154. package/common/src/data-structures/Hinkal/hinkalWithdraw.mjs +35 -45
  155. package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  156. package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +167 -95
  157. package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.cjs +1 -0
  158. package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.d.ts +27 -0
  159. package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.mjs +31 -0
  160. package/common/src/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  161. package/common/src/data-structures/Hinkal/resetMerkleTrees.mjs +1 -0
  162. package/common/src/data-structures/IndexedDB/activity-db.cjs +1 -1
  163. package/common/src/data-structures/IndexedDB/activity-db.mjs +34 -34
  164. package/common/src/data-structures/IndexedDB/signatures-db.cjs +1 -1
  165. package/common/src/data-structures/IndexedDB/signatures-db.mjs +11 -11
  166. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
  167. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +11 -10
  168. package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.cjs +1 -1
  169. package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.mjs +14 -14
  170. package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
  171. package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.mjs +26 -26
  172. package/common/src/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
  173. package/common/src/data-structures/TokenDBs/PrivateTokensDB.mjs +15 -15
  174. package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.cjs +1 -1
  175. package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.mjs +12 -16
  176. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.cjs +1 -1
  177. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.d.ts +1 -0
  178. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.mjs +8 -4
  179. package/common/src/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
  180. package/common/src/data-structures/crypto-keys/decodeUTXO.d.ts +1 -0
  181. package/common/src/data-structures/crypto-keys/decodeUTXO.mjs +12 -12
  182. package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
  183. package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.mjs +12 -12
  184. package/common/src/data-structures/event-service/helpers/ClientEventHelper.cjs +1 -1
  185. package/common/src/data-structures/event-service/helpers/ClientEventHelper.mjs +6 -6
  186. package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
  187. package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +27 -23
  188. package/common/src/data-structures/merkle-tree/MerkleTree.cjs +1 -1
  189. package/common/src/data-structures/merkle-tree/MerkleTree.d.ts +10 -0
  190. package/common/src/data-structures/merkle-tree/MerkleTree.mjs +9 -1
  191. package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.cjs +1 -1
  192. package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.d.ts +3 -0
  193. package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.mjs +64 -54
  194. package/common/src/error-handling/error-codes.constants.cjs +1 -1
  195. package/common/src/error-handling/error-codes.constants.d.ts +6 -11
  196. package/common/src/error-handling/error-codes.constants.mjs +8 -13
  197. package/common/src/error-handling/get-error.message.cjs +1 -1
  198. package/common/src/error-handling/get-error.message.mjs +27 -14
  199. package/common/src/externalABIs/index.cjs +1 -1
  200. package/common/src/externalABIs/index.d.ts +1 -113
  201. package/common/src/externalABIs/index.mjs +2 -6
  202. package/common/src/functions/auto-deposit-back-helpers/select-gas-token.cjs +1 -1
  203. package/common/src/functions/auto-deposit-back-helpers/select-gas-token.mjs +8 -8
  204. package/common/src/functions/index.cjs +1 -1
  205. package/common/src/functions/index.d.ts +0 -1
  206. package/common/src/functions/index.mjs +12 -15
  207. package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.cjs +1 -1
  208. package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.mjs +39 -5
  209. package/common/src/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
  210. package/common/src/functions/pre-transaction/getExternalSwapAddress.mjs +2 -18
  211. package/common/src/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
  212. package/common/src/functions/pre-transaction/getSolanaCalldataHash.d.ts +1 -1
  213. package/common/src/functions/pre-transaction/getSolanaCalldataHash.mjs +11 -10
  214. package/common/src/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
  215. package/common/src/functions/pre-transaction/getVolatileTransferAmount.mjs +12 -12
  216. package/common/src/functions/pre-transaction/index.cjs +1 -1
  217. package/common/src/functions/pre-transaction/index.d.ts +1 -2
  218. package/common/src/functions/pre-transaction/index.mjs +1 -2
  219. package/common/src/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
  220. package/common/src/functions/pre-transaction/outputUtxoProcessing.d.ts +1 -1
  221. package/common/src/functions/pre-transaction/outputUtxoProcessing.mjs +7 -8
  222. package/common/src/functions/pre-transaction/solana.cjs +1 -1
  223. package/common/src/functions/pre-transaction/solana.d.ts +13 -0
  224. package/common/src/functions/pre-transaction/solana.mjs +46 -22
  225. package/common/src/functions/pre-transaction/store-proof.cjs +1 -1
  226. package/common/src/functions/pre-transaction/store-proof.d.ts +1 -1
  227. package/common/src/functions/pre-transaction/store-proof.mjs +1 -0
  228. package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs +1 -1
  229. package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +1 -1
  230. package/common/src/functions/private-wallet/emporium.helpers.cjs +1 -1
  231. package/common/src/functions/private-wallet/emporium.helpers.mjs +12 -13
  232. package/common/src/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
  233. package/common/src/functions/private-wallet/emporium.swap.helpers.d.ts +0 -1
  234. package/common/src/functions/private-wallet/emporium.swap.helpers.mjs +38 -80
  235. package/common/src/functions/private-wallet/index.cjs +1 -1
  236. package/common/src/functions/private-wallet/index.d.ts +0 -1
  237. package/common/src/functions/private-wallet/index.mjs +0 -1
  238. package/common/src/functions/snarkjs/common.snarkjs.cjs +1 -1
  239. package/common/src/functions/snarkjs/common.snarkjs.d.ts +2 -2
  240. package/common/src/functions/snarkjs/common.snarkjs.mjs +89 -52
  241. package/common/src/functions/snarkjs/constant.cjs +1 -1
  242. package/common/src/functions/snarkjs/constant.d.ts +32 -0
  243. package/common/src/functions/snarkjs/constant.mjs +32 -0
  244. package/common/src/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
  245. package/common/src/functions/snarkjs/constructGeneralZkProof.d.ts +1 -1
  246. package/common/src/functions/snarkjs/constructGeneralZkProof.mjs +78 -65
  247. package/common/src/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
  248. package/common/src/functions/snarkjs/constructSolanaZkProof.d.ts +4 -1
  249. package/common/src/functions/snarkjs/constructSolanaZkProof.mjs +44 -39
  250. package/common/src/functions/snarkjs/constructTxEnclave.cjs +1 -0
  251. package/common/src/functions/snarkjs/constructTxEnclave.d.ts +32 -0
  252. package/common/src/functions/snarkjs/constructTxEnclave.mjs +162 -0
  253. package/common/src/functions/snarkjs/fetchTronInsertionSiblings.cjs +1 -0
  254. package/common/src/functions/snarkjs/fetchTronInsertionSiblings.d.ts +7 -0
  255. package/common/src/functions/snarkjs/fetchTronInsertionSiblings.mjs +13 -0
  256. package/common/src/functions/snarkjs/generateCircomData.cjs +1 -1
  257. package/common/src/functions/snarkjs/generateCircomData.d.ts +1 -1
  258. package/common/src/functions/snarkjs/generateCircomData.mjs +33 -27
  259. package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.cjs +1 -1
  260. package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.d.ts +1 -1
  261. package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.mjs +7 -7
  262. package/common/src/functions/snarkjs/generateZkProof.cjs +1 -1
  263. package/common/src/functions/snarkjs/generateZkProof.d.ts +1 -1
  264. package/common/src/functions/snarkjs/generateZkProof.mjs +9 -16
  265. package/common/src/functions/snarkjs/signedMessageHash.cjs +1 -1
  266. package/common/src/functions/snarkjs/signedMessageHash.d.ts +11 -0
  267. package/common/src/functions/snarkjs/signedMessageHash.mjs +21 -3
  268. package/common/src/functions/snarkjs/verifySignedEnclaveResponse.cjs +1 -0
  269. package/common/src/functions/snarkjs/verifySignedEnclaveResponse.d.ts +1 -0
  270. package/common/src/functions/snarkjs/verifySignedEnclaveResponse.mjs +11 -0
  271. package/common/src/functions/utils/addresses.cjs +1 -1
  272. package/common/src/functions/utils/addresses.d.ts +1 -0
  273. package/common/src/functions/utils/addresses.mjs +6 -2
  274. package/common/src/functions/utils/buildClaimableDepositPlan.d.ts +2 -2
  275. package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
  276. package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.mjs +1 -1
  277. package/common/src/functions/utils/deposit-claimable.utils.cjs +1 -1
  278. package/common/src/functions/utils/deposit-claimable.utils.d.ts +1 -1
  279. package/common/src/functions/utils/deposit-claimable.utils.mjs +3 -1
  280. package/common/src/functions/utils/enclave-utxo-storage.cjs +1 -1
  281. package/common/src/functions/utils/enclave-utxo-storage.mjs +1 -1
  282. package/common/src/functions/utils/fees.utils.cjs +1 -1
  283. package/common/src/functions/utils/fees.utils.mjs +31 -31
  284. package/common/src/functions/utils/formatter.d.ts +1 -0
  285. package/common/src/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
  286. package/common/src/functions/utils/getUtxosFromReceipt.utils.mjs +6 -6
  287. package/common/src/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
  288. package/common/src/functions/utils/getUtxosFromReceiptSolana.mjs +11 -10
  289. package/common/src/functions/utils/index.cjs +1 -1
  290. package/common/src/functions/utils/index.d.ts +2 -2
  291. package/common/src/functions/utils/index.mjs +11 -10
  292. package/common/src/functions/utils/process.utils.cjs +1 -1
  293. package/common/src/functions/utils/process.utils.d.ts +0 -1
  294. package/common/src/functions/utils/process.utils.mjs +2 -11
  295. package/common/src/functions/utils/publicBalance.utils.cjs +1 -1
  296. package/common/src/functions/utils/publicBalance.utils.mjs +2 -1
  297. package/common/src/functions/utils/transfer-claimable.utils.cjs +1 -1
  298. package/common/src/functions/utils/transfer-claimable.utils.mjs +2 -2
  299. package/common/src/functions/utils/tron.utils.cjs +1 -1
  300. package/common/src/functions/utils/tron.utils.d.ts +5 -14
  301. package/common/src/functions/utils/tron.utils.mjs +91 -127
  302. package/common/src/functions/utils/waasStamp.cjs +1 -0
  303. package/common/src/functions/utils/waasStamp.d.ts +5 -0
  304. package/common/src/functions/utils/waasStamp.mjs +2 -0
  305. package/common/src/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  306. package/common/src/functions/web3/events/getInputUtxoAndBalance.d.ts +3 -8
  307. package/common/src/functions/web3/events/getInputUtxoAndBalance.mjs +44 -48
  308. package/common/src/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
  309. package/common/src/functions/web3/events/getInputUtxosEnclave.d.ts +4 -3
  310. package/common/src/functions/web3/events/getInputUtxosEnclave.mjs +34 -25
  311. package/common/src/functions/web3/events/getShieldedBalance.cjs +1 -1
  312. package/common/src/functions/web3/events/getShieldedBalance.d.ts +1 -1
  313. package/common/src/functions/web3/events/getShieldedBalance.mjs +88 -76
  314. package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
  315. package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +9 -6
  316. package/common/src/functions/web3/functionCalls/approveToken.cjs +1 -1
  317. package/common/src/functions/web3/functionCalls/approveToken.mjs +12 -12
  318. package/common/src/functions/web3/functionCalls/submitProof.cjs +1 -0
  319. package/common/src/functions/web3/functionCalls/submitProof.d.ts +5 -0
  320. package/common/src/functions/web3/functionCalls/submitProof.mjs +26 -0
  321. package/common/src/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -1
  322. package/common/src/functions/web3/functionCalls/transactCallDirectTron.d.ts +7 -3
  323. package/common/src/functions/web3/functionCalls/transactCallDirectTron.mjs +81 -87
  324. package/common/src/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  325. package/common/src/functions/web3/functionCalls/transactCallRelayer.d.ts +6 -11
  326. package/common/src/functions/web3/functionCalls/transactCallRelayer.mjs +4 -2
  327. package/common/src/functions/web3/functionCalls/waitForErc20Approvals.cjs +1 -1
  328. package/common/src/functions/web3/functionCalls/waitForErc20Approvals.mjs +6 -6
  329. package/common/src/functions/web3/getContractMetadata.cjs +1 -1
  330. package/common/src/functions/web3/getContractMetadata.mjs +1 -1
  331. package/common/src/functions/web3/getTokenHolder.cjs +1 -1
  332. package/common/src/functions/web3/getTokenHolder.mjs +3 -2
  333. package/common/src/functions/web3/index.cjs +1 -1
  334. package/common/src/functions/web3/index.d.ts +0 -3
  335. package/common/src/functions/web3/index.mjs +0 -3
  336. package/common/src/functions/web3/lifiAPI.cjs +1 -1
  337. package/common/src/functions/web3/lifiAPI.mjs +1 -1
  338. package/common/src/providers/TronProviderAdapter.cjs +1 -1
  339. package/common/src/providers/TronProviderAdapter.mjs +7 -1
  340. package/common/src/providers/WagmiProviderAdapter.cjs +1 -1
  341. package/common/src/providers/WagmiProviderAdapter.mjs +5 -5
  342. package/common/src/types/activities.types.cjs +1 -1
  343. package/common/src/types/activities.types.d.ts +0 -9
  344. package/common/src/types/activities.types.mjs +1 -1
  345. package/common/src/types/admin.types.cjs +1 -1
  346. package/common/src/types/admin.types.d.ts +3 -1
  347. package/common/src/types/admin.types.mjs +1 -1
  348. package/common/src/types/bridging-tx.types.d.ts +8 -0
  349. package/common/src/types/cache.types.cjs +1 -1
  350. package/common/src/types/cache.types.d.ts +2 -1
  351. package/common/src/types/cache.types.mjs +1 -1
  352. package/common/src/types/circom-data.types.d.ts +6 -0
  353. package/common/src/types/commitments.types.d.ts +2 -0
  354. package/common/src/types/dashboard-transaction.types.d.ts +3 -0
  355. package/common/src/types/ethereum-network.types.cjs +1 -1
  356. package/common/src/types/ethereum-network.types.d.ts +6 -15
  357. package/common/src/types/ethereum-network.types.mjs +1 -1
  358. package/common/src/types/external-action.types.cjs +1 -1
  359. package/common/src/types/external-action.types.d.ts +2 -5
  360. package/common/src/types/external-action.types.mjs +1 -1
  361. package/common/src/types/hinkal.types.cjs +1 -1
  362. package/common/src/types/hinkal.types.d.ts +4 -7
  363. package/common/src/types/hinkal.types.mjs +1 -1
  364. package/common/src/types/index.cjs +1 -1
  365. package/common/src/types/index.d.ts +2 -0
  366. package/common/src/types/index.mjs +1 -0
  367. package/common/src/types/near-intents.types.d.ts +1 -0
  368. package/common/src/types/offscreen.types.cjs +1 -1
  369. package/common/src/types/offscreen.types.d.ts +0 -1
  370. package/common/src/types/offscreen.types.mjs +1 -1
  371. package/common/src/types/pay-activities.types.d.ts +3 -0
  372. package/common/src/types/remote-proof.types.d.ts +0 -6
  373. package/common/src/types/remote-tx-build.types.d.ts +242 -0
  374. package/common/src/types/scheduled-transactions.types.d.ts +3 -0
  375. package/common/src/types/solana.types.d.ts +7 -0
  376. package/common/src/types/tenderly.api.types.d.ts +70 -0
  377. package/common/src/types/transact.types.cjs +1 -0
  378. package/common/src/types/transact.types.d.ts +53 -0
  379. package/common/src/types/transact.types.mjs +6 -0
  380. package/common/src/webworker/{logError-uy41lNp1.js → logError-CxZzSALU.js} +1 -1
  381. package/common/src/webworker/package.json +12 -12
  382. package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.cjs +1 -1
  383. package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.mjs +1 -1
  384. package/common/src/webworker/snarkjsWorkerNode.cjs +1 -1
  385. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
  386. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +1 -1
  387. package/common/src/webworker/utxoWorkerNode.cjs +1 -1
  388. package/common/src/webworker/viteWorkerURL.constant.cjs +3 -3
  389. package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
  390. package/common/src/webworker/workerProxy-swwPYw6e.js +1 -0
  391. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
  392. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +1 -1
  393. package/common/src/webworker/zkProofWorkerNode.cjs +1 -1
  394. package/index.cjs +1 -1
  395. package/index.mjs +1 -1
  396. package/internal/swapApi.cjs +1 -1
  397. package/internal/swapApi.d.ts +3 -3
  398. package/internal/swapApi.mjs +22 -25
  399. package/package.json +12 -12
  400. package/services/Hinkal.cjs +1 -1
  401. package/services/Hinkal.d.ts +3 -3
  402. package/services/Hinkal.mjs +7 -7
  403. package/types/IHinkal.d.ts +3 -3
  404. package/types/swap.types.d.ts +3 -20
  405. package/common/src/API/callOdosAPI.cjs +0 -1
  406. package/common/src/API/callOdosAPI.d.ts +0 -63
  407. package/common/src/API/callOdosAPI.mjs +0 -18
  408. package/common/src/API/callOneInchAPI.cjs +0 -1
  409. package/common/src/API/callOneInchAPI.d.ts +0 -24
  410. package/common/src/API/callOneInchAPI.mjs +0 -16
  411. package/common/src/constants/rewards.constants.d.ts +0 -2
  412. package/common/src/externalABIs/IQuoterV2.json.cjs +0 -1
  413. package/common/src/externalABIs/IQuoterV2.json.mjs +0 -203
  414. package/common/src/externalABIs/ISwapRouter.json.cjs +0 -1
  415. package/common/src/externalABIs/ISwapRouter.json.mjs +0 -537
  416. package/common/src/externalABIs/IUniswapV3Factory.json.cjs +0 -1
  417. package/common/src/externalABIs/IUniswapV3Factory.json.mjs +0 -188
  418. package/common/src/externalABIs/IUniswapV3Pool.json.cjs +0 -1
  419. package/common/src/externalABIs/IUniswapV3Pool.json.mjs +0 -938
  420. package/common/src/externalABIs/UniswapV2PoolAbi.json.cjs +0 -1
  421. package/common/src/externalABIs/UniswapV2PoolAbi.json.mjs +0 -78
  422. package/common/src/functions/pre-transaction/interaction-to-action.cjs +0 -1
  423. package/common/src/functions/pre-transaction/interaction-to-action.d.ts +0 -2
  424. package/common/src/functions/pre-transaction/interaction-to-action.mjs +0 -1
  425. package/common/src/functions/pre-transaction/recipientUtxoProcessing.cjs +0 -1
  426. package/common/src/functions/pre-transaction/recipientUtxoProcessing.d.ts +0 -3
  427. package/common/src/functions/pre-transaction/recipientUtxoProcessing.mjs +0 -30
  428. package/common/src/functions/private-wallet/opProducer.cjs +0 -1
  429. package/common/src/functions/private-wallet/opProducer.d.ts +0 -5
  430. package/common/src/functions/private-wallet/opProducer.mjs +0 -3
  431. package/common/src/functions/snarkjs/generateZkProofEnclave.cjs +0 -1
  432. package/common/src/functions/snarkjs/generateZkProofEnclave.d.ts +0 -5
  433. package/common/src/functions/snarkjs/generateZkProofEnclave.mjs +0 -27
  434. package/common/src/functions/utils/get-signature-header.cjs +0 -1
  435. package/common/src/functions/utils/get-signature-header.d.ts +0 -5
  436. package/common/src/functions/utils/get-signature-header.mjs +0 -4
  437. package/common/src/functions/web3/odosAPI.cjs +0 -1
  438. package/common/src/functions/web3/odosAPI.d.ts +0 -5
  439. package/common/src/functions/web3/odosAPI.mjs +0 -35
  440. package/common/src/functions/web3/oneInchAPI.cjs +0 -1
  441. package/common/src/functions/web3/oneInchAPI.d.ts +0 -5
  442. package/common/src/functions/web3/oneInchAPI.mjs +0 -44
  443. package/common/src/functions/web3/uniswapAPI.cjs +0 -1
  444. package/common/src/functions/web3/uniswapAPI.d.ts +0 -16
  445. package/common/src/functions/web3/uniswapAPI.mjs +0 -60
  446. package/common/src/webworker/workerProxy-MheXtWa4.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import { Logger as e } from "../../../error-handling/logger.mjs";
2
- import { getSequence as t, resolveSync as n } from "../../../functions/utils/resolve-sync.utils.mjs";
3
- import { blockReorgDepth as r } from "../../../constants/reorg-depths.constants.mjs";
4
- import { getProviderFromContract as i } from "../../../functions/utils/getSignerFromContract.mjs";
2
+ import { getProviderFromContract as t } from "../../../functions/utils/getSignerFromContract.mjs";
3
+ import { blockReorgDepth as n } from "../../../constants/reorg-depths.constants.mjs";
4
+ import { getSequence as r, resolveSync as i } from "../../../functions/utils/resolve-sync.utils.mjs";
5
5
  import { BlockchainEvent as a } from "../../BlockchainEvent/BlockchainEvent.mjs";
6
6
  import { ethers as o } from "ethers";
7
7
  //#region libs/shared/common/src/data-structures/event-service/evm/BlockchainEventEmitter.ts
@@ -62,18 +62,18 @@ var s = class {
62
62
  if (this._isReady) throw Error("Can't add event processor after event emitter initialized");
63
63
  this.eventProcessors.add(e);
64
64
  }
65
- async getEventsInRange(e, r) {
66
- let i = [];
67
- return await n(t(e, r, this.maxPageSize).map(({ from: e, to: t }) => async () => {
68
- let n = await this.getEventsForSingleContract(this.contract, e, t);
69
- i.push(...n);
70
- })), i.map((e) => a.fromEthers(e));
65
+ async getEventsInRange(e, t) {
66
+ let n = [];
67
+ return await i(r(e, t, this.maxPageSize).map(({ from: e, to: t }) => async () => {
68
+ let r = await this.getEventsForSingleContract(this.contract, e, t);
69
+ n.push(...r);
70
+ })), n.map((e) => a.fromEthers(e));
71
71
  }
72
72
  async getLastBlockNumberForEventRequest() {
73
- let e = await i(this.contract).getBlockNumber();
73
+ let e = await t(this.contract).getBlockNumber();
74
74
  if (!this.isServer) return e;
75
- let { chainId: t } = await i(this.contract).getNetwork();
76
- return Math.max(this.latestBlockNumber, e - r[Number(t)] + 1);
75
+ let { chainId: r } = await t(this.contract).getNetwork();
76
+ return Math.max(this.latestBlockNumber, e - n[Number(r)] + 1);
77
77
  }
78
78
  async retrieveEvents(t, n = !1) {
79
79
  return this.requireReady(), await this.eventsFetchingMutex.runExclusive(async () => {
@@ -1 +1 @@
1
- const e=require(`../../../error-handling/logger.cjs`),t=require(`../../../API/API.cjs`),n=require(`../../BlockchainEvent/BlockchainEvent.cjs`);var r=5e3,i=class{chainId;eventCategory;pollIntervalId;constructor(e,t){this.chainId=e,this.eventCategory=t}clear(){this.pollIntervalId!=null&&(clearInterval(this.pollIntervalId),this.pollIntervalId=void 0)}startUpdateListener(i,a,o){let s=a,c=async()=>{try{let{events:e,latestBlockNumber:r}=await t.API.getSnapshotServerEvents(this.chainId,this.eventCategory,s);e.length>0&&await i(e.map(e=>n.BlockchainEvent.fromSerialized(e))),r>=s&&(s=r+1,o(s))}catch(t){e.Logger.error(`Snapshot events poll error`,t)}};this.pollIntervalId=setInterval(c,r)}};exports.ClientEventHelper=i;
1
+ const e=require(`../../../API/API.cjs`),t=require(`../../../error-handling/logger.cjs`),n=require(`../../BlockchainEvent/BlockchainEvent.cjs`);var r=5e3,i=class{chainId;eventCategory;pollIntervalId;constructor(e,t){this.chainId=e,this.eventCategory=t}clear(){this.pollIntervalId!=null&&(clearInterval(this.pollIntervalId),this.pollIntervalId=void 0)}startUpdateListener(i,a,o){let s=a,c=async()=>{try{let{events:t,latestBlockNumber:r}=await e.API.getSnapshotServerEvents(this.chainId,this.eventCategory,s);t.length>0&&await i(t.map(e=>n.BlockchainEvent.fromSerialized(e))),r>=s&&(s=r+1,o(s))}catch(e){t.Logger.error(`Snapshot events poll error`,e)}};this.pollIntervalId=setInterval(c,r)}};exports.ClientEventHelper=i;
@@ -1,5 +1,5 @@
1
- import { Logger as e } from "../../../error-handling/logger.mjs";
2
- import { API as t } from "../../../API/API.mjs";
1
+ import { API as e } from "../../../API/API.mjs";
2
+ import { Logger as t } from "../../../error-handling/logger.mjs";
3
3
  import { BlockchainEvent as n } from "../../BlockchainEvent/BlockchainEvent.mjs";
4
4
  //#region libs/shared/common/src/data-structures/event-service/helpers/ClientEventHelper.ts
5
5
  var r = 5e3, i = class {
@@ -15,10 +15,10 @@ var r = 5e3, i = class {
15
15
  startUpdateListener(i, a, o) {
16
16
  let s = a, c = async () => {
17
17
  try {
18
- let { events: e, latestBlockNumber: r } = await t.getSnapshotServerEvents(this.chainId, this.eventCategory, s);
19
- e.length > 0 && await i(e.map((e) => n.fromSerialized(e))), r >= s && (s = r + 1, o(s));
20
- } catch (t) {
21
- e.error("Snapshot events poll error", t);
18
+ let { events: t, latestBlockNumber: r } = await e.getSnapshotServerEvents(this.chainId, this.eventCategory, s);
19
+ t.length > 0 && await i(t.map((e) => n.fromSerialized(e))), r >= s && (s = r + 1, o(s));
20
+ } catch (e) {
21
+ t.error("Snapshot events poll error", e);
22
22
  }
23
23
  };
24
24
  this.pollIntervalId = setInterval(c, r);
@@ -1 +1 @@
1
- const e=require(`../../../functions/utils/amounts.utils.cjs`),t=require(`../../../crypto/poseidon.cjs`),n=require(`../../crypto-keys/decodeUTXO.cjs`);require(`../../../crypto/index.cjs`);const r=require(`../../merkle-tree/MerkleTree.cjs`);require(`../../merkle-tree/index.cjs`);const i=require(`../../../functions/utils/merkleTree.utils.cjs`),a=require(`./AbstractSolanaSnapshotService.cjs`);var o=class extends a.AbstractSolanaSnapshotService{constructor(e){super(e,`NewCommitment`)}_merkleTree;_encryptedOutputs;_encryptedOutputsByCommitment=new Map;get merkleTree(){return this._merkleTree}get encryptedOutputs(){return this._encryptedOutputs}serializeSnapshot(e){return{merkleTree:e.payload.merkleTree.toJSON(),latestBlockNumber:e.latestBlockNumber,encryptedOutputs:e.payload.encryptedOutputs.map(e=>({value:e.value,isPositive:String(e.isPositive),isBlocked:e.isBlocked??!1})),encryptedOutputsByCommitment:Array.from(e.payload.encryptedOutputsByCommitment.entries()).map(([e,t])=>({commitment:e.toString(),encryptedOutput:t}))}}deserializeSnapshot(e){let n;n=e.latestBlockNumber&&e.merkleTree?i.contructMerkleTreeFromSerialized(e.merkleTree):r.MerkleTree.create(t.poseidonFunction,0n);let a=e.encryptedOutputs?.map(e=>({value:e.value,isPositive:JSON.parse(e.isPositive),isBlocked:e.isBlocked??!1})),o=new Map;return e.encryptedOutputsByCommitment?.forEach(({commitment:e,encryptedOutput:t})=>{o.set(BigInt(e),t)}),{latestBlockNumber:e.latestBlockNumber??0,payload:{merkleTree:n,encryptedOutputs:a||[],encryptedOutputsByCommitment:o}}}getSnapshotPayload(){return{merkleTree:this._merkleTree,encryptedOutputs:this._encryptedOutputs,encryptedOutputsByCommitment:this._encryptedOutputsByCommitment}}populateSnapshot({payload:{merkleTree:e,encryptedOutputs:t,encryptedOutputsByCommitment:n}}){this._merkleTree=e,this._encryptedOutputs=t,this._encryptedOutputsByCommitment=n}async mapEvent(t){let r=t.getArg(`commitment`),i=t.getArg(`index`),a=t.getArg(`encrypted_output`),o=t.getArg(`on_chain_data`),s=e.advancedToBigInt(r),c=e.advancedToBigInt(i);return a.length===0?{commitment:s,index:c,encryptedOutput:n.encodeSolanaOnChainUtxo(o)}:{commitment:s,index:c,encryptedOutput:`0x${Buffer.from(a).toString(`hex`)}`}}acceptEvent(e,t,r,i){let a=e.index>=0n?e.index:-1n*e.index,o=this._merkleTree.getValue(a);if(o===e.commitment)return!1;this._merkleTree.insert(e.commitment,a);let s=o===void 0?void 0:this._encryptedOutputsByCommitment.get(o);if(o!==void 0&&s!==void 0){let e=this.encryptedOutputs.findIndex(e=>e.value===s);e!==-1&&this.encryptedOutputs.splice(e,1),this._encryptedOutputsByCommitment.delete(o)}if(this._encryptedOutputsByCommitment.set(e.commitment,e.encryptedOutput),this.encryptedOutputs.map(e=>e.value).includes(e.encryptedOutput))return!0;let c={value:e.encryptedOutput,isPositive:!n.isSolanaOnChainUtxo(e.encryptedOutput),isBlocked:i??!1};return this._encryptedOutputs.push(c),!0}};exports.AbstractSolanaCommitmentsSnapshotService=o;
1
+ const e=require(`../../../functions/utils/amounts.utils.cjs`),t=require(`../../../crypto/poseidon.cjs`),n=require(`../../crypto-keys/decodeUTXO.cjs`);require(`../../../crypto/index.cjs`);const r=require(`../../merkle-tree/MerkleTree.cjs`);require(`../../merkle-tree/index.cjs`);const i=require(`../../../functions/utils/merkleTree.utils.cjs`),a=require(`./AbstractSolanaSnapshotService.cjs`);var o=class extends a.AbstractSolanaSnapshotService{constructor(e){super(e,`NewCommitment`)}_merkleTree;_encryptedOutputs;_encryptedOutputsByCommitment=new Map;get merkleTree(){return this._merkleTree}get encryptedOutputs(){return this._encryptedOutputs}serializeSnapshot(e){return{merkleTree:e.payload.merkleTree.toJSON(),latestBlockNumber:e.latestBlockNumber,encryptedOutputs:e.payload.encryptedOutputs.map(e=>({value:e.value,isPositive:String(e.isPositive),isBlocked:e.isBlocked??!1,encryptedBlob:e.encryptedBlob})),encryptedOutputsByCommitment:Array.from(e.payload.encryptedOutputsByCommitment.entries()).map(([e,t])=>({commitment:e.toString(),encryptedOutput:t}))}}deserializeSnapshot(e){let n;n=e.latestBlockNumber&&e.merkleTree?i.contructMerkleTreeFromSerialized(e.merkleTree):r.MerkleTree.create(t.poseidonFunction,0n);let a=e.encryptedOutputs?.map(e=>({value:e.value,isPositive:JSON.parse(e.isPositive),isBlocked:e.isBlocked??!1,encryptedBlob:e.encryptedBlob})),o=new Map;return e.encryptedOutputsByCommitment?.forEach(({commitment:e,encryptedOutput:t})=>{o.set(BigInt(e),t)}),{latestBlockNumber:e.latestBlockNumber??0,payload:{merkleTree:n,encryptedOutputs:a||[],encryptedOutputsByCommitment:o}}}getSnapshotPayload(){return{merkleTree:this._merkleTree,encryptedOutputs:this._encryptedOutputs,encryptedOutputsByCommitment:this._encryptedOutputsByCommitment}}populateSnapshot({payload:{merkleTree:e,encryptedOutputs:t,encryptedOutputsByCommitment:n}}){this._merkleTree=e,this._encryptedOutputs=t,this._encryptedOutputsByCommitment=n}async mapEvent(t){let r=t.getArg(`commitment`),i=t.getArg(`index`),a=t.getArg(`encrypted_output`),o=t.getArg(`on_chain_data`),s=e.advancedToBigInt(r),c=e.advancedToBigInt(i),l=`0x${Buffer.from(a).toString(`hex`)}`;return n.hasSolanaOnChainData(o)?{commitment:s,index:c,encryptedOutput:n.encodeSolanaOnChainUtxo(o),encryptedBlob:a.length>0?l:void 0}:{commitment:s,index:c,encryptedOutput:l}}acceptEvent(e,t,r,i){let a=e.index>=0n?e.index:-1n*e.index,o=this._merkleTree.getValue(a);if(o===e.commitment)return!1;this._merkleTree.insert(e.commitment,a);let s=o===void 0?void 0:this._encryptedOutputsByCommitment.get(o);if(o!==void 0&&s!==void 0){let e=this.encryptedOutputs.findIndex(e=>e.value===s);e!==-1&&this.encryptedOutputs.splice(e,1),this._encryptedOutputsByCommitment.delete(o)}if(this._encryptedOutputsByCommitment.set(e.commitment,e.encryptedOutput),this.encryptedOutputs.map(e=>e.value).includes(e.encryptedOutput))return!0;let c={value:e.encryptedOutput,isPositive:!n.isSolanaOnChainUtxo(e.encryptedOutput),isBlocked:i??!1,encryptedBlob:e.encryptedBlob};return this._encryptedOutputs.push(c),!0}};exports.AbstractSolanaCommitmentsSnapshotService=o;
@@ -1,13 +1,13 @@
1
1
  import { advancedToBigInt as e } from "../../../functions/utils/amounts.utils.mjs";
2
2
  import { poseidonFunction as t } from "../../../crypto/poseidon.mjs";
3
- import { encodeSolanaOnChainUtxo as n, isSolanaOnChainUtxo as r } from "../../crypto-keys/decodeUTXO.mjs";
3
+ import { encodeSolanaOnChainUtxo as n, hasSolanaOnChainData as r, isSolanaOnChainUtxo as i } from "../../crypto-keys/decodeUTXO.mjs";
4
4
  import "../../../crypto/index.mjs";
5
- import { MerkleTree as i } from "../../merkle-tree/MerkleTree.mjs";
5
+ import { MerkleTree as a } from "../../merkle-tree/MerkleTree.mjs";
6
6
  import "../../merkle-tree/index.mjs";
7
- import { contructMerkleTreeFromSerialized as a } from "../../../functions/utils/merkleTree.utils.mjs";
8
- import { AbstractSolanaSnapshotService as o } from "./AbstractSolanaSnapshotService.mjs";
7
+ import { contructMerkleTreeFromSerialized as o } from "../../../functions/utils/merkleTree.utils.mjs";
8
+ import { AbstractSolanaSnapshotService as s } from "./AbstractSolanaSnapshotService.mjs";
9
9
  //#region libs/shared/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.ts
10
- var s = class extends o {
10
+ var c = class extends s {
11
11
  constructor(e) {
12
12
  super(e, "NewCommitment");
13
13
  }
@@ -27,7 +27,8 @@ var s = class extends o {
27
27
  encryptedOutputs: e.payload.encryptedOutputs.map((e) => ({
28
28
  value: e.value,
29
29
  isPositive: String(e.isPositive),
30
- isBlocked: e.isBlocked ?? !1
30
+ isBlocked: e.isBlocked ?? !1,
31
+ encryptedBlob: e.encryptedBlob
31
32
  })),
32
33
  encryptedOutputsByCommitment: Array.from(e.payload.encryptedOutputsByCommitment.entries()).map(([e, t]) => ({
33
34
  commitment: e.toString(),
@@ -37,20 +38,21 @@ var s = class extends o {
37
38
  }
38
39
  deserializeSnapshot(e) {
39
40
  let n;
40
- n = e.latestBlockNumber && e.merkleTree ? a(e.merkleTree) : i.create(t, 0n);
41
+ n = e.latestBlockNumber && e.merkleTree ? o(e.merkleTree) : a.create(t, 0n);
41
42
  let r = e.encryptedOutputs?.map((e) => ({
42
43
  value: e.value,
43
44
  isPositive: JSON.parse(e.isPositive),
44
- isBlocked: e.isBlocked ?? !1
45
- })), o = /* @__PURE__ */ new Map();
45
+ isBlocked: e.isBlocked ?? !1,
46
+ encryptedBlob: e.encryptedBlob
47
+ })), i = /* @__PURE__ */ new Map();
46
48
  return e.encryptedOutputsByCommitment?.forEach(({ commitment: e, encryptedOutput: t }) => {
47
- o.set(BigInt(e), t);
49
+ i.set(BigInt(e), t);
48
50
  }), {
49
51
  latestBlockNumber: e.latestBlockNumber ?? 0,
50
52
  payload: {
51
53
  merkleTree: n,
52
54
  encryptedOutputs: r || [],
53
- encryptedOutputsByCommitment: o
55
+ encryptedOutputsByCommitment: i
54
56
  }
55
57
  };
56
58
  }
@@ -65,18 +67,19 @@ var s = class extends o {
65
67
  this._merkleTree = e, this._encryptedOutputs = t, this._encryptedOutputsByCommitment = n;
66
68
  }
67
69
  async mapEvent(t) {
68
- let r = t.getArg("commitment"), i = t.getArg("index"), a = t.getArg("encrypted_output"), o = t.getArg("on_chain_data"), s = e(r), c = e(i);
69
- return a.length === 0 ? {
70
- commitment: s,
71
- index: c,
72
- encryptedOutput: n(o)
70
+ let i = t.getArg("commitment"), a = t.getArg("index"), o = t.getArg("encrypted_output"), s = t.getArg("on_chain_data"), c = e(i), l = e(a), u = `0x${Buffer.from(o).toString("hex")}`;
71
+ return r(s) ? {
72
+ commitment: c,
73
+ index: l,
74
+ encryptedOutput: n(s),
75
+ encryptedBlob: o.length > 0 ? u : void 0
73
76
  } : {
74
- commitment: s,
75
- index: c,
76
- encryptedOutput: `0x${Buffer.from(a).toString("hex")}`
77
+ commitment: c,
78
+ index: l,
79
+ encryptedOutput: u
77
80
  };
78
81
  }
79
- acceptEvent(e, t, n, i) {
82
+ acceptEvent(e, t, n, r) {
80
83
  let a = e.index >= 0n ? e.index : -1n * e.index, o = this._merkleTree.getValue(a);
81
84
  if (o === e.commitment) return !1;
82
85
  this._merkleTree.insert(e.commitment, a);
@@ -88,11 +91,12 @@ var s = class extends o {
88
91
  if (this._encryptedOutputsByCommitment.set(e.commitment, e.encryptedOutput), this.encryptedOutputs.map((e) => e.value).includes(e.encryptedOutput)) return !0;
89
92
  let c = {
90
93
  value: e.encryptedOutput,
91
- isPositive: !r(e.encryptedOutput),
92
- isBlocked: i ?? !1
94
+ isPositive: !i(e.encryptedOutput),
95
+ isBlocked: r ?? !1,
96
+ encryptedBlob: e.encryptedBlob
93
97
  };
94
98
  return this._encryptedOutputs.push(c), !0;
95
99
  }
96
100
  };
97
101
  //#endregion
98
- export { s as AbstractSolanaCommitmentsSnapshotService };
102
+ export { c as AbstractSolanaCommitmentsSnapshotService };
@@ -1 +1 @@
1
- const e=require(`../../constants/protocol.constants.cjs`),t=require(`../../error-handling/logError.cjs`),n=require(`./MerkleTreeIncompleteError.cjs`);var r=class r{tree;count;index;reverseTree;static createWithData(e,t,n,i,a,o,s){return new r(a,o,s,e,t,n,i)}static create(t,n,i=e.MERKLE_LEVELS){return new r(t,i,n)}createReverseTree(){let e=new Map;for(let t=this.getStartIndex();t<this.getStartIndex()+this.count;t+=1n){let n=this.tree.get(t);n!==void 0&&e.set(n,t)}return e}constructor(e,t,n,r,i,a,o){this.hashFunction=e,this.levels=t,this.defaultNodeValue=n,this.tree=r??new Map,this.count=o??0n,this.index=a??2n**(t-1n),i?this.reverseTree=i:this.reverseTree=this.createReverseTree()}getStartIndex(){return 2n**(this.levels-1n)}logarithm2(e){let t=0n;for(;2n**t<e;)t+=1n;return t}bigIntMax(e,t){return e>t?e:t}forceInsert(e,t){if(t<this.getStartIndex())throw RangeError();this.tree.set(t,e),this.reverseTree.set(e,t);let n=this.index-this.getStartIndex(),r=this.logarithm2(n),i=t;for(let e=1n;e<=r;e+=1n){i/=2n;let e=this.hashFunction(this.tree.get(i*2n)||this.defaultNodeValue,this.tree.get(i*2n+1n)||this.defaultNodeValue);this.tree.set(i,e)}}insert(e,n){let r=!1;this.tree.has(n)&&(r=!0,t.logError(`Editing commitment index: ${n} `)),r||(this.count+=1n),this.index=this.bigIntMax(this.index,n+1n),this.forceInsert(e,n)}remove(e){this.forceInsert(this.defaultNodeValue,e)}completenessCheck(){if(this.count!==this.index-this.getStartIndex())throw new n.MerkleTreeIncompleteError}getRootHash(){this.completenessCheck();for(let e=1n;e<2n**this.levels;e*=2n)if(this.tree.get(e))return this.tree.get(e);return this.defaultNodeValue}getMerkleData(){return this.completenessCheck(),new Map(this.tree)}getValue(e){return this.tree.get(e)}getSiblingIndex(e){return e===1n?1n:e%2n==1n?e-1n:e+1n}getSiblingHashesForVerification(e){this.completenessCheck();let t=this.reverseTree.get(e);if(t===void 0)return Array(25).fill(0n);let n=[];for(;t!==0n;)n.push(this.tree.get(this.getSiblingIndex(t))||this.defaultNodeValue),t/=2n;return n.slice(0,25)}getSiblingSides(e){this.completenessCheck();let t=this.reverseTree.get(e);if(t===void 0)return Array(25).fill(0n);let n=[];for(;t!==0n;){let e=t%2n==0n?0n:1n;n.push(e),t/=2n}return n.slice(0,25)}toJSON(){let{tree:e,reverseTree:t,count:n,index:r}=this;return{tree:Object.fromEntries(e),reverseTree:Object.fromEntries(t),count:n.toString(),index:r.toString()}}toJSONLite(){let{tree:e,count:t,index:n}=this;return{tree:Object.fromEntries(e),count:t.toString(),index:n.toString()}}clone(){return r.createWithData(new Map(this.tree),new Map(this.reverseTree),this.index,this.count,this.hashFunction,this.levels,this.defaultNodeValue)}getIndex(){return this.index}};exports.MerkleTree=r;
1
+ const e=require(`../../constants/protocol.constants.cjs`),t=require(`../../error-handling/logError.cjs`),n=require(`./MerkleTreeIncompleteError.cjs`);var r=class r{tree;count;index;reverseTree;static createWithData(e,t,n,i,a,o,s){return new r(a,o,s,e,t,n,i)}static create(t,n,i=e.MERKLE_LEVELS){return new r(t,i,n)}createReverseTree(){let e=new Map;for(let t=this.getStartIndex();t<this.getStartIndex()+this.count;t+=1n){let n=this.tree.get(t);n!==void 0&&e.set(n,t)}return e}constructor(e,t,n,r,i,a,o){this.hashFunction=e,this.levels=t,this.defaultNodeValue=n,this.tree=r??new Map,this.count=o??0n,this.index=a??2n**(t-1n),i?this.reverseTree=i:this.reverseTree=this.createReverseTree()}getStartIndex(){return 2n**(this.levels-1n)}logarithm2(e){let t=0n;for(;2n**t<e;)t+=1n;return t}bigIntMax(e,t){return e>t?e:t}forceInsert(e,t){if(t<this.getStartIndex())throw RangeError();this.tree.set(t,e),this.reverseTree.set(e,t);let n=this.index-this.getStartIndex(),r=this.logarithm2(n),i=t;for(let e=1n;e<=r;e+=1n){i/=2n;let e=this.hashFunction(this.tree.get(i*2n)||this.defaultNodeValue,this.tree.get(i*2n+1n)||this.defaultNodeValue);this.tree.set(i,e)}}insert(e,n){let r=!1;this.tree.has(n)&&(r=!0,t.logError(`Editing commitment index: ${n} `)),r||(this.count+=1n),this.index=this.bigIntMax(this.index,n+1n),this.forceInsert(e,n)}remove(e){this.forceInsert(this.defaultNodeValue,e)}completenessCheck(){if(this.count!==this.index-this.getStartIndex())throw new n.MerkleTreeIncompleteError}getRootHash(){this.completenessCheck();for(let e=1n;e<2n**this.levels;e*=2n)if(this.tree.get(e))return this.tree.get(e);return this.defaultNodeValue}getMerkleData(){return this.completenessCheck(),new Map(this.tree)}getValue(e){return this.tree.get(e)}getSiblingIndex(e){return e===1n?1n:e%2n==1n?e-1n:e+1n}getSiblingHashesForVerification(e){this.completenessCheck();let t=this.reverseTree.get(e);if(t===void 0)return Array(25).fill(0n);let n=[];for(;t!==0n;)n.push(this.tree.get(this.getSiblingIndex(t))??this.defaultNodeValue),t/=2n;return n.slice(0,25)}getSiblingSides(e){this.completenessCheck();let t=this.reverseTree.get(e);if(t===void 0)return Array(25).fill(0n);let n=[];for(;t!==0n;){let e=t%2n==0n?0n:1n;n.push(e),t/=2n}return n.slice(0,25)}toJSON(){let{tree:e,reverseTree:t,count:n,index:r}=this;return{tree:Object.fromEntries(e),reverseTree:Object.fromEntries(t),count:n.toString(),index:r.toString()}}toJSONLite(){let{tree:e,count:t,index:n}=this;return{tree:Object.fromEntries(e),count:t.toString(),index:n.toString()}}clone(){return r.createWithData(new Map(this.tree),new Map(this.reverseTree),this.index,this.count,this.hashFunction,this.levels,this.defaultNodeValue)}getIndex(){return this.index}getInsertionSiblingData(e){let t=[],n=[],r=e;for(;r!==0n;)t.push(this.tree.get(this.getSiblingIndex(r))??this.defaultNodeValue),n.push(r%2n==0n?0n:1n),r/=2n;return{siblings:t.slice(0,25),sides:n.slice(0,25)}}};exports.MerkleTree=r;
@@ -79,4 +79,14 @@ export declare class MerkleTree<T> {
79
79
  toJSONLite(): MerkleTreeJson;
80
80
  clone(): MerkleTree<T>;
81
81
  getIndex(): bigint;
82
+ /**
83
+ * Compute sibling hashes and sides needed to prove insertion at a given leaf index.
84
+ * Used by the Tron circuit to compute newRootHash off-chain.
85
+ * The caller is responsible for passing the correct nodeIndex (e.g. tree.getIndex()
86
+ * for the first insertion, or tree.getIndex() + 1n after simulating the first).
87
+ */
88
+ getInsertionSiblingData(nodeIndex: bigint): {
89
+ siblings: T[];
90
+ sides: bigint[];
91
+ };
82
92
  }
@@ -74,7 +74,7 @@ var r = class r {
74
74
  let t = this.reverseTree.get(e);
75
75
  if (t === void 0) return Array(25).fill(0n);
76
76
  let n = [];
77
- for (; t !== 0n;) n.push(this.tree.get(this.getSiblingIndex(t)) || this.defaultNodeValue), t /= 2n;
77
+ for (; t !== 0n;) n.push(this.tree.get(this.getSiblingIndex(t)) ?? this.defaultNodeValue), t /= 2n;
78
78
  return n.slice(0, 25);
79
79
  }
80
80
  getSiblingSides(e) {
@@ -111,6 +111,14 @@ var r = class r {
111
111
  getIndex() {
112
112
  return this.index;
113
113
  }
114
+ getInsertionSiblingData(e) {
115
+ let t = [], n = [], r = e;
116
+ for (; r !== 0n;) t.push(this.tree.get(this.getSiblingIndex(r)) ?? this.defaultNodeValue), n.push(r % 2n == 0n ? 0n : 1n), r /= 2n;
117
+ return {
118
+ siblings: t.slice(0, 25),
119
+ sides: n.slice(0, 25)
120
+ };
121
+ }
114
122
  };
115
123
  //#endregion
116
124
  export { r as MerkleTree };
@@ -1 +1 @@
1
- const e=require(`../../functions/web3/etherFunctions.cjs`),t=require(`../../functions/utils/upToDateState.cjs`),n=require(`../../error-handling/logger.cjs`),r=require(`../../types/balances.types.cjs`),i=require(`../../functions/utils/string.utils.cjs`),a=require(`./BalanceChangedHandler.cjs`),o=require(`../IndexedDB/private-balances-db.cjs`),s=require(`../IndexedDB/prices-db.cjs`),c=require(`./privateBalancesReducer.cjs`);var l=class{privateBalancesState={};privateBalancesListeners=new Set;hinkal;unsubscribeBalanceChange;constructor(e){this.hinkal=e,this.unsubscribeBalanceChange=a.balanceChangedHandler.subscribe(e=>{this.applyRefreshFromBalanceChangeEvent(e).catch(e=>{n.Logger.error(`Private balance refresh from balance change failed:`,e)})})}getSnapshot(){return this.privateBalancesState}onPrivateBalancesWithUSDChange(e){return this.privateBalancesListeners.add(e),()=>this.privateBalancesListeners.delete(e)}dispose(){this.unsubscribeBalanceChange(),this.privateBalancesListeners.clear()}async applyRefreshFromBalanceChangeEvent(e){if(!e){await this.refreshInternal(r.PrivateBalanceUpdateType.FreshWithoutLoader);return}let{updateType:t,balanceChangeState:n,chainIdToUpdate:i,resetCacheBefore:a,updateTokensListBefore:o}=e;await this.refreshInternal(t,n,a,o,i)}dispatch(e){this.privateBalancesState=c.privateBalancesReducer(this.privateBalancesState,e);let t=this.privateBalancesState;this.privateBalancesListeners.forEach(e=>e(t))}async getAddressAndChain(e){try{return{ethAdd:e?.ethereumAddress??await this.hinkal.getEthereumAddress(),userKeys:e?.userKeys??this.hinkal.userKeys}}catch{return{ethAdd:void 0,userKeys:void 0}}}async hasCache(e,t){return await o.privateBalancesStorage.getBalancesByWallet(e,t)!==void 0}async getBalancesWithUsdValues(t,r){try{if(!r)return[];let n=t.map(e=>e.token.erc20TokenAddress);if(!n.length)return[];let i=await s.pricesStorage.getAndUpdatePrices(r,n),a=new Map(n.map((e,t)=>[e,i[t]]));return[...t.map(t=>{try{let n=t.token.erc20TokenAddress,r=a.get(n)??0,i=t.balance,o=Number(e.getAmountInToken(t.token,i))*r;return{...t,usdValue:o}}catch{return{...t,usdValue:0}}})]}catch{return n.Logger.log(`Error fetching private token balances`),[]}}handleCached=async(r,a)=>{try{await t.checkAddressNotUpdated(this.hinkal,r),this.dispatch({type:`SET_BALANCES`,chainId:a,balances:void 0});let n=await o.privateBalancesStorage.getBalancesByWallet(r,a),c=await s.pricesStorage.getPrices();if(await t.checkAddressNotUpdated(this.hinkal,r),!n||(this.dispatch({type:`SET_BALANCES`,chainId:a,balances:n}),!c))return;let l=n.map(t=>{let n=i.getTokenStateKey(t.token.erc20TokenAddress,a);return{...t,usdValue:c[n]?Number(e.getAmountInToken(t.token,t.balance))*c[n]:0}});this.dispatch({type:`SET_USD_BALANCES`,chainId:a,balances:l})}catch(e){n.Logger.error(`Error refreshing cached private balance:`,e)}};handleFresh=async(e,r,i,a,s,c)=>{let l=s;try{await t.checkAddressNotUpdated(this.hinkal,e);let n=await this.hasCache(e,r);await t.checkAddressNotUpdated(this.hinkal,e),l=s||!n,l&&this.dispatch({type:`SET_LOADING`,chainId:r,newValue:!0}),await t.checkAddressNotUpdated(this.hinkal,e),a&&await this.hinkal.resetMerkle([r]);let u=await this.hinkal.getTotalBalance(r,i,e,a,c);await t.checkAddressNotUpdated(this.hinkal,e);let d=u.filter(e=>e.balance>0n);this.dispatch({type:`SET_BALANCES`,chainId:r,balances:d}),await o.privateBalancesStorage.setBalances(e,r,d),await t.checkAddressNotUpdated(this.hinkal,e),l&&(this.dispatch({type:`SET_USD_LOADING`,chainId:r,newValue:!0}),this.dispatch({type:`SET_LOADING`,chainId:r,newValue:!1})),await t.checkAddressNotUpdated(this.hinkal,e);let f=await this.getBalancesWithUsdValues(d,r);await t.checkAddressNotUpdated(this.hinkal,e),f.length>0&&this.dispatch({type:`SET_USD_BALANCES`,chainId:r,balances:f})}catch(e){n.Logger.error(`Error refreshing private balance:`,e)}finally{l&&(this.dispatch({type:`SET_LOADING`,chainId:r,newValue:!1}),this.dispatch({type:`SET_USD_LOADING`,chainId:r,newValue:!1}))}};getSupportedChainsToUpdate(e){let t=this.hinkal.getSupportedChains();return e?t.includes(e)?[e]:[]:t}async refreshInternal(e=r.PrivateBalanceUpdateType.FreshWithoutLoader,t,n=!1,i=!1,a){let{ethAdd:o,userKeys:s}=await this.getAddressAndChain(t);!o||!s?.getShieldedPublicKey()||await Promise.all(this.getSupportedChainsToUpdate(a).map(async t=>{switch(e){case r.PrivateBalanceUpdateType.OnlyCache:await this.handleCached(o,t);break;case r.PrivateBalanceUpdateType.Fresh:await this.handleFresh(o,t,s,n,!0,i);break;case r.PrivateBalanceUpdateType.FreshWithoutLoader:await this.handleFresh(o,t,s,n,!1,i);break;default:break}}))}};exports.HinkalPrivateBalanceController=l;
1
+ const e=require(`../../functions/web3/etherFunctions.cjs`),t=require(`../../functions/utils/upToDateState.cjs`),n=require(`../../types/balances.types.cjs`),r=require(`../../error-handling/logger.cjs`),i=require(`../../functions/utils/string.utils.cjs`),a=require(`../../constants/balance.constants.cjs`),o=require(`./BalanceChangedHandler.cjs`),s=require(`../IndexedDB/private-balances-db.cjs`),c=require(`../IndexedDB/prices-db.cjs`),l=require(`./privateBalancesReducer.cjs`);var u=class{privateBalancesState={};privateBalancesListeners=new Set;hinkal;unsubscribeBalanceChange;pollIntervalId;pollInFlight=!1;constructor(e){this.hinkal=e,this.unsubscribeBalanceChange=o.balanceChangedHandler.subscribe(e=>{this.applyRefreshFromBalanceChangeEvent(e).catch(e=>{r.Logger.error(`Private balance refresh from balance change failed:`,e)})}),this.pollIntervalId=setInterval(()=>this.pollRemoteBalances(),a.REMOTE_BALANCE_POLL_INTERVAL_MS)}getSnapshot(){return this.privateBalancesState}onPrivateBalancesWithUSDChange(e){return this.privateBalancesListeners.add(e),()=>this.privateBalancesListeners.delete(e)}dispose(){clearInterval(this.pollIntervalId),this.unsubscribeBalanceChange(),this.privateBalancesListeners.clear()}pollRemoteBalances(){this.privateBalancesListeners.size!==0&&(!this.hinkal.generateProofRemotely||this.pollInFlight||(this.pollInFlight=!0,this.refreshInternal(n.PrivateBalanceUpdateType.FreshWithoutLoader,void 0,!1,!0).catch(e=>{r.Logger.error(`Remote private balance poll failed:`,e)}).finally(()=>{this.pollInFlight=!1})))}async applyRefreshFromBalanceChangeEvent(e){if(!e){await this.refreshInternal(n.PrivateBalanceUpdateType.FreshWithoutLoader);return}let{updateType:t,balanceChangeState:r,chainIdToUpdate:i,resetCacheBefore:a,updateTokensListBefore:o}=e;await this.refreshInternal(t,r,a,o,i)}dispatch(e){this.privateBalancesState=l.privateBalancesReducer(this.privateBalancesState,e);let t=this.privateBalancesState;this.privateBalancesListeners.forEach(e=>e(t))}async getAddressAndChain(e){try{return{ethAdd:e?.ethereumAddress??await this.hinkal.getEthereumAddress(),userKeys:e?.userKeys??this.hinkal.userKeys}}catch{return{ethAdd:void 0,userKeys:void 0}}}async hasCache(e,t){return await s.privateBalancesStorage.getBalancesByWallet(e,t)!==void 0}async getBalancesWithUsdValues(t,n){try{if(!n)return[];let r=t.map(e=>e.token.erc20TokenAddress);if(!r.length)return[];let i=await c.pricesStorage.getAndUpdatePrices(n,r),a=new Map(r.map((e,t)=>[e,i[t]]));return[...t.map(t=>{try{let n=t.token.erc20TokenAddress,r=a.get(n)??0,i=t.balance,o=Number(e.getAmountInToken(t.token,i))*r;return{...t,usdValue:o}}catch{return{...t,usdValue:0}}})]}catch{return r.Logger.log(`Error fetching private token balances`),[]}}handleCached=async(n,a)=>{try{await t.checkAddressNotUpdated(this.hinkal,n),this.dispatch({type:`SET_BALANCES`,chainId:a,balances:void 0});let r=await s.privateBalancesStorage.getBalancesByWallet(n,a),o=await c.pricesStorage.getPrices();if(await t.checkAddressNotUpdated(this.hinkal,n),!r||(this.dispatch({type:`SET_BALANCES`,chainId:a,balances:r}),!o))return;let l=r.map(t=>{let n=i.getTokenStateKey(t.token.erc20TokenAddress,a);return{...t,usdValue:o[n]?Number(e.getAmountInToken(t.token,t.balance))*o[n]:0}});this.dispatch({type:`SET_USD_BALANCES`,chainId:a,balances:l})}catch(e){r.Logger.error(`Error refreshing cached private balance:`,e)}};handleFresh=async(e,n,i,a,o,c)=>{let l=o;try{await t.checkAddressNotUpdated(this.hinkal,e);let r=await this.hasCache(e,n);await t.checkAddressNotUpdated(this.hinkal,e),l=o||!r,l&&this.dispatch({type:`SET_LOADING`,chainId:n,newValue:!0}),await t.checkAddressNotUpdated(this.hinkal,e),a&&await this.hinkal.resetMerkle([n]);let u=await this.hinkal.getTotalBalance(n,i,e,a,c);await t.checkAddressNotUpdated(this.hinkal,e);let d=u.filter(e=>e.balance>0n);this.dispatch({type:`SET_BALANCES`,chainId:n,balances:d}),await s.privateBalancesStorage.setBalances(e,n,d),await t.checkAddressNotUpdated(this.hinkal,e),l&&(this.dispatch({type:`SET_USD_LOADING`,chainId:n,newValue:!0}),this.dispatch({type:`SET_LOADING`,chainId:n,newValue:!1})),await t.checkAddressNotUpdated(this.hinkal,e);let f=await this.getBalancesWithUsdValues(d,n);await t.checkAddressNotUpdated(this.hinkal,e),f.length>0&&this.dispatch({type:`SET_USD_BALANCES`,chainId:n,balances:f})}catch(e){r.Logger.error(`Error refreshing private balance:`,e)}finally{l&&(this.dispatch({type:`SET_LOADING`,chainId:n,newValue:!1}),this.dispatch({type:`SET_USD_LOADING`,chainId:n,newValue:!1}))}};getSupportedChainsToUpdate(e){let t=this.hinkal.getSupportedChains();return e?t.includes(e)?[e]:[]:t}async refreshInternal(e=n.PrivateBalanceUpdateType.FreshWithoutLoader,t,r=!1,i=!1,a){let{ethAdd:o,userKeys:s}=await this.getAddressAndChain(t);!o||!s?.getShieldedPublicKey()||await Promise.all(this.getSupportedChainsToUpdate(a).map(async t=>{switch(e){case n.PrivateBalanceUpdateType.OnlyCache:await this.handleCached(o,t);break;case n.PrivateBalanceUpdateType.Fresh:await this.handleFresh(o,t,s,r,!0,i);break;case n.PrivateBalanceUpdateType.FreshWithoutLoader:await this.handleFresh(o,t,s,r,!1,i);break;default:break}}))}};exports.HinkalPrivateBalanceController=u;
@@ -5,10 +5,13 @@ export declare class HinkalPrivateBalanceController {
5
5
  private readonly privateBalancesListeners;
6
6
  private readonly hinkal;
7
7
  private readonly unsubscribeBalanceChange;
8
+ private readonly pollIntervalId;
9
+ private pollInFlight;
8
10
  constructor(hinkal: IHinkal);
9
11
  getSnapshot(): PrivateBalancesState;
10
12
  onPrivateBalancesWithUSDChange(callback: (state: PrivateBalancesState) => void): () => void;
11
13
  dispose(): void;
14
+ private pollRemoteBalances;
12
15
  private applyRefreshFromBalanceChangeEvent;
13
16
  private dispatch;
14
17
  private getAddressAndChain;
@@ -1,24 +1,27 @@
1
1
  import { getAmountInToken as e } from "../../functions/web3/etherFunctions.mjs";
2
2
  import { checkAddressNotUpdated as t } from "../../functions/utils/upToDateState.mjs";
3
- import { Logger as n } from "../../error-handling/logger.mjs";
4
- import { PrivateBalanceUpdateType as r } from "../../types/balances.types.mjs";
3
+ import { PrivateBalanceUpdateType as n } from "../../types/balances.types.mjs";
4
+ import { Logger as r } from "../../error-handling/logger.mjs";
5
5
  import { getTokenStateKey as i } from "../../functions/utils/string.utils.mjs";
6
- import { balanceChangedHandler as a } from "./BalanceChangedHandler.mjs";
7
- import { privateBalancesStorage as o } from "../IndexedDB/private-balances-db.mjs";
8
- import { pricesStorage as s } from "../IndexedDB/prices-db.mjs";
9
- import { privateBalancesReducer as c } from "./privateBalancesReducer.mjs";
6
+ import { REMOTE_BALANCE_POLL_INTERVAL_MS as a } from "../../constants/balance.constants.mjs";
7
+ import { balanceChangedHandler as o } from "./BalanceChangedHandler.mjs";
8
+ import { privateBalancesStorage as s } from "../IndexedDB/private-balances-db.mjs";
9
+ import { pricesStorage as c } from "../IndexedDB/prices-db.mjs";
10
+ import { privateBalancesReducer as l } from "./privateBalancesReducer.mjs";
10
11
  //#region libs/shared/common/src/data-structures/private-balances/HinkalPrivateBalanceController.ts
11
- var l = class {
12
+ var u = class {
12
13
  privateBalancesState = {};
13
14
  privateBalancesListeners = /* @__PURE__ */ new Set();
14
15
  hinkal;
15
16
  unsubscribeBalanceChange;
17
+ pollIntervalId;
18
+ pollInFlight = !1;
16
19
  constructor(e) {
17
- this.hinkal = e, this.unsubscribeBalanceChange = a.subscribe((e) => {
20
+ this.hinkal = e, this.unsubscribeBalanceChange = o.subscribe((e) => {
18
21
  this.applyRefreshFromBalanceChangeEvent(e).catch((e) => {
19
- n.error("Private balance refresh from balance change failed:", e);
22
+ r.error("Private balance refresh from balance change failed:", e);
20
23
  });
21
- });
24
+ }), this.pollIntervalId = setInterval(() => this.pollRemoteBalances(), a);
22
25
  }
23
26
  getSnapshot() {
24
27
  return this.privateBalancesState;
@@ -27,18 +30,25 @@ var l = class {
27
30
  return this.privateBalancesListeners.add(e), () => this.privateBalancesListeners.delete(e);
28
31
  }
29
32
  dispose() {
30
- this.unsubscribeBalanceChange(), this.privateBalancesListeners.clear();
33
+ clearInterval(this.pollIntervalId), this.unsubscribeBalanceChange(), this.privateBalancesListeners.clear();
34
+ }
35
+ pollRemoteBalances() {
36
+ this.privateBalancesListeners.size !== 0 && (!this.hinkal.generateProofRemotely || this.pollInFlight || (this.pollInFlight = !0, this.refreshInternal(n.FreshWithoutLoader, void 0, !1, !0).catch((e) => {
37
+ r.error("Remote private balance poll failed:", e);
38
+ }).finally(() => {
39
+ this.pollInFlight = !1;
40
+ })));
31
41
  }
32
42
  async applyRefreshFromBalanceChangeEvent(e) {
33
43
  if (!e) {
34
- await this.refreshInternal(r.FreshWithoutLoader);
44
+ await this.refreshInternal(n.FreshWithoutLoader);
35
45
  return;
36
46
  }
37
- let { updateType: t, balanceChangeState: n, chainIdToUpdate: i, resetCacheBefore: a, updateTokensListBefore: o } = e;
38
- await this.refreshInternal(t, n, a, o, i);
47
+ let { updateType: t, balanceChangeState: r, chainIdToUpdate: i, resetCacheBefore: a, updateTokensListBefore: o } = e;
48
+ await this.refreshInternal(t, r, a, o, i);
39
49
  }
40
50
  dispatch(e) {
41
- this.privateBalancesState = c(this.privateBalancesState, e);
51
+ this.privateBalancesState = l(this.privateBalancesState, e);
42
52
  let t = this.privateBalancesState;
43
53
  this.privateBalancesListeners.forEach((e) => e(t));
44
54
  }
@@ -56,14 +66,14 @@ var l = class {
56
66
  }
57
67
  }
58
68
  async hasCache(e, t) {
59
- return await o.getBalancesByWallet(e, t) !== void 0;
69
+ return await s.getBalancesByWallet(e, t) !== void 0;
60
70
  }
61
- async getBalancesWithUsdValues(t, r) {
71
+ async getBalancesWithUsdValues(t, n) {
62
72
  try {
63
- if (!r) return [];
64
- let n = t.map((e) => e.token.erc20TokenAddress);
65
- if (!n.length) return [];
66
- let i = await s.getAndUpdatePrices(r, n), a = new Map(n.map((e, t) => [e, i[t]]));
73
+ if (!n) return [];
74
+ let r = t.map((e) => e.token.erc20TokenAddress);
75
+ if (!r.length) return [];
76
+ let i = await c.getAndUpdatePrices(n, r), a = new Map(r.map((e, t) => [e, i[t]]));
67
77
  return [...t.map((t) => {
68
78
  try {
69
79
  let n = t.token.erc20TokenAddress, r = a.get(n) ?? 0, i = t.balance, o = Number(e(t.token, i)) * r;
@@ -79,27 +89,27 @@ var l = class {
79
89
  }
80
90
  })];
81
91
  } catch {
82
- return n.log("Error fetching private token balances"), [];
92
+ return r.log("Error fetching private token balances"), [];
83
93
  }
84
94
  }
85
- handleCached = async (r, a) => {
95
+ handleCached = async (n, a) => {
86
96
  try {
87
- await t(this.hinkal, r), this.dispatch({
97
+ await t(this.hinkal, n), this.dispatch({
88
98
  type: "SET_BALANCES",
89
99
  chainId: a,
90
100
  balances: void 0
91
101
  });
92
- let n = await o.getBalancesByWallet(r, a), c = await s.getPrices();
93
- if (await t(this.hinkal, r), !n || (this.dispatch({
102
+ let r = await s.getBalancesByWallet(n, a), o = await c.getPrices();
103
+ if (await t(this.hinkal, n), !r || (this.dispatch({
94
104
  type: "SET_BALANCES",
95
105
  chainId: a,
96
- balances: n
97
- }), !c)) return;
98
- let l = n.map((t) => {
106
+ balances: r
107
+ }), !o)) return;
108
+ let l = r.map((t) => {
99
109
  let n = i(t.token.erc20TokenAddress, a);
100
110
  return {
101
111
  ...t,
102
- usdValue: c[n] ? Number(e(t.token, t.balance)) * c[n] : 0
112
+ usdValue: o[n] ? Number(e(t.token, t.balance)) * o[n] : 0
103
113
  };
104
114
  });
105
115
  this.dispatch({
@@ -108,51 +118,51 @@ var l = class {
108
118
  balances: l
109
119
  });
110
120
  } catch (e) {
111
- n.error("Error refreshing cached private balance:", e);
121
+ r.error("Error refreshing cached private balance:", e);
112
122
  }
113
123
  };
114
- handleFresh = async (e, r, i, a, s, c) => {
115
- let l = s;
124
+ handleFresh = async (e, n, i, a, o, c) => {
125
+ let l = o;
116
126
  try {
117
127
  await t(this.hinkal, e);
118
- let n = await this.hasCache(e, r);
119
- await t(this.hinkal, e), l = s || !n, l && this.dispatch({
128
+ let r = await this.hasCache(e, n);
129
+ await t(this.hinkal, e), l = o || !r, l && this.dispatch({
120
130
  type: "SET_LOADING",
121
- chainId: r,
131
+ chainId: n,
122
132
  newValue: !0
123
- }), await t(this.hinkal, e), a && await this.hinkal.resetMerkle([r]);
124
- let u = await this.hinkal.getTotalBalance(r, i, e, a, c);
133
+ }), await t(this.hinkal, e), a && await this.hinkal.resetMerkle([n]);
134
+ let u = await this.hinkal.getTotalBalance(n, i, e, a, c);
125
135
  await t(this.hinkal, e);
126
136
  let d = u.filter((e) => e.balance > 0n);
127
137
  this.dispatch({
128
138
  type: "SET_BALANCES",
129
- chainId: r,
139
+ chainId: n,
130
140
  balances: d
131
- }), await o.setBalances(e, r, d), await t(this.hinkal, e), l && (this.dispatch({
141
+ }), await s.setBalances(e, n, d), await t(this.hinkal, e), l && (this.dispatch({
132
142
  type: "SET_USD_LOADING",
133
- chainId: r,
143
+ chainId: n,
134
144
  newValue: !0
135
145
  }), this.dispatch({
136
146
  type: "SET_LOADING",
137
- chainId: r,
147
+ chainId: n,
138
148
  newValue: !1
139
149
  })), await t(this.hinkal, e);
140
- let f = await this.getBalancesWithUsdValues(d, r);
150
+ let f = await this.getBalancesWithUsdValues(d, n);
141
151
  await t(this.hinkal, e), f.length > 0 && this.dispatch({
142
152
  type: "SET_USD_BALANCES",
143
- chainId: r,
153
+ chainId: n,
144
154
  balances: f
145
155
  });
146
156
  } catch (e) {
147
- n.error("Error refreshing private balance:", e);
157
+ r.error("Error refreshing private balance:", e);
148
158
  } finally {
149
159
  l && (this.dispatch({
150
160
  type: "SET_LOADING",
151
- chainId: r,
161
+ chainId: n,
152
162
  newValue: !1
153
163
  }), this.dispatch({
154
164
  type: "SET_USD_LOADING",
155
- chainId: r,
165
+ chainId: n,
156
166
  newValue: !1
157
167
  }));
158
168
  }
@@ -161,18 +171,18 @@ var l = class {
161
171
  let t = this.hinkal.getSupportedChains();
162
172
  return e ? t.includes(e) ? [e] : [] : t;
163
173
  }
164
- async refreshInternal(e = r.FreshWithoutLoader, t, n = !1, i = !1, a) {
174
+ async refreshInternal(e = n.FreshWithoutLoader, t, r = !1, i = !1, a) {
165
175
  let { ethAdd: o, userKeys: s } = await this.getAddressAndChain(t);
166
176
  !o || !s?.getShieldedPublicKey() || await Promise.all(this.getSupportedChainsToUpdate(a).map(async (t) => {
167
177
  switch (e) {
168
- case r.OnlyCache:
178
+ case n.OnlyCache:
169
179
  await this.handleCached(o, t);
170
180
  break;
171
- case r.Fresh:
172
- await this.handleFresh(o, t, s, n, !0, i);
181
+ case n.Fresh:
182
+ await this.handleFresh(o, t, s, r, !0, i);
173
183
  break;
174
- case r.FreshWithoutLoader:
175
- await this.handleFresh(o, t, s, n, !1, i);
184
+ case n.FreshWithoutLoader:
185
+ await this.handleFresh(o, t, s, r, !1, i);
176
186
  break;
177
187
  default: break;
178
188
  }
@@ -180,4 +190,4 @@ var l = class {
180
190
  }
181
191
  };
182
192
  //#endregion
183
- export { l as HinkalPrivateBalanceController };
193
+ export { u as HinkalPrivateBalanceController };
@@ -1,2 +1,2 @@
1
1
  var e={WC_NO_MATCHING_KEY:`creating the transaction failed
2
- version`,CONNECTION_PROBLEM:`Failed to connect wallet. Please try again.`,REQUEST_PENDING:`request of type 'wallet_requestpermissions' already pending for origin`},t={INSUFFICIENT_FUNDS:`Insufficient funds`,INSUFFICIENT_FUNDS_WITHDRAW:`Not enough funds to withdraw`,INSUFFICIENT_FUNDS_TRANSFER:`Not enough funds to transfer`,INSUFFICIENT_FUNDS_TO_TRANSACT:`Not enough funds to transact`,INSUFFICIENT_FUNDS_GAS:`Insufficient funds for gas * price`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Insufficient TRX balance to cover transfer amount and transaction fee reserve`,INSUFFICIENT_SOL_BALANCE:`Insufficient SOL balance`},n={GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT:`Skipped shielding due to gas fee exceeding your limit.`,AUTO_SHIELD_INSUFFICIENT_GAS:`Auto-Shield skipped due to insufficient gas.`},r={...e,...t,...n,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`ApproxParamsInvalid`,NOT_ENOUGH_TOKENS:`Transfer amount exceeds balance`,TRANSACTION_NOT_CONFIRMED:`The transaction was not confirmed by the network. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Non-200 status code: '429'`,RELAYER_NOT_AVAILABLE:`All relayers are busy, please try in a few seconds`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,CONNECT_ERROR:`Connection error`,CONNECT_ERROR2:`DOMException: Failed`,USER_REJECTED_TX:`Transaction rejected`,USER_REJECTED_SIGN:`User rejected signing`,USER_REJECTED_TRANSACTION:`user rejected transaction`,USER_REJECTED_SIGN2:`User rejected the request`,USER_REJECTED_CONNECTION:`The user rejected connection.`,USER_REJECTED_RPC:`User has rejected`,SIMULATION_FAILED:`Simulation failed:`,USER_DENIED_TRANSACTION_SIGNATURE:`User denied transaction signature.`,USER_DENIED_REQUEST_SIGNATURE:`User denied request signature.`,SIGNING_FAILED:`The signing failed. Please, try again`,SIGNATURE_UNSUPPORTED_CHAINS:`Details: Unsupported chains`,SIGNATURE_UNSUPPORTED_CHAINS2:`User disapproved requested chains`,SIGNATURE_REQUEST_EXPIRED:`Request expired. Please try again`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`The method personal_sign does not exist`,USER_DISAPPROVED_REQUESTED_METHODS:`User disapproved requested methods`,INVALID_AUTHORIZATION:`The requested account and/or method has not been authorized by the user`,INVALID_NULLIFIER:`Nullifier cannot be reused`,SANCTIONED_ADDRESS:`Address is sanctioned`,INVALID_AMOUNT:`Please, select correct amount`,RECIPIENT_FORMAT_INCORRECT:`Recipient Information format is incorrect`,INVALID_TOKEN:`Invalid token provided`,STATE_TO_UPDATE:`Error in template Verifier_219 line: 121`,INVALID_RECEIVER:`Receiver address doesn't match`,INVALID_RELAYER:`Relayer address doesn't match`,INVALID_RELAYER_FEE:`Relayer fee amount is not valid`,TIMESTAMP_STALE:`Timestamp provided does not align with current time`,INVALID_ZKP:`Proof must be valid`,NO_TRANSACTIONS_TO_CERTIFY:`This week, you do not have transactions to certify`,RECIPIENT_AMOUNT_INVALID:`Recipient amount is invalid`,UNSUPPORTED_NETWORK:`The selected network is not supported. Please switch to another network to continue.`,SIG_BY_OWNER:`Signature must be signed by the owner of the contract`,AMOUNT_EMPTY:`Please, specify amount`,RELAYER_ISSUE:`Relayer has some issues. Try again later`,RELAYER_GAS_ESTIMATE:`Relayer was not able to estimate the gas costs of tx. Please, try later`,RECEIVER_EMPTY:`Please, enter recipient address`,VALID_ETHEREUM_ADDRESS:`Please, input valid ethereum address`,METAMASK_NOT_INSTALLED:`Please, install Metamask Wallet`,VIABLE_TX:`The transaction is not viable. Please increase the swap amount to swap with Relayer`,TRANSACTION_REPLACED:`transaction was replaced`,TRANSACTION_REPLACED2:`replacement fee too low`,TRANSACTION_CANCELED:`Transaction was cancelled. Please try again`,NONCE_HIGH:`Nonce too high`,WALLET_CONNECT_MATCHING_KEYS:`No matching key. keychain`,UNKNOWN_PROVIDER:`Unknown provider`,SAFE_ERC:`SafeERC20: low-level call failed`,SAFE_ERC_APPROVE:`SafeERC20: approve from non-zero to non-zero allowance`,SWAP_RELAYER_MIN:`Relayer minimum fee is not satisfied`,LOW_LEVEL_CALL:`low-level delegate call failed`,INTEGRAL_CURVE_ZERO:`previous integral cannot be zero`,ODOS_FETCH:`Odos API Fetch Error`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,SLIPPAGE_LIMIT:`Slippage Limit Exceeded`,SLIPPAGE_LIMIT_1:`Slippage screwed you`,QUOTE_EXPIRED:`Quote has expired`,REVERT_NO_STRING:`Transaction reverted without a reason string`,UNISWAP_NOT_ENOUGH_LIQUIDITY:`Not Enough Liquidity`,CONNECTION_FAILED:`Failed to connect`,FAILED_TO_SWITCH_NETWORKS:`Please switch networks in your wallet settings`,INVALID_FROM:`Invalid from token`,INVALID_TO:`Invalid to token`,Invalid_Password:`Invalid password`,INTERNAL_ERROR:`Internal error: please, try again`,INVALID_MERKLE_ROOT:`Invalid merkle tree root`,MERLE_TREE_SNARK:`Error in template ForceEqualIfEnabled`,ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED:`Chain/address changed: balance updated canceled`,DECIMALS_LIMIT:`Number of decimals exceed maximum`,MERKLE_TREE_INCOMPLETE:`Merkle tree is incomplete`,FAIL_ESTIMATE_GAS:`Failed to estimate gas: check the transaction parameters`,LEDGER_IS_LOCKED:`Ledger device: Locked device`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Ledger device: UNKNOWN_ERROR (0x6a8c)`,LEDGER_IS_NOT_AVAILABLE:`Ledger device: UNKNOWN_ERROR`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,ODOS_SWAP_FAILED:`Odos swap call failed`,ONEINCH_SWAP_FAILED:`One inch swap failed`,GAS_ESTIMATION_ERROR:`Failed Gas Estimates Response`,GAS_ESTIMATE_INCORRECT_PARAMETERS:`Incorrect Parameters for Gas Estimate`,CONNECTIVITY_ERROR:`Request failed with status code 500`,TRANSACTION_FAILED:`Transaction Failed: Revert`,NO_SWAP_QUOTES:`No swap quotes available`,NO_UNISWAP_PRICE:`Cannot get Uniswap Price`,NO_ODOS_PRICE:`Cannot get Odos Price`,NO_ONEINCH_PRICE:`Cannot get OneInch Price`,NO_LIFI_PRICE:`Cannot get LiFi Price`,FEES_OVER_TRANSACTION_VALUE:`Fees are over transaction value. Please, increase the amount`,GAS_STATION_NOT_AVAILABLE:`Gas Station Not Available`,INBALANCE_IN_TOKEN:`Inbalance in token detected`,BALANCE_EQUATION_FAILED:`Balance Diff Should be equal to sum of onchain and offchain created commitments`,TOKEN_ADD_ERROR:`Error occoured while adding token. Please make sure you are adding a valid ERC-20 token`,CANNOT_ESTIMATE_GAS:`transaction may require manual gas limit`,NETWORK_ERROR:`Network Error`,MAX_FEE_GAS_ERROR:`max fee per gas less than block base fee`,CORS_ERROR:`has been blocked by CORS policy`,CANNOT_ESTIMATE_GAS2:`transaction may fail or may require manual gas limit`,NO_RESPONSE_PRIVATE:`No resonse from private relay`,TRY_AGAIN_AFTER_TRANSACTION:`Please, try again`,ALREADY_SUBSCRIBED:`User Already Subscribed`,PREFERRED_TOKEN_OR_ADDRESS_MISSING:`Please, specify both the preferred token and public wallet address`,SNAPSHOT_FILE_NOT_FOUND:`We are updating our servers. Please try again in some time`,SAME_ADDRESS_FORBIDDEN:`You cannot recieve staked tokens on the same ethereum address`,NOT_VALID_ETHEREUM_ADDRESS:`Please enter a valid Ethereum address`,MUST_STAKE_AT_LEAST_ONE_ETH:`Amount too low, Please stake at least 1 ETH`,OUT_OF_MEMORY:`Out of memory: Cannot allocate Wasm memory`,OUT_OF_MEMORY2:`could not allocate memory`,OUT_OF_MEMORY3:`out of memory`,UNKNOWN:`Unknown error`,TRANSACTION_WRONG_REQUEST:`The requested Transaction type is not supported`,INSUFFICIENT_LAMPORTS:`insufficient lamports`,TOKENS_DO_NOT_BELONG_SAME_CHAIN:`Tokens belong to different chains. All tokens must belong to the same chain`,OKX_MIN_RETURN_NOT_REACHED:`custom program error: 0x177a`,MIN_RETURNED_NOT_REACHED:`MinReturnNotReached`,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:`ReceivedAmountLowerThanExpected`,AUTO_SHIELD_SKIPPED:`We skipped auto-shield because the asset was an NFT or the remaining token was used as gas.`,LOW_OUTPUT_AMOUNT:`Gas fees exceed received amount. Please try adjusting amount or lowering slippage.`,EXECUTION_REVERTED:`execution reverted`,SOLANA_TRANSACTION_LOG_SIZE_LIMIT:`Transaction logs are too large. Please try again later`,COMPUTATIONAL_BUDGET_EXCEEDED:`ComputationalBudgetExceeded`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Relay Fee is over withdraw amount`,TRON_CONFIRMATION_DECLINED:`Confirmation declined by user`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`One of the source addresses is restricted from private transactions`,ACCOUNT_RESOURCE_INSUFFICIENT_ERROR:`Account resource insufficient error`},i=`Not enough memory. Please, close some tabs/applications to free up memory and try again`,a=`Your transaction didn’t go through due to price slippage. Try increasing your slippage tolerance`,o={USER_REJECTED_TRANSACTION:`You cancelled the transaction`,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`The amount you provided is too high, please adjust the amount`,WC_NO_MATCHING_KEY:`Wallet Connect error. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Rate Limit: please, use different rpc provider in your wallet`,INSUFFICIENT_FUNDS_GAS:`Your balance is too low to cover the transaction fees. Please add funds to proceed`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Your TRX balance is too low to cover amount and transaction fee`,INVALID_NULLIFIER:`There seems to be an issue with syncing your balance. Please press the refresh icon next to your shielded balance`,STATE_TO_UPDATE:`A technical issue has occurred. Please create a ticket on Hinkal discord server`,INVALID_ZKP:`The Zero Knowledge Proof provided is invalid. Please check and try again`,NONCE_HIGH:`To resolve this issue, please reset your wallet in the Settings`,UNKNOWN_PROVIDER:`The provider is not recognized. Please check your settings`,TRANSACTION_REPLACED:`Your transaction was replaced by another. Please submit your transaction again`,TRANSACTION_REPLACED2:`This transaction was replaced. Please try submitting again`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,SAFE_ERC:`Your approved amount is lower than what you’re trying to send. Increase the approval or adjust the amount, then try again.`,SIMULATION_FAILED:`Transaction simulation failed. Please try again.`,SAFE_ERC_APPROVE:`The selected ERC20 Token could not be approved. Please contact the Hinkal support team`,INTEGRAL_CURVE_ZERO:`There's an issue with the pool's staking function. Please contact the Hinkal support team for assistance`,LOW_LEVEL_CALL:`A technical issue occurred. Please contact the Hinkal team for assistance`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,USER_REJECTED_SIGN2:`You canceled the request`,USER_REJECTED_RPC:`You canceled the request`,USER_DENIED_TRANSACTION_SIGNATURE:`You canceled the request`,USER_DENIED_REQUEST_SIGNATURE:`You canceled the request`,ODOS_FETCH:`Current Odos price is unavailable. Please try again`,ODOS_SWAP_FAILED:`Your Odos Swap transaction didn’t go through. Please try again`,ONEINCH_SWAP_FAILED:`Your 1inch Swap transaction didn’t go through. Please try again`,CONNECT_ERROR2:`Oops, there are connectivity issues. Please check your internet connection and try again`,WALLET_CONNECT_MATCHING_KEYS:`An internal WalletConnect error occurred. Please try reconnecting`,SIGNATURE_UNSUPPORTED_CHAINS:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_CHAINS2:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`Your active wallet doesn't support personal signatures. Please use a different wallet`,REVERT_NO_STRING:`Your transaction didn’t go through due to technical issues. Please submit a ticket on Hinkal discord server`,INVALID_MERKLE_ROOT:`There's an issue with the merkle tree root. Please submit a ticket on Hinkal discord server`,MERLE_TREE_SNARK:`An error occurred in the circuit processing. Please submit a ticket on Hinkal discord server`,MAX_FEE_GAS_ERROR:`Your transaction was rejected due to high network congestion`,MERKLE_TREE_INCOMPLETE:`A technical issue has occurred. Please submit a ticket on Hinkal discord server`,CORS_ERROR:`Unable to reach the remote client. Please submit a ticket on Hinkal discord server`,NETWORK_ERROR:`Connection error. Please, check back later`,CONNECTIVITY_ERROR:`A connectivity issue occurred. Please check your network connection`,LEDGER_IS_LOCKED:`Your wallet is locked. Please unlock your wallet`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Your ledger is not allowed to sign transactions. Please allow blind signing`,LEDGER_IS_NOT_AVAILABLE:`Access denied to use Ledger device.`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,INBALANCE_IN_TOKEN:a,OKX_MIN_RETURN_NOT_REACHED:a,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:a,MIN_RETURNED_NOT_REACHED:a,BALANCE_EQUATION_FAILED:`There's an issue with the balance calculation. Please adjust your transaction parameters`,SLIPPAGE_LIMIT_1:`Your transaction didn’t go through due to price slippage. Adjust slippage settings and retry`,CANNOT_ESTIMATE_GAS:`Unable to estimate the gas required. Please set the gas limit manually`,CANNOT_ESTIMATE_GAS2:`Your transaction didn’t go through. Please try setting gas limit manually`,GAS_STATION_NOT_AVAILABLE:`The Gas Station service is currently unavailable. Please submit a ticket on Hinkal discord server`,TIMESTAMP_STALE:`This transaction is outdated. Please initiate a new transaction`,ALREADY_SUBSCRIBED:`This email is already subscribed to the Hinkal newsletter`,OUT_OF_MEMORY:i,OUT_OF_MEMORY2:i,OUT_OF_MEMORY3:i,INVALID_RECOVERY_PHRASE:`Invalid recovery phrase`,PHRASES_DONT_MATCH:`Phrases do not match. You can go back and verify your recovery phrase.`,PASSWORDS_DONT_MATCH:`Passwords do not match`,PASSWORD_SAME_AS_OLD:`Password cannot be the same as the old one`,PASSWORD_TOO_SMALL:`Password must be at least 8 characters`,PASSWORD_NOT_CORRECT:`Incorrect current password`,CODE_ALREADY_USED:`This code has already been used`,ACCESS_CODE_REQUIRED:`Access code is required`,ACCESS_CODE_IS_ALREADY_IN_USE:`Access code is already in use`,ACCESS_CODE_IS_ALREADY_IN_USE1:`Access code already in use. Import or connect existing wallet`,ERROR_DURING_PHRASE_CONFIRMATION:`Error during Phrase confirmation`,INSUFFICIENT_LAMPORTS:`Your SOL balance is too low to complete this transaction`,EXECUTION_REVERTED:`Your transaction reverted.`,COMPUTATIONAL_BUDGET_EXCEEDED:`Your transaction exceeded the limited compute units. Please try again.`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Your transaction didn’t go through because the relay fee exceeded the transaction amount`,TRON_CONFIRMATION_DECLINED:`You canceled the request`,INVALID_RELAYER_FEE:`The transaction fee changed while submitting. Please try again.`,REQUEST_PENDING:`A request is already pending in your wallet. Please confirm to connect.`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`The funds you’re trying to use have been flagged as sanctioned.`,NO_SWAP_QUOTES:`No swap route available for this token pair on the selected network at the moment. Please try again later or adjust the swap parameters.`},s={UTXO_LIMITATIONS:`Your transaction exceeds the UTXO limit`,INSUFFICIENT_BALANCE_FOR_FEES:`Fees are high right now and would consume a large portion of your balance. Consider reducing the amount or retrying later.`,HIGH_FEE_WARNING:`Total fees exceed your available balance. Consider adding funds or retry later when fees decrease.`};exports.DIRECTLY_SHOW_MESSAGE_ERROR_CODES=s,exports.UserFriendlyErrorCodes=o,exports.gasErrorCodes=n,exports.insufficientResourcesErrorCodes=t,exports.transactionErrorCodes=r;
2
+ version`,CONNECTION_PROBLEM:`Failed to connect wallet. Please try again.`,REQUEST_PENDING:`request of type 'wallet_requestpermissions' already pending for origin`},t={INSUFFICIENT_FUNDS:`Insufficient funds`,INSUFFICIENT_FUNDS_WITHDRAW:`Not enough funds to withdraw`,INSUFFICIENT_FUNDS_TRANSFER:`Not enough funds to transfer`,INSUFFICIENT_FUNDS_TO_TRANSACT:`Not enough funds to transact`,INSUFFICIENT_FUNDS_GAS:`Insufficient funds for gas * price`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Insufficient TRX balance to cover transfer amount and transaction fee reserve`,INSUFFICIENT_SOL_BALANCE:`Insufficient SOL balance`},n={GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT:`Skipped shielding due to gas fee exceeding your limit.`,AUTO_SHIELD_INSUFFICIENT_GAS:`Auto-Shield skipped due to insufficient gas.`},r={...e,...t,...n,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`ApproxParamsInvalid`,NOT_ENOUGH_TOKENS:`Transfer amount exceeds balance`,TRANSACTION_NOT_CONFIRMED:`The transaction was not confirmed by the network. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Non-200 status code: '429'`,RELAYER_NOT_AVAILABLE:`All relayers are busy, please try in a few seconds`,NO_STUCK_BALANCE_TO_WITHDRAW:`No stuck balance found to withdraw`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,CONNECT_ERROR:`Connection error`,CONNECT_ERROR2:`DOMException: Failed`,USER_REJECTED_TX:`Transaction rejected`,USER_REJECTED_SIGN:`User rejected signing`,USER_REJECTED_TRANSACTION:`user rejected transaction`,USER_REJECTED_SIGN2:`User rejected the request`,USER_REJECTED_CONNECTION:`The user rejected connection.`,USER_REJECTED_RPC:`User has rejected`,SIMULATION_FAILED:`Simulation failed:`,USER_DENIED_TRANSACTION_SIGNATURE:`User denied transaction signature.`,USER_DENIED_REQUEST_SIGNATURE:`User denied request signature.`,SIGNING_FAILED:`The signing failed. Please, try again`,SIGNATURE_UNSUPPORTED_CHAINS:`Details: Unsupported chains`,SIGNATURE_UNSUPPORTED_CHAINS2:`User disapproved requested chains`,SIGNATURE_REQUEST_EXPIRED:`Request expired. Please try again`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`The method personal_sign does not exist`,USER_DISAPPROVED_REQUESTED_METHODS:`User disapproved requested methods`,INVALID_AUTHORIZATION:`The requested account and/or method has not been authorized by the user`,INVALID_NULLIFIER:`Nullifier cannot be reused`,SANCTIONED_ADDRESS:`Address is sanctioned`,INVALID_AMOUNT:`Please, select correct amount`,RECIPIENT_FORMAT_INCORRECT:`Recipient Information format is incorrect`,INVALID_TOKEN:`Invalid token provided`,STATE_TO_UPDATE:`Error in template Verifier_219 line: 121`,INVALID_RECEIVER:`Receiver address doesn't match`,INVALID_RELAYER:`Relayer address doesn't match`,INVALID_RELAYER_FEE:`Relayer fee amount is not valid`,TIMESTAMP_STALE:`Timestamp provided does not align with current time`,INVALID_ZKP:`Proof must be valid`,NO_TRANSACTIONS_TO_CERTIFY:`This week, you do not have transactions to certify`,RECIPIENT_AMOUNT_INVALID:`Recipient amount is invalid`,UNSUPPORTED_NETWORK:`The selected network is not supported. Please switch to another network to continue.`,SIG_BY_OWNER:`Signature must be signed by the owner of the contract`,AMOUNT_EMPTY:`Please, specify amount`,RELAYER_ISSUE:`Relayer has some issues. Try again later`,RELAYER_GAS_ESTIMATE:`Relayer was not able to estimate the gas costs of tx. Please, try later`,RECEIVER_EMPTY:`Please, enter recipient address`,VALID_ETHEREUM_ADDRESS:`Please, input valid ethereum address`,METAMASK_NOT_INSTALLED:`Please, install Metamask Wallet`,VIABLE_TX:`The transaction is not viable. Please increase the swap amount to swap with Relayer`,TRANSACTION_REPLACED:`transaction was replaced`,TRANSACTION_REPLACED2:`replacement fee too low`,TRANSACTION_CANCELED:`Transaction was cancelled. Please try again`,NONCE_HIGH:`Nonce too high`,WALLET_CONNECT_MATCHING_KEYS:`No matching key. keychain`,UNKNOWN_PROVIDER:`Unknown provider`,SAFE_ERC:`SafeERC20: low-level call failed`,SAFE_ERC_APPROVE:`SafeERC20: approve from non-zero to non-zero allowance`,SWAP_RELAYER_MIN:`Relayer minimum fee is not satisfied`,LOW_LEVEL_CALL:`low-level delegate call failed`,INTEGRAL_CURVE_ZERO:`previous integral cannot be zero`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,SLIPPAGE_LIMIT:`Slippage Limit Exceeded`,SLIPPAGE_LIMIT_1:`Slippage screwed you`,QUOTE_EXPIRED:`Quote has expired`,REVERT_NO_STRING:`Transaction reverted without a reason string`,CONNECTION_FAILED:`Failed to connect`,FAILED_TO_SWITCH_NETWORKS:`Please switch networks in your wallet settings`,INVALID_FROM:`Invalid from token`,INVALID_TO:`Invalid to token`,Invalid_Password:`Invalid password`,INTERNAL_ERROR:`Internal error: please, try again`,INVALID_MERKLE_ROOT:`Invalid merkle tree root`,MERLE_TREE_SNARK:`Error in template ForceEqualIfEnabled`,ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED:`Chain/address changed: balance updated canceled`,DECIMALS_LIMIT:`Number of decimals exceed maximum`,MERKLE_TREE_INCOMPLETE:`Merkle tree is incomplete`,FAIL_ESTIMATE_GAS:`Failed to estimate gas: check the transaction parameters`,LEDGER_IS_LOCKED:`Ledger device: Locked device`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Ledger device: UNKNOWN_ERROR (0x6a8c)`,LEDGER_IS_NOT_AVAILABLE:`Ledger device: UNKNOWN_ERROR`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,GAS_ESTIMATION_ERROR:`Failed Gas Estimates Response`,GAS_ESTIMATE_INCORRECT_PARAMETERS:`Incorrect Parameters for Gas Estimate`,CONNECTIVITY_ERROR:`Request failed with status code 500`,TRANSACTION_FAILED:`Transaction Failed: Revert`,NO_SWAP_QUOTES:`No swap quotes available`,FEES_OVER_TRANSACTION_VALUE:`Fees are over transaction value. Please, increase the amount`,GAS_STATION_NOT_AVAILABLE:`Gas Station Not Available`,INBALANCE_IN_TOKEN:`Inbalance in token detected`,BALANCE_EQUATION_FAILED:`Balance Diff Should be equal to sum of onchain and offchain created commitments`,TOKEN_ADD_ERROR:`Error occoured while adding token. Please make sure you are adding a valid ERC-20 token`,CANNOT_ESTIMATE_GAS:`transaction may require manual gas limit`,NETWORK_ERROR:`Network Error`,MAX_FEE_GAS_ERROR:`max fee per gas less than block base fee`,CORS_ERROR:`has been blocked by CORS policy`,CANNOT_ESTIMATE_GAS2:`transaction may fail or may require manual gas limit`,NO_RESPONSE_PRIVATE:`No resonse from private relay`,TRY_AGAIN_AFTER_TRANSACTION:`Please, try again`,ALREADY_SUBSCRIBED:`User Already Subscribed`,PREFERRED_TOKEN_OR_ADDRESS_MISSING:`Please, specify both the preferred token and public wallet address`,SNAPSHOT_FILE_NOT_FOUND:`We are updating our servers. Please try again in some time`,SAME_ADDRESS_FORBIDDEN:`You cannot recieve staked tokens on the same ethereum address`,NOT_VALID_ETHEREUM_ADDRESS:`Please enter a valid Ethereum address`,MUST_STAKE_AT_LEAST_ONE_ETH:`Amount too low, Please stake at least 1 ETH`,OUT_OF_MEMORY:`Out of memory: Cannot allocate Wasm memory`,OUT_OF_MEMORY2:`could not allocate memory`,OUT_OF_MEMORY3:`out of memory`,UNKNOWN:`Unknown error`,TRANSACTION_WRONG_REQUEST:`The requested Transaction type is not supported`,INSUFFICIENT_LAMPORTS:`insufficient lamports`,TOKENS_DO_NOT_BELONG_SAME_CHAIN:`Tokens belong to different chains. All tokens must belong to the same chain`,OKX_MIN_RETURN_NOT_REACHED:`custom program error: 0x177a`,MIN_RETURNED_NOT_REACHED:`MinReturnNotReached`,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:`ReceivedAmountLowerThanExpected`,AUTO_SHIELD_SKIPPED:`We skipped auto-shield because the asset was an NFT or the remaining token was used as gas.`,LOW_OUTPUT_AMOUNT:`Gas fees exceed received amount. Please try adjusting amount or lowering slippage.`,EXECUTION_REVERTED:`execution reverted`,SOLANA_TRANSACTION_LOG_SIZE_LIMIT:`Transaction logs are too large. Please try again later`,COMPUTATIONAL_BUDGET_EXCEEDED:`ComputationalBudgetExceeded`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Relay Fee is over withdraw amount`,TRON_CONFIRMATION_DECLINED:`Confirmation declined by user`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`One of the source addresses is restricted from private transactions`,ACCOUNT_RESOURCE_INSUFFICIENT_ERROR:`Account resource insufficient error`,TRON_ROOT_HASH_STALE:`Hinkal Root Hash Is Stale For Proof`,TRON_TX_IN_FLIGHT:`Another Hinkal transaction is in progress`},i=`Not enough memory. Please, close some tabs/applications to free up memory and try again`,a=`Your transaction didn’t go through due to price slippage. Try increasing your slippage tolerance`,o={USER_REJECTED_TRANSACTION:`You cancelled the transaction`,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`The amount you provided is too high, please adjust the amount`,WC_NO_MATCHING_KEY:`Wallet Connect error. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Rate Limit: please, use different rpc provider in your wallet`,INSUFFICIENT_FUNDS_GAS:`Your balance is too low to cover the transaction fees. Please add funds to proceed`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Your TRX balance is too low to cover amount and transaction fee`,INVALID_NULLIFIER:`There seems to be an issue with syncing your balance. Please press the refresh icon next to your shielded balance`,STATE_TO_UPDATE:`A technical issue has occurred. Please create a ticket on Hinkal discord server`,INVALID_ZKP:`The Zero Knowledge Proof provided is invalid. Please check and try again`,NONCE_HIGH:`To resolve this issue, please reset your wallet in the Settings`,UNKNOWN_PROVIDER:`The provider is not recognized. Please check your settings`,TRANSACTION_REPLACED:`Your transaction was replaced by another. Please submit your transaction again`,TRANSACTION_REPLACED2:`This transaction was replaced. Please try submitting again`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,SAFE_ERC:`Your approved amount is lower than what you’re trying to send. Increase the approval or adjust the amount, then try again.`,SIMULATION_FAILED:`Transaction simulation failed. Please try again.`,SAFE_ERC_APPROVE:`The selected ERC20 Token could not be approved. Please contact the Hinkal support team`,INTEGRAL_CURVE_ZERO:`There's an issue with the pool's staking function. Please contact the Hinkal support team for assistance`,LOW_LEVEL_CALL:`A technical issue occurred. Please contact the Hinkal team for assistance`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,USER_REJECTED_SIGN2:`You canceled the request`,USER_REJECTED_RPC:`You canceled the request`,USER_DENIED_TRANSACTION_SIGNATURE:`You canceled the request`,USER_DENIED_REQUEST_SIGNATURE:`You canceled the request`,CONNECT_ERROR2:`Oops, there are connectivity issues. Please check your internet connection and try again`,WALLET_CONNECT_MATCHING_KEYS:`An internal WalletConnect error occurred. Please try reconnecting`,SIGNATURE_UNSUPPORTED_CHAINS:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_CHAINS2:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`Your active wallet doesn't support personal signatures. Please use a different wallet`,REVERT_NO_STRING:`Your transaction didn’t go through due to technical issues. Please submit a ticket on Hinkal discord server`,INVALID_MERKLE_ROOT:`There's an issue with the merkle tree root. Please submit a ticket on Hinkal discord server`,MERLE_TREE_SNARK:`An error occurred in the circuit processing. Please submit a ticket on Hinkal discord server`,MAX_FEE_GAS_ERROR:`Your transaction was rejected due to high network congestion`,MERKLE_TREE_INCOMPLETE:`A technical issue has occurred. Please submit a ticket on Hinkal discord server`,CORS_ERROR:`Unable to reach the remote client. Please submit a ticket on Hinkal discord server`,NETWORK_ERROR:`Connection error. Please, check back later`,CONNECTIVITY_ERROR:`A connectivity issue occurred. Please check your network connection`,LEDGER_IS_LOCKED:`Your wallet is locked. Please unlock your wallet`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Your ledger is not allowed to sign transactions. Please allow blind signing`,LEDGER_IS_NOT_AVAILABLE:`Access denied to use Ledger device.`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,INBALANCE_IN_TOKEN:a,OKX_MIN_RETURN_NOT_REACHED:a,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:a,MIN_RETURNED_NOT_REACHED:a,BALANCE_EQUATION_FAILED:`There's an issue with the balance calculation. Please adjust your transaction parameters`,SLIPPAGE_LIMIT_1:`Your transaction didn’t go through due to price slippage. Adjust slippage settings and retry`,CANNOT_ESTIMATE_GAS:`Unable to estimate the gas required. Please set the gas limit manually`,CANNOT_ESTIMATE_GAS2:`Your transaction didn’t go through. Please try setting gas limit manually`,GAS_STATION_NOT_AVAILABLE:`The Gas Station service is currently unavailable. Please submit a ticket on Hinkal discord server`,TIMESTAMP_STALE:`This transaction is outdated. Please initiate a new transaction`,ALREADY_SUBSCRIBED:`This email is already subscribed to the Hinkal newsletter`,OUT_OF_MEMORY:i,OUT_OF_MEMORY2:i,OUT_OF_MEMORY3:i,INVALID_RECOVERY_PHRASE:`Invalid recovery phrase`,PHRASES_DONT_MATCH:`Phrases do not match. You can go back and verify your recovery phrase.`,PASSWORDS_DONT_MATCH:`Passwords do not match`,PASSWORD_SAME_AS_OLD:`Password cannot be the same as the old one`,PASSWORD_TOO_SMALL:`Password must be at least 8 characters`,PASSWORD_NOT_CORRECT:`Incorrect current password`,CODE_ALREADY_USED:`This code has already been used`,ACCESS_CODE_REQUIRED:`Access code is required`,ACCESS_CODE_IS_ALREADY_IN_USE:`Access code is already in use`,ACCESS_CODE_IS_ALREADY_IN_USE1:`Access code already in use. Import or connect existing wallet`,ERROR_DURING_PHRASE_CONFIRMATION:`Error during Phrase confirmation`,INSUFFICIENT_LAMPORTS:`Your SOL balance is too low to complete this transaction`,EXECUTION_REVERTED:`Your transaction reverted.`,COMPUTATIONAL_BUDGET_EXCEEDED:`Your transaction exceeded the limited compute units. Please try again.`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Your transaction didn’t go through because the relay fee exceeded the transaction amount`,TRON_CONFIRMATION_DECLINED:`You canceled the request`,INVALID_RELAYER_FEE:`The transaction fee changed while submitting. Please try again.`,REQUEST_PENDING:`A request is already pending in your wallet. Please confirm to connect.`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`The funds you’re trying to use have been flagged as sanctioned.`,NO_SWAP_QUOTES:`No swap route available for this token pair on the selected network at the moment. Please try again later or adjust the swap parameters.`,TRON_ROOT_HASH_STALE:`Another transaction was processed just before yours. Please try again`,TRON_TX_IN_FLIGHT:`Another transaction is currently being processed. Please try again in a few seconds`,NO_LIFI_PRICE:`Li-Fi provider couldn't fetch the price. please, retry in a few seconds.`},s={UTXO_LIMITATIONS:`Your transaction exceeds the UTXO limit`,INSUFFICIENT_BALANCE_FOR_FEES:`Fees are high right now and would consume a large portion of your balance. Consider reducing the amount or retrying later.`,HIGH_FEE_WARNING:`Total fees exceed your available balance. Consider adding funds or retry later when fees decrease.`};exports.DIRECTLY_SHOW_MESSAGE_ERROR_CODES=s,exports.UserFriendlyErrorCodes=o,exports.gasErrorCodes=n,exports.insufficientResourcesErrorCodes=t,exports.transactionErrorCodes=r;