@hinkal/common 0.0.115 → 0.0.116
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.
- package/{common12.mjs → API/API.mjs} +10 -10
- package/API/HinkalPointsCalls.mjs +38 -0
- package/API/callBeefyGraphAPI.mjs +37 -0
- package/{common13.mjs → API/callCurveAPI.mjs} +9 -9
- package/API/callMonitor.mjs +30 -0
- package/API/callOdosAPI.mjs +44 -0
- package/API/callOneInchAPI.mjs +37 -0
- package/API/callRelayer.mjs +32 -0
- package/API/checkRisk.mjs +30 -0
- package/API/dataServerCalls.mjs +32 -0
- package/API/fetchCommitmentsCache.mjs +31 -0
- package/API/fetchNullifiers.mjs +30 -0
- package/API/getAxelarGasEstimate.mjs +37 -0
- package/{common3.mjs → API/getCoingeckoPrice.mjs} +1 -1
- package/API/getConnextReceiveFee.mjs +30 -0
- package/API/getGasEstimates.mjs +38 -0
- package/API/getRelayerURL.mjs +32 -0
- package/{common2.mjs → API/getServerURL.mjs} +21 -21
- package/API/getTokenPrice.mjs +41 -0
- package/{common215.mjs → API/kycCalls.mjs} +2 -2
- package/API/passwordCalls.mjs +36 -0
- package/{common211.mjs → API/referralProgramCalls.mjs} +22 -22
- package/API/relayCalls.mjs +30 -0
- package/API/restoreSnapshots.mjs +32 -0
- package/API/rewardsPointsCalls.mjs +40 -0
- package/API/userVerifyTransactions.mjs +45 -0
- package/{common36.mjs → constants/axelar.constants.mjs} +9 -9
- package/{common43.mjs → constants/beefy.registry.mjs} +1 -1
- package/{common28.mjs → constants/chains.constants.mjs} +12 -12
- package/{common35.mjs → constants/coingecko.constants.mjs} +1 -1
- package/{common30.mjs → constants/contracts.constants.mjs} +30 -30
- package/{common38.mjs → constants/crvCvx.registry.mjs} +1 -1
- package/{common39.mjs → constants/crvDynamic.registry.mjs} +1 -1
- package/constants/fees.constants.mjs +57 -0
- package/{common31.mjs → constants/kyc.constants.mjs} +3 -3
- package/{common44.mjs → constants/pendle.registry.mjs} +2 -2
- package/{common42.mjs → constants/reorg-depths.constants.mjs} +1 -1
- package/{common41.mjs → constants/rewards.constants.mjs} +4 -4
- package/constants/token-data/ERC20Registry.mjs +85 -0
- package/constants/token-data/index.mjs +6 -0
- package/{common33.mjs → constants/vite.constants.mjs} +2 -2
- package/{common45.mjs → crypto/poseidon.mjs} +1 -1
- package/{common47.mjs → crypto/preProcessing.mjs} +2 -2
- package/{common53.mjs → data-structures/Hinkal/Hinkal.mjs} +46 -46
- package/{common54.mjs → data-structures/Hinkal/hinkalActionBeefy.mjs} +29 -29
- package/data-structures/Hinkal/hinkalActionConvex.mjs +83 -0
- package/{common56.mjs → data-structures/Hinkal/hinkalActionCurve.mjs} +32 -32
- package/data-structures/Hinkal/hinkalActionLidoEth.mjs +91 -0
- package/{common57.mjs → data-structures/Hinkal/hinkalActionPendle.mjs} +33 -33
- package/{common226.mjs → data-structures/Hinkal/hinkalActionPendleLP.mjs} +29 -29
- package/{common228.mjs → data-structures/Hinkal/hinkalActionStake.mjs} +31 -31
- package/{common225.mjs → data-structures/Hinkal/hinkalActionVolatile.mjs} +32 -32
- package/{common58.mjs → data-structures/Hinkal/hinkalDeposit.mjs} +27 -27
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +47 -0
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +66 -0
- package/data-structures/Hinkal/hinkalSwap.mjs +98 -0
- package/data-structures/Hinkal/hinkalWithdraw.mjs +91 -0
- package/data-structures/Hinkal/resetMerkleTrees.mjs +49 -0
- package/{common78.mjs → data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs} +23 -23
- package/{common49.mjs → data-structures/crypto-keys/decodeUTXO.mjs} +2 -2
- package/{common50.mjs → data-structures/crypto-keys/encryptDecryptUtxo.mjs} +2 -2
- package/{common52.mjs → data-structures/crypto-keys/keyUtils.mjs} +1 -1
- package/{common51.mjs → data-structures/crypto-keys/keys.mjs} +5 -5
- package/{common66.mjs → data-structures/event-service/AbstractAccessTokenSnapshotService.mjs} +25 -25
- package/{common67.mjs → data-structures/event-service/AbstractCommitmentsSnapshotService.mjs} +24 -24
- package/{common70.mjs → data-structures/event-service/AbstractEventService.mjs} +21 -21
- package/{common68.mjs → data-structures/event-service/AbstractNullifierSnapshotService.mjs} +1 -1
- package/{common69.mjs → data-structures/event-service/AbstractSnapshotService.mjs} +1 -1
- package/{common64.mjs → data-structures/merkle-tree/MerkleTree.mjs} +22 -22
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.mjs +48 -0
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +47 -0
- package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +44 -0
- package/{common73.mjs → data-structures/token-price-fetcher/TokenChecker.mjs} +3 -3
- package/{common74.mjs → data-structures/token-price-fetcher/TokenPriceFetcher.mjs} +32 -32
- package/{common75.mjs → data-structures/transactions-manager/TransactionsManager.mjs} +27 -27
- package/data-structures/transactions-manager/history/getBeefyData.mjs +68 -0
- package/data-structures/transactions-manager/history/getConvexData.mjs +57 -0
- package/{common246.mjs → data-structures/transactions-manager/history/getCurveData.mjs} +23 -23
- package/data-structures/transactions-manager/history/getDepositData.mjs +36 -0
- package/data-structures/transactions-manager/history/getLidoData.mjs +44 -0
- package/data-structures/transactions-manager/history/getPendleData.mjs +59 -0
- package/data-structures/transactions-manager/history/getSwapData.mjs +43 -0
- package/data-structures/transactions-manager/history/getTxDetails.mjs +74 -0
- package/{common251.mjs → data-structures/transactions-manager/history/getVolatileData.mjs} +25 -25
- package/{common76.mjs → data-structures/transactions-manager/history/history.types.mjs} +21 -21
- package/{common71.mjs → data-structures/utxo/Utxo.mjs} +4 -4
- package/{common77.mjs → data-structures/volatile-helper/VolatileHelper.mjs} +25 -25
- package/{common79.mjs → error-handling/customErrors/FeeOverTransactionValueError.mjs} +1 -1
- package/{common80.mjs → error-handling/customErrors/customErrors.helpers.mjs} +5 -5
- package/{common82.mjs → error-handling/get-error.message.mjs} +5 -5
- package/error-handling/handleErrorRestore.mjs +35 -0
- package/{common84.mjs → error-handling/logError.mjs} +1 -1
- package/functions/kyc/authentoHelper.mjs +42 -0
- package/functions/kyc/passportHelper.mjs +39 -0
- package/{common204.mjs → functions/kyc/zkMeHelper.mjs} +4 -4
- package/{common126.mjs → functions/pre-transaction/getFlatFees.mjs} +25 -25
- package/{common122.mjs → functions/pre-transaction/interaction-to-action.mjs} +5 -5
- package/functions/pre-transaction/outputUtxoProcessing.mjs +45 -0
- package/functions/pre-transaction/process-gas-estimates.mjs +57 -0
- package/{common125.mjs → functions/pre-transaction/processAmountChanges.mjs} +27 -27
- package/{common155.mjs → functions/private-wallet/opProducer.mjs} +3 -3
- package/functions/protocols/convex.protocols.mjs +41 -0
- package/functions/protocols/curve.protocols.mjs +45 -0
- package/{common152.mjs → functions/protocols/pendle.helpers.mjs} +26 -26
- package/{common148.mjs → functions/snarkjs/common.snarkjs.mjs} +5 -5
- package/{common255.mjs → functions/snarkjs/constant.mjs} +21 -21
- package/{common147.mjs → functions/snarkjs/constructEmporiumProof.mjs} +13 -13
- package/{common146.mjs → functions/snarkjs/constructGeneralZkProof.mjs} +29 -29
- package/functions/snarkjs/generateCircomData.mjs +60 -0
- package/{common149.mjs → functions/snarkjs/generateZkProof.mjs} +4 -4
- package/functions/snarkjs/getZKFiles.mjs +30 -0
- package/{common153.mjs → functions/staking/index.mjs} +2 -2
- package/functions/utils/axelar.utils.mjs +38 -0
- package/{common115.mjs → functions/utils/cacheFunctions.mjs} +22 -22
- package/functions/utils/convertIntegrationProviderToExternalActionId.mjs +16 -0
- package/{common118.mjs → functions/utils/erc20tokenFunctions.mjs} +2 -2
- package/functions/utils/evmNetworkFunctions.mjs +29 -0
- package/{common117.mjs → functions/utils/external-action.utils.mjs} +6 -6
- package/{common130.mjs → functions/utils/getDataFromTransaction.mjs} +21 -21
- package/{common222.mjs → functions/utils/memoize.utils.mjs} +1 -1
- package/functions/utils/volatile-patcher.utils.mjs +40 -0
- package/{common137.mjs → functions/web3/etherFunctions.mjs} +1 -1
- package/functions/web3/events/balanceChangedHandler.mjs +10 -0
- package/{common138.mjs → functions/web3/events/getInputUtxoAndBalance.mjs} +6 -6
- package/{common139.mjs → functions/web3/events/getShieldedBalance.mjs} +27 -27
- package/functions/web3/functionCalls/accessTokenCalls.mjs +48 -0
- package/{common241.mjs → functions/web3/functionCalls/approveToken.mjs} +23 -23
- package/{common229.mjs → functions/web3/functionCalls/estimateGasRelayer.mjs} +4 -4
- package/functions/web3/functionCalls/transactCallDirect.mjs +60 -0
- package/functions/web3/functionCalls/transactCallRelayer.mjs +42 -0
- package/functions/web3/odosAPI.mjs +65 -0
- package/functions/web3/oneInchAPI.mjs +61 -0
- package/{common145.mjs → functions/web3/runContractFunction.mjs} +22 -22
- package/{common142.mjs → functions/web3/uniswapAPI.mjs} +25 -25
- package/{common.mjs → index.mjs} +188 -188
- package/package.json +1 -1
- package/{common168.mjs → types/curve.types.mjs} +1 -1
- package/webworker/performTaskWithWorker.mjs +62 -0
- package/{common252.mjs → webworker/snarkjsWorker/snarkjsWorkerLogic.mjs} +1 -1
- package/{common254.mjs → webworker/utxoWorker/utxoWorkerLogic.mjs} +8 -8
- package/{common191.mjs → webworker/workerFactory.mjs} +7 -7
- package/{common253.mjs → webworker/zkProofWorker/zkProofWorkerLogic.mjs} +8 -8
- package/common10.mjs +0 -30
- package/common11.mjs +0 -30
- package/common112.mjs +0 -48
- package/common113.mjs +0 -39
- package/common121.mjs +0 -16
- package/common123.mjs +0 -45
- package/common124.mjs +0 -57
- package/common127.mjs +0 -29
- package/common128.mjs +0 -38
- package/common136.mjs +0 -40
- package/common14.mjs +0 -32
- package/common141.mjs +0 -10
- package/common143.mjs +0 -65
- package/common144.mjs +0 -61
- package/common150.mjs +0 -45
- package/common151.mjs +0 -41
- package/common16.mjs +0 -6
- package/common170.mjs +0 -85
- package/common205.mjs +0 -42
- package/common208.mjs +0 -62
- package/common212.mjs +0 -40
- package/common213.mjs +0 -45
- package/common214.mjs +0 -36
- package/common216.mjs +0 -44
- package/common217.mjs +0 -32
- package/common218.mjs +0 -38
- package/common220.mjs +0 -32
- package/common221.mjs +0 -47
- package/common223.mjs +0 -30
- package/common224.mjs +0 -91
- package/common227.mjs +0 -30
- package/common230.mjs +0 -42
- package/common231.mjs +0 -60
- package/common232.mjs +0 -48
- package/common233.mjs +0 -47
- package/common234.mjs +0 -44
- package/common235.mjs +0 -74
- package/common237.mjs +0 -60
- package/common239.mjs +0 -30
- package/common242.mjs +0 -31
- package/common243.mjs +0 -30
- package/common244.mjs +0 -68
- package/common245.mjs +0 -57
- package/common247.mjs +0 -36
- package/common248.mjs +0 -43
- package/common249.mjs +0 -44
- package/common250.mjs +0 -59
- package/common29.mjs +0 -57
- package/common4.mjs +0 -37
- package/common5.mjs +0 -37
- package/common55.mjs +0 -83
- package/common59.mjs +0 -98
- package/common6.mjs +0 -32
- package/common61.mjs +0 -91
- package/common62.mjs +0 -66
- package/common63.mjs +0 -49
- package/common7.mjs +0 -37
- package/common8.mjs +0 -38
- package/common83.mjs +0 -35
- package/common9.mjs +0 -41
- /package/{common15.mjs → constants/assets.constants.mjs} +0 -0
- /package/{common37.mjs → constants/backend.constants.mjs} +0 -0
- /package/{common18.mjs → constants/deploy-data/deploy-data-arbMainnet.json.mjs} +0 -0
- /package/{common22.mjs → constants/deploy-data/deploy-data-avalanche.json.mjs} +0 -0
- /package/{common26.mjs → constants/deploy-data/deploy-data-axelar1.json.mjs} +0 -0
- /package/{common27.mjs → constants/deploy-data/deploy-data-axelar2.json.mjs} +0 -0
- /package/{common23.mjs → constants/deploy-data/deploy-data-base.json.mjs} +0 -0
- /package/{common24.mjs → constants/deploy-data/deploy-data-blast.json.mjs} +0 -0
- /package/{common17.mjs → constants/deploy-data/deploy-data-bnbMainnet.json.mjs} +0 -0
- /package/{common19.mjs → constants/deploy-data/deploy-data-ethMainnet.json.mjs} +0 -0
- /package/{common25.mjs → constants/deploy-data/deploy-data-localhost.json.mjs} +0 -0
- /package/{common20.mjs → constants/deploy-data/deploy-data-optimism.json.mjs} +0 -0
- /package/{common21.mjs → constants/deploy-data/deploy-data-polygon.json.mjs} +0 -0
- /package/{common40.mjs → constants/lido.constants.mjs} +0 -0
- /package/{common34.mjs → constants/protocol.constants.mjs} +0 -0
- /package/{common32.mjs → constants/server.constants.mjs} +0 -0
- /package/{common180.mjs → constants/token-data/arbMainnetRegistry.json.mjs} +0 -0
- /package/{common172.mjs → constants/token-data/arbMainnetRegistryFixed.json.mjs} +0 -0
- /package/{common175.mjs → constants/token-data/avalancheRegistry.json.mjs} +0 -0
- /package/{common183.mjs → constants/token-data/avalancheRegistryFixed.json.mjs} +0 -0
- /package/{common185.mjs → constants/token-data/baseRegistry.json.mjs} +0 -0
- /package/{common177.mjs → constants/token-data/baseRegistryFixed.json.mjs} +0 -0
- /package/{common178.mjs → constants/token-data/blastRegistry.json.mjs} +0 -0
- /package/{common186.mjs → constants/token-data/blastRegistryFixed.json.mjs} +0 -0
- /package/{common173.mjs → constants/token-data/bnbMainnetRegistry.json.mjs} +0 -0
- /package/{common181.mjs → constants/token-data/bnbMainnetRegistryFixed.json.mjs} +0 -0
- /package/{common190.mjs → constants/token-data/coingeckoRegistry.json.mjs} +0 -0
- /package/{common179.mjs → constants/token-data/ethMainnetRegistry.json.mjs} +0 -0
- /package/{common171.mjs → constants/token-data/ethMainnetRegistryFixed.json.mjs} +0 -0
- /package/{common187.mjs → constants/token-data/localhostRegistry.json.mjs} +0 -0
- /package/{common184.mjs → constants/token-data/optimismRegistry.json.mjs} +0 -0
- /package/{common176.mjs → constants/token-data/optimismRegistryFixed.json.mjs} +0 -0
- /package/{common182.mjs → constants/token-data/polygonRegistry.json.mjs} +0 -0
- /package/{common174.mjs → constants/token-data/polygonRegistryFixed.json.mjs} +0 -0
- /package/{common189.mjs → constants/token-data/popularTokens.constants.mjs} +0 -0
- /package/{common188.mjs → constants/token-data/tokenPricing.consts.mjs} +0 -0
- /package/{common46.mjs → crypto/babyJub.mjs} +0 -0
- /package/{common60.mjs → data-structures/Hinkal/hinkalTransfer.mjs} +0 -0
- /package/{common48.mjs → data-structures/ValueCache/ValueCache.mjs} +0 -0
- /package/{common72.mjs → data-structures/custom-token-registry/CustomTokenRegistry.mjs} +0 -0
- /package/{common65.mjs → data-structures/merkle-tree/MerkleTreeIncompleteError.mjs} +0 -0
- /package/{common256.mjs → data-structures/transactions-manager/history/history.utils.mjs} +0 -0
- /package/{common219.mjs → error-handling/customErrors/ErrorWithAmount.mjs} +0 -0
- /package/{common81.mjs → error-handling/error-codes.constants.mjs} +0 -0
- /package/{common85.mjs → error-handling/types.mjs} +0 -0
- /package/{common88.mjs → externalABIs/BUSD.mjs} +0 -0
- /package/{common109.mjs → externalABIs/BabPassport.json.mjs} +0 -0
- /package/{common192.mjs → externalABIs/BeefyRouterAbi.json.mjs} +0 -0
- /package/{common193.mjs → externalABIs/BeefyStrategyAbi.json.mjs} +0 -0
- /package/{common87.mjs → externalABIs/BeefyVaultAbi.json.mjs} +0 -0
- /package/{common194.mjs → externalABIs/BeefyZapAbi.json.mjs} +0 -0
- /package/{common195.mjs → externalABIs/BeefyZapOneInchAbi.json.mjs} +0 -0
- /package/{common196.mjs → externalABIs/ConvexBoosterAbi.json.mjs} +0 -0
- /package/{common197.mjs → externalABIs/ConvexBoosterAbiMainnet.json.mjs} +0 -0
- /package/{common198.mjs → externalABIs/ConvexRewardPoolAbi.json.mjs} +0 -0
- /package/{common89.mjs → externalABIs/CurveReadingWrapperAbi.json.mjs} +0 -0
- /package/{common90.mjs → externalABIs/CurveWrappedMainPool.json.mjs} +0 -0
- /package/{common199.mjs → externalABIs/CurveZap.json.mjs} +0 -0
- /package/{common200.mjs → externalABIs/CvxCrvUtilities.json.mjs} +0 -0
- /package/{common91.mjs → externalABIs/DAI.mjs} +0 -0
- /package/{common92.mjs → externalABIs/ERC20.json.mjs} +0 -0
- /package/{common110.mjs → externalABIs/GalxePassport.json.mjs} +0 -0
- /package/{common93.mjs → externalABIs/IQuoterV2.json.mjs} +0 -0
- /package/{common101.mjs → externalABIs/ISwapRouter.json.mjs} +0 -0
- /package/{common94.mjs → externalABIs/IUniswapV3Factory.json.mjs} +0 -0
- /package/{common202.mjs → externalABIs/IUniswapV3Pool.json.mjs} +0 -0
- /package/{common102.mjs → externalABIs/LidoStEthAbi.json.mjs} +0 -0
- /package/{common103.mjs → externalABIs/LidoStMaticAbi.json.mjs} +0 -0
- /package/{common107.mjs → externalABIs/LidoStakeManagerAbi.json.mjs} +0 -0
- /package/{common104.mjs → externalABIs/LidoWithdrawalQueueERC721Abi.json.mjs} +0 -0
- /package/{common106.mjs → externalABIs/LidoWstEthAbi.json.mjs} +0 -0
- /package/{common111.mjs → externalABIs/OptimismGasPriceOracle.json.mjs} +0 -0
- /package/{common201.mjs → externalABIs/PendleRouterAbi.json.mjs} +0 -0
- /package/{common105.mjs → externalABIs/PoLidoNftAbi.json.mjs} +0 -0
- /package/{common95.mjs → externalABIs/SanctionsList.mjs} +0 -0
- /package/{common96.mjs → externalABIs/USDC.mjs} +0 -0
- /package/{common97.mjs → externalABIs/USDR.mjs} +0 -0
- /package/{common98.mjs → externalABIs/USDR3CRV.mjs} +0 -0
- /package/{common99.mjs → externalABIs/USDT.mjs} +0 -0
- /package/{common203.mjs → externalABIs/UniswapV2PoolAbi.json.mjs} +0 -0
- /package/{common100.mjs → externalABIs/WETH.mjs} +0 -0
- /package/{common86.mjs → externalABIs/amToken.mjs} +0 -0
- /package/{common108.mjs → externalABIs/transactionsProver.json.mjs} +0 -0
- /package/{common154.mjs → functions/private-wallet/emporium.helpers.mjs} +0 -0
- /package/{common114.mjs → functions/utils/amounts.utils.mjs} +0 -0
- /package/{common134.mjs → functions/utils/caseInsensitive.utils.mjs} +0 -0
- /package/{common116.mjs → functions/utils/create-provider.mjs} +0 -0
- /package/{common206.mjs → functions/utils/enum.utils.mjs} +0 -0
- /package/{common133.mjs → functions/utils/nickname.utils.mjs} +0 -0
- /package/{common207.mjs → functions/utils/process.utils.mjs} +0 -0
- /package/{common131.mjs → functions/utils/reloadPage.mjs} +0 -0
- /package/{common119.mjs → functions/utils/requireEnv.mjs} +0 -0
- /package/{common120.mjs → functions/utils/resolve-sync.utils.mjs} +0 -0
- /package/{common240.mjs → functions/utils/serialize.utils.mjs} +0 -0
- /package/{common132.mjs → functions/utils/string.utils.mjs} +0 -0
- /package/{common135.mjs → functions/utils/time.utils.mjs} +0 -0
- /package/{common129.mjs → functions/utils/userAgent.mjs} +0 -0
- /package/{common140.mjs → functions/web3/events/web3RetrieveEvents.mjs} +0 -0
- /package/{common156.mjs → types/beefy.types.mjs} +0 -0
- /package/{common157.mjs → types/circom-data.types.mjs} +0 -0
- /package/{common158.mjs → types/ethereum-network.types.mjs} +0 -0
- /package/{common159.mjs → types/external-action.types.mjs} +0 -0
- /package/{common169.mjs → types/hinkal.stake.types.mjs} +0 -0
- /package/{common160.mjs → types/hinkal.types.mjs} +0 -0
- /package/{common161.mjs → types/kyc.types.mjs} +0 -0
- /package/{common167.mjs → types/pendle.types.mjs} +0 -0
- /package/{common166.mjs → types/rewards.types.mjs} +0 -0
- /package/{common163.mjs → types/slippage.types.mjs} +0 -0
- /package/{common165.mjs → types/time.types.mjs} +0 -0
- /package/{common162.mjs → types/token.types.mjs} +0 -0
- /package/{common164.mjs → types/transactions.types.mjs} +0 -0
- /package/{common238.mjs → webworker/snarkjsWorker/snarkjsWorker.types.mjs} +0 -0
- /package/{common210.mjs → webworker/utxoWorker/utxoWorker.types.mjs} +0 -0
- /package/{common209.mjs → webworker/worker.registry.mjs} +0 -0
- /package/{common257.mjs → webworker/workerProxy.mjs} +0 -0
- /package/{common236.mjs → webworker/zkProofWorker/zkProofWorker.types.mjs} +0 -0
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { chainIds as J } from "
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import { HinkalStakeMode as c } from "
|
|
6
|
-
import { randomBigInt as V } from "
|
|
7
|
-
import { Utxo as j } from "
|
|
1
|
+
import { chainIds as J } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import "../../types/circom-data.types.mjs";
|
|
3
|
+
import "../../types/transactions.types.mjs";
|
|
4
|
+
import "../../types/curve.types.mjs";
|
|
5
|
+
import { HinkalStakeMode as c } from "../../types/hinkal.stake.types.mjs";
|
|
6
|
+
import { randomBigInt as V } from "../web3/etherFunctions.mjs";
|
|
7
|
+
import { Utxo as j } from "../../data-structures/utxo/Utxo.mjs";
|
|
8
8
|
import "axios";
|
|
9
9
|
import "ethers";
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
import { zeroAddress as q } from "
|
|
13
|
-
import "
|
|
14
|
-
import { performTaskWithWorker as s } from "
|
|
15
|
-
import { WorkerVariant as l } from "
|
|
16
|
-
import { ZKProofWorkerActionType as S } from "
|
|
17
|
-
import { calcAmountChanges as F, calcEncryptedOutputs as Q, buildOutCommitments as X, calcPublicSignalCount as Y, createCallDataHash as $, calcStealthAddressStructure as U } from "./
|
|
18
|
-
import { generateCircomData as x } from "./
|
|
19
|
-
import { generateZkProof as oo } from "./
|
|
10
|
+
import "../../data-structures/crypto-keys/keys.mjs";
|
|
11
|
+
import "../../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
|
|
12
|
+
import { zeroAddress as q } from "../../constants/protocol.constants.mjs";
|
|
13
|
+
import "../web3/events/getShieldedBalance.mjs";
|
|
14
|
+
import { performTaskWithWorker as s } from "../../webworker/performTaskWithWorker.mjs";
|
|
15
|
+
import { WorkerVariant as l } from "../../webworker/worker.registry.mjs";
|
|
16
|
+
import { ZKProofWorkerActionType as S } from "../../webworker/zkProofWorker/zkProofWorker.types.mjs";
|
|
17
|
+
import { calcAmountChanges as F, calcEncryptedOutputs as Q, buildOutCommitments as X, calcPublicSignalCount as Y, createCallDataHash as $, calcStealthAddressStructure as U } from "./common.snarkjs.mjs";
|
|
18
|
+
import { generateCircomData as x } from "./generateCircomData.mjs";
|
|
19
|
+
import { generateZkProof as oo } from "./generateZkProof.mjs";
|
|
20
20
|
import "circomlibjs";
|
|
21
|
-
import "
|
|
22
|
-
import "
|
|
23
|
-
import "
|
|
24
|
-
import "
|
|
25
|
-
import "
|
|
26
|
-
import "
|
|
27
|
-
import "
|
|
28
|
-
import "
|
|
29
|
-
import "
|
|
21
|
+
import "../utils/external-action.utils.mjs";
|
|
22
|
+
import "../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
23
|
+
import "../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
24
|
+
import "../../constants/coingecko.constants.mjs";
|
|
25
|
+
import "../../constants/vite.constants.mjs";
|
|
26
|
+
import "../utils/userAgent.mjs";
|
|
27
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
28
|
+
import "../../constants/kyc.constants.mjs";
|
|
29
|
+
import "../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
30
30
|
import "libsodium-wrappers";
|
|
31
|
-
import "
|
|
32
|
-
import "
|
|
33
|
-
import "
|
|
31
|
+
import "../../constants/contracts.constants.mjs";
|
|
32
|
+
import "../../constants/axelar.constants.mjs";
|
|
33
|
+
import "../../constants/rewards.constants.mjs";
|
|
34
34
|
const Lo = async (f, g, e, a, h, u, k, C, I, T = q, R = J.localhost, r = e.map(() => !1), y = e.map(() => 0n), b = void 0, m) => {
|
|
35
35
|
const N = f.getRootHash(), P = g.getRootHash(), D = e.map((o) => o.map((i) => i.getConstructableParams())), _ = h.getSignature(), { accessTokenSiblings: B, accessTokenSiblingSides: E } = await s({
|
|
36
36
|
type: l.ZKProof,
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import "../../constants/chains.constants.mjs";
|
|
2
|
+
import { defaultHookData as S } from "../../types/circom-data.types.mjs";
|
|
3
|
+
import "../../types/transactions.types.mjs";
|
|
4
|
+
import "../../types/curve.types.mjs";
|
|
5
|
+
import "ethers";
|
|
6
|
+
import { zeroAddress as h } from "../../constants/protocol.constants.mjs";
|
|
7
|
+
import "circomlibjs";
|
|
8
|
+
import "../../data-structures/crypto-keys/keys.mjs";
|
|
9
|
+
import "axios";
|
|
10
|
+
import "../../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
|
|
11
|
+
import "../web3/events/getShieldedBalance.mjs";
|
|
12
|
+
import { performTaskWithWorker as C } from "../../webworker/performTaskWithWorker.mjs";
|
|
13
|
+
import { WorkerVariant as T } from "../../webworker/worker.registry.mjs";
|
|
14
|
+
import { ZKProofWorkerActionType as W } from "../../webworker/zkProofWorker/zkProofWorker.types.mjs";
|
|
15
|
+
import { calcAmountChanges as b, buildOutCommitments as L } from "./common.snarkjs.mjs";
|
|
16
|
+
import { getExternalActionIdHash as N } from "../utils/external-action.utils.mjs";
|
|
17
|
+
import "../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
18
|
+
import "../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
19
|
+
import "../../constants/coingecko.constants.mjs";
|
|
20
|
+
import "../../constants/vite.constants.mjs";
|
|
21
|
+
import "../utils/userAgent.mjs";
|
|
22
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
23
|
+
import "../../constants/kyc.constants.mjs";
|
|
24
|
+
import "../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
25
|
+
import "libsodium-wrappers";
|
|
26
|
+
import "../../constants/contracts.constants.mjs";
|
|
27
|
+
import "../../constants/axelar.constants.mjs";
|
|
28
|
+
import "../../constants/rewards.constants.mjs";
|
|
29
|
+
const ir = async (e, a, o, t, n, s, c, m, i, d, f, k, l, g, p, u) => {
|
|
30
|
+
const y = b(o, t, !0), A = o.map((r) => r.map((I) => I.getConstructableParams())), D = await C({
|
|
31
|
+
type: T.ZKProof,
|
|
32
|
+
payload: {
|
|
33
|
+
type: W.BUILD_IN_NULLIFIERS,
|
|
34
|
+
data: { inputUtxosSerialized: A, onChainCreation: p }
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
rootHashHinkal: e,
|
|
39
|
+
erc20TokenAddresses: o.map((r) => r[0].erc20TokenAddress),
|
|
40
|
+
tokenIds: l.map((r) => String(r)),
|
|
41
|
+
amountChanges: y,
|
|
42
|
+
inputNullifiers: D,
|
|
43
|
+
outCommitments: L(t, p),
|
|
44
|
+
encryptedOutputs: n,
|
|
45
|
+
flatFees: s,
|
|
46
|
+
timeStamp: t[0][0].timeStamp,
|
|
47
|
+
stealthAddressStructure: g,
|
|
48
|
+
rootHashAccessToken: a,
|
|
49
|
+
relay: f,
|
|
50
|
+
externalAddress: i === void 0 ? h : i,
|
|
51
|
+
externalActionMetadata: d,
|
|
52
|
+
externalActionId: typeof m == "bigint" ? 0n : N(m),
|
|
53
|
+
hookData: u || S,
|
|
54
|
+
publicSignalCount: c,
|
|
55
|
+
calldataHash: k
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
ir as generateCircomData
|
|
60
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { performTaskWithWorker as p } from "
|
|
2
|
-
import { SnarkJSWorkerActionType as i } from "
|
|
3
|
-
import { WorkerVariant as c } from "
|
|
4
|
-
import { getZKeyFile as r, getWASMFile as g } from "./
|
|
1
|
+
import { performTaskWithWorker as p } from "../../webworker/performTaskWithWorker.mjs";
|
|
2
|
+
import { SnarkJSWorkerActionType as i } from "../../webworker/snarkjsWorker/snarkjsWorker.types.mjs";
|
|
3
|
+
import { WorkerVariant as c } from "../../webworker/worker.registry.mjs";
|
|
4
|
+
import { getZKeyFile as r, getWASMFile as g } from "./getZKFiles.mjs";
|
|
5
5
|
const S = async (o, t, e) => {
|
|
6
6
|
console.log("Zero Knowledge proof construction started, please wait...", r(t, o));
|
|
7
7
|
const a = g(t, o), n = r(t, o), { publicSignals: l, zkCallData: s } = await p({
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { chainIds as o } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import "../../types/circom-data.types.mjs";
|
|
3
|
+
import "../../types/transactions.types.mjs";
|
|
4
|
+
import "../../types/curve.types.mjs";
|
|
5
|
+
import "ethers";
|
|
6
|
+
import "circomlibjs";
|
|
7
|
+
import "../../data-structures/crypto-keys/keys.mjs";
|
|
8
|
+
import "axios";
|
|
9
|
+
import "../../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
|
|
10
|
+
import "../web3/events/getShieldedBalance.mjs";
|
|
11
|
+
import "../../webworker/workerFactory.mjs";
|
|
12
|
+
import "../utils/external-action.utils.mjs";
|
|
13
|
+
import "../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
14
|
+
import "../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
15
|
+
import "../../constants/coingecko.constants.mjs";
|
|
16
|
+
import "../../constants/vite.constants.mjs";
|
|
17
|
+
import "../utils/userAgent.mjs";
|
|
18
|
+
import { prodVerifiers as t, localVerifiers as m } from "./constant.mjs";
|
|
19
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
20
|
+
import "../../constants/kyc.constants.mjs";
|
|
21
|
+
import "../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
22
|
+
import "libsodium-wrappers";
|
|
23
|
+
import "../../constants/contracts.constants.mjs";
|
|
24
|
+
import "../../constants/axelar.constants.mjs";
|
|
25
|
+
import "../../constants/rewards.constants.mjs";
|
|
26
|
+
const j = (r, i) => i === o.localhost ? m[`${r}Wasm`] : t(i)[`${r}Wasm`], q = (r, i) => i === o.localhost ? m[`${r}Zkey`] : t(i)[`${r}Zkey`];
|
|
27
|
+
export {
|
|
28
|
+
j as getWASMFile,
|
|
29
|
+
q as getZKeyFile
|
|
30
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ethers as i } from "ethers";
|
|
2
|
-
import { UserKeys as f } from "
|
|
2
|
+
import { UserKeys as f } from "../../data-structures/crypto-keys/keys.mjs";
|
|
3
3
|
import s from "libsodium-wrappers";
|
|
4
|
-
import { poseidonHash as c } from "
|
|
4
|
+
import { poseidonHash as c } from "../../crypto/poseidon.mjs";
|
|
5
5
|
import "circomlibjs";
|
|
6
6
|
const S = (t, e, r) => {
|
|
7
7
|
const o = i.utils.defaultAbiCoder.encode(
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import "../../constants/chains.constants.mjs";
|
|
2
|
+
import "../../types/circom-data.types.mjs";
|
|
3
|
+
import "../../types/transactions.types.mjs";
|
|
4
|
+
import "../../types/curve.types.mjs";
|
|
5
|
+
import "ethers";
|
|
6
|
+
import "circomlibjs";
|
|
7
|
+
import "../../data-structures/crypto-keys/keys.mjs";
|
|
8
|
+
import "axios";
|
|
9
|
+
import "../../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
|
|
10
|
+
import "../web3/events/getShieldedBalance.mjs";
|
|
11
|
+
import "../../webworker/workerFactory.mjs";
|
|
12
|
+
import "./external-action.utils.mjs";
|
|
13
|
+
import "../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
14
|
+
import "./convertIntegrationProviderToExternalActionId.mjs";
|
|
15
|
+
import "../../constants/coingecko.constants.mjs";
|
|
16
|
+
import "../../constants/vite.constants.mjs";
|
|
17
|
+
import "./userAgent.mjs";
|
|
18
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
19
|
+
import "../../constants/kyc.constants.mjs";
|
|
20
|
+
import "../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
21
|
+
import "libsodium-wrappers";
|
|
22
|
+
import "../../constants/contracts.constants.mjs";
|
|
23
|
+
import { AxelarRegistry as p } from "../../constants/axelar.constants.mjs";
|
|
24
|
+
import "../../constants/rewards.constants.mjs";
|
|
25
|
+
const z = (i) => {
|
|
26
|
+
const r = p.find((m) => m.chainId === i.chainId);
|
|
27
|
+
if (!r)
|
|
28
|
+
return;
|
|
29
|
+
const { sourceChain: t, sourceAddress: o } = r;
|
|
30
|
+
return {
|
|
31
|
+
destinationChain: t,
|
|
32
|
+
destinationAddress: o,
|
|
33
|
+
messageFee: i.gasFeeInWei ?? 0n
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
z as getAxelarMigrationInfo
|
|
38
|
+
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import "ethers";
|
|
2
2
|
import "axios";
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
3
|
+
import "../../constants/chains.constants.mjs";
|
|
4
|
+
import "../../types/circom-data.types.mjs";
|
|
5
|
+
import "../../types/transactions.types.mjs";
|
|
6
|
+
import "../../types/curve.types.mjs";
|
|
7
7
|
import "circomlibjs";
|
|
8
|
-
import "
|
|
9
|
-
import { serializeDecodedTxs as g, deserializeDecodedTxs as C } from "./
|
|
10
|
-
import "
|
|
11
|
-
import "./
|
|
12
|
-
import "
|
|
13
|
-
import "./
|
|
14
|
-
import "
|
|
15
|
-
import { logError as p } from "
|
|
16
|
-
import "./
|
|
17
|
-
import "
|
|
18
|
-
import "
|
|
19
|
-
import "
|
|
20
|
-
import "
|
|
21
|
-
import "
|
|
8
|
+
import "../../data-structures/crypto-keys/keys.mjs";
|
|
9
|
+
import { serializeDecodedTxs as g, deserializeDecodedTxs as C } from "./getDataFromTransaction.mjs";
|
|
10
|
+
import "../web3/events/getShieldedBalance.mjs";
|
|
11
|
+
import "./external-action.utils.mjs";
|
|
12
|
+
import "../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
13
|
+
import "./convertIntegrationProviderToExternalActionId.mjs";
|
|
14
|
+
import "../../constants/coingecko.constants.mjs";
|
|
15
|
+
import { logError as p } from "../../error-handling/logError.mjs";
|
|
16
|
+
import "./userAgent.mjs";
|
|
17
|
+
import "../../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
|
|
18
|
+
import "../../webworker/workerFactory.mjs";
|
|
19
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
20
|
+
import "../../constants/kyc.constants.mjs";
|
|
21
|
+
import "../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
22
22
|
import "libsodium-wrappers";
|
|
23
|
-
import "
|
|
24
|
-
import "
|
|
25
|
-
import "
|
|
26
|
-
import "
|
|
23
|
+
import "../../constants/vite.constants.mjs";
|
|
24
|
+
import "../../constants/contracts.constants.mjs";
|
|
25
|
+
import "../../constants/axelar.constants.mjs";
|
|
26
|
+
import "../../constants/rewards.constants.mjs";
|
|
27
27
|
const l = {
|
|
28
28
|
encryptedOutputs: [],
|
|
29
29
|
lastOutput: ""
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "../../types/circom-data.types.mjs";
|
|
2
|
+
import { ExternalActionId as r } from "../../types/external-action.types.mjs";
|
|
3
|
+
import { IntegrationProvider as o } from "../../types/hinkal.types.mjs";
|
|
4
|
+
import "../../types/transactions.types.mjs";
|
|
5
|
+
import "../../types/curve.types.mjs";
|
|
6
|
+
const t = {
|
|
7
|
+
[o.UNISWAP]: r.Uniswap,
|
|
8
|
+
[o.ODOS]: r.Odos,
|
|
9
|
+
[o.ONEINCH]: r.OneInch,
|
|
10
|
+
[o.PENDLE]: r.Pendle,
|
|
11
|
+
[o.ALL]: void 0,
|
|
12
|
+
[o.NONE]: void 0
|
|
13
|
+
}, p = (n) => t[n];
|
|
14
|
+
export {
|
|
15
|
+
p as convertIntegrationProviderToExternalActionId
|
|
16
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getERC20Registry as n } from "
|
|
2
|
-
import { customTokenRegistry as i } from "
|
|
1
|
+
import { getERC20Registry as n } from "../../constants/token-data/ERC20Registry.mjs";
|
|
2
|
+
import { customTokenRegistry as i } from "../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
3
3
|
const T = (e, o) => {
|
|
4
4
|
const r = n(o), t = i.getCustomTokens(o);
|
|
5
5
|
return [...r, ...t].find((s) => e === void 0 ? !1 : s.erc20TokenAddress.toLowerCase() === e.toLowerCase());
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { networkRegistry as i, chainIdsByType as o } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import "../../types/circom-data.types.mjs";
|
|
3
|
+
import "../../types/transactions.types.mjs";
|
|
4
|
+
import "../../types/curve.types.mjs";
|
|
5
|
+
import "ethers";
|
|
6
|
+
import "circomlibjs";
|
|
7
|
+
import "../../data-structures/crypto-keys/keys.mjs";
|
|
8
|
+
import "axios";
|
|
9
|
+
import "../../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
|
|
10
|
+
import "../web3/events/getShieldedBalance.mjs";
|
|
11
|
+
import "../../webworker/workerFactory.mjs";
|
|
12
|
+
import "./external-action.utils.mjs";
|
|
13
|
+
import "../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
14
|
+
import "./convertIntegrationProviderToExternalActionId.mjs";
|
|
15
|
+
import "../../constants/coingecko.constants.mjs";
|
|
16
|
+
import "../../constants/vite.constants.mjs";
|
|
17
|
+
import "./userAgent.mjs";
|
|
18
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
19
|
+
import "../../constants/kyc.constants.mjs";
|
|
20
|
+
import "../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
21
|
+
import "libsodium-wrappers";
|
|
22
|
+
import "../../constants/contracts.constants.mjs";
|
|
23
|
+
import "../../constants/axelar.constants.mjs";
|
|
24
|
+
import "../../constants/rewards.constants.mjs";
|
|
25
|
+
const B = (t) => i[t], R = (t) => Object.keys(o)[Object.values(o).findIndex((r) => r.includes(t.chainId))];
|
|
26
|
+
export {
|
|
27
|
+
B as getNetworkObject,
|
|
28
|
+
R as getNetworkType
|
|
29
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ethers as u } from "ethers";
|
|
2
|
-
import { CIRCOM_P as r } from "
|
|
3
|
-
import "
|
|
4
|
-
import { ExternalActionId as t } from "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import { toNumberOrUndefined as a } from "./
|
|
2
|
+
import { CIRCOM_P as r } from "../../constants/protocol.constants.mjs";
|
|
3
|
+
import "../../types/circom-data.types.mjs";
|
|
4
|
+
import { ExternalActionId as t } from "../../types/external-action.types.mjs";
|
|
5
|
+
import "../../types/transactions.types.mjs";
|
|
6
|
+
import "../../types/curve.types.mjs";
|
|
7
|
+
import { toNumberOrUndefined as a } from "./amounts.utils.mjs";
|
|
8
8
|
const s = (n) => n === 0n ? 0n : BigInt(u.utils.id(n)) % r, g = (n) => BigInt(n) === 0n ? t.Transact : Object.values(t).find(
|
|
9
9
|
(e) => BigInt(n) === s(e)
|
|
10
10
|
), i = {
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { BigNumber as m } from "ethers";
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
2
|
+
import "../../constants/chains.constants.mjs";
|
|
3
|
+
import "../../types/circom-data.types.mjs";
|
|
4
|
+
import "../../types/transactions.types.mjs";
|
|
5
|
+
import "../../types/curve.types.mjs";
|
|
6
6
|
import "circomlibjs";
|
|
7
|
-
import "
|
|
7
|
+
import "../../data-structures/crypto-keys/keys.mjs";
|
|
8
8
|
import "axios";
|
|
9
|
-
import { abiDecodeUtxo as g } from "
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
import "
|
|
13
|
-
import "./
|
|
14
|
-
import "
|
|
15
|
-
import "./
|
|
16
|
-
import "
|
|
17
|
-
import "
|
|
18
|
-
import "./
|
|
19
|
-
import "
|
|
20
|
-
import "
|
|
21
|
-
import "
|
|
9
|
+
import { abiDecodeUtxo as g } from "../../data-structures/crypto-keys/decodeUTXO.mjs";
|
|
10
|
+
import "../../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
|
|
11
|
+
import "../web3/events/getShieldedBalance.mjs";
|
|
12
|
+
import "../../webworker/workerFactory.mjs";
|
|
13
|
+
import "./external-action.utils.mjs";
|
|
14
|
+
import "../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
15
|
+
import "./convertIntegrationProviderToExternalActionId.mjs";
|
|
16
|
+
import "../../constants/coingecko.constants.mjs";
|
|
17
|
+
import "../../constants/vite.constants.mjs";
|
|
18
|
+
import "./userAgent.mjs";
|
|
19
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
20
|
+
import "../../constants/kyc.constants.mjs";
|
|
21
|
+
import "../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
22
22
|
import "libsodium-wrappers";
|
|
23
|
-
import { getHinkalParameters as x } from "
|
|
24
|
-
import "
|
|
25
|
-
import "
|
|
23
|
+
import { getHinkalParameters as x } from "../../constants/contracts.constants.mjs";
|
|
24
|
+
import "../../constants/axelar.constants.mjs";
|
|
25
|
+
import "../../constants/rewards.constants.mjs";
|
|
26
26
|
const G = (e, r) => {
|
|
27
27
|
const n = e.parseTransaction({ data: r }), { circomData: t } = n.args, {
|
|
28
28
|
extraRandomization: o,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getERC20Registry as p } from "../../constants/token-data/ERC20Registry.mjs";
|
|
2
|
+
import "../../constants/chains.constants.mjs";
|
|
3
|
+
import "../../types/circom-data.types.mjs";
|
|
4
|
+
import "../../types/transactions.types.mjs";
|
|
5
|
+
import "../../types/curve.types.mjs";
|
|
6
|
+
import "ethers";
|
|
7
|
+
import "circomlibjs";
|
|
8
|
+
import "../../data-structures/crypto-keys/keys.mjs";
|
|
9
|
+
import "axios";
|
|
10
|
+
import "../../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
|
|
11
|
+
import "../web3/events/getShieldedBalance.mjs";
|
|
12
|
+
import "../../webworker/workerFactory.mjs";
|
|
13
|
+
import "./external-action.utils.mjs";
|
|
14
|
+
import { customTokenRegistry as s } from "../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
15
|
+
import "./convertIntegrationProviderToExternalActionId.mjs";
|
|
16
|
+
import "../../constants/coingecko.constants.mjs";
|
|
17
|
+
import "../../constants/vite.constants.mjs";
|
|
18
|
+
import "./userAgent.mjs";
|
|
19
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
20
|
+
import "../../constants/kyc.constants.mjs";
|
|
21
|
+
import { VolatileHelper as e } from "../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
22
|
+
import "libsodium-wrappers";
|
|
23
|
+
import "../../constants/contracts.constants.mjs";
|
|
24
|
+
import "../../constants/axelar.constants.mjs";
|
|
25
|
+
import "../../constants/rewards.constants.mjs";
|
|
26
|
+
const m = { chains: [] }, v = async (r) => {
|
|
27
|
+
let o = [...p(r), ...s.getCustomTokens(r)];
|
|
28
|
+
m.chains.includes(r) || (o = await Promise.all(
|
|
29
|
+
o.map(async (t) => {
|
|
30
|
+
if (t.isVolatile) {
|
|
31
|
+
const i = await e.getShareTokenAddress(r, t.erc20TokenAddress);
|
|
32
|
+
i && (t.sharedAddress = i);
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
})
|
|
36
|
+
), m.chains.push(r));
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
v as patchRegistry
|
|
40
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ethers as i, BigNumber as a } from "ethers";
|
|
2
|
-
import { transactionErrorCodes as c } from "
|
|
2
|
+
import { transactionErrorCodes as c } from "../../error-handling/error-codes.constants.mjs";
|
|
3
3
|
const h = (t) => i.utils.parseEther(t).toBigInt(), P = (t) => i.BigNumber.from(i.utils.randomBytes(t)).toBigInt(), f = (t, n) => i.utils.formatUnits(n, t.decimals), m = (t, n) => {
|
|
4
4
|
const r = 10 ** (18 - t.decimals);
|
|
5
5
|
try {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "../../../types/circom-data.types.mjs";
|
|
2
|
+
import { EventType as e } from "../../../types/hinkal.types.mjs";
|
|
3
|
+
import "../../../types/transactions.types.mjs";
|
|
4
|
+
import "../../../types/curve.types.mjs";
|
|
5
|
+
const p = () => {
|
|
6
|
+
document.dispatchEvent(new Event(e.BalanceChange));
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
p as balanceChangedHandler
|
|
10
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Utxo as C } from "
|
|
2
|
-
import "
|
|
3
|
-
import { ContractType as m } from "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import { getHinkalCache as O, setHinkalCache as P } from "
|
|
1
|
+
import { Utxo as C } from "../../../data-structures/utxo/Utxo.mjs";
|
|
2
|
+
import "../../../types/circom-data.types.mjs";
|
|
3
|
+
import { ContractType as m } from "../../../types/ethereum-network.types.mjs";
|
|
4
|
+
import "../../../types/transactions.types.mjs";
|
|
5
|
+
import "../../../types/curve.types.mjs";
|
|
6
|
+
import { getHinkalCache as O, setHinkalCache as P } from "../../utils/cacheFunctions.mjs";
|
|
7
7
|
const b = async (e, r, u, n, i = 0) => (await e.utxoUtils.buildBatchProcess(r, u)).reduce((s, t) => n && i !== 0 ? t.erc20TokenAddress.toLowerCase() === n.toLowerCase() && t.tokenId === i ? [...s, t] : s : n ? t.erc20TokenAddress.toLowerCase() === n.toLowerCase() ? [...s, t] : s : [...s, t], []), I = async (e, r, u, n, i, a, s, t = 0) => {
|
|
8
8
|
const o = await e.utxoUtils.batchFilterUtxosWithNullifier(r, u);
|
|
9
9
|
if (s) {
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { Mutex as A } from "async-mutex";
|
|
2
|
-
import { getERC20Registry as w } from "
|
|
3
|
-
import { Utxo as k } from "
|
|
4
|
-
import { customTokenRegistry as I } from "
|
|
5
|
-
import { getInputUtxoAndBalance as T } from "./
|
|
6
|
-
import { getAmountWithPrecision as U } from "
|
|
7
|
-
import { ErrorWithAmount as P } from "
|
|
2
|
+
import { getERC20Registry as w } from "../../../constants/token-data/ERC20Registry.mjs";
|
|
3
|
+
import { Utxo as k } from "../../../data-structures/utxo/Utxo.mjs";
|
|
4
|
+
import { customTokenRegistry as I } from "../../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
5
|
+
import { getInputUtxoAndBalance as T } from "./getInputUtxoAndBalance.mjs";
|
|
6
|
+
import { getAmountWithPrecision as U } from "../etherFunctions.mjs";
|
|
7
|
+
import { ErrorWithAmount as P } from "../../../error-handling/customErrors/ErrorWithAmount.mjs";
|
|
8
8
|
import "axios";
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
import "
|
|
9
|
+
import "../../../constants/chains.constants.mjs";
|
|
10
|
+
import "../../../types/circom-data.types.mjs";
|
|
11
|
+
import "../../../types/transactions.types.mjs";
|
|
12
|
+
import "../../../types/curve.types.mjs";
|
|
13
13
|
import "ethers";
|
|
14
|
-
import "
|
|
15
|
-
import "
|
|
16
|
-
import "
|
|
17
|
-
import "
|
|
18
|
-
import "
|
|
19
|
-
import "
|
|
20
|
-
import { caseInsensitiveEqual as h } from "
|
|
14
|
+
import "../../../webworker/workerFactory.mjs";
|
|
15
|
+
import "../../../data-structures/crypto-keys/keys.mjs";
|
|
16
|
+
import "../../../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
|
|
17
|
+
import "../../utils/external-action.utils.mjs";
|
|
18
|
+
import "../../../constants/coingecko.constants.mjs";
|
|
19
|
+
import "../../../constants/vite.constants.mjs";
|
|
20
|
+
import { caseInsensitiveEqual as h } from "../../utils/caseInsensitive.utils.mjs";
|
|
21
21
|
import "libsodium-wrappers";
|
|
22
22
|
import "circomlibjs";
|
|
23
|
-
import "
|
|
24
|
-
import "
|
|
25
|
-
import { VolatileHelper as b } from "
|
|
26
|
-
import "
|
|
27
|
-
import "
|
|
28
|
-
import "
|
|
29
|
-
import { getERC20Token as x } from "
|
|
30
|
-
import "
|
|
31
|
-
import "
|
|
32
|
-
import { patchRegistry as S } from "
|
|
23
|
+
import "../../../constants/reorg-depths.constants.mjs";
|
|
24
|
+
import "../../../constants/kyc.constants.mjs";
|
|
25
|
+
import { VolatileHelper as b } from "../../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
26
|
+
import "../../../constants/contracts.constants.mjs";
|
|
27
|
+
import "../../../constants/axelar.constants.mjs";
|
|
28
|
+
import "../../../constants/rewards.constants.mjs";
|
|
29
|
+
import { getERC20Token as x } from "../../utils/erc20tokenFunctions.mjs";
|
|
30
|
+
import "../../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
31
|
+
import "../../utils/userAgent.mjs";
|
|
32
|
+
import { patchRegistry as S } from "../../utils/volatile-patcher.utils.mjs";
|
|
33
33
|
const C = new A(), at = async (a) => {
|
|
34
34
|
const s = await C.acquire(), { inputUtxos: m } = await T({ hinkal: a, sliceIfMore6: !1 }), r = a.getCurrentChainId(), l = [...w(r), ...I.getCustomTokens(r)];
|
|
35
35
|
await S(r);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { networkRegistry as a } from "../../../constants/chains.constants.mjs";
|
|
2
|
+
import "../../../types/circom-data.types.mjs";
|
|
3
|
+
import { ContractType as c } from "../../../types/ethereum-network.types.mjs";
|
|
4
|
+
import "../../../types/transactions.types.mjs";
|
|
5
|
+
import "../../../types/curve.types.mjs";
|
|
6
|
+
import { ethToWei as m } from "../etherFunctions.mjs";
|
|
7
|
+
import "ethers";
|
|
8
|
+
import "circomlibjs";
|
|
9
|
+
import "../../../data-structures/crypto-keys/keys.mjs";
|
|
10
|
+
import "axios";
|
|
11
|
+
import "../../../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
|
|
12
|
+
import "../events/getShieldedBalance.mjs";
|
|
13
|
+
import "../../../webworker/workerFactory.mjs";
|
|
14
|
+
import "../../utils/external-action.utils.mjs";
|
|
15
|
+
import "../../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
16
|
+
import "../../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
17
|
+
import "../../../constants/coingecko.constants.mjs";
|
|
18
|
+
import "../../../constants/vite.constants.mjs";
|
|
19
|
+
import "../../utils/userAgent.mjs";
|
|
20
|
+
import "../../../constants/reorg-depths.constants.mjs";
|
|
21
|
+
import "../../../constants/kyc.constants.mjs";
|
|
22
|
+
import "../../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
23
|
+
import "libsodium-wrappers";
|
|
24
|
+
import "../../../constants/contracts.constants.mjs";
|
|
25
|
+
import "../../../constants/axelar.constants.mjs";
|
|
26
|
+
import "../../../constants/rewards.constants.mjs";
|
|
27
|
+
const J = async (t) => (await t.getContractWithFetcher(c.CrossChainAccessTokenContract).functions.hasToken(t.userKeys.getAccessKey()))[0], L = async (t, e) => {
|
|
28
|
+
const o = t.getContractWithSigner(c.CrossChainAccessTokenContract), s = a[t.getCurrentChainId()].accessTokenMintingFee ?? "0", n = {
|
|
29
|
+
value: m(s)
|
|
30
|
+
};
|
|
31
|
+
return await o.addToken(e, n);
|
|
32
|
+
}, N = async (t, e, o) => {
|
|
33
|
+
const s = t.getContractWithSigner(c.CrossChainAccessTokenContract), i = a[t.getCurrentChainId()].accessTokenMintingFee ?? "0", n = m(i), r = o.reduce(
|
|
34
|
+
(T, u) => T + u.messageFee,
|
|
35
|
+
0n
|
|
36
|
+
), p = {
|
|
37
|
+
chains: o,
|
|
38
|
+
totalMessageFees: r
|
|
39
|
+
}, C = {
|
|
40
|
+
value: n + r
|
|
41
|
+
};
|
|
42
|
+
return await s.addTokenCrossChain(e, p, C);
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
J as checkHinkalAccessToken,
|
|
46
|
+
L as mintAccessToken,
|
|
47
|
+
N as mintTokenCrossChain
|
|
48
|
+
};
|