@hinkal/common 0.2.10 → 0.2.11
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/API/API.d.mts +49 -0
- package/API/HinkalPointsCalls.d.mts +20 -0
- package/API/callBeefyGraphAPI.d.mts +2 -0
- package/API/callCurveAPI.d.mts +9 -0
- package/API/callMonitor.d.mts +1 -0
- package/API/callOdosAPI.d.mts +63 -0
- package/API/callOneInchAPI.d.mts +18 -0
- package/API/callRelayer.d.mts +10 -0
- package/API/checkRisk.d.mts +1 -0
- package/API/dataServerCalls.d.mts +2 -0
- package/API/duneAPI.d.mts +11 -0
- package/API/fetchCommitmentsCache.d.mts +20 -0
- package/API/fetchNullifiers.d.mts +5 -0
- package/API/getAxelarGasEstimate.d.mts +5 -0
- package/API/getCoingeckoPrice.d.mts +22 -0
- package/API/getConnextReceiveFee.d.mts +2 -0
- package/API/getGasEstimates.d.mts +9 -0
- package/API/getRelayerURL.d.mts +1 -0
- package/API/getServerURL.d.mts +2 -0
- package/API/getTokenPrice.d.mts +16 -0
- package/API/index.d.mts +14 -0
- package/API/kycCalls.d.mts +30 -0
- package/API/passwordCalls.d.mts +9 -0
- package/API/referralProgramCalls.d.mts +36 -0
- package/API/relayCalls.d.mts +5 -0
- package/API/restoreSnapshots.d.mts +1 -0
- package/API/rewardsPointsCalls.d.mts +13 -0
- package/API/userVerifyTransactions.d.mts +19 -0
- package/constants/assets.constants.d.mts +13 -0
- package/constants/axelar.constants.d.mts +5 -0
- package/constants/backend.constants.d.mts +11 -0
- package/constants/beefy.registry.d.mts +8 -0
- package/constants/chains.constants.d.mts +36 -0
- package/constants/coingecko.constants.d.mts +13 -0
- package/constants/contracts.constants.d.mts +119 -0
- package/constants/crvCvx.registry.d.mts +20 -0
- package/constants/crvDynamic.registry.d.mts +1 -0
- package/constants/deploy-data/index.d.mts +11 -0
- package/constants/fees.constants.d.mts +11 -0
- package/constants/index.d.mts +20 -0
- package/constants/kyc.constants.d.mts +28 -0
- package/constants/lido.constants.d.mts +10 -0
- package/constants/pendle.registry.d.mts +21 -0
- package/constants/protocol.constants.d.mts +18 -0
- package/constants/reorg-depths.constants.d.mts +3 -0
- package/constants/rewards.constants.d.mts +19 -0
- package/constants/server.constants.d.mts +155 -0
- package/constants/token-data/ERC20Registry.d.mts +3 -0
- package/constants/token-data/index.d.mts +976 -0
- package/constants/token-data/popularTokens.constants.d.mts +3 -0
- package/constants/token-data/tokenPricing.consts.d.mts +5 -0
- package/constants/vite.constants.d.mts +14 -0
- package/crypto/babyJub.d.mts +16 -0
- package/crypto/index.d.mts +3 -0
- package/crypto/poseidon.d.mts +15 -0
- package/crypto/preProcessing.d.mts +1 -0
- package/data-structures/Hinkal/Hinkal.d.mts +100 -0
- package/data-structures/Hinkal/IHinkal.d.mts +93 -0
- package/data-structures/Hinkal/hinkalActionBeefy.d.mts +3 -0
- package/data-structures/Hinkal/hinkalActionConvex.d.mts +12 -0
- package/data-structures/Hinkal/hinkalActionCurve.d.mts +12 -0
- package/data-structures/Hinkal/hinkalActionLidoEth.d.mts +4 -0
- package/data-structures/Hinkal/hinkalActionPendle.d.mts +3 -0
- package/data-structures/Hinkal/hinkalActionPendleLP.d.mts +7 -0
- package/data-structures/Hinkal/hinkalActionStake.d.mts +3 -0
- package/data-structures/Hinkal/hinkalActionVolatile.d.mts +3 -0
- package/data-structures/Hinkal/hinkalDeposit.d.mts +3 -0
- package/data-structures/Hinkal/hinkalGetRecipientInfo.d.mts +2 -0
- package/data-structures/Hinkal/hinkalGetZkMeProvider.d.mts +3 -0
- package/data-structures/Hinkal/hinkalPrivateWallet.d.mts +2 -0
- package/data-structures/Hinkal/hinkalSwap.d.mts +3 -0
- package/data-structures/Hinkal/hinkalTransfer.d.mts +1 -0
- package/data-structures/Hinkal/hinkalWithdraw.d.mts +2 -0
- package/data-structures/Hinkal/index.d.mts +12 -0
- package/data-structures/Hinkal/resetMerkleTrees.d.mts +2 -0
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.mts +20 -0
- package/data-structures/ValueCache/ValueCache.d.mts +10 -0
- package/data-structures/ValueCache/index.d.mts +1 -0
- package/data-structures/cacheDevices/BaseCacheDevice.d.mts +8 -0
- package/data-structures/cacheDevices/FileCacheDevice.d.mts +9 -0
- package/data-structures/cacheDevices/LocalStorageCacheDevice.d.mts +7 -0
- package/data-structures/cacheDevices/index.d.mts +2 -0
- package/data-structures/crypto-keys/decodeUTXO.d.mts +14 -0
- package/data-structures/crypto-keys/encryptDecryptUtxo.d.mts +18 -0
- package/data-structures/crypto-keys/index.d.mts +4 -0
- package/data-structures/crypto-keys/keyUtils.d.mts +2 -0
- package/data-structures/crypto-keys/keys.d.mts +58 -0
- package/data-structures/custom-token-registry/CustomTokenRegistry.d.mts +13 -0
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.d.mts +35 -0
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.d.mts +30 -0
- package/data-structures/event-service/AbstractEventService.d.mts +31 -0
- package/data-structures/event-service/AbstractNullifierSnapshotService.d.mts +22 -0
- package/data-structures/event-service/AbstractSnapshotService.d.mts +23 -0
- package/data-structures/event-service/index.d.mts +5 -0
- package/data-structures/index.d.mts +13 -0
- package/data-structures/merkle-tree/MerkleTree.d.mts +78 -0
- package/data-structures/merkle-tree/MerkleTreeIncompleteError.d.mts +3 -0
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.mts +3 -0
- package/data-structures/merkle-tree/index.d.mts +3 -0
- package/data-structures/provider-adapter/IProviderAdapter.d.mts +35 -0
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.d.mts +7 -0
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.d.mts +7 -0
- package/data-structures/snapshot/ClientNullifierSnapshotService.d.mts +7 -0
- package/data-structures/token-price-fetcher/TokenChecker.d.mts +20 -0
- package/data-structures/token-price-fetcher/index.d.mts +1 -0
- package/data-structures/transactions-manager/TransactionsManager.d.mts +27 -0
- package/data-structures/transactions-manager/history/getBeefyData.d.mts +3 -0
- package/data-structures/transactions-manager/history/getConvexData.d.mts +6 -0
- package/data-structures/transactions-manager/history/getCurveData.d.mts +6 -0
- package/data-structures/transactions-manager/history/getDepositData.d.mts +2 -0
- package/data-structures/transactions-manager/history/getLidoData.d.mts +10 -0
- package/data-structures/transactions-manager/history/getPendleData.d.mts +3 -0
- package/data-structures/transactions-manager/history/getSwapData.d.mts +3 -0
- package/data-structures/transactions-manager/history/getTxDetails.d.mts +3 -0
- package/data-structures/transactions-manager/history/getVolatileData.d.mts +32 -0
- package/data-structures/transactions-manager/history/history.types.d.mts +95 -0
- package/data-structures/transactions-manager/history/history.utils.d.mts +8 -0
- package/data-structures/transactions-manager/index.d.mts +2 -0
- package/data-structures/utxo/Utxo.d.mts +63 -0
- package/data-structures/volatile-helper/VolatileHelper.d.mts +57 -0
- package/data-structures/volatile-helper/index.d.mts +1 -0
- package/error-handling/customErrors/ErrorWithAmount.d.mts +4 -0
- package/error-handling/customErrors/FeeOverTransactionValueError.d.mts +9 -0
- package/error-handling/customErrors/customErrors.helpers.d.mts +5 -0
- package/error-handling/customErrors/index.d.mts +3 -0
- package/error-handling/error-codes.constants.d.mts +181 -0
- package/error-handling/get-error.message.d.mts +3 -0
- package/error-handling/handleErrorRestore.d.mts +2 -0
- package/error-handling/index.d.mts +7 -0
- package/error-handling/logError.d.mts +1 -0
- package/error-handling/types.d.mts +5 -0
- package/externalABIs/BUSD.d.mts +38 -0
- package/externalABIs/DAI.d.mts +45 -0
- package/externalABIs/ERC20.d.mts +1 -0
- package/externalABIs/SanctionsList.d.mts +35 -0
- package/externalABIs/USDC.d.mts +28 -0
- package/externalABIs/USDR.d.mts +28 -0
- package/externalABIs/USDR3CRV.d.mts +49 -0
- package/externalABIs/USDT.d.mts +41 -0
- package/externalABIs/WETH.d.mts +38 -0
- package/externalABIs/amToken.d.mts +28 -0
- package/externalABIs/crvFRAX.d.mts +38 -0
- package/externalABIs/index.d.mts +323 -0
- package/externalABIs/swapAbi.d.mts +77 -0
- package/functions/index.d.mts +14 -0
- package/functions/kyc/aiPriseHelper.d.mts +0 -0
- package/functions/kyc/authentoHelper.d.mts +12 -0
- package/functions/kyc/index.d.mts +3 -0
- package/functions/kyc/openDefaultPassportWindow.d.mts +1 -0
- package/functions/kyc/passportHelper.d.mts +3 -0
- package/functions/kyc/zkMeHelper.d.mts +4 -0
- package/functions/pre-transaction/getFlatFees.d.mts +12 -0
- package/functions/pre-transaction/index.d.mts +5 -0
- package/functions/pre-transaction/interaction-to-action.d.mts +2 -0
- package/functions/pre-transaction/outputUtxoProcessing.d.mts +5 -0
- package/functions/pre-transaction/process-gas-estimates.d.mts +5 -0
- package/functions/pre-transaction/processAmountChanges.d.mts +12 -0
- package/functions/private-wallet/emporium.helpers.d.mts +5 -0
- package/functions/private-wallet/index.d.mts +2 -0
- package/functions/private-wallet/opProducer.d.mts +5 -0
- package/functions/protocols/convex.protocols.d.mts +1 -0
- package/functions/protocols/curve.protocols.d.mts +1 -0
- package/functions/protocols/index.d.mts +3 -0
- package/functions/protocols/pendle.helpers.d.mts +8 -0
- package/functions/snarkjs/common.snarkjs.d.mts +22 -0
- package/functions/snarkjs/constant.d.mts +151 -0
- package/functions/snarkjs/constructEmporiumProof.d.mts +10 -0
- package/functions/snarkjs/constructGeneralZkProof.d.mts +12 -0
- package/functions/snarkjs/generateCircomData.d.mts +4 -0
- package/functions/snarkjs/generateZkProof.d.mts +5 -0
- package/functions/snarkjs/generateZkProofEnclave.d.mts +5 -0
- package/functions/snarkjs/generateZkProofSelf.d.mts +5 -0
- package/functions/snarkjs/getZKFiles.d.mts +2 -0
- package/functions/snarkjs/index.d.mts +4 -0
- package/functions/staking/index.d.mts +11 -0
- package/functions/utils/amounts.utils.d.mts +21 -0
- package/functions/utils/axelar.utils.d.mts +2 -0
- package/functions/utils/cacheDevice.utils.d.mts +3 -0
- package/functions/utils/cacheFunctions.d.mts +17 -0
- package/functions/utils/caseInsensitive.utils.d.mts +3 -0
- package/functions/utils/convertIntegrationProviderToExternalActionId.d.mts +2 -0
- package/functions/utils/create-provider.d.mts +2 -0
- package/functions/utils/enum.utils.d.mts +9 -0
- package/functions/utils/erc20tokenFunctions.d.mts +4 -0
- package/functions/utils/evmNetworkFunctions.d.mts +4 -0
- package/functions/utils/external-action.utils.d.mts +8 -0
- package/functions/utils/getDataFromTransaction.d.mts +45 -0
- package/functions/utils/index.d.mts +21 -0
- package/functions/utils/memoize.utils.d.mts +1 -0
- package/functions/utils/nickname.utils.d.mts +1 -0
- package/functions/utils/process.utils.d.mts +7 -0
- package/functions/utils/reloadPage.d.mts +1 -0
- package/functions/utils/requireEnv.d.mts +1 -0
- package/functions/utils/resolve-sync.utils.d.mts +6 -0
- package/functions/utils/serialize.utils.d.mts +1 -0
- package/functions/utils/string.utils.d.mts +8 -0
- package/functions/utils/time.utils.d.mts +1 -0
- package/functions/utils/userAgent.d.mts +2 -0
- package/functions/utils/volatile-patcher.utils.d.mts +1 -0
- package/functions/web3/etherFunctions.d.mts +20 -0
- package/functions/web3/events/balanceChangedHandler.d.mts +1 -0
- package/functions/web3/events/getInputUtxoAndBalance.d.mts +24 -0
- package/functions/web3/events/getShieldedBalance.d.mts +18 -0
- package/functions/web3/events/index.d.mts +4 -0
- package/functions/web3/events/web3RetrieveEvents.d.mts +14 -0
- package/functions/web3/functionCalls/accessTokenCalls.d.mts +6 -0
- package/functions/web3/functionCalls/approveToken.d.mts +4 -0
- package/functions/web3/functionCalls/estimateGasRelayer.d.mts +4 -0
- package/functions/web3/functionCalls/getRootHash.d.mts +2 -0
- package/functions/web3/functionCalls/relayFunctions.d.mts +17 -0
- package/functions/web3/functionCalls/transactCallDirect.d.mts +6 -0
- package/functions/web3/functionCalls/transactCallRelayer.d.mts +7 -0
- package/functions/web3/getContractMetadata.d.mts +5 -0
- package/functions/web3/index.d.mts +6 -0
- package/functions/web3/odosAPI.d.mts +5 -0
- package/functions/web3/oneInchAPI.d.mts +5 -0
- package/functions/web3/runContractFunction.d.mts +15 -0
- package/functions/web3/uniswapAPI.d.mts +16 -0
- package/index.d.mts +8 -0
- package/package.json +41 -11
- package/providers/EthersProviderAdapter.d.mts +39 -0
- package/providers/WagmiProviderAdapter.d.mts +46 -0
- package/providers/exportProviers.d.mts +3 -0
- package/providers/prepareEthersHinkal.d.mts +4 -0
- package/providers/prepareWagmiHinkal.d.mts +3 -0
- package/types/API.types.d.mts +23 -0
- package/types/ICacheDevice.d.mts +4 -0
- package/types/IMultiThreadedUtxoUtils.d.mts +8 -0
- package/types/admin.types.d.mts +22 -0
- package/types/axelar.types.d.mts +14 -0
- package/types/beefy.types.d.mts +11 -0
- package/types/big-intable.types.d.mts +2 -0
- package/types/circom-data.types.d.mts +70 -0
- package/types/coingecko.types.d.mts +8 -0
- package/types/commitments.types.d.mts +26 -0
- package/types/connext.types.d.mts +13 -0
- package/types/crypto.types.d.mts +7 -0
- package/types/curve.types.d.mts +133 -0
- package/types/duneAPI.types.d.mts +9 -0
- package/types/ethereum-network.types.d.mts +142 -0
- package/types/external-action.types.d.mts +28 -0
- package/types/hinkal.stake.types.d.mts +11 -0
- package/types/hinkal.types.d.mts +150 -0
- package/types/hinkalTvl.types.d.mts +4 -0
- package/types/index.d.mts +27 -0
- package/types/kyc.types.d.mts +39 -0
- package/types/pendle.api.types.d.mts +233 -0
- package/types/pendle.types.d.mts +222 -0
- package/types/relayer.types.d.mts +25 -0
- package/types/remote-proof.types.d.mts +15 -0
- package/types/rewards.types.d.mts +230 -0
- package/types/slippage.types.d.mts +15 -0
- package/types/snark.types.d.mts +40 -0
- package/types/time.types.d.mts +31 -0
- package/types/token.types.d.mts +36 -0
- package/types/transactions.types.d.mts +55 -0
- package/webworker/performTaskWithWorker.d.mts +5 -0
- package/webworker/snarkjsWorker/snarkjsWorker.types.d.mts +14 -0
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.d.mts +1 -0
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.d.mts +10 -0
- package/webworker/utxoWorker/utxoWorker.types.d.mts +29 -0
- package/webworker/utxoWorker/utxoWorkerLauncher.d.mts +1 -0
- package/webworker/utxoWorker/utxoWorkerLogic.d.mts +8 -0
- package/webworker/viteWorkerURL.constant.d.mts +9 -0
- package/webworker/worker.registry.d.mts +10 -0
- package/webworker/worker.types.d.mts +33 -0
- package/webworker/workerErrorHandler.d.mts +1 -0
- package/webworker/workerFactory.d.mts +7 -0
- package/webworker/workerProxy.d.mts +40 -0
- package/webworker/zkProofWorker/zkProofWorker.types.d.mts +38 -0
- package/webworker/zkProofWorker/zkProofWorkerLauncher.d.mts +1 -0
- package/webworker/zkProofWorker/zkProofWorkerLogic.d.mts +8 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BigNumber, ethers } from 'ethers';
|
|
2
|
+
interface IRunTransaction {
|
|
3
|
+
contractFunction: ethers.ContractFunction;
|
|
4
|
+
args: unknown[];
|
|
5
|
+
gasLimit?: number;
|
|
6
|
+
gasPrice?: BigNumber;
|
|
7
|
+
confirmations?: number;
|
|
8
|
+
waitTime?: number;
|
|
9
|
+
nonce?: number;
|
|
10
|
+
}
|
|
11
|
+
interface IRunContractFunction extends IRunTransaction {
|
|
12
|
+
provider: ethers.providers.Provider;
|
|
13
|
+
}
|
|
14
|
+
export declare const runContractFunction: ({ provider, contractFunction, args, gasLimit, nonce, confirmations, }: IRunContractFunction) => Promise<ethers.ContractReceipt>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Contract } from 'ethers';
|
|
2
|
+
import { ERC20Token } from '../../types';
|
|
3
|
+
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
4
|
+
interface PoolAndFee {
|
|
5
|
+
poolAddress: string;
|
|
6
|
+
fee: number;
|
|
7
|
+
token1Balance: bigint;
|
|
8
|
+
}
|
|
9
|
+
export declare const searchPoolAndFee: (token1Contract: Contract, factory: Contract, token0Address: string, token1Address: string) => Promise<PoolAndFee>;
|
|
10
|
+
export declare const getUniswapPriceHelper: (hinkal: IHinkal, chainId: number, token0: ERC20Token, token1: ERC20Token, fee: number, inSwapAmount: bigint) => Promise<bigint>;
|
|
11
|
+
export declare const getUniswapFee: (hinkal: IHinkal, chainId: number, token0: ERC20Token, token1: ERC20Token) => Promise<number>;
|
|
12
|
+
export declare const getUniswapPrice: (hinkal: IHinkal, chainId: number, inSwapAmount: string, inSwapToken: ERC20Token, outSwapToken: ERC20Token) => Promise<{
|
|
13
|
+
tokenPrice: bigint;
|
|
14
|
+
poolFee: string;
|
|
15
|
+
}>;
|
|
16
|
+
export {};
|
package/index.d.mts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hinkal/common",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"homepage": "hinkal.pro",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Hinkal Protocol"
|
|
@@ -13,24 +13,54 @@
|
|
|
13
13
|
],
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
|
-
"import":
|
|
17
|
-
|
|
16
|
+
"import": {
|
|
17
|
+
"types": "./index.d.mts",
|
|
18
|
+
"default": "./index.mjs"
|
|
19
|
+
},
|
|
20
|
+
"require": {
|
|
21
|
+
"types": "./index.d.ts",
|
|
22
|
+
"default": "./index.cjs"
|
|
23
|
+
}
|
|
18
24
|
},
|
|
19
25
|
"./providers/EthersProviderAdapter": {
|
|
20
|
-
"import":
|
|
21
|
-
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./providers/EthersProviderAdapter.d.mts",
|
|
28
|
+
"default": "./providers/EthersProviderAdapter.mjs"
|
|
29
|
+
},
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./providers/EthersProviderAdapter.d.ts",
|
|
32
|
+
"default": "./providers/EthersProviderAdapter.cjs"
|
|
33
|
+
}
|
|
22
34
|
},
|
|
23
35
|
"./providers/WagmiProviderAdapter": {
|
|
24
|
-
"import":
|
|
25
|
-
|
|
36
|
+
"import": {
|
|
37
|
+
"types": "./providers/WagmiProviderAdapter.d.mts",
|
|
38
|
+
"default": "./providers/WagmiProviderAdapter.mjs"
|
|
39
|
+
},
|
|
40
|
+
"require": {
|
|
41
|
+
"types:": "./providers/WagmiProviderAdapter.d.ts",
|
|
42
|
+
"default": "./providers/WagmiProviderAdapter.cjs"
|
|
43
|
+
}
|
|
26
44
|
},
|
|
27
45
|
"./providers/prepareEthersHinkal": {
|
|
28
|
-
"import":
|
|
29
|
-
|
|
46
|
+
"import": {
|
|
47
|
+
"types": "./providers/prepareEthersHinkal.d.mts",
|
|
48
|
+
"default": "./providers/prepareEthersHinkal.mjs"
|
|
49
|
+
},
|
|
50
|
+
"require": {
|
|
51
|
+
"types": "./providers/prepareEthersHinkal.d.ts",
|
|
52
|
+
"default": "./providers/prepareEthersHinkal.cjs"
|
|
53
|
+
}
|
|
30
54
|
},
|
|
31
55
|
"./providers/prepareWagmiHinkal": {
|
|
32
|
-
"import":
|
|
33
|
-
|
|
56
|
+
"import": {
|
|
57
|
+
"types": "./providers/prepareWagmiHinkal.d.mts",
|
|
58
|
+
"default": "./providers/prepareWagmiHinkal.mjs"
|
|
59
|
+
},
|
|
60
|
+
"require": {
|
|
61
|
+
"types": "./providers/prepareWagmiHinkal.d.ts",
|
|
62
|
+
"default": "./providers/prepareWagmiHinkal.cjs"
|
|
63
|
+
}
|
|
34
64
|
}
|
|
35
65
|
},
|
|
36
66
|
"types": "./index.d.ts",
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { IProviderAdapter } from '../data-structures/provider-adapter/IProviderAdapter';
|
|
2
|
+
import { ContractMetadata, ContractType, EthereumNetwork } from '../types/ethereum-network.types';
|
|
3
|
+
import { ethers, Signer } from 'ethers';
|
|
4
|
+
export declare class EthersProviderAdapter implements IProviderAdapter<Signer> {
|
|
5
|
+
signer: Signer | undefined;
|
|
6
|
+
chainId: number | undefined;
|
|
7
|
+
private originalProvider;
|
|
8
|
+
private fetchProvider;
|
|
9
|
+
initConnector(): void;
|
|
10
|
+
initSigner(signer: Signer): void;
|
|
11
|
+
requireSigner(): void;
|
|
12
|
+
init(chainId?: number): Promise<void>;
|
|
13
|
+
disconnectFromConnector(): Promise<void>;
|
|
14
|
+
connectToConnector(): Promise<number>;
|
|
15
|
+
waitForTransaction(transactionHash: string, confirmations: number): Promise<boolean>;
|
|
16
|
+
signMessage(message: string): Promise<string>;
|
|
17
|
+
signTypedData(domain: ethers.TypedDataDomain, types: Record<string, ethers.TypedDataField[]>, value: Record<string, unknown>): Promise<string>;
|
|
18
|
+
getSelectedNetwork: () => EthereumNetwork | undefined;
|
|
19
|
+
switchNetwork(): Promise<void>;
|
|
20
|
+
private createFetchProvider;
|
|
21
|
+
getAddress(): Promise<string>;
|
|
22
|
+
setChainEventListener(): void;
|
|
23
|
+
onAccountChanged(): Promise<unknown>;
|
|
24
|
+
onChainChanged(chainId?: number): Promise<unknown>;
|
|
25
|
+
release(): void;
|
|
26
|
+
private parseChainIdParam;
|
|
27
|
+
getContractMetadata(contractType: ContractType, chainId?: number): ContractMetadata;
|
|
28
|
+
getContract(contractType: ContractType, contractAddress?: undefined, chainId?: number): ethers.Contract;
|
|
29
|
+
getContractWithSigner(contract: ContractType, contractAddress?: undefined): ethers.Contract;
|
|
30
|
+
getContractWithFetcher(contract: ContractType, contractAddress?: undefined): ethers.Contract;
|
|
31
|
+
getContractWithFetcherForEthereum(contract: ContractType, contractAddress?: undefined): ethers.Contract;
|
|
32
|
+
sendTransaction(tx: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionResponse>;
|
|
33
|
+
connectAndPatchProvider(): Promise<number>;
|
|
34
|
+
isPermitterAvailable(): boolean;
|
|
35
|
+
getGasPrice(): Promise<bigint>;
|
|
36
|
+
}
|
|
37
|
+
export declare const ethersProvierAdapter: EthersProviderAdapter;
|
|
38
|
+
declare const _default: <T = unknown>() => IProviderAdapter<T>;
|
|
39
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ChainEventListener, IProviderAdapter } from '../data-structures/provider-adapter/IProviderAdapter';
|
|
2
|
+
import { ContractMetadata, ContractType, EthereumNetwork } from '../types/ethereum-network.types';
|
|
3
|
+
import { ethers } from 'ethers';
|
|
4
|
+
import { type Connector } from 'wagmi';
|
|
5
|
+
export declare class WagmiProviderAdapter implements IProviderAdapter<Connector> {
|
|
6
|
+
private connector;
|
|
7
|
+
chainId: number | undefined;
|
|
8
|
+
private originalProvider;
|
|
9
|
+
private fetchProvider;
|
|
10
|
+
private signer;
|
|
11
|
+
private chainEventListener?;
|
|
12
|
+
private config?;
|
|
13
|
+
private unsubscribeFns;
|
|
14
|
+
initConnector(connector: Connector): void;
|
|
15
|
+
requireConnector(): void;
|
|
16
|
+
initConfig(config: any): void;
|
|
17
|
+
init(chainId?: number): Promise<void>;
|
|
18
|
+
disconnectFromConnector(): Promise<void>;
|
|
19
|
+
connectToConnector(connector: Connector): Promise<number>;
|
|
20
|
+
waitForTransaction(transactionHash: string, confirmations: number): Promise<boolean>;
|
|
21
|
+
signMessage(message: string): Promise<string>;
|
|
22
|
+
signTypedData(domain: ethers.TypedDataDomain, types: Record<string, ethers.TypedDataField[]>, value: Record<string, unknown>): Promise<string>;
|
|
23
|
+
getSelectedNetwork: () => EthereumNetwork | undefined;
|
|
24
|
+
switchNetwork(network: EthereumNetwork): Promise<import("viem").Chain>;
|
|
25
|
+
private createFetchProvider;
|
|
26
|
+
getAddress(): Promise<string>;
|
|
27
|
+
setChainEventListener(chainEventListener: ChainEventListener): void;
|
|
28
|
+
onAccountChanged(): Promise<unknown>;
|
|
29
|
+
onChainChanged(chainId?: number): Promise<unknown>;
|
|
30
|
+
release(): void;
|
|
31
|
+
private removeListeners;
|
|
32
|
+
private parseChainIdParam;
|
|
33
|
+
getContractMetadata(contractType: ContractType, chainId?: number): ContractMetadata;
|
|
34
|
+
getContract(contractType: ContractType, contractAddress?: undefined, chainId?: number): ethers.Contract;
|
|
35
|
+
getContractWithSigner(contract: ContractType, contractAddress?: undefined): ethers.Contract;
|
|
36
|
+
getContractWithFetcher(contract: ContractType, contractAddress?: undefined): ethers.Contract;
|
|
37
|
+
getContractWithFetcherForEthereum(contract: ContractType, contractAddress?: undefined): ethers.Contract;
|
|
38
|
+
sendTransaction(tx: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionResponse>;
|
|
39
|
+
connectAndPatchProvider(connector: Connector): Promise<number>;
|
|
40
|
+
isPermitterAvailable(): boolean;
|
|
41
|
+
getGasPrice(): Promise<bigint>;
|
|
42
|
+
walletClientToSigner(walletClient: any, chainId: number): Promise<ethers.providers.JsonRpcSigner>;
|
|
43
|
+
}
|
|
44
|
+
export declare const wagmiProviderAdapter: WagmiProviderAdapter;
|
|
45
|
+
declare const _default: <T = unknown>() => IProviderAdapter<T>;
|
|
46
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RafflePrizeType } from './rewards.types';
|
|
2
|
+
export interface ThirdPartyLeaderBoardItem {
|
|
3
|
+
nickname: string;
|
|
4
|
+
points: number;
|
|
5
|
+
}
|
|
6
|
+
export interface PointInfo {
|
|
7
|
+
lpPoints: number;
|
|
8
|
+
referralPoints: number;
|
|
9
|
+
certificationPoints: number;
|
|
10
|
+
tradePoints: number;
|
|
11
|
+
ambassadorPoints: number;
|
|
12
|
+
bonusPoints: number;
|
|
13
|
+
}
|
|
14
|
+
export interface LeaderBoardItem {
|
|
15
|
+
nickname: string;
|
|
16
|
+
points: number;
|
|
17
|
+
boost: number;
|
|
18
|
+
rafflePrizes?: RafflePrizeType[];
|
|
19
|
+
breakdown: PointInfo;
|
|
20
|
+
}
|
|
21
|
+
export interface LeaderboardEntry extends LeaderBoardItem {
|
|
22
|
+
position: number;
|
|
23
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Utxo } from '../data-structures/utxo/Utxo';
|
|
2
|
+
import { type UserKeys } from '../data-structures/crypto-keys/keys';
|
|
3
|
+
import { EncryptedOutputWithSign, OutputsWithSignAndLast } from './commitments.types';
|
|
4
|
+
export interface IMultiThreadedUtxoUtils {
|
|
5
|
+
batchProcess(encryptedOutputs: EncryptedOutputWithSign[], lastOutput: string, userKeys: UserKeys): Promise<OutputsWithSignAndLast>;
|
|
6
|
+
buildBatchProcess(encryptedOutputs: EncryptedOutputWithSign[], userKeys: UserKeys): Promise<Utxo[]>;
|
|
7
|
+
batchFilterUtxosWithNullifier(allUtxos: Utxo[], nullifiers: Set<string>): Promise<Utxo[]>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare enum AdminActionType {
|
|
2
|
+
Internal = "Internal",
|
|
3
|
+
External = "External"
|
|
4
|
+
}
|
|
5
|
+
export declare enum AdminDetailedActionType {
|
|
6
|
+
Deposit = "Deposit",
|
|
7
|
+
WithdrawWithRelayer = "Withdraw With Relayer",
|
|
8
|
+
WithdrawWithoutRelayer = "Withdraw Without Relayer",
|
|
9
|
+
MintAccessToken = "Mint Access Token",
|
|
10
|
+
Aave = "Aave",
|
|
11
|
+
Odos = "Odos",
|
|
12
|
+
Uniswap = "Uniswap",
|
|
13
|
+
OneInch = "1Inch",
|
|
14
|
+
Curve = "Curve",
|
|
15
|
+
Convex = "Convex",
|
|
16
|
+
Transact = "Transact",
|
|
17
|
+
Beefy = "Beefy",
|
|
18
|
+
Volatile = "Volatile",
|
|
19
|
+
Lido = "Lido",
|
|
20
|
+
Pendle = "Pendle",
|
|
21
|
+
HinkalStake = "HinkalStake"
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface AxelarMigrationInfo {
|
|
2
|
+
destinationChain: string;
|
|
3
|
+
destinationAddress: string;
|
|
4
|
+
messageFee: bigint;
|
|
5
|
+
}
|
|
6
|
+
export interface AxelarCapsule {
|
|
7
|
+
chains: AxelarMigrationInfo[];
|
|
8
|
+
totalMessageFees: bigint;
|
|
9
|
+
}
|
|
10
|
+
export interface AxelarNetworkSelection {
|
|
11
|
+
chainId: number;
|
|
12
|
+
gasFeeInWei?: bigint;
|
|
13
|
+
isSelected: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BeefyAction } from './hinkal.types';
|
|
2
|
+
export type ChartTimeBucket = '1h_1d' | '1h_1w' | '1d_1M' | '1d_1Y';
|
|
3
|
+
export declare const dataBeefyApiConfig: {
|
|
4
|
+
base: string;
|
|
5
|
+
routes: {
|
|
6
|
+
prices: (oracleId: string, datePeriod: ChartTimeBucket) => string;
|
|
7
|
+
tvls: (vaultId: string, datePeriod: ChartTimeBucket) => string;
|
|
8
|
+
apys: (vaultId: string, datePeriod: ChartTimeBucket) => string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const isBeefyDeposit: (beefyAction: BeefyAction) => boolean;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export type CircomDataType = {
|
|
2
|
+
rootHashHinkal: bigint | undefined;
|
|
3
|
+
erc20TokenAddresses: string[];
|
|
4
|
+
tokenIds: string[];
|
|
5
|
+
amountChanges: bigint[];
|
|
6
|
+
inputNullifiers: string[][];
|
|
7
|
+
outCommitments: string[][];
|
|
8
|
+
encryptedOutputs: string[][];
|
|
9
|
+
flatFees: bigint[];
|
|
10
|
+
timeStamp?: string;
|
|
11
|
+
stealthAddressStructure: StealthAddressStructure;
|
|
12
|
+
rootHashAccessToken: bigint | undefined;
|
|
13
|
+
relay: string;
|
|
14
|
+
externalAddress: string;
|
|
15
|
+
externalActionMetadata: string;
|
|
16
|
+
externalActionId: bigint;
|
|
17
|
+
hookData: HookDataType;
|
|
18
|
+
calldataHash: bigint;
|
|
19
|
+
publicSignalCount: number;
|
|
20
|
+
};
|
|
21
|
+
export type CircomDataJsonType = {
|
|
22
|
+
rootHashHinkal: bigint | undefined | string;
|
|
23
|
+
erc20TokenAddresses: string[];
|
|
24
|
+
tokenIds: string[];
|
|
25
|
+
inputNullifiers: string[][];
|
|
26
|
+
outCommitments: string[][];
|
|
27
|
+
encryptedOutputs: string[][];
|
|
28
|
+
flatFees: bigint[] | string[];
|
|
29
|
+
amountChanges: bigint[] | string[];
|
|
30
|
+
stealthAddressStructure: StealthAddressStructure<bigint | string>;
|
|
31
|
+
timeStamp?: string;
|
|
32
|
+
rootHashAccessToken: bigint | undefined | string;
|
|
33
|
+
relay: string;
|
|
34
|
+
externalAddress: string;
|
|
35
|
+
externalActionMetadata: string;
|
|
36
|
+
externalActionId: bigint | string;
|
|
37
|
+
hookData: HookDataType;
|
|
38
|
+
calldataHash: bigint | string;
|
|
39
|
+
publicSignalCount: number;
|
|
40
|
+
};
|
|
41
|
+
export type DimDataType = {
|
|
42
|
+
tokenNumber: number;
|
|
43
|
+
nullifierAmount: number;
|
|
44
|
+
outputAmount: number;
|
|
45
|
+
};
|
|
46
|
+
export type HookDataType = {
|
|
47
|
+
hookContract: string;
|
|
48
|
+
preHookContract: string;
|
|
49
|
+
preHookMetadata: string;
|
|
50
|
+
postHookMetadata: string;
|
|
51
|
+
};
|
|
52
|
+
export type StealthAddressStructure<T = bigint> = {
|
|
53
|
+
extraRandomization: T;
|
|
54
|
+
stealthAddress: T;
|
|
55
|
+
H0: T;
|
|
56
|
+
H1: T;
|
|
57
|
+
};
|
|
58
|
+
export declare const emptyStealthAddressStructure: {
|
|
59
|
+
extraRandomization: string;
|
|
60
|
+
stealthAddress: string;
|
|
61
|
+
H0: string;
|
|
62
|
+
H1: string;
|
|
63
|
+
};
|
|
64
|
+
export interface TransactParams {
|
|
65
|
+
dimensions: DimDataType;
|
|
66
|
+
circomData: CircomDataType;
|
|
67
|
+
}
|
|
68
|
+
export declare const defaultHookData: HookDataType;
|
|
69
|
+
export declare const defaultHookDataArray: string[];
|
|
70
|
+
export declare const defaultStealthAddressStructure: StealthAddressStructure;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BigIntable } from './big-intable.types';
|
|
2
|
+
export interface EncryptedOutputWithSign<Sign = boolean> {
|
|
3
|
+
value: string;
|
|
4
|
+
isPositive: Sign;
|
|
5
|
+
}
|
|
6
|
+
export interface OutputsWithSignAndLast<Sign = boolean> {
|
|
7
|
+
additionalEncryptedOutputs: EncryptedOutputWithSign<Sign>[];
|
|
8
|
+
lastOutput: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CommitmentEvent<BN = BigIntable> {
|
|
11
|
+
commitment: BN;
|
|
12
|
+
index: BN;
|
|
13
|
+
encryptedOutput: string;
|
|
14
|
+
}
|
|
15
|
+
export interface AccessTokenEvent<BN = BigIntable> {
|
|
16
|
+
accessKey: BN;
|
|
17
|
+
index: BN;
|
|
18
|
+
senderAddress: string;
|
|
19
|
+
}
|
|
20
|
+
export interface NullifierEvent<T> {
|
|
21
|
+
nullifier: T;
|
|
22
|
+
}
|
|
23
|
+
export interface RegisterEvent {
|
|
24
|
+
ethereumAddress: string;
|
|
25
|
+
shieldedAddressHash: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ConnextEstimateFeeParams = {
|
|
2
|
+
callDataGasAmount: number;
|
|
3
|
+
isHighPriority: boolean;
|
|
4
|
+
originDomain: number;
|
|
5
|
+
destinationDomain: number;
|
|
6
|
+
};
|
|
7
|
+
export type ConnextFeeData = {
|
|
8
|
+
type: string;
|
|
9
|
+
hex: string;
|
|
10
|
+
};
|
|
11
|
+
export type ConnextFeeResponse = {
|
|
12
|
+
receiveFeeAmount: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
export type Coins = {
|
|
2
|
+
address: string;
|
|
3
|
+
usdPrice: number;
|
|
4
|
+
decimals: string;
|
|
5
|
+
poolBalance: string;
|
|
6
|
+
symbol: string;
|
|
7
|
+
usdTotal?: number;
|
|
8
|
+
weighting?: number;
|
|
9
|
+
};
|
|
10
|
+
export type GaugeReward = {
|
|
11
|
+
tokenAddress: string;
|
|
12
|
+
symbol: string;
|
|
13
|
+
apy: number;
|
|
14
|
+
};
|
|
15
|
+
export type CurvePoolsType = {
|
|
16
|
+
id?: string;
|
|
17
|
+
name: string;
|
|
18
|
+
address: string;
|
|
19
|
+
lpToken: string;
|
|
20
|
+
lpTokenAddress: string;
|
|
21
|
+
coins: Coins[];
|
|
22
|
+
coinNames: string;
|
|
23
|
+
tokensForDeposit: Coins[];
|
|
24
|
+
coinAddresses: Array<string>;
|
|
25
|
+
coinLogos: Array<string>;
|
|
26
|
+
gaugeAddress?: string;
|
|
27
|
+
gaugeRewards?: GaugeReward[];
|
|
28
|
+
gaugeCrvApy?: {
|
|
29
|
+
base: number;
|
|
30
|
+
boosted: number;
|
|
31
|
+
};
|
|
32
|
+
usdTotal: number;
|
|
33
|
+
totalSupply: number;
|
|
34
|
+
lpPrice: number;
|
|
35
|
+
liquidityUtilization?: number;
|
|
36
|
+
tvl: number;
|
|
37
|
+
convexPoolData?: {
|
|
38
|
+
[id: string]: string | number | boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type CurveSubGraphType = {
|
|
42
|
+
address: string;
|
|
43
|
+
volumeUSD: number;
|
|
44
|
+
dailyApy: number;
|
|
45
|
+
weeklyApy: number;
|
|
46
|
+
};
|
|
47
|
+
export type CurvePoolsAllType = CurvePoolsType & CurveSubGraphType;
|
|
48
|
+
export type PoolDataType = {
|
|
49
|
+
id?: string;
|
|
50
|
+
name: string;
|
|
51
|
+
address: string;
|
|
52
|
+
lpToken: string;
|
|
53
|
+
lpTokenAddress: string;
|
|
54
|
+
coins: Coins[];
|
|
55
|
+
tokensForDeposit: Coins[];
|
|
56
|
+
coinNames: string;
|
|
57
|
+
coinLogos: string[];
|
|
58
|
+
gaugeAddress?: string;
|
|
59
|
+
gaugeCrvApy?: {
|
|
60
|
+
base: number;
|
|
61
|
+
boosted: number;
|
|
62
|
+
};
|
|
63
|
+
gaugeRewards?: GaugeReward[];
|
|
64
|
+
usdTotal: number;
|
|
65
|
+
totalSupply: number;
|
|
66
|
+
lpPrice: number;
|
|
67
|
+
tvl: number;
|
|
68
|
+
volumeUSD: number;
|
|
69
|
+
liquidityUtilization?: number;
|
|
70
|
+
dailyApy: number;
|
|
71
|
+
weeklyApy: number;
|
|
72
|
+
};
|
|
73
|
+
export type CurvePoolExtendedInfo = {
|
|
74
|
+
poolAddress: any;
|
|
75
|
+
lpToken: any;
|
|
76
|
+
gaugeAddress: any;
|
|
77
|
+
gaugeCrvApy: any;
|
|
78
|
+
currencyReserves: any;
|
|
79
|
+
liquidityUtilization: any;
|
|
80
|
+
volumeUSD: number;
|
|
81
|
+
dailyApy: any;
|
|
82
|
+
weeklyApy: any;
|
|
83
|
+
A?: any;
|
|
84
|
+
initialA?: any;
|
|
85
|
+
futureA?: any;
|
|
86
|
+
futureTime?: any;
|
|
87
|
+
fee?: any;
|
|
88
|
+
daoFee?: any;
|
|
89
|
+
hasRampUp: boolean;
|
|
90
|
+
virtualPrice: any;
|
|
91
|
+
gaugeRewards?: GaugeReward[];
|
|
92
|
+
};
|
|
93
|
+
export declare const curveNetworkNames: {
|
|
94
|
+
[x: number]: string;
|
|
95
|
+
};
|
|
96
|
+
export declare const curvePools: readonly ["factory", "main", "crypto", "factory-crypto", "factory-crvusd", "factory-stable-ng", "factory-tricrypto"];
|
|
97
|
+
export type CurvePoolType = {
|
|
98
|
+
[name: string]: {
|
|
99
|
+
shortName: string;
|
|
100
|
+
tag: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
export type CurvePoolTypes = (typeof curvePools)[number];
|
|
104
|
+
export type PoolDataKeyType = keyof PoolDataType;
|
|
105
|
+
export type UpperTabPossibleSelections = 'DEPOSIT' | 'WITHDRAW/CLAIM';
|
|
106
|
+
export declare const UpperTabPossibleValues: string[];
|
|
107
|
+
export declare enum StatType {
|
|
108
|
+
Liquidity = "Liquidity",
|
|
109
|
+
Swaps = "Swaps"
|
|
110
|
+
}
|
|
111
|
+
export type CurvePoolResponse = {
|
|
112
|
+
id?: string;
|
|
113
|
+
address?: string;
|
|
114
|
+
name?: string;
|
|
115
|
+
coinsAddresses?: string[];
|
|
116
|
+
lpTokenAddress?: string;
|
|
117
|
+
totalSupply?: string;
|
|
118
|
+
usdTotal?: number;
|
|
119
|
+
gaugeCrvApy?: number[];
|
|
120
|
+
gaugeAddress?: string;
|
|
121
|
+
gaugeRewards?: GaugeReward[];
|
|
122
|
+
underlyingCoins?: Coins[];
|
|
123
|
+
coins?: Coins[];
|
|
124
|
+
volumeUSD?: number;
|
|
125
|
+
latestDailyApy?: number;
|
|
126
|
+
latestWeeklyApy?: number;
|
|
127
|
+
};
|
|
128
|
+
export type ConvexPoolResponse = {
|
|
129
|
+
id: string;
|
|
130
|
+
address: string;
|
|
131
|
+
lpTokenAddress: string;
|
|
132
|
+
convexPoolData: CurvePoolsType;
|
|
133
|
+
};
|