@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,57 +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 { getAmountInWei as T } from "../web3/etherFunctions.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import { getValueFirstNDigit as l } from "../utils/amounts.utils.js";
|
|
9
|
-
import "../../data-structures/crypto-keys/keys.js";
|
|
10
|
-
import "axios";
|
|
11
|
-
import "../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
12
|
-
import "../web3/events/getShieldedBalance.js";
|
|
13
|
-
import "../../webworker/workerFactory.js";
|
|
14
|
-
import "../utils/external-action.utils.js";
|
|
15
|
-
import "../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
16
|
-
import "../utils/convertIntegrationProviderToExternalActionId.js";
|
|
17
|
-
import "../utils/userAgent.js";
|
|
18
|
-
import "../../constants/reorg-depths.constants.js";
|
|
19
|
-
import "../../constants/kyc.constants.js";
|
|
20
|
-
import "../../constants/coingecko.constants.js";
|
|
21
|
-
import { logError as p } from "../../error-handling/logError.js";
|
|
22
|
-
import "../../data-structures/volatile-helper/VolatileHelper.js";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "../../constants/vite.constants.js";
|
|
25
|
-
import "../../constants/contracts.constants.js";
|
|
26
|
-
import "../../constants/axelar.constants.js";
|
|
27
|
-
import "../../constants/rewards.constants.js";
|
|
28
|
-
import { getGasEstimates as E } from "../../API/getGasEstimates.js";
|
|
29
|
-
const K = async (s, t, e, a, n, c) => {
|
|
30
|
-
let i, o, r;
|
|
31
|
-
try {
|
|
32
|
-
({
|
|
33
|
-
status: i,
|
|
34
|
-
priceOfTransactionInUSD: o,
|
|
35
|
-
priceOfTransactionInToken: r
|
|
36
|
-
} = await E(
|
|
37
|
-
s,
|
|
38
|
-
t.erc20TokenAddress,
|
|
39
|
-
e,
|
|
40
|
-
a,
|
|
41
|
-
n,
|
|
42
|
-
c
|
|
43
|
-
));
|
|
44
|
-
} catch (f) {
|
|
45
|
-
p("processGasEstimates error:", f);
|
|
46
|
-
}
|
|
47
|
-
const m = r ? T(t, l(r, t.decimals)) : void 0;
|
|
48
|
-
return p("processGasEstimates: ", {
|
|
49
|
-
status: i,
|
|
50
|
-
priceOfTransactionInUSD: o,
|
|
51
|
-
priceOfTransactionInTokenEstimate: r,
|
|
52
|
-
priceOfTransactionInToken: m
|
|
53
|
-
}), { priceOfTransactionInUSD: o, priceOfTransactionInToken: m };
|
|
54
|
-
};
|
|
55
|
-
export {
|
|
56
|
-
K as processGasEstimates
|
|
57
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { getNonLocalhostChainId as r, chainIds as t } from "../../constants/chains.constants.js";
|
|
2
|
-
import "../../types/circom-data.types.js";
|
|
3
|
-
import "../../types/transactions.types.js";
|
|
4
|
-
import "../../types/curve.types.js";
|
|
5
|
-
import "ethers";
|
|
6
|
-
import "circomlibjs";
|
|
7
|
-
import "../../data-structures/crypto-keys/keys.js";
|
|
8
|
-
import "axios";
|
|
9
|
-
import "../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
10
|
-
import "../web3/events/getShieldedBalance.js";
|
|
11
|
-
import "../../webworker/workerFactory.js";
|
|
12
|
-
import "../utils/external-action.utils.js";
|
|
13
|
-
import "../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
14
|
-
import "../utils/convertIntegrationProviderToExternalActionId.js";
|
|
15
|
-
import "../../constants/coingecko.constants.js";
|
|
16
|
-
import "../../constants/vite.constants.js";
|
|
17
|
-
import "../utils/userAgent.js";
|
|
18
|
-
import "../../constants/reorg-depths.constants.js";
|
|
19
|
-
import "../../constants/kyc.constants.js";
|
|
20
|
-
import "../../data-structures/volatile-helper/VolatileHelper.js";
|
|
21
|
-
import "libsodium-wrappers";
|
|
22
|
-
import "../../constants/contracts.constants.js";
|
|
23
|
-
import "../../constants/axelar.constants.js";
|
|
24
|
-
import "../../constants/rewards.constants.js";
|
|
25
|
-
const N = (o) => {
|
|
26
|
-
switch (r(o)) {
|
|
27
|
-
case t.polygon:
|
|
28
|
-
return "0x4257ea7637c355f81616050cbb6a9b709fd72683";
|
|
29
|
-
case t.arbMainnet:
|
|
30
|
-
return "0xb952a807345991bd529fdded05009f5e80fe8f45";
|
|
31
|
-
case t.ethMainnet:
|
|
32
|
-
return "0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B";
|
|
33
|
-
case t.optimism:
|
|
34
|
-
return "0x81ab7e0d570b01411fcc4afd3d50ec8c241cb74b";
|
|
35
|
-
default:
|
|
36
|
-
return "0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B";
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
N as getCVX
|
|
41
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { getNonLocalhostChainId as o, chainIds as t } from "../../constants/chains.constants.js";
|
|
2
|
-
import "../../types/circom-data.types.js";
|
|
3
|
-
import "../../types/transactions.types.js";
|
|
4
|
-
import "../../types/curve.types.js";
|
|
5
|
-
import "ethers";
|
|
6
|
-
import "circomlibjs";
|
|
7
|
-
import "../../data-structures/crypto-keys/keys.js";
|
|
8
|
-
import "axios";
|
|
9
|
-
import "../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
10
|
-
import "../web3/events/getShieldedBalance.js";
|
|
11
|
-
import "../../webworker/workerFactory.js";
|
|
12
|
-
import "../utils/external-action.utils.js";
|
|
13
|
-
import "../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
14
|
-
import "../utils/convertIntegrationProviderToExternalActionId.js";
|
|
15
|
-
import "../../constants/coingecko.constants.js";
|
|
16
|
-
import "../../constants/vite.constants.js";
|
|
17
|
-
import "../utils/userAgent.js";
|
|
18
|
-
import "../../constants/reorg-depths.constants.js";
|
|
19
|
-
import "../../constants/kyc.constants.js";
|
|
20
|
-
import "../../data-structures/volatile-helper/VolatileHelper.js";
|
|
21
|
-
import "libsodium-wrappers";
|
|
22
|
-
import "../../constants/contracts.constants.js";
|
|
23
|
-
import "../../constants/axelar.constants.js";
|
|
24
|
-
import "../../constants/rewards.constants.js";
|
|
25
|
-
const v = (r) => {
|
|
26
|
-
switch (o(r)) {
|
|
27
|
-
case t.polygon:
|
|
28
|
-
return "0x172370d5Cd63279eFa6d502DAB29171933a610AF";
|
|
29
|
-
case t.arbMainnet:
|
|
30
|
-
return "0x11cdb42b0eb46d95f990bedd4695a6e3fa034978";
|
|
31
|
-
case t.ethMainnet:
|
|
32
|
-
return "0xD533a949740bb3306d119CC777fa900bA034cd52";
|
|
33
|
-
case t.avalanche:
|
|
34
|
-
return "0x47536F17F4fF30e64A96a7555826b8f9e66ec468";
|
|
35
|
-
case t.optimism:
|
|
36
|
-
return "0x0994206dfe8de6ec6920ff4d779b0d950605fb53";
|
|
37
|
-
case t.base:
|
|
38
|
-
return "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415";
|
|
39
|
-
default:
|
|
40
|
-
return "0xD533a949740bb3306d119CC777fa900bA034cd52";
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
export {
|
|
44
|
-
v as getCRV
|
|
45
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import "../../constants/chains.constants.js";
|
|
2
|
-
import { defaultHookData as S } from "../../types/circom-data.types.js";
|
|
3
|
-
import "../../types/transactions.types.js";
|
|
4
|
-
import "../../types/curve.types.js";
|
|
5
|
-
import "ethers";
|
|
6
|
-
import { zeroAddress as h } from "../../constants/protocol.constants.js";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "../../data-structures/crypto-keys/keys.js";
|
|
9
|
-
import "axios";
|
|
10
|
-
import "../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
11
|
-
import "../web3/events/getShieldedBalance.js";
|
|
12
|
-
import { performTaskWithWorker as C } from "../../webworker/performTaskWithWorker.js";
|
|
13
|
-
import { WorkerVariant as T } from "../../webworker/worker.registry.js";
|
|
14
|
-
import { ZKProofWorkerActionType as W } from "../../webworker/zkProofWorker/zkProofWorker.types.js";
|
|
15
|
-
import { calcAmountChanges as b, buildOutCommitments as L } from "./common.snarkjs.js";
|
|
16
|
-
import { getExternalActionIdHash as N } from "../utils/external-action.utils.js";
|
|
17
|
-
import "../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
18
|
-
import "../utils/convertIntegrationProviderToExternalActionId.js";
|
|
19
|
-
import "../../constants/coingecko.constants.js";
|
|
20
|
-
import "../../constants/vite.constants.js";
|
|
21
|
-
import "../utils/userAgent.js";
|
|
22
|
-
import "../../constants/reorg-depths.constants.js";
|
|
23
|
-
import "../../constants/kyc.constants.js";
|
|
24
|
-
import "../../data-structures/volatile-helper/VolatileHelper.js";
|
|
25
|
-
import "libsodium-wrappers";
|
|
26
|
-
import "../../constants/contracts.constants.js";
|
|
27
|
-
import "../../constants/axelar.constants.js";
|
|
28
|
-
import "../../constants/rewards.constants.js";
|
|
29
|
-
const ir = async (e, a, o, t, n, s, c, m, i, d, f, k, l, g, p, u) => {
|
|
30
|
-
const y = b(o, t, !0), A = o.map((r) => r.map((I) => I.getConstructableParams())), D = await C({
|
|
31
|
-
type: T.ZKProof,
|
|
32
|
-
payload: {
|
|
33
|
-
type: W.BUILD_IN_NULLIFIERS,
|
|
34
|
-
data: { inputUtxosSerialized: A, onChainCreation: p }
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return {
|
|
38
|
-
rootHashHinkal: e,
|
|
39
|
-
erc20TokenAddresses: o.map((r) => r[0].erc20TokenAddress),
|
|
40
|
-
tokenIds: l.map((r) => String(r)),
|
|
41
|
-
amountChanges: y,
|
|
42
|
-
inputNullifiers: D,
|
|
43
|
-
outCommitments: L(t, p),
|
|
44
|
-
encryptedOutputs: n,
|
|
45
|
-
flatFees: s,
|
|
46
|
-
timeStamp: t[0][0].timeStamp,
|
|
47
|
-
stealthAddressStructure: g,
|
|
48
|
-
rootHashAccessToken: a,
|
|
49
|
-
relay: f,
|
|
50
|
-
externalAddress: i === void 0 ? h : i,
|
|
51
|
-
externalActionMetadata: d,
|
|
52
|
-
externalActionId: typeof m == "bigint" ? 0n : N(m),
|
|
53
|
-
hookData: u || S,
|
|
54
|
-
publicSignalCount: c,
|
|
55
|
-
calldataHash: k
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export {
|
|
59
|
-
ir as generateCircomData
|
|
60
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { chainIds as o } from "../../constants/chains.constants.js";
|
|
2
|
-
import "../../types/circom-data.types.js";
|
|
3
|
-
import "../../types/transactions.types.js";
|
|
4
|
-
import "../../types/curve.types.js";
|
|
5
|
-
import "ethers";
|
|
6
|
-
import "circomlibjs";
|
|
7
|
-
import "../../data-structures/crypto-keys/keys.js";
|
|
8
|
-
import "axios";
|
|
9
|
-
import "../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
10
|
-
import "../web3/events/getShieldedBalance.js";
|
|
11
|
-
import "../../webworker/workerFactory.js";
|
|
12
|
-
import "../utils/external-action.utils.js";
|
|
13
|
-
import "../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
14
|
-
import "../utils/convertIntegrationProviderToExternalActionId.js";
|
|
15
|
-
import "../../constants/coingecko.constants.js";
|
|
16
|
-
import "../../constants/vite.constants.js";
|
|
17
|
-
import "../utils/userAgent.js";
|
|
18
|
-
import { prodVerifiers as t, localVerifiers as m } from "./constant.js";
|
|
19
|
-
import "../../constants/reorg-depths.constants.js";
|
|
20
|
-
import "../../constants/kyc.constants.js";
|
|
21
|
-
import "../../data-structures/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
|
-
const j = (r, i) => i === o.localhost ? m[`${r}Wasm`] : t(i)[`${r}Wasm`], q = (r, i) => i === o.localhost ? m[`${r}Zkey`] : t(i)[`${r}Zkey`];
|
|
27
|
-
export {
|
|
28
|
-
j as getWASMFile,
|
|
29
|
-
q as getZKeyFile
|
|
30
|
-
};
|
|
@@ -1,38 +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 "../../data-structures/crypto-keys/keys.js";
|
|
8
|
-
import "axios";
|
|
9
|
-
import "../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
10
|
-
import "../web3/events/getShieldedBalance.js";
|
|
11
|
-
import "../../webworker/workerFactory.js";
|
|
12
|
-
import "./external-action.utils.js";
|
|
13
|
-
import "../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
14
|
-
import "./convertIntegrationProviderToExternalActionId.js";
|
|
15
|
-
import "../../constants/coingecko.constants.js";
|
|
16
|
-
import "../../constants/vite.constants.js";
|
|
17
|
-
import "./userAgent.js";
|
|
18
|
-
import "../../constants/reorg-depths.constants.js";
|
|
19
|
-
import "../../constants/kyc.constants.js";
|
|
20
|
-
import "../../data-structures/volatile-helper/VolatileHelper.js";
|
|
21
|
-
import "libsodium-wrappers";
|
|
22
|
-
import "../../constants/contracts.constants.js";
|
|
23
|
-
import { AxelarRegistry as p } from "../../constants/axelar.constants.js";
|
|
24
|
-
import "../../constants/rewards.constants.js";
|
|
25
|
-
const z = (i) => {
|
|
26
|
-
const r = p.find((m) => m.chainId === i.chainId);
|
|
27
|
-
if (!r)
|
|
28
|
-
return;
|
|
29
|
-
const { sourceChain: t, sourceAddress: o } = r;
|
|
30
|
-
return {
|
|
31
|
-
destinationChain: t,
|
|
32
|
-
destinationAddress: o,
|
|
33
|
-
messageFee: i.gasFeeInWei ?? 0n
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export {
|
|
37
|
-
z as getAxelarMigrationInfo
|
|
38
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import "../../types/circom-data.types.js";
|
|
2
|
-
import { ExternalActionId as r } from "../../types/external-action.types.js";
|
|
3
|
-
import { IntegrationProvider as o } from "../../types/hinkal.types.js";
|
|
4
|
-
import "../../types/transactions.types.js";
|
|
5
|
-
import "../../types/curve.types.js";
|
|
6
|
-
const t = {
|
|
7
|
-
[o.UNISWAP]: r.Uniswap,
|
|
8
|
-
[o.ODOS]: r.Odos,
|
|
9
|
-
[o.ONEINCH]: r.OneInch,
|
|
10
|
-
[o.PENDLE]: r.Pendle,
|
|
11
|
-
[o.ALL]: void 0,
|
|
12
|
-
[o.NONE]: void 0
|
|
13
|
-
}, p = (n) => t[n];
|
|
14
|
-
export {
|
|
15
|
-
p as convertIntegrationProviderToExternalActionId
|
|
16
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { networkRegistry as i, chainIdsByType as o } from "../../constants/chains.constants.js";
|
|
2
|
-
import "../../types/circom-data.types.js";
|
|
3
|
-
import "../../types/transactions.types.js";
|
|
4
|
-
import "../../types/curve.types.js";
|
|
5
|
-
import "ethers";
|
|
6
|
-
import "circomlibjs";
|
|
7
|
-
import "../../data-structures/crypto-keys/keys.js";
|
|
8
|
-
import "axios";
|
|
9
|
-
import "../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
10
|
-
import "../web3/events/getShieldedBalance.js";
|
|
11
|
-
import "../../webworker/workerFactory.js";
|
|
12
|
-
import "./external-action.utils.js";
|
|
13
|
-
import "../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
14
|
-
import "./convertIntegrationProviderToExternalActionId.js";
|
|
15
|
-
import "../../constants/coingecko.constants.js";
|
|
16
|
-
import "../../constants/vite.constants.js";
|
|
17
|
-
import "./userAgent.js";
|
|
18
|
-
import "../../constants/reorg-depths.constants.js";
|
|
19
|
-
import "../../constants/kyc.constants.js";
|
|
20
|
-
import "../../data-structures/volatile-helper/VolatileHelper.js";
|
|
21
|
-
import "libsodium-wrappers";
|
|
22
|
-
import "../../constants/contracts.constants.js";
|
|
23
|
-
import "../../constants/axelar.constants.js";
|
|
24
|
-
import "../../constants/rewards.constants.js";
|
|
25
|
-
const B = (t) => i[t], R = (t) => Object.keys(o)[Object.values(o).findIndex((r) => r.includes(t.chainId))];
|
|
26
|
-
export {
|
|
27
|
-
B as getNetworkObject,
|
|
28
|
-
R as getNetworkType
|
|
29
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { getERC20Registry as p } from "../../constants/token-data/ERC20Registry.js";
|
|
2
|
-
import "../../constants/chains.constants.js";
|
|
3
|
-
import "../../types/circom-data.types.js";
|
|
4
|
-
import "../../types/transactions.types.js";
|
|
5
|
-
import "../../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "../../data-structures/crypto-keys/keys.js";
|
|
9
|
-
import "axios";
|
|
10
|
-
import "../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
11
|
-
import "../web3/events/getShieldedBalance.js";
|
|
12
|
-
import "../../webworker/workerFactory.js";
|
|
13
|
-
import "./external-action.utils.js";
|
|
14
|
-
import { customTokenRegistry as s } from "../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
15
|
-
import "./convertIntegrationProviderToExternalActionId.js";
|
|
16
|
-
import "../../constants/coingecko.constants.js";
|
|
17
|
-
import "../../constants/vite.constants.js";
|
|
18
|
-
import "./userAgent.js";
|
|
19
|
-
import "../../constants/reorg-depths.constants.js";
|
|
20
|
-
import "../../constants/kyc.constants.js";
|
|
21
|
-
import { VolatileHelper as e } from "../../data-structures/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
|
-
const m = { chains: [] }, v = async (r) => {
|
|
27
|
-
let o = [...p(r), ...s.getCustomTokens(r)];
|
|
28
|
-
m.chains.includes(r) || (o = await Promise.all(
|
|
29
|
-
o.map(async (t) => {
|
|
30
|
-
if (t.isVolatile) {
|
|
31
|
-
const i = await e.getShareTokenAddress(r, t.erc20TokenAddress);
|
|
32
|
-
i && (t.sharedAddress = i);
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
})
|
|
36
|
-
), m.chains.push(r));
|
|
37
|
-
};
|
|
38
|
-
export {
|
|
39
|
-
v as patchRegistry
|
|
40
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "../../../types/circom-data.types.js";
|
|
2
|
-
import { EventType as e } from "../../../types/hinkal.types.js";
|
|
3
|
-
import "../../../types/transactions.types.js";
|
|
4
|
-
import "../../../types/curve.types.js";
|
|
5
|
-
const p = () => {
|
|
6
|
-
document.dispatchEvent(new Event(e.BalanceChange));
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
p as balanceChangedHandler
|
|
10
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { networkRegistry as a } from "../../../constants/chains.constants.js";
|
|
2
|
-
import "../../../types/circom-data.types.js";
|
|
3
|
-
import { ContractType as c } from "../../../types/ethereum-network.types.js";
|
|
4
|
-
import "../../../types/transactions.types.js";
|
|
5
|
-
import "../../../types/curve.types.js";
|
|
6
|
-
import { ethToWei as m } from "../etherFunctions.js";
|
|
7
|
-
import "ethers";
|
|
8
|
-
import "circomlibjs";
|
|
9
|
-
import "../../../data-structures/crypto-keys/keys.js";
|
|
10
|
-
import "axios";
|
|
11
|
-
import "../../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
12
|
-
import "../events/getShieldedBalance.js";
|
|
13
|
-
import "../../../webworker/workerFactory.js";
|
|
14
|
-
import "../../utils/external-action.utils.js";
|
|
15
|
-
import "../../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
16
|
-
import "../../utils/convertIntegrationProviderToExternalActionId.js";
|
|
17
|
-
import "../../../constants/coingecko.constants.js";
|
|
18
|
-
import "../../../constants/vite.constants.js";
|
|
19
|
-
import "../../utils/userAgent.js";
|
|
20
|
-
import "../../../constants/reorg-depths.constants.js";
|
|
21
|
-
import "../../../constants/kyc.constants.js";
|
|
22
|
-
import "../../../data-structures/volatile-helper/VolatileHelper.js";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "../../../constants/contracts.constants.js";
|
|
25
|
-
import "../../../constants/axelar.constants.js";
|
|
26
|
-
import "../../../constants/rewards.constants.js";
|
|
27
|
-
const J = async (t) => (await t.getContractWithFetcher(c.CrossChainAccessTokenContract).functions.hasToken(t.userKeys.getAccessKey()))[0], L = async (t, e) => {
|
|
28
|
-
const o = t.getContractWithSigner(c.CrossChainAccessTokenContract), s = a[t.getCurrentChainId()].accessTokenMintingFee ?? "0", n = {
|
|
29
|
-
value: m(s)
|
|
30
|
-
};
|
|
31
|
-
return await o.addToken(e, n);
|
|
32
|
-
}, N = async (t, e, o) => {
|
|
33
|
-
const s = t.getContractWithSigner(c.CrossChainAccessTokenContract), i = a[t.getCurrentChainId()].accessTokenMintingFee ?? "0", n = m(i), r = o.reduce(
|
|
34
|
-
(T, u) => T + u.messageFee,
|
|
35
|
-
0n
|
|
36
|
-
), p = {
|
|
37
|
-
chains: o,
|
|
38
|
-
totalMessageFees: r
|
|
39
|
-
}, C = {
|
|
40
|
-
value: n + r
|
|
41
|
-
};
|
|
42
|
-
return await s.addTokenCrossChain(e, p, C);
|
|
43
|
-
};
|
|
44
|
-
export {
|
|
45
|
-
J as checkHinkalAccessToken,
|
|
46
|
-
L as mintAccessToken,
|
|
47
|
-
N as mintTokenCrossChain
|
|
48
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import "../../../constants/chains.constants.js";
|
|
2
|
-
import "../../../types/circom-data.types.js";
|
|
3
|
-
import { ContractType as A } from "../../../types/ethereum-network.types.js";
|
|
4
|
-
import "../../../types/transactions.types.js";
|
|
5
|
-
import "../../../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import { zeroAddress as d } from "../../../constants/protocol.constants.js";
|
|
8
|
-
import "circomlibjs";
|
|
9
|
-
import "../../../data-structures/crypto-keys/keys.js";
|
|
10
|
-
import "axios";
|
|
11
|
-
import "../../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
12
|
-
import "../events/getShieldedBalance.js";
|
|
13
|
-
import "../../../webworker/workerFactory.js";
|
|
14
|
-
import "../../utils/external-action.utils.js";
|
|
15
|
-
import "../../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
16
|
-
import "../../utils/convertIntegrationProviderToExternalActionId.js";
|
|
17
|
-
import "../../../constants/coingecko.constants.js";
|
|
18
|
-
import "../../../constants/vite.constants.js";
|
|
19
|
-
import "../../utils/userAgent.js";
|
|
20
|
-
import { waitLittle as T } from "../../utils/time.utils.js";
|
|
21
|
-
import { approveTokenToHinkal as y } from "./approveToken.js";
|
|
22
|
-
import "../../../constants/reorg-depths.constants.js";
|
|
23
|
-
import "../../../constants/kyc.constants.js";
|
|
24
|
-
import "../../../data-structures/volatile-helper/VolatileHelper.js";
|
|
25
|
-
import "libsodium-wrappers";
|
|
26
|
-
import "../../../constants/contracts.constants.js";
|
|
27
|
-
import "../../../constants/axelar.constants.js";
|
|
28
|
-
import "../../../constants/rewards.constants.js";
|
|
29
|
-
const $ = async (i, r, s, t, m, p, g, f) => {
|
|
30
|
-
const c = i.getContractWithSigner(A.HinkalContract), h = await i.getEthereumAddress(), l = g ?? c, n = f ?? c, a = "transact";
|
|
31
|
-
console.log("before the direct transaction"), r > 0n && s.erc20TokenAddress !== d && await y(i, l, r, s);
|
|
32
|
-
const e = {
|
|
33
|
-
value: r > 0n && s.erc20TokenAddress === d ? BigInt(r).toString() : void 0
|
|
34
|
-
};
|
|
35
|
-
let o;
|
|
36
|
-
try {
|
|
37
|
-
o = (await n.estimateGas[a](
|
|
38
|
-
t[0],
|
|
39
|
-
t[1],
|
|
40
|
-
t[2],
|
|
41
|
-
p,
|
|
42
|
-
m,
|
|
43
|
-
{ ...e, from: h }
|
|
44
|
-
)).toNumber(), console.log({ "gas costs of deposit": o });
|
|
45
|
-
} catch (x) {
|
|
46
|
-
console.log("hinkalDeposit: gas estimation error: ", { err: x });
|
|
47
|
-
}
|
|
48
|
-
const v = o && o >= 0 ? Math.ceil(o * 12 / 10) : void 0;
|
|
49
|
-
return e.gasLimit = v, await T(), await n[a](
|
|
50
|
-
t[0],
|
|
51
|
-
t[1],
|
|
52
|
-
t[2],
|
|
53
|
-
p,
|
|
54
|
-
m,
|
|
55
|
-
e
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
export {
|
|
59
|
-
$ as transactCallDirect
|
|
60
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { callRelayerTransactAPI as a } from "../../../API/callRelayer.js";
|
|
2
|
-
import "../../../constants/chains.constants.js";
|
|
3
|
-
import "../../../types/circom-data.types.js";
|
|
4
|
-
import "../../../types/transactions.types.js";
|
|
5
|
-
import "../../../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "../../../data-structures/crypto-keys/keys.js";
|
|
9
|
-
import "axios";
|
|
10
|
-
import "../../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
11
|
-
import "../events/getShieldedBalance.js";
|
|
12
|
-
import "../../utils/external-action.utils.js";
|
|
13
|
-
import "../../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
14
|
-
import "../../utils/convertIntegrationProviderToExternalActionId.js";
|
|
15
|
-
import "../../../constants/coingecko.constants.js";
|
|
16
|
-
import "../../../constants/vite.constants.js";
|
|
17
|
-
import "../../utils/userAgent.js";
|
|
18
|
-
import "../../../constants/reorg-depths.constants.js";
|
|
19
|
-
import "../../../constants/kyc.constants.js";
|
|
20
|
-
import "../../../webworker/workerFactory.js";
|
|
21
|
-
import "../../../data-structures/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 { serializeCircomData as c } from "../../snarkjs/common.snarkjs.js";
|
|
27
|
-
const F = async (t, r, i, m, p) => {
|
|
28
|
-
const s = c(m), o = await a(t, {
|
|
29
|
-
a: r[0],
|
|
30
|
-
b: r[1],
|
|
31
|
-
c: r[2],
|
|
32
|
-
dimData: i,
|
|
33
|
-
circomData: s,
|
|
34
|
-
withPrivateMempool: p
|
|
35
|
-
});
|
|
36
|
-
if (o.status === "success")
|
|
37
|
-
return o.message;
|
|
38
|
-
throw new Error(o.error);
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
F as transactCallRelayer
|
|
42
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { callOdosAPI as m } from "../../API/callOdosAPI.js";
|
|
2
|
-
import { localhostNetwork as n, networkRegistry as d } from "../../constants/chains.constants.js";
|
|
3
|
-
import "../../types/circom-data.types.js";
|
|
4
|
-
import "../../types/transactions.types.js";
|
|
5
|
-
import "../../types/curve.types.js";
|
|
6
|
-
import { getAmountInWei as a } from "./etherFunctions.js";
|
|
7
|
-
import "ethers";
|
|
8
|
-
import { zeroAddress as c } from "../../constants/protocol.constants.js";
|
|
9
|
-
import "circomlibjs";
|
|
10
|
-
import "../../data-structures/crypto-keys/keys.js";
|
|
11
|
-
import { transactionErrorCodes as u } from "../../error-handling/error-codes.constants.js";
|
|
12
|
-
import "axios";
|
|
13
|
-
import "../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
14
|
-
import "./events/getShieldedBalance.js";
|
|
15
|
-
import "../../webworker/workerFactory.js";
|
|
16
|
-
import "../utils/external-action.utils.js";
|
|
17
|
-
import "../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
18
|
-
import "../utils/convertIntegrationProviderToExternalActionId.js";
|
|
19
|
-
import "../../constants/coingecko.constants.js";
|
|
20
|
-
import "../../constants/vite.constants.js";
|
|
21
|
-
import "../utils/userAgent.js";
|
|
22
|
-
import "../../constants/reorg-depths.constants.js";
|
|
23
|
-
import "../../constants/kyc.constants.js";
|
|
24
|
-
import "../../data-structures/volatile-helper/VolatileHelper.js";
|
|
25
|
-
import "libsodium-wrappers";
|
|
26
|
-
import "../../constants/contracts.constants.js";
|
|
27
|
-
import "../../constants/axelar.constants.js";
|
|
28
|
-
import "../../constants/rewards.constants.js";
|
|
29
|
-
const q = async (r, t, e, i) => {
|
|
30
|
-
try {
|
|
31
|
-
const o = {
|
|
32
|
-
chainId: r.getCurrentChainId() !== 31337 ? r.getCurrentChainId() : n,
|
|
33
|
-
inputTokens: [
|
|
34
|
-
{
|
|
35
|
-
tokenAddress: t?.wrappedErc20TokenAddress ?? t.erc20TokenAddress,
|
|
36
|
-
amount: a(t, i).toString()
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
outputTokens: [
|
|
40
|
-
{
|
|
41
|
-
tokenAddress: e?.wrappedErc20TokenAddress ?? e.erc20TokenAddress,
|
|
42
|
-
proportion: 1
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
userAddr: d[r.getCurrentChainId()].contractData.odosExternalActionInstanceAddress || c,
|
|
46
|
-
slippageLimitPercent: 10,
|
|
47
|
-
disableRFQs: !0
|
|
48
|
-
// sometimes swap fails because of RFQs
|
|
49
|
-
}, { odosResponse: s, status: p } = await m(
|
|
50
|
-
r.getCurrentChainId(),
|
|
51
|
-
o
|
|
52
|
-
);
|
|
53
|
-
if (p !== "success")
|
|
54
|
-
throw Error("Odos API Fetch Error");
|
|
55
|
-
return {
|
|
56
|
-
outSwapAmountValue: BigInt(s.outputTokens[0].amount),
|
|
57
|
-
odosDataValue: s.transaction.data
|
|
58
|
-
};
|
|
59
|
-
} catch (o) {
|
|
60
|
-
throw console.log({ error: o }), Error(u.NO_ODOS_PRICE);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
export {
|
|
64
|
-
q as getOdosPrice
|
|
65
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { callOneInchAPI as p } from "../../API/callOneInchAPI.js";
|
|
2
|
-
import "../../constants/chains.constants.js";
|
|
3
|
-
import "../../types/circom-data.types.js";
|
|
4
|
-
import { ContractType as a } from "../../types/ethereum-network.types.js";
|
|
5
|
-
import "../../types/transactions.types.js";
|
|
6
|
-
import "../../types/curve.types.js";
|
|
7
|
-
import { getAmountInWei as c } from "./etherFunctions.js";
|
|
8
|
-
import "ethers";
|
|
9
|
-
import { zeroAddress as e, oneInchZeroAddress as s } from "../../constants/protocol.constants.js";
|
|
10
|
-
import "circomlibjs";
|
|
11
|
-
import "../../data-structures/crypto-keys/keys.js";
|
|
12
|
-
import { transactionErrorCodes as d } from "../../error-handling/error-codes.constants.js";
|
|
13
|
-
import "axios";
|
|
14
|
-
import "../../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
15
|
-
import "./events/getShieldedBalance.js";
|
|
16
|
-
import "../../webworker/workerFactory.js";
|
|
17
|
-
import "../utils/external-action.utils.js";
|
|
18
|
-
import "../../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
19
|
-
import "../utils/convertIntegrationProviderToExternalActionId.js";
|
|
20
|
-
import "../../constants/coingecko.constants.js";
|
|
21
|
-
import "../../constants/vite.constants.js";
|
|
22
|
-
import "../utils/userAgent.js";
|
|
23
|
-
import "../../constants/reorg-depths.constants.js";
|
|
24
|
-
import "../../constants/kyc.constants.js";
|
|
25
|
-
import "../../data-structures/volatile-helper/VolatileHelper.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 W = async (i, t, m, n) => {
|
|
31
|
-
try {
|
|
32
|
-
const o = {
|
|
33
|
-
fromTokenAddress: t.erc20TokenAddress !== e ? t.erc20TokenAddress : s,
|
|
34
|
-
toTokenAddress: m.erc20TokenAddress !== e ? m.erc20TokenAddress : s,
|
|
35
|
-
fromAddress: e,
|
|
36
|
-
// we user zero address here because this paramater is not relevant to us, only destReceiver is
|
|
37
|
-
destReceiver: i.getContractMetadata(a.OneInchExternalActionContract).address,
|
|
38
|
-
amount: c(t, n),
|
|
39
|
-
slippage: 10,
|
|
40
|
-
disableEstimate: !0,
|
|
41
|
-
// disable gas estimation, we don't need it
|
|
42
|
-
// disable partial filling:
|
|
43
|
-
// if slippage tolerance isn't satisfied 1inch will try to swap less amount of input tokens
|
|
44
|
-
// and returning leftover tokens to fromAddress
|
|
45
|
-
// this is not what we want
|
|
46
|
-
allowPartialFill: !1
|
|
47
|
-
}, r = await p(i.getCurrentChainId(), o);
|
|
48
|
-
if (!r || !r.tx)
|
|
49
|
-
throw Error("OneInch API price fetch error");
|
|
50
|
-
return {
|
|
51
|
-
outSwapAmountValue: BigInt(r.toAmount),
|
|
52
|
-
oneInchDataValue: r.tx.data
|
|
53
|
-
// calldata to use
|
|
54
|
-
};
|
|
55
|
-
} catch (o) {
|
|
56
|
-
throw console.log({ error: o }), Error(d.NO_ONEINCH_PRICE);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
export {
|
|
60
|
-
W as getOneInchPrice
|
|
61
|
-
};
|