@dodoex/widgets 3.0.4-ve33.8 → 3.1.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/dist/cjs/locales/en-US.js +1 -1
- package/dist/cjs/locales/zh-CN.js +1 -1
- package/dist/{helper-DVYAzZqp.cjs → helper-Dnk7p0aW.cjs} +1 -1
- package/dist/{helper-m0zYAm2Y.js → helper-MNzHxcL-.js} +1 -1
- package/dist/index-BUQIlyE6.js +31 -0
- package/dist/index-BfNK29Ue.js +78 -0
- package/dist/{index-DVhV_6cf.cjs → index-BoZcs46K.cjs} +2 -2
- package/dist/{index-U8agSrk7.cjs → index-CeaQBk4G.cjs} +6 -6
- package/dist/{index-CnZH_7q3.js → index-D6YQnhH9.js} +1 -1
- package/dist/index-DYpT9qAx.cjs +31 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/types/components/AddressWithLinkAndCopy.d.ts +2 -1
- package/dist/types/components/List/EmptyList.d.ts +2 -1
- package/dist/types/components/SelectChain.d.ts +2 -1
- package/dist/types/components/Swap/components/ReviewDialog.d.ts +2 -1
- package/dist/types/components/Swap/components/SwapSettingsDialog/index.d.ts +4 -1
- package/dist/types/components/Swap/components/TokenCard/TokenPickerDialog.d.ts +3 -2
- package/dist/types/components/Swap/index.d.ts +4 -1
- package/dist/types/components/TokenLogoPair.d.ts +1 -1
- package/dist/types/components/Widget/index.d.ts +26 -2
- package/dist/types/components/WidgetContainer.d.ts +1 -1
- package/dist/types/constants/api.d.ts +1 -1
- package/dist/types/constants/swap.d.ts +0 -3
- package/dist/types/hooks/Swap/useFetchRoutePrice.d.ts +3 -1
- package/dist/types/hooks/Swap/useFetchRoutePrice.test.d.ts +1 -0
- package/dist/types/hooks/Swap/useSlippageLimit.d.ts +1 -1
- package/dist/types/hooks/Swap/useSwapSettingStore.d.ts +0 -1
- package/dist/types/hooks/contract/useFetchBlockNumber.d.ts +1 -1
- package/dist/types/hooks/useGlobalState.d.ts +32 -0
- package/dist/types/hooks/useGraphQLRequests.d.ts +1 -0
- package/dist/types/hooks/useTokenState.d.ts +18 -0
- package/dist/types/index.d.ts +26 -25
- package/dist/types/utils/formatter.d.ts +2 -2
- package/dist/types/widgets/MiningWidget/hooks/helper.d.ts +2 -2
- package/dist/types/widgets/MiningWidget/hooks/useReviewRewardToken.d.ts +2 -2
- package/dist/types/widgets/PoolWidget/AMMV3/hooks/usePools.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/BaseInfoCardList.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/FeeRateCard.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/LqRatioSet.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/LqSettingsShow.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/PriceModeCard.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/VersionChartExample.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/components/widgets.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolCreate/index.d.ts +3 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/components/MoreDetail/index.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/components/Overview.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/components/TotalLiquidity.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolDetail/index.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolList/AddLiquidity.d.ts +6 -1
- package/dist/types/widgets/PoolWidget/PoolList/MyCreated.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolList/MyLiquidity.d.ts +6 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/LiquidityTable.d.ts +3 -1
- package/dist/types/widgets/PoolWidget/PoolList/components/migationWidget.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/PoolList/hooks/usePoolListFilterTokenAndPool.d.ts +9 -1
- package/dist/types/widgets/PoolWidget/PoolList/index.d.ts +7 -1
- package/dist/types/widgets/PoolWidget/PoolModify/index.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/PoolOperateInner.d.ts +4 -2
- package/dist/types/widgets/PoolWidget/PoolOperate/RemovePoolOperate.d.ts +4 -2
- package/dist/types/widgets/PoolWidget/PoolOperate/components/SlippageSetting.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/index.d.ts +4 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/types.d.ts +12 -0
- package/dist/types/widgets/PoolWidget/hooks/usePoolDetail.d.ts +35 -0
- package/dist/types/widgets/PoolWidget/utils.d.ts +0 -1
- package/package.json +13 -14
- package/dist/index-Dwpantht.js +0 -78
- package/dist/index-IwdBiDvV.js +0 -32
- package/dist/index-ur0NgM_S.cjs +0 -32
- package/dist/types/store/actions/globals.d.ts +0 -9
- package/dist/types/store/actions/index.d.ts +0 -4
- package/dist/types/store/actions/settings.d.ts +0 -3
- package/dist/types/store/actions/token.d.ts +0 -7
- package/dist/types/store/actions/wallet.d.ts +0 -6
- package/dist/types/store/index.d.ts +0 -12
- package/dist/types/store/reducers/globals.d.ts +0 -21
- package/dist/types/store/reducers/index.d.ts +0 -17
- package/dist/types/store/reducers/settings.d.ts +0 -8
- package/dist/types/store/reducers/token.d.ts +0 -22
- package/dist/types/store/reducers/wallet.d.ts +0 -13
- package/dist/types/store/selectors/globals.d.ts +0 -7
- package/dist/types/store/selectors/settings.d.ts +0 -2
- package/dist/types/store/selectors/token.d.ts +0 -6
- package/dist/types/store/selectors/wallet.d.ts +0 -6
- package/dist/types/widgets/ve33/Ve33PoolList/TableList.d.ts +0 -13
- package/dist/types/widgets/ve33/Ve33PoolList/components/PoolTypeTag.d.ts +0 -7
- package/dist/types/widgets/ve33/Ve33PoolList/index.d.ts +0 -3
- package/dist/types/widgets/ve33/config.d.ts +0 -62
- package/dist/types/widgets/ve33/constants.d.ts +0 -21
- package/dist/types/widgets/ve33/hooks/usePoolColors.d.ts +0 -11
- package/dist/types/widgets/ve33/types.d.ts +0 -24
- package/dist/types/widgets/ve33/utils.d.ts +0 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const maxSlippageWarning = 5;
|
|
2
|
-
export declare const useSlippageLimit: () => boolean;
|
|
2
|
+
export declare const useSlippageLimit: (slippageSwap?: number) => boolean;
|
|
@@ -22,7 +22,6 @@ interface SwapSettingState {
|
|
|
22
22
|
ddl: string;
|
|
23
23
|
expertMode: boolean;
|
|
24
24
|
disableIndirectRouting: boolean;
|
|
25
|
-
slippage: string;
|
|
26
25
|
}
|
|
27
26
|
export declare const useSwapSettingStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SwapSettingState>, "persist"> & {
|
|
28
27
|
persist: {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
export declare enum ContractStatus {
|
|
3
|
+
Initial = "Initial",
|
|
4
|
+
Pending = "Pending",
|
|
5
|
+
ApproveSuccess = "ApproveSuccess",
|
|
6
|
+
TxSuccess = "TxSuccess",
|
|
7
|
+
Failed = "Failed"
|
|
8
|
+
}
|
|
9
|
+
interface GlobalState {
|
|
10
|
+
fromTokenChainId?: ChainId;
|
|
11
|
+
latestBlockNumber: number;
|
|
12
|
+
openConnectWalletInfo: boolean | {
|
|
13
|
+
/** Wallet is connected, chainID needs to be switched */
|
|
14
|
+
chainId?: ChainId;
|
|
15
|
+
};
|
|
16
|
+
contractStatus?: ContractStatus;
|
|
17
|
+
autoConnectLoading?: boolean;
|
|
18
|
+
showCoingecko?: boolean;
|
|
19
|
+
/** source: props.getAutoSlippage */
|
|
20
|
+
autoSlippage?: {
|
|
21
|
+
loading: boolean;
|
|
22
|
+
value: number | null;
|
|
23
|
+
};
|
|
24
|
+
slippage: string | null;
|
|
25
|
+
}
|
|
26
|
+
export declare const useGlobalState: import("zustand").UseBoundStore<import("zustand").StoreApi<GlobalState>>;
|
|
27
|
+
export declare function setContractStatus(value: GlobalState['contractStatus']): void;
|
|
28
|
+
export declare function setAutoConnectLoading(value: GlobalState['autoConnectLoading']): void;
|
|
29
|
+
export declare function setAutoSlippage(value: GlobalState['autoSlippage']): void;
|
|
30
|
+
export declare function setAutoSlippageLoading(loading: boolean): void;
|
|
31
|
+
export declare function setSlippage(value: GlobalState['slippage']): void;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TokenList } from './Token';
|
|
3
|
+
export type AccountBalance = {
|
|
4
|
+
tokenBalances?: BigNumber;
|
|
5
|
+
tokenAllowances?: BigNumber;
|
|
6
|
+
};
|
|
7
|
+
export type AccountBalances = {
|
|
8
|
+
[key in string]: AccountBalance;
|
|
9
|
+
};
|
|
10
|
+
interface TokenState {
|
|
11
|
+
tokenList: TokenList;
|
|
12
|
+
popularTokenList: TokenList;
|
|
13
|
+
}
|
|
14
|
+
export declare const useTokenState: import("zustand").UseBoundStore<import("zustand").StoreApi<TokenState>>;
|
|
15
|
+
export declare function getAllTokenList(state?: TokenState): import("./Token").TokenInfo[];
|
|
16
|
+
export declare function setTokenList(value: TokenState['tokenList']): void;
|
|
17
|
+
export declare function setPopularTokenList(value: TokenState['popularTokenList']): void;
|
|
18
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import { SwapProps } from './components/Swap';
|
|
2
2
|
import { WidgetProps } from './components/Widget';
|
|
3
|
-
export {
|
|
3
|
+
export { useRouterStore, PageType } from './router';
|
|
4
4
|
export type { Page } from './router';
|
|
5
5
|
export { WIDGET_CLASS_NAME } from './components/Widget';
|
|
6
6
|
export { MetadataFlag } from './hooks/Submission/types';
|
|
7
|
-
export { Swap } from './components/Swap';
|
|
8
|
-
export { default as SwapOrderHistory } from './components/Swap/SwapOrderHistory';
|
|
9
|
-
export { Message, UnstyleWidget, Widget } from './components/Widget';
|
|
10
|
-
export type { WidgetProps } from './components/Widget';
|
|
11
|
-
export { WIDGET_MODULE_CLASS_NAME } from './components/WidgetContainer';
|
|
12
|
-
export { chainListMap } from './constants/chainList';
|
|
13
7
|
export { rpcServerMap, scanUrlDomainMap } from './constants/chains';
|
|
14
|
-
export {
|
|
8
|
+
export { chainListMap } from './constants/chainList';
|
|
9
|
+
export { Widget, UnstyleWidget, Message } from './components/Widget';
|
|
10
|
+
export { WIDGET_MODULE_CLASS_NAME } from './components/WidgetContainer';
|
|
11
|
+
export type { WidgetProps } from './components/Widget';
|
|
12
|
+
export type SwapWidgetProps = WidgetProps & SwapProps;
|
|
15
13
|
export type { TokenInfo } from './hooks/Token/type';
|
|
16
14
|
export { useMessageState } from './hooks/useMessageState';
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
15
|
+
export { Swap } from './components/Swap';
|
|
16
|
+
export { default as SwapOrderHistory } from './components/Swap/SwapOrderHistory';
|
|
17
|
+
export { useTradeSwapOrderList } from './hooks/Swap/useTradeSwapOrderList';
|
|
20
18
|
export { Pool } from './widgets/PoolWidget';
|
|
21
|
-
export { default as AMMV2Create } from './widgets/PoolWidget/AMMV2Create';
|
|
22
|
-
export { default as AddLiquidityV3 } from './widgets/PoolWidget/AMMV3/AddLiquidityV3';
|
|
23
|
-
export { AMMV3PositionManage } from './widgets/PoolWidget/AMMV3/AMMV3PositionManage';
|
|
24
|
-
export { AMMV3PositionsView } from './widgets/PoolWidget/AMMV3/AMMV3PositionsView';
|
|
25
|
-
export { usePoolBalanceInfo } from './widgets/PoolWidget/hooks/usePoolBalanceInfo';
|
|
26
|
-
export { default as PoolCreate } from './widgets/PoolWidget/PoolCreate';
|
|
27
|
-
export { default as PoolDetail } from './widgets/PoolWidget/PoolDetail';
|
|
28
19
|
export { default as PoolList } from './widgets/PoolWidget/PoolList';
|
|
20
|
+
export { default as PoolCreate } from './widgets/PoolWidget/PoolCreate';
|
|
21
|
+
export { default as AMMV2Create } from './widgets/PoolWidget/AMMV2Create';
|
|
29
22
|
export { default as PoolModify } from './widgets/PoolWidget/PoolModify';
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
23
|
+
export { default as PoolDetail } from './widgets/PoolWidget/PoolDetail';
|
|
24
|
+
export { default as PoolOperateDialog, PoolOperate, } from './widgets/PoolWidget/PoolOperate';
|
|
32
25
|
export type { PoolOperateProps } from './widgets/PoolWidget/PoolOperate';
|
|
33
|
-
export
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
26
|
+
export { usePoolBalanceInfo } from './widgets/PoolWidget/hooks/usePoolBalanceInfo';
|
|
27
|
+
export { MiningList } from './widgets/MiningWidget/MiningList';
|
|
28
|
+
export { MiningDetail } from './widgets/MiningWidget/MiningDetail';
|
|
29
|
+
export { MiningCreate } from './widgets/MiningWidget/MiningCreate';
|
|
30
|
+
export { default as AddLiquidityV3 } from './widgets/PoolWidget/AMMV3/AddLiquidityV3';
|
|
31
|
+
export { AMMV3PositionsView } from './widgets/PoolWidget/AMMV3/AMMV3PositionsView';
|
|
32
|
+
export { AMMV3PositionManage } from './widgets/PoolWidget/AMMV3/AMMV3PositionManage';
|
|
33
|
+
export { useTokenStatus } from './hooks/Token/useTokenStatus';
|
|
34
|
+
export { default as TokenStatusButton } from './components/TokenStatusButton';
|
|
35
|
+
export { default as TokenPairStatusButton } from './components/TokenPairStatusButton';
|
|
36
36
|
export { TokenCard } from './components/Swap/components/TokenCard';
|
|
37
37
|
export { default as TokenLogo } from './components/TokenLogo';
|
|
38
|
+
export { FailedList } from './components/List/FailedList';
|
|
39
|
+
export { EmptyList } from './components/List/EmptyList';
|
|
38
40
|
export { getEtherscanPage } from './utils/address';
|
|
39
|
-
export {
|
|
41
|
+
export { formatReadableNumber, formatTokenAmountNumber, formatShortNumber, formatPercentageNumber, } from './utils/formatter';
|
|
40
42
|
export declare function SwapWidget(props: SwapWidgetProps): JSX.Element;
|
|
41
43
|
export declare function PoolWidget(props: SwapWidgetProps): JSX.Element;
|
|
42
|
-
export declare function Ve33PoolListWidget(props: SwapWidgetProps): JSX.Element;
|
|
43
44
|
export declare function InitSwapWidget(props: SwapWidgetProps): void;
|
|
@@ -30,7 +30,7 @@ export declare function getIntegerNumber(v: number): number;
|
|
|
30
30
|
* format to short number, like: -0.12 -> 0, 0.0000123->0.000012, 123.234 -> 123.23, 1234.12 -> 1.23K, 1000000.123->1.00M
|
|
31
31
|
* @param n
|
|
32
32
|
*/
|
|
33
|
-
export declare function formatShortNumber(n?:
|
|
33
|
+
export declare function formatShortNumber(n?: BigNumber, showDecimals?: number): string;
|
|
34
34
|
export declare function formatExponentialNotation(n?: BigNumber): string;
|
|
35
35
|
/**
|
|
36
36
|
* format to percentage number
|
|
@@ -43,7 +43,7 @@ roundingMode, }: {
|
|
|
43
43
|
showDecimals?: number;
|
|
44
44
|
roundingMode?: BigNumber.RoundingMode;
|
|
45
45
|
}): string;
|
|
46
|
-
export declare const formatApy: (amount: BigNumber
|
|
46
|
+
export declare const formatApy: (amount: BigNumber, showDecimals?: number) => string;
|
|
47
47
|
export declare function formatUnknownTokenSymbol(token?: {
|
|
48
48
|
symbol: string;
|
|
49
49
|
name: string;
|
|
@@ -60,10 +60,10 @@ export declare function getV3MiningSingleRewardAmount(t: ReviewedMiningRewardTok
|
|
|
60
60
|
workThroughReward: BigNumber | undefined;
|
|
61
61
|
lastFlagBlock: BigNumber | undefined;
|
|
62
62
|
rewardVault: string | undefined;
|
|
63
|
-
startTime: BigNumber | undefined;
|
|
64
|
-
endTime: BigNumber | undefined;
|
|
65
63
|
rewardPerBlock: BigNumber | undefined;
|
|
66
64
|
startBlock: BigNumber | undefined;
|
|
67
65
|
endBlock: BigNumber | undefined;
|
|
66
|
+
startTime: BigNumber | undefined;
|
|
67
|
+
endTime: BigNumber | undefined;
|
|
68
68
|
};
|
|
69
69
|
export {};
|
|
@@ -19,10 +19,10 @@ export declare function useReviewRewardToken({ chainId, index, miningContractAdd
|
|
|
19
19
|
workThroughReward: BigNumber | undefined;
|
|
20
20
|
lastFlagBlock: BigNumber | undefined;
|
|
21
21
|
rewardVault: string | undefined;
|
|
22
|
-
startTime: BigNumber | undefined;
|
|
23
|
-
endTime: BigNumber | undefined;
|
|
24
22
|
rewardPerBlock: BigNumber | undefined;
|
|
25
23
|
startBlock: BigNumber | undefined;
|
|
26
24
|
endBlock: BigNumber | undefined;
|
|
25
|
+
startTime: BigNumber | undefined;
|
|
26
|
+
endTime: BigNumber | undefined;
|
|
27
27
|
};
|
|
28
28
|
};
|
|
@@ -14,7 +14,7 @@ export declare enum PoolState {
|
|
|
14
14
|
EXISTS = 2,
|
|
15
15
|
INVALID = 3
|
|
16
16
|
}
|
|
17
|
-
export declare function usePools(poolKeys: [
|
|
17
|
+
export declare function usePools(chainId: number | undefined, poolKeys: [
|
|
18
18
|
Currency | undefined,
|
|
19
19
|
Currency | undefined,
|
|
20
20
|
FeeAmount | undefined
|
|
@@ -2,7 +2,7 @@ import { BoxProps } from '@dodoex/components';
|
|
|
2
2
|
import BigNumber from 'bignumber.js';
|
|
3
3
|
import { StateProps } from '../reducer';
|
|
4
4
|
import { SectionStatusT } from '../types';
|
|
5
|
-
export declare function BaseInfoCardList({ status, selectedVersion, baseToken, quoteToken, initPrice, slippageCoefficient, midPrice, sx, }: {
|
|
5
|
+
export declare function BaseInfoCardList({ status, selectedVersion, baseToken, quoteToken, initPrice, slippageCoefficient, midPrice, sx, cardBg, }: {
|
|
6
6
|
status: SectionStatusT;
|
|
7
7
|
selectedVersion: StateProps['selectedVersion'];
|
|
8
8
|
baseToken: StateProps['baseToken'];
|
|
@@ -11,4 +11,5 @@ export declare function BaseInfoCardList({ status, selectedVersion, baseToken, q
|
|
|
11
11
|
slippageCoefficient: StateProps['slippageCoefficient'];
|
|
12
12
|
midPrice: BigNumber | undefined;
|
|
13
13
|
sx?: BoxProps['sx'];
|
|
14
|
+
cardBg: string;
|
|
14
15
|
}): JSX.Element | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StateProps } from '../reducer';
|
|
2
|
-
export declare function FeeRateCard({ isWaiting, feeRate, }: {
|
|
2
|
+
export declare function FeeRateCard({ isWaiting, feeRate, cardBg, }: {
|
|
3
3
|
isWaiting: boolean;
|
|
4
4
|
feeRate: StateProps['feeRate'];
|
|
5
|
+
cardBg: string;
|
|
5
6
|
}): JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StateProps } from '../reducer';
|
|
2
|
-
export declare function LqRatioSet({ isWaiting, selectedVersion, baseToken, quoteToken, initPrice, slippageCoefficient, baseAmount, quoteAmount, peggedBaseTokenRatio, peggedQuoteTokenRatio, }: {
|
|
2
|
+
export declare function LqRatioSet({ isWaiting, selectedVersion, baseToken, quoteToken, initPrice, slippageCoefficient, baseAmount, quoteAmount, peggedBaseTokenRatio, peggedQuoteTokenRatio, cardBg, }: {
|
|
3
3
|
isWaiting: boolean;
|
|
4
4
|
selectedVersion: StateProps['selectedVersion'];
|
|
5
5
|
baseToken: StateProps['baseToken'];
|
|
@@ -10,4 +10,5 @@ export declare function LqRatioSet({ isWaiting, selectedVersion, baseToken, quot
|
|
|
10
10
|
quoteAmount: StateProps['quoteAmount'];
|
|
11
11
|
peggedBaseTokenRatio: StateProps['peggedBaseTokenRatio'];
|
|
12
12
|
peggedQuoteTokenRatio: StateProps['peggedQuoteTokenRatio'];
|
|
13
|
+
cardBg: string;
|
|
13
14
|
}): JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StateProps } from '../reducer';
|
|
2
2
|
import { SectionStatusT } from '../types';
|
|
3
|
-
export declare function LqSettingsShow({ status, selectedVersion, baseToken, quoteToken, initPrice, slippageCoefficient, baseAmount, quoteAmount, }: {
|
|
3
|
+
export declare function LqSettingsShow({ status, selectedVersion, baseToken, quoteToken, initPrice, slippageCoefficient, baseAmount, quoteAmount, cardBg, }: {
|
|
4
4
|
status: SectionStatusT;
|
|
5
5
|
selectedVersion: StateProps['selectedVersion'];
|
|
6
6
|
baseToken: StateProps['baseToken'];
|
|
@@ -9,4 +9,5 @@ export declare function LqSettingsShow({ status, selectedVersion, baseToken, quo
|
|
|
9
9
|
slippageCoefficient: StateProps['slippageCoefficient'];
|
|
10
10
|
baseAmount: StateProps['baseAmount'];
|
|
11
11
|
quoteAmount: StateProps['quoteAmount'];
|
|
12
|
+
cardBg: string;
|
|
12
13
|
}): JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StateProps } from '../reducer';
|
|
2
|
-
export declare function PriceModeCard({ isWaiting, selectedSubPeggedVersion, }: {
|
|
2
|
+
export declare function PriceModeCard({ isWaiting, selectedSubPeggedVersion, cardBg, }: {
|
|
3
3
|
isWaiting: boolean;
|
|
4
4
|
selectedSubPeggedVersion: StateProps['selectedSubPeggedVersion'];
|
|
5
|
+
cardBg: string;
|
|
5
6
|
}): JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SectionStatusT, VersionItem } from '../types';
|
|
2
|
-
export declare function VersionChartExample({ versionItem, status, }: {
|
|
2
|
+
export declare function VersionChartExample({ versionItem, status, cardBg, }: {
|
|
3
3
|
versionItem: VersionItem;
|
|
4
4
|
status: SectionStatusT;
|
|
5
|
+
cardBg: string;
|
|
5
6
|
}): JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare function Card({ title, children, isWaiting, }: {
|
|
2
|
+
export declare function Card({ title, children, isWaiting, backgroundColor, }: {
|
|
3
3
|
title: React.ReactNode;
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
isWaiting: boolean;
|
|
6
|
+
backgroundColor: string;
|
|
6
7
|
}): JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { usePoolDetail } from '../../../hooks/usePoolDetail';
|
|
2
|
-
export default function MoreDetail({ poolDetail, }: {
|
|
2
|
+
export default function MoreDetail({ poolDetail, cardBg, }: {
|
|
3
3
|
poolDetail: ReturnType<typeof usePoolDetail>['poolDetail'];
|
|
4
|
+
cardBg: string;
|
|
4
5
|
}): JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { usePoolDetail } from '../../hooks/usePoolDetail';
|
|
2
|
-
export default function Overview({ poolDetail, }: {
|
|
2
|
+
export default function Overview({ poolDetail, cardBg, }: {
|
|
3
3
|
poolDetail: ReturnType<typeof usePoolDetail>['poolDetail'];
|
|
4
|
+
cardBg: string;
|
|
4
5
|
}): JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { usePoolDetail } from '../../hooks/usePoolDetail';
|
|
2
|
-
export default function TotalLiquidity({ poolDetail, }: {
|
|
2
|
+
export default function TotalLiquidity({ poolDetail, cardBg, }: {
|
|
3
3
|
poolDetail: ReturnType<typeof usePoolDetail>['poolDetail'];
|
|
4
|
+
cardBg: string;
|
|
4
5
|
}): JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ChainId } from '@dodoex/api';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { TokenAndPoolFilterUserOptions } from './hooks/usePoolListFilterTokenAndPool';
|
|
3
4
|
import { PoolOperateProps } from '../PoolOperate';
|
|
4
|
-
|
|
5
|
+
import { GetMigrationPairAndMining } from '../PoolOperate/types';
|
|
6
|
+
export default function AddLiquidityList({ scrollParentRef, filterChainIds, activeChainId, handleChangeActiveChainId, operatePool, setOperatePool, tokenAndPoolFilter, getMigrationPairAndMining, supportAMMIcon, }: {
|
|
5
7
|
scrollParentRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
6
8
|
account?: string;
|
|
7
9
|
filterChainIds?: ChainId[];
|
|
@@ -9,4 +11,7 @@ export default function AddLiquidityList({ scrollParentRef, filterChainIds, acti
|
|
|
9
11
|
handleChangeActiveChainId: (chainId: number | undefined) => void;
|
|
10
12
|
operatePool: Partial<PoolOperateProps> | null;
|
|
11
13
|
setOperatePool: (operate: Partial<PoolOperateProps> | null) => void;
|
|
14
|
+
tokenAndPoolFilter?: TokenAndPoolFilterUserOptions;
|
|
15
|
+
getMigrationPairAndMining?: GetMigrationPairAndMining;
|
|
16
|
+
supportAMMIcon?: boolean;
|
|
12
17
|
}): JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ChainId } from '@dodoex/api';
|
|
2
2
|
import { PoolOperateProps } from '../PoolOperate';
|
|
3
|
-
export default function MyCreated({ account, filterChainIds, activeChainId, handleChangeActiveChainId, operatePool, setOperatePool, }: {
|
|
3
|
+
export default function MyCreated({ account, filterChainIds, activeChainId, handleChangeActiveChainId, operatePool, setOperatePool, supportAMMIcon, }: {
|
|
4
4
|
account?: string;
|
|
5
5
|
filterChainIds?: ChainId[];
|
|
6
6
|
activeChainId: ChainId | undefined;
|
|
7
7
|
handleChangeActiveChainId: (chainId: number | undefined) => void;
|
|
8
8
|
operatePool: Partial<PoolOperateProps> | null;
|
|
9
9
|
setOperatePool: (operate: Partial<PoolOperateProps> | null) => void;
|
|
10
|
+
supportAMMIcon?: boolean;
|
|
10
11
|
}): JSX.Element;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { ChainId } from '@dodoex/api';
|
|
2
|
+
import { TokenAndPoolFilterUserOptions } from './hooks/usePoolListFilterTokenAndPool';
|
|
2
3
|
import { PoolOperateProps } from '../PoolOperate';
|
|
3
|
-
|
|
4
|
+
import { GetMigrationPairAndMining } from '../PoolOperate/types';
|
|
5
|
+
export default function MyLiquidity({ account, filterChainIds, activeChainId, handleChangeActiveChainId, operatePool, setOperatePool, getMigrationPairAndMining, tokenAndPoolFilter, supportAMMIcon, }: {
|
|
4
6
|
account?: string;
|
|
5
7
|
filterChainIds?: ChainId[];
|
|
6
8
|
activeChainId: ChainId | undefined;
|
|
7
9
|
handleChangeActiveChainId: (chainId: number | undefined) => void;
|
|
8
10
|
operatePool: Partial<PoolOperateProps> | null;
|
|
9
11
|
setOperatePool: (operate: Partial<PoolOperateProps> | null) => void;
|
|
12
|
+
getMigrationPairAndMining?: GetMigrationPairAndMining;
|
|
13
|
+
tokenAndPoolFilter?: TokenAndPoolFilterUserOptions;
|
|
14
|
+
supportAMMIcon?: boolean;
|
|
10
15
|
}): JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BoxProps } from '@dodoex/components';
|
|
2
|
-
export default function LiquidityTable({ sx, children, hasMore, loadMore, loadMoreLoading, ...props }: BoxProps & {
|
|
2
|
+
export default function LiquidityTable({ sx, children, empty, loading, hasMore, loadMore, loadMoreLoading, ...props }: BoxProps & {
|
|
3
|
+
empty?: boolean;
|
|
4
|
+
loading?: boolean;
|
|
3
5
|
hasMore?: boolean;
|
|
4
6
|
loadMore?: () => void;
|
|
5
7
|
loadMoreLoading?: boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BoxProps } from '@dodoex/components';
|
|
2
|
+
export interface MigrationTagProps {
|
|
3
|
+
sx?: BoxProps['sx'];
|
|
4
|
+
isRightTop?: boolean;
|
|
5
|
+
isReverseColor?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const MigrationTag: ({ sx, isRightTop, isReverseColor, }: MigrationTagProps) => JSX.Element;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { TokenInfo } from '../../../../hooks/Token';
|
|
2
3
|
import { FetchLiquidityListLqList } from '../../utils';
|
|
3
|
-
export
|
|
4
|
+
export interface TokenAndPoolFilterUserOptions {
|
|
5
|
+
tokens: Array<TokenInfo>;
|
|
6
|
+
lqList: FetchLiquidityListLqList;
|
|
7
|
+
onChangeFilterTokens: (tokens: Array<TokenInfo>) => void;
|
|
8
|
+
onChangeFilterAddressLqList: (lqList: FetchLiquidityListLqList) => void;
|
|
9
|
+
element: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function usePoolListFilterTokenAndPool(tokenAndPoolFilter?: TokenAndPoolFilterUserOptions): {
|
|
4
12
|
filterTokens: TokenInfo[];
|
|
5
13
|
filterASymbol: string;
|
|
6
14
|
filterBSymbol: string;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Page, PageType } from '../../../router/types';
|
|
3
|
-
|
|
3
|
+
import { TokenAndPoolFilterUserOptions } from './hooks/usePoolListFilterTokenAndPool';
|
|
4
|
+
import { GetMigrationPairAndMining, ShowMigrationPairAndMining } from '../PoolOperate/types';
|
|
5
|
+
export default function PoolList({ params, scrollRef: scrollParentRefProps, tokenAndPoolFilter, getMigrationPairAndMining, showMigrationPairAndMining, supportAMMIcon, }: {
|
|
4
6
|
params?: Page<PageType.Pool>['params'];
|
|
5
7
|
scrollRef?: React.RefObject<any>;
|
|
8
|
+
tokenAndPoolFilter?: TokenAndPoolFilterUserOptions;
|
|
9
|
+
getMigrationPairAndMining?: GetMigrationPairAndMining;
|
|
10
|
+
showMigrationPairAndMining?: ShowMigrationPairAndMining;
|
|
11
|
+
supportAMMIcon?: boolean;
|
|
6
12
|
}): JSX.Element;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { OperateTab } from './hooks/usePoolOperateTabs';
|
|
2
|
-
import { OperatePool } from './types';
|
|
2
|
+
import { GetMigrationPairAndMining, OperatePool, ShowMigrationPairAndMining } from './types';
|
|
3
3
|
export interface PoolOperateInnerProps {
|
|
4
4
|
pool: OperatePool;
|
|
5
5
|
operate?: OperateTab;
|
|
6
6
|
hidePoolInfo?: boolean;
|
|
7
7
|
errorRefetch?: () => void;
|
|
8
8
|
submittedBack?: () => void;
|
|
9
|
+
getMigrationPairAndMining?: GetMigrationPairAndMining;
|
|
10
|
+
showMigrationPairAndMining?: ShowMigrationPairAndMining;
|
|
9
11
|
}
|
|
10
|
-
export default function PoolOperateInner({ pool, operate, hidePoolInfo, errorRefetch, submittedBack, }: PoolOperateInnerProps): JSX.Element;
|
|
12
|
+
export default function PoolOperateInner({ pool, operate, hidePoolInfo, errorRefetch, submittedBack, getMigrationPairAndMining, showMigrationPairAndMining, }: PoolOperateInnerProps): JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { OperatePool } from './types';
|
|
1
|
+
import { GetMigrationPairAndMining, OperatePool, ShowMigrationPairAndMining } from './types';
|
|
2
2
|
import { usePoolBalanceInfo } from '../hooks/usePoolBalanceInfo';
|
|
3
|
-
export declare function RemovePoolOperate({ submittedBack: submittedBackProps, onlyShowSide, pool, balanceInfo, }: {
|
|
3
|
+
export declare function RemovePoolOperate({ submittedBack: submittedBackProps, onlyShowSide, pool, balanceInfo, getMigrationPairAndMining, showMigrationPairAndMining, }: {
|
|
4
4
|
submittedBack?: () => void;
|
|
5
5
|
onlyShowSide?: 'base' | 'quote';
|
|
6
6
|
pool?: OperatePool;
|
|
7
7
|
balanceInfo: ReturnType<typeof usePoolBalanceInfo>;
|
|
8
|
+
getMigrationPairAndMining?: GetMigrationPairAndMining;
|
|
9
|
+
showMigrationPairAndMining?: ShowMigrationPairAndMining;
|
|
8
10
|
}): JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { AUTO_SWAP_SLIPPAGE_PROTECTION } from '../../../../constants/pool';
|
|
|
3
3
|
import { PoolType } from '@dodoex/api';
|
|
4
4
|
export declare const useSlipper: ({ address, type, }: {
|
|
5
5
|
address?: string;
|
|
6
|
-
type?:
|
|
6
|
+
type?: PoolType;
|
|
7
7
|
}) => {
|
|
8
8
|
slipper: number | "auto";
|
|
9
9
|
setSlipper: import("react").Dispatch<import("react").SetStateAction<number | "auto">>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BoxProps } from '@dodoex/components';
|
|
2
2
|
import { PoolOperateInnerProps } from './PoolOperateInner';
|
|
3
|
+
import { GetMigrationPairAndMining, ShowMigrationPairAndMining } from './types';
|
|
3
4
|
export interface PoolOperateProps {
|
|
4
5
|
onClose?: () => void;
|
|
5
6
|
account: string | undefined;
|
|
@@ -10,8 +11,10 @@ export interface PoolOperateProps {
|
|
|
10
11
|
hasMining?: boolean;
|
|
11
12
|
hidePoolInfo?: boolean;
|
|
12
13
|
sx?: BoxProps['sx'];
|
|
14
|
+
getMigrationPairAndMining?: GetMigrationPairAndMining;
|
|
15
|
+
showMigrationPairAndMining?: ShowMigrationPairAndMining;
|
|
13
16
|
}
|
|
14
|
-
export declare function PoolOperate({ onClose, pool: poolProps, address, operate, chainId, hasMining, hidePoolInfo, sx, }: PoolOperateProps): JSX.Element;
|
|
17
|
+
export declare function PoolOperate({ onClose, pool: poolProps, address, operate, chainId, hasMining, hidePoolInfo, sx, getMigrationPairAndMining, showMigrationPairAndMining, }: PoolOperateProps): JSX.Element;
|
|
15
18
|
export default function PoolOperateDialog({ modal, ...props }: PoolOperateProps & {
|
|
16
19
|
modal?: boolean;
|
|
17
20
|
}): JSX.Element;
|
|
@@ -20,3 +20,15 @@ export type OperatePool = {
|
|
|
20
20
|
lpFeeRate?: string;
|
|
21
21
|
liquidityPositions?: ExcludeNone<ExcludeNone<FetchMyLiquidityListLqList>[0]>['liquidityPositions'];
|
|
22
22
|
} | undefined;
|
|
23
|
+
export interface LiquidityMigrationInfo {
|
|
24
|
+
chainId: number;
|
|
25
|
+
miningContractAddress: string;
|
|
26
|
+
stakeTokenAddress: string;
|
|
27
|
+
newMiningContractAddress: string;
|
|
28
|
+
newStakeTokenAddress: string;
|
|
29
|
+
}
|
|
30
|
+
export type GetMigrationPairAndMining = (p: {
|
|
31
|
+
address: string;
|
|
32
|
+
chainId: number;
|
|
33
|
+
}) => LiquidityMigrationInfo | undefined;
|
|
34
|
+
export type ShowMigrationPairAndMining = (p: LiquidityMigrationInfo) => void;
|
|
@@ -11,6 +11,13 @@ export declare function usePoolDetail({ id, chainId, }: {
|
|
|
11
11
|
baseToken: TokenInfo;
|
|
12
12
|
quoteToken: TokenInfo;
|
|
13
13
|
miningAddress: string;
|
|
14
|
+
apy: {
|
|
15
|
+
miningBaseApy?: any | null;
|
|
16
|
+
miningQuoteApy?: any | null;
|
|
17
|
+
transactionBaseApy?: any | null;
|
|
18
|
+
transactionQuoteApy?: any | null;
|
|
19
|
+
metromMiningApy?: any | null;
|
|
20
|
+
} | null | undefined;
|
|
14
21
|
baseApy: string | undefined;
|
|
15
22
|
quoteApy: string | undefined;
|
|
16
23
|
isCpPool: boolean;
|
|
@@ -80,6 +87,13 @@ export declare function usePoolDetail({ id, chainId, }: {
|
|
|
80
87
|
baseToken: TokenInfo;
|
|
81
88
|
quoteToken: TokenInfo;
|
|
82
89
|
miningAddress: string;
|
|
90
|
+
apy: {
|
|
91
|
+
miningBaseApy?: any | null;
|
|
92
|
+
miningQuoteApy?: any | null;
|
|
93
|
+
transactionBaseApy?: any | null;
|
|
94
|
+
transactionQuoteApy?: any | null;
|
|
95
|
+
metromMiningApy?: any | null;
|
|
96
|
+
} | null | undefined;
|
|
83
97
|
baseApy: string | undefined;
|
|
84
98
|
quoteApy: string | undefined;
|
|
85
99
|
isCpPool: boolean;
|
|
@@ -149,6 +163,13 @@ export declare function usePoolDetail({ id, chainId, }: {
|
|
|
149
163
|
baseToken: TokenInfo;
|
|
150
164
|
quoteToken: TokenInfo;
|
|
151
165
|
miningAddress: string;
|
|
166
|
+
apy: {
|
|
167
|
+
miningBaseApy?: any | null;
|
|
168
|
+
miningQuoteApy?: any | null;
|
|
169
|
+
transactionBaseApy?: any | null;
|
|
170
|
+
transactionQuoteApy?: any | null;
|
|
171
|
+
metromMiningApy?: any | null;
|
|
172
|
+
} | null | undefined;
|
|
152
173
|
baseApy: string | undefined;
|
|
153
174
|
quoteApy: string | undefined;
|
|
154
175
|
isCpPool: boolean;
|
|
@@ -218,6 +239,13 @@ export declare function usePoolDetail({ id, chainId, }: {
|
|
|
218
239
|
baseToken: TokenInfo;
|
|
219
240
|
quoteToken: TokenInfo;
|
|
220
241
|
miningAddress: string;
|
|
242
|
+
apy: {
|
|
243
|
+
miningBaseApy?: any | null;
|
|
244
|
+
miningQuoteApy?: any | null;
|
|
245
|
+
transactionBaseApy?: any | null;
|
|
246
|
+
transactionQuoteApy?: any | null;
|
|
247
|
+
metromMiningApy?: any | null;
|
|
248
|
+
} | null | undefined;
|
|
221
249
|
baseApy: string | undefined;
|
|
222
250
|
quoteApy: string | undefined;
|
|
223
251
|
isCpPool: boolean;
|
|
@@ -287,6 +315,13 @@ export declare function usePoolDetail({ id, chainId, }: {
|
|
|
287
315
|
baseToken: TokenInfo;
|
|
288
316
|
quoteToken: TokenInfo;
|
|
289
317
|
miningAddress: string;
|
|
318
|
+
apy: {
|
|
319
|
+
miningBaseApy?: any | null;
|
|
320
|
+
miningQuoteApy?: any | null;
|
|
321
|
+
transactionBaseApy?: any | null;
|
|
322
|
+
transactionQuoteApy?: any | null;
|
|
323
|
+
metromMiningApy?: any | null;
|
|
324
|
+
} | null | undefined;
|
|
290
325
|
baseApy: string | undefined;
|
|
291
326
|
quoteApy: string | undefined;
|
|
292
327
|
isCpPool: boolean;
|
|
@@ -7,7 +7,6 @@ export type FetchLiquidityListLqList = ExcludeNone<ReturnType<Exclude<(typeof Po
|
|
|
7
7
|
export type FetchMyLiquidityListLqList = ExcludeNone<ReturnType<Exclude<(typeof PoolApi.graphql.fetchMyLiquidityList)['__apiType'], undefined>>['liquidity_list']>['lqList'];
|
|
8
8
|
export type FetchMyCreateListLqList = ExcludeNone<ReturnType<Exclude<(typeof PoolApi.graphql.fetchDashboardPairList)['__apiType'], undefined>>['dashboard_pairs_list']>['list'];
|
|
9
9
|
export type FetchPoolList = ExcludeNone<ReturnType<Exclude<(typeof PoolApi.graphql.fetchPoolList)['__apiType'], undefined>>['pairs']>;
|
|
10
|
-
export type FetchVe33PoolList = ExcludeNone<ReturnType<Exclude<(typeof PoolApi.graphql.fetchVe33PoolList)['__apiType'], undefined>>['ve33_getPoolList']>;
|
|
11
10
|
export declare function convertLiquidityTokenToTokenInfo(token: {
|
|
12
11
|
id: string;
|
|
13
12
|
symbol: string;
|