@hinkal/common 0.2.11 → 0.2.12
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/package.json +16 -41
- package/API/API.d.mts +0 -49
- package/API/HinkalPointsCalls.d.mts +0 -20
- package/API/callBeefyGraphAPI.d.mts +0 -2
- package/API/callCurveAPI.d.mts +0 -9
- package/API/callMonitor.d.mts +0 -1
- package/API/callOdosAPI.d.mts +0 -63
- package/API/callOneInchAPI.d.mts +0 -18
- package/API/callRelayer.d.mts +0 -10
- package/API/checkRisk.d.mts +0 -1
- package/API/dataServerCalls.d.mts +0 -2
- package/API/duneAPI.d.mts +0 -11
- package/API/fetchCommitmentsCache.d.mts +0 -20
- package/API/fetchNullifiers.d.mts +0 -5
- package/API/getAxelarGasEstimate.d.mts +0 -5
- package/API/getCoingeckoPrice.d.mts +0 -22
- package/API/getConnextReceiveFee.d.mts +0 -2
- package/API/getGasEstimates.d.mts +0 -9
- package/API/getRelayerURL.d.mts +0 -1
- package/API/getServerURL.d.mts +0 -2
- package/API/getTokenPrice.d.mts +0 -16
- package/API/index.d.mts +0 -14
- package/API/kycCalls.d.mts +0 -30
- package/API/passwordCalls.d.mts +0 -9
- package/API/referralProgramCalls.d.mts +0 -36
- package/API/relayCalls.d.mts +0 -5
- package/API/restoreSnapshots.d.mts +0 -1
- package/API/rewardsPointsCalls.d.mts +0 -13
- package/API/userVerifyTransactions.d.mts +0 -19
- package/constants/assets.constants.d.mts +0 -13
- package/constants/axelar.constants.d.mts +0 -5
- package/constants/backend.constants.d.mts +0 -11
- package/constants/beefy.registry.d.mts +0 -8
- package/constants/chains.constants.d.mts +0 -36
- package/constants/coingecko.constants.d.mts +0 -13
- package/constants/contracts.constants.d.mts +0 -119
- package/constants/crvCvx.registry.d.mts +0 -20
- package/constants/crvDynamic.registry.d.mts +0 -1
- package/constants/deploy-data/index.d.mts +0 -11
- package/constants/fees.constants.d.mts +0 -11
- package/constants/index.d.mts +0 -20
- package/constants/kyc.constants.d.mts +0 -28
- package/constants/lido.constants.d.mts +0 -10
- package/constants/pendle.registry.d.mts +0 -21
- package/constants/protocol.constants.d.mts +0 -18
- package/constants/reorg-depths.constants.d.mts +0 -3
- package/constants/rewards.constants.d.mts +0 -19
- package/constants/server.constants.d.mts +0 -155
- package/constants/token-data/ERC20Registry.d.mts +0 -3
- package/constants/token-data/index.d.mts +0 -976
- package/constants/token-data/popularTokens.constants.d.mts +0 -3
- package/constants/token-data/tokenPricing.consts.d.mts +0 -5
- package/constants/vite.constants.d.mts +0 -14
- package/crypto/babyJub.d.mts +0 -16
- package/crypto/index.d.mts +0 -3
- package/crypto/poseidon.d.mts +0 -15
- package/crypto/preProcessing.d.mts +0 -1
- package/data-structures/Hinkal/Hinkal.d.mts +0 -100
- package/data-structures/Hinkal/IHinkal.d.mts +0 -93
- package/data-structures/Hinkal/hinkalActionBeefy.d.mts +0 -3
- package/data-structures/Hinkal/hinkalActionConvex.d.mts +0 -12
- package/data-structures/Hinkal/hinkalActionCurve.d.mts +0 -12
- package/data-structures/Hinkal/hinkalActionLidoEth.d.mts +0 -4
- package/data-structures/Hinkal/hinkalActionPendle.d.mts +0 -3
- package/data-structures/Hinkal/hinkalActionPendleLP.d.mts +0 -7
- package/data-structures/Hinkal/hinkalActionStake.d.mts +0 -3
- package/data-structures/Hinkal/hinkalActionVolatile.d.mts +0 -3
- package/data-structures/Hinkal/hinkalDeposit.d.mts +0 -3
- package/data-structures/Hinkal/hinkalGetRecipientInfo.d.mts +0 -2
- package/data-structures/Hinkal/hinkalGetZkMeProvider.d.mts +0 -3
- package/data-structures/Hinkal/hinkalPrivateWallet.d.mts +0 -2
- package/data-structures/Hinkal/hinkalSwap.d.mts +0 -3
- package/data-structures/Hinkal/hinkalTransfer.d.mts +0 -1
- package/data-structures/Hinkal/hinkalWithdraw.d.mts +0 -2
- package/data-structures/Hinkal/index.d.mts +0 -12
- package/data-structures/Hinkal/resetMerkleTrees.d.mts +0 -2
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.mts +0 -20
- package/data-structures/ValueCache/ValueCache.d.mts +0 -10
- package/data-structures/ValueCache/index.d.mts +0 -1
- package/data-structures/cacheDevices/BaseCacheDevice.d.mts +0 -8
- package/data-structures/cacheDevices/FileCacheDevice.d.mts +0 -9
- package/data-structures/cacheDevices/LocalStorageCacheDevice.d.mts +0 -7
- package/data-structures/cacheDevices/index.d.mts +0 -2
- package/data-structures/crypto-keys/decodeUTXO.d.mts +0 -14
- package/data-structures/crypto-keys/encryptDecryptUtxo.d.mts +0 -18
- package/data-structures/crypto-keys/index.d.mts +0 -4
- package/data-structures/crypto-keys/keyUtils.d.mts +0 -2
- package/data-structures/crypto-keys/keys.d.mts +0 -58
- package/data-structures/custom-token-registry/CustomTokenRegistry.d.mts +0 -13
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.d.mts +0 -35
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.d.mts +0 -30
- package/data-structures/event-service/AbstractEventService.d.mts +0 -31
- package/data-structures/event-service/AbstractNullifierSnapshotService.d.mts +0 -22
- package/data-structures/event-service/AbstractSnapshotService.d.mts +0 -23
- package/data-structures/event-service/index.d.mts +0 -5
- package/data-structures/index.d.mts +0 -13
- package/data-structures/merkle-tree/MerkleTree.d.mts +0 -78
- package/data-structures/merkle-tree/MerkleTreeIncompleteError.d.mts +0 -3
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.mts +0 -3
- package/data-structures/merkle-tree/index.d.mts +0 -3
- package/data-structures/provider-adapter/IProviderAdapter.d.mts +0 -35
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.d.mts +0 -7
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.d.mts +0 -7
- package/data-structures/snapshot/ClientNullifierSnapshotService.d.mts +0 -7
- package/data-structures/token-price-fetcher/TokenChecker.d.mts +0 -20
- package/data-structures/token-price-fetcher/index.d.mts +0 -1
- package/data-structures/transactions-manager/TransactionsManager.d.mts +0 -27
- package/data-structures/transactions-manager/history/getBeefyData.d.mts +0 -3
- package/data-structures/transactions-manager/history/getConvexData.d.mts +0 -6
- package/data-structures/transactions-manager/history/getCurveData.d.mts +0 -6
- package/data-structures/transactions-manager/history/getDepositData.d.mts +0 -2
- package/data-structures/transactions-manager/history/getLidoData.d.mts +0 -10
- package/data-structures/transactions-manager/history/getPendleData.d.mts +0 -3
- package/data-structures/transactions-manager/history/getSwapData.d.mts +0 -3
- package/data-structures/transactions-manager/history/getTxDetails.d.mts +0 -3
- package/data-structures/transactions-manager/history/getVolatileData.d.mts +0 -32
- package/data-structures/transactions-manager/history/history.types.d.mts +0 -95
- package/data-structures/transactions-manager/history/history.utils.d.mts +0 -8
- package/data-structures/transactions-manager/index.d.mts +0 -2
- package/data-structures/utxo/Utxo.d.mts +0 -63
- package/data-structures/volatile-helper/VolatileHelper.d.mts +0 -57
- package/data-structures/volatile-helper/index.d.mts +0 -1
- package/error-handling/customErrors/ErrorWithAmount.d.mts +0 -4
- package/error-handling/customErrors/FeeOverTransactionValueError.d.mts +0 -9
- package/error-handling/customErrors/customErrors.helpers.d.mts +0 -5
- package/error-handling/customErrors/index.d.mts +0 -3
- package/error-handling/error-codes.constants.d.mts +0 -181
- package/error-handling/get-error.message.d.mts +0 -3
- package/error-handling/handleErrorRestore.d.mts +0 -2
- package/error-handling/index.d.mts +0 -7
- package/error-handling/logError.d.mts +0 -1
- package/error-handling/types.d.mts +0 -5
- package/externalABIs/BUSD.d.mts +0 -38
- package/externalABIs/DAI.d.mts +0 -45
- package/externalABIs/ERC20.d.mts +0 -1
- package/externalABIs/SanctionsList.d.mts +0 -35
- package/externalABIs/USDC.d.mts +0 -28
- package/externalABIs/USDR.d.mts +0 -28
- package/externalABIs/USDR3CRV.d.mts +0 -49
- package/externalABIs/USDT.d.mts +0 -41
- package/externalABIs/WETH.d.mts +0 -38
- package/externalABIs/amToken.d.mts +0 -28
- package/externalABIs/crvFRAX.d.mts +0 -38
- package/externalABIs/index.d.mts +0 -323
- package/externalABIs/swapAbi.d.mts +0 -77
- package/functions/index.d.mts +0 -14
- package/functions/kyc/aiPriseHelper.d.mts +0 -0
- package/functions/kyc/authentoHelper.d.mts +0 -12
- package/functions/kyc/index.d.mts +0 -3
- package/functions/kyc/openDefaultPassportWindow.d.mts +0 -1
- package/functions/kyc/passportHelper.d.mts +0 -3
- package/functions/kyc/zkMeHelper.d.mts +0 -4
- package/functions/pre-transaction/getFlatFees.d.mts +0 -12
- package/functions/pre-transaction/index.d.mts +0 -5
- package/functions/pre-transaction/interaction-to-action.d.mts +0 -2
- package/functions/pre-transaction/outputUtxoProcessing.d.mts +0 -5
- package/functions/pre-transaction/process-gas-estimates.d.mts +0 -5
- package/functions/pre-transaction/processAmountChanges.d.mts +0 -12
- package/functions/private-wallet/emporium.helpers.d.mts +0 -5
- package/functions/private-wallet/index.d.mts +0 -2
- package/functions/private-wallet/opProducer.d.mts +0 -5
- package/functions/protocols/convex.protocols.d.mts +0 -1
- package/functions/protocols/curve.protocols.d.mts +0 -1
- package/functions/protocols/index.d.mts +0 -3
- package/functions/protocols/pendle.helpers.d.mts +0 -8
- package/functions/snarkjs/common.snarkjs.d.mts +0 -22
- package/functions/snarkjs/constant.d.mts +0 -151
- package/functions/snarkjs/constructEmporiumProof.d.mts +0 -10
- package/functions/snarkjs/constructGeneralZkProof.d.mts +0 -12
- package/functions/snarkjs/generateCircomData.d.mts +0 -4
- package/functions/snarkjs/generateZkProof.d.mts +0 -5
- package/functions/snarkjs/generateZkProofEnclave.d.mts +0 -5
- package/functions/snarkjs/generateZkProofSelf.d.mts +0 -5
- package/functions/snarkjs/getZKFiles.d.mts +0 -2
- package/functions/snarkjs/index.d.mts +0 -4
- package/functions/staking/index.d.mts +0 -11
- package/functions/utils/amounts.utils.d.mts +0 -21
- package/functions/utils/axelar.utils.d.mts +0 -2
- package/functions/utils/cacheDevice.utils.d.mts +0 -3
- package/functions/utils/cacheFunctions.d.mts +0 -17
- package/functions/utils/caseInsensitive.utils.d.mts +0 -3
- package/functions/utils/convertIntegrationProviderToExternalActionId.d.mts +0 -2
- package/functions/utils/create-provider.d.mts +0 -2
- package/functions/utils/enum.utils.d.mts +0 -9
- package/functions/utils/erc20tokenFunctions.d.mts +0 -4
- package/functions/utils/evmNetworkFunctions.d.mts +0 -4
- package/functions/utils/external-action.utils.d.mts +0 -8
- package/functions/utils/getDataFromTransaction.d.mts +0 -45
- package/functions/utils/index.d.mts +0 -21
- package/functions/utils/memoize.utils.d.mts +0 -1
- package/functions/utils/nickname.utils.d.mts +0 -1
- package/functions/utils/process.utils.d.mts +0 -7
- package/functions/utils/reloadPage.d.mts +0 -1
- package/functions/utils/requireEnv.d.mts +0 -1
- package/functions/utils/resolve-sync.utils.d.mts +0 -6
- package/functions/utils/serialize.utils.d.mts +0 -1
- package/functions/utils/string.utils.d.mts +0 -8
- package/functions/utils/time.utils.d.mts +0 -1
- package/functions/utils/userAgent.d.mts +0 -2
- package/functions/utils/volatile-patcher.utils.d.mts +0 -1
- package/functions/web3/etherFunctions.d.mts +0 -20
- package/functions/web3/events/balanceChangedHandler.d.mts +0 -1
- package/functions/web3/events/getInputUtxoAndBalance.d.mts +0 -24
- package/functions/web3/events/getShieldedBalance.d.mts +0 -18
- package/functions/web3/events/index.d.mts +0 -4
- package/functions/web3/events/web3RetrieveEvents.d.mts +0 -14
- package/functions/web3/functionCalls/accessTokenCalls.d.mts +0 -6
- package/functions/web3/functionCalls/approveToken.d.mts +0 -4
- package/functions/web3/functionCalls/estimateGasRelayer.d.mts +0 -4
- package/functions/web3/functionCalls/getRootHash.d.mts +0 -2
- package/functions/web3/functionCalls/relayFunctions.d.mts +0 -17
- package/functions/web3/functionCalls/transactCallDirect.d.mts +0 -6
- package/functions/web3/functionCalls/transactCallRelayer.d.mts +0 -7
- package/functions/web3/getContractMetadata.d.mts +0 -5
- package/functions/web3/index.d.mts +0 -6
- package/functions/web3/odosAPI.d.mts +0 -5
- package/functions/web3/oneInchAPI.d.mts +0 -5
- package/functions/web3/runContractFunction.d.mts +0 -15
- package/functions/web3/uniswapAPI.d.mts +0 -16
- package/index.d.mts +0 -8
- package/providers/EthersProviderAdapter.d.mts +0 -39
- package/providers/WagmiProviderAdapter.d.mts +0 -46
- package/providers/exportProviers.d.mts +0 -3
- package/providers/prepareEthersHinkal.d.mts +0 -4
- package/providers/prepareWagmiHinkal.d.mts +0 -3
- package/types/API.types.d.mts +0 -23
- package/types/ICacheDevice.d.mts +0 -4
- package/types/IMultiThreadedUtxoUtils.d.mts +0 -8
- package/types/admin.types.d.mts +0 -22
- package/types/axelar.types.d.mts +0 -14
- package/types/beefy.types.d.mts +0 -11
- package/types/big-intable.types.d.mts +0 -2
- package/types/circom-data.types.d.mts +0 -70
- package/types/coingecko.types.d.mts +0 -8
- package/types/commitments.types.d.mts +0 -26
- package/types/connext.types.d.mts +0 -13
- package/types/crypto.types.d.mts +0 -7
- package/types/curve.types.d.mts +0 -133
- package/types/duneAPI.types.d.mts +0 -9
- package/types/ethereum-network.types.d.mts +0 -142
- package/types/external-action.types.d.mts +0 -28
- package/types/hinkal.stake.types.d.mts +0 -11
- package/types/hinkal.types.d.mts +0 -150
- package/types/hinkalTvl.types.d.mts +0 -4
- package/types/index.d.mts +0 -27
- package/types/kyc.types.d.mts +0 -39
- package/types/pendle.api.types.d.mts +0 -233
- package/types/pendle.types.d.mts +0 -222
- package/types/relayer.types.d.mts +0 -25
- package/types/remote-proof.types.d.mts +0 -15
- package/types/rewards.types.d.mts +0 -230
- package/types/slippage.types.d.mts +0 -15
- package/types/snark.types.d.mts +0 -40
- package/types/time.types.d.mts +0 -31
- package/types/token.types.d.mts +0 -36
- package/types/transactions.types.d.mts +0 -55
- package/webworker/performTaskWithWorker.d.mts +0 -5
- package/webworker/snarkjsWorker/snarkjsWorker.types.d.mts +0 -14
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.d.mts +0 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.d.mts +0 -10
- package/webworker/utxoWorker/utxoWorker.types.d.mts +0 -29
- package/webworker/utxoWorker/utxoWorkerLauncher.d.mts +0 -1
- package/webworker/utxoWorker/utxoWorkerLogic.d.mts +0 -8
- package/webworker/viteWorkerURL.constant.d.mts +0 -9
- package/webworker/worker.registry.d.mts +0 -10
- package/webworker/worker.types.d.mts +0 -33
- package/webworker/workerErrorHandler.d.mts +0 -1
- package/webworker/workerFactory.d.mts +0 -7
- package/webworker/workerProxy.d.mts +0 -40
- package/webworker/zkProofWorker/zkProofWorker.types.d.mts +0 -38
- package/webworker/zkProofWorker/zkProofWorkerLauncher.d.mts +0 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.d.mts +0 -8
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const urlForBeefyVaultTotalInUSD = "https://api.beefy.finance/tvl";
|
|
2
|
-
export declare const urlForBeefyVaultTokens = "https://api.beefy.finance/vaults";
|
|
3
|
-
export declare const urlForBeefyVaultLpTokens = "https://api.beefy.finance/lps";
|
|
4
|
-
export declare const urlForRegularTokenPricesInBeefy = "https://api.beefy.finance/prices";
|
|
5
|
-
export declare const urlForPendleAPI = "https://api-v2.pendle.finance/core/v1/";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const isNode: boolean;
|
|
2
|
-
export declare const isWebpack: boolean;
|
|
3
|
-
export declare enum DEPLOYMENT_MODE {
|
|
4
|
-
DEVELOPMENT = "development",
|
|
5
|
-
STAGING = "staging",
|
|
6
|
-
PLAYGROUND = "playground",
|
|
7
|
-
PRODUCTION = "production"
|
|
8
|
-
}
|
|
9
|
-
export declare const deploymentMode: DEPLOYMENT_MODE | undefined;
|
|
10
|
-
export declare const isStaging: boolean;
|
|
11
|
-
export declare const isPlayground: boolean;
|
|
12
|
-
export declare const isDevelopment: boolean;
|
|
13
|
-
export declare const isNotProduction: boolean;
|
|
14
|
-
export declare const isNotClientProduction: boolean;
|
package/crypto/babyJub.d.mts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
declare class JubHolder {
|
|
2
|
-
private babyjub;
|
|
3
|
-
init(): Promise<void>;
|
|
4
|
-
getJub(): any;
|
|
5
|
-
}
|
|
6
|
-
export declare const jubHolder: JubHolder;
|
|
7
|
-
export declare const babyJubInstance: () => any;
|
|
8
|
-
export type JubPoint = [bigint, bigint];
|
|
9
|
-
export interface BabyJubType {
|
|
10
|
-
mulPointEscalar: (point: [Uint8Array, Uint8Array], s: bigint) => [Uint8Array, Uint8Array];
|
|
11
|
-
F: {
|
|
12
|
-
toString: (arr: Uint8Array) => string;
|
|
13
|
-
};
|
|
14
|
-
Base8: [Uint8Array, Uint8Array];
|
|
15
|
-
}
|
|
16
|
-
export {};
|
package/crypto/index.d.mts
DELETED
package/crypto/poseidon.d.mts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare class PoseidonHolder {
|
|
2
|
-
private poseidon;
|
|
3
|
-
init(): Promise<void>;
|
|
4
|
-
getPoseidon(): any;
|
|
5
|
-
}
|
|
6
|
-
export declare const poseidonHolder: PoseidonHolder;
|
|
7
|
-
export declare function poseidonFunction<T = any>(...args: T[]): bigint;
|
|
8
|
-
/**
|
|
9
|
-
* hashing algorithm implementation
|
|
10
|
-
* @param args rest parameter to take unlimited number of arguments
|
|
11
|
-
* @returns poseidon hash in base 16
|
|
12
|
-
*/
|
|
13
|
-
export declare const poseidonHash: (...args: unknown[]) => string;
|
|
14
|
-
export type PoseidonHasher = (...args: unknown[]) => string;
|
|
15
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const preProcessing: () => Promise<void>;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { ContractTransaction, ethers } from 'ethers';
|
|
2
|
-
import { AxelarMigrationInfo } from '../../types/axelar.types';
|
|
3
|
-
import { BeefyAction, ConvexAction, CurveAction, HinkalConfig, LidoAction, LidoVariant, VolatileHelperData } from '../../types/hinkal.types';
|
|
4
|
-
import { ContractMetadata, ContractType, EthereumNetwork } from '../../types/ethereum-network.types';
|
|
5
|
-
import { EncryptedOutputWithSign } from '../../types/commitments.types';
|
|
6
|
-
import { ExternalActionId } from '../../types/external-action.types';
|
|
7
|
-
import { HinkalStakeMode } from '../../types/hinkal.stake.types';
|
|
8
|
-
import { type IMultiThreadedUtxoUtils } from '../../types/IMultiThreadedUtxoUtils';
|
|
9
|
-
import { PendleLPMetadata, PendleMetadata } from '../../types/pendle.types';
|
|
10
|
-
import { RelayerTransaction } from '../../types/relayer.types';
|
|
11
|
-
import { SignatureData } from '../../types/crypto.types';
|
|
12
|
-
import { TokenBalance } from '../../types/token.types';
|
|
13
|
-
import { UserKeys } from '../crypto-keys/keys';
|
|
14
|
-
import { ClientAccessTokenSnapshotService } from '../snapshot/ClientAccessTokenSnapshotService';
|
|
15
|
-
import { ClientCommitmentsSnapshotService } from '../snapshot/ClientCommitmentsSnapshotService';
|
|
16
|
-
import { ClientNullifierSnapshotService } from '../snapshot/ClientNullifierSnapshotService';
|
|
17
|
-
import { IProviderAdapter } from '../provider-adapter/IProviderAdapter';
|
|
18
|
-
import { type IHinkal } from './IHinkal';
|
|
19
|
-
import { MerkleTree } from '../merkle-tree';
|
|
20
|
-
import { IAPI } from '../../API';
|
|
21
|
-
import { TransactionsManager } from '../transactions-manager';
|
|
22
|
-
import { type ICacheDevice } from '../../types/ICacheDevice';
|
|
23
|
-
export declare class Hinkal<ConnectorType> implements IHinkal {
|
|
24
|
-
private providerAdapter?;
|
|
25
|
-
userKeys: UserKeys;
|
|
26
|
-
readonly signingMessage: string;
|
|
27
|
-
merkleTreeHinkal: MerkleTree<bigint>;
|
|
28
|
-
merkleTreeAccessToken: MerkleTree<bigint>;
|
|
29
|
-
nullifiers: Set<string>;
|
|
30
|
-
encryptedOutputs: EncryptedOutputWithSign[];
|
|
31
|
-
commitmentsSnapshotService?: ClientCommitmentsSnapshotService;
|
|
32
|
-
nullifierSnapshotService?: ClientNullifierSnapshotService;
|
|
33
|
-
accessTokenSnapshotService?: ClientAccessTokenSnapshotService;
|
|
34
|
-
transactionsManager: TransactionsManager;
|
|
35
|
-
utxoUtils: IMultiThreadedUtxoUtils;
|
|
36
|
-
cacheDevice: ICacheDevice;
|
|
37
|
-
generateProofRemotely: boolean;
|
|
38
|
-
constructor(hinkalConfig?: HinkalConfig);
|
|
39
|
-
initProviderAdapter(connector: ConnectorType, providerAdapter: IProviderAdapter<ConnectorType>): Promise<void>;
|
|
40
|
-
initUserKeys(): Promise<void>;
|
|
41
|
-
initUserKeysWithPassword(password: string): Promise<void>;
|
|
42
|
-
resetMerkle(): Promise<void>;
|
|
43
|
-
getProviderAdapter(): IProviderAdapter<ConnectorType>;
|
|
44
|
-
waitForTransaction(transactionHash: string, confirmations?: number): Promise<boolean>;
|
|
45
|
-
getContractMetadata(contractType: ContractType, chainId?: number): ContractMetadata;
|
|
46
|
-
getContract(contractType: ContractType, contractAddress?: undefined, chainId?: number): ethers.Contract;
|
|
47
|
-
getContractWithFetcherByChainId(chainId: number, contractType: ContractType, contractAddress?: undefined): ethers.Contract;
|
|
48
|
-
signMessage(message: string): Promise<string>;
|
|
49
|
-
signTypedData(domain: ethers.TypedDataDomain, types: Record<string, ethers.TypedDataField[]>, value: Record<string, unknown>): Promise<string>;
|
|
50
|
-
getContractWithSigner(contract: ContractType, contractAddress?: string): ethers.Contract;
|
|
51
|
-
getContractWithFetcher(contract: ContractType, contractAddress?: string): ethers.Contract;
|
|
52
|
-
getContractWithFetcherForEthereum(contract: ContractType, address: string): ethers.Contract;
|
|
53
|
-
isSelectedNetworkSupported(): boolean;
|
|
54
|
-
switchNetwork(network: EthereumNetwork): Promise<void>;
|
|
55
|
-
getCurrentChainId(): number;
|
|
56
|
-
getSelectedNetwork(): EthereumNetwork | undefined;
|
|
57
|
-
isPermitterAvailable(): boolean;
|
|
58
|
-
connectAndPatchProvider(connector: ConnectorType): Promise<number>;
|
|
59
|
-
disconnectFromConnector(): Promise<void>;
|
|
60
|
-
updateProviderAdapter(providerAdapter: IProviderAdapter): Promise<void>;
|
|
61
|
-
setListeners(): Promise<void>;
|
|
62
|
-
private onAccountChanged;
|
|
63
|
-
private onChainChanged;
|
|
64
|
-
monitorConnectedAddress(): Promise<void>;
|
|
65
|
-
getBalances(): Promise<TokenBalance[]>;
|
|
66
|
-
getSupportedPassportLinks(): string[];
|
|
67
|
-
checkAccessToken(): Promise<boolean>;
|
|
68
|
-
getAxelarEstimate(chainId: number, sourceChainName: string, destChainName: string, sourceChainToken: string): Promise<import('../../API/getAxelarGasEstimate').AxelarGasResponse>;
|
|
69
|
-
getConnextReceiveFee(sourceChainName: string, destChainName: string): Promise<import('../../types/connext.types').ConnextFeeResponse>;
|
|
70
|
-
mintHinkalAccessToken(signatureData: SignatureData): Promise<ethers.ContractTransaction>;
|
|
71
|
-
mintHinkalAccessTokenCrossChain(signatureData: SignatureData, axelarMigrationInfos: AxelarMigrationInfo[]): Promise<ethers.ContractTransaction>;
|
|
72
|
-
getHinkalTreeRootHash(): Promise<any>;
|
|
73
|
-
getAccessTokenTreeRootHash(): Promise<any>;
|
|
74
|
-
resetMerkleTreesIfNecessary(): Promise<void>;
|
|
75
|
-
getEventsFromHinkal(): Promise<void>;
|
|
76
|
-
getEthereumAddress(): Promise<string>;
|
|
77
|
-
getRandomRelay(): Promise<string | undefined>;
|
|
78
|
-
getGasPrice(): Promise<bigint>;
|
|
79
|
-
getAPI(): IAPI;
|
|
80
|
-
resetCache(): void;
|
|
81
|
-
snapshotsClearInterval(): void;
|
|
82
|
-
getRecipientInfo(): string;
|
|
83
|
-
deposit(erc20Addresses: string[], amountChanges: bigint[]): Promise<ethers.ContractTransaction>;
|
|
84
|
-
depositForOther(erc20Addresses: string[], amountChanges: bigint[], recipientInfo: string): Promise<ethers.ContractTransaction>;
|
|
85
|
-
withdraw(erc20Addresses: string[], amountChanges: bigint[], recipientAddress: string, isRelayerOff: boolean, onlyGasEstimate?: boolean): Promise<ethers.ContractTransaction | RelayerTransaction | bigint>;
|
|
86
|
-
swap(erc20Addresses: string[], amountChanges: bigint[], externalActionId: ExternalActionId, swapData: string, onlyGasEstimate?: boolean, withPrivateMempool?: boolean): Promise<RelayerTransaction | bigint>;
|
|
87
|
-
actionCurve(tokens: string[], tokenAmounts: bigint[], poolAddress: string, curveAction: CurveAction, newVersion: boolean, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
88
|
-
actionConvex(tokens: string[], tokenAmounts: bigint[], poolId: number, convexAction: ConvexAction, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
89
|
-
actionBeefy(tokens: string[], tokenAmounts: bigint[], beefyAction: BeefyAction, oneInchData: string[], zapAddress: string, boostAddress: string | undefined, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
90
|
-
actionLido(lidoVariant: LidoVariant, lidoAction: LidoAction, tokens: string[], tokenAmounts: bigint[], tokenIds: number[], onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
91
|
-
actionPendle(erc20Addresses: string[], amountChanges: bigint[], pendleMetadata: PendleMetadata, gasTokenAddress?: string, onlyGasEstimate?: boolean): Promise<RelayerTransaction | ContractTransaction | bigint>;
|
|
92
|
-
actionPendleLP(erc20Addresses: string[], amountChanges: bigint[], pendleLPMetadata: PendleLPMetadata, gasTokenAddress?: string, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
93
|
-
actionVolatile(erc20Addresses: string[], amountChanges: bigint[], volatileHelperData: VolatileHelperData, onlyGasEstimate?: boolean): Promise<RelayerTransaction | ContractTransaction | bigint>;
|
|
94
|
-
actionStake(erc20Addresses: string[], amountChanges: bigint[], stakeMode: HinkalStakeMode, stakedTokenRecipient: string): Promise<ContractTransaction>;
|
|
95
|
-
actionPrivateWallet(erc20Addresses: string[], amountChanges: bigint[], onChainCreation: boolean[], ops?: string[], walletNonce?: bigint, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
96
|
-
getPendleLPClaimableParams(wlpTokenAddress: string, wlpTokenBalance: bigint): Promise<{
|
|
97
|
-
amount: bigint;
|
|
98
|
-
timestamp: string;
|
|
99
|
-
}>;
|
|
100
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { AxelarMigrationInfo } from '../../types/axelar.types';
|
|
2
|
-
import { BeefyAction, ConvexAction, CurveAction, LidoAction, LidoVariant, VolatileHelperData } from '../../types/hinkal.types';
|
|
3
|
-
import { ContractMetadata, ContractType, EthereumNetwork } from '../../types/ethereum-network.types';
|
|
4
|
-
import { EncryptedOutputWithSign } from '../../types/commitments.types';
|
|
5
|
-
import { ExternalActionId } from '../../types/external-action.types';
|
|
6
|
-
import { HinkalStakeMode } from '../../types/hinkal.stake.types';
|
|
7
|
-
import { type IMultiThreadedUtxoUtils } from '../../types/IMultiThreadedUtxoUtils';
|
|
8
|
-
import { PendleLPMetadata, PendleMetadata } from '../../types/pendle.types';
|
|
9
|
-
import { RelayerTransaction } from '../../types/relayer.types';
|
|
10
|
-
import { SignatureData } from '../../types/crypto.types';
|
|
11
|
-
import { TokenBalance } from '../../types/token.types';
|
|
12
|
-
import { Bytes, ContractTransaction, ethers } from 'ethers';
|
|
13
|
-
import { type UserKeys } from '../crypto-keys/keys';
|
|
14
|
-
import { IProviderAdapter } from '../provider-adapter/IProviderAdapter';
|
|
15
|
-
import { ClientAccessTokenSnapshotService } from '../snapshot/ClientAccessTokenSnapshotService';
|
|
16
|
-
import { ClientCommitmentsSnapshotService } from '../snapshot/ClientCommitmentsSnapshotService';
|
|
17
|
-
import { ClientNullifierSnapshotService } from '../snapshot/ClientNullifierSnapshotService';
|
|
18
|
-
import { MerkleTree } from '../merkle-tree';
|
|
19
|
-
import { TransactionsManager } from '../transactions-manager/TransactionsManager';
|
|
20
|
-
import { IAPI } from '../../API/API';
|
|
21
|
-
import { AxelarGasResponse } from '../../API/getAxelarGasEstimate';
|
|
22
|
-
import { type ICacheDevice } from '../../types/ICacheDevice';
|
|
23
|
-
export interface IHinkal<ConnectorType = unknown> {
|
|
24
|
-
userKeys: UserKeys;
|
|
25
|
-
readonly signingMessage: string;
|
|
26
|
-
merkleTreeHinkal: MerkleTree<bigint>;
|
|
27
|
-
merkleTreeAccessToken: MerkleTree<bigint>;
|
|
28
|
-
nullifiers: Set<string>;
|
|
29
|
-
encryptedOutputs: EncryptedOutputWithSign[];
|
|
30
|
-
commitmentsSnapshotService?: ClientCommitmentsSnapshotService;
|
|
31
|
-
nullifierSnapshotService?: ClientNullifierSnapshotService;
|
|
32
|
-
accessTokenSnapshotService?: ClientAccessTokenSnapshotService;
|
|
33
|
-
transactionsManager: TransactionsManager;
|
|
34
|
-
generateProofRemotely: boolean;
|
|
35
|
-
utxoUtils: IMultiThreadedUtxoUtils;
|
|
36
|
-
cacheDevice: ICacheDevice;
|
|
37
|
-
getBalances(): Promise<TokenBalance[]>;
|
|
38
|
-
getSupportedPassportLinks(): string[];
|
|
39
|
-
checkAccessToken(): Promise<boolean>;
|
|
40
|
-
getAxelarEstimate(chainId: number, sourceChainName: string, destChainName: string, sourceChainToken: string): Promise<AxelarGasResponse>;
|
|
41
|
-
getEthereumAddress(): Promise<string>;
|
|
42
|
-
resetMerkleTreesIfNecessary(): Promise<void>;
|
|
43
|
-
resetMerkle(): Promise<void>;
|
|
44
|
-
getEventsFromHinkal(): Promise<void>;
|
|
45
|
-
mintHinkalAccessToken(signatureData: SignatureData): Promise<ethers.ContractTransaction>;
|
|
46
|
-
mintHinkalAccessTokenCrossChain(signatureData: SignatureData, axelarMigrationInfos: AxelarMigrationInfo[]): Promise<ethers.ContractTransaction>;
|
|
47
|
-
getRandomRelay(): Promise<string | undefined>;
|
|
48
|
-
getGasPrice(): Promise<bigint>;
|
|
49
|
-
getAPI(): IAPI;
|
|
50
|
-
resetCache(): void;
|
|
51
|
-
snapshotsClearInterval(): void;
|
|
52
|
-
getRecipientInfo(): string;
|
|
53
|
-
deposit(erc20Addresses: string[], amountChanges: bigint[]): Promise<ethers.ContractTransaction>;
|
|
54
|
-
depositForOther(erc20Addresses: string[], amountChanges: bigint[], recepinetInfo: string): Promise<ethers.ContractTransaction>;
|
|
55
|
-
withdraw(erc20Addresses: string[], amountChanges: bigint[], recipientAddress: string, isRelayerOff: boolean, onlyGasEstimate?: boolean): Promise<ethers.ContractTransaction | RelayerTransaction | bigint>;
|
|
56
|
-
swap(erc20Addresses: string[], amountChanges: bigint[], externalActionId: ExternalActionId, swapData: string, onlyGasEstimate?: boolean, withPrivateMempool?: boolean): Promise<RelayerTransaction | bigint>;
|
|
57
|
-
actionCurve(tokens: string[], tokenAmounts: bigint[], poolAddress: string, curveAction: CurveAction, newVersion: boolean, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
58
|
-
actionConvex(tokens: string[], tokenAmounts: bigint[], poolId: number, convexAction: ConvexAction, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
59
|
-
actionBeefy(tokens: string[], tokenAmounts: bigint[], beefyAction: BeefyAction, oneInchData: string[], zapAddress: string, boostAddress: string | undefined, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
60
|
-
actionStake(erc20Addresses: string[], amountChanges: bigint[], stakeMode: HinkalStakeMode, stakedTokenRecipient: string): Promise<ethers.ContractTransaction>;
|
|
61
|
-
getProviderAdapter(): IProviderAdapter;
|
|
62
|
-
initUserKeys(): Promise<void>;
|
|
63
|
-
initUserKeysWithPassword(password: string): Promise<void>;
|
|
64
|
-
initProviderAdapter(connector: ConnectorType, providerAdapter: IProviderAdapter<ConnectorType>): Promise<void>;
|
|
65
|
-
connectAndPatchProvider(connector: ConnectorType): Promise<number>;
|
|
66
|
-
disconnectFromConnector(): Promise<void>;
|
|
67
|
-
updateProviderAdapter(providerAdapter: IProviderAdapter): Promise<void>;
|
|
68
|
-
setListeners(providerAdapter: IProviderAdapter): Promise<void>;
|
|
69
|
-
waitForTransaction(transactionHash: string, confirmations?: number): Promise<boolean>;
|
|
70
|
-
getContractMetadata(contractType: ContractType, chainId?: number): ContractMetadata;
|
|
71
|
-
getContract(contract: ContractType, contractAddress?: string, chainId?: number): ethers.Contract;
|
|
72
|
-
getContractWithSigner(contract: ContractType, contractAddress?: string): ethers.Contract;
|
|
73
|
-
getContractWithFetcher(contract: ContractType, contractAddress?: string): ethers.Contract;
|
|
74
|
-
getContractWithFetcherByChainId(chainId: number, contractType: ContractType, contractAddress?: string): ethers.Contract;
|
|
75
|
-
getContractWithFetcherForEthereum(contract: ContractType, contractAddress?: string): ethers.Contract;
|
|
76
|
-
isSelectedNetworkSupported(): boolean;
|
|
77
|
-
switchNetwork(network: EthereumNetwork): Promise<unknown>;
|
|
78
|
-
getCurrentChainId(): number;
|
|
79
|
-
monitorConnectedAddress(): Promise<void>;
|
|
80
|
-
getSelectedNetwork(): EthereumNetwork | undefined;
|
|
81
|
-
isPermitterAvailable(): boolean;
|
|
82
|
-
signMessage(message: Bytes | string): Promise<string>;
|
|
83
|
-
signTypedData(domain: ethers.TypedDataDomain, types: Record<string, ethers.TypedDataField[]>, value: Record<string, unknown>): Promise<string>;
|
|
84
|
-
actionLido(lidoVariant: LidoVariant, lidoAction: LidoAction, tokens: string[], tokenAmounts: bigint[], tokenIds: number[], onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
85
|
-
actionPendle(erc20Addresses: string[], amountChanges: bigint[], pendleMetadata: PendleMetadata, gasTokenAddress?: string, onlyGasEstimate?: boolean): Promise<RelayerTransaction | ContractTransaction | bigint>;
|
|
86
|
-
actionPendleLP(erc20Addresses: string[], amountChanges: bigint[], pendleLPMetadata: PendleLPMetadata, gasTokenAddress?: string, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
87
|
-
actionVolatile(erc20Addresses: string[], amountChanges: bigint[], volatileHelperData: VolatileHelperData, onlyGasEstimate?: boolean): Promise<RelayerTransaction | ContractTransaction | bigint>;
|
|
88
|
-
actionPrivateWallet(erc20Addresses: string[], amountChanges: bigint[], onChainCreation: boolean[], ops: string[], walletNonce?: bigint, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
89
|
-
getPendleLPClaimableParams(wlpTokenAddress: string, wlpTokenBalance: bigint): Promise<{
|
|
90
|
-
amount: bigint;
|
|
91
|
-
timestamp: string;
|
|
92
|
-
}>;
|
|
93
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { BeefyAction } from '../../types/hinkal.types';
|
|
2
|
-
import { IHinkal } from './IHinkal';
|
|
3
|
-
export declare const hinkalActionBeefy: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], beefyAction: BeefyAction, oneInchData: string[], zapAddress: string, boostAddress: string | undefined, onlyGasEstimate?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ConvexAction } from '../../types/hinkal.types';
|
|
2
|
-
import { IHinkal } from './IHinkal';
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param hinkal hinkal class instance
|
|
6
|
-
* @param tokenAddresses addresses of the tokenAddresses
|
|
7
|
-
* @param tokenAmounts token amounts
|
|
8
|
-
* @param minMintAmount LP Token amount
|
|
9
|
-
* @param poolAddress curve pool address
|
|
10
|
-
* @returns await transaction object
|
|
11
|
-
*/
|
|
12
|
-
export declare const hinkalActionConvex: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], poolId: number, convexAction: ConvexAction, onlyGasEstimate?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CurveAction } from '../../types/hinkal.types';
|
|
2
|
-
import { IHinkal } from './IHinkal';
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param hinkal hinkal class instance
|
|
6
|
-
* @param tokenAddresses addresses of the tokenAddresses
|
|
7
|
-
* @param tokenAmounts token amounts
|
|
8
|
-
* @param minMintAmount LP Token amount
|
|
9
|
-
* @param poolAddress curve pool address
|
|
10
|
-
* @returns await transaction object
|
|
11
|
-
*/
|
|
12
|
-
export declare const hinkalActionCurve: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], poolAddress: string, curveAction: CurveAction, newVersion: boolean, onlyGasEstimate?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { LidoAction, LidoVariant } from '../../types/hinkal.types';
|
|
2
|
-
import { RelayerTransaction } from '../../types/relayer.types';
|
|
3
|
-
import { IHinkal } from './IHinkal';
|
|
4
|
-
export declare const hinkalActionLido: (hinkal: IHinkal, lidoVariant: LidoVariant, lidoAction: LidoAction, erc20Addresses: string[], amountChanges: bigint[], tokenIds: number[], onlyGasEstimate?: boolean) => Promise<RelayerTransaction | bigint>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { PendleMetadata } from '../../types/pendle.types';
|
|
2
|
-
import { IHinkal } from './IHinkal';
|
|
3
|
-
export declare const hinkalActionPendle: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], pendleMetadata: PendleMetadata, gasTokenAddress?: string, onlyGasEstimate?: boolean) => Promise<any>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PendleLPMetadata } from '../../types';
|
|
2
|
-
import { IHinkal } from './IHinkal';
|
|
3
|
-
export declare const hinkalActionPendleLP: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], pendleLPMetadata: PendleLPMetadata, gasTokenAddress?: string, onlyGasEstimate?: boolean) => Promise<bigint | import('../../types/relayer.types').RelayerTransaction>;
|
|
4
|
-
export declare const hinkalGetPendleLPClaimableParams: (hinkal: IHinkal, wlpTokenAddress: string, wlpTokenBalance: bigint) => Promise<{
|
|
5
|
-
amount: bigint;
|
|
6
|
-
timestamp: string;
|
|
7
|
-
}>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { IHinkal } from './IHinkal';
|
|
2
|
-
import { VolatileHelperData } from '../../types/hinkal.types';
|
|
3
|
-
export declare const hinkalActionVolatile: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], volatileHelperData: VolatileHelperData, onlyGasEstimate: boolean) => Promise<any>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { IHinkal } from './IHinkal';
|
|
2
|
-
export declare const hinkalDeposit: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[]) => Promise<any>;
|
|
3
|
-
export declare const hinkalDepositForOther: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], recipinetInfo: string) => Promise<any>;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { IHinkal } from './IHinkal';
|
|
2
|
-
export declare const hinkalPrivateWallet: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], onChainCreation: boolean[], ops?: string[], walletNonce?: bigint, onlyGasEstimate?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ExternalActionId } from '../../types/external-action.types';
|
|
2
|
-
import { IHinkal } from './IHinkal';
|
|
3
|
-
export declare const hinkalSwap: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], externalActionId: ExternalActionId, data: string, onlyGasEstimate?: boolean, withPrivateMempool?: boolean) => Promise<bigint | import('../../index.ts').RelayerTransaction>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const hinkalTransfer: () => Promise<void>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './Hinkal';
|
|
2
|
-
export * from './IHinkal';
|
|
3
|
-
export * from './hinkalActionBeefy';
|
|
4
|
-
export * from './hinkalActionConvex';
|
|
5
|
-
export * from './hinkalActionCurve';
|
|
6
|
-
export * from './hinkalActionPendle';
|
|
7
|
-
export * from './hinkalDeposit';
|
|
8
|
-
export * from './hinkalSwap';
|
|
9
|
-
export * from './hinkalTransfer';
|
|
10
|
-
export * from './hinkalWithdraw';
|
|
11
|
-
export * from './hinkalPrivateWallet';
|
|
12
|
-
export * from './resetMerkleTrees';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { EncryptedOutputWithSign, OutputsWithSignAndLast } from '../../types/commitments.types';
|
|
2
|
-
import { IMultiThreadedUtxoUtils } from '../../types/IMultiThreadedUtxoUtils';
|
|
3
|
-
import { UserKeys } from '../crypto-keys/keys';
|
|
4
|
-
import { Utxo } from '../utxo/Utxo';
|
|
5
|
-
declare global {
|
|
6
|
-
interface Navigator {
|
|
7
|
-
deviceMemory: number | undefined;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare class MultiThreadedUtxoUtils implements IMultiThreadedUtxoUtils {
|
|
11
|
-
readonly NUM_WORKERS: number;
|
|
12
|
-
readonly NUM_WORKERS_BATCH_PROCESS: number;
|
|
13
|
-
constructor();
|
|
14
|
-
private createUtxoPromise;
|
|
15
|
-
batchFilterUtxosWithNullifier(allUtxos: Utxo[], nullifiers: Set<string>): Promise<Utxo[]>;
|
|
16
|
-
buildBatchProcess(encryptedOutputs: EncryptedOutputWithSign[], userKeys: UserKeys): Promise<Utxo[]>;
|
|
17
|
-
sliceArrayIntoParts<T>(arr: T[], numberOfParts: number): T[][];
|
|
18
|
-
findLastOutput(lastOutputsArray: string[], lastOutput: string): string;
|
|
19
|
-
batchProcess(encryptedOutputs: EncryptedOutputWithSign[], lastOutput: string, userKeys: UserKeys): Promise<OutputsWithSignAndLast<boolean>>;
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ValueCache';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ICacheDevice } from '../../types/ICacheDevice';
|
|
2
|
-
export declare abstract class BaseCacheDevice implements ICacheDevice {
|
|
3
|
-
protected inMemoryCache: Map<string, string>;
|
|
4
|
-
protected getInMemory(key: string): string | undefined;
|
|
5
|
-
protected setInMemory(key: string, value: string): void;
|
|
6
|
-
abstract get(key: string): string | undefined;
|
|
7
|
-
abstract set(key: string, value: string): void;
|
|
8
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseCacheDevice } from './BaseCacheDevice';
|
|
2
|
-
export declare class FileCacheDevice extends BaseCacheDevice {
|
|
3
|
-
private filePath;
|
|
4
|
-
private useFileCache;
|
|
5
|
-
constructor(useFileCache: boolean | undefined, filePath: string);
|
|
6
|
-
private readFileFromDevice;
|
|
7
|
-
get(key: string): string | undefined;
|
|
8
|
-
set(key: string, value: string): void;
|
|
9
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IUtxoConstructor, Utxo } from '../utxo/Utxo';
|
|
2
|
-
export declare const abiDecodeUtxo: (encryptedOutput: string) => {
|
|
3
|
-
amount: bigint;
|
|
4
|
-
erc20TokenAddress: string;
|
|
5
|
-
randomization: bigint;
|
|
6
|
-
stealthAddress: string;
|
|
7
|
-
H0: bigint;
|
|
8
|
-
H1: bigint;
|
|
9
|
-
timeStamp: string;
|
|
10
|
-
tokenId: number;
|
|
11
|
-
};
|
|
12
|
-
export declare const decodeUtxoConstructorArgs: (encryptedOutput: string, privateKey: string) => IUtxoConstructor;
|
|
13
|
-
export declare const decodeUtxo: (encryptedOutput: string, privateKey: string) => Utxo;
|
|
14
|
-
export declare const checkUtxoSignature: (encryptedOutput: string, privateKey: string) => boolean;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { IUtxoConstructor, Utxo } from '../utxo/Utxo';
|
|
2
|
-
import { UserKeys } from './keys';
|
|
3
|
-
/**
|
|
4
|
-
* encrypt data for the UTXO
|
|
5
|
-
* @param amount UTXO amount
|
|
6
|
-
* @param blinding UTXO blinding
|
|
7
|
-
* @param publicKey sender's encryption public key
|
|
8
|
-
* @returns returns encrypted data {Uint8Array}
|
|
9
|
-
*/
|
|
10
|
-
export declare const encryptUtxo: (utxo: Utxo, forceZeroAmount: boolean) => Uint8Array;
|
|
11
|
-
export declare const decryptUtxoConstructorArgs: (encryptedData: Uint8Array, userKeys: UserKeys) => IUtxoConstructor;
|
|
12
|
-
/**
|
|
13
|
-
* decrypt UTXO data from events
|
|
14
|
-
* @param encryptedData encrypted UTXO data {Uint8Array}
|
|
15
|
-
* @param publicKey/privateKey sender's encryption keys
|
|
16
|
-
* @returns decrypted UTXO data Object {amount, blinding}
|
|
17
|
-
*/
|
|
18
|
-
export declare const decryptUtxo: (encryptedData: Uint8Array, userKeys: UserKeys) => Utxo;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { JubPoint } from '../../crypto/babyJub';
|
|
2
|
-
export interface EncryptionKeyPair {
|
|
3
|
-
privateKey: string;
|
|
4
|
-
publicKey: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const EncryptionKeyPairDefaultValue: EncryptionKeyPair;
|
|
7
|
-
export declare class UserKeys {
|
|
8
|
-
private signature;
|
|
9
|
-
constructor(_signature?: string);
|
|
10
|
-
getSignature(): string;
|
|
11
|
-
setSignature(_signature: string): void;
|
|
12
|
-
private requireSignature;
|
|
13
|
-
verifyMessage(signingMessage: string): string;
|
|
14
|
-
/**
|
|
15
|
-
* get shielded private key from message signature used to login to the application,
|
|
16
|
-
* this private key is used to generate encryption keypairs as well as public key
|
|
17
|
-
* @retuns 0x-prefixed shielded private key
|
|
18
|
-
*/
|
|
19
|
-
getShieldedPrivateKey: () => string;
|
|
20
|
-
/**
|
|
21
|
-
* generate shielded public key from private key
|
|
22
|
-
* @param privateKey the key used to generate the shielded public key, this should be the signature
|
|
23
|
-
* that the user provided
|
|
24
|
-
* @retuns shielded public key in hexstring with 0x prefixed
|
|
25
|
-
*/
|
|
26
|
-
getShieldedPublicKey: () => string;
|
|
27
|
-
/**
|
|
28
|
-
* generate access token, this accessKey is what should be sent to the server for signing
|
|
29
|
-
* @returns accessKey in hexstring with 0x prefixed
|
|
30
|
-
*/
|
|
31
|
-
getAccessKey: () => string;
|
|
32
|
-
getWalletSalt: (walletNonce: bigint) => string;
|
|
33
|
-
/**
|
|
34
|
-
* generate backend token, which is used for access control on backend
|
|
35
|
-
* @returns accessKey in hexstring with 0x prefixed
|
|
36
|
-
*/
|
|
37
|
-
getBackendToken: () => string;
|
|
38
|
-
static getRandomizedStealthPair: (s: bigint, privateKey: string) => {
|
|
39
|
-
H0: JubPoint;
|
|
40
|
-
H1: JubPoint;
|
|
41
|
-
};
|
|
42
|
-
static getStealthAddressCompressedPoints: (s: bigint, privateKey: string) => {
|
|
43
|
-
h0: bigint;
|
|
44
|
-
h1: bigint;
|
|
45
|
-
};
|
|
46
|
-
static getStealthAddress: (s: bigint, privateKey: string) => string;
|
|
47
|
-
static getStealthAddressWithEKey: (s: bigint, privateKey: string) => {
|
|
48
|
-
stealthAddress: string;
|
|
49
|
-
encryptionKey: string;
|
|
50
|
-
};
|
|
51
|
-
static checkSignature: (s: bigint, stealthAddressH0: bigint, stealthAddressH1: bigint, privateKey: string) => boolean;
|
|
52
|
-
/**
|
|
53
|
-
* generate private and public keypair
|
|
54
|
-
* @param seed seed to use to deterministically generate key, must be in DataHexString format
|
|
55
|
-
* and must correspond to 32 bytes
|
|
56
|
-
*/
|
|
57
|
-
static getEncryptionKeyPair: (privateKey: string) => EncryptionKeyPair;
|
|
58
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ERC20Token } from '../../types/token.types';
|
|
2
|
-
declare class CustomTokenRegistry {
|
|
3
|
-
private localStorageKey;
|
|
4
|
-
tokenRegistry: ERC20Token[];
|
|
5
|
-
constructor();
|
|
6
|
-
private persistRegistry;
|
|
7
|
-
getCustomTokens(chainId: number): ERC20Token[];
|
|
8
|
-
tokenExists(registry: ERC20Token[], tokenToCheck: ERC20Token): ERC20Token | undefined;
|
|
9
|
-
addCustomToken(token: ERC20Token): void;
|
|
10
|
-
removeCustomToken(tokenToRemove: ERC20Token): void;
|
|
11
|
-
}
|
|
12
|
-
export declare const customTokenRegistry: CustomTokenRegistry;
|
|
13
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ethers } from 'ethers';
|
|
2
|
-
import { MerkleTree, MerkleTreeJson } from '../merkle-tree';
|
|
3
|
-
import { AccessTokenEvent } from '../../types';
|
|
4
|
-
import { AbstractSnapshotService, Snapshot } from './AbstractSnapshotService';
|
|
5
|
-
export type SenderAddressIndexMapJson = {
|
|
6
|
-
address: string;
|
|
7
|
-
index: number;
|
|
8
|
-
}[];
|
|
9
|
-
export type AccessTokenSnapshotPayload = {
|
|
10
|
-
readonly merkleTree: MerkleTree<bigint>;
|
|
11
|
-
readonly senderAddresses: string[];
|
|
12
|
-
readonly senderAddressIndexMap: Map<string, number>;
|
|
13
|
-
};
|
|
14
|
-
export type AccessTokenSerializedSnapshot = {
|
|
15
|
-
latestBlockNumber?: number;
|
|
16
|
-
reserveBlockNumber?: number;
|
|
17
|
-
merkleTree?: MerkleTreeJson;
|
|
18
|
-
senderAddresses?: string[];
|
|
19
|
-
senderAddressIndexMap?: SenderAddressIndexMapJson;
|
|
20
|
-
};
|
|
21
|
-
export declare abstract class AbstractAccessTokenSnapshotService extends AbstractSnapshotService<AccessTokenEvent<bigint>, AccessTokenEvent, AccessTokenSnapshotPayload, AccessTokenSerializedSnapshot> {
|
|
22
|
-
constructor(contract: ethers.Contract, initialBlockNumber: number, isServer: boolean, maxPageSize?: number);
|
|
23
|
-
private _merkleTree;
|
|
24
|
-
private _senderAddresses;
|
|
25
|
-
private _senderAddressIndexMap;
|
|
26
|
-
get merkleTree(): MerkleTree<bigint>;
|
|
27
|
-
get senderAddresses(): string[];
|
|
28
|
-
get senderAddressIndexMap(): Map<string, number>;
|
|
29
|
-
protected serializeSnapshot(snapshot: Snapshot<AccessTokenSnapshotPayload>): AccessTokenSerializedSnapshot;
|
|
30
|
-
protected deserializeSnapshot(serializedSnapshot: AccessTokenSerializedSnapshot): Snapshot<AccessTokenSnapshotPayload>;
|
|
31
|
-
protected acceptEvent(event: AccessTokenEvent<bigint>, _blockNumber: number): boolean;
|
|
32
|
-
protected mapEvent(event: AccessTokenEvent): AccessTokenEvent<bigint>;
|
|
33
|
-
protected getSnapshotPayload(): AccessTokenSnapshotPayload;
|
|
34
|
-
protected populateSnapshot({ payload: { merkleTree, senderAddresses, senderAddressIndexMap }, }: Snapshot<AccessTokenSnapshotPayload>): void;
|
|
35
|
-
}
|