@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
package/common249.mjs
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { utils as a } from "ethers";
|
|
2
|
-
import "./common28.mjs";
|
|
3
|
-
import "./common157.mjs";
|
|
4
|
-
import { ExternalActionId as i } from "./common159.mjs";
|
|
5
|
-
import { LidoAction as p } from "./common160.mjs";
|
|
6
|
-
import "./common164.mjs";
|
|
7
|
-
import "./common168.mjs";
|
|
8
|
-
import "circomlibjs";
|
|
9
|
-
import "./common51.mjs";
|
|
10
|
-
import "axios";
|
|
11
|
-
import "./common50.mjs";
|
|
12
|
-
import "./common139.mjs";
|
|
13
|
-
import "./common191.mjs";
|
|
14
|
-
import { getExternalActionIdHash as r } from "./common117.mjs";
|
|
15
|
-
import { getERC20TokenBySymbol as e } from "./common118.mjs";
|
|
16
|
-
import "./common121.mjs";
|
|
17
|
-
import "./common35.mjs";
|
|
18
|
-
import "./common33.mjs";
|
|
19
|
-
import "./common129.mjs";
|
|
20
|
-
import "./common42.mjs";
|
|
21
|
-
import "./common31.mjs";
|
|
22
|
-
import { TransactionType as d } from "./common76.mjs";
|
|
23
|
-
import { wstEthSymbol as l, stMaticSymbol as c, ethSymbol as s, maticSymbol as T } from "./common40.mjs";
|
|
24
|
-
import "./common77.mjs";
|
|
25
|
-
import "./common72.mjs";
|
|
26
|
-
import "libsodium-wrappers";
|
|
27
|
-
import "./common30.mjs";
|
|
28
|
-
import "./common36.mjs";
|
|
29
|
-
import "./common41.mjs";
|
|
30
|
-
const U = (t, A, o) => {
|
|
31
|
-
const n = a.defaultAbiCoder.decode(["uint8"], t.externalActionMetadata)[0];
|
|
32
|
-
let m;
|
|
33
|
-
return n === p.Request ? m = t.externalActionId.toBigInt() === r(i.LidoETH) || t.externalActionId.toBigInt() === r(i.LidoETHNFT) ? e(l, o) : e(c, o) : m = t.externalActionId.toBigInt() === r(i.LidoETH) || t.externalActionId.toBigInt() === r(i.LidoETHNFT) ? e(s, o) : e(T, o), {
|
|
34
|
-
lidoToken: {
|
|
35
|
-
token: m,
|
|
36
|
-
balance: t.amountChanges[1].toBigInt()
|
|
37
|
-
},
|
|
38
|
-
type: d.LIDO,
|
|
39
|
-
lidoAction: n
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export {
|
|
43
|
-
U as getLidoData
|
|
44
|
-
};
|
package/common250.mjs
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { TransactionType as P } from "./common76.mjs";
|
|
2
|
-
import "./common157.mjs";
|
|
3
|
-
import { ExternalActionId as h } from "./common159.mjs";
|
|
4
|
-
import { PendleAction as t } from "./common160.mjs";
|
|
5
|
-
import "./common164.mjs";
|
|
6
|
-
import "./common168.mjs";
|
|
7
|
-
import "./common28.mjs";
|
|
8
|
-
import "./common33.mjs";
|
|
9
|
-
import "./common30.mjs";
|
|
10
|
-
import "./common31.mjs";
|
|
11
|
-
import "./common35.mjs";
|
|
12
|
-
import "./common36.mjs";
|
|
13
|
-
import "./common41.mjs";
|
|
14
|
-
import "./common42.mjs";
|
|
15
|
-
import "ethers";
|
|
16
|
-
import "circomlibjs";
|
|
17
|
-
import "./common51.mjs";
|
|
18
|
-
import "axios";
|
|
19
|
-
import "./common50.mjs";
|
|
20
|
-
import "./common139.mjs";
|
|
21
|
-
import "./common191.mjs";
|
|
22
|
-
import { getActionFromMetadata as g } from "./common117.mjs";
|
|
23
|
-
import { getERC20Token as y } from "./common118.mjs";
|
|
24
|
-
import "./common121.mjs";
|
|
25
|
-
import "./common129.mjs";
|
|
26
|
-
import { toEnumValue as A } from "./common206.mjs";
|
|
27
|
-
import { txHistoryToBigInt as E } from "./common256.mjs";
|
|
28
|
-
import { TokenChecker as m } from "./common73.mjs";
|
|
29
|
-
import "./common77.mjs";
|
|
30
|
-
import "./common72.mjs";
|
|
31
|
-
import "libsodium-wrappers";
|
|
32
|
-
const oo = (r, p, T) => {
|
|
33
|
-
const k = g(h.Pendle, E(r)), e = A(t, k), s = [], a = [];
|
|
34
|
-
let c;
|
|
35
|
-
const l = p[0], f = p[1];
|
|
36
|
-
return r.amountChanges.forEach((u, d) => {
|
|
37
|
-
let n = u.toBigInt(), i = 0n;
|
|
38
|
-
(e === t.SwapToYt || e === t.Mint) && (n += l.amount, i = f.amount), e && [
|
|
39
|
-
t.Deposit,
|
|
40
|
-
t.Withdraw,
|
|
41
|
-
t.Redeem,
|
|
42
|
-
t.SwapFromYt,
|
|
43
|
-
t.Checkpoint
|
|
44
|
-
].includes(e) && (i = l.amount);
|
|
45
|
-
const o = y(r.erc20TokenAddresses[d], T) ?? {
|
|
46
|
-
erc20TokenAddress: r.erc20TokenAddresses[d]
|
|
47
|
-
};
|
|
48
|
-
"decimals" in o && m.isPendleToken(o) && !m.isPendleSyToken(o) ? a.push({ token: o, balance: n }) : "decimals" in o && m.isPendleSyToken(o) ? c = { token: o, balance: i } : s.push({ token: o, balance: n });
|
|
49
|
-
}), {
|
|
50
|
-
pendleTokens: a,
|
|
51
|
-
nonPendleTokens: s,
|
|
52
|
-
pendleAction: e,
|
|
53
|
-
syToken: c,
|
|
54
|
-
type: P.PENDLE
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
export {
|
|
58
|
-
oo as getPendleData
|
|
59
|
-
};
|
package/common29.mjs
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import "./common28.mjs";
|
|
2
|
-
import "./common157.mjs";
|
|
3
|
-
import { slippageLevels as A } from "./common163.mjs";
|
|
4
|
-
import "./common164.mjs";
|
|
5
|
-
import "./common168.mjs";
|
|
6
|
-
import { isDevelopment as m } from "./common33.mjs";
|
|
7
|
-
import "./common30.mjs";
|
|
8
|
-
import "./common31.mjs";
|
|
9
|
-
import "./common35.mjs";
|
|
10
|
-
import "./common36.mjs";
|
|
11
|
-
import "./common41.mjs";
|
|
12
|
-
import "./common42.mjs";
|
|
13
|
-
import "ethers";
|
|
14
|
-
import "circomlibjs";
|
|
15
|
-
import { absBigInt as s } from "./common114.mjs";
|
|
16
|
-
import "./common51.mjs";
|
|
17
|
-
import "axios";
|
|
18
|
-
import "./common50.mjs";
|
|
19
|
-
import "./common139.mjs";
|
|
20
|
-
import "./common191.mjs";
|
|
21
|
-
import "./common117.mjs";
|
|
22
|
-
import "./common72.mjs";
|
|
23
|
-
import "./common121.mjs";
|
|
24
|
-
import "./common129.mjs";
|
|
25
|
-
import "./common77.mjs";
|
|
26
|
-
import "libsodium-wrappers";
|
|
27
|
-
const c = 8n, u = 3n, a = (t) => t ? c : u, i = (t, o = !1) => {
|
|
28
|
-
const e = s(t);
|
|
29
|
-
return a(o) * e / 10000n;
|
|
30
|
-
}, g = (t, o) => {
|
|
31
|
-
const e = s(t), n = A[o];
|
|
32
|
-
return BigInt(Math.round(n * 100)) * e / 10000n;
|
|
33
|
-
}, f = (t, o = !1) => {
|
|
34
|
-
const e = s(t), n = i(e, o);
|
|
35
|
-
return e - n;
|
|
36
|
-
}, q = (t, o = !1) => s(t) * 10000n / (10000n - a(o)), F = (t, o, e = !1) => {
|
|
37
|
-
const n = s(t), r = s(o), p = f(n, e) - r;
|
|
38
|
-
return console.log("flatFee", { flatFeesAbs: r, afterFlatFee: p, totalFee: o + i(n, e) }), p;
|
|
39
|
-
}, b = (t, o) => {
|
|
40
|
-
const e = s(t), n = g(e, o);
|
|
41
|
-
return e - n;
|
|
42
|
-
}, z = (t, o, e, n = !1) => {
|
|
43
|
-
const r = s(t), p = s(o), l = b(r, e);
|
|
44
|
-
return F(l, p, n);
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
u as HINKAL_EXTERNAL_ACTION_FEE,
|
|
48
|
-
c as HINKAL_UNIVERSAL_FEE,
|
|
49
|
-
F as getAmountAfterRelayAndFlatFees,
|
|
50
|
-
z as getAmountAfterRelayAndFlatFeesAndSlippage,
|
|
51
|
-
f as getAmountAfterRelayFee,
|
|
52
|
-
b as getAmountAfterSlippage,
|
|
53
|
-
q as getAmountWithoutFee,
|
|
54
|
-
a as getHinkalFeeRateInBeeps,
|
|
55
|
-
i as getRelayFee,
|
|
56
|
-
g as getSlippageFee
|
|
57
|
-
};
|
package/common4.mjs
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import r from "axios";
|
|
2
|
-
import { getNonLocalhostChainId as m } from "./common28.mjs";
|
|
3
|
-
import "./common157.mjs";
|
|
4
|
-
import "./common164.mjs";
|
|
5
|
-
import "./common168.mjs";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "./common51.mjs";
|
|
9
|
-
import { getServerURL as n } from "./common2.mjs";
|
|
10
|
-
import "./common50.mjs";
|
|
11
|
-
import "./common139.mjs";
|
|
12
|
-
import "./common191.mjs";
|
|
13
|
-
import "./common117.mjs";
|
|
14
|
-
import "./common72.mjs";
|
|
15
|
-
import "./common121.mjs";
|
|
16
|
-
import "./common35.mjs";
|
|
17
|
-
import { API_CONFIG as e } from "./common32.mjs";
|
|
18
|
-
import "./common33.mjs";
|
|
19
|
-
import "./common129.mjs";
|
|
20
|
-
import "./common42.mjs";
|
|
21
|
-
import "./common31.mjs";
|
|
22
|
-
import "./common77.mjs";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "./common30.mjs";
|
|
25
|
-
import "./common36.mjs";
|
|
26
|
-
import "./common41.mjs";
|
|
27
|
-
const N = async (i, o) => {
|
|
28
|
-
const t = m(i), p = new URLSearchParams();
|
|
29
|
-
p.append("fromTokenAddress", o.fromTokenAddress), p.append("toTokenAddress", o.toTokenAddress), p.append("amount", `${o.amount}`), p.append("fromAddress", o.fromAddress), p.append("slippage", `${o.slippage}`), o.destReceiver && p.append("destReceiver", o.destReceiver), o.disableEstimate && p.append("disableEstimate", `${o.disableEstimate}`), o.allowPartialFill && p.append("allowPartialFill", `${o.allowPartialFill}`);
|
|
30
|
-
const a = {
|
|
31
|
-
url: `https://api.1inch.dev/swap/v5.2/${t}/swap?${p}`
|
|
32
|
-
};
|
|
33
|
-
return (await r.post(`${n(i)}${e.ROUTES.callOneInchAPI}`, a)).data.oneInchResponse;
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
N as callOneInchAPI
|
|
37
|
-
};
|
package/common5.mjs
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import m from "axios";
|
|
2
|
-
import "./common28.mjs";
|
|
3
|
-
import "./common157.mjs";
|
|
4
|
-
import "./common164.mjs";
|
|
5
|
-
import "./common168.mjs";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "./common51.mjs";
|
|
9
|
-
import { getServerURL as e } from "./common2.mjs";
|
|
10
|
-
import "./common50.mjs";
|
|
11
|
-
import "./common139.mjs";
|
|
12
|
-
import "./common191.mjs";
|
|
13
|
-
import "./common117.mjs";
|
|
14
|
-
import "./common72.mjs";
|
|
15
|
-
import "./common121.mjs";
|
|
16
|
-
import "./common35.mjs";
|
|
17
|
-
import { API_CONFIG as a } from "./common32.mjs";
|
|
18
|
-
import "./common33.mjs";
|
|
19
|
-
import "./common129.mjs";
|
|
20
|
-
import "./common42.mjs";
|
|
21
|
-
import "./common31.mjs";
|
|
22
|
-
import "./common77.mjs";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "./common30.mjs";
|
|
25
|
-
import "./common36.mjs";
|
|
26
|
-
import "./common41.mjs";
|
|
27
|
-
const E = async (t, r, o, i = "apys") => {
|
|
28
|
-
const p = {
|
|
29
|
-
id: t,
|
|
30
|
-
datePeriod: r,
|
|
31
|
-
dataType: i
|
|
32
|
-
};
|
|
33
|
-
return await m.post(`${e(o)}${a.ROUTES.beefyGraphAPI}`, p);
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
E as getBeefyHistoricalChartData
|
|
37
|
-
};
|
package/common55.mjs
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { utils as R } from "ethers";
|
|
2
|
-
import { getNonLocalhostChainId as U, networkRegistry as h, chainIds as d } from "./common28.mjs";
|
|
3
|
-
import "./common157.mjs";
|
|
4
|
-
import { ExternalActionId as P } from "./common159.mjs";
|
|
5
|
-
import { ConvexAction as g } from "./common160.mjs";
|
|
6
|
-
import "./common164.mjs";
|
|
7
|
-
import "./common168.mjs";
|
|
8
|
-
import { transactionErrorCodes as T } from "./common81.mjs";
|
|
9
|
-
import "circomlibjs";
|
|
10
|
-
import "./common51.mjs";
|
|
11
|
-
import "axios";
|
|
12
|
-
import "./common50.mjs";
|
|
13
|
-
import { addPaddingToUtxos as D } from "./common139.mjs";
|
|
14
|
-
import { outputUtxoProcessing as M } from "./common123.mjs";
|
|
15
|
-
import { constructZkProof as N } from "./common146.mjs";
|
|
16
|
-
import { estimateGasRelayer as O } from "./common229.mjs";
|
|
17
|
-
import { transactCallRelayer as S } from "./common230.mjs";
|
|
18
|
-
import "./common117.mjs";
|
|
19
|
-
import "./common72.mjs";
|
|
20
|
-
import "./common121.mjs";
|
|
21
|
-
import "./common35.mjs";
|
|
22
|
-
import "./common33.mjs";
|
|
23
|
-
import { processAmountChanges as F } from "./common125.mjs";
|
|
24
|
-
import { getFlatFees as b } from "./common126.mjs";
|
|
25
|
-
import "./common129.mjs";
|
|
26
|
-
import "./common42.mjs";
|
|
27
|
-
import "./common31.mjs";
|
|
28
|
-
import "./common191.mjs";
|
|
29
|
-
import "./common77.mjs";
|
|
30
|
-
import "libsodium-wrappers";
|
|
31
|
-
import "./common30.mjs";
|
|
32
|
-
import "./common36.mjs";
|
|
33
|
-
import "./common41.mjs";
|
|
34
|
-
const xt = async (t, i, o, C, n, x = !1) => {
|
|
35
|
-
const r = [...await D(t, i, o)], A = `swapperMO${o.length.toString()}x${r[0].length}x1`, s = U(t.getCurrentChainId());
|
|
36
|
-
console.log({ inputUtxosArray: r });
|
|
37
|
-
const a = P.Convex, { flatFees: c, feeUnit: I } = await b(
|
|
38
|
-
t.getCurrentChainId(),
|
|
39
|
-
i,
|
|
40
|
-
a,
|
|
41
|
-
o,
|
|
42
|
-
n
|
|
43
|
-
);
|
|
44
|
-
o = F({
|
|
45
|
-
erc20Addresses: i,
|
|
46
|
-
amountChanges: o,
|
|
47
|
-
flatFees: c,
|
|
48
|
-
feeUnit: I,
|
|
49
|
-
externalActionId: a,
|
|
50
|
-
action: n
|
|
51
|
-
}), console.log("new amount changes", { amountChanges: o });
|
|
52
|
-
const w = [g.StakeLP, g.UnStakeLP].includes(n) ? [!1, !1, ...s === d.ethMainnet ? [!0, !0] : [!0]] : [!1, ...s === d.ethMainnet ? [!0, !0] : [!0]], m = [];
|
|
53
|
-
for (let e = 0; e < i.length; e += 1) {
|
|
54
|
-
const { outputUtxos: L } = M(t.userKeys, r[e], o[e]);
|
|
55
|
-
m.push(L);
|
|
56
|
-
}
|
|
57
|
-
console.log({ outputUtxosArray: m });
|
|
58
|
-
const y = h[t.getCurrentChainId()].contractData.convexExternalActionInstanceAddress, E = R.defaultAbiCoder.encode(
|
|
59
|
-
["uint8", "uint256", "uint256", "uint256"],
|
|
60
|
-
[Number(n), C, r[0][0].amount, r[0][0].timeStamp]
|
|
61
|
-
), p = await t.getRandomRelay();
|
|
62
|
-
if (!p)
|
|
63
|
-
throw Error(T.RELAYER_NOT_AVAILABLE);
|
|
64
|
-
const { zkCallData: u, circomData: l, dimData: f } = await N(
|
|
65
|
-
t.merkleTreeHinkal,
|
|
66
|
-
t.merkleTreeAccessToken,
|
|
67
|
-
r,
|
|
68
|
-
m,
|
|
69
|
-
t.userKeys,
|
|
70
|
-
A,
|
|
71
|
-
a,
|
|
72
|
-
y,
|
|
73
|
-
E,
|
|
74
|
-
p,
|
|
75
|
-
t.getCurrentChainId(),
|
|
76
|
-
w,
|
|
77
|
-
c
|
|
78
|
-
);
|
|
79
|
-
return x ? await O(t, u, f, l) : await S(t.getCurrentChainId(), u, f, l);
|
|
80
|
-
};
|
|
81
|
-
export {
|
|
82
|
-
xt as hinkalActionConvex
|
|
83
|
-
};
|
package/common59.mjs
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { networkRegistry as R } from "./common28.mjs";
|
|
2
|
-
import "./common157.mjs";
|
|
3
|
-
import { ExternalActionId as n } from "./common159.mjs";
|
|
4
|
-
import "./common164.mjs";
|
|
5
|
-
import "./common168.mjs";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import { transactionErrorCodes as I } from "./common81.mjs";
|
|
8
|
-
import "circomlibjs";
|
|
9
|
-
import "./common51.mjs";
|
|
10
|
-
import "axios";
|
|
11
|
-
import "./common50.mjs";
|
|
12
|
-
import { addPaddingToUtxos as U } from "./common139.mjs";
|
|
13
|
-
import { outputUtxoProcessing as D } from "./common123.mjs";
|
|
14
|
-
import { constructZkProof as T } from "./common146.mjs";
|
|
15
|
-
import { estimateGasRelayer as b } from "./common229.mjs";
|
|
16
|
-
import { transactCallRelayer as F } from "./common230.mjs";
|
|
17
|
-
import "./common117.mjs";
|
|
18
|
-
import "./common72.mjs";
|
|
19
|
-
import "./common121.mjs";
|
|
20
|
-
import "./common35.mjs";
|
|
21
|
-
import "./common33.mjs";
|
|
22
|
-
import { processAmountChanges as L } from "./common125.mjs";
|
|
23
|
-
import { getFlatFees as M } from "./common126.mjs";
|
|
24
|
-
import "./common129.mjs";
|
|
25
|
-
import "./common42.mjs";
|
|
26
|
-
import "./common31.mjs";
|
|
27
|
-
import "./common191.mjs";
|
|
28
|
-
import "./common77.mjs";
|
|
29
|
-
import "libsodium-wrappers";
|
|
30
|
-
import "./common30.mjs";
|
|
31
|
-
import "./common36.mjs";
|
|
32
|
-
import "./common41.mjs";
|
|
33
|
-
const N = (t, o) => {
|
|
34
|
-
const { contractData: r } = R[t.getCurrentChainId()];
|
|
35
|
-
let e;
|
|
36
|
-
switch (o) {
|
|
37
|
-
case n.Uniswap:
|
|
38
|
-
e = r?.uniswapExternalActionAddress;
|
|
39
|
-
break;
|
|
40
|
-
case n.Odos:
|
|
41
|
-
e = r?.odosExternalActionInstanceAddress;
|
|
42
|
-
break;
|
|
43
|
-
case n.OneInch:
|
|
44
|
-
e = r?.oneInchExternalActionInstanceAddress;
|
|
45
|
-
break;
|
|
46
|
-
default:
|
|
47
|
-
e = r?.uniswapExternalActionAddress;
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
if (!e)
|
|
51
|
-
throw new Error("No external Address set during swap");
|
|
52
|
-
return e;
|
|
53
|
-
}, dt = async (t, o, r, e, u, A = !1, x = !1) => {
|
|
54
|
-
const { flatFees: p, feeUnit: w } = await M(
|
|
55
|
-
t.getCurrentChainId(),
|
|
56
|
-
o,
|
|
57
|
-
e,
|
|
58
|
-
r
|
|
59
|
-
);
|
|
60
|
-
r = L({ erc20Addresses: o, amountChanges: r, flatFees: p, feeUnit: w, externalActionId: e });
|
|
61
|
-
const E = N(t, e), s = {
|
|
62
|
-
externalActionId: e,
|
|
63
|
-
externalAddress: E,
|
|
64
|
-
externalActionMetadata: u
|
|
65
|
-
}, i = [...await U(t, o, r)], g = `swapperM${r.length.toString()}x${i[0].length}x1`, y = [!1, !0], m = [];
|
|
66
|
-
for (let a = 0; a < o.length; a += 1) {
|
|
67
|
-
const { outputUtxos: C } = D(t.userKeys, i[a], r[a]);
|
|
68
|
-
m.push(C);
|
|
69
|
-
}
|
|
70
|
-
const c = await t.getRandomRelay();
|
|
71
|
-
if (!c)
|
|
72
|
-
throw Error(I.RELAYER_NOT_AVAILABLE);
|
|
73
|
-
const { zkCallData: d, circomData: l, dimData: f } = await T(
|
|
74
|
-
t.merkleTreeHinkal,
|
|
75
|
-
t.merkleTreeAccessToken,
|
|
76
|
-
i,
|
|
77
|
-
m,
|
|
78
|
-
t.userKeys,
|
|
79
|
-
g,
|
|
80
|
-
s.externalActionId,
|
|
81
|
-
s.externalAddress,
|
|
82
|
-
s.externalActionMetadata,
|
|
83
|
-
c,
|
|
84
|
-
t.getCurrentChainId(),
|
|
85
|
-
y,
|
|
86
|
-
p
|
|
87
|
-
);
|
|
88
|
-
return A ? await b(t, d, f, l) : await F(
|
|
89
|
-
t.getCurrentChainId(),
|
|
90
|
-
d,
|
|
91
|
-
f,
|
|
92
|
-
l,
|
|
93
|
-
x
|
|
94
|
-
);
|
|
95
|
-
};
|
|
96
|
-
export {
|
|
97
|
-
dt as hinkalSwap
|
|
98
|
-
};
|
package/common6.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import o from "axios";
|
|
2
|
-
import "./common28.mjs";
|
|
3
|
-
import "./common157.mjs";
|
|
4
|
-
import "./common164.mjs";
|
|
5
|
-
import "./common168.mjs";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "./common51.mjs";
|
|
9
|
-
import "./common50.mjs";
|
|
10
|
-
import "./common139.mjs";
|
|
11
|
-
import "./common191.mjs";
|
|
12
|
-
import "./common117.mjs";
|
|
13
|
-
import "./common72.mjs";
|
|
14
|
-
import "./common121.mjs";
|
|
15
|
-
import "./common35.mjs";
|
|
16
|
-
import { getRelayerURL as i } from "./common14.mjs";
|
|
17
|
-
import { RELAYER_CONFIG as m } from "./common32.mjs";
|
|
18
|
-
import "./common33.mjs";
|
|
19
|
-
import "./common129.mjs";
|
|
20
|
-
import "./common42.mjs";
|
|
21
|
-
import "./common31.mjs";
|
|
22
|
-
import "./common77.mjs";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "./common30.mjs";
|
|
25
|
-
import "./common36.mjs";
|
|
26
|
-
import "./common41.mjs";
|
|
27
|
-
async function P(r, t) {
|
|
28
|
-
return (await o.post(`${i(r)}${m.TRANSACT}`, t)).data;
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
P as callRelayerTransactAPI
|
|
32
|
-
};
|
package/common61.mjs
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import "./common28.mjs";
|
|
2
|
-
import "./common157.mjs";
|
|
3
|
-
import { ExternalActionId as l } from "./common159.mjs";
|
|
4
|
-
import "./common164.mjs";
|
|
5
|
-
import "./common168.mjs";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import { transactionErrorCodes as T } from "./common81.mjs";
|
|
8
|
-
import { zeroAddress as I } from "./common34.mjs";
|
|
9
|
-
import "circomlibjs";
|
|
10
|
-
import "./common51.mjs";
|
|
11
|
-
import "axios";
|
|
12
|
-
import "./common50.mjs";
|
|
13
|
-
import { addPaddingToUtxos as y } from "./common139.mjs";
|
|
14
|
-
import { outputUtxoProcessing as D } from "./common123.mjs";
|
|
15
|
-
import { constructZkProof as U } from "./common146.mjs";
|
|
16
|
-
import { estimateGasRelayer as F } from "./common229.mjs";
|
|
17
|
-
import { transactCallRelayer as N } from "./common230.mjs";
|
|
18
|
-
import { transactCallDirect as R } from "./common231.mjs";
|
|
19
|
-
import "./common117.mjs";
|
|
20
|
-
import { getERC20Token as L } from "./common118.mjs";
|
|
21
|
-
import "./common121.mjs";
|
|
22
|
-
import "./common35.mjs";
|
|
23
|
-
import "./common33.mjs";
|
|
24
|
-
import { processAmountChanges as M } from "./common125.mjs";
|
|
25
|
-
import { getFlatFees as P } from "./common126.mjs";
|
|
26
|
-
import "./common129.mjs";
|
|
27
|
-
import "./common42.mjs";
|
|
28
|
-
import "./common31.mjs";
|
|
29
|
-
import "./common191.mjs";
|
|
30
|
-
import "./common77.mjs";
|
|
31
|
-
import "./common72.mjs";
|
|
32
|
-
import "libsodium-wrappers";
|
|
33
|
-
import "./common30.mjs";
|
|
34
|
-
import "./common36.mjs";
|
|
35
|
-
import "./common41.mjs";
|
|
36
|
-
const lt = async (t, i, r, u, e, A = !1) => {
|
|
37
|
-
const { flatFees: x, feeUnit: w } = await P(
|
|
38
|
-
t.getCurrentChainId(),
|
|
39
|
-
i,
|
|
40
|
-
l.Transact,
|
|
41
|
-
r
|
|
42
|
-
);
|
|
43
|
-
e || M({
|
|
44
|
-
erc20Addresses: i,
|
|
45
|
-
amountChanges: r,
|
|
46
|
-
flatFees: x,
|
|
47
|
-
feeUnit: w,
|
|
48
|
-
externalActionId: l.Transact
|
|
49
|
-
});
|
|
50
|
-
const a = L(i[0], t.getCurrentChainId());
|
|
51
|
-
if (!a)
|
|
52
|
-
throw Error("Deposit Action: No Token Found");
|
|
53
|
-
const n = {
|
|
54
|
-
externalActionId: 0n,
|
|
55
|
-
externalAddress: u,
|
|
56
|
-
externalActionMetadata: "0x00"
|
|
57
|
-
}, m = [...await y(t, i, r)], g = `swapperM${r.length.toString()}x${m[0].length}x1`, C = [!1], d = [];
|
|
58
|
-
for (let o = 0; o < i.length; o += 1) {
|
|
59
|
-
const { outputUtxos: E } = D(t.userKeys, m[o], r[o]);
|
|
60
|
-
d.push(E);
|
|
61
|
-
}
|
|
62
|
-
const f = await t.getRandomRelay();
|
|
63
|
-
if (!e && !f)
|
|
64
|
-
throw Error(T.RELAYER_NOT_AVAILABLE);
|
|
65
|
-
const { zkCallData: p, circomData: c, dimData: s } = await U(
|
|
66
|
-
t.merkleTreeHinkal,
|
|
67
|
-
t.merkleTreeAccessToken,
|
|
68
|
-
m,
|
|
69
|
-
d,
|
|
70
|
-
t.userKeys,
|
|
71
|
-
g,
|
|
72
|
-
n.externalActionId,
|
|
73
|
-
n.externalAddress,
|
|
74
|
-
n.externalActionMetadata,
|
|
75
|
-
e ? I : f,
|
|
76
|
-
t.getCurrentChainId(),
|
|
77
|
-
C,
|
|
78
|
-
x
|
|
79
|
-
);
|
|
80
|
-
if (A)
|
|
81
|
-
return await F(t, p, s, c);
|
|
82
|
-
if (e) {
|
|
83
|
-
if (!a)
|
|
84
|
-
throw Error("Withdraw Action: No Token Found");
|
|
85
|
-
return await R(t, r[0], a, p, c, s);
|
|
86
|
-
}
|
|
87
|
-
return await N(t.getCurrentChainId(), p, s, c);
|
|
88
|
-
};
|
|
89
|
-
export {
|
|
90
|
-
lt as hinkalWithdraw
|
|
91
|
-
};
|
package/common62.mjs
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { networkRegistry as A } from "./common28.mjs";
|
|
2
|
-
import "./common157.mjs";
|
|
3
|
-
import { ExternalActionId as g } from "./common159.mjs";
|
|
4
|
-
import "./common164.mjs";
|
|
5
|
-
import "./common168.mjs";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import { transactionErrorCodes as w } from "./common81.mjs";
|
|
8
|
-
import "circomlibjs";
|
|
9
|
-
import "./common51.mjs";
|
|
10
|
-
import "axios";
|
|
11
|
-
import "./common50.mjs";
|
|
12
|
-
import { addPaddingToUtxos as R } from "./common139.mjs";
|
|
13
|
-
import { outputUtxoProcessing as U } from "./common123.mjs";
|
|
14
|
-
import "./common191.mjs";
|
|
15
|
-
import "./common117.mjs";
|
|
16
|
-
import "./common72.mjs";
|
|
17
|
-
import "./common121.mjs";
|
|
18
|
-
import "./common35.mjs";
|
|
19
|
-
import "./common33.mjs";
|
|
20
|
-
import { processAmountChanges as C } from "./common125.mjs";
|
|
21
|
-
import "./common129.mjs";
|
|
22
|
-
import { estimateGasRelayer as I } from "./common229.mjs";
|
|
23
|
-
import { transactCallRelayer as P } from "./common230.mjs";
|
|
24
|
-
import "./common42.mjs";
|
|
25
|
-
import "./common31.mjs";
|
|
26
|
-
import "./common77.mjs";
|
|
27
|
-
import { constructEmporiumProof as T } from "./common147.mjs";
|
|
28
|
-
import "libsodium-wrappers";
|
|
29
|
-
import "./common30.mjs";
|
|
30
|
-
import "./common36.mjs";
|
|
31
|
-
import "./common41.mjs";
|
|
32
|
-
const pt = async (t, i, o, u, d = [], l, E = !1) => {
|
|
33
|
-
const e = i.map((r) => 0n);
|
|
34
|
-
o = C({ erc20Addresses: i, amountChanges: o, flatFees: e, feeUnit: void 0, externalActionId: g.Emporium });
|
|
35
|
-
const m = [...await R(t, i, o)], p = [];
|
|
36
|
-
for (let r = 0; r < i.length; r += 1) {
|
|
37
|
-
const { outputUtxos: y } = U(t.userKeys, m[r], o[r]);
|
|
38
|
-
p.push(y);
|
|
39
|
-
}
|
|
40
|
-
const a = await t.getRandomRelay();
|
|
41
|
-
if (!a)
|
|
42
|
-
throw Error(w.RELAYER_NOT_AVAILABLE);
|
|
43
|
-
const { contractData: x } = A[t.getCurrentChainId()], s = x.emporiumAddress;
|
|
44
|
-
if (!s)
|
|
45
|
-
throw Error("No Emporium Address Provided");
|
|
46
|
-
const { zkCallData: n, circomData: c, dimData: f } = await T(
|
|
47
|
-
t.merkleTreeHinkal,
|
|
48
|
-
t.merkleTreeAccessToken,
|
|
49
|
-
m,
|
|
50
|
-
p,
|
|
51
|
-
t.userKeys,
|
|
52
|
-
o.length,
|
|
53
|
-
m[0].length,
|
|
54
|
-
s,
|
|
55
|
-
d,
|
|
56
|
-
a,
|
|
57
|
-
t.getCurrentChainId(),
|
|
58
|
-
u,
|
|
59
|
-
e,
|
|
60
|
-
l
|
|
61
|
-
);
|
|
62
|
-
return E ? await I(t, n, f, c) : await P(t.getCurrentChainId(), n, f, c);
|
|
63
|
-
};
|
|
64
|
-
export {
|
|
65
|
-
pt as hinkalPrivateWallet
|
|
66
|
-
};
|
package/common63.mjs
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { networkRegistry as i } from "./common28.mjs";
|
|
2
|
-
import "./common157.mjs";
|
|
3
|
-
import { ContractType as r } from "./common158.mjs";
|
|
4
|
-
import "./common164.mjs";
|
|
5
|
-
import "./common168.mjs";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "./common51.mjs";
|
|
9
|
-
import "axios";
|
|
10
|
-
import "./common50.mjs";
|
|
11
|
-
import "./common139.mjs";
|
|
12
|
-
import "./common191.mjs";
|
|
13
|
-
import "./common117.mjs";
|
|
14
|
-
import "./common72.mjs";
|
|
15
|
-
import "./common121.mjs";
|
|
16
|
-
import "./common35.mjs";
|
|
17
|
-
import "./common33.mjs";
|
|
18
|
-
import "./common129.mjs";
|
|
19
|
-
import { ClientAccessTokenSnapshotService as m } from "./common232.mjs";
|
|
20
|
-
import { ClientCommitmentsSnapshotService as n } from "./common233.mjs";
|
|
21
|
-
import { ClientNullifierSnapshotService as c } from "./common234.mjs";
|
|
22
|
-
import "./common31.mjs";
|
|
23
|
-
import "./common77.mjs";
|
|
24
|
-
import "./common42.mjs";
|
|
25
|
-
import { balanceChangedHandler as o } from "./common141.mjs";
|
|
26
|
-
import "libsodium-wrappers";
|
|
27
|
-
import "./common30.mjs";
|
|
28
|
-
import "./common36.mjs";
|
|
29
|
-
import "./common41.mjs";
|
|
30
|
-
const j = async (e) => {
|
|
31
|
-
const { maxPageSize: t } = i[e.getCurrentChainId()];
|
|
32
|
-
e.commitmentsSnapshotService?.intervalClear(), e.commitmentsSnapshotService = new n(
|
|
33
|
-
e.getContractWithFetcher(r.HinkalContract),
|
|
34
|
-
t
|
|
35
|
-
), e.nullifierSnapshotService?.intervalClear(), e.nullifierSnapshotService = new c(
|
|
36
|
-
e.getContractWithFetcher(r.HinkalContract),
|
|
37
|
-
t
|
|
38
|
-
), e.accessTokenSnapshotService?.intervalClear(), e.accessTokenSnapshotService = new m(
|
|
39
|
-
e.getContractWithFetcher(r.CrossChainAccessTokenContract),
|
|
40
|
-
t
|
|
41
|
-
), await Promise.all([
|
|
42
|
-
e.commitmentsSnapshotService.init(),
|
|
43
|
-
e.nullifierSnapshotService.init(),
|
|
44
|
-
e.accessTokenSnapshotService.init()
|
|
45
|
-
]), e.merkleTreeHinkal = e.commitmentsSnapshotService.merkleTree, e.merkleTreeAccessToken = e.accessTokenSnapshotService.merkleTree, e.nullifiers = e.nullifierSnapshotService.nullifiers, e.encryptedOutputs = e.commitmentsSnapshotService.encryptedOutputs, e.commitmentsSnapshotService.onNewEvent = o, e.nullifierSnapshotService.onNewEvent = o;
|
|
46
|
-
};
|
|
47
|
-
export {
|
|
48
|
-
j as resetMerkleTrees
|
|
49
|
-
};
|