@hinkal/common 0.0.114 → 0.0.115
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/{index.js → common.mjs} +188 -188
- package/common10.mjs +30 -0
- package/common11.mjs +30 -0
- package/common112.mjs +48 -0
- package/common113.mjs +39 -0
- package/{functions/utils/cacheFunctions.js → common115.mjs} +22 -22
- package/{functions/utils/external-action.utils.js → common117.mjs} +6 -6
- package/{functions/utils/erc20tokenFunctions.js → common118.mjs} +2 -2
- package/{API/API.js → common12.mjs} +10 -10
- package/common121.mjs +16 -0
- package/{functions/pre-transaction/interaction-to-action.js → common122.mjs} +5 -5
- package/common123.mjs +45 -0
- package/common124.mjs +57 -0
- package/{functions/pre-transaction/processAmountChanges.js → common125.mjs} +27 -27
- package/{functions/pre-transaction/getFlatFees.js → common126.mjs} +25 -25
- package/common127.mjs +29 -0
- package/common128.mjs +38 -0
- package/{API/callCurveAPI.js → common13.mjs} +9 -9
- package/{functions/utils/getDataFromTransaction.js → common130.mjs} +21 -21
- package/common136.mjs +40 -0
- package/{functions/web3/etherFunctions.js → common137.mjs} +1 -1
- package/{functions/web3/events/getInputUtxoAndBalance.js → common138.mjs} +6 -6
- package/{functions/web3/events/getShieldedBalance.js → common139.mjs} +27 -27
- package/common14.mjs +32 -0
- package/common141.mjs +10 -0
- package/{functions/web3/uniswapAPI.js → common142.mjs} +25 -25
- package/common143.mjs +65 -0
- package/common144.mjs +61 -0
- package/{functions/web3/runContractFunction.js → common145.mjs} +22 -22
- package/{functions/snarkjs/constructGeneralZkProof.js → common146.mjs} +29 -29
- package/{functions/snarkjs/constructEmporiumProof.js → common147.mjs} +13 -13
- package/{functions/snarkjs/common.snarkjs.js → common148.mjs} +5 -5
- package/{functions/snarkjs/generateZkProof.js → common149.mjs} +4 -4
- package/common150.mjs +45 -0
- package/common151.mjs +41 -0
- package/{functions/protocols/pendle.helpers.js → common152.mjs} +26 -26
- package/{functions/staking/index.js → common153.mjs} +2 -2
- package/{functions/private-wallet/opProducer.js → common155.mjs} +3 -3
- package/common16.mjs +6 -0
- package/{types/curve.types.js → common168.mjs} +1 -1
- package/common170.mjs +85 -0
- package/{webworker/workerFactory.js → common191.mjs} +7 -7
- package/{API/getServerURL.js → common2.mjs} +21 -21
- package/{functions/kyc/zkMeHelper.js → common204.mjs} +4 -4
- package/common205.mjs +42 -0
- package/common208.mjs +62 -0
- package/{API/referralProgramCalls.js → common211.mjs} +22 -22
- package/common212.mjs +40 -0
- package/common213.mjs +45 -0
- package/common214.mjs +36 -0
- package/{API/kycCalls.js → common215.mjs} +2 -2
- package/common216.mjs +44 -0
- package/common217.mjs +32 -0
- package/common218.mjs +38 -0
- package/common220.mjs +32 -0
- package/common221.mjs +47 -0
- package/{functions/utils/memoize.utils.js → common222.mjs} +1 -1
- package/common223.mjs +30 -0
- package/common224.mjs +91 -0
- package/{data-structures/Hinkal/hinkalActionVolatile.js → common225.mjs} +32 -32
- package/{data-structures/Hinkal/hinkalActionPendleLP.js → common226.mjs} +29 -29
- package/common227.mjs +30 -0
- package/{data-structures/Hinkal/hinkalActionStake.js → common228.mjs} +31 -31
- package/{functions/web3/functionCalls/estimateGasRelayer.js → common229.mjs} +4 -4
- package/common230.mjs +42 -0
- package/common231.mjs +60 -0
- package/common232.mjs +48 -0
- package/common233.mjs +47 -0
- package/common234.mjs +44 -0
- package/common235.mjs +74 -0
- package/common237.mjs +60 -0
- package/common239.mjs +30 -0
- package/{functions/web3/functionCalls/approveToken.js → common241.mjs} +23 -23
- package/common242.mjs +31 -0
- package/common243.mjs +30 -0
- package/common244.mjs +68 -0
- package/common245.mjs +57 -0
- package/{data-structures/transactions-manager/history/getCurveData.js → common246.mjs} +23 -23
- package/common247.mjs +36 -0
- package/common248.mjs +43 -0
- package/common249.mjs +44 -0
- package/common250.mjs +59 -0
- package/{data-structures/transactions-manager/history/getVolatileData.js → common251.mjs} +25 -25
- package/{webworker/snarkjsWorker/snarkjsWorkerLogic.js → common252.mjs} +1 -1
- package/{webworker/zkProofWorker/zkProofWorkerLogic.js → common253.mjs} +8 -8
- package/{webworker/utxoWorker/utxoWorkerLogic.js → common254.mjs} +8 -8
- package/{functions/snarkjs/constant.js → common255.mjs} +21 -21
- package/{constants/chains.constants.js → common28.mjs} +12 -12
- package/{constants/fees.constants.js → common29.mjs} +22 -22
- package/{API/getCoingeckoPrice.js → common3.mjs} +1 -1
- package/{constants/contracts.constants.js → common30.mjs} +30 -30
- package/{constants/kyc.constants.js → common31.mjs} +3 -3
- package/{constants/vite.constants.js → common33.mjs} +2 -2
- package/{constants/coingecko.constants.js → common35.mjs} +1 -1
- package/{constants/axelar.constants.js → common36.mjs} +9 -9
- package/{constants/crvCvx.registry.js → common38.mjs} +1 -1
- package/{constants/crvDynamic.registry.js → common39.mjs} +1 -1
- package/common4.mjs +37 -0
- package/{constants/rewards.constants.js → common41.mjs} +4 -4
- package/{constants/reorg-depths.constants.js → common42.mjs} +1 -1
- package/{constants/beefy.registry.js → common43.mjs} +1 -1
- package/{constants/pendle.registry.js → common44.mjs} +2 -2
- package/{crypto/poseidon.js → common45.mjs} +1 -1
- package/{crypto/preProcessing.js → common47.mjs} +2 -2
- package/{data-structures/crypto-keys/decodeUTXO.js → common49.mjs} +2 -2
- package/common5.mjs +37 -0
- package/{data-structures/crypto-keys/encryptDecryptUtxo.js → common50.mjs} +2 -2
- package/{data-structures/crypto-keys/keys.js → common51.mjs} +5 -5
- package/{data-structures/crypto-keys/keyUtils.js → common52.mjs} +1 -1
- package/{data-structures/Hinkal/Hinkal.js → common53.mjs} +46 -46
- package/{data-structures/Hinkal/hinkalActionBeefy.js → common54.mjs} +29 -29
- package/common55.mjs +83 -0
- package/{data-structures/Hinkal/hinkalActionCurve.js → common56.mjs} +32 -32
- package/{data-structures/Hinkal/hinkalActionPendle.js → common57.mjs} +33 -33
- package/{data-structures/Hinkal/hinkalDeposit.js → common58.mjs} +27 -27
- package/common59.mjs +98 -0
- package/common6.mjs +32 -0
- package/common61.mjs +91 -0
- package/common62.mjs +66 -0
- package/common63.mjs +49 -0
- package/{data-structures/merkle-tree/MerkleTree.js → common64.mjs} +22 -22
- package/{data-structures/event-service/AbstractAccessTokenSnapshotService.js → common66.mjs} +25 -25
- package/{data-structures/event-service/AbstractCommitmentsSnapshotService.js → common67.mjs} +24 -24
- package/{data-structures/event-service/AbstractNullifierSnapshotService.js → common68.mjs} +1 -1
- package/{data-structures/event-service/AbstractSnapshotService.js → common69.mjs} +1 -1
- package/common7.mjs +37 -0
- package/{data-structures/event-service/AbstractEventService.js → common70.mjs} +21 -21
- package/{data-structures/utxo/Utxo.js → common71.mjs} +4 -4
- package/{data-structures/token-price-fetcher/TokenChecker.js → common73.mjs} +3 -3
- package/{data-structures/token-price-fetcher/TokenPriceFetcher.js → common74.mjs} +32 -32
- package/{data-structures/transactions-manager/TransactionsManager.js → common75.mjs} +27 -27
- package/{data-structures/transactions-manager/history/history.types.js → common76.mjs} +21 -21
- package/{data-structures/volatile-helper/VolatileHelper.js → common77.mjs} +25 -25
- package/{data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.js → common78.mjs} +23 -23
- package/{error-handling/customErrors/FeeOverTransactionValueError.js → common79.mjs} +1 -1
- package/common8.mjs +38 -0
- package/{error-handling/customErrors/customErrors.helpers.js → common80.mjs} +5 -5
- package/{error-handling/get-error.message.js → common82.mjs} +5 -5
- package/common83.mjs +35 -0
- package/{error-handling/logError.js → common84.mjs} +1 -1
- package/common9.mjs +41 -0
- package/package.json +3 -3
- package/API/HinkalPointsCalls.js +0 -38
- package/API/callBeefyGraphAPI.js +0 -37
- package/API/callMonitor.js +0 -30
- package/API/callOdosAPI.js +0 -44
- package/API/callOneInchAPI.js +0 -37
- package/API/callRelayer.js +0 -32
- package/API/checkRisk.js +0 -30
- package/API/dataServerCalls.js +0 -32
- package/API/fetchCommitmentsCache.js +0 -31
- package/API/fetchNullifiers.js +0 -30
- package/API/getAxelarGasEstimate.js +0 -37
- package/API/getConnextReceiveFee.js +0 -30
- package/API/getGasEstimates.js +0 -38
- package/API/getRelayerURL.js +0 -32
- package/API/getTokenPrice.js +0 -41
- package/API/passwordCalls.js +0 -36
- package/API/relayCalls.js +0 -30
- package/API/restoreSnapshots.js +0 -32
- package/API/rewardsPointsCalls.js +0 -40
- package/API/userVerifyTransactions.js +0 -45
- package/constants/token-data/ERC20Registry.js +0 -85
- package/constants/token-data/index.js +0 -6
- package/data-structures/Hinkal/hinkalActionConvex.js +0 -83
- package/data-structures/Hinkal/hinkalActionLidoEth.js +0 -91
- package/data-structures/Hinkal/hinkalGetZkMeProvider.js +0 -47
- package/data-structures/Hinkal/hinkalPrivateWallet.js +0 -66
- package/data-structures/Hinkal/hinkalSwap.js +0 -98
- package/data-structures/Hinkal/hinkalWithdraw.js +0 -91
- package/data-structures/Hinkal/resetMerkleTrees.js +0 -49
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.js +0 -48
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.js +0 -47
- package/data-structures/snapshot/ClientNullifierSnapshotService.js +0 -44
- package/data-structures/transactions-manager/history/getBeefyData.js +0 -68
- package/data-structures/transactions-manager/history/getConvexData.js +0 -57
- package/data-structures/transactions-manager/history/getDepositData.js +0 -36
- package/data-structures/transactions-manager/history/getLidoData.js +0 -44
- package/data-structures/transactions-manager/history/getPendleData.js +0 -59
- package/data-structures/transactions-manager/history/getSwapData.js +0 -43
- package/data-structures/transactions-manager/history/getTxDetails.js +0 -74
- package/error-handling/handleErrorRestore.js +0 -35
- package/functions/kyc/authentoHelper.js +0 -42
- package/functions/kyc/passportHelper.js +0 -39
- package/functions/pre-transaction/outputUtxoProcessing.js +0 -45
- package/functions/pre-transaction/process-gas-estimates.js +0 -57
- package/functions/protocols/convex.protocols.js +0 -41
- package/functions/protocols/curve.protocols.js +0 -45
- package/functions/snarkjs/generateCircomData.js +0 -60
- package/functions/snarkjs/getZKFiles.js +0 -30
- package/functions/utils/axelar.utils.js +0 -38
- package/functions/utils/convertIntegrationProviderToExternalActionId.js +0 -16
- package/functions/utils/evmNetworkFunctions.js +0 -29
- package/functions/utils/volatile-patcher.utils.js +0 -40
- package/functions/web3/events/balanceChangedHandler.js +0 -10
- package/functions/web3/functionCalls/accessTokenCalls.js +0 -48
- package/functions/web3/functionCalls/transactCallDirect.js +0 -60
- package/functions/web3/functionCalls/transactCallRelayer.js +0 -42
- package/functions/web3/odosAPI.js +0 -65
- package/functions/web3/oneInchAPI.js +0 -61
- package/webworker/performTaskWithWorker.js +0 -62
- /package/{externalABIs/WETH.js → common100.mjs} +0 -0
- /package/{externalABIs/ISwapRouter.json.js → common101.mjs} +0 -0
- /package/{externalABIs/LidoStEthAbi.json.js → common102.mjs} +0 -0
- /package/{externalABIs/LidoStMaticAbi.json.js → common103.mjs} +0 -0
- /package/{externalABIs/LidoWithdrawalQueueERC721Abi.json.js → common104.mjs} +0 -0
- /package/{externalABIs/PoLidoNftAbi.json.js → common105.mjs} +0 -0
- /package/{externalABIs/LidoWstEthAbi.json.js → common106.mjs} +0 -0
- /package/{externalABIs/LidoStakeManagerAbi.json.js → common107.mjs} +0 -0
- /package/{externalABIs/transactionsProver.json.js → common108.mjs} +0 -0
- /package/{externalABIs/BabPassport.json.js → common109.mjs} +0 -0
- /package/{externalABIs/GalxePassport.json.js → common110.mjs} +0 -0
- /package/{externalABIs/OptimismGasPriceOracle.json.js → common111.mjs} +0 -0
- /package/{functions/utils/amounts.utils.js → common114.mjs} +0 -0
- /package/{functions/utils/create-provider.js → common116.mjs} +0 -0
- /package/{functions/utils/requireEnv.js → common119.mjs} +0 -0
- /package/{functions/utils/resolve-sync.utils.js → common120.mjs} +0 -0
- /package/{functions/utils/userAgent.js → common129.mjs} +0 -0
- /package/{functions/utils/reloadPage.js → common131.mjs} +0 -0
- /package/{functions/utils/string.utils.js → common132.mjs} +0 -0
- /package/{functions/utils/nickname.utils.js → common133.mjs} +0 -0
- /package/{functions/utils/caseInsensitive.utils.js → common134.mjs} +0 -0
- /package/{functions/utils/time.utils.js → common135.mjs} +0 -0
- /package/{functions/web3/events/web3RetrieveEvents.js → common140.mjs} +0 -0
- /package/{constants/assets.constants.js → common15.mjs} +0 -0
- /package/{functions/private-wallet/emporium.helpers.js → common154.mjs} +0 -0
- /package/{types/beefy.types.js → common156.mjs} +0 -0
- /package/{types/circom-data.types.js → common157.mjs} +0 -0
- /package/{types/ethereum-network.types.js → common158.mjs} +0 -0
- /package/{types/external-action.types.js → common159.mjs} +0 -0
- /package/{types/hinkal.types.js → common160.mjs} +0 -0
- /package/{types/kyc.types.js → common161.mjs} +0 -0
- /package/{types/token.types.js → common162.mjs} +0 -0
- /package/{types/slippage.types.js → common163.mjs} +0 -0
- /package/{types/transactions.types.js → common164.mjs} +0 -0
- /package/{types/time.types.js → common165.mjs} +0 -0
- /package/{types/rewards.types.js → common166.mjs} +0 -0
- /package/{types/pendle.types.js → common167.mjs} +0 -0
- /package/{types/hinkal.stake.types.js → common169.mjs} +0 -0
- /package/{constants/deploy-data/deploy-data-bnbMainnet.json.js → common17.mjs} +0 -0
- /package/{constants/token-data/ethMainnetRegistryFixed.json.js → common171.mjs} +0 -0
- /package/{constants/token-data/arbMainnetRegistryFixed.json.js → common172.mjs} +0 -0
- /package/{constants/token-data/bnbMainnetRegistry.json.js → common173.mjs} +0 -0
- /package/{constants/token-data/polygonRegistryFixed.json.js → common174.mjs} +0 -0
- /package/{constants/token-data/avalancheRegistry.json.js → common175.mjs} +0 -0
- /package/{constants/token-data/optimismRegistryFixed.json.js → common176.mjs} +0 -0
- /package/{constants/token-data/baseRegistryFixed.json.js → common177.mjs} +0 -0
- /package/{constants/token-data/blastRegistry.json.js → common178.mjs} +0 -0
- /package/{constants/token-data/ethMainnetRegistry.json.js → common179.mjs} +0 -0
- /package/{constants/deploy-data/deploy-data-arbMainnet.json.js → common18.mjs} +0 -0
- /package/{constants/token-data/arbMainnetRegistry.json.js → common180.mjs} +0 -0
- /package/{constants/token-data/bnbMainnetRegistryFixed.json.js → common181.mjs} +0 -0
- /package/{constants/token-data/polygonRegistry.json.js → common182.mjs} +0 -0
- /package/{constants/token-data/avalancheRegistryFixed.json.js → common183.mjs} +0 -0
- /package/{constants/token-data/optimismRegistry.json.js → common184.mjs} +0 -0
- /package/{constants/token-data/baseRegistry.json.js → common185.mjs} +0 -0
- /package/{constants/token-data/blastRegistryFixed.json.js → common186.mjs} +0 -0
- /package/{constants/token-data/localhostRegistry.json.js → common187.mjs} +0 -0
- /package/{constants/token-data/tokenPricing.consts.js → common188.mjs} +0 -0
- /package/{constants/token-data/popularTokens.constants.js → common189.mjs} +0 -0
- /package/{constants/deploy-data/deploy-data-ethMainnet.json.js → common19.mjs} +0 -0
- /package/{constants/token-data/coingeckoRegistry.json.js → common190.mjs} +0 -0
- /package/{externalABIs/BeefyRouterAbi.json.js → common192.mjs} +0 -0
- /package/{externalABIs/BeefyStrategyAbi.json.js → common193.mjs} +0 -0
- /package/{externalABIs/BeefyZapAbi.json.js → common194.mjs} +0 -0
- /package/{externalABIs/BeefyZapOneInchAbi.json.js → common195.mjs} +0 -0
- /package/{externalABIs/ConvexBoosterAbi.json.js → common196.mjs} +0 -0
- /package/{externalABIs/ConvexBoosterAbiMainnet.json.js → common197.mjs} +0 -0
- /package/{externalABIs/ConvexRewardPoolAbi.json.js → common198.mjs} +0 -0
- /package/{externalABIs/CurveZap.json.js → common199.mjs} +0 -0
- /package/{constants/deploy-data/deploy-data-optimism.json.js → common20.mjs} +0 -0
- /package/{externalABIs/CvxCrvUtilities.json.js → common200.mjs} +0 -0
- /package/{externalABIs/PendleRouterAbi.json.js → common201.mjs} +0 -0
- /package/{externalABIs/IUniswapV3Pool.json.js → common202.mjs} +0 -0
- /package/{externalABIs/UniswapV2PoolAbi.json.js → common203.mjs} +0 -0
- /package/{functions/utils/enum.utils.js → common206.mjs} +0 -0
- /package/{functions/utils/process.utils.js → common207.mjs} +0 -0
- /package/{webworker/worker.registry.js → common209.mjs} +0 -0
- /package/{constants/deploy-data/deploy-data-polygon.json.js → common21.mjs} +0 -0
- /package/{webworker/utxoWorker/utxoWorker.types.js → common210.mjs} +0 -0
- /package/{error-handling/customErrors/ErrorWithAmount.js → common219.mjs} +0 -0
- /package/{constants/deploy-data/deploy-data-avalanche.json.js → common22.mjs} +0 -0
- /package/{constants/deploy-data/deploy-data-base.json.js → common23.mjs} +0 -0
- /package/{webworker/zkProofWorker/zkProofWorker.types.js → common236.mjs} +0 -0
- /package/{webworker/snarkjsWorker/snarkjsWorker.types.js → common238.mjs} +0 -0
- /package/{constants/deploy-data/deploy-data-blast.json.js → common24.mjs} +0 -0
- /package/{functions/utils/serialize.utils.js → common240.mjs} +0 -0
- /package/{constants/deploy-data/deploy-data-localhost.json.js → common25.mjs} +0 -0
- /package/{data-structures/transactions-manager/history/history.utils.js → common256.mjs} +0 -0
- /package/{webworker/workerProxy.js → common257.mjs} +0 -0
- /package/{constants/deploy-data/deploy-data-axelar1.json.js → common26.mjs} +0 -0
- /package/{constants/deploy-data/deploy-data-axelar2.json.js → common27.mjs} +0 -0
- /package/{constants/server.constants.js → common32.mjs} +0 -0
- /package/{constants/protocol.constants.js → common34.mjs} +0 -0
- /package/{constants/backend.constants.js → common37.mjs} +0 -0
- /package/{constants/lido.constants.js → common40.mjs} +0 -0
- /package/{crypto/babyJub.js → common46.mjs} +0 -0
- /package/{data-structures/ValueCache/ValueCache.js → common48.mjs} +0 -0
- /package/{data-structures/Hinkal/hinkalTransfer.js → common60.mjs} +0 -0
- /package/{data-structures/merkle-tree/MerkleTreeIncompleteError.js → common65.mjs} +0 -0
- /package/{data-structures/custom-token-registry/CustomTokenRegistry.js → common72.mjs} +0 -0
- /package/{error-handling/error-codes.constants.js → common81.mjs} +0 -0
- /package/{error-handling/types.js → common85.mjs} +0 -0
- /package/{externalABIs/amToken.js → common86.mjs} +0 -0
- /package/{externalABIs/BeefyVaultAbi.json.js → common87.mjs} +0 -0
- /package/{externalABIs/BUSD.js → common88.mjs} +0 -0
- /package/{externalABIs/CurveReadingWrapperAbi.json.js → common89.mjs} +0 -0
- /package/{externalABIs/CurveWrappedMainPool.json.js → common90.mjs} +0 -0
- /package/{externalABIs/DAI.js → common91.mjs} +0 -0
- /package/{externalABIs/ERC20.json.js → common92.mjs} +0 -0
- /package/{externalABIs/IQuoterV2.json.js → common93.mjs} +0 -0
- /package/{externalABIs/IUniswapV3Factory.json.js → common94.mjs} +0 -0
- /package/{externalABIs/SanctionsList.js → common95.mjs} +0 -0
- /package/{externalABIs/USDC.js → common96.mjs} +0 -0
- /package/{externalABIs/USDR.js → common97.mjs} +0 -0
- /package/{externalABIs/USDR3CRV.js → common98.mjs} +0 -0
- /package/{externalABIs/USDT.js → common99.mjs} +0 -0
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { networkRegistry as o } from "./arbMainnetRegistry.json.js";
|
|
2
|
-
import { networkRegistry as i } from "./arbMainnetRegistryFixed.json.js";
|
|
3
|
-
import { networkRegistry as n } from "./avalancheRegistry.json.js";
|
|
4
|
-
import { networkRegistry as a } from "./avalancheRegistryFixed.json.js";
|
|
5
|
-
import { networkRegistry as k } from "./bnbMainnetRegistry.json.js";
|
|
6
|
-
import { networkRegistry as g } from "./bnbMainnetRegistryFixed.json.js";
|
|
7
|
-
import { networkRegistry as m } from "./ethMainnetRegistry.json.js";
|
|
8
|
-
import { networkRegistry as s } from "./ethMainnetRegistryFixed.json.js";
|
|
9
|
-
import { networkRegistry as y } from "./localhostRegistry.json.js";
|
|
10
|
-
import { networkRegistry as R } from "./optimismRegistry.json.js";
|
|
11
|
-
import { networkRegistry as w } from "./optimismRegistryFixed.json.js";
|
|
12
|
-
import { networkRegistry as c } from "./baseRegistry.json.js";
|
|
13
|
-
import { networkRegistry as p } from "./baseRegistryFixed.json.js";
|
|
14
|
-
import { networkRegistry as f } from "./polygonRegistry.json.js";
|
|
15
|
-
import { networkRegistry as b } from "./polygonRegistryFixed.json.js";
|
|
16
|
-
import { networkRegistry as $ } from "./blastRegistry.json.js";
|
|
17
|
-
import { networkRegistry as u } from "./blastRegistryFixed.json.js";
|
|
18
|
-
import { chainIds as r } from "../chains.constants.js";
|
|
19
|
-
const J = (t) => {
|
|
20
|
-
switch (t) {
|
|
21
|
-
case r.polygon:
|
|
22
|
-
return f;
|
|
23
|
-
case r.arbMainnet:
|
|
24
|
-
return o;
|
|
25
|
-
case r.ethMainnet:
|
|
26
|
-
return m;
|
|
27
|
-
case r.bnbMainnet:
|
|
28
|
-
return k;
|
|
29
|
-
case r.avalanche:
|
|
30
|
-
return n;
|
|
31
|
-
case r.optimism:
|
|
32
|
-
return R;
|
|
33
|
-
case r.base:
|
|
34
|
-
return c;
|
|
35
|
-
case r.blast:
|
|
36
|
-
return $;
|
|
37
|
-
default:
|
|
38
|
-
return y;
|
|
39
|
-
}
|
|
40
|
-
}, K = (t) => {
|
|
41
|
-
let e;
|
|
42
|
-
switch (t) {
|
|
43
|
-
case r.polygon: {
|
|
44
|
-
e = b;
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
case r.arbMainnet: {
|
|
48
|
-
e = i;
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
case r.ethMainnet: {
|
|
52
|
-
e = s;
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
case r.avalanche: {
|
|
56
|
-
e = a;
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
case r.bnbMainnet: {
|
|
60
|
-
e = g;
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
case r.optimism: {
|
|
64
|
-
e = w;
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
case r.base: {
|
|
68
|
-
e = p;
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
case r.blast: {
|
|
72
|
-
e = u;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
default: {
|
|
76
|
-
e = s;
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return e;
|
|
81
|
-
};
|
|
82
|
-
export {
|
|
83
|
-
J as getERC20Registry,
|
|
84
|
-
K as getFixedRegistry
|
|
85
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { utils as R } from "ethers";
|
|
2
|
-
import { getNonLocalhostChainId as U, networkRegistry as h, chainIds as d } from "../../constants/chains.constants.js";
|
|
3
|
-
import "../../types/circom-data.types.js";
|
|
4
|
-
import { ExternalActionId as P } from "../../types/external-action.types.js";
|
|
5
|
-
import { ConvexAction as g } from "../../types/hinkal.types.js";
|
|
6
|
-
import "../../types/transactions.types.js";
|
|
7
|
-
import "../../types/curve.types.js";
|
|
8
|
-
import { transactionErrorCodes as T } from "../../error-handling/error-codes.constants.js";
|
|
9
|
-
import "circomlibjs";
|
|
10
|
-
import "../crypto-keys/keys.js";
|
|
11
|
-
import "axios";
|
|
12
|
-
import "../crypto-keys/encryptDecryptUtxo.js";
|
|
13
|
-
import { addPaddingToUtxos as D } from "../../functions/web3/events/getShieldedBalance.js";
|
|
14
|
-
import { outputUtxoProcessing as M } from "../../functions/pre-transaction/outputUtxoProcessing.js";
|
|
15
|
-
import { constructZkProof as N } from "../../functions/snarkjs/constructGeneralZkProof.js";
|
|
16
|
-
import { estimateGasRelayer as O } from "../../functions/web3/functionCalls/estimateGasRelayer.js";
|
|
17
|
-
import { transactCallRelayer as S } from "../../functions/web3/functionCalls/transactCallRelayer.js";
|
|
18
|
-
import "../../functions/utils/external-action.utils.js";
|
|
19
|
-
import "../custom-token-registry/CustomTokenRegistry.js";
|
|
20
|
-
import "../../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
21
|
-
import "../../constants/coingecko.constants.js";
|
|
22
|
-
import "../../constants/vite.constants.js";
|
|
23
|
-
import { processAmountChanges as F } from "../../functions/pre-transaction/processAmountChanges.js";
|
|
24
|
-
import { getFlatFees as b } from "../../functions/pre-transaction/getFlatFees.js";
|
|
25
|
-
import "../../functions/utils/userAgent.js";
|
|
26
|
-
import "../../constants/reorg-depths.constants.js";
|
|
27
|
-
import "../../constants/kyc.constants.js";
|
|
28
|
-
import "../../webworker/workerFactory.js";
|
|
29
|
-
import "../volatile-helper/VolatileHelper.js";
|
|
30
|
-
import "libsodium-wrappers";
|
|
31
|
-
import "../../constants/contracts.constants.js";
|
|
32
|
-
import "../../constants/axelar.constants.js";
|
|
33
|
-
import "../../constants/rewards.constants.js";
|
|
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
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { ethers as M } from "ethers";
|
|
2
|
-
import { networkRegistry as U } from "../../constants/chains.constants.js";
|
|
3
|
-
import "../../types/circom-data.types.js";
|
|
4
|
-
import { ExternalActionId as m } from "../../types/external-action.types.js";
|
|
5
|
-
import { LidoAction as s, LidoVariant as u } from "../../types/hinkal.types.js";
|
|
6
|
-
import "../../types/transactions.types.js";
|
|
7
|
-
import "../../types/curve.types.js";
|
|
8
|
-
import { transactionErrorCodes as N } from "../../error-handling/error-codes.constants.js";
|
|
9
|
-
import "circomlibjs";
|
|
10
|
-
import "../crypto-keys/keys.js";
|
|
11
|
-
import "axios";
|
|
12
|
-
import "../crypto-keys/encryptDecryptUtxo.js";
|
|
13
|
-
import { addPaddingToUtxos as D } from "../../functions/web3/events/getShieldedBalance.js";
|
|
14
|
-
import { outputUtxoProcessing as P } from "../../functions/pre-transaction/outputUtxoProcessing.js";
|
|
15
|
-
import { constructZkProof as H } from "../../functions/snarkjs/constructGeneralZkProof.js";
|
|
16
|
-
import { estimateGasRelayer as S } from "../../functions/web3/functionCalls/estimateGasRelayer.js";
|
|
17
|
-
import { transactCallRelayer as b } from "../../functions/web3/functionCalls/transactCallRelayer.js";
|
|
18
|
-
import "../../functions/utils/external-action.utils.js";
|
|
19
|
-
import "../custom-token-registry/CustomTokenRegistry.js";
|
|
20
|
-
import "../../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
21
|
-
import "../../constants/coingecko.constants.js";
|
|
22
|
-
import "../../constants/vite.constants.js";
|
|
23
|
-
import { processAmountChanges as v } from "../../functions/pre-transaction/processAmountChanges.js";
|
|
24
|
-
import { getFlatFees as K } from "../../functions/pre-transaction/getFlatFees.js";
|
|
25
|
-
import "../../functions/utils/userAgent.js";
|
|
26
|
-
import "../../constants/reorg-depths.constants.js";
|
|
27
|
-
import "../../constants/kyc.constants.js";
|
|
28
|
-
import "../../webworker/workerFactory.js";
|
|
29
|
-
import "../volatile-helper/VolatileHelper.js";
|
|
30
|
-
import "libsodium-wrappers";
|
|
31
|
-
import "../../constants/contracts.constants.js";
|
|
32
|
-
import "../../constants/axelar.constants.js";
|
|
33
|
-
import "../../constants/rewards.constants.js";
|
|
34
|
-
const _ = (t, i) => {
|
|
35
|
-
if (t === u.Ethereum)
|
|
36
|
-
return i === s.Stake ? m.LidoETH : m.LidoETHNFT;
|
|
37
|
-
if (t === u.Polygon)
|
|
38
|
-
return i === s.Stake ? m.LidoMATIC : m.LidoMATICNFT;
|
|
39
|
-
throw new Error("Invalid LidoVariant used");
|
|
40
|
-
}, $ = (t) => M.utils.defaultAbiCoder.encode(["uint8"], [Number(t)]), Ct = async (t, i, e, a, o, f, A = !1) => {
|
|
41
|
-
const p = [...await D(t, a, o, 6, f)], y = p[0].length, C = `${e === s.Stake ? "swapperM" : "swapperToken"}2x${y}x1`, n = _(i, e), { flatFees: x, feeUnit: L } = await K(
|
|
42
|
-
t.getCurrentChainId(),
|
|
43
|
-
a,
|
|
44
|
-
n,
|
|
45
|
-
o,
|
|
46
|
-
e
|
|
47
|
-
);
|
|
48
|
-
o = v({
|
|
49
|
-
erc20Addresses: a,
|
|
50
|
-
amountChanges: o,
|
|
51
|
-
flatFees: x,
|
|
52
|
-
feeUnit: L,
|
|
53
|
-
externalActionId: n,
|
|
54
|
-
action: e
|
|
55
|
-
});
|
|
56
|
-
const g = e === s.Request ? o.map(() => !1) : o.map((r) => r > 0n), l = [];
|
|
57
|
-
for (let r = 0; r < a.length; r += 1) {
|
|
58
|
-
const { outputUtxos: F } = P(
|
|
59
|
-
t.userKeys,
|
|
60
|
-
p[r],
|
|
61
|
-
o[r],
|
|
62
|
-
void 0,
|
|
63
|
-
f[r]
|
|
64
|
-
);
|
|
65
|
-
l.push(F);
|
|
66
|
-
}
|
|
67
|
-
if (!await t.getRandomRelay())
|
|
68
|
-
throw Error(N.RELAYER_NOT_AVAILABLE);
|
|
69
|
-
const { lidoExternalActionEthAddress: T, lidoExternalActionMaticAddress: I } = U[t.getCurrentChainId()].contractData, c = i === u.Ethereum ? T : I;
|
|
70
|
-
if (!c)
|
|
71
|
-
throw new Error("Can't find external action address");
|
|
72
|
-
const R = $(e), { zkCallData: E, circomData: d, dimData: w } = await H(
|
|
73
|
-
t.merkleTreeHinkal,
|
|
74
|
-
t.merkleTreeAccessToken,
|
|
75
|
-
p,
|
|
76
|
-
l,
|
|
77
|
-
t.userKeys,
|
|
78
|
-
C,
|
|
79
|
-
n,
|
|
80
|
-
c,
|
|
81
|
-
R,
|
|
82
|
-
await t.getRandomRelay(),
|
|
83
|
-
t.getCurrentChainId(),
|
|
84
|
-
g,
|
|
85
|
-
x
|
|
86
|
-
);
|
|
87
|
-
return console.log({ externalActionAddress: c, externalActionId: n, circomData: d }), A ? await S(t, E, w, d) : await b(t.getCurrentChainId(), E, w, d);
|
|
88
|
-
};
|
|
89
|
-
export {
|
|
90
|
-
Ct as hinkalActionLido
|
|
91
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import "../../constants/chains.constants.js";
|
|
2
|
-
import "../../types/circom-data.types.js";
|
|
3
|
-
import "../../types/transactions.types.js";
|
|
4
|
-
import "../../types/curve.types.js";
|
|
5
|
-
import "ethers";
|
|
6
|
-
import "circomlibjs";
|
|
7
|
-
import "../crypto-keys/keys.js";
|
|
8
|
-
import "axios";
|
|
9
|
-
import "../crypto-keys/encryptDecryptUtxo.js";
|
|
10
|
-
import "../../functions/web3/events/getShieldedBalance.js";
|
|
11
|
-
import "../../webworker/workerFactory.js";
|
|
12
|
-
import "../../functions/utils/external-action.utils.js";
|
|
13
|
-
import "../custom-token-registry/CustomTokenRegistry.js";
|
|
14
|
-
import "../../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
15
|
-
import "../../functions/utils/userAgent.js";
|
|
16
|
-
import "../../constants/reorg-depths.constants.js";
|
|
17
|
-
import "../../constants/kyc.constants.js";
|
|
18
|
-
import "../../constants/coingecko.constants.js";
|
|
19
|
-
import "../../constants/vite.constants.js";
|
|
20
|
-
import "../volatile-helper/VolatileHelper.js";
|
|
21
|
-
import "libsodium-wrappers";
|
|
22
|
-
import "../../constants/contracts.constants.js";
|
|
23
|
-
import "../../constants/axelar.constants.js";
|
|
24
|
-
import "../../constants/rewards.constants.js";
|
|
25
|
-
import { API as i } from "../../API/API.js";
|
|
26
|
-
const q = (e) => ({
|
|
27
|
-
async getAccessToken() {
|
|
28
|
-
const r = e.getCurrentChainId();
|
|
29
|
-
return i.getZkMeAccessToken(r);
|
|
30
|
-
},
|
|
31
|
-
async getUserAccounts() {
|
|
32
|
-
return [await e.getEthereumAddress()];
|
|
33
|
-
},
|
|
34
|
-
async delegateTransaction(r) {
|
|
35
|
-
const t = await e.getProviderAdapter(), o = {
|
|
36
|
-
...r,
|
|
37
|
-
chainId: Number(r.chainId),
|
|
38
|
-
type: r.type ? r.type : void 0,
|
|
39
|
-
maxPriorityFeePerGas: r.maxPriorityFeePerGas ? r.maxPriorityFeePerGas : void 0,
|
|
40
|
-
maxFeePerGas: r.maxFeePerGas ? r.maxFeePerGas : void 0
|
|
41
|
-
};
|
|
42
|
-
return (await t.sendTransaction(o)).hash;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
export {
|
|
46
|
-
q as getHinkalZkMeProvider
|
|
47
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { networkRegistry as A } from "../../constants/chains.constants.js";
|
|
2
|
-
import "../../types/circom-data.types.js";
|
|
3
|
-
import { ExternalActionId as g } from "../../types/external-action.types.js";
|
|
4
|
-
import "../../types/transactions.types.js";
|
|
5
|
-
import "../../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import { transactionErrorCodes as w } from "../../error-handling/error-codes.constants.js";
|
|
8
|
-
import "circomlibjs";
|
|
9
|
-
import "../crypto-keys/keys.js";
|
|
10
|
-
import "axios";
|
|
11
|
-
import "../crypto-keys/encryptDecryptUtxo.js";
|
|
12
|
-
import { addPaddingToUtxos as R } from "../../functions/web3/events/getShieldedBalance.js";
|
|
13
|
-
import { outputUtxoProcessing as U } from "../../functions/pre-transaction/outputUtxoProcessing.js";
|
|
14
|
-
import "../../webworker/workerFactory.js";
|
|
15
|
-
import "../../functions/utils/external-action.utils.js";
|
|
16
|
-
import "../custom-token-registry/CustomTokenRegistry.js";
|
|
17
|
-
import "../../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
18
|
-
import "../../constants/coingecko.constants.js";
|
|
19
|
-
import "../../constants/vite.constants.js";
|
|
20
|
-
import { processAmountChanges as C } from "../../functions/pre-transaction/processAmountChanges.js";
|
|
21
|
-
import "../../functions/utils/userAgent.js";
|
|
22
|
-
import { estimateGasRelayer as I } from "../../functions/web3/functionCalls/estimateGasRelayer.js";
|
|
23
|
-
import { transactCallRelayer as P } from "../../functions/web3/functionCalls/transactCallRelayer.js";
|
|
24
|
-
import "../../constants/reorg-depths.constants.js";
|
|
25
|
-
import "../../constants/kyc.constants.js";
|
|
26
|
-
import "../volatile-helper/VolatileHelper.js";
|
|
27
|
-
import { constructEmporiumProof as T } from "../../functions/snarkjs/constructEmporiumProof.js";
|
|
28
|
-
import "libsodium-wrappers";
|
|
29
|
-
import "../../constants/contracts.constants.js";
|
|
30
|
-
import "../../constants/axelar.constants.js";
|
|
31
|
-
import "../../constants/rewards.constants.js";
|
|
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
|
-
};
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { networkRegistry as R } from "../../constants/chains.constants.js";
|
|
2
|
-
import "../../types/circom-data.types.js";
|
|
3
|
-
import { ExternalActionId as n } from "../../types/external-action.types.js";
|
|
4
|
-
import "../../types/transactions.types.js";
|
|
5
|
-
import "../../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import { transactionErrorCodes as I } from "../../error-handling/error-codes.constants.js";
|
|
8
|
-
import "circomlibjs";
|
|
9
|
-
import "../crypto-keys/keys.js";
|
|
10
|
-
import "axios";
|
|
11
|
-
import "../crypto-keys/encryptDecryptUtxo.js";
|
|
12
|
-
import { addPaddingToUtxos as U } from "../../functions/web3/events/getShieldedBalance.js";
|
|
13
|
-
import { outputUtxoProcessing as D } from "../../functions/pre-transaction/outputUtxoProcessing.js";
|
|
14
|
-
import { constructZkProof as T } from "../../functions/snarkjs/constructGeneralZkProof.js";
|
|
15
|
-
import { estimateGasRelayer as b } from "../../functions/web3/functionCalls/estimateGasRelayer.js";
|
|
16
|
-
import { transactCallRelayer as F } from "../../functions/web3/functionCalls/transactCallRelayer.js";
|
|
17
|
-
import "../../functions/utils/external-action.utils.js";
|
|
18
|
-
import "../custom-token-registry/CustomTokenRegistry.js";
|
|
19
|
-
import "../../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
20
|
-
import "../../constants/coingecko.constants.js";
|
|
21
|
-
import "../../constants/vite.constants.js";
|
|
22
|
-
import { processAmountChanges as L } from "../../functions/pre-transaction/processAmountChanges.js";
|
|
23
|
-
import { getFlatFees as M } from "../../functions/pre-transaction/getFlatFees.js";
|
|
24
|
-
import "../../functions/utils/userAgent.js";
|
|
25
|
-
import "../../constants/reorg-depths.constants.js";
|
|
26
|
-
import "../../constants/kyc.constants.js";
|
|
27
|
-
import "../../webworker/workerFactory.js";
|
|
28
|
-
import "../volatile-helper/VolatileHelper.js";
|
|
29
|
-
import "libsodium-wrappers";
|
|
30
|
-
import "../../constants/contracts.constants.js";
|
|
31
|
-
import "../../constants/axelar.constants.js";
|
|
32
|
-
import "../../constants/rewards.constants.js";
|
|
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
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import "../../constants/chains.constants.js";
|
|
2
|
-
import "../../types/circom-data.types.js";
|
|
3
|
-
import { ExternalActionId as l } from "../../types/external-action.types.js";
|
|
4
|
-
import "../../types/transactions.types.js";
|
|
5
|
-
import "../../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import { transactionErrorCodes as T } from "../../error-handling/error-codes.constants.js";
|
|
8
|
-
import { zeroAddress as I } from "../../constants/protocol.constants.js";
|
|
9
|
-
import "circomlibjs";
|
|
10
|
-
import "../crypto-keys/keys.js";
|
|
11
|
-
import "axios";
|
|
12
|
-
import "../crypto-keys/encryptDecryptUtxo.js";
|
|
13
|
-
import { addPaddingToUtxos as y } from "../../functions/web3/events/getShieldedBalance.js";
|
|
14
|
-
import { outputUtxoProcessing as D } from "../../functions/pre-transaction/outputUtxoProcessing.js";
|
|
15
|
-
import { constructZkProof as U } from "../../functions/snarkjs/constructGeneralZkProof.js";
|
|
16
|
-
import { estimateGasRelayer as F } from "../../functions/web3/functionCalls/estimateGasRelayer.js";
|
|
17
|
-
import { transactCallRelayer as N } from "../../functions/web3/functionCalls/transactCallRelayer.js";
|
|
18
|
-
import { transactCallDirect as R } from "../../functions/web3/functionCalls/transactCallDirect.js";
|
|
19
|
-
import "../../functions/utils/external-action.utils.js";
|
|
20
|
-
import { getERC20Token as L } from "../../functions/utils/erc20tokenFunctions.js";
|
|
21
|
-
import "../../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
22
|
-
import "../../constants/coingecko.constants.js";
|
|
23
|
-
import "../../constants/vite.constants.js";
|
|
24
|
-
import { processAmountChanges as M } from "../../functions/pre-transaction/processAmountChanges.js";
|
|
25
|
-
import { getFlatFees as P } from "../../functions/pre-transaction/getFlatFees.js";
|
|
26
|
-
import "../../functions/utils/userAgent.js";
|
|
27
|
-
import "../../constants/reorg-depths.constants.js";
|
|
28
|
-
import "../../constants/kyc.constants.js";
|
|
29
|
-
import "../../webworker/workerFactory.js";
|
|
30
|
-
import "../volatile-helper/VolatileHelper.js";
|
|
31
|
-
import "../custom-token-registry/CustomTokenRegistry.js";
|
|
32
|
-
import "libsodium-wrappers";
|
|
33
|
-
import "../../constants/contracts.constants.js";
|
|
34
|
-
import "../../constants/axelar.constants.js";
|
|
35
|
-
import "../../constants/rewards.constants.js";
|
|
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
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { networkRegistry as i } from "../../constants/chains.constants.js";
|
|
2
|
-
import "../../types/circom-data.types.js";
|
|
3
|
-
import { ContractType as r } from "../../types/ethereum-network.types.js";
|
|
4
|
-
import "../../types/transactions.types.js";
|
|
5
|
-
import "../../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "../crypto-keys/keys.js";
|
|
9
|
-
import "axios";
|
|
10
|
-
import "../crypto-keys/encryptDecryptUtxo.js";
|
|
11
|
-
import "../../functions/web3/events/getShieldedBalance.js";
|
|
12
|
-
import "../../webworker/workerFactory.js";
|
|
13
|
-
import "../../functions/utils/external-action.utils.js";
|
|
14
|
-
import "../custom-token-registry/CustomTokenRegistry.js";
|
|
15
|
-
import "../../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
16
|
-
import "../../constants/coingecko.constants.js";
|
|
17
|
-
import "../../constants/vite.constants.js";
|
|
18
|
-
import "../../functions/utils/userAgent.js";
|
|
19
|
-
import { ClientAccessTokenSnapshotService as m } from "../snapshot/ClientAccessTokenSnapshotService.js";
|
|
20
|
-
import { ClientCommitmentsSnapshotService as n } from "../snapshot/ClientCommitmentsSnapshotService.js";
|
|
21
|
-
import { ClientNullifierSnapshotService as c } from "../snapshot/ClientNullifierSnapshotService.js";
|
|
22
|
-
import "../../constants/kyc.constants.js";
|
|
23
|
-
import "../volatile-helper/VolatileHelper.js";
|
|
24
|
-
import "../../constants/reorg-depths.constants.js";
|
|
25
|
-
import { balanceChangedHandler as o } from "../../functions/web3/events/balanceChangedHandler.js";
|
|
26
|
-
import "libsodium-wrappers";
|
|
27
|
-
import "../../constants/contracts.constants.js";
|
|
28
|
-
import "../../constants/axelar.constants.js";
|
|
29
|
-
import "../../constants/rewards.constants.js";
|
|
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
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { AbstractAccessTokenSnapshotService as e } from "../event-service/AbstractAccessTokenSnapshotService.js";
|
|
2
|
-
import "circomlibjs";
|
|
3
|
-
import "ethers";
|
|
4
|
-
import "axios";
|
|
5
|
-
import "../../constants/chains.constants.js";
|
|
6
|
-
import "../../types/circom-data.types.js";
|
|
7
|
-
import "../../types/transactions.types.js";
|
|
8
|
-
import "../../types/curve.types.js";
|
|
9
|
-
import "../crypto-keys/keys.js";
|
|
10
|
-
import "../crypto-keys/encryptDecryptUtxo.js";
|
|
11
|
-
import "../../functions/web3/events/getShieldedBalance.js";
|
|
12
|
-
import "../../webworker/workerFactory.js";
|
|
13
|
-
import "../../functions/utils/external-action.utils.js";
|
|
14
|
-
import "../custom-token-registry/CustomTokenRegistry.js";
|
|
15
|
-
import "../../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
16
|
-
import "../../constants/coingecko.constants.js";
|
|
17
|
-
import "../../constants/vite.constants.js";
|
|
18
|
-
import "../../functions/utils/userAgent.js";
|
|
19
|
-
import { fetchAccessTokenSnapshot as o } from "../../API/fetchCommitmentsCache.js";
|
|
20
|
-
import "../../constants/kyc.constants.js";
|
|
21
|
-
import "../volatile-helper/VolatileHelper.js";
|
|
22
|
-
import "libsodium-wrappers";
|
|
23
|
-
import "../../constants/contracts.constants.js";
|
|
24
|
-
import "../../constants/axelar.constants.js";
|
|
25
|
-
import "../../constants/rewards.constants.js";
|
|
26
|
-
import "../../constants/reorg-depths.constants.js";
|
|
27
|
-
class z extends e {
|
|
28
|
-
constructor(t, r) {
|
|
29
|
-
super(t, 0, !1, r);
|
|
30
|
-
}
|
|
31
|
-
async fetchSnapshot() {
|
|
32
|
-
const { chainId: t } = await this.contract.provider.getNetwork(), r = await o(t);
|
|
33
|
-
if (r.accessTokenContractAddress !== this.contract.address || r.chainId !== t)
|
|
34
|
-
throw Error("Commitment Snapshot: incorrect contract or chain id");
|
|
35
|
-
return {
|
|
36
|
-
latestBlockNumber: r.latestBlockNumber,
|
|
37
|
-
merkleTree: r.merkleTree,
|
|
38
|
-
senderAddresses: r.senderAddresses,
|
|
39
|
-
senderAddressIndexMap: r.senderAddressIndexMap
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
persistSnapshot(t) {
|
|
43
|
-
return Promise.resolve();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
z as ClientAccessTokenSnapshotService
|
|
48
|
-
};
|