@hinkal/common 0.3.2 → 0.3.4

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 (452) hide show
  1. package/README.md +16 -19
  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/crypto/index.cjs +1 -1
  88. package/common/src/crypto/index.d.ts +0 -1
  89. package/common/src/crypto/index.mjs +0 -1
  90. package/common/src/data-structures/Hinkal/Hinkal.cjs +1 -1
  91. package/common/src/data-structures/Hinkal/Hinkal.mjs +26 -22
  92. package/common/src/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
  93. package/common/src/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
  94. package/common/src/data-structures/Hinkal/handleAutoDepositBack.mjs +36 -35
  95. package/common/src/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
  96. package/common/src/data-structures/Hinkal/hinkalActionReceive.mjs +3 -3
  97. package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.cjs +1 -1
  98. package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.mjs +60 -58
  99. package/common/src/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -1
  100. package/common/src/data-structures/Hinkal/hinkalClaimUtxo.mjs +42 -47
  101. package/common/src/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
  102. package/common/src/data-structures/Hinkal/hinkalDeposit.d.ts +1 -0
  103. package/common/src/data-structures/Hinkal/hinkalDeposit.mjs +50 -116
  104. package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -1
  105. package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.mjs +102 -92
  106. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
  107. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +3 -2
  108. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +104 -59
  109. package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
  110. package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +4 -4
  111. package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.cjs +1 -1
  112. package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.mjs +7 -3
  113. package/common/src/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  114. package/common/src/data-structures/Hinkal/hinkalPrivateWallet.mjs +51 -39
  115. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
  116. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +1 -2
  117. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.mjs +53 -131
  118. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.cjs +1 -1
  119. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.d.ts +1 -1
  120. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.mjs +29 -47
  121. package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
  122. package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.mjs +3 -3
  123. package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
  124. package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +70 -45
  125. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
  126. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +2 -2
  127. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.mjs +47 -45
  128. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  129. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +8 -4
  130. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +133 -81
  131. package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -1
  132. package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +1 -1
  133. package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +16 -12
  134. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
  135. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +2 -2
  136. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +61 -54
  137. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
  138. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +1 -1
  139. package/common/src/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
  140. package/common/src/data-structures/Hinkal/hinkalSolanaSwap.mjs +87 -51
  141. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
  142. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +1 -0
  143. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.mjs +95 -50
  144. package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
  145. package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +60 -34
  146. package/common/src/data-structures/Hinkal/hinkalSwap.cjs +1 -1
  147. package/common/src/data-structures/Hinkal/hinkalSwap.mjs +29 -32
  148. package/common/src/data-structures/Hinkal/hinkalTransact.cjs +1 -0
  149. package/common/src/data-structures/Hinkal/hinkalTransact.d.ts +3 -0
  150. package/common/src/data-structures/Hinkal/hinkalTransact.mjs +90 -0
  151. package/common/src/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
  152. package/common/src/data-structures/Hinkal/hinkalTransfer.mjs +40 -45
  153. package/common/src/data-structures/Hinkal/hinkalTronDepositToSelf.cjs +1 -0
  154. package/common/src/data-structures/Hinkal/hinkalTronDepositToSelf.d.ts +8 -0
  155. package/common/src/data-structures/Hinkal/hinkalTronDepositToSelf.mjs +30 -0
  156. package/common/src/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  157. package/common/src/data-structures/Hinkal/hinkalWithdraw.mjs +35 -45
  158. package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  159. package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +167 -95
  160. package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.cjs +1 -0
  161. package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.d.ts +27 -0
  162. package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.mjs +31 -0
  163. package/common/src/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  164. package/common/src/data-structures/Hinkal/resetMerkleTrees.mjs +1 -0
  165. package/common/src/data-structures/IndexedDB/activity-db.cjs +1 -1
  166. package/common/src/data-structures/IndexedDB/activity-db.mjs +34 -34
  167. package/common/src/data-structures/IndexedDB/signatures-db.cjs +1 -1
  168. package/common/src/data-structures/IndexedDB/signatures-db.mjs +11 -11
  169. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
  170. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +11 -10
  171. package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.cjs +1 -1
  172. package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.mjs +14 -14
  173. package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
  174. package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.mjs +26 -26
  175. package/common/src/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
  176. package/common/src/data-structures/TokenDBs/PrivateTokensDB.mjs +15 -15
  177. package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.cjs +1 -1
  178. package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.mjs +12 -16
  179. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.cjs +1 -1
  180. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.d.ts +1 -0
  181. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.mjs +8 -4
  182. package/common/src/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
  183. package/common/src/data-structures/crypto-keys/decodeUTXO.d.ts +1 -0
  184. package/common/src/data-structures/crypto-keys/decodeUTXO.mjs +12 -12
  185. package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
  186. package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.mjs +12 -12
  187. package/common/src/data-structures/event-service/helpers/ClientEventHelper.cjs +1 -1
  188. package/common/src/data-structures/event-service/helpers/ClientEventHelper.mjs +6 -6
  189. package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
  190. package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +27 -23
  191. package/common/src/data-structures/merkle-tree/MerkleTree.cjs +1 -1
  192. package/common/src/data-structures/merkle-tree/MerkleTree.d.ts +10 -0
  193. package/common/src/data-structures/merkle-tree/MerkleTree.mjs +9 -1
  194. package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.cjs +1 -1
  195. package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.d.ts +3 -0
  196. package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.mjs +64 -54
  197. package/common/src/error-handling/error-codes.constants.cjs +1 -1
  198. package/common/src/error-handling/error-codes.constants.d.ts +6 -11
  199. package/common/src/error-handling/error-codes.constants.mjs +8 -13
  200. package/common/src/error-handling/get-error.message.cjs +1 -1
  201. package/common/src/error-handling/get-error.message.mjs +27 -14
  202. package/common/src/externalABIs/index.cjs +1 -1
  203. package/common/src/externalABIs/index.d.ts +1 -113
  204. package/common/src/externalABIs/index.mjs +2 -6
  205. package/common/src/functions/auto-deposit-back-helpers/select-gas-token.cjs +1 -1
  206. package/common/src/functions/auto-deposit-back-helpers/select-gas-token.mjs +8 -8
  207. package/common/src/functions/index.cjs +1 -1
  208. package/common/src/functions/index.d.ts +0 -1
  209. package/common/src/functions/index.mjs +12 -15
  210. package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.cjs +1 -1
  211. package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.mjs +39 -5
  212. package/common/src/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
  213. package/common/src/functions/pre-transaction/getExternalSwapAddress.mjs +2 -18
  214. package/common/src/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
  215. package/common/src/functions/pre-transaction/getSolanaCalldataHash.d.ts +1 -1
  216. package/common/src/functions/pre-transaction/getSolanaCalldataHash.mjs +11 -10
  217. package/common/src/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
  218. package/common/src/functions/pre-transaction/getVolatileTransferAmount.mjs +12 -12
  219. package/common/src/functions/pre-transaction/index.cjs +1 -1
  220. package/common/src/functions/pre-transaction/index.d.ts +1 -2
  221. package/common/src/functions/pre-transaction/index.mjs +1 -2
  222. package/common/src/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
  223. package/common/src/functions/pre-transaction/outputUtxoProcessing.d.ts +1 -1
  224. package/common/src/functions/pre-transaction/outputUtxoProcessing.mjs +7 -8
  225. package/common/src/functions/pre-transaction/solana.cjs +1 -1
  226. package/common/src/functions/pre-transaction/solana.d.ts +13 -0
  227. package/common/src/functions/pre-transaction/solana.mjs +46 -22
  228. package/common/src/functions/pre-transaction/store-proof.cjs +1 -1
  229. package/common/src/functions/pre-transaction/store-proof.d.ts +1 -1
  230. package/common/src/functions/pre-transaction/store-proof.mjs +1 -0
  231. package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs +1 -1
  232. package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +1 -1
  233. package/common/src/functions/private-wallet/emporium.helpers.cjs +1 -1
  234. package/common/src/functions/private-wallet/emporium.helpers.mjs +12 -13
  235. package/common/src/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
  236. package/common/src/functions/private-wallet/emporium.swap.helpers.d.ts +0 -1
  237. package/common/src/functions/private-wallet/emporium.swap.helpers.mjs +38 -80
  238. package/common/src/functions/private-wallet/index.cjs +1 -1
  239. package/common/src/functions/private-wallet/index.d.ts +0 -1
  240. package/common/src/functions/private-wallet/index.mjs +0 -1
  241. package/common/src/functions/snarkjs/common.snarkjs.cjs +1 -1
  242. package/common/src/functions/snarkjs/common.snarkjs.d.ts +2 -2
  243. package/common/src/functions/snarkjs/common.snarkjs.mjs +89 -52
  244. package/common/src/functions/snarkjs/constant.cjs +1 -1
  245. package/common/src/functions/snarkjs/constant.d.ts +32 -0
  246. package/common/src/functions/snarkjs/constant.mjs +32 -0
  247. package/common/src/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
  248. package/common/src/functions/snarkjs/constructGeneralZkProof.d.ts +1 -1
  249. package/common/src/functions/snarkjs/constructGeneralZkProof.mjs +78 -65
  250. package/common/src/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
  251. package/common/src/functions/snarkjs/constructSolanaZkProof.d.ts +4 -1
  252. package/common/src/functions/snarkjs/constructSolanaZkProof.mjs +44 -39
  253. package/common/src/functions/snarkjs/constructTxEnclave.cjs +1 -0
  254. package/common/src/functions/snarkjs/constructTxEnclave.d.ts +32 -0
  255. package/common/src/functions/snarkjs/constructTxEnclave.mjs +162 -0
  256. package/common/src/functions/snarkjs/fetchTronInsertionSiblings.cjs +1 -0
  257. package/common/src/functions/snarkjs/fetchTronInsertionSiblings.d.ts +7 -0
  258. package/common/src/functions/snarkjs/fetchTronInsertionSiblings.mjs +13 -0
  259. package/common/src/functions/snarkjs/generateCircomData.cjs +1 -1
  260. package/common/src/functions/snarkjs/generateCircomData.d.ts +1 -1
  261. package/common/src/functions/snarkjs/generateCircomData.mjs +33 -27
  262. package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.cjs +1 -1
  263. package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.d.ts +1 -1
  264. package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.mjs +7 -7
  265. package/common/src/functions/snarkjs/generateZkProof.cjs +1 -1
  266. package/common/src/functions/snarkjs/generateZkProof.d.ts +1 -1
  267. package/common/src/functions/snarkjs/generateZkProof.mjs +9 -16
  268. package/common/src/functions/snarkjs/signedMessageHash.cjs +1 -1
  269. package/common/src/functions/snarkjs/signedMessageHash.d.ts +11 -0
  270. package/common/src/functions/snarkjs/signedMessageHash.mjs +21 -3
  271. package/common/src/functions/snarkjs/verifySignedEnclaveResponse.cjs +1 -0
  272. package/common/src/functions/snarkjs/verifySignedEnclaveResponse.d.ts +1 -0
  273. package/common/src/functions/snarkjs/verifySignedEnclaveResponse.mjs +11 -0
  274. package/common/src/functions/utils/addresses.cjs +1 -1
  275. package/common/src/functions/utils/addresses.d.ts +1 -0
  276. package/common/src/functions/utils/addresses.mjs +6 -2
  277. package/common/src/functions/utils/buildClaimableDepositPlan.d.ts +2 -2
  278. package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
  279. package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.mjs +1 -1
  280. package/common/src/functions/utils/deposit-claimable.utils.cjs +1 -1
  281. package/common/src/functions/utils/deposit-claimable.utils.d.ts +1 -1
  282. package/common/src/functions/utils/deposit-claimable.utils.mjs +3 -1
  283. package/common/src/functions/utils/enclave-utxo-storage.cjs +1 -1
  284. package/common/src/functions/utils/enclave-utxo-storage.mjs +1 -1
  285. package/common/src/functions/utils/fees.utils.cjs +1 -1
  286. package/common/src/functions/utils/fees.utils.mjs +31 -31
  287. package/common/src/functions/utils/formatter.d.ts +1 -0
  288. package/common/src/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
  289. package/common/src/functions/utils/getUtxosFromReceipt.utils.mjs +6 -6
  290. package/common/src/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
  291. package/common/src/functions/utils/getUtxosFromReceiptSolana.mjs +11 -10
  292. package/common/src/functions/utils/index.cjs +1 -1
  293. package/common/src/functions/utils/index.d.ts +2 -2
  294. package/common/src/functions/utils/index.mjs +11 -10
  295. package/common/src/functions/utils/process.utils.cjs +1 -1
  296. package/common/src/functions/utils/process.utils.d.ts +0 -1
  297. package/common/src/functions/utils/process.utils.mjs +2 -11
  298. package/common/src/functions/utils/publicBalance.utils.cjs +1 -1
  299. package/common/src/functions/utils/publicBalance.utils.mjs +2 -1
  300. package/common/src/functions/utils/transfer-claimable.utils.cjs +1 -1
  301. package/common/src/functions/utils/transfer-claimable.utils.mjs +2 -2
  302. package/common/src/functions/utils/tron.utils.cjs +1 -1
  303. package/common/src/functions/utils/tron.utils.d.ts +5 -14
  304. package/common/src/functions/utils/tron.utils.mjs +91 -127
  305. package/common/src/functions/utils/waasStamp.cjs +1 -0
  306. package/common/src/functions/utils/waasStamp.d.ts +5 -0
  307. package/common/src/functions/utils/waasStamp.mjs +2 -0
  308. package/common/src/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  309. package/common/src/functions/web3/events/getInputUtxoAndBalance.d.ts +3 -8
  310. package/common/src/functions/web3/events/getInputUtxoAndBalance.mjs +44 -48
  311. package/common/src/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
  312. package/common/src/functions/web3/events/getInputUtxosEnclave.d.ts +4 -3
  313. package/common/src/functions/web3/events/getInputUtxosEnclave.mjs +34 -25
  314. package/common/src/functions/web3/events/getShieldedBalance.cjs +1 -1
  315. package/common/src/functions/web3/events/getShieldedBalance.d.ts +1 -1
  316. package/common/src/functions/web3/events/getShieldedBalance.mjs +88 -76
  317. package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
  318. package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +9 -6
  319. package/common/src/functions/web3/functionCalls/approveToken.cjs +1 -1
  320. package/common/src/functions/web3/functionCalls/approveToken.mjs +12 -12
  321. package/common/src/functions/web3/functionCalls/submitProof.cjs +1 -0
  322. package/common/src/functions/web3/functionCalls/submitProof.d.ts +5 -0
  323. package/common/src/functions/web3/functionCalls/submitProof.mjs +26 -0
  324. package/common/src/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -1
  325. package/common/src/functions/web3/functionCalls/transactCallDirectTron.d.ts +7 -3
  326. package/common/src/functions/web3/functionCalls/transactCallDirectTron.mjs +81 -87
  327. package/common/src/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  328. package/common/src/functions/web3/functionCalls/transactCallRelayer.d.ts +6 -11
  329. package/common/src/functions/web3/functionCalls/transactCallRelayer.mjs +4 -2
  330. package/common/src/functions/web3/functionCalls/waitForErc20Approvals.cjs +1 -1
  331. package/common/src/functions/web3/functionCalls/waitForErc20Approvals.mjs +6 -6
  332. package/common/src/functions/web3/getContractMetadata.cjs +1 -1
  333. package/common/src/functions/web3/getContractMetadata.mjs +1 -1
  334. package/common/src/functions/web3/getTokenHolder.cjs +1 -1
  335. package/common/src/functions/web3/getTokenHolder.mjs +3 -2
  336. package/common/src/functions/web3/index.cjs +1 -1
  337. package/common/src/functions/web3/index.d.ts +0 -3
  338. package/common/src/functions/web3/index.mjs +0 -3
  339. package/common/src/functions/web3/lifiAPI.cjs +1 -1
  340. package/common/src/functions/web3/lifiAPI.mjs +1 -1
  341. package/common/src/providers/TronProviderAdapter.cjs +1 -1
  342. package/common/src/providers/TronProviderAdapter.mjs +7 -1
  343. package/common/src/providers/WagmiProviderAdapter.cjs +1 -1
  344. package/common/src/providers/WagmiProviderAdapter.mjs +5 -5
  345. package/common/src/types/activities.types.cjs +1 -1
  346. package/common/src/types/activities.types.d.ts +0 -9
  347. package/common/src/types/activities.types.mjs +1 -1
  348. package/common/src/types/admin.types.cjs +1 -1
  349. package/common/src/types/admin.types.d.ts +3 -1
  350. package/common/src/types/admin.types.mjs +1 -1
  351. package/common/src/types/bridging-tx.types.d.ts +8 -0
  352. package/common/src/types/cache.types.cjs +1 -1
  353. package/common/src/types/cache.types.d.ts +2 -1
  354. package/common/src/types/cache.types.mjs +1 -1
  355. package/common/src/types/circom-data.types.d.ts +6 -0
  356. package/common/src/types/commitments.types.d.ts +2 -0
  357. package/common/src/types/dashboard-transaction.types.d.ts +3 -0
  358. package/common/src/types/ethereum-network.types.cjs +1 -1
  359. package/common/src/types/ethereum-network.types.d.ts +6 -15
  360. package/common/src/types/ethereum-network.types.mjs +1 -1
  361. package/common/src/types/external-action.types.cjs +1 -1
  362. package/common/src/types/external-action.types.d.ts +2 -5
  363. package/common/src/types/external-action.types.mjs +1 -1
  364. package/common/src/types/hinkal.types.cjs +1 -1
  365. package/common/src/types/hinkal.types.d.ts +4 -7
  366. package/common/src/types/hinkal.types.mjs +1 -1
  367. package/common/src/types/index.cjs +1 -1
  368. package/common/src/types/index.d.ts +2 -0
  369. package/common/src/types/index.mjs +1 -0
  370. package/common/src/types/near-intents.types.d.ts +1 -0
  371. package/common/src/types/offscreen.types.cjs +1 -1
  372. package/common/src/types/offscreen.types.d.ts +0 -1
  373. package/common/src/types/offscreen.types.mjs +1 -1
  374. package/common/src/types/pay-activities.types.d.ts +3 -0
  375. package/common/src/types/remote-proof.types.d.ts +0 -6
  376. package/common/src/types/remote-tx-build.types.d.ts +242 -0
  377. package/common/src/types/scheduled-transactions.types.d.ts +3 -0
  378. package/common/src/types/solana.types.d.ts +7 -0
  379. package/common/src/types/tenderly.api.types.d.ts +70 -0
  380. package/common/src/types/transact.types.cjs +1 -0
  381. package/common/src/types/transact.types.d.ts +53 -0
  382. package/common/src/types/transact.types.mjs +6 -0
  383. package/common/src/webworker/{logError-uy41lNp1.js → logError-CxZzSALU.js} +1 -1
  384. package/common/src/webworker/package.json +12 -12
  385. package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.cjs +1 -1
  386. package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.mjs +1 -1
  387. package/common/src/webworker/snarkjsWorkerNode.cjs +1 -1
  388. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
  389. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +1 -1
  390. package/common/src/webworker/utxoWorkerNode.cjs +1 -1
  391. package/common/src/webworker/viteWorkerURL.constant.cjs +3 -3
  392. package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
  393. package/common/src/webworker/workerProxy-swwPYw6e.js +1 -0
  394. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
  395. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +1 -1
  396. package/common/src/webworker/zkProofWorkerNode.cjs +1 -1
  397. package/index.cjs +1 -1
  398. package/index.mjs +1 -1
  399. package/internal/swapApi.cjs +1 -1
  400. package/internal/swapApi.d.ts +3 -3
  401. package/internal/swapApi.mjs +22 -25
  402. package/package.json +12 -12
  403. package/services/Hinkal.cjs +1 -1
  404. package/services/Hinkal.d.ts +3 -3
  405. package/services/Hinkal.mjs +7 -7
  406. package/types/IHinkal.d.ts +3 -3
  407. package/types/swap.types.d.ts +3 -20
  408. package/common/src/API/callOdosAPI.cjs +0 -1
  409. package/common/src/API/callOdosAPI.d.ts +0 -63
  410. package/common/src/API/callOdosAPI.mjs +0 -18
  411. package/common/src/API/callOneInchAPI.cjs +0 -1
  412. package/common/src/API/callOneInchAPI.d.ts +0 -24
  413. package/common/src/API/callOneInchAPI.mjs +0 -16
  414. package/common/src/constants/rewards.constants.d.ts +0 -2
  415. package/common/src/crypto/ecdh-dual-path.cjs +0 -1
  416. package/common/src/crypto/ecdh-dual-path.d.ts +0 -13
  417. package/common/src/crypto/ecdh-dual-path.mjs +0 -6
  418. package/common/src/externalABIs/IQuoterV2.json.cjs +0 -1
  419. package/common/src/externalABIs/IQuoterV2.json.mjs +0 -203
  420. package/common/src/externalABIs/ISwapRouter.json.cjs +0 -1
  421. package/common/src/externalABIs/ISwapRouter.json.mjs +0 -537
  422. package/common/src/externalABIs/IUniswapV3Factory.json.cjs +0 -1
  423. package/common/src/externalABIs/IUniswapV3Factory.json.mjs +0 -188
  424. package/common/src/externalABIs/IUniswapV3Pool.json.cjs +0 -1
  425. package/common/src/externalABIs/IUniswapV3Pool.json.mjs +0 -938
  426. package/common/src/externalABIs/UniswapV2PoolAbi.json.cjs +0 -1
  427. package/common/src/externalABIs/UniswapV2PoolAbi.json.mjs +0 -78
  428. package/common/src/functions/pre-transaction/interaction-to-action.cjs +0 -1
  429. package/common/src/functions/pre-transaction/interaction-to-action.d.ts +0 -2
  430. package/common/src/functions/pre-transaction/interaction-to-action.mjs +0 -1
  431. package/common/src/functions/pre-transaction/recipientUtxoProcessing.cjs +0 -1
  432. package/common/src/functions/pre-transaction/recipientUtxoProcessing.d.ts +0 -3
  433. package/common/src/functions/pre-transaction/recipientUtxoProcessing.mjs +0 -30
  434. package/common/src/functions/private-wallet/opProducer.cjs +0 -1
  435. package/common/src/functions/private-wallet/opProducer.d.ts +0 -5
  436. package/common/src/functions/private-wallet/opProducer.mjs +0 -3
  437. package/common/src/functions/snarkjs/generateZkProofEnclave.cjs +0 -1
  438. package/common/src/functions/snarkjs/generateZkProofEnclave.d.ts +0 -5
  439. package/common/src/functions/snarkjs/generateZkProofEnclave.mjs +0 -27
  440. package/common/src/functions/utils/get-signature-header.cjs +0 -1
  441. package/common/src/functions/utils/get-signature-header.d.ts +0 -5
  442. package/common/src/functions/utils/get-signature-header.mjs +0 -4
  443. package/common/src/functions/web3/odosAPI.cjs +0 -1
  444. package/common/src/functions/web3/odosAPI.d.ts +0 -5
  445. package/common/src/functions/web3/odosAPI.mjs +0 -35
  446. package/common/src/functions/web3/oneInchAPI.cjs +0 -1
  447. package/common/src/functions/web3/oneInchAPI.d.ts +0 -5
  448. package/common/src/functions/web3/oneInchAPI.mjs +0 -44
  449. package/common/src/functions/web3/uniswapAPI.cjs +0 -1
  450. package/common/src/functions/web3/uniswapAPI.d.ts +0 -16
  451. package/common/src/functions/web3/uniswapAPI.mjs +0 -60
  452. package/common/src/webworker/workerProxy-MheXtWa4.js +0 -1
@@ -22,6 +22,7 @@ export declare const transactionErrorCodes: {
22
22
  TRANSACTION_NOT_CONFIRMED: string;
23
23
  RPC_PROVIDER_LIMIT_ERROR: string;
24
24
  RELAYER_NOT_AVAILABLE: string;
25
+ NO_STUCK_BALANCE_TO_WITHDRAW: string;
25
26
  TRANSACTION_TIMEOUT: string;
26
27
  CONNECT_ERROR: string;
27
28
  CONNECT_ERROR2: string;
@@ -74,14 +75,12 @@ export declare const transactionErrorCodes: {
74
75
  SWAP_RELAYER_MIN: string;
75
76
  LOW_LEVEL_CALL: string;
76
77
  INTEGRAL_CURVE_ZERO: string;
77
- ODOS_FETCH: string;
78
78
  YOU_CANCELED_REQUEST: string;
79
79
  YOU_CANCELED_TRANSACTION_REQUEST: string;
80
80
  SLIPPAGE_LIMIT: string;
81
81
  SLIPPAGE_LIMIT_1: string;
82
82
  QUOTE_EXPIRED: string;
83
83
  REVERT_NO_STRING: string;
84
- UNISWAP_NOT_ENOUGH_LIQUIDITY: string;
85
84
  CONNECTION_FAILED: string;
86
85
  FAILED_TO_SWITCH_NETWORKS: string;
87
86
  INVALID_FROM: string;
@@ -98,17 +97,11 @@ export declare const transactionErrorCodes: {
98
97
  LEDGER_BLIDN_SIGNING_NOT_ALLOWED: string;
99
98
  LEDGER_IS_NOT_AVAILABLE: string;
100
99
  LEDGER_ACCESS_DENIED: string;
101
- ODOS_SWAP_FAILED: string;
102
- ONEINCH_SWAP_FAILED: string;
103
100
  GAS_ESTIMATION_ERROR: string;
104
101
  GAS_ESTIMATE_INCORRECT_PARAMETERS: string;
105
102
  CONNECTIVITY_ERROR: string;
106
103
  TRANSACTION_FAILED: string;
107
104
  NO_SWAP_QUOTES: string;
108
- NO_UNISWAP_PRICE: string;
109
- NO_ODOS_PRICE: string;
110
- NO_ONEINCH_PRICE: string;
111
- NO_LIFI_PRICE: string;
112
105
  FEES_OVER_TRANSACTION_VALUE: string;
113
106
  GAS_STATION_NOT_AVAILABLE: string;
114
107
  INBALANCE_IN_TOKEN: string;
@@ -146,6 +139,8 @@ export declare const transactionErrorCodes: {
146
139
  TRON_CONFIRMATION_DECLINED: string;
147
140
  BLACKLISTED_INPUT_COMMITMENT_ADDRESS: string;
148
141
  ACCOUNT_RESOURCE_INSUFFICIENT_ERROR: string;
142
+ TRON_ROOT_HASH_STALE: string;
143
+ TRON_TX_IN_FLIGHT: string;
149
144
  GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT: string;
150
145
  AUTO_SHIELD_INSUFFICIENT_GAS: string;
151
146
  INSUFFICIENT_FUNDS: string;
@@ -186,9 +181,6 @@ export declare const UserFriendlyErrorCodes: {
186
181
  USER_REJECTED_RPC: string;
187
182
  USER_DENIED_TRANSACTION_SIGNATURE: string;
188
183
  USER_DENIED_REQUEST_SIGNATURE: string;
189
- ODOS_FETCH: string;
190
- ODOS_SWAP_FAILED: string;
191
- ONEINCH_SWAP_FAILED: string;
192
184
  CONNECT_ERROR2: string;
193
185
  WALLET_CONNECT_MATCHING_KEYS: string;
194
186
  SIGNATURE_UNSUPPORTED_CHAINS: string;
@@ -240,6 +232,9 @@ export declare const UserFriendlyErrorCodes: {
240
232
  REQUEST_PENDING: string;
241
233
  BLACKLISTED_INPUT_COMMITMENT_ADDRESS: string;
242
234
  NO_SWAP_QUOTES: string;
235
+ TRON_ROOT_HASH_STALE: string;
236
+ TRON_TX_IN_FLIGHT: string;
237
+ NO_LIFI_PRICE: string;
243
238
  };
244
239
  export declare const DIRECTLY_SHOW_MESSAGE_ERROR_CODES: {
245
240
  UTXO_LIMITATIONS: string;
@@ -24,6 +24,7 @@ var e = {
24
24
  TRANSACTION_NOT_CONFIRMED: "The transaction was not confirmed by the network. Please, try again",
25
25
  RPC_PROVIDER_LIMIT_ERROR: "Non-200 status code: '429'",
26
26
  RELAYER_NOT_AVAILABLE: "All relayers are busy, please try in a few seconds",
27
+ NO_STUCK_BALANCE_TO_WITHDRAW: "No stuck balance found to withdraw",
27
28
  TRANSACTION_TIMEOUT: "Your transaction got stale. Please, try in a few seconds",
28
29
  CONNECT_ERROR: "Connection error",
29
30
  CONNECT_ERROR2: "DOMException: Failed",
@@ -76,14 +77,12 @@ var e = {
76
77
  SWAP_RELAYER_MIN: "Relayer minimum fee is not satisfied",
77
78
  LOW_LEVEL_CALL: "low-level delegate call failed",
78
79
  INTEGRAL_CURVE_ZERO: "previous integral cannot be zero",
79
- ODOS_FETCH: "Odos API Fetch Error",
80
80
  YOU_CANCELED_REQUEST: "You canceled the request",
81
81
  YOU_CANCELED_TRANSACTION_REQUEST: "You cancelled the transaction request.",
82
82
  SLIPPAGE_LIMIT: "Slippage Limit Exceeded",
83
83
  SLIPPAGE_LIMIT_1: "Slippage screwed you",
84
84
  QUOTE_EXPIRED: "Quote has expired",
85
85
  REVERT_NO_STRING: "Transaction reverted without a reason string",
86
- UNISWAP_NOT_ENOUGH_LIQUIDITY: "Not Enough Liquidity",
87
86
  CONNECTION_FAILED: "Failed to connect",
88
87
  FAILED_TO_SWITCH_NETWORKS: "Please switch networks in your wallet settings",
89
88
  INVALID_FROM: "Invalid from token",
@@ -100,17 +99,11 @@ var e = {
100
99
  LEDGER_BLIDN_SIGNING_NOT_ALLOWED: "Ledger device: UNKNOWN_ERROR (0x6a8c)",
101
100
  LEDGER_IS_NOT_AVAILABLE: "Ledger device: UNKNOWN_ERROR",
102
101
  LEDGER_ACCESS_DENIED: "Access denied to use Ledger device.",
103
- ODOS_SWAP_FAILED: "Odos swap call failed",
104
- ONEINCH_SWAP_FAILED: "One inch swap failed",
105
102
  GAS_ESTIMATION_ERROR: "Failed Gas Estimates Response",
106
103
  GAS_ESTIMATE_INCORRECT_PARAMETERS: "Incorrect Parameters for Gas Estimate",
107
104
  CONNECTIVITY_ERROR: "Request failed with status code 500",
108
105
  TRANSACTION_FAILED: "Transaction Failed: Revert",
109
106
  NO_SWAP_QUOTES: "No swap quotes available",
110
- NO_UNISWAP_PRICE: "Cannot get Uniswap Price",
111
- NO_ODOS_PRICE: "Cannot get Odos Price",
112
- NO_ONEINCH_PRICE: "Cannot get OneInch Price",
113
- NO_LIFI_PRICE: "Cannot get LiFi Price",
114
107
  FEES_OVER_TRANSACTION_VALUE: "Fees are over transaction value. Please, increase the amount",
115
108
  GAS_STATION_NOT_AVAILABLE: "Gas Station Not Available",
116
109
  INBALANCE_IN_TOKEN: "Inbalance in token detected",
@@ -147,7 +140,9 @@ var e = {
147
140
  RELAY_FEE_OVER_WITHDRAW_AMOUNT: "Relay Fee is over withdraw amount",
148
141
  TRON_CONFIRMATION_DECLINED: "Confirmation declined by user",
149
142
  BLACKLISTED_INPUT_COMMITMENT_ADDRESS: "One of the source addresses is restricted from private transactions",
150
- ACCOUNT_RESOURCE_INSUFFICIENT_ERROR: "Account resource insufficient error"
143
+ ACCOUNT_RESOURCE_INSUFFICIENT_ERROR: "Account resource insufficient error",
144
+ TRON_ROOT_HASH_STALE: "Hinkal Root Hash Is Stale For Proof",
145
+ TRON_TX_IN_FLIGHT: "Another Hinkal transaction is in progress"
151
146
  }, 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 = {
152
147
  USER_REJECTED_TRANSACTION: "You cancelled the transaction",
153
148
  SOME_ERROR: "Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord",
@@ -175,9 +170,6 @@ var e = {
175
170
  USER_REJECTED_RPC: "You canceled the request",
176
171
  USER_DENIED_TRANSACTION_SIGNATURE: "You canceled the request",
177
172
  USER_DENIED_REQUEST_SIGNATURE: "You canceled the request",
178
- ODOS_FETCH: "Current Odos price is unavailable. Please try again",
179
- ODOS_SWAP_FAILED: "Your Odos Swap transaction didn’t go through. Please try again",
180
- ONEINCH_SWAP_FAILED: "Your 1inch Swap transaction didn’t go through. Please try again",
181
173
  CONNECT_ERROR2: "Oops, there are connectivity issues. Please check your internet connection and try again",
182
174
  WALLET_CONNECT_MATCHING_KEYS: "An internal WalletConnect error occurred. Please try reconnecting",
183
175
  SIGNATURE_UNSUPPORTED_CHAINS: "The transaction couldn’t be signed: this network is not supported",
@@ -228,7 +220,10 @@ var e = {
228
220
  INVALID_RELAYER_FEE: "The transaction fee changed while submitting. Please try again.",
229
221
  REQUEST_PENDING: "A request is already pending in your wallet. Please confirm to connect.",
230
222
  BLACKLISTED_INPUT_COMMITMENT_ADDRESS: "The funds you’re trying to use have been flagged as sanctioned.",
231
- 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."
223
+ 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.",
224
+ TRON_ROOT_HASH_STALE: "Another transaction was processed just before yours. Please try again",
225
+ TRON_TX_IN_FLIGHT: "Another transaction is currently being processed. Please try again in a few seconds",
226
+ NO_LIFI_PRICE: "Li-Fi provider couldn't fetch the price. please, retry in a few seconds."
232
227
  }, s = {
233
228
  UTXO_LIMITATIONS: "Your transaction exceeds the UTXO limit",
234
229
  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.",
@@ -1 +1 @@
1
- const e=require(`./error-codes.constants.cjs`),t=require(`./customErrors/ErrorWithAmount.cjs`),n=require(`./customErrors/FeeOverTransactionValueError.cjs`),r=require(`./types.cjs`),i=require(`./customErrors/customErrors.helpers.cjs`);require(`./customErrors/index.cjs`);const a=require(`../types/transaction.types.cjs`);require(`../types/index.cjs`);const o=require(`./isInsufficientFundsError.cjs`);var s=e=>{if(typeof e==`object`&&e){if(`response`in e&&typeof e.response==`object`&&e.response!==null&&`data`in e.response&&typeof e.response.data==`object`&&e.response.data!==null&&`message`in e.response.data&&typeof e.response.data.message==`string`)return e.response.data.message;if(`data`in e&&typeof e.data==`object`&&e.data!==null&&`message`in e.data&&typeof e.data.message==`string`)return e.data.message;if(`message`in e&&typeof e.message==`string`&&e.message)return e.message;if(`error`in e&&typeof e.error==`string`&&e.error)return e.error}if(e instanceof Error)return e.message;if(typeof e==`string`)return e},c=t=>{switch(t){case r.ErrorCategory.DEPOSIT:return`Deposit failed`;case r.ErrorCategory.SWAP:return`Swap failed`;case r.ErrorCategory.BRIDGE:return`Bridge failed`;case r.ErrorCategory.WITHDRAW:return`Send failed`;case r.ErrorCategory.Fund:return`Unshield failed`;case r.ErrorCategory.Receive:return`Shield failed`;case r.ErrorCategory.DappTransaction:return`DApp transaction failed`;case r.ErrorCategory.Approve:return`Approval failed`;default:return e.transactionErrorCodes.UNKNOWN}},l=(r,a)=>{if(r instanceof n.FeeOverTransactionValueError)return i.getGenericFeeOverTransactionValueErrorMessage(r,a);if(r instanceof t.ErrorWithAmount){let{amount:e,message:t}=r;return`${t} ${e}`}let l=s(r);if(l&&o.isInsufficientFundsError(l))return e.insufficientResourcesErrorCodes.INSUFFICIENT_FUNDS;if(l){let t=l.toLowerCase(),n=Object.keys(e.transactionErrorCodes).find(n=>t===e.transactionErrorCodes[n].toLowerCase());if(n&&n in e.UserFriendlyErrorCodes)return e.UserFriendlyErrorCodes[n];let r=Object.entries(e.transactionErrorCodes).find(([e,n])=>t.includes(n.toLowerCase()));if(r)return e.UserFriendlyErrorCodes[r[0]]??r[1];if(Object.values(e.DIRECTLY_SHOW_MESSAGE_ERROR_CODES).find(e=>t.includes(e.toLowerCase())))return l}return a?c(a):e.transactionErrorCodes.UNKNOWN},u=(e,t)=>{let n;switch(t){case a.TransactionRequestType.Send:case a.TransactionRequestType.ProxySend:n=r.ErrorCategory.WITHDRAW;break;case a.TransactionRequestType.SwapTokens:case a.TransactionRequestType.ProxySwapTokens:n=r.ErrorCategory.SWAP;break;case a.TransactionRequestType.ReceiveFromShieldedAccount:n=r.ErrorCategory.Receive;break;case a.TransactionRequestType.Fund:n=r.ErrorCategory.Fund;break;case a.TransactionRequestType.PrivateTransactionFromProxy:n=r.ErrorCategory.DappTransaction;break;default:n=void 0;break}return l(e,n)};exports.extractMessage=s,exports.getErrorMessage=l,exports.getErrorMessageFromTransactionRequest=u;
1
+ const e=require(`./error-codes.constants.cjs`),t=require(`./customErrors/ErrorWithAmount.cjs`),n=require(`./customErrors/FeeOverTransactionValueError.cjs`),r=require(`./types.cjs`),i=require(`./customErrors/customErrors.helpers.cjs`);require(`./customErrors/index.cjs`);const a=require(`../types/transaction.types.cjs`);require(`../types/index.cjs`);const o=require(`./isInsufficientFundsError.cjs`);var s=(e,t)=>{let n=t.reduce((e,t)=>{if(!(typeof e!=`object`||!e||!(t in e)))return e[t]},e);return typeof n==`string`&&n?n:void 0},c=e=>{if(typeof e==`object`&&e){let t=s(e,[`response`,`data`,`message`])??s(e,[`response`,`data`,`detail`])??s(e,[`data`,`message`])??s(e,[`data`,`detail`]);if(t)return t;if(`message`in e&&typeof e.message==`string`&&e.message)return e.message;if(`error`in e&&typeof e.error==`string`&&e.error)return e.error}if(e instanceof Error)return e.message;if(typeof e==`string`)return e},l=t=>{switch(t){case r.ErrorCategory.DEPOSIT:return`Deposit failed`;case r.ErrorCategory.SWAP:return`Swap failed`;case r.ErrorCategory.BRIDGE:return`Bridge failed`;case r.ErrorCategory.WITHDRAW:return`Send failed`;case r.ErrorCategory.Fund:return`Unshield failed`;case r.ErrorCategory.Receive:return`Shield failed`;case r.ErrorCategory.DappTransaction:return`DApp transaction failed`;case r.ErrorCategory.Approve:return`Approval failed`;default:return e.transactionErrorCodes.UNKNOWN}},u=(r,a)=>{if(r instanceof n.FeeOverTransactionValueError)return i.getGenericFeeOverTransactionValueErrorMessage(r,a);if(r instanceof t.ErrorWithAmount){let{amount:e,message:t}=r;return`${t} ${e}`}let s=c(r);if(s&&o.isInsufficientFundsError(s))return e.insufficientResourcesErrorCodes.INSUFFICIENT_FUNDS;if(s){let t=s.toLowerCase(),n=Object.keys(e.transactionErrorCodes).find(n=>t===e.transactionErrorCodes[n].toLowerCase());if(n&&n in e.UserFriendlyErrorCodes)return e.UserFriendlyErrorCodes[n];let r=Object.entries(e.transactionErrorCodes).find(([e,n])=>t.includes(n.toLowerCase()));if(r)return e.UserFriendlyErrorCodes[r[0]]??r[1];if(Object.values(e.DIRECTLY_SHOW_MESSAGE_ERROR_CODES).find(e=>t.includes(e.toLowerCase())))return s}return a?l(a):e.transactionErrorCodes.UNKNOWN},d=(e,t)=>{let n;switch(t){case a.TransactionRequestType.Send:case a.TransactionRequestType.ProxySend:n=r.ErrorCategory.WITHDRAW;break;case a.TransactionRequestType.SwapTokens:case a.TransactionRequestType.ProxySwapTokens:n=r.ErrorCategory.SWAP;break;case a.TransactionRequestType.ReceiveFromShieldedAccount:n=r.ErrorCategory.Receive;break;case a.TransactionRequestType.Fund:n=r.ErrorCategory.Fund;break;case a.TransactionRequestType.PrivateTransactionFromProxy:n=r.ErrorCategory.DappTransaction;break;default:n=void 0;break}return u(e,n)};exports.extractMessage=c,exports.getErrorMessage=u,exports.getErrorMessageFromTransactionRequest=d;
@@ -8,16 +8,29 @@ import { TransactionRequestType as c } from "../types/transaction.types.mjs";
8
8
  import "../types/index.mjs";
9
9
  import { isInsufficientFundsError as l } from "./isInsufficientFundsError.mjs";
10
10
  //#region libs/shared/common/src/error-handling/get-error.message.ts
11
- var u = (e) => {
11
+ var u = (e, t) => {
12
+ let n = t.reduce((e, t) => {
13
+ if (!(typeof e != "object" || !e || !(t in e))) return e[t];
14
+ }, e);
15
+ return typeof n == "string" && n ? n : void 0;
16
+ }, d = (e) => {
12
17
  if (typeof e == "object" && e) {
13
- if ("response" in e && typeof e.response == "object" && e.response !== null && "data" in e.response && typeof e.response.data == "object" && e.response.data !== null && "message" in e.response.data && typeof e.response.data.message == "string") return e.response.data.message;
14
- if ("data" in e && typeof e.data == "object" && e.data !== null && "message" in e.data && typeof e.data.message == "string") return e.data.message;
18
+ let t = u(e, [
19
+ "response",
20
+ "data",
21
+ "message"
22
+ ]) ?? u(e, [
23
+ "response",
24
+ "data",
25
+ "detail"
26
+ ]) ?? u(e, ["data", "message"]) ?? u(e, ["data", "detail"]);
27
+ if (t) return t;
15
28
  if ("message" in e && typeof e.message == "string" && e.message) return e.message;
16
29
  if ("error" in e && typeof e.error == "string" && e.error) return e.error;
17
30
  }
18
31
  if (e instanceof Error) return e.message;
19
32
  if (typeof e == "string") return e;
20
- }, d = (e) => {
33
+ }, f = (e) => {
21
34
  switch (e) {
22
35
  case o.DEPOSIT: return "Deposit failed";
23
36
  case o.SWAP: return "Swap failed";
@@ -29,23 +42,23 @@ var u = (e) => {
29
42
  case o.Approve: return "Approval failed";
30
43
  default: return r.UNKNOWN;
31
44
  }
32
- }, f = (o, c) => {
45
+ }, p = (o, c) => {
33
46
  if (o instanceof a) return s(o, c);
34
47
  if (o instanceof i) {
35
48
  let { amount: e, message: t } = o;
36
49
  return `${t} ${e}`;
37
50
  }
38
- let f = u(o);
39
- if (f && l(f)) return n.INSUFFICIENT_FUNDS;
40
- if (f) {
41
- let n = f.toLowerCase(), i = Object.keys(r).find((e) => n === r[e].toLowerCase());
51
+ let u = d(o);
52
+ if (u && l(u)) return n.INSUFFICIENT_FUNDS;
53
+ if (u) {
54
+ let n = u.toLowerCase(), i = Object.keys(r).find((e) => n === r[e].toLowerCase());
42
55
  if (i && i in t) return t[i];
43
56
  let a = Object.entries(r).find(([e, t]) => n.includes(t.toLowerCase()));
44
57
  if (a) return t[a[0]] ?? a[1];
45
- if (Object.values(e).find((e) => n.includes(e.toLowerCase()))) return f;
58
+ if (Object.values(e).find((e) => n.includes(e.toLowerCase()))) return u;
46
59
  }
47
- return c ? d(c) : r.UNKNOWN;
48
- }, p = (e, t) => {
60
+ return c ? f(c) : r.UNKNOWN;
61
+ }, m = (e, t) => {
49
62
  let n;
50
63
  switch (t) {
51
64
  case c.Send:
@@ -69,7 +82,7 @@ var u = (e) => {
69
82
  n = void 0;
70
83
  break;
71
84
  }
72
- return f(e, n);
85
+ return p(e, n);
73
86
  };
74
87
  //#endregion
75
- export { u as extractMessage, f as getErrorMessage, p as getErrorMessageFromTransactionRequest };
88
+ export { d as extractMessage, p as getErrorMessage, m as getErrorMessageFromTransactionRequest };
@@ -1 +1 @@
1
- const e=require(`./ERC20.json.cjs`),t=require(`./ERC721.json.cjs`),n=require(`./ERC1155.json.cjs`),r=require(`./IQuoterV2.json.cjs`),i=require(`./IUniswapV3Factory.json.cjs`),a=require(`./ISwapRouter.json.cjs`);var o=e.default.abi,s=t.default.abi,c=n.default.abi;r.default.abi,i.default.abi,a.default.abi,exports.ERC1155ABI=c,exports.ERC20ABI=o,exports.ERC721ABI=s;
1
+ const e=require(`./ERC20.json.cjs`),t=require(`./ERC721.json.cjs`),n=require(`./ERC1155.json.cjs`);var r=e.default.abi,i=t.default.abi,a=n.default.abi;exports.ERC1155ABI=a,exports.ERC20ABI=r,exports.ERC721ABI=i;
@@ -104,116 +104,4 @@ declare const ERC1155ABI: ({
104
104
  type: string;
105
105
  anonymous?: undefined;
106
106
  })[];
107
- declare const quoterV2ABI: ({
108
- inputs: {
109
- internalType: string;
110
- name: string;
111
- type: string;
112
- }[];
113
- name: string;
114
- outputs: {
115
- internalType: string;
116
- name: string;
117
- type: string;
118
- }[];
119
- stateMutability: string;
120
- type: string;
121
- } | {
122
- inputs: {
123
- components: {
124
- internalType: string;
125
- name: string;
126
- type: string;
127
- }[];
128
- internalType: string;
129
- name: string;
130
- type: string;
131
- }[];
132
- name: string;
133
- outputs: {
134
- internalType: string;
135
- name: string;
136
- type: string;
137
- }[];
138
- stateMutability: string;
139
- type: string;
140
- })[];
141
- declare const factoryABI: ({
142
- anonymous: boolean;
143
- inputs: {
144
- indexed: boolean;
145
- internalType: string;
146
- name: string;
147
- type: string;
148
- }[];
149
- name: string;
150
- type: string;
151
- outputs?: undefined;
152
- stateMutability?: undefined;
153
- } | {
154
- inputs: {
155
- internalType: string;
156
- name: string;
157
- type: string;
158
- }[];
159
- name: string;
160
- outputs: {
161
- internalType: string;
162
- name: string;
163
- type: string;
164
- }[];
165
- stateMutability: string;
166
- type: string;
167
- anonymous?: undefined;
168
- })[];
169
- declare const ISwapRouterABI: ({
170
- inputs: {
171
- internalType: string;
172
- name: string;
173
- type: string;
174
- }[];
175
- stateMutability: string;
176
- type: string;
177
- name?: undefined;
178
- outputs?: undefined;
179
- } | {
180
- inputs: {
181
- components: {
182
- internalType: string;
183
- name: string;
184
- type: string;
185
- }[];
186
- internalType: string;
187
- name: string;
188
- type: string;
189
- }[];
190
- name: string;
191
- outputs: {
192
- internalType: string;
193
- name: string;
194
- type: string;
195
- }[];
196
- stateMutability: string;
197
- type: string;
198
- } | {
199
- inputs: {
200
- internalType: string;
201
- name: string;
202
- type: string;
203
- }[];
204
- name: string;
205
- outputs: {
206
- internalType: string;
207
- name: string;
208
- type: string;
209
- }[];
210
- stateMutability: string;
211
- type: string;
212
- } | {
213
- stateMutability: string;
214
- type: string;
215
- inputs?: undefined;
216
- name?: undefined;
217
- outputs?: undefined;
218
- })[];
219
- export { quoterV2ABI, factoryABI, AmTokenABI, ERC20ABI, ERC721ABI, USDCABI, daiABI, USDRABI, USDR3CRVABI, USDTABI, WETHABI, BUSDABI, sanctionsListABI, optimismGasPriceOracleAbi, NodeInterfaceABI, ISwapRouterABI, ERC1155ABI, };
107
+ export { AmTokenABI, ERC20ABI, ERC721ABI, USDCABI, daiABI, USDRABI, USDR3CRVABI, USDTABI, WETHABI, BUSDABI, sanctionsListABI, optimismGasPriceOracleAbi, NodeInterfaceABI, ERC1155ABI, };
@@ -1,11 +1,7 @@
1
1
  import e from "./ERC20.json.mjs";
2
2
  import t from "./ERC721.json.mjs";
3
3
  import n from "./ERC1155.json.mjs";
4
- import r from "./IQuoterV2.json.mjs";
5
- import i from "./IUniswapV3Factory.json.mjs";
6
- import a from "./ISwapRouter.json.mjs";
7
4
  //#region libs/shared/common/src/externalABIs/index.ts
8
- var o = e.abi, s = t.abi, c = n.abi;
9
- r.abi, i.abi, a.abi;
5
+ var r = e.abi, i = t.abi, a = n.abi;
10
6
  //#endregion
11
- export { c as ERC1155ABI, o as ERC20ABI, s as ERC721ABI };
7
+ export { a as ERC1155ABI, r as ERC20ABI, i as ERC721ABI };
@@ -1 +1 @@
1
- const e=require(`../utils/caseInsensitive.utils.cjs`),t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`../../error-handling/logger.cjs`),r=require(`../../types/external-action.types.cjs`),i=require(`../../types/offscreen.types.cjs`);require(`../../types/index.cjs`),require(`../../error-handling/index.cjs`);const a=require(`../pre-transaction/getFeeStructure.cjs`);require(`../pre-transaction/index.cjs`);const o=require(`../utils/convertEmporiumOpToCallInfo.cjs`),s=require(`../utils/postToOffscreen.cjs`);require(`../utils/index.cjs`);var c=async(c,l,u,d,f,p,m,h,g)=>{try{if(!((p.find(({erc20Token:t})=>e.caseInsensitiveEqual(t.erc20TokenAddress,c))?.totalUsdBalance??0)>=l)){let n=p.find(t=>t.totalUsdBalance<=l?!1:d.find(({erc20TokenAddress:n})=>e.caseInsensitiveEqual(n,t.erc20Token.erc20TokenAddress))?t.publicUsdBalance>l:!0);if(!n){s.postToOffscreen(i.MessagesFromOffscreen.AutoShieldTxStatus,{message:t.transactionErrorCodes.AUTO_SHIELD_INSUFFICIENT_GAS});return}c=n.erc20Token.erc20TokenAddress,m=await a.getFeeStructure(u,c,h,r.ExternalActionId.Emporium,f.map(e=>o.convertEmporiumOpToCallInfo(e,g,u)))}return{feeToken:c,feeStructure:m}}catch(e){n.Logger.error(`selectGasToken error`,{error:e});return}};exports.selectGasToken=c;
1
+ const e=require(`../utils/caseInsensitive.utils.cjs`),t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`../../types/external-action.types.cjs`),r=require(`../../types/offscreen.types.cjs`);require(`../../types/index.cjs`);const i=require(`../../error-handling/logger.cjs`);require(`../../error-handling/index.cjs`);const a=require(`../pre-transaction/getFeeStructure.cjs`);require(`../pre-transaction/index.cjs`);const o=require(`../utils/convertEmporiumOpToCallInfo.cjs`),s=require(`../utils/postToOffscreen.cjs`);require(`../utils/index.cjs`);var c=async(c,l,u,d,f,p,m,h,g)=>{try{if(!((p.find(({erc20Token:t})=>e.caseInsensitiveEqual(t.erc20TokenAddress,c))?.totalUsdBalance??0)>=l)){let i=p.find(t=>t.totalUsdBalance<=l?!1:d.find(({erc20TokenAddress:n})=>e.caseInsensitiveEqual(n,t.erc20Token.erc20TokenAddress))?t.publicUsdBalance>l:!0);if(!i){s.postToOffscreen(r.MessagesFromOffscreen.AutoShieldTxStatus,{message:t.transactionErrorCodes.AUTO_SHIELD_INSUFFICIENT_GAS});return}c=i.erc20Token.erc20TokenAddress,m=await a.getFeeStructure(u,c,h,n.ExternalActionId.Emporium,f.map(e=>o.convertEmporiumOpToCallInfo(e,g,u)))}return{feeToken:c,feeStructure:m}}catch(e){i.Logger.error(`selectGasToken error`,{error:e});return}};exports.selectGasToken=c;
@@ -1,9 +1,9 @@
1
1
  import { caseInsensitiveEqual as e } from "../utils/caseInsensitive.utils.mjs";
2
2
  import { transactionErrorCodes as t } from "../../error-handling/error-codes.constants.mjs";
3
- import { Logger as n } from "../../error-handling/logger.mjs";
4
- import { ExternalActionId as r } from "../../types/external-action.types.mjs";
5
- import { MessagesFromOffscreen as i } from "../../types/offscreen.types.mjs";
3
+ import { ExternalActionId as n } from "../../types/external-action.types.mjs";
4
+ import { MessagesFromOffscreen as r } from "../../types/offscreen.types.mjs";
6
5
  import "../../types/index.mjs";
6
+ import { Logger as i } from "../../error-handling/logger.mjs";
7
7
  import "../../error-handling/index.mjs";
8
8
  import { getFeeStructure as a } from "../pre-transaction/getFeeStructure.mjs";
9
9
  import "../pre-transaction/index.mjs";
@@ -14,19 +14,19 @@ import "../utils/index.mjs";
14
14
  var c = async (c, l, u, d, f, p, m, h, g) => {
15
15
  try {
16
16
  if (!((p.find(({ erc20Token: t }) => e(t.erc20TokenAddress, c))?.totalUsdBalance ?? 0) >= l)) {
17
- let n = p.find((t) => t.totalUsdBalance <= l ? !1 : d.find(({ erc20TokenAddress: n }) => e(n, t.erc20Token.erc20TokenAddress)) ? t.publicUsdBalance > l : !0);
18
- if (!n) {
19
- s(i.AutoShieldTxStatus, { message: t.AUTO_SHIELD_INSUFFICIENT_GAS });
17
+ let i = p.find((t) => t.totalUsdBalance <= l ? !1 : d.find(({ erc20TokenAddress: n }) => e(n, t.erc20Token.erc20TokenAddress)) ? t.publicUsdBalance > l : !0);
18
+ if (!i) {
19
+ s(r.AutoShieldTxStatus, { message: t.AUTO_SHIELD_INSUFFICIENT_GAS });
20
20
  return;
21
21
  }
22
- c = n.erc20Token.erc20TokenAddress, m = await a(u, c, h, r.Emporium, f.map((e) => o(e, g, u)));
22
+ c = i.erc20Token.erc20TokenAddress, m = await a(u, c, h, n.Emporium, f.map((e) => o(e, g, u)));
23
23
  }
24
24
  return {
25
25
  feeToken: c,
26
26
  feeStructure: m
27
27
  };
28
28
  } catch (e) {
29
- n.error("selectGasToken error", { error: e });
29
+ i.error("selectGasToken error", { error: e });
30
30
  return;
31
31
  }
32
32
  };
@@ -1 +1 @@
1
- require(`./utils/abi.utils.cjs`),require(`./utils/serialize.utils.cjs`),require(`./utils/caseInsensitive.utils.cjs`),require(`./utils/amounts.utils.cjs`),require(`./web3/etherFunctions.cjs`),require(`./utils/time.utils.cjs`),require(`./utils/upToDateState.cjs`),require(`./utils/cacheFunctions.cjs`),require(`./utils/enclaveHandshakeService.cjs`),require(`./utils/encryptInputForEnclave.cjs`),require(`./utils/solanaMint.utils.cjs`),require(`./utils/customEnclaveFunctionsRegister.cjs`),require(`./utils/serialize-utxos.utils.cjs`),require(`./utils/addresses.cjs`),require(`./utils/tron.utils.cjs`),require(`./web3/events/getInputUtxoAndBalance.cjs`),require(`./utils/get-signature-header.cjs`),require(`./utils/legacyKeys.cjs`),require(`./utils/auth.utils.cjs`),require(`./utils/string.utils.cjs`),require(`./utils/token-check.utils.cjs`),require(`./utils/map.utils.cjs`),require(`./utils/mutexes.utils.cjs`),require(`./utils/erc20tokenFunctions.cjs`),require(`./web3/events/getShieldedBalance.cjs`),require(`./pre-transaction/outputUtxoProcessing.cjs`),require(`./utils/external-action.utils.cjs`),require(`./snarkjs/common.snarkjs.cjs`),require(`./pre-transaction/solana.cjs`),require(`./snarkjs/signedMessageHash.cjs`),require(`./pre-transaction/process-gas-estimates.cjs`),require(`./pre-transaction/getVolatileTransferAmount.cjs`),require(`./pre-transaction/constructAdminData.cjs`),require(`./utils/create-provider.cjs`),require(`./pre-transaction/convert-okx-instructions.cjs`),require(`./web3/getSolanaPriorityFee.cjs`),require(`./utils/process.utils.cjs`),require(`./pre-transaction/sendV0Transaction.cjs`),require(`./utils/bytes32.utils.cjs`),require(`./pre-transaction/recipientUtxoProcessing.cjs`),require(`./pre-transaction/ensureAmountChanges.cjs`),require(`./pre-transaction/getFeeStructure.cjs`),require(`./pre-transaction/waitForDepositedUtxosInMerkleTree.cjs`),require(`./pre-transaction/buildCommitmentValidationData.cjs`),require(`./pre-transaction/index.cjs`),require(`./snarkjs/generateZkProof.cjs`),require(`./snarkjs/generateMainAndCommitmentZkProof.cjs`),require(`./utils/resolve-sync.utils.cjs`),require(`./utils/reloadPage.cjs`),require(`./utils/cacheDevice.utils.cjs`),require(`./utils/involves-permit2-op.cjs`),require(`./utils/convertEmporiumOpToCallInfo.cjs`),require(`./utils/getRecipientInfoFromUserKeys.cjs`),require(`./utils/publicBalance.utils.cjs`),require(`./utils/postToOffscreen.cjs`),require(`./utils/getContractAddress.cjs`),require(`./utils/getUtxosFromReceipt.utils.cjs`),require(`./utils/getUtxosFromReceiptSolana.cjs`),require(`./utils/fees.utils.cjs`),require(`./utils/proxyAvatar.utils.cjs`),require(`./utils/enclave-signature-storage.cjs`),require(`./utils/tx-confirmation.utils.cjs`),require(`./utils/tronSimulation.utils.cjs`),require(`./utils/getSignerFromContract.cjs`),require(`./utils/temp-wallet.utils.cjs`),require(`./utils/mnemonics.cjs`),require(`./utils/nearIntents.utils.cjs`),require(`./utils/index.cjs`),require(`./snarkjs/fetchOnChainRootHashes.cjs`),require(`./private-wallet/emporium.helpers.cjs`),require(`./snarkjs/constructGeneralZkProof.cjs`),require(`./web3/uniswapAPI.cjs`),require(`./web3/odosAPI.cjs`),require(`./web3/oneInchAPI.cjs`),require(`./web3/lifiAPI.cjs`),require(`./web3/okxAPI.cjs`),require(`./web3/index.cjs`),require(`./snarkjs/constructSolanaZkProof.cjs`),require(`./snarkjs/index.cjs`),require(`./private-wallet/emporium.swap.helpers.cjs`),require(`./private-wallet/index.cjs`),require(`./auto-deposit-back-helpers/get-tokens-to-deposit-back.cjs`),require(`./auto-deposit-back-helpers/get-gas-token-records.cjs`),require(`./auto-deposit-back-helpers/select-gas-token.cjs`),require(`./auto-deposit-back-helpers/update-hinkal.cjs`),require(`./auto-deposit-back-helpers/index.cjs`);
1
+ require(`./utils/abi.utils.cjs`),require(`./utils/serialize.utils.cjs`),require(`./utils/caseInsensitive.utils.cjs`),require(`./utils/amounts.utils.cjs`),require(`./web3/etherFunctions.cjs`),require(`./utils/time.utils.cjs`),require(`./utils/upToDateState.cjs`),require(`./utils/cacheFunctions.cjs`),require(`./utils/enclaveHandshakeService.cjs`),require(`./utils/encryptInputForEnclave.cjs`),require(`./utils/solanaMint.utils.cjs`),require(`./utils/serialize-utxos.utils.cjs`),require(`./utils/customEnclaveFunctionsRegister.cjs`),require(`./utils/addresses.cjs`),require(`./utils/tron.utils.cjs`),require(`./web3/events/getInputUtxoAndBalance.cjs`),require(`./utils/legacyKeys.cjs`),require(`./utils/auth.utils.cjs`),require(`./utils/string.utils.cjs`),require(`./utils/token-check.utils.cjs`),require(`./utils/map.utils.cjs`),require(`./utils/mutexes.utils.cjs`),require(`./utils/erc20tokenFunctions.cjs`),require(`./web3/events/getShieldedBalance.cjs`),require(`./pre-transaction/outputUtxoProcessing.cjs`),require(`./utils/external-action.utils.cjs`),require(`./snarkjs/common.snarkjs.cjs`),require(`./pre-transaction/solana.cjs`),require(`./snarkjs/signedMessageHash.cjs`),require(`./pre-transaction/process-gas-estimates.cjs`),require(`./pre-transaction/getVolatileTransferAmount.cjs`),require(`./pre-transaction/constructAdminData.cjs`),require(`./utils/create-provider.cjs`),require(`./pre-transaction/calculateSolanaNullifierCount.cjs`),require(`./pre-transaction/convert-okx-instructions.cjs`),require(`./web3/getSolanaPriorityFee.cjs`),require(`./utils/process.utils.cjs`),require(`./pre-transaction/sendV0Transaction.cjs`),require(`./utils/bytes32.utils.cjs`),require(`./pre-transaction/ensureAmountChanges.cjs`),require(`./pre-transaction/getFeeStructure.cjs`),require(`./pre-transaction/getExternalSwapAddress.cjs`),require(`./pre-transaction/waitForDepositedUtxosInMerkleTree.cjs`),require(`./pre-transaction/buildCommitmentValidationData.cjs`),require(`./pre-transaction/index.cjs`),require(`./snarkjs/generateZkProof.cjs`),require(`./snarkjs/generateMainAndCommitmentZkProof.cjs`),require(`./snarkjs/fetchOnChainRootHashes.cjs`),require(`./utils/getContractAddress.cjs`),require(`./private-wallet/emporium.helpers.cjs`),require(`./snarkjs/constructGeneralZkProof.cjs`),require(`./utils/getSignerFromContract.cjs`),require(`./utils/tronSimulation.utils.cjs`),require(`./utils/tx-confirmation.utils.cjs`),require(`./utils/getUtxosFromReceipt.utils.cjs`),require(`./utils/getRecipientInfoFromUserKeys.cjs`),require(`./utils/resolve-sync.utils.cjs`),require(`./utils/reloadPage.cjs`),require(`./utils/cacheDevice.utils.cjs`),require(`./utils/involves-permit2-op.cjs`),require(`./utils/convertEmporiumOpToCallInfo.cjs`),require(`./utils/publicBalance.utils.cjs`),require(`./utils/postToOffscreen.cjs`),require(`./utils/getUtxosFromReceiptSolana.cjs`),require(`./utils/fees.utils.cjs`),require(`./utils/proxyAvatar.utils.cjs`),require(`./utils/enclave-signature-storage.cjs`),require(`./utils/temp-wallet.utils.cjs`),require(`./utils/mnemonics.cjs`),require(`./utils/nearIntents.utils.cjs`),require(`./utils/index.cjs`),require(`./web3/lifiAPI.cjs`),require(`./web3/okxAPI.cjs`),require(`./web3/index.cjs`),require(`./snarkjs/constructSolanaZkProof.cjs`),require(`./snarkjs/index.cjs`),require(`./private-wallet/emporium.swap.helpers.cjs`),require(`./private-wallet/index.cjs`),require(`./auto-deposit-back-helpers/get-tokens-to-deposit-back.cjs`),require(`./auto-deposit-back-helpers/get-gas-token-records.cjs`),require(`./auto-deposit-back-helpers/select-gas-token.cjs`),require(`./auto-deposit-back-helpers/update-hinkal.cjs`),require(`./auto-deposit-back-helpers/index.cjs`);
@@ -9,4 +9,3 @@ export * from './pre-transaction/outputUtxoProcessing';
9
9
  export * from './utils/requireEnv';
10
10
  export * from './utils/resolve-sync.utils';
11
11
  export * from './utils/getDataFromTransaction';
12
- export * from './web3/uniswapAPI';
@@ -9,12 +9,11 @@ import "./utils/cacheFunctions.mjs";
9
9
  import "./utils/enclaveHandshakeService.mjs";
10
10
  import "./utils/encryptInputForEnclave.mjs";
11
11
  import "./utils/solanaMint.utils.mjs";
12
- import "./utils/customEnclaveFunctionsRegister.mjs";
13
12
  import "./utils/serialize-utxos.utils.mjs";
13
+ import "./utils/customEnclaveFunctionsRegister.mjs";
14
14
  import "./utils/addresses.mjs";
15
15
  import "./utils/tron.utils.mjs";
16
16
  import "./web3/events/getInputUtxoAndBalance.mjs";
17
- import "./utils/get-signature-header.mjs";
18
17
  import "./utils/legacyKeys.mjs";
19
18
  import "./utils/auth.utils.mjs";
20
19
  import "./utils/string.utils.mjs";
@@ -32,46 +31,44 @@ import "./pre-transaction/process-gas-estimates.mjs";
32
31
  import "./pre-transaction/getVolatileTransferAmount.mjs";
33
32
  import "./pre-transaction/constructAdminData.mjs";
34
33
  import "./utils/create-provider.mjs";
34
+ import "./pre-transaction/calculateSolanaNullifierCount.mjs";
35
35
  import "./pre-transaction/convert-okx-instructions.mjs";
36
36
  import "./web3/getSolanaPriorityFee.mjs";
37
37
  import "./utils/process.utils.mjs";
38
38
  import "./pre-transaction/sendV0Transaction.mjs";
39
39
  import "./utils/bytes32.utils.mjs";
40
- import "./pre-transaction/recipientUtxoProcessing.mjs";
41
40
  import "./pre-transaction/ensureAmountChanges.mjs";
42
41
  import "./pre-transaction/getFeeStructure.mjs";
42
+ import "./pre-transaction/getExternalSwapAddress.mjs";
43
43
  import "./pre-transaction/waitForDepositedUtxosInMerkleTree.mjs";
44
44
  import "./pre-transaction/buildCommitmentValidationData.mjs";
45
45
  import "./pre-transaction/index.mjs";
46
46
  import "./snarkjs/generateZkProof.mjs";
47
47
  import "./snarkjs/generateMainAndCommitmentZkProof.mjs";
48
+ import "./snarkjs/fetchOnChainRootHashes.mjs";
49
+ import "./utils/getContractAddress.mjs";
50
+ import "./private-wallet/emporium.helpers.mjs";
51
+ import "./snarkjs/constructGeneralZkProof.mjs";
52
+ import "./utils/getSignerFromContract.mjs";
53
+ import "./utils/tronSimulation.utils.mjs";
54
+ import "./utils/tx-confirmation.utils.mjs";
55
+ import "./utils/getUtxosFromReceipt.utils.mjs";
56
+ import "./utils/getRecipientInfoFromUserKeys.mjs";
48
57
  import "./utils/resolve-sync.utils.mjs";
49
58
  import "./utils/reloadPage.mjs";
50
59
  import "./utils/cacheDevice.utils.mjs";
51
60
  import "./utils/involves-permit2-op.mjs";
52
61
  import "./utils/convertEmporiumOpToCallInfo.mjs";
53
- import "./utils/getRecipientInfoFromUserKeys.mjs";
54
62
  import "./utils/publicBalance.utils.mjs";
55
63
  import "./utils/postToOffscreen.mjs";
56
- import "./utils/getContractAddress.mjs";
57
- import "./utils/getUtxosFromReceipt.utils.mjs";
58
64
  import "./utils/getUtxosFromReceiptSolana.mjs";
59
65
  import "./utils/fees.utils.mjs";
60
66
  import "./utils/proxyAvatar.utils.mjs";
61
67
  import "./utils/enclave-signature-storage.mjs";
62
- import "./utils/tx-confirmation.utils.mjs";
63
- import "./utils/tronSimulation.utils.mjs";
64
- import "./utils/getSignerFromContract.mjs";
65
68
  import "./utils/temp-wallet.utils.mjs";
66
69
  import "./utils/mnemonics.mjs";
67
70
  import "./utils/nearIntents.utils.mjs";
68
71
  import "./utils/index.mjs";
69
- import "./snarkjs/fetchOnChainRootHashes.mjs";
70
- import "./private-wallet/emporium.helpers.mjs";
71
- import "./snarkjs/constructGeneralZkProof.mjs";
72
- import "./web3/uniswapAPI.mjs";
73
- import "./web3/odosAPI.mjs";
74
- import "./web3/oneInchAPI.mjs";
75
72
  import "./web3/lifiAPI.mjs";
76
73
  import "./web3/okxAPI.mjs";
77
74
  import "./web3/index.mjs";
@@ -1 +1 @@
1
- require(`../../constants/chains.constants.cjs`),require(`../web3/events/getShieldedBalance.cjs`),require(`./solana.cjs`),require(`../utils/create-provider.cjs`),require(`@solana/web3.js`);
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../error-handling/logger.cjs`),n=require(`../web3/events/getShieldedBalance.cjs`),r=require(`./solana.cjs`),i=require(`../utils/create-provider.cjs`),a=require(`../snarkjs/constructTxEnclave.cjs`);let o=require(`@solana/web3.js`);var s=6,c=async(c,l,u,d)=>{if(!e.isSolanaLike(l)||u.length===0||d.length===0)return 0;if(c.generateProofRemotely)try{return await a.estimateNullifiersEnclaveCall(c,{chainId:l,mintAddresses:u,amountChanges:d})}catch(e){return t.Logger.error(`calculateSolanaNullifierCount: enclave estimate failed, charging maximum rent`,e),s}let f;try{f=(await n.addPaddingToUtxos(c,l,u,d,6)).flat().filter(e=>e.amount!==0n)}catch(e){return t.Logger.log(`Error during getting inputUtxos locally:`,e),s}if(f.length===0)return 0;try{let{fetchRpcUrl:t,contractData:n}=e.networkRegistry[l],{originalDeployer:a,hinkalIdl:s}=n;if(!t)throw Error(`RPC URL not found for chain ID`);if(!a)throw Error(`Original deployer not found for chain ID`);if(!s)throw Error(`Hinkal IDL not found for chain ID`);let c=i.createCustomSolanaConnection(t),u=new o.PublicKey(a),d=new o.PublicKey(s.address),p=f.map(e=>r.getNullifierAccount(BigInt(e.getNullifier()),u,d));return(await c.getMultipleAccountsInfo(p)).filter(e=>e===null).length}catch(e){return t.Logger.error(`calculateSolanaNullifierCount: nullifier probe failed, charging for every note`,e),f.length}};exports.calculateSolanaNullifierCount=c;
@@ -1,5 +1,39 @@
1
- import "../../constants/chains.constants.mjs";
2
- import "../web3/events/getShieldedBalance.mjs";
3
- import "./solana.mjs";
4
- import "../utils/create-provider.mjs";
5
- import "@solana/web3.js";
1
+ import { isSolanaLike as e, networkRegistry as t } from "../../constants/chains.constants.mjs";
2
+ import { Logger as n } from "../../error-handling/logger.mjs";
3
+ import { addPaddingToUtxos as r } from "../web3/events/getShieldedBalance.mjs";
4
+ import { getNullifierAccount as i } from "./solana.mjs";
5
+ import { createCustomSolanaConnection as a } from "../utils/create-provider.mjs";
6
+ import { estimateNullifiersEnclaveCall as o } from "../snarkjs/constructTxEnclave.mjs";
7
+ import { PublicKey as s } from "@solana/web3.js";
8
+ //#region libs/shared/common/src/functions/pre-transaction/calculateSolanaNullifierCount.ts
9
+ var c = 6, l = async (l, u, d, f) => {
10
+ if (!e(u) || d.length === 0 || f.length === 0) return 0;
11
+ if (l.generateProofRemotely) try {
12
+ return await o(l, {
13
+ chainId: u,
14
+ mintAddresses: d,
15
+ amountChanges: f
16
+ });
17
+ } catch (e) {
18
+ return n.error("calculateSolanaNullifierCount: enclave estimate failed, charging maximum rent", e), c;
19
+ }
20
+ let p;
21
+ try {
22
+ p = (await r(l, u, d, f, 6)).flat().filter((e) => e.amount !== 0n);
23
+ } catch (e) {
24
+ return n.log("Error during getting inputUtxos locally:", e), c;
25
+ }
26
+ if (p.length === 0) return 0;
27
+ try {
28
+ let { fetchRpcUrl: e, contractData: n } = t[u], { originalDeployer: r, hinkalIdl: o } = n;
29
+ if (!e) throw Error("RPC URL not found for chain ID");
30
+ if (!r) throw Error("Original deployer not found for chain ID");
31
+ if (!o) throw Error("Hinkal IDL not found for chain ID");
32
+ let c = a(e), l = new s(r), d = new s(o.address), f = p.map((e) => i(BigInt(e.getNullifier()), l, d));
33
+ return (await c.getMultipleAccountsInfo(f)).filter((e) => e === null).length;
34
+ } catch (e) {
35
+ return n.error("calculateSolanaNullifierCount: nullifier probe failed, charging for every note", e), p.length;
36
+ }
37
+ };
38
+ //#endregion
39
+ export { l as calculateSolanaNullifierCount };
@@ -1 +1 @@
1
- const e=require(`../../constants/chains.constants.cjs`),t=require(`../../types/external-action.types.cjs`);var n=(n,r)=>{let{contractData:i}=e.networkRegistry[n],a;switch(r){case t.ExternalActionId.Uniswap:a=i?.uniswapExternalActionAddress;break;case t.ExternalActionId.Odos:a=i?.odosExternalActionInstanceAddress;break;case t.ExternalActionId.OneInch:a=i?.oneInchExternalActionInstanceAddress;break;case t.ExternalActionId.Lifi:a=i?.hinkalAddress;break;default:a=i?.uniswapExternalActionAddress;break}if(!a)throw Error(`No external Address set during swap`);return a};exports.getExternalSwapAddress=n;
1
+ const e=require(`../../constants/chains.constants.cjs`),t=require(`../../types/external-action.types.cjs`);var n=(n,r)=>{if(r!==t.ExternalActionId.Lifi)throw Error(`Unsupported swap external action: ${r}`);let{contractData:i}=e.networkRegistry[n],a=i?.lifiExternalActionInstanceAddress;if(!a)throw Error(`No external Address set during swap`);return a};exports.getExternalSwapAddress=n;
@@ -2,24 +2,8 @@ import { networkRegistry as e } from "../../constants/chains.constants.mjs";
2
2
  import { ExternalActionId as t } from "../../types/external-action.types.mjs";
3
3
  //#region libs/shared/common/src/functions/pre-transaction/getExternalSwapAddress.ts
4
4
  var n = (n, r) => {
5
- let { contractData: i } = e[n], a;
6
- switch (r) {
7
- case t.Uniswap:
8
- a = i?.uniswapExternalActionAddress;
9
- break;
10
- case t.Odos:
11
- a = i?.odosExternalActionInstanceAddress;
12
- break;
13
- case t.OneInch:
14
- a = i?.oneInchExternalActionInstanceAddress;
15
- break;
16
- case t.Lifi:
17
- a = i?.hinkalAddress;
18
- break;
19
- default:
20
- a = i?.uniswapExternalActionAddress;
21
- break;
22
- }
5
+ if (r !== t.Lifi) throw Error(`Unsupported swap external action: ${r}`);
6
+ let { contractData: i } = e[n], a = i?.lifiExternalActionInstanceAddress;
23
7
  if (!a) throw Error("No external Address set during swap");
24
8
  return a;
25
9
  };
@@ -1 +1 @@
1
- require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/protocol.constants.cjs`);let t=require(`ethers`),n=require(`@coral-xyz/anchor`);var r=(r,i,a,o,s,c,l,u)=>{let d=new n.BN(s.toString()),f=new n.BN(c.toString()),p=o.reduce((e,t)=>[...e,...new n.BN(t.length).toArray(`be`,8),...t],[]),m=l.reduce((e,t)=>{let r=[...new n.BN(t.programIndex).toArray(`be`,1),...new n.BN(t.accountIndexes.length).toArray(`be`,8),...t.accountIndexes,...new n.BN(t.data.length).toArray(`be`,8),...t.data];return[...e,...r]},[]),h=u.reduce((e,t)=>[...e,+!!t.isWritable,...t.pubkey.toBytes()],[]),g=[r.tokenNumber,r.nullifierAmount,r.outputAmount,...i.toBytes(),...a.toBytes(),...p,...d.toArray(`be`,8),...f.toArray(`be`,8),...m,...h];return BigInt(t.ethers.sha256(new Uint8Array(g)))%e.CIRCOM_P};exports.getSolanaCalldataHash=r;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/protocol.constants.cjs`);let t=require(`ethers`),n=require(`@coral-xyz/anchor`);var r=(r,i,a,o,s,c,l,u,d)=>{let f=new n.BN(c.toString()),p=new n.BN(l.toString()),m=o.reduce((e,t)=>[...e,...new n.BN(t.length).toArray(`be`,8),...t],[]),h=u.reduce((e,t)=>{let r=[...new n.BN(t.programIndex).toArray(`be`,1),...new n.BN(t.accountIndexes.length).toArray(`be`,8),...t.accountIndexes,...new n.BN(t.data.length).toArray(`be`,8),...t.data];return[...e,...r]},[]),g=d.reduce((e,t)=>[...e,+!!t.isWritable,...t.pubkey.toBytes()],[]),_=[r.tokenNumber,r.nullifierAmount,r.outputAmount,...i.toBytes(),...a.toBytes(),...m,...t.ethers.getBytes(s),...f.toArray(`be`,8),...p.toArray(`be`,8),...h,...g];return BigInt(t.ethers.sha256(new Uint8Array(_)))%e.CIRCOM_P};exports.getSolanaCalldataHash=r;
@@ -1,4 +1,4 @@
1
1
  import { DimDataType } from '../../types/circom-data.types';
2
2
  import { AccountMeta, PublicKey } from '@solana/web3.js';
3
3
  import { HinkalInstruction } from './convert-okx-instructions';
4
- export declare const getSolanaCalldataHash: (dimensions: DimDataType, recipient: PublicKey, signer: PublicKey, encryptedOutputs: number[][], relayerFee: bigint, variableRate: bigint, instructions: HinkalInstruction[], remainingAccounts: AccountMeta[]) => bigint;
4
+ export declare const getSolanaCalldataHash: (dimensions: DimDataType, recipient: PublicKey, signer: PublicKey, encryptedOutputs: number[][], onChainEncryptedOutput: string, relayerFee: bigint, variableRate: bigint, instructions: HinkalInstruction[], remainingAccounts: AccountMeta[]) => bigint;