@hinkal/common 0.0.111 → 0.0.112

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 (261) hide show
  1. package/index-DXElTGy9.mjs +254449 -0
  2. package/index.js +455 -642
  3. package/package.json +1 -1
  4. package/{webworker/snarkjsWorker/snarkjsWorkerLogic.js → snarkjsWorkerLogic-CVna_BW9.mjs} +1 -1
  5. package/utxoWorkerLogic-B1Hh-bq4.mjs +64 -0
  6. package/{webworker/workerProxy.js → workerProxy-BDj498Ht.mjs} +1 -1
  7. package/zkProofWorkerLogic-D9rxuuiK.mjs +60 -0
  8. package/API/API.js +0 -58
  9. package/API/HinkalPointsCalls.js +0 -38
  10. package/API/callBeefyGraphAPI.js +0 -37
  11. package/API/callCurveAPI.js +0 -156
  12. package/API/callMonitor.js +0 -30
  13. package/API/callOdosAPI.js +0 -44
  14. package/API/callOneInchAPI.js +0 -37
  15. package/API/callRelayer.js +0 -32
  16. package/API/checkRisk.js +0 -30
  17. package/API/dataServerCalls.js +0 -32
  18. package/API/fetchCommitmentsCache.js +0 -31
  19. package/API/fetchNullifiers.js +0 -30
  20. package/API/getAxelarGasEstimate.js +0 -37
  21. package/API/getCoingeckoPrice.js +0 -27
  22. package/API/getConnextReceiveFee.js +0 -30
  23. package/API/getGasEstimates.js +0 -38
  24. package/API/getRelayerURL.js +0 -32
  25. package/API/getServerURL.js +0 -67
  26. package/API/getTokenPrice.js +0 -41
  27. package/API/kycCalls.js +0 -32
  28. package/API/passwordCalls.js +0 -36
  29. package/API/referralProgramCalls.js +0 -58
  30. package/API/relayCalls.js +0 -30
  31. package/API/restoreSnapshots.js +0 -32
  32. package/API/rewardsPointsCalls.js +0 -40
  33. package/API/userVerifyTransactions.js +0 -45
  34. package/constants/assets.constants.js +0 -16
  35. package/constants/axelar.constants.js +0 -55
  36. package/constants/backend.constants.js +0 -18
  37. package/constants/beefy.registry.js +0 -24
  38. package/constants/chains.constants.js +0 -204
  39. package/constants/coingecko.constants.js +0 -53
  40. package/constants/contracts.constants.js +0 -276
  41. package/constants/crvCvx.registry.js +0 -636
  42. package/constants/crvDynamic.registry.js +0 -24
  43. package/constants/deploy-data/deploy-data-arbMainnet.json.js +0 -7415
  44. package/constants/deploy-data/deploy-data-avalanche.json.js +0 -7411
  45. package/constants/deploy-data/deploy-data-axelar1.json.js +0 -4329
  46. package/constants/deploy-data/deploy-data-axelar2.json.js +0 -4329
  47. package/constants/deploy-data/deploy-data-base.json.js +0 -8425
  48. package/constants/deploy-data/deploy-data-blast.json.js +0 -9600
  49. package/constants/deploy-data/deploy-data-bnbMainnet.json.js +0 -6877
  50. package/constants/deploy-data/deploy-data-ethMainnet.json.js +0 -11427
  51. package/constants/deploy-data/deploy-data-localhost.json.js +0 -13283
  52. package/constants/deploy-data/deploy-data-optimism.json.js +0 -7417
  53. package/constants/deploy-data/deploy-data-polygon.json.js +0 -7439
  54. package/constants/fees.constants.js +0 -57
  55. package/constants/kyc.constants.js +0 -118
  56. package/constants/lido.constants.js +0 -13
  57. package/constants/pendle.registry.js +0 -253
  58. package/constants/protocol.constants.js +0 -26
  59. package/constants/reorg-depths.constants.js +0 -15
  60. package/constants/rewards.constants.js +0 -27
  61. package/constants/server.constants.js +0 -157
  62. package/constants/token-data/ERC20Registry.js +0 -85
  63. package/constants/token-data/arbMainnetRegistry.json.js +0 -946
  64. package/constants/token-data/arbMainnetRegistryFixed.json.js +0 -856
  65. package/constants/token-data/avalancheRegistry.json.js +0 -591
  66. package/constants/token-data/avalancheRegistryFixed.json.js +0 -591
  67. package/constants/token-data/baseRegistry.json.js +0 -490
  68. package/constants/token-data/baseRegistryFixed.json.js +0 -463
  69. package/constants/token-data/blastRegistry.json.js +0 -137
  70. package/constants/token-data/blastRegistryFixed.json.js +0 -137
  71. package/constants/token-data/bnbMainnetRegistry.json.js +0 -973
  72. package/constants/token-data/bnbMainnetRegistryFixed.json.js +0 -973
  73. package/constants/token-data/coingeckoRegistry.json.js +0 -115623
  74. package/constants/token-data/ethMainnetRegistry.json.js +0 -2700
  75. package/constants/token-data/ethMainnetRegistryFixed.json.js +0 -2251
  76. package/constants/token-data/index.js +0 -6
  77. package/constants/token-data/localhostRegistry.json.js +0 -2768
  78. package/constants/token-data/optimismRegistry.json.js +0 -1455
  79. package/constants/token-data/optimismRegistryFixed.json.js +0 -1392
  80. package/constants/token-data/polygonRegistry.json.js +0 -1327
  81. package/constants/token-data/polygonRegistryFixed.json.js +0 -1255
  82. package/constants/token-data/popularTokens.constants.js +0 -14
  83. package/constants/token-data/tokenPricing.consts.js +0 -8
  84. package/constants/vite.constants.js +0 -29
  85. package/crypto/babyJub.js +0 -15
  86. package/crypto/poseidon.js +0 -26
  87. package/crypto/preProcessing.js +0 -9
  88. package/data-structures/Hinkal/Hinkal.js +0 -299
  89. package/data-structures/Hinkal/hinkalActionBeefy.js +0 -101
  90. package/data-structures/Hinkal/hinkalActionConvex.js +0 -83
  91. package/data-structures/Hinkal/hinkalActionCurve.js +0 -112
  92. package/data-structures/Hinkal/hinkalActionLidoEth.js +0 -91
  93. package/data-structures/Hinkal/hinkalActionPendle.js +0 -140
  94. package/data-structures/Hinkal/hinkalActionPendleLP.js +0 -96
  95. package/data-structures/Hinkal/hinkalActionStake.js +0 -138
  96. package/data-structures/Hinkal/hinkalActionVolatile.js +0 -112
  97. package/data-structures/Hinkal/hinkalDeposit.js +0 -95
  98. package/data-structures/Hinkal/hinkalGetZkMeProvider.js +0 -47
  99. package/data-structures/Hinkal/hinkalPrivateWallet.js +0 -66
  100. package/data-structures/Hinkal/hinkalSwap.js +0 -98
  101. package/data-structures/Hinkal/hinkalTransfer.js +0 -5
  102. package/data-structures/Hinkal/hinkalWithdraw.js +0 -91
  103. package/data-structures/Hinkal/resetMerkleTrees.js +0 -49
  104. package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.js +0 -83
  105. package/data-structures/ValueCache/ValueCache.js +0 -25
  106. package/data-structures/crypto-keys/decodeUTXO.js +0 -40
  107. package/data-structures/crypto-keys/encryptDecryptUtxo.js +0 -41
  108. package/data-structures/crypto-keys/keyUtils.js +0 -10
  109. package/data-structures/crypto-keys/keys.js +0 -90
  110. package/data-structures/custom-token-registry/CustomTokenRegistry.js +0 -33
  111. package/data-structures/event-service/AbstractAccessTokenSnapshotService.js +0 -131
  112. package/data-structures/event-service/AbstractCommitmentsSnapshotService.js +0 -132
  113. package/data-structures/event-service/AbstractEventService.js +0 -118
  114. package/data-structures/event-service/AbstractNullifierSnapshotService.js +0 -59
  115. package/data-structures/event-service/AbstractSnapshotService.js +0 -35
  116. package/data-structures/merkle-tree/MerkleTree.js +0 -177
  117. package/data-structures/merkle-tree/MerkleTreeIncompleteError.js +0 -8
  118. package/data-structures/snapshot/ClientAccessTokenSnapshotService.js +0 -48
  119. package/data-structures/snapshot/ClientCommitmentsSnapshotService.js +0 -47
  120. package/data-structures/snapshot/ClientNullifierSnapshotService.js +0 -44
  121. package/data-structures/token-price-fetcher/TokenChecker.js +0 -29
  122. package/data-structures/token-price-fetcher/TokenPriceFetcher.js +0 -218
  123. package/data-structures/transactions-manager/TransactionsManager.js +0 -194
  124. package/data-structures/transactions-manager/history/getBeefyData.js +0 -68
  125. package/data-structures/transactions-manager/history/getConvexData.js +0 -57
  126. package/data-structures/transactions-manager/history/getCurveData.js +0 -97
  127. package/data-structures/transactions-manager/history/getDepositData.js +0 -36
  128. package/data-structures/transactions-manager/history/getLidoData.js +0 -44
  129. package/data-structures/transactions-manager/history/getPendleData.js +0 -59
  130. package/data-structures/transactions-manager/history/getSwapData.js +0 -43
  131. package/data-structures/transactions-manager/history/getTxDetails.js +0 -74
  132. package/data-structures/transactions-manager/history/getVolatileData.js +0 -75
  133. package/data-structures/transactions-manager/history/history.types.js +0 -62
  134. package/data-structures/transactions-manager/history/history.utils.js +0 -8
  135. package/data-structures/utxo/Utxo.js +0 -134
  136. package/data-structures/volatile-helper/VolatileHelper.js +0 -181
  137. package/error-handling/customErrors/ErrorWithAmount.js +0 -9
  138. package/error-handling/customErrors/FeeOverTransactionValueError.js +0 -9
  139. package/error-handling/customErrors/customErrors.helpers.js +0 -21
  140. package/error-handling/error-codes.constants.js +0 -184
  141. package/error-handling/get-error.message.js +0 -53
  142. package/error-handling/handleErrorRestore.js +0 -35
  143. package/error-handling/logError.js +0 -7
  144. package/error-handling/types.js +0 -4
  145. package/externalABIs/BUSD.js +0 -519
  146. package/externalABIs/BabPassport.json.js +0 -24
  147. package/externalABIs/BeefyRouterAbi.json.js +0 -1022
  148. package/externalABIs/BeefyStrategyAbi.json.js +0 -1423
  149. package/externalABIs/BeefyVaultAbi.json.js +0 -570
  150. package/externalABIs/BeefyZapAbi.json.js +0 -208
  151. package/externalABIs/BeefyZapOneInchAbi.json.js +0 -340
  152. package/externalABIs/ConvexBoosterAbi.json.js +0 -674
  153. package/externalABIs/ConvexBoosterAbiMainnet.json.js +0 -1002
  154. package/externalABIs/ConvexRewardPoolAbi.json.js +0 -883
  155. package/externalABIs/CurveReadingWrapperAbi.json.js +0 -1422
  156. package/externalABIs/CurveWrappedMainPool.json.js +0 -1136
  157. package/externalABIs/CurveZap.json.js +0 -262
  158. package/externalABIs/CvxCrvUtilities.json.js +0 -264
  159. package/externalABIs/DAI.js +0 -334
  160. package/externalABIs/ERC20.json.js +0 -291
  161. package/externalABIs/GalxePassport.json.js +0 -41
  162. package/externalABIs/IQuoterV2.json.js +0 -205
  163. package/externalABIs/ISwapRouter.json.js +0 -568
  164. package/externalABIs/IUniswapV3Factory.json.js +0 -201
  165. package/externalABIs/IUniswapV3Pool.json.js +0 -999
  166. package/externalABIs/LidoStEthAbi.json.js +0 -1603
  167. package/externalABIs/LidoStMaticAbi.json.js +0 -1764
  168. package/externalABIs/LidoStakeManagerAbi.json.js +0 -2082
  169. package/externalABIs/LidoWithdrawalQueueERC721Abi.json.js +0 -2030
  170. package/externalABIs/LidoWstEthAbi.json.js +0 -480
  171. package/externalABIs/OptimismGasPriceOracle.json.js +0 -206
  172. package/externalABIs/PendleRouterAbi.json.js +0 -173
  173. package/externalABIs/PoLidoNftAbi.json.js +0 -701
  174. package/externalABIs/SanctionsList.js +0 -89
  175. package/externalABIs/USDC.js +0 -721
  176. package/externalABIs/USDR.js +0 -346
  177. package/externalABIs/USDR3CRV.js +0 -542
  178. package/externalABIs/USDT.js +0 -393
  179. package/externalABIs/UniswapV2PoolAbi.json.js +0 -80
  180. package/externalABIs/WETH.js +0 -156
  181. package/externalABIs/amToken.js +0 -350
  182. package/externalABIs/transactionsProver.json.js +0 -39
  183. package/functions/kyc/authentoHelper.js +0 -42
  184. package/functions/kyc/passportHelper.js +0 -39
  185. package/functions/kyc/zkMeHelper.js +0 -56
  186. package/functions/pre-transaction/getFlatFees.js +0 -203
  187. package/functions/pre-transaction/interaction-to-action.js +0 -57
  188. package/functions/pre-transaction/outputUtxoProcessing.js +0 -45
  189. package/functions/pre-transaction/process-gas-estimates.js +0 -57
  190. package/functions/pre-transaction/processAmountChanges.js +0 -229
  191. package/functions/private-wallet/emporium.helpers.js +0 -19
  192. package/functions/private-wallet/opProducer.js +0 -24
  193. package/functions/protocols/convex.protocols.js +0 -41
  194. package/functions/protocols/curve.protocols.js +0 -45
  195. package/functions/protocols/pendle.helpers.js +0 -108
  196. package/functions/snarkjs/common.snarkjs.js +0 -96
  197. package/functions/snarkjs/constant.js +0 -211
  198. package/functions/snarkjs/constructEmporiumProof.js +0 -105
  199. package/functions/snarkjs/constructGeneralZkProof.js +0 -129
  200. package/functions/snarkjs/generateCircomData.js +0 -60
  201. package/functions/snarkjs/generateZkProof.js +0 -18
  202. package/functions/snarkjs/getZKFiles.js +0 -30
  203. package/functions/staking/index.js +0 -40
  204. package/functions/utils/amounts.utils.js +0 -70
  205. package/functions/utils/axelar.utils.js +0 -38
  206. package/functions/utils/cacheFunctions.js +0 -67
  207. package/functions/utils/caseInsensitive.utils.js +0 -6
  208. package/functions/utils/convertIntegrationProviderToExternalActionId.js +0 -16
  209. package/functions/utils/create-provider.js +0 -5
  210. package/functions/utils/enum.utils.js +0 -14
  211. package/functions/utils/erc20tokenFunctions.js +0 -20
  212. package/functions/utils/evmNetworkFunctions.js +0 -29
  213. package/functions/utils/external-action.utils.js +0 -61
  214. package/functions/utils/getDataFromTransaction.js +0 -105
  215. package/functions/utils/memoize.utils.js +0 -14
  216. package/functions/utils/nickname.utils.js +0 -7
  217. package/functions/utils/process.utils.js +0 -4
  218. package/functions/utils/reloadPage.js +0 -4
  219. package/functions/utils/requireEnv.js +0 -7
  220. package/functions/utils/resolve-sync.utils.js +0 -22
  221. package/functions/utils/serialize.utils.js +0 -4
  222. package/functions/utils/string.utils.js +0 -14
  223. package/functions/utils/time.utils.js +0 -8
  224. package/functions/utils/userAgent.js +0 -15
  225. package/functions/utils/volatile-patcher.utils.js +0 -40
  226. package/functions/web3/etherFunctions.js +0 -41
  227. package/functions/web3/events/balanceChangedHandler.js +0 -10
  228. package/functions/web3/events/getInputUtxoAndBalance.js +0 -72
  229. package/functions/web3/events/getShieldedBalance.js +0 -107
  230. package/functions/web3/events/web3RetrieveEvents.js +0 -9
  231. package/functions/web3/functionCalls/accessTokenCalls.js +0 -48
  232. package/functions/web3/functionCalls/approveToken.js +0 -153
  233. package/functions/web3/functionCalls/estimateGasRelayer.js +0 -18
  234. package/functions/web3/functionCalls/transactCallDirect.js +0 -60
  235. package/functions/web3/functionCalls/transactCallRelayer.js +0 -42
  236. package/functions/web3/odosAPI.js +0 -65
  237. package/functions/web3/oneInchAPI.js +0 -61
  238. package/functions/web3/runContractFunction.js +0 -95
  239. package/functions/web3/uniswapAPI.js +0 -97
  240. package/types/beefy.types.js +0 -21
  241. package/types/circom-data.types.js +0 -22
  242. package/types/curve.types.js +0 -25
  243. package/types/ethereum-network.types.js +0 -4
  244. package/types/external-action.types.js +0 -4
  245. package/types/hinkal.stake.types.js +0 -4
  246. package/types/hinkal.types.js +0 -15
  247. package/types/kyc.types.js +0 -13
  248. package/types/pendle.types.js +0 -15
  249. package/types/rewards.types.js +0 -27
  250. package/types/slippage.types.js +0 -15
  251. package/types/time.types.js +0 -58
  252. package/types/token.types.js +0 -4
  253. package/types/transactions.types.js +0 -36
  254. package/webworker/performTaskWithWorker.js +0 -62
  255. package/webworker/snarkjsWorker/snarkjsWorker.types.js +0 -4
  256. package/webworker/utxoWorker/utxoWorker.types.js +0 -4
  257. package/webworker/utxoWorker/utxoWorkerLogic.js +0 -70
  258. package/webworker/worker.registry.js +0 -4
  259. package/webworker/workerFactory.js +0 -42
  260. package/webworker/zkProofWorker/zkProofWorker.types.js +0 -4
  261. package/webworker/zkProofWorker/zkProofWorkerLogic.js +0 -66
@@ -1,4 +0,0 @@
1
- var l = /* @__PURE__ */ ((e) => (e[e.HinkalContract = 0] = "HinkalContract", e[e.HinkalHelperContract = 1] = "HinkalHelperContract", e[e.CrossChainAccessTokenContract = 2] = "CrossChainAccessTokenContract", e[e.UniswapV3FactoryContract = 3] = "UniswapV3FactoryContract", e[e.UniswapV3PoolContract = 4] = "UniswapV3PoolContract", e[e.UniswapV3QuoterContract = 5] = "UniswapV3QuoterContract", e[e.ERC20Contract = 6] = "ERC20Contract", e[e.WATokenContract = 7] = "WATokenContract", e[e.OneInchExternalActionContract = 8] = "OneInchExternalActionContract", e[e.MerkleTreeContract = 9] = "MerkleTreeContract", e[e.ContractWithNonces = 10] = "ContractWithNonces", e[e.PermitterContract = 11] = "PermitterContract", e[e.CurveWrappedMainPool = 12] = "CurveWrappedMainPool", e[e.CurveReadingWrapper = 13] = "CurveReadingWrapper", e[e.CurvePoolLPTokenAmountCalculator2 = 14] = "CurvePoolLPTokenAmountCalculator2", e[e.CurvePoolLPTokenAmountCalculator3 = 15] = "CurvePoolLPTokenAmountCalculator3", e[e.CurvePoolLPTokenAmountCalculator4 = 16] = "CurvePoolLPTokenAmountCalculator4", e[e.CurvePoolLPTokenAmountCalculatorDynamic = 17] = "CurvePoolLPTokenAmountCalculatorDynamic", e[e.CurvePoolLPTokenAmountCalculator2OneArg = 18] = "CurvePoolLPTokenAmountCalculator2OneArg", e[e.CurvePoolLPTokenAmountCalculator3OneArg = 19] = "CurvePoolLPTokenAmountCalculator3OneArg", e[e.CurvePoolLPTokenAmountCalculator4OneArg = 20] = "CurvePoolLPTokenAmountCalculator4OneArg", e[e.CurvePoolWithIntCoins = 21] = "CurvePoolWithIntCoins", e[e.CurveExternalAction = 22] = "CurveExternalAction", e[e.WrappedStakedCurveLp = 23] = "WrappedStakedCurveLp", e[e.WrappedStakedRewardsCurveLp = 24] = "WrappedStakedRewardsCurveLp", e[e.CurveGauge = 25] = "CurveGauge", e[e.ConvexBooster = 26] = "ConvexBooster", e[e.ConvexBoosterMainnet = 27] = "ConvexBoosterMainnet", e[e.ConvexRewardPool = 28] = "ConvexRewardPool", e[e.ConvexCvxLocker = 29] = "ConvexCvxLocker", e[e.ConvexStakePool = 30] = "ConvexStakePool", e[e.ConvexCvxCRVWrapper = 31] = "ConvexCvxCRVWrapper", e[e.ConvexCxvCrvUtillities = 32] = "ConvexCxvCrvUtillities", e[e.ConvexExternalAction = 33] = "ConvexExternalAction", e[e.WrappedStakedConvexLp = 34] = "WrappedStakedConvexLp", e[e.CurvePoolWithIntBalances = 35] = "CurvePoolWithIntBalances", e[e.CurveZaps = 36] = "CurveZaps", e[e.BeefyVault = 37] = "BeefyVault", e[e.BeefyZap = 38] = "BeefyZap", e[e.BeefyRouter = 39] = "BeefyRouter", e[e.BeefyZapOneInch = 40] = "BeefyZapOneInch", e[e.BeefyExternalAction = 41] = "BeefyExternalAction", e[e.BeefyStakeExternalAction = 42] = "BeefyStakeExternalAction", e[e.BeefyStrategy = 43] = "BeefyStrategy", e[e.WrappedStakedBeefyLp = 44] = "WrappedStakedBeefyLp", e[e.UniswapV2PoolContract = 45] = "UniswapV2PoolContract", e[e.LidoWstEther = 46] = "LidoWstEther", e[e.LidoStEther = 47] = "LidoStEther", e[e.LidoStMatic = 48] = "LidoStMatic", e[e.LidoWithdrawalQueueERC721 = 49] = "LidoWithdrawalQueueERC721", e[e.LidoStakeManager = 50] = "LidoStakeManager", e[e.PoLidoNFT = 51] = "PoLidoNFT", e[e.PendleGeneralExternalAction = 52] = "PendleGeneralExternalAction", e[e.PendleRouter = 53] = "PendleRouter", e[e.WstPendleLPToken = 54] = "WstPendleLPToken", e[e.WstYtToken = 55] = "WstYtToken", e[e.VolatileVault = 56] = "VolatileVault", e[e.VolatileTokenAction = 57] = "VolatileTokenAction", e[e.HinkalWrapper = 58] = "HinkalWrapper", e[e.HinkalWrapper2 = 59] = "HinkalWrapper2", e[e.HinkalStakeExternalAction = 60] = "HinkalStakeExternalAction", e[e.HToken = 61] = "HToken", e))(l || {});
2
- export {
3
- l as ContractType
4
- };
@@ -1,4 +0,0 @@
1
- var C = /* @__PURE__ */ ((e) => (e.Transact = "Transact", e.Uniswap = "Uniswap", e.Odos = "Odos", e.OneInch = "OneInch", e.Curve = "Curve", e.CurveDynamic = "CurveDynamic", e.CurveCRV = "CurveCRV", e.CurveCRVRewards = "CurveCRVRewards", e.Convex = "Convex", e.Beefy = "Beefy", e.BeefyStake = "BeefyStake", e.Volatile = "Volatile", e.LidoETH = "LidoETH", e.LidoMATIC = "LidoMATIC", e.LidoETHNFT = "LidoETHNFT", e.LidoMATICNFT = "LidoMATICNFT", e.Pendle = "Pendle", e.PendleLP = "PendleLP", e.HinkalStake = "HinkalStake", e.Connext = "Connext", e.Emporium = "Emporium", e))(C || {});
2
- export {
3
- C as ExternalActionId
4
- };
@@ -1,4 +0,0 @@
1
- var e = /* @__PURE__ */ ((t) => (t.Deposit = "Deposit", t.Stake = "Stake", t.Unstake = "Unstake", t))(e || {});
2
- export {
3
- e as HinkalStakeMode
4
- };
@@ -1,15 +0,0 @@
1
- var E = /* @__PURE__ */ ((a) => (a.BalanceChange = "BalanceChange", a.NetworkChange = "NetworkChange", a.KycNeeded = "KycNeeded", a.AccountChanged = "AccountChanged", a.ShowConnect = "ShowConnect", a.ShowNetworkPopup = "ShowNetworkPopup", a.MerkleTreeUpdated = "MerkleTreeUpdated", a.MerkleTreeResetStarted = "MerkleTreeResetStarted", a.MerkleTreeResetFinished = "MerkleTreeResetFinished", a))(E || {}), S = /* @__PURE__ */ ((a) => (a[a.UNISWAP = 1] = "UNISWAP", a[a.ODOS = 2] = "ODOS", a[a.ONEINCH = 3] = "ONEINCH", a[a.PENDLE = 4] = "PENDLE", a[a.ALL = 5] = "ALL", a[a.NONE = 6] = "NONE", a))(S || {}), D = /* @__PURE__ */ ((a) => (a[a.CurveAavePool = 0] = "CurveAavePool", a))(D || {}), _ = /* @__PURE__ */ ((a) => (a[a.Deposit = 0] = "Deposit", a[a.WithdrawInt = 11] = "WithdrawInt", a[a.WithdrawUint = 12] = "WithdrawUint", a[a.WithdrawImbalance = 13] = "WithdrawImbalance", a[a.Stake = 2] = "Stake", a[a.Unstake = 3] = "Unstake", a[a.GetCRV = 4] = "GetCRV", a))(_ || {}), h = /* @__PURE__ */ ((a) => (a[a.StakeLP = 0] = "StakeLP", a[a.UnStakeLP = 1] = "UnStakeLP", a[a.ClaimRewardsLP = 2] = "ClaimRewardsLP", a))(h || {}), W = /* @__PURE__ */ ((a) => (a[a.Deposit = 0] = "Deposit", a[a.DepositRegular = 1] = "DepositRegular", a[a.DepositOneInchSingle = 2] = "DepositOneInchSingle", a[a.DepositOneInchUniswap = 3] = "DepositOneInchUniswap", a[a.DepositOneInchSolidly = 4] = "DepositOneInchSolidly", a[a.Withdraw = 5] = "Withdraw", a[a.WithdrawRegular = 6] = "WithdrawRegular", a[a.WithdrawOneInchSingle = 7] = "WithdrawOneInchSingle", a[a.WithdrawOneInchUniswapAndSolidly = 8] = "WithdrawOneInchUniswapAndSolidly", a[a.WithdrawBoth = 9] = "WithdrawBoth", a[a.Stake = 10] = "Stake", a[a.Unstake = 11] = "Unstake", a[a.GetRewards = 12] = "GetRewards", a))(W || {}), L = /* @__PURE__ */ ((a) => (a.Ethereum = "Ethereum", a.Polygon = "Polygon", a))(L || {}), r = /* @__PURE__ */ ((a) => (a[a.Stake = 0] = "Stake", a[a.Request = 1] = "Request", a[a.Claim = 2] = "Claim", a))(r || {}), w = /* @__PURE__ */ ((a) => (a[a.Deposit = 0] = "Deposit", a[a.Withdraw = 1] = "Withdraw", a[a.SwapFromYt = 2] = "SwapFromYt", a[a.SwapToYt = 3] = "SwapToYt", a[a.SwapPt = 4] = "SwapPt", a[a.Mint = 5] = "Mint", a[a.Redeem = 6] = "Redeem", a[a.Checkpoint = 7] = "Checkpoint", a[a.PoolRemove = 8] = "PoolRemove", a))(w || {}), s = /* @__PURE__ */ ((a) => (a[a.AddOrRemoveLiquidity = 0] = "AddOrRemoveLiquidity", a[a.Checkpoint = 1] = "Checkpoint", a[a.Invalid = 99] = "Invalid", a))(s || {}), U = /* @__PURE__ */ ((a) => (a[a.Persist = 0] = "Persist", a[a.Deposit = 1] = "Deposit", a[a.Withdraw = 2] = "Withdraw", a[a.Swap = 3] = "Swap", a))(U || {}), p = /* @__PURE__ */ ((a) => (a.WITHDRAW = "WITHDRAW", a.SWAP = "SWAP", a.CURVE_DEPOSIT = "CURVE_DEPOSIT", a.CURVE_WITHDRAW = "CURVE_WITHDRAW", a.CURVE_WITHDRAW_INBALANCED = "CURVE_WITHDRAW_INBALANCED", a.STAKING = "STAKING", a.UNSTAKING = "UNSTAKING", a.CLAIMING = "CLAIMING", a.BEEFY = "BEEFY", a.BEEFY_STAKE = "BEEFY_STAKE", a.BEEFY_UNSTAKE = "BEEFY_UNSTAKE", a.BEEFY_GET_REWARDS = "BEEFY_GET_REWARDS", a.LIDO_STAKE = "LIDO_STAKE", a.LIDO_REQUEST = "LIDO_REQUEST", a.LIDO_CLAIM = "LIDO_CLAIM", a.PENDLE_TRANSACT = "PENDLE_TRANSACT", a.PENDLE_YT_IN_SWAP = "PENDLE_YT_IN_SWAP", a.PENDLE_YT_OUT_SWAP = "PENDLE_YT_OUT_SWAP", a.PENDLE_PT_SWAP = "PENDLE_PT_SWAP", a.PENDLE_MINT = "PENDLE_MINT", a.PENDLE_REDEEM = "PENDLE_REDEEM", a.PENDLE_CLAIM = "PENDLE_CLAIM", a.PENDLE_LP = "PENDLE_LP", a.PENDLE_LP_CLAIM = "PENDLE_LP_CLAIM", a.VOLATILE_WITHDRAW = "VOLATILE_WITHDRAW", a.VOLATILE_SWAP = "VOLATILE_SWAP", a.EMPORIUM = "EMPORIUM", a.NONE = "NONE", a))(p || {});
2
- export {
3
- W as BeefyAction,
4
- h as ConvexAction,
5
- _ as CurveAction,
6
- E as EventType,
7
- p as INTERACTION,
8
- S as IntegrationProvider,
9
- r as LidoAction,
10
- L as LidoVariant,
11
- w as PendleAction,
12
- s as PendleLPAction,
13
- D as StakeProvider,
14
- U as VolatileAction
15
- };
@@ -1,13 +0,0 @@
1
- var N = /* @__PURE__ */ ((E) => (E.USER = "USER", E.BUSINESS = "BUSINESS", E))(N || {});
2
- const S = [
3
- "USER",
4
- "BUSINESS"
5
- /* BUSINESS */
6
- ];
7
- var D = /* @__PURE__ */ ((E) => (E.APPROVED = "APPROVED", E.DECLINED = "DECLINED", E.REVIEW = "REVIEW", E.UNKNOWN = "UNKNOWN", E))(D || {}), I = /* @__PURE__ */ ((E) => (E.COMPLETED = "COMPLETED", E.FAILED = "FAILED", E.PENDING = "PENDING", E.RUNNING = "RUNNING", E.NOT_STARTED = "NOT_STARTED", E))(I || {});
8
- export {
9
- D as KycVerificationResult,
10
- I as KycVerificationStatus,
11
- N as VERIFICATION_TYPE,
12
- S as VerificationTypes
13
- };
@@ -1,15 +0,0 @@
1
- var t = /* @__PURE__ */ ((r) => (r.Trade = "TRADE", r.Earn = "EARN", r))(t || {}), E = /* @__PURE__ */ ((r) => (r.Markets = "Market", r.Pools = "Pools", r.Dashboard = "Dashboard", r))(E || {}), u = /* @__PURE__ */ ((r) => (r.Swap = "Swap", r.Mint = "Mint", r))(u || {}), Y = /* @__PURE__ */ ((r) => (r.Zap = "Zap", r.Manual = "Manual", r))(Y || {}), i = /* @__PURE__ */ ((r) => (r.ZapIn = "Zap In", r.ZapOut = "Zap Out", r))(i || {}), o = /* @__PURE__ */ ((r) => (r.AddLiquidity = "Add Liquidity", r.RemoveLiquidity = "Remove Liquidity", r))(o || {}), v = /* @__PURE__ */ ((r) => (r.YT = "YT", r.LP = "LP", r))(v || {}), I = /* @__PURE__ */ ((r) => (r.Pool = "Pool", r.Stake = "Stake", r))(I || {}), L = /* @__PURE__ */ ((r) => (r.Ethereum = "ethereum", r.Arbitrum = "arbitrum", r.BNB = "bnb", r.Optimism = "optimism", r))(L || {}), S = /* @__PURE__ */ ((r) => (r.IB = "IB", r.GENERIC = "GENERIC", r.PENDLE_LP = "PENDLE_LP", r.NATIVE = "NATIVE", r.PT = "PT", r.SY = "SY", r.YT = "YT", r))(S || {}), m = /* @__PURE__ */ ((r) => (r.SwapExactTokenForYt = "SwapExactTokenForYt", r.SwapExactTokenForPt = "SwapExactTokenForPt", r.SwapExactYtForToken = "SwapExactYtForToken", r.SwapExactPtForToken = "SwapExactPtForToken", r))(m || {}), a = /* @__PURE__ */ ((r) => (r.mintPY = "MINT_PY", r.redeemPY = "REDEEM_PY", r.addLiquidity = "ADD_LIQUIDITY", r.removeLiquidity = "REMOVE_LIQUIDITY", r.swapPT = "SWAP_PT", r.swapYT = "SWAP_YT", r.swapPY = "SWAP_PY", r))(a || {});
2
- export {
3
- S as PendleAssetType,
4
- L as PendleChains,
5
- v as PendleDashboardTabs,
6
- I as PendleEarnTabs,
7
- a as PendleMarketTransactionTypes,
8
- o as PendlePoolManualTabs,
9
- Y as PendlePoolTabs,
10
- i as PendlePoolZapTabs,
11
- m as PendleSwapType,
12
- t as PendleTabs,
13
- E as PendleTradeGeneralTabs,
14
- u as PendleTradeTabs
15
- };
@@ -1,27 +0,0 @@
1
- var r = /* @__PURE__ */ ((n) => (n.None = "None", n.Bronze = "Bronze", n.Silver = "Silver", n.Gold = "Gold", n.Platinum = "Platinum", n.Diamond = "Diamond", n.Elite = "Elite", n))(r || {}), i = /* @__PURE__ */ ((n) => (n.None = "None", n.Bronze = "Bronze", n.Silver = "Silver", n.Gold = "Gold", n.Platinum = "Platinum", n.Diamond = "Diamond", n))(i || {}), t = /* @__PURE__ */ ((n) => (n.Points = "POINTS", n.ReferralProgram = "REFERRAL", n.LrtPoints = "LRT_POINTS", n.LPProgram = "LP", n.RewardsHistory = "HISTORY", n))(t || {}), e = /* @__PURE__ */ ((n) => (n.InProgress = "In Progress", n.Closed = "Closed", n))(e || {}), o = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Submitted = "Submitted", n.Unsubmitted = "Didn't Submit", n))(o || {}), l = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Eligible = "Eligible", n.Ineligible = "Ineligible", n))(l || {}), P = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Completed = "Completed", n.Unsubmitted = "Didn't Submit", n))(P || {}), v = /* @__PURE__ */ ((n) => (n.Gold = "Gold", n.Silver = "Silver", n))(v || {}), m = /* @__PURE__ */ ((n) => (n.CertificationPoints = "CertificationPoints", n.TradePoints = "TradePoints", n.LPPoints = "LPPoints", n.ReferralPoints = "ReferralPoints", n.GalxePoints = "GalxePoints", n.ZealyPoints = "ZealyPoints", n.TaskOnPoints = "TaskOnPoints", n.BonusPoints = "BonusPoints", n))(m || {}), u = /* @__PURE__ */ ((n) => (n.Season = "Season", n.Week = "Week", n))(u || {}), d = /* @__PURE__ */ ((n) => (n.PAID = "PAID", n.PENDING = "PENDING", n))(d || {}), S = /* @__PURE__ */ ((n) => (n[n.Certify = 0] = "Certify", n[n.CheckActivity = 1] = "CheckActivity", n))(S || {}), G = /* @__PURE__ */ ((n) => (n[n.Points = 0] = "Points", n[n.Trader = 1] = "Trader", n[n.Affiliate = 2] = "Affiliate", n[n.LP = 3] = "LP", n[n.History = 4] = "History", n))(G || {}), c = /* @__PURE__ */ ((n) => (n[n.IntegrationCheck = 0] = "IntegrationCheck", n[n.RandomPrizeGold = 1] = "RandomPrizeGold", n[n.RandomPrizeSilver = 2] = "RandomPrizeSilver", n))(c || {});
2
- const s = {
3
- Result: {}
4
- }, k = {
5
- renzo: 0,
6
- kelp: 0,
7
- etherFi: 0,
8
- zircuit: 0
9
- };
10
- export {
11
- c as BonusType,
12
- S as CertifyType,
13
- i as LP_TIER,
14
- d as PaymentStatus,
15
- m as PointType,
16
- v as RafflePrizeType,
17
- G as RewardPage,
18
- P as RewardsHistoryDistribution,
19
- l as RewardsHistoryEligibility,
20
- o as RewardsHistorySnapshots,
21
- e as RewardsHistoryStatuses,
22
- t as RewardsPageTabs,
23
- r as TIER_LEVEL,
24
- u as Timeline,
25
- k as emptyUserPointsBreakdown,
26
- s as emptyUserPointsResponse
27
- };
@@ -1,15 +0,0 @@
1
- var r = /* @__PURE__ */ ((e) => (e.Swap = "Swap", e.CurveDeposit = "CurveDeposit", e.CurveWithdraw = "CurveWithdraw", e.Beefy = "Beefy", e.Pendle = "Pendle", e))(r || {});
2
- const t = {
3
- Swap: 0.7,
4
- // means 0.7% -> taken from default Uniswap Slippage
5
- CurveDeposit: 0.9,
6
- // 0.03 taken from Curve
7
- CurveWithdraw: 0.9,
8
- Beefy: 1,
9
- Pendle: 3
10
- // 1 means 1%
11
- };
12
- export {
13
- r as SlippageType,
14
- t as slippageLevels
15
- };
@@ -1,58 +0,0 @@
1
- const w = 1e3, R = 6e4, m = 36e5, f = 864e5, A = 6048e5, r = /* @__PURE__ */ new Date("2024-03-04T00:00:00.000Z"), c = (e) => {
2
- if (e < 0)
3
- throw Error("Certification for the past week is not available");
4
- }, o = (e) => (c(e), new Date(new Date(r).setUTCDate(r.getUTCDate() + 7 * e))), U = (e) => {
5
- c(e);
6
- const t = o(e).getTime() / 1e3, n = o(e + 1).getTime() / 1e3;
7
- return { initialTimestamp: t, endTimestamp: n };
8
- }, i = () => {
9
- const e = (/* @__PURE__ */ new Date()).getTime() / 1e3;
10
- let t = -1, n;
11
- do
12
- t += 1, { endTimestamp: n } = U(t);
13
- while (e > n);
14
- return t;
15
- }, I = (e) => {
16
- if (e === void 0)
17
- return i();
18
- const t = Number(e);
19
- return !Number.isFinite(t) || t < 0 ? i() : t;
20
- }, Y = (e, t = "/") => [e.getUTCDate(), e.getUTCMonth() + 1, e.getUTCFullYear()].join(t), h = (e) => {
21
- const t = i();
22
- return e === t;
23
- }, p = (e) => {
24
- const t = i();
25
- return e < t - 1;
26
- }, v = (e) => {
27
- const t = new Date(e);
28
- return t.setUTCDate(t.getUTCDate() + 1), t.setUTCHours(0), t.setUTCMinutes(0), t.setUTCSeconds(0), t.setUTCMilliseconds(0), t;
29
- };
30
- var g = /* @__PURE__ */ ((e) => (e[e.JANUARY = 0] = "JANUARY", e[e.FEBRUARY = 1] = "FEBRUARY", e[e.MARCH = 2] = "MARCH", e[e.APRIL = 3] = "APRIL", e[e.MAY = 4] = "MAY", e[e.JUNE = 5] = "JUNE", e[e.JULY = 6] = "JULY", e[e.AUGUST = 7] = "AUGUST", e[e.SEPTEMBER = 8] = "SEPTEMBER", e[e.OCTOBER = 9] = "OCTOBER", e[e.NOVEMBER = 10] = "NOVEMBER", e[e.DECEMBER = 11] = "DECEMBER", e))(g || {});
31
- const C = (e, t) => {
32
- if (t < 0 || t > 11)
33
- throw Error("getNextMonth: incorrect month provided");
34
- if (e < 2023 || e > 2025)
35
- throw Error("getNextMonth: incorrect year provided");
36
- let n = e, s;
37
- return t < 11 ? s = t + 1 : (s = 0, n = e + 1), { newYear: n, newMonth: s };
38
- }, B = (e, t) => {
39
- const { newYear: n, newMonth: s } = C(e, t), a = new Date(e, t, 1).getTime() / 1e3, l = new Date(e, t, 8).getTime() / 1e3, u = new Date(e, t, 15).getTime() / 1e3, d = new Date(e, t, 23).getTime() / 1e3, E = new Date(n, s, 1).getTime() / 1e3;
40
- return [a, l, u, d, E];
41
- };
42
- export {
43
- g as MONTHS,
44
- f as dayInMilliseconds,
45
- B as divideMonthOnIntervals,
46
- i as getCurrentWeek,
47
- o as getDateFromWeek,
48
- v as getNextDay,
49
- U as getWeekTimestamps,
50
- p as hasCertificationPeriodExpired,
51
- m as hourInMilliseconds,
52
- h as isWeekCurrent,
53
- R as minuteInMilliseconds,
54
- I as parseWeek,
55
- w as secondInMilliseconds,
56
- Y as toDateString,
57
- A as weekInMilliseconds
58
- };
@@ -1,4 +0,0 @@
1
- var t = /* @__PURE__ */ ((i) => (i[i.Classic = 0] = "Classic", i[i.ERC20Permit = 1] = "ERC20Permit", i[i.DAIPermit = 2] = "DAIPermit", i))(t || {});
2
- export {
3
- t as ApprovalType
4
- };
@@ -1,36 +0,0 @@
1
- import { BigNumber as t } from "ethers";
2
- const o = t.from(0), r = {
3
- blockNumber: 0,
4
- timeStamp: 0,
5
- methodId: "",
6
- input: "",
7
- decodedInput: {
8
- erc20TokenAddresses: [],
9
- amountChanges: [],
10
- flatFees: [0n, 0n].map((e) => t.from(e)),
11
- externalActionId: o,
12
- externalActionMetadata: "",
13
- encryptedOutputs: [],
14
- hookData: {
15
- hookContract: "",
16
- preHookContract: "",
17
- preHookMetadata: "",
18
- postHookMetadata: ""
19
- },
20
- stealthAddressStructure: {
21
- extraRandomization: 0n,
22
- stealthAddress: 0n,
23
- H0: 0n,
24
- H1: 0n
25
- }
26
- },
27
- logs: [],
28
- hash: "",
29
- gas: 0,
30
- gasPrice: 0,
31
- isError: "",
32
- status: ""
33
- };
34
- export {
35
- r as emptyDecodedTx
36
- };
@@ -1,62 +0,0 @@
1
- import { chainIds as f } from "../constants/chains.constants.js";
2
- import "../types/circom-data.types.js";
3
- import "../types/transactions.types.js";
4
- import "../types/curve.types.js";
5
- import "ethers";
6
- import "circomlibjs";
7
- import "../data-structures/crypto-keys/keys.js";
8
- import "axios";
9
- import "../data-structures/crypto-keys/encryptDecryptUtxo.js";
10
- import "../functions/web3/events/getShieldedBalance.js";
11
- import { WorkerFactory as w } from "./workerFactory.js";
12
- import "../functions/utils/external-action.utils.js";
13
- import "../data-structures/custom-token-registry/CustomTokenRegistry.js";
14
- import "../functions/utils/convertIntegrationProviderToExternalActionId.js";
15
- import "../constants/coingecko.constants.js";
16
- import { isDevelopment as h } from "../constants/vite.constants.js";
17
- import "../functions/utils/userAgent.js";
18
- import "../constants/reorg-depths.constants.js";
19
- import "../constants/kyc.constants.js";
20
- import "../data-structures/volatile-helper/VolatileHelper.js";
21
- import "libsodium-wrappers";
22
- import "../constants/contracts.constants.js";
23
- import "../constants/axelar.constants.js";
24
- import "../constants/rewards.constants.js";
25
- const H = async (r) => {
26
- const o = await w.getWebWorker(r.type);
27
- return new Promise((m, p) => {
28
- let i = {};
29
- if (typeof window < "u" && window.location) {
30
- const { origin: t, protocol: n, host: a, port: s, hostname: c, href: d } = window.location;
31
- i = {
32
- origin: t,
33
- protocol: n,
34
- host: a,
35
- port: s,
36
- hostname: c,
37
- href: d
38
- };
39
- }
40
- o.onmessage = (t) => {
41
- m(t.data), o.terminate();
42
- }, o.onerror = (t) => {
43
- p(t), o.terminate();
44
- };
45
- const e = {
46
- payload: r.payload,
47
- metadata: {
48
- hostLocation: i,
49
- constants: {
50
- chains: {
51
- chainIds: f
52
- },
53
- isDevelopment: h
54
- }
55
- }
56
- };
57
- o.postMessage(e);
58
- });
59
- };
60
- export {
61
- H as performTaskWithWorker
62
- };
@@ -1,4 +0,0 @@
1
- var E = /* @__PURE__ */ ((L) => (L[L.FULL_PROVE = 0] = "FULL_PROVE", L))(E || {});
2
- export {
3
- E as SnarkJSWorkerActionType
4
- };
@@ -1,4 +0,0 @@
1
- var _ = /* @__PURE__ */ ((I) => (I[I.BATCH_FILTER_UTXOS_WITH_NULLIFIER = 0] = "BATCH_FILTER_UTXOS_WITH_NULLIFIER", I[I.BUILD_UTXOS = 1] = "BUILD_UTXOS", I[I.DECIPHER_OUTPUTS = 2] = "DECIPHER_OUTPUTS", I))(_ || {});
2
- export {
3
- _ as UtxoWorkerActionType
4
- };
@@ -1,70 +0,0 @@
1
- import { preProcessing as f } from "../../crypto/preProcessing.js";
2
- import { UserKeys as p } from "../../data-structures/crypto-keys/keys.js";
3
- import { Utxo as h } from "../../data-structures/utxo/Utxo.js";
4
- import { decryptUtxoConstructorArgs as y, decryptUtxo as m } from "../../data-structures/crypto-keys/encryptDecryptUtxo.js";
5
- import { decodeUtxoConstructorArgs as U, checkUtxoSignature as g } from "../../data-structures/crypto-keys/decodeUTXO.js";
6
- import { logError as d } from "../../error-handling/logError.js";
7
- import { WorkerProxy as x } from "../workerProxy.js";
8
- import { UtxoWorkerActionType as l } from "./utxoWorker.types.js";
9
- const a = new x(), T = async ({ data: e }) => {
10
- const { utxos: t, nullifiers: o } = e, s = t.filter((r) => {
11
- const c = new h(r);
12
- return !o.has(c.getNullifier());
13
- });
14
- a.postMessageToMainThread(s);
15
- }, v = async ({ data: e }) => {
16
- const t = new p(e.signature), o = t.getShieldedPrivateKey(), s = e.encryptedOutputs.map((r) => {
17
- try {
18
- return r.isPositive ? y(Buffer.from(r.value.slice(2), "hex"), t) : U(r.value, o);
19
- } catch {
20
- return;
21
- }
22
- }).filter((r) => r !== void 0);
23
- a.postMessageToMainThread(s);
24
- }, k = async ({ data: e }) => {
25
- const t = new p(e.signature), o = [], { encryptedOutputs: s } = e;
26
- let { lastOutput: r } = e;
27
- for (let c = 0; c < s.length; c += 1) {
28
- const n = s[c];
29
- if (r = n.value, n.isPositive)
30
- try {
31
- const i = m(Buffer.from(r.slice(2), "hex"), t);
32
- if (!i.erc20TokenAddress || !i.amount || !i.stealthAddress)
33
- throw Error("bruh");
34
- o.map((u) => u.value).includes(n.value) || o.push(n);
35
- } catch {
36
- d("Utxo not decrypted");
37
- }
38
- else
39
- try {
40
- g(r, t.getShieldedPrivateKey()) && (o.map((u) => u.value).includes(n.value) || o.push(n));
41
- } catch {
42
- d("Utxo not decoded");
43
- }
44
- }
45
- a.postMessageToMainThread({ additionalEncryptedOutputs: o, lastOutput: r });
46
- }, w = async (e) => {
47
- await f();
48
- const { type: t } = e.payload;
49
- switch (t) {
50
- case l.BATCH_FILTER_UTXOS_WITH_NULLIFIER:
51
- T(e.payload);
52
- return;
53
- case l.BUILD_UTXOS:
54
- v(e.payload);
55
- return;
56
- case l.DECIPHER_OUTPUTS:
57
- k(e.payload);
58
- return;
59
- default:
60
- throw Error(`Unknown worker message type ${t}`);
61
- }
62
- };
63
- a.attachWorkerSideOnMessage(w);
64
- export {
65
- a as default,
66
- v as handleBuildUtxosMessage,
67
- k as handleDecipherMessage,
68
- T as handleFilterUtxosWithNullifier,
69
- w as onWorkerMessage
70
- };
@@ -1,4 +0,0 @@
1
- var o = /* @__PURE__ */ ((S) => (S.ZKProof = "ZKProof", S.SnarkJS = "SnarkJS", S.UTXO = "UTXO", S))(o || {});
2
- export {
3
- o as WorkerVariant
4
- };
@@ -1,42 +0,0 @@
1
- import { WorkerVariant as r } from "./worker.registry.js";
2
- class t {
3
- static isRunningInNode = typeof process < "u" && process.versions != null && process.versions.node != null;
4
- constructor() {
5
- }
6
- static createWorker = async (e) => {
7
- if (t.isRunningInNode) {
8
- let s;
9
- return e === r.SnarkJS ? s = await import(
10
- /* @vite-ignore */
11
- "./snarkjsWorker/snarkjsWorkerLogic.js"
12
- ) : e === r.ZKProof ? s = await import(
13
- /* @vite-ignore */
14
- "./zkProofWorker/zkProofWorkerLogic.js"
15
- ) : e === r.UTXO && (s = await import(
16
- /* @vite-ignore */
17
- "./utxoWorker/utxoWorkerLogic.js"
18
- )), s.default;
19
- }
20
- if (e === r.SnarkJS)
21
- return new Worker(new URL("" + new URL("../assets/snarkjsWorkerLauncher-fuD5h_j0.js", import.meta.url).href, import.meta.url), { type: "module" });
22
- if (e === r.ZKProof)
23
- return new Worker(new URL("" + new URL("../assets/zkProofWorkerLauncher-J3Ts5_Ba.js", import.meta.url).href, import.meta.url), { type: "module" });
24
- if (e === r.UTXO)
25
- return new Worker(new URL("" + new URL("../assets/utxoWorkerLauncher-TRT6Cdzd.js", import.meta.url).href, import.meta.url), { type: "module" });
26
- };
27
- static getWebWorker(e) {
28
- switch (e) {
29
- case r.ZKProof:
30
- return t.createWorker(e);
31
- case r.SnarkJS:
32
- return t.createWorker(e);
33
- case r.UTXO:
34
- return t.createWorker(e);
35
- default:
36
- throw Error(`Unknown worker type: ${e}`);
37
- }
38
- }
39
- }
40
- export {
41
- t as WorkerFactory
42
- };
@@ -1,4 +0,0 @@
1
- var _ = /* @__PURE__ */ ((I) => (I[I.CALC_COMMITMENTS_SIBLING_AND_SIDES = 0] = "CALC_COMMITMENTS_SIBLING_AND_SIDES", I[I.CALC_ACCESS_TOKEN_SIBLING_AND_SIDES = 1] = "CALC_ACCESS_TOKEN_SIBLING_AND_SIDES", I[I.BUILD_IN_NULLIFIERS = 2] = "BUILD_IN_NULLIFIERS", I))(_ || {});
2
- export {
3
- _ as ZKProofWorkerActionType
4
- };
@@ -1,66 +0,0 @@
1
- import { preProcessing as u } from "../../crypto/preProcessing.js";
2
- import { UserKeys as I } from "../../data-structures/crypto-keys/keys.js";
3
- import { Utxo as S } from "../../data-structures/utxo/Utxo.js";
4
- import { poseidonFunction as g } from "../../crypto/poseidon.js";
5
- import { MerkleTree as T } from "../../data-structures/merkle-tree/MerkleTree.js";
6
- import { calcCommitmentsSiblingAndSides as k, calcAccessTokenSiblingsAndSides as C } from "../../functions/snarkjs/common.snarkjs.js";
7
- import { WorkerProxy as M } from "../workerProxy.js";
8
- import { ZKProofWorkerActionType as d } from "./zkProofWorker.types.js";
9
- const l = new M(), f = (e) => {
10
- const { inputUtxosSerialized: t, merkleTreeSerialized: n } = e.data, m = n.tree, r = new Map(
11
- Object.entries(m).map(([a, c]) => [BigInt(a), BigInt(c)])
12
- ), o = T.createWithData(
13
- r,
14
- BigInt(n.index),
15
- BigInt(n.count),
16
- g,
17
- 25n,
18
- 0n
19
- ), i = t.map(
20
- (a) => a.map((c) => new S(c))
21
- ), { inCommitmentSiblings: s, inCommitmentSiblingSides: p } = k(i, o);
22
- l.postMessageToMainThread({ inCommitmentSiblings: s, inCommitmentSiblingSides: p });
23
- }, A = (e) => {
24
- const { userSignature: t, merkleTreeAccessTokenSerialized: n } = e.data, m = new I(t), r = n.tree, o = new Map(
25
- Object.entries(r).map(([a, c]) => [BigInt(a), BigInt(c)])
26
- ), i = T.createWithData(
27
- o,
28
- BigInt(n.index),
29
- BigInt(n.count),
30
- g,
31
- 25n,
32
- 0n
33
- ), { accessTokenSiblings: s, accessTokenSiblingSides: p } = C(m, i);
34
- l.postMessageToMainThread({ accessTokenSiblings: s, accessTokenSiblingSides: p });
35
- }, h = (e) => {
36
- const { inputUtxosSerialized: t, onChainCreation: n } = e.data, r = t.map(
37
- (o) => o.map((i) => new S(i))
38
- ).map(
39
- (o, i) => o.map((s) => n[i] ? "0" : s.getNullifier())
40
- );
41
- l.postMessageToMainThread(r);
42
- }, w = async (e) => {
43
- await u();
44
- const { type: t } = e.payload;
45
- switch (t) {
46
- case d.CALC_COMMITMENTS_SIBLING_AND_SIDES:
47
- f(e.payload);
48
- return;
49
- case d.CALC_ACCESS_TOKEN_SIBLING_AND_SIDES:
50
- A(e.payload);
51
- return;
52
- case d.BUILD_IN_NULLIFIERS:
53
- h(e.payload);
54
- return;
55
- default:
56
- throw Error(`Unknown worker message type ${t}`);
57
- }
58
- };
59
- l.attachWorkerSideOnMessage(w);
60
- export {
61
- l as default,
62
- h as handleBuildInNullifiers,
63
- A as handleCalcAccessTokenSiblingAndSides,
64
- f as handleCalcCommitmentsSiblingAndSides,
65
- w as onWorkerMessage
66
- };