@ichidao/ichi-vaults-sdk 0.1.42 → 2.0.0
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/README.md +61 -208
- package/dist/abis/types/AlgebraIntegralPool.d.ts +702 -793
- package/dist/abis/types/AlgebraPool.d.ts +693 -730
- package/dist/abis/types/ClPool.d.ts +789 -871
- package/dist/abis/types/DepositGuard.d.ts +193 -178
- package/dist/abis/types/DepositGuardWithHtsWrapping.d.ts +300 -297
- package/dist/abis/types/ERC20.d.ts +120 -147
- package/dist/abis/types/ERC20Wrapper.d.ts +147 -155
- package/dist/abis/types/IchiVault.d.ts +598 -728
- package/dist/abis/types/MultiFeeDistributer.d.ts +314 -423
- package/dist/abis/types/Multicall.d.ts +58 -73
- package/dist/abis/types/UniswapV3Pool.d.ts +654 -693
- package/dist/abis/types/common.d.ts +40 -12
- package/dist/abis/types/factories/AlgebraIntegralPool__factory.d.ts +2 -3
- package/dist/abis/types/factories/AlgebraIntegralPool__factory.js +10 -13
- package/dist/abis/types/factories/AlgebraIntegralPool__factory.js.map +1 -1
- package/dist/abis/types/factories/AlgebraPool__factory.d.ts +2 -3
- package/dist/abis/types/factories/AlgebraPool__factory.js +10 -13
- package/dist/abis/types/factories/AlgebraPool__factory.js.map +1 -1
- package/dist/abis/types/factories/ClPool__factory.d.ts +2 -3
- package/dist/abis/types/factories/ClPool__factory.js +10 -13
- package/dist/abis/types/factories/ClPool__factory.js.map +1 -1
- package/dist/abis/types/factories/DepositGuardWithHtsWrapping__factory.d.ts +2 -3
- package/dist/abis/types/factories/DepositGuardWithHtsWrapping__factory.js +10 -13
- package/dist/abis/types/factories/DepositGuardWithHtsWrapping__factory.js.map +1 -1
- package/dist/abis/types/factories/DepositGuard__factory.d.ts +2 -3
- package/dist/abis/types/factories/DepositGuard__factory.js +10 -13
- package/dist/abis/types/factories/DepositGuard__factory.js.map +1 -1
- package/dist/abis/types/factories/ERC20Wrapper__factory.d.ts +2 -3
- package/dist/abis/types/factories/ERC20Wrapper__factory.js +10 -13
- package/dist/abis/types/factories/ERC20Wrapper__factory.js.map +1 -1
- package/dist/abis/types/factories/ERC20__factory.d.ts +2 -3
- package/dist/abis/types/factories/ERC20__factory.js +10 -13
- package/dist/abis/types/factories/ERC20__factory.js.map +1 -1
- package/dist/abis/types/factories/IchiVault__factory.d.ts +2 -3
- package/dist/abis/types/factories/IchiVault__factory.js +10 -13
- package/dist/abis/types/factories/IchiVault__factory.js.map +1 -1
- package/dist/abis/types/factories/MultiFeeDistributer__factory.d.ts +2 -3
- package/dist/abis/types/factories/MultiFeeDistributer__factory.js +10 -13
- package/dist/abis/types/factories/MultiFeeDistributer__factory.js.map +1 -1
- package/dist/abis/types/factories/Multicall__factory.d.ts +2 -3
- package/dist/abis/types/factories/Multicall__factory.js +10 -13
- package/dist/abis/types/factories/Multicall__factory.js.map +1 -1
- package/dist/abis/types/factories/UniswapV3Pool__factory.d.ts +2 -3
- package/dist/abis/types/factories/UniswapV3Pool__factory.js +10 -13
- package/dist/abis/types/factories/UniswapV3Pool__factory.js.map +1 -1
- package/dist/src/__tests__/index.test.js +376 -700
- package/dist/src/__tests__/index.test.js.map +1 -1
- package/dist/src/abis/types/AlgebraIntegralPool.d.ts +702 -793
- package/dist/src/abis/types/AlgebraPool.d.ts +693 -730
- package/dist/src/abis/types/ClPool.d.ts +789 -871
- package/dist/src/abis/types/DepositGuard.d.ts +193 -178
- package/dist/src/abis/types/DepositGuardWithHtsWrapping.d.ts +300 -297
- package/dist/src/abis/types/ERC20.d.ts +120 -147
- package/dist/src/abis/types/ERC20Wrapper.d.ts +147 -155
- package/dist/src/abis/types/IchiVault.d.ts +598 -728
- package/dist/src/abis/types/MultiFeeDistributer.d.ts +314 -423
- package/dist/src/abis/types/Multicall.d.ts +58 -73
- package/dist/src/abis/types/UniswapV3Pool.d.ts +654 -693
- package/dist/src/abis/types/common.d.ts +40 -12
- package/dist/src/abis/types/factories/AlgebraIntegralPool__factory.d.ts +2 -3
- package/dist/src/abis/types/factories/AlgebraPool__factory.d.ts +2 -3
- package/dist/src/abis/types/factories/ClPool__factory.d.ts +2 -3
- package/dist/src/abis/types/factories/DepositGuardWithHtsWrapping__factory.d.ts +2 -3
- package/dist/src/abis/types/factories/DepositGuard__factory.d.ts +2 -3
- package/dist/src/abis/types/factories/ERC20Wrapper__factory.d.ts +2 -3
- package/dist/src/abis/types/factories/ERC20__factory.d.ts +2 -3
- package/dist/src/abis/types/factories/IchiVault__factory.d.ts +2 -3
- package/dist/src/abis/types/factories/MultiFeeDistributer__factory.d.ts +2 -3
- package/dist/src/abis/types/factories/Multicall__factory.d.ts +2 -3
- package/dist/src/abis/types/factories/UniswapV3Pool__factory.d.ts +2 -3
- package/dist/src/contracts/index.d.ts +1 -1
- package/dist/src/contracts/index.js +12 -12
- package/dist/src/contracts/index.js.map +1 -1
- package/dist/src/functions/_totalBalances.d.ts +2 -3
- package/dist/src/functions/_totalBalances.js +46 -117
- package/dist/src/functions/_totalBalances.js.map +1 -1
- package/dist/src/functions/_vaultEvents.js +347 -488
- package/dist/src/functions/_vaultEvents.js.map +1 -1
- package/dist/src/functions/_withdrawHelpers.d.ts +2 -3
- package/dist/src/functions/_withdrawHelpers.js +13 -62
- package/dist/src/functions/_withdrawHelpers.js.map +1 -1
- package/dist/src/functions/calculateApr.d.ts +1 -1
- package/dist/src/functions/calculateApr.js +77 -150
- package/dist/src/functions/calculateApr.js.map +1 -1
- package/dist/src/functions/calculateDtr.d.ts +1 -1
- package/dist/src/functions/calculateDtr.js +84 -169
- package/dist/src/functions/calculateDtr.js.map +1 -1
- package/dist/src/functions/calculateFees.d.ts +1 -1
- package/dist/src/functions/calculateFees.js +97 -172
- package/dist/src/functions/calculateFees.js.map +1 -1
- package/dist/src/functions/chains.js +6 -6
- package/dist/src/functions/chains.js.map +1 -1
- package/dist/src/functions/claimRewards.d.ts +3 -4
- package/dist/src/functions/claimRewards.js +29 -92
- package/dist/src/functions/claimRewards.js.map +1 -1
- package/dist/src/functions/deposit.d.ts +7 -9
- package/dist/src/functions/deposit.js +199 -364
- package/dist/src/functions/deposit.js.map +1 -1
- package/dist/src/functions/depositWithHtsWrapping.d.ts +4 -6
- package/dist/src/functions/depositWithHtsWrapping.js +109 -226
- package/dist/src/functions/depositWithHtsWrapping.js.map +1 -1
- package/dist/src/functions/getFeeAprs.d.ts +1 -1
- package/dist/src/functions/getFeeAprs.js +55 -111
- package/dist/src/functions/getFeeAprs.js.map +1 -1
- package/dist/src/functions/priceFromPool.d.ts +3 -4
- package/dist/src/functions/priceFromPool.js +99 -208
- package/dist/src/functions/priceFromPool.js.map +1 -1
- package/dist/src/functions/rewardInfo.js +79 -159
- package/dist/src/functions/rewardInfo.js.map +1 -1
- package/dist/src/functions/totalBalances.d.ts +2 -3
- package/dist/src/functions/totalBalances.js +14 -67
- package/dist/src/functions/totalBalances.js.map +1 -1
- package/dist/src/functions/userBalances.d.ts +2 -3
- package/dist/src/functions/userBalances.js +244 -368
- package/dist/src/functions/userBalances.js.map +1 -1
- package/dist/src/functions/userRewards.d.ts +1 -1
- package/dist/src/functions/userRewards.js +87 -145
- package/dist/src/functions/userRewards.js.map +1 -1
- package/dist/src/functions/vault.d.ts +1 -1
- package/dist/src/functions/vault.js +203 -383
- package/dist/src/functions/vault.js.map +1 -1
- package/dist/src/functions/vaultBasics.js +6 -7
- package/dist/src/functions/vaultBasics.js.map +1 -1
- package/dist/src/functions/vaultMetrics.d.ts +1 -1
- package/dist/src/functions/vaultMetrics.js +111 -189
- package/dist/src/functions/vaultMetrics.js.map +1 -1
- package/dist/src/functions/vaultPositions.d.ts +1 -1
- package/dist/src/functions/vaultPositions.js +69 -134
- package/dist/src/functions/vaultPositions.js.map +1 -1
- package/dist/src/functions/vaultTvl.d.ts +1 -1
- package/dist/src/functions/vaultTvl.js +80 -165
- package/dist/src/functions/vaultTvl.js.map +1 -1
- package/dist/src/functions/withdraw.d.ts +6 -8
- package/dist/src/functions/withdraw.js +165 -295
- package/dist/src/functions/withdraw.js.map +1 -1
- package/dist/src/functions/withdrawWithErc20Wrapping.d.ts +2 -4
- package/dist/src/functions/withdrawWithErc20Wrapping.js +59 -126
- package/dist/src/functions/withdrawWithErc20Wrapping.js.map +1 -1
- package/dist/src/graphql/constants.js +211 -212
- package/dist/src/graphql/constants.js.map +1 -1
- package/dist/src/graphql/functions.js +30 -102
- package/dist/src/graphql/functions.js.map +1 -1
- package/dist/src/graphql/queries.js +407 -42
- package/dist/src/graphql/queries.js.map +1 -1
- package/dist/src/index.cjs.js +3 -2
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.esm.js +3 -2
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/src/contracts/index.d.ts +1 -1
- package/dist/src/src/functions/_totalBalances.d.ts +2 -3
- package/dist/src/src/functions/_withdrawHelpers.d.ts +2 -3
- package/dist/src/src/functions/calculateApr.d.ts +1 -1
- package/dist/src/src/functions/calculateDtr.d.ts +1 -1
- package/dist/src/src/functions/calculateFees.d.ts +1 -1
- package/dist/src/src/functions/claimRewards.d.ts +3 -4
- package/dist/src/src/functions/deposit.d.ts +7 -9
- package/dist/src/src/functions/depositWithHtsWrapping.d.ts +4 -6
- package/dist/src/src/functions/getFeeAprs.d.ts +1 -1
- package/dist/src/src/functions/priceFromPool.d.ts +3 -4
- package/dist/src/src/functions/totalBalances.d.ts +2 -3
- package/dist/src/src/functions/userBalances.d.ts +2 -3
- package/dist/src/src/functions/userRewards.d.ts +1 -1
- package/dist/src/src/functions/vault.d.ts +1 -1
- package/dist/src/src/functions/vaultMetrics.d.ts +1 -1
- package/dist/src/src/functions/vaultPositions.d.ts +1 -1
- package/dist/src/src/functions/vaultTvl.d.ts +1 -1
- package/dist/src/src/functions/withdraw.d.ts +6 -8
- package/dist/src/src/functions/withdrawWithErc20Wrapping.d.ts +2 -4
- package/dist/src/src/index.d.ts +1 -0
- package/dist/src/src/types/calculateGasMargin.d.ts +1 -2
- package/dist/src/src/types/index.d.ts +11 -13
- package/dist/src/src/utils/amountWithSlippage.d.ts +1 -2
- package/dist/src/src/utils/config/addresses.d.ts +1 -1
- package/dist/src/src/utils/formatBigInt.d.ts +1 -2
- package/dist/src/src/utils/getConfigByFactory.d.ts +33 -0
- package/dist/src/src/utils/getPrice.d.ts +1 -2
- package/dist/src/src/utils/multicallUtils.d.ts +9 -10
- package/dist/src/src/utils/parseBigInt.d.ts +1 -2
- package/dist/src/types/calculateGasMargin.d.ts +1 -2
- package/dist/src/types/calculateGasMargin.js +4 -5
- package/dist/src/types/calculateGasMargin.js.map +1 -1
- package/dist/src/types/index.d.ts +11 -13
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/utils/amountWithSlippage.d.ts +1 -2
- package/dist/src/utils/amountWithSlippage.js +1 -1
- package/dist/src/utils/amountWithSlippage.js.map +1 -1
- package/dist/src/utils/cache.js +2 -2
- package/dist/src/utils/cache.js.map +1 -1
- package/dist/src/utils/config/addresses.d.ts +1 -1
- package/dist/src/utils/config/addresses.js +267 -268
- package/dist/src/utils/config/addresses.js.map +1 -1
- package/dist/src/utils/formatBigInt.d.ts +1 -2
- package/dist/src/utils/formatBigInt.js +4 -5
- package/dist/src/utils/formatBigInt.js.map +1 -1
- package/dist/src/utils/getConfigByFactory.d.ts +33 -0
- package/dist/src/utils/getConfigByFactory.js +79 -0
- package/dist/src/utils/getConfigByFactory.js.map +1 -0
- package/dist/src/utils/getGraphUrls.js +8 -12
- package/dist/src/utils/getGraphUrls.js.map +1 -1
- package/dist/src/utils/getPrice.d.ts +1 -2
- package/dist/src/utils/getPrice.js +5 -6
- package/dist/src/utils/getPrice.js.map +1 -1
- package/dist/src/utils/isVelodrome.js +2 -3
- package/dist/src/utils/isVelodrome.js.map +1 -1
- package/dist/src/utils/multicallUtils.d.ts +9 -10
- package/dist/src/utils/multicallUtils.js +38 -93
- package/dist/src/utils/multicallUtils.js.map +1 -1
- package/dist/src/utils/parseBigInt.d.ts +1 -2
- package/dist/src/utils/parseBigInt.js +5 -7
- package/dist/src/utils/parseBigInt.js.map +1 -1
- package/dist/src/utils/positionKey.js +2 -4
- package/dist/src/utils/positionKey.js.map +1 -1
- package/package.json +5 -17
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
2
2
|
import { PriceChange, SupportedDex, VaultApr, VaultState } from '../types';
|
|
3
3
|
export declare function getLpPriceAt(vaultEvents: VaultState[], daysAgo: number, isVaultInverted: boolean, token0decimals: number, token1decimals: number): PriceChange | null;
|
|
4
4
|
export declare function getLpApr(vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex, timeIntervals?: number[]): Promise<(VaultApr | null)[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
2
2
|
import { AverageDepositTokenRatio, DepositTokenRatio, SupportedDex, VaultState, VaultTransactionEvent } from '../types';
|
|
3
3
|
export declare function getDtrAtTransactionEvent(objTransactionEvent: VaultTransactionEvent, isVaultInverted: boolean, token0Decimals: number, token1Decimals: number, beforeEvent?: boolean): DepositTokenRatio;
|
|
4
4
|
export declare function getDtrAtFeeCollectionEvent(objFeeCollectionEvent: VaultState, isVaultInverted: boolean, token0Decimals: number, token1Decimals: number): DepositTokenRatio;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
2
2
|
import { Fees, FeesInfo, SupportedDex, TotalAmounts, TotalAmountsBN, VaultState } from '../types';
|
|
3
3
|
export declare function getTotalAmountsAtFeeCollectionEvent(objFees: VaultState, isVaultInverted: boolean, token0Decimals: number, token1Decimals: number): [number, number];
|
|
4
4
|
export declare function getFeesAmountInBaseTokens(objFees: Fees, isVaultInverted: boolean, token0Decimals: number, token1Decimals: number): number;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ContractTransaction, Overrides } from 'ethers';
|
|
1
|
+
import { ContractTransactionResponse, Overrides, Signer } from 'ethers';
|
|
3
2
|
import { SupportedDex } from '../types';
|
|
4
3
|
/**
|
|
5
4
|
* Claims rewards from the farming contract associated with a vault
|
|
6
5
|
*
|
|
7
6
|
* @param accountAddress - The address of the account claiming rewards
|
|
8
7
|
* @param vaultAddress - The address of the vault
|
|
9
|
-
* @param
|
|
8
|
+
* @param signer - The signer for the transaction
|
|
10
9
|
* @param dex - The DEX to use
|
|
11
10
|
* @param overrides - Optional transaction overrides
|
|
12
11
|
* @returns The transaction
|
|
13
12
|
*/
|
|
14
|
-
export declare function claimRewards(accountAddress: string, vaultAddress: string,
|
|
13
|
+
export declare function claimRewards(accountAddress: string, vaultAddress: string, signer: Signer, dex: SupportedDex, overrides?: Overrides): Promise<ContractTransactionResponse>;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JsonRpcProvider } from '@ethersproject/providers';
|
|
3
|
-
import { BigNumber } from 'ethers';
|
|
1
|
+
import { JsonRpcProvider, ContractTransactionResponse, Overrides, Signer } from 'ethers';
|
|
4
2
|
import { SupportedDex } from '../types';
|
|
5
3
|
export declare function isTokenAllowed(tokenIdx: 0 | 1, vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex): Promise<boolean>;
|
|
6
|
-
export declare function isDepositTokenApproved(accountAddress: string, tokenIdx: 0 | 1, amount: string | number |
|
|
7
|
-
export declare function approveDepositToken(accountAddress: string, tokenIdx: 0 | 1, vaultAddress: string,
|
|
8
|
-
export declare function _getMaxDepositAmount(tokenIdx: 0 | 1, vaultAddress: string, jsonProvider: JsonRpcProvider): Promise<
|
|
9
|
-
export declare function getMaxDepositAmount(tokenIdx: 0 | 1, vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex): Promise<
|
|
10
|
-
export declare function deposit(accountAddress: string, amount0: string | number |
|
|
11
|
-
export declare function depositNativeToken(accountAddress: string, amount0: string | number |
|
|
4
|
+
export declare function isDepositTokenApproved(accountAddress: string, tokenIdx: 0 | 1, amount: string | number | bigint, vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex): Promise<boolean>;
|
|
5
|
+
export declare function approveDepositToken(accountAddress: string, tokenIdx: 0 | 1, vaultAddress: string, signer: Signer, dex: SupportedDex, amount?: string | number | bigint, overrides?: Overrides): Promise<ContractTransactionResponse>;
|
|
6
|
+
export declare function _getMaxDepositAmount(tokenIdx: 0 | 1, vaultAddress: string, jsonProvider: JsonRpcProvider): Promise<bigint>;
|
|
7
|
+
export declare function getMaxDepositAmount(tokenIdx: 0 | 1, vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex): Promise<bigint>;
|
|
8
|
+
export declare function deposit(accountAddress: string, amount0: string | number | bigint, amount1: string | number | bigint, vaultAddress: string, signer: Signer, dex: SupportedDex, percentSlippage?: number, overrides?: Overrides): Promise<ContractTransactionResponse>;
|
|
9
|
+
export declare function depositNativeToken(accountAddress: string, amount0: string | number | bigint, amount1: string | number | bigint, vaultAddress: string, signer: Signer, dex: SupportedDex, percentSlippage?: number, overrides?: Overrides): Promise<ContractTransactionResponse>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JsonRpcProvider } from '@ethersproject/providers';
|
|
3
|
-
import { BigNumber } from 'ethers';
|
|
1
|
+
import { JsonRpcProvider, ContractTransactionResponse, Overrides, Signer } from 'ethers';
|
|
4
2
|
import { SupportedDex } from '../types';
|
|
5
|
-
export declare function isTokenApproved(accountAddress: string, tokenAddress: string, amount: string | number |
|
|
6
|
-
export declare function approveToken(accountAddress: string, tokenAddress: string, vaultAddress: string,
|
|
3
|
+
export declare function isTokenApproved(accountAddress: string, tokenAddress: string, amount: string | number | bigint, vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex): Promise<boolean>;
|
|
4
|
+
export declare function approveToken(accountAddress: string, tokenAddress: string, vaultAddress: string, signer: Signer, dex: SupportedDex, amount?: string | number | bigint, overrides?: Overrides): Promise<ContractTransactionResponse>;
|
|
7
5
|
export declare function getActualDepositToken(depositToken: string, jsonProvider: JsonRpcProvider): Promise<string>;
|
|
8
|
-
export declare function depositWithHtsWrapping(accountAddress: string, amount0: string | number |
|
|
6
|
+
export declare function depositWithHtsWrapping(accountAddress: string, amount0: string | number | bigint, amount1: string | number | bigint, vaultAddress: string, signer: Signer, dex: SupportedDex, percentSlippage?: number, overrides?: Overrides): Promise<ContractTransactionResponse>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '
|
|
2
|
-
import { BigNumber } from '@ethersproject/bignumber';
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
3
2
|
import { IchiVault, SupportedChainId, SupportedDex } from '../types';
|
|
4
|
-
export declare function getSqrtPriceFromPool(poolAddress: string, jsonProvider: JsonRpcProvider, chainId: SupportedChainId, dex: SupportedDex): Promise<
|
|
5
|
-
export declare function getSqrtPriceFromVault(vault: IchiVault, jsonProvider: JsonRpcProvider, chainId: SupportedChainId, dex: SupportedDex): Promise<
|
|
3
|
+
export declare function getSqrtPriceFromPool(poolAddress: string, jsonProvider: JsonRpcProvider, chainId: SupportedChainId, dex: SupportedDex): Promise<bigint>;
|
|
4
|
+
export declare function getSqrtPriceFromVault(vault: IchiVault, jsonProvider: JsonRpcProvider, chainId: SupportedChainId, dex: SupportedDex): Promise<bigint>;
|
|
6
5
|
export declare function getCurrPrice(vault: IchiVault, jsonProvider: JsonRpcProvider, chainId: SupportedChainId, dex: SupportedDex, isVaultInverted: boolean, token0decimals: number, token1decimals: number): Promise<number>;
|
|
7
6
|
export declare function getVaultTvl(vault: IchiVault, jsonProvider: JsonRpcProvider, chainId: SupportedChainId, dex: SupportedDex, isVaultInverted: boolean, token0decimals: number, token1decimals: number): Promise<number>;
|
|
8
7
|
export declare function getCurrLpPrice(vault: IchiVault, jsonProvider: JsonRpcProvider, dex: SupportedDex, chainId: SupportedChainId, isVaultInverted: boolean, token0decimals: number, token1decimals: number): Promise<number>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '
|
|
2
|
-
import { BigNumber } from 'ethers';
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
3
2
|
import { SupportedDex, TotalAmounts, TotalAmountsBN } from '../types';
|
|
4
3
|
export declare function getTotalAmounts(vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex): Promise<TotalAmounts>;
|
|
5
4
|
export declare function getTotalAmounts(vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex, raw: true): Promise<TotalAmountsBN>;
|
|
6
5
|
export declare function getTotalSupply(vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex): Promise<string>;
|
|
7
|
-
export declare function getTotalSupply(vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex, raw: true): Promise<
|
|
6
|
+
export declare function getTotalSupply(vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex, raw: true): Promise<bigint>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '
|
|
2
|
-
import { BigNumber } from 'ethers';
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
3
2
|
import { SupportedDex, UserAmounts, UserAmountsBN, UserAmountsInVault, UserAmountsInVaultBN, UserBalanceInVault, UserBalanceInVaultBN } from '../types';
|
|
4
3
|
import { UserBalancesQueryData } from '../types/vaultQueryData';
|
|
5
4
|
export declare function getUserBalance(accountAddress: string, vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex): Promise<string>;
|
|
6
|
-
export declare function getUserBalance(accountAddress: string, vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex, raw: true): Promise<
|
|
5
|
+
export declare function getUserBalance(accountAddress: string, vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex, raw: true): Promise<bigint>;
|
|
7
6
|
export declare function sendUserBalancesQueryRequest(url: string, accountAddress: string, query: string, vaultAddress?: string): Promise<UserBalancesQueryData['user']>;
|
|
8
7
|
export declare function getAllUserBalances(accountAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex): Promise<UserBalanceInVault[]>;
|
|
9
8
|
export declare function getAllUserBalances(accountAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex, raw: true): Promise<UserBalanceInVaultBN[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
2
2
|
import { SupportedDex, UserRewards, UserRewardsBN, UserRewardsByToken, UserRewardsByTokenBN } from '../types';
|
|
3
3
|
export declare function getUserRewards(accountAddress: string, vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex): Promise<UserRewardsByToken[]>;
|
|
4
4
|
export declare function getUserRewards(accountAddress: string, vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex, raw: true): Promise<UserRewardsByTokenBN[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
2
2
|
import { SupportedDex, SupportedChainId, IchiVault, VaultWithRewards } from '../types';
|
|
3
3
|
import { VaultsByPoolQueryData, VaultsByTokensQueryData } from '../types/vaultQueryData';
|
|
4
4
|
export declare function getIchiVaultInfo(chainId: SupportedChainId, dex: SupportedDex, vaultAddress: string, jsonProvider?: JsonRpcProvider): Promise<IchiVault>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
2
2
|
import { SupportedDex, VaultMetrics } from '../types';
|
|
3
3
|
export declare function getVaultMetrics(vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex, timeIntervals?: number[]): Promise<(VaultMetrics | null)[]>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JsonRpcProvider } from '@ethersproject/providers';
|
|
3
|
-
import { BigNumber } from 'ethers';
|
|
1
|
+
import { JsonRpcProvider, ContractTransactionResponse, Overrides, Signer } from 'ethers';
|
|
4
2
|
import { SupportedDex } from '../types';
|
|
5
|
-
export declare function approveVaultToken(accountAddress: string, vaultAddress: string,
|
|
6
|
-
export declare function isVaultTokenApproved(accountAddress: string, shares: string | number |
|
|
7
|
-
export declare function withdraw(accountAddress: string, shares: string | number |
|
|
8
|
-
export declare function withdrawWithSlippage(accountAddress: string, shares: string | number |
|
|
9
|
-
export declare function withdrawNativeToken(accountAddress: string, shares: string | number |
|
|
3
|
+
export declare function approveVaultToken(accountAddress: string, vaultAddress: string, signer: Signer, dex: SupportedDex, shares?: string | number | bigint, overrides?: Overrides): Promise<ContractTransactionResponse>;
|
|
4
|
+
export declare function isVaultTokenApproved(accountAddress: string, shares: string | number | bigint, vaultAddress: string, jsonProvider: JsonRpcProvider, dex: SupportedDex): Promise<boolean>;
|
|
5
|
+
export declare function withdraw(accountAddress: string, shares: string | number | bigint, vaultAddress: string, signer: Signer, dex: SupportedDex, overrides?: Overrides): Promise<ContractTransactionResponse>;
|
|
6
|
+
export declare function withdrawWithSlippage(accountAddress: string, shares: string | number | bigint, vaultAddress: string, signer: Signer, dex: SupportedDex, percentSlippage?: number, overrides?: Overrides): Promise<ContractTransactionResponse>;
|
|
7
|
+
export declare function withdrawNativeToken(accountAddress: string, shares: string | number | bigint, vaultAddress: string, signer: Signer, dex: SupportedDex, percentSlippage?: number, overrides?: Overrides): Promise<ContractTransactionResponse>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JsonRpcProvider } from '@ethersproject/providers';
|
|
3
|
-
import { BigNumber } from 'ethers';
|
|
1
|
+
import { ContractTransactionResponse, Overrides, Signer } from 'ethers';
|
|
4
2
|
import { SupportedDex } from '../types';
|
|
5
|
-
export declare function withdrawWithErc20Wrapping(accountAddress: string, shares: string | number |
|
|
3
|
+
export declare function withdrawWithErc20Wrapping(accountAddress: string, shares: string | number | bigint, vaultAddress: string, signer: Signer, dex: SupportedDex, percentSlippage?: number, overrides?: Overrides): Promise<ContractTransactionResponse>;
|
package/dist/src/src/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BigNumber } from '@ethersproject/bignumber';
|
|
2
1
|
import { SupportedChainId } from '.';
|
|
3
2
|
export declare function getGasLimit(chainId: SupportedChainId): number;
|
|
4
|
-
export declare function calculateGasMargin(value:
|
|
3
|
+
export declare function calculateGasMargin(value: bigint): bigint;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { Signer } from '
|
|
2
|
-
|
|
3
|
-
import { BigNumber } from 'ethers';
|
|
4
|
-
export type SignerOrProvider = Signer | Provider;
|
|
1
|
+
import { Signer, JsonRpcProvider, Provider } from 'ethers';
|
|
2
|
+
export type SignerOrProvider = Signer | Provider | JsonRpcProvider;
|
|
5
3
|
export declare enum SupportedChainId {
|
|
6
4
|
arbitrum = 42161,
|
|
7
5
|
arthera = 10242,
|
|
@@ -121,13 +119,13 @@ export declare enum SupportedDex {
|
|
|
121
119
|
XSwap = "XSwap"
|
|
122
120
|
}
|
|
123
121
|
export declare const ichiVaultDecimals = 18;
|
|
124
|
-
export type TotalAmountsBN = [
|
|
125
|
-
total0:
|
|
126
|
-
total1:
|
|
122
|
+
export type TotalAmountsBN = [bigint, bigint] & {
|
|
123
|
+
total0: bigint;
|
|
124
|
+
total1: bigint;
|
|
127
125
|
};
|
|
128
|
-
export type UserAmountsBN = [
|
|
129
|
-
amount0:
|
|
130
|
-
amount1:
|
|
126
|
+
export type UserAmountsBN = [bigint, bigint] & {
|
|
127
|
+
amount0: bigint;
|
|
128
|
+
amount1: bigint;
|
|
131
129
|
};
|
|
132
130
|
export type TotalAmounts = [string, string] & {
|
|
133
131
|
total0: string;
|
|
@@ -245,8 +243,8 @@ export type UserBalanceInVault = {
|
|
|
245
243
|
};
|
|
246
244
|
export type UserBalanceInVaultBN = {
|
|
247
245
|
vaultAddress: string;
|
|
248
|
-
shares:
|
|
249
|
-
stakedShares?:
|
|
246
|
+
shares: bigint;
|
|
247
|
+
stakedShares?: bigint;
|
|
250
248
|
};
|
|
251
249
|
export type VaultMetrics = {
|
|
252
250
|
timeInterval: number;
|
|
@@ -269,7 +267,7 @@ export type UserRewardsByToken = {
|
|
|
269
267
|
export type UserRewardsByTokenBN = {
|
|
270
268
|
token: string;
|
|
271
269
|
tokenDecimals: number;
|
|
272
|
-
rewardAmount:
|
|
270
|
+
rewardAmount: bigint;
|
|
273
271
|
};
|
|
274
272
|
export type RewardInfo = {
|
|
275
273
|
id: string;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function amountWithSlippage(amount: BigNumber, percentSlippage: number): BigNumber;
|
|
1
|
+
export default function amountWithSlippage(amount: bigint, percentSlippage: number): bigint;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SupportedDex, SupportedChainId } from '../../types';
|
|
2
|
+
export declare const ERC20_WRAPPER_ADDRESS = "0x000000000000000000000000000000000093A3A8";
|
|
2
3
|
export type AddressConfig = {
|
|
3
4
|
[key in SupportedDex]?: string;
|
|
4
5
|
};
|
|
@@ -21,5 +22,4 @@ export type Config = {
|
|
|
21
22
|
[key in SupportedDex]?: SupportedDexConfig;
|
|
22
23
|
};
|
|
23
24
|
export declare const addressConfig: Record<SupportedChainId, Config>;
|
|
24
|
-
export declare const ERC20_WRAPPER_ADDRESS = "0x000000000000000000000000000000000093A3A8";
|
|
25
25
|
export declare const MULTICALL_ADDRESSES: Partial<Record<SupportedChainId, string>>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function formatBigInt(value: number | string | BigNumber, decimals?: number): string;
|
|
1
|
+
export default function formatBigInt(value: number | string | bigint, decimals?: number): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SupportedChainId, SupportedDex } from '../types';
|
|
2
|
+
export type FactoryConfig = {
|
|
3
|
+
dex: SupportedDex;
|
|
4
|
+
factoryAddress: string;
|
|
5
|
+
vaultDeployerAddress: string;
|
|
6
|
+
depositGuardAddress: string;
|
|
7
|
+
depositGuardVersion: number;
|
|
8
|
+
graphUrl: string;
|
|
9
|
+
publishedUrl: string;
|
|
10
|
+
supportsCollectFees: boolean;
|
|
11
|
+
version?: number;
|
|
12
|
+
isAlgebra: boolean;
|
|
13
|
+
ammVersion?: string;
|
|
14
|
+
is2Thick?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Get DEX configuration by factory address.
|
|
18
|
+
* This is useful when you have a vault's factory address and need to determine
|
|
19
|
+
* which DEX it belongs to and get the associated configuration.
|
|
20
|
+
*
|
|
21
|
+
* @param chainId - The chain ID
|
|
22
|
+
* @param factoryAddress - The factory address (case-insensitive)
|
|
23
|
+
* @returns FactoryConfig if found, undefined otherwise
|
|
24
|
+
*/
|
|
25
|
+
export declare function getConfigByFactory(chainId: SupportedChainId, factoryAddress: string): FactoryConfig | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Get all factory configurations for a chain.
|
|
28
|
+
* Returns a map of factory address (lowercase) to DEX configuration.
|
|
29
|
+
*
|
|
30
|
+
* @param chainId - The chain ID
|
|
31
|
+
* @returns Map of factory address to FactoryConfig
|
|
32
|
+
*/
|
|
33
|
+
export declare function getAllFactoryConfigs(chainId: SupportedChainId): Map<string, FactoryConfig>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function getPrice(isInverted: boolean, sqrtPrice: BigNumber, decimals0: number, decimals1: number, decimalPlaces?: number): number;
|
|
1
|
+
export default function getPrice(isInverted: boolean, sqrtPrice: bigint, decimals0: number, decimals1: number, decimalPlaces?: number): number;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { BigNumber, Signer } from 'ethers';
|
|
1
|
+
import { Contract, Signer } from 'ethers';
|
|
2
|
+
import { JsonRpcProvider } from 'ethers';
|
|
4
3
|
import { SupportedChainId } from '../types';
|
|
5
4
|
interface Call {
|
|
6
5
|
target: string;
|
|
@@ -9,20 +8,20 @@ interface Call {
|
|
|
9
8
|
}
|
|
10
9
|
export interface Result {
|
|
11
10
|
success: boolean;
|
|
12
|
-
gasUsed:
|
|
11
|
+
gasUsed: bigint;
|
|
13
12
|
returnData: string;
|
|
14
13
|
}
|
|
15
|
-
export declare function getMulticallContract(chainId: SupportedChainId, provider:
|
|
16
|
-
export declare function multicall(calls: Call[], chainId: SupportedChainId, provider:
|
|
14
|
+
export declare function getMulticallContract(chainId: SupportedChainId, provider: JsonRpcProvider | Signer): Contract;
|
|
15
|
+
export declare function multicall(calls: Call[], chainId: SupportedChainId, provider: JsonRpcProvider | Signer, batchSize?: number): Promise<Result[]>;
|
|
17
16
|
export declare function encodeTotalAmountsCall(vaultAddress: string): Call;
|
|
18
17
|
export declare function encodeTotalSupplyCall(vaultAddress: string): Call;
|
|
19
18
|
export declare function encodeDecimalsCall(tokenAddress: string): Call;
|
|
20
19
|
export declare function encodeFarmingRewardsCall(farmingContractAddress: string, userAddress: string): Call;
|
|
21
20
|
export declare function decodeTotalAmountsResult(result: Result, vaultAddress: string): {
|
|
22
|
-
total0:
|
|
23
|
-
total1:
|
|
21
|
+
total0: bigint;
|
|
22
|
+
total1: bigint;
|
|
24
23
|
};
|
|
25
|
-
export declare function decodeTotalSupplyResult(result: Result, vaultAddress: string):
|
|
24
|
+
export declare function decodeTotalSupplyResult(result: Result, vaultAddress: string): bigint;
|
|
26
25
|
export declare function decodeDecimalsResult(result: Result, tokenAddress: string): number;
|
|
27
|
-
export declare function decodeFarmingRewardsResult(result: Result, farmingContractAddress: string): [string[],
|
|
26
|
+
export declare function decodeFarmingRewardsResult(result: Result, farmingContractAddress: string): [string[], bigint[]];
|
|
28
27
|
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function parseBigInt(_value: number | string, decimals: number): BigNumber;
|
|
1
|
+
export default function parseBigInt(_value: number | string, decimals: number): bigint;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BigNumber } from '@ethersproject/bignumber';
|
|
2
1
|
import { SupportedChainId } from '.';
|
|
3
2
|
export declare function getGasLimit(chainId: SupportedChainId): number;
|
|
4
|
-
export declare function calculateGasMargin(value:
|
|
3
|
+
export declare function calculateGasMargin(value: bigint): bigint;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculateGasMargin = exports.getGasLimit = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var mantleGasLimit = 3e9;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const defaultGasLimit = 5e6;
|
|
6
|
+
const mantleGasLimit = 3e9;
|
|
8
7
|
function getGasLimit(chainId) {
|
|
9
8
|
return chainId === _1.SupportedChainId.mantle ? mantleGasLimit : defaultGasLimit;
|
|
10
9
|
}
|
|
11
10
|
exports.getGasLimit = getGasLimit;
|
|
12
11
|
function calculateGasMargin(value) {
|
|
13
|
-
return value
|
|
12
|
+
return (value * 12000n) / 10000n;
|
|
14
13
|
}
|
|
15
14
|
exports.calculateGasMargin = calculateGasMargin;
|
|
16
15
|
//# sourceMappingURL=calculateGasMargin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateGasMargin.js","sourceRoot":"","sources":["../../../src/types/calculateGasMargin.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"calculateGasMargin.js","sourceRoot":"","sources":["../../../src/types/calculateGasMargin.ts"],"names":[],"mappings":";;;AAAA,wBAAqC;AAErC,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,SAAgB,WAAW,CAAC,OAAyB;IACnD,OAAO,OAAO,KAAK,mBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC;AAChF,CAAC;AAFD,kCAEC;AAED,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;AACnC,CAAC;AAFD,gDAEC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { Signer } from '
|
|
2
|
-
|
|
3
|
-
import { BigNumber } from 'ethers';
|
|
4
|
-
export type SignerOrProvider = Signer | Provider;
|
|
1
|
+
import { Signer, JsonRpcProvider, Provider } from 'ethers';
|
|
2
|
+
export type SignerOrProvider = Signer | Provider | JsonRpcProvider;
|
|
5
3
|
export declare enum SupportedChainId {
|
|
6
4
|
arbitrum = 42161,
|
|
7
5
|
arthera = 10242,
|
|
@@ -121,13 +119,13 @@ export declare enum SupportedDex {
|
|
|
121
119
|
XSwap = "XSwap"
|
|
122
120
|
}
|
|
123
121
|
export declare const ichiVaultDecimals = 18;
|
|
124
|
-
export type TotalAmountsBN = [
|
|
125
|
-
total0:
|
|
126
|
-
total1:
|
|
122
|
+
export type TotalAmountsBN = [bigint, bigint] & {
|
|
123
|
+
total0: bigint;
|
|
124
|
+
total1: bigint;
|
|
127
125
|
};
|
|
128
|
-
export type UserAmountsBN = [
|
|
129
|
-
amount0:
|
|
130
|
-
amount1:
|
|
126
|
+
export type UserAmountsBN = [bigint, bigint] & {
|
|
127
|
+
amount0: bigint;
|
|
128
|
+
amount1: bigint;
|
|
131
129
|
};
|
|
132
130
|
export type TotalAmounts = [string, string] & {
|
|
133
131
|
total0: string;
|
|
@@ -245,8 +243,8 @@ export type UserBalanceInVault = {
|
|
|
245
243
|
};
|
|
246
244
|
export type UserBalanceInVaultBN = {
|
|
247
245
|
vaultAddress: string;
|
|
248
|
-
shares:
|
|
249
|
-
stakedShares?:
|
|
246
|
+
shares: bigint;
|
|
247
|
+
stakedShares?: bigint;
|
|
250
248
|
};
|
|
251
249
|
export type VaultMetrics = {
|
|
252
250
|
timeInterval: number;
|
|
@@ -269,7 +267,7 @@ export type UserRewardsByToken = {
|
|
|
269
267
|
export type UserRewardsByTokenBN = {
|
|
270
268
|
token: string;
|
|
271
269
|
tokenDecimals: number;
|
|
272
|
-
rewardAmount:
|
|
270
|
+
rewardAmount: bigint;
|
|
273
271
|
};
|
|
274
272
|
export type RewardInfo = {
|
|
275
273
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function amountWithSlippage(amount: BigNumber, percentSlippage: number): BigNumber;
|
|
1
|
+
export default function amountWithSlippage(amount: bigint, percentSlippage: number): bigint;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
function amountWithSlippage(amount, percentSlippage) {
|
|
4
|
-
return amount
|
|
4
|
+
return (amount * BigInt(Math.floor((100 - percentSlippage) * 1000))) / 100000n;
|
|
5
5
|
}
|
|
6
6
|
exports.default = amountWithSlippage;
|
|
7
7
|
//# sourceMappingURL=amountWithSlippage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amountWithSlippage.js","sourceRoot":"","sources":["../../../src/utils/amountWithSlippage.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"amountWithSlippage.js","sourceRoot":"","sources":["../../../src/utils/amountWithSlippage.ts"],"names":[],"mappings":";;AAAA,SAAwB,kBAAkB,CAAC,MAAc,EAAE,eAAuB;IAChF,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,eAAe,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AACjF,CAAC;AAFD,qCAEC"}
|
package/dist/src/utils/cache.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const node_cache_1 = __importDefault(require("node-cache"));
|
|
7
|
+
const cache = new node_cache_1.default();
|
|
8
8
|
exports.default = cache;
|
|
9
9
|
//# sourceMappingURL=cache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/utils/cache.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/utils/cache.ts"],"names":[],"mappings":";;;;;AAAA,4DAAmC;AAEnC,MAAM,KAAK,GAAG,IAAI,oBAAS,EAAE,CAAC;AAE9B,kBAAe,KAAK,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SupportedDex, SupportedChainId } from '../../types';
|
|
2
|
+
export declare const ERC20_WRAPPER_ADDRESS = "0x000000000000000000000000000000000093A3A8";
|
|
2
3
|
export type AddressConfig = {
|
|
3
4
|
[key in SupportedDex]?: string;
|
|
4
5
|
};
|
|
@@ -21,5 +22,4 @@ export type Config = {
|
|
|
21
22
|
[key in SupportedDex]?: SupportedDexConfig;
|
|
22
23
|
};
|
|
23
24
|
export declare const addressConfig: Record<SupportedChainId, Config>;
|
|
24
|
-
export declare const ERC20_WRAPPER_ADDRESS = "0x000000000000000000000000000000000093A3A8";
|
|
25
25
|
export declare const MULTICALL_ADDRESSES: Partial<Record<SupportedChainId, string>>;
|