@dodoex/widgets 3.0.3-neox.9 → 3.0.4-ve33.10
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-AjnHSFsf.cjs → helper-BPuHWVRM.cjs} +1 -1
- package/dist/{helper-0hzCeJrS.js → helper-t_Ye_aBf.js} +1 -1
- package/dist/{index-Qj9OIRRb.js → index-BA5HePEm.js} +1 -1
- package/dist/index-C8qblH3I.js +32 -0
- package/dist/index-CQTOLjzQ.cjs +32 -0
- package/dist/{index-DjwU4kAc.js → index-CTWa5eCR.js} +1 -1
- package/dist/{index-HyEGLl2q.cjs → index-Cg3PeApO.cjs} +1 -1
- package/dist/{index-BvhDPlnr.cjs → index-al7nXNyl.cjs} +1 -1
- 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 +3 -1
- package/dist/types/components/CardWidgets.d.ts +1 -0
- package/dist/types/components/Swap/components/Dialog.d.ts +0 -2
- package/dist/types/components/Swap/components/ReviewDialog.d.ts +1 -2
- package/dist/types/components/Swap/components/SwapSettingsDialog/index.d.ts +1 -4
- package/dist/types/components/Swap/components/TokenCard/BalanceText.d.ts +1 -3
- package/dist/types/components/Swap/components/TokenCard/TokenLogoCollapse.d.ts +1 -5
- package/dist/types/components/Swap/components/TokenCard/index.d.ts +5 -5
- package/dist/types/components/Swap/components/TokenPairPriceWithToggle.d.ts +2 -14
- package/dist/types/components/Swap/index.d.ts +1 -4
- package/dist/types/components/Widget/index.d.ts +3 -0
- package/dist/types/components/WithExecutionDialog/index.d.ts +1 -1
- package/dist/types/constants/api.d.ts +1 -1
- package/dist/types/constants/swap.d.ts +3 -0
- package/dist/types/hooks/Submission/types.d.ts +6 -1
- package/dist/types/hooks/Submission/useExecution.d.ts +2 -0
- package/dist/types/hooks/Swap/useFetchRoutePrice.d.ts +1 -3
- package/dist/types/hooks/Swap/useSlippageLimit.d.ts +1 -1
- package/dist/types/hooks/Swap/useSwapSettingStore.d.ts +1 -0
- package/dist/types/hooks/style/useWidgetDevice.d.ts +0 -2
- package/dist/types/hooks/useGraphQLRequests.d.ts +0 -1
- package/dist/types/index.d.ts +36 -23
- package/dist/types/store/actions/token.d.ts +1 -1
- package/dist/types/store/selectors/token.d.ts +2 -2
- package/dist/types/utils/address.d.ts +1 -1
- package/dist/types/utils/formatter.d.ts +2 -2
- package/dist/types/utils/token.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/addresses.d.ts +0 -14
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/chains.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/PoolList/components/GoPoolDetailBtn.d.ts +1 -3
- package/dist/types/widgets/PoolWidget/PoolList/hooks/usePoolListFilterTokenAndPool.d.ts +1 -0
- package/dist/types/widgets/PoolWidget/PoolList/hooks/usePoolListTabs.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/AddPoolOperate.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/RemovePoolOperate.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/components/LiquidityInfo.d.ts +1 -3
- package/dist/types/widgets/PoolWidget/hooks/contract/getModifyDPPPoolParams.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/utils.d.ts +2 -0
- package/dist/types/widgets/ve33/Ve33PoolDetail/index.d.ts +7 -0
- package/dist/types/widgets/ve33/Ve33PoolList/TableList.d.ts +14 -0
- package/dist/types/widgets/ve33/Ve33PoolList/index.d.ts +5 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/AddPoolOperate.d.ts +6 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/RemovePoolOperate.d.ts +5 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/components/ComparePrice.d.ts +8 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/components/OperateBtn.d.ts +6 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/components/SliderPercentageCard.d.ts +7 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/components/SlippageSetting.d.ts +18 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/components/V2ConfirmDialog.d.ts +19 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/hooks/useComparePrice.d.ts +19 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/hooks/useLiquidityOperateAmount.d.ts +82 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/hooks/usePercentageRemove.d.ts +25 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/hooks/usePoolOperateTabs.d.ts +12 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/hooks/useVe33V2AddLiquidity.d.ts +12 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/hooks/useVe33V2BalanceInfo.d.ts +34 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/hooks/useVe33V2RemoveLiquidity.d.ts +12 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/hooks/useWithdrawInfo.d.ts +25 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/index.d.ts +23 -0
- package/dist/types/widgets/ve33/Ve33PoolOperate/types.d.ts +22 -0
- package/dist/types/widgets/ve33/VotePoolList/TableList.d.ts +14 -0
- package/dist/types/widgets/ve33/VotePoolList/index.d.ts +1 -0
- package/dist/types/widgets/ve33/components/GoBack.d.ts +4 -0
- package/dist/types/widgets/ve33/components/PoolHead.d.ts +8 -0
- package/dist/types/widgets/ve33/components/PoolTypeTag.d.ts +8 -0
- package/dist/types/widgets/ve33/components/widgets.d.ts +5 -0
- package/dist/types/widgets/ve33/config.d.ts +62 -0
- package/dist/types/widgets/ve33/constants.d.ts +21 -0
- package/dist/types/widgets/ve33/hooks/usePoolColors.d.ts +11 -0
- package/dist/types/widgets/ve33/hooks/useVotePoolFilters.d.ts +13 -0
- package/dist/types/widgets/ve33/hooks/useVoteTabs.d.ts +12 -0
- package/dist/types/widgets/ve33/types.d.ts +38 -0
- package/dist/types/widgets/ve33/utils.d.ts +9 -0
- package/package.json +11 -11
- package/dist/9cc2b17a1958d960.svg +0 -3
- package/dist/f7a5110e71722a0c.svg +0 -10
- package/dist/index-C10KoHv_.js +0 -32
- package/dist/index-ClXjNHoy.cjs +0 -32
- package/dist/types/components/Swap/components/SwapInfoCard.d.ts +0 -9
- package/dist/types/hooks/Swap/useFetchRoutePrice.test.d.ts +0 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/components/MyLiquidityInfo.d.ts +0 -15
- package/dist/types/widgets/PoolWidget/PoolOperate/components/PairTitle.d.ts +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ExecutionProps } from '../../hooks/Submission';
|
|
3
|
-
export default function WithExecutionDialog({ children, executionStatus, ...props }: {
|
|
3
|
+
export default function WithExecutionDialog({ children, executionStatus, showSubmitLoadingDialog, ...props }: {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
} & ExecutionProps): JSX.Element;
|
|
@@ -13,7 +13,7 @@ export declare const AppUrl = "https://app.dodoex.io";
|
|
|
13
13
|
export declare const getCGTokenListAPI: (chainId: ChainId) => any;
|
|
14
14
|
export declare const RoutePriceAPI = "https://api.dodoex.io/route-service/v2/widget/getdodoroute";
|
|
15
15
|
export declare const FiatPriceAPI = "https://api.dodoex.io/frontend-price-api/current/batch";
|
|
16
|
-
export declare function getAPIService(key: APIServiceKey, serviceProps
|
|
16
|
+
export declare function getAPIService(key: APIServiceKey, serviceProps: Partial<APIServices> | undefined, apiDomain: string): string;
|
|
17
17
|
export declare const contractRequests: ContractRequests;
|
|
18
18
|
export declare const tokenContractRequests: ContractRequests;
|
|
19
19
|
export declare const tokenApi: TokenApi;
|
|
@@ -27,7 +27,9 @@ export declare enum MetadataFlag {
|
|
|
27
27
|
claimMining = "claimMining",
|
|
28
28
|
submissionCreateMetaKey = "submissionCreateMetaKey",
|
|
29
29
|
approve = "approve",
|
|
30
|
-
reset = "reset"
|
|
30
|
+
reset = "reset",
|
|
31
|
+
addLiquidityVe33V2Position = "addLiquidityVe33V2Position",
|
|
32
|
+
removeLiquidityVe33V2Position = "removeLiquidityVe33V2Position"
|
|
31
33
|
}
|
|
32
34
|
export type Metadata = Record<string, any>;
|
|
33
35
|
export type Request = {
|
|
@@ -51,10 +53,12 @@ export declare enum ExecutionResult {
|
|
|
51
53
|
Success = "success",
|
|
52
54
|
Submitted = "submitted"
|
|
53
55
|
}
|
|
56
|
+
type SubmitState = 'loading' | 'submitted';
|
|
54
57
|
export interface Showing {
|
|
55
58
|
brief: string;
|
|
56
59
|
subtitle?: string | React.ReactNode;
|
|
57
60
|
spec: StepSpec;
|
|
61
|
+
submitState?: SubmitState;
|
|
58
62
|
}
|
|
59
63
|
export type ExecutionCtx = {
|
|
60
64
|
/**
|
|
@@ -90,3 +94,4 @@ export declare enum WatchResult {
|
|
|
90
94
|
Failed = 0,
|
|
91
95
|
Success = 1
|
|
92
96
|
}
|
|
97
|
+
export {};
|
|
@@ -4,6 +4,7 @@ export interface ExecutionProps {
|
|
|
4
4
|
onTxSubmit?: (tx: string, data: any) => void;
|
|
5
5
|
onTxSuccess?: (tx: string, data: any) => void;
|
|
6
6
|
onTxReverted?: (tx: string, data: any) => void;
|
|
7
|
+
showSubmitLoadingDialog?: boolean;
|
|
7
8
|
executionStatus?: {
|
|
8
9
|
showing?: Showing | null;
|
|
9
10
|
showingDone?: boolean;
|
|
@@ -20,6 +21,7 @@ export default function useExecution({ onTxFail, onTxSubmit, onTxSuccess, onTxRe
|
|
|
20
21
|
errorMessage: string | null;
|
|
21
22
|
setErrorMessage: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
22
23
|
closeShowing: () => void;
|
|
24
|
+
setShowing: import("react").Dispatch<import("react").SetStateAction<Showing | null>>;
|
|
23
25
|
ctxVal: ExecutionCtx;
|
|
24
26
|
requests: Map<string, [Request, State]>;
|
|
25
27
|
};
|
|
@@ -14,8 +14,6 @@ export interface FetchRoutePrice {
|
|
|
14
14
|
toAmount: string;
|
|
15
15
|
estimateGas?: boolean;
|
|
16
16
|
isReverseRouting?: boolean;
|
|
17
|
-
slippage?: number;
|
|
18
|
-
slippageLoading?: boolean;
|
|
19
17
|
}
|
|
20
18
|
interface IRouteResponse {
|
|
21
19
|
resAmount: number;
|
|
@@ -30,7 +28,7 @@ interface IRouteResponse {
|
|
|
30
28
|
useSource: string;
|
|
31
29
|
duration: number;
|
|
32
30
|
}
|
|
33
|
-
export declare function useFetchRoutePrice({ toToken, fromToken, fromAmount, toAmount, marginAmount, estimateGas, isReverseRouting,
|
|
31
|
+
export declare function useFetchRoutePrice({ toToken, fromToken, fromAmount, toAmount, marginAmount, estimateGas, isReverseRouting, }: FetchRoutePrice): {
|
|
34
32
|
status: RoutePriceStatus;
|
|
35
33
|
rawBrief: IRouteResponse | null;
|
|
36
34
|
refetch: () => Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const maxSlippageWarning = 5;
|
|
2
|
-
export declare const useSlippageLimit: (
|
|
2
|
+
export declare const useSlippageLimit: () => boolean;
|
|
@@ -22,6 +22,7 @@ interface SwapSettingState {
|
|
|
22
22
|
ddl: string;
|
|
23
23
|
expertMode: boolean;
|
|
24
24
|
disableIndirectRouting: boolean;
|
|
25
|
+
slippage: string;
|
|
25
26
|
}
|
|
26
27
|
export declare const useSwapSettingStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SwapSettingState>, "persist"> & {
|
|
27
28
|
persist: {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,41 +1,54 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
1
2
|
import { SwapProps } from './components/Swap';
|
|
2
3
|
import { WidgetProps } from './components/Widget';
|
|
3
|
-
export {
|
|
4
|
+
export { PageType, useRouterStore } from './router';
|
|
4
5
|
export type { Page } from './router';
|
|
5
6
|
export { WIDGET_CLASS_NAME } from './components/Widget';
|
|
6
7
|
export { MetadataFlag } from './hooks/Submission/types';
|
|
7
|
-
export { rpcServerMap, scanUrlDomainMap } from './constants/chains';
|
|
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;
|
|
13
|
-
export type { TokenInfo } from './hooks/Token/type';
|
|
14
|
-
export { useMessageState } from './hooks/useMessageState';
|
|
15
8
|
export { Swap } from './components/Swap';
|
|
16
9
|
export { default as SwapOrderHistory } from './components/Swap/SwapOrderHistory';
|
|
10
|
+
export { Message, UnstyleWidget, Widget } from './components/Widget';
|
|
11
|
+
export type { WidgetProps } from './components/Widget';
|
|
12
|
+
export { WIDGET_MODULE_CLASS_NAME } from './components/WidgetContainer';
|
|
13
|
+
export { chainListMap } from './constants/chainList';
|
|
14
|
+
export { rpcServerMap, scanUrlDomainMap } from './constants/chains';
|
|
17
15
|
export { useTradeSwapOrderList } from './hooks/Swap/useTradeSwapOrderList';
|
|
16
|
+
export type { TokenInfo } from './hooks/Token/type';
|
|
17
|
+
export { useMessageState } from './hooks/useMessageState';
|
|
18
|
+
export { MiningCreate } from './widgets/MiningWidget/MiningCreate';
|
|
19
|
+
export { MiningDetail } from './widgets/MiningWidget/MiningDetail';
|
|
20
|
+
export { MiningList } from './widgets/MiningWidget/MiningList';
|
|
18
21
|
export { Pool } from './widgets/PoolWidget';
|
|
19
|
-
export { default as PoolList } from './widgets/PoolWidget/PoolList';
|
|
20
|
-
export { default as PoolCreate } from './widgets/PoolWidget/PoolCreate';
|
|
21
22
|
export { default as AMMV2Create } from './widgets/PoolWidget/AMMV2Create';
|
|
22
|
-
export { default as PoolModify } from './widgets/PoolWidget/PoolModify';
|
|
23
|
-
export { default as PoolDetail } from './widgets/PoolWidget/PoolDetail';
|
|
24
|
-
export { default as PoolOperateDialog, PoolOperate, } from './widgets/PoolWidget/PoolOperate';
|
|
25
|
-
export type { PoolOperateProps } from './widgets/PoolWidget/PoolOperate';
|
|
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
23
|
export { default as AddLiquidityV3 } from './widgets/PoolWidget/AMMV3/AddLiquidityV3';
|
|
31
|
-
export { AMMV3PositionsView } from './widgets/PoolWidget/AMMV3/AMMV3PositionsView';
|
|
32
24
|
export { AMMV3PositionManage } from './widgets/PoolWidget/AMMV3/AMMV3PositionManage';
|
|
25
|
+
export { AMMV3PositionsView } from './widgets/PoolWidget/AMMV3/AMMV3PositionsView';
|
|
26
|
+
export { usePoolBalanceInfo } from './widgets/PoolWidget/hooks/usePoolBalanceInfo';
|
|
27
|
+
export { default as PoolCreate } from './widgets/PoolWidget/PoolCreate';
|
|
28
|
+
export { default as PoolDetail } from './widgets/PoolWidget/PoolDetail';
|
|
29
|
+
export { default as PoolList } from './widgets/PoolWidget/PoolList';
|
|
30
|
+
export { default as PoolModify } from './widgets/PoolWidget/PoolModify';
|
|
31
|
+
export { PoolOperate, default as PoolOperateDialog, } from './widgets/PoolWidget/PoolOperate';
|
|
32
|
+
export type { PoolOperateProps } from './widgets/PoolWidget/PoolOperate';
|
|
33
|
+
export { Ve33PoolDetail } from './widgets/ve33/Ve33PoolDetail';
|
|
34
|
+
export { Ve33PoolList } from './widgets/ve33/Ve33PoolList';
|
|
35
|
+
export { VotePoolList } from './widgets/ve33/VotePoolList';
|
|
36
|
+
export type SwapWidgetProps = WidgetProps & SwapProps;
|
|
37
|
+
export { EmptyList } from './components/List/EmptyList';
|
|
38
|
+
export { FailedList } from './components/List/FailedList';
|
|
33
39
|
export { TokenCard } from './components/Swap/components/TokenCard';
|
|
34
40
|
export { default as TokenLogo } from './components/TokenLogo';
|
|
35
|
-
export { FailedList } from './components/List/FailedList';
|
|
36
|
-
export { EmptyList } from './components/List/EmptyList';
|
|
37
41
|
export { getEtherscanPage } from './utils/address';
|
|
38
|
-
export {
|
|
42
|
+
export { formatPercentageNumber, formatReadableNumber, formatShortNumber, formatTokenAmountNumber, } from './utils/formatter';
|
|
39
43
|
export declare function SwapWidget(props: SwapWidgetProps): JSX.Element;
|
|
40
44
|
export declare function PoolWidget(props: SwapWidgetProps): JSX.Element;
|
|
45
|
+
export declare function Ve33PoolListWidget(props: WidgetProps & {
|
|
46
|
+
onClickPoolListRow: (id: string, chainId: ChainId) => void;
|
|
47
|
+
}): JSX.Element;
|
|
48
|
+
export declare function VotePoolListWidget(props: WidgetProps): JSX.Element;
|
|
49
|
+
export declare function Ve33PoolDetailWidget(props: WidgetProps & {
|
|
50
|
+
id: string;
|
|
51
|
+
chainId: ChainId;
|
|
52
|
+
onClickGoBack: () => void;
|
|
53
|
+
}): JSX.Element;
|
|
41
54
|
export declare function InitSwapWidget(props: SwapWidgetProps): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppThunkAction } from '.';
|
|
2
|
-
import {
|
|
2
|
+
import { TokenInfo, TokenList } from '../../hooks/Token';
|
|
3
3
|
import { SlippageWithToken } from '../reducers/token';
|
|
4
4
|
export declare const setTokenList: (tokenList: TokenList) => AppThunkAction;
|
|
5
5
|
export declare const setPopularTokenList: (popularTokenList: TokenList) => AppThunkAction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChainId } from '@dodoex/api';
|
|
2
2
|
import { RootState } from '../reducers';
|
|
3
3
|
export declare const getTokenList: (state?: RootState) => import("../../hooks/Token").TokenList;
|
|
4
|
-
export declare const getAllTokenList: (state?: RootState) => import("
|
|
5
|
-
export declare const getPopularTokenList: (chainId: ChainId, state?: RootState) => import("
|
|
4
|
+
export declare const getAllTokenList: (state?: RootState) => import("../..").TokenInfo[];
|
|
5
|
+
export declare const getPopularTokenList: (chainId: ChainId, state?: RootState) => import("../..").TokenInfo[];
|
|
6
6
|
export declare const getSlippageWithTokens: (state?: RootState) => import("../reducers/token").SlippageWithToken[];
|
|
@@ -23,7 +23,7 @@ export declare function openEtherscanPage(path: string | undefined, chainId: Cha
|
|
|
23
23
|
* @returns
|
|
24
24
|
* @see https://test-explorer.plumenetwork.xyz/address/0x3A7Bc5F9E41356728f037f17D88c642EE46d1Aaa?tab=contract
|
|
25
25
|
*/
|
|
26
|
-
export declare const getUniInitCodeHash: (chainId: number) => "
|
|
26
|
+
export declare const getUniInitCodeHash: (chainId: number) => "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f" | "0x007722521498f3d29a63d1eb6ab35e202874706c77ce73d45c1ad9da88174a3f" | "0x67a372377cf6d7f78cfdcc9df0bc21e1139bd49e5a47c33ee0de5389a4396410" | "0x2ebf1082215ab683deab4ee8ff50d42205db2059829b641717ab3f61f18d481a";
|
|
27
27
|
export declare function sortsBefore(tokenA: TokenInfo, tokenB: TokenInfo): boolean;
|
|
28
28
|
export declare const computePairAddress: ({ factoryAddress, tokenA, tokenB, fee, }: {
|
|
29
29
|
factoryAddress: string;
|
|
@@ -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?: BigNumber, showDecimals?: number): string;
|
|
33
|
+
export declare function formatShortNumber(n?: number | string | BigNumber | null, 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, showDecimals?: number) => string;
|
|
46
|
+
export declare const formatApy: (amount: BigNumber | string | number | null, showDecimals?: number) => string;
|
|
47
47
|
export declare function formatUnknownTokenSymbol(token?: {
|
|
48
48
|
symbol: string;
|
|
49
49
|
name: string;
|
|
@@ -19,7 +19,7 @@ export declare function getTokenPairCompareText({ fromToken, toToken, fromFiatPr
|
|
|
19
19
|
comparePriceText: string;
|
|
20
20
|
loading: boolean;
|
|
21
21
|
};
|
|
22
|
-
export declare function getShowDecimals(decimals: string | number):
|
|
22
|
+
export declare function getShowDecimals(decimals: string | number): 6 | 4;
|
|
23
23
|
export declare function convertFetchTokenToTokenInfo(token: {
|
|
24
24
|
id?: string | null;
|
|
25
25
|
address?: string | null;
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import { SupportedChainsType } from './chains';
|
|
2
1
|
type AddressMap = {
|
|
3
2
|
[chainId: number]: string;
|
|
4
3
|
};
|
|
5
|
-
type ChainAddresses = {
|
|
6
|
-
/**
|
|
7
|
-
* UniswapV3Factory
|
|
8
|
-
* @see https://taikoscan.io/address/0x78172691DD3B8ADa7aEbd9bFfB487FB11D735DB2?tab=contract#code
|
|
9
|
-
*/
|
|
10
|
-
v3CoreFactoryAddress: string;
|
|
11
|
-
/**
|
|
12
|
-
* NonfungiblePositionManager
|
|
13
|
-
* @see https://taikoscan.io/address/0x2623281DdcC34A73a9e8898f2c57A32A860903f1?tab=contract#code
|
|
14
|
-
*/
|
|
15
|
-
nonfungiblePositionManagerAddress?: string;
|
|
16
|
-
};
|
|
17
|
-
export declare const CHAIN_TO_ADDRESSES_MAP: Record<SupportedChainsType, ChainAddresses>;
|
|
18
4
|
export declare const V3_CORE_FACTORY_ADDRESSES: AddressMap;
|
|
19
5
|
export declare const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: AddressMap;
|
|
20
6
|
export {};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { ChainId } from '@dodoex/api';
|
|
2
2
|
export { ChainId } from '@dodoex/api';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated
|
|
5
|
+
*/
|
|
3
6
|
export declare const SUPPORTED_CHAINS: readonly [ChainId.MAINNET, ChainId.ARBITRUM_ONE, ChainId.SEPOLIA, ChainId.TAIKO];
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated
|
|
9
|
+
*/
|
|
4
10
|
export type SupportedChainsType = (typeof SUPPORTED_CHAINS)[number];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { usePoolBalanceInfo } from '../hooks/usePoolBalanceInfo';
|
|
2
1
|
import { OperatePool } from './types';
|
|
2
|
+
import { usePoolBalanceInfo } from '../hooks/usePoolBalanceInfo';
|
|
3
3
|
export declare function AddPoolOperate({ submittedBack: submittedBackProps, onlyShowSide, pool, balanceInfo, }: {
|
|
4
4
|
submittedBack?: () => void;
|
|
5
5
|
onlyShowSide?: 'base' | 'quote';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { usePoolBalanceInfo } from '../hooks/usePoolBalanceInfo';
|
|
2
1
|
import { OperatePool } from './types';
|
|
2
|
+
import { usePoolBalanceInfo } from '../hooks/usePoolBalanceInfo';
|
|
3
3
|
export declare function RemovePoolOperate({ submittedBack: submittedBackProps, onlyShowSide, pool, balanceInfo, }: {
|
|
4
4
|
submittedBack?: () => void;
|
|
5
5
|
onlyShowSide?: 'base' | 'quote';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BoxProps } from '@dodoex/components';
|
|
2
1
|
import { usePoolBalanceInfo } from '../../hooks/usePoolBalanceInfo';
|
|
3
2
|
import { OperatePool } from '../types';
|
|
4
3
|
export interface LiquidityInfoProps {
|
|
@@ -6,6 +5,5 @@ export interface LiquidityInfoProps {
|
|
|
6
5
|
hidePoolInfo?: boolean;
|
|
7
6
|
pool: OperatePool;
|
|
8
7
|
balanceInfo: ReturnType<typeof usePoolBalanceInfo>;
|
|
9
|
-
sx?: BoxProps['sx'];
|
|
10
8
|
}
|
|
11
|
-
export default function LiquidityInfo({ loading: loadingProps, hidePoolInfo, pool, balanceInfo,
|
|
9
|
+
export default function LiquidityInfo({ loading: loadingProps, hidePoolInfo, pool, balanceInfo, }: LiquidityInfoProps): JSX.Element;
|
|
@@ -66,7 +66,7 @@ export declare function useDiffer({ srcPool, newPool, }: {
|
|
|
66
66
|
isRemove: boolean;
|
|
67
67
|
};
|
|
68
68
|
} | null;
|
|
69
|
-
export declare const getModifyDPPPoolParams: ({ chainId, account, srcPool, baseToken, quoteToken, baseAmount, quoteAmount, feeRate, initPrice, slippageCoefficient, SLIPPAGE_PROTECTION, }: {
|
|
69
|
+
export declare const getModifyDPPPoolParams: ({ chainId, account, srcPool, baseToken, quoteToken, baseAmount, quoteAmount, feeRate, initPrice, slippageCoefficient, ddl, SLIPPAGE_PROTECTION, }: {
|
|
70
70
|
chainId?: number;
|
|
71
71
|
account?: string;
|
|
72
72
|
srcPool?: ModifyPool;
|
|
@@ -77,6 +77,7 @@ export declare const getModifyDPPPoolParams: ({ chainId, account, srcPool, baseT
|
|
|
77
77
|
feeRate: string;
|
|
78
78
|
initPrice: string;
|
|
79
79
|
slippageCoefficient: string;
|
|
80
|
+
ddl: number | undefined;
|
|
80
81
|
SLIPPAGE_PROTECTION: number;
|
|
81
82
|
}) => Promise<{
|
|
82
83
|
data: string;
|
|
@@ -7,6 +7,8 @@ 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
|
+
export type FetchVotePoolList = ExcludeNone<ReturnType<Exclude<(typeof PoolApi.graphql.fetchVotePoolList)['__apiType'], undefined>>['ve33_getVotePoolList']>;
|
|
10
12
|
export declare function convertLiquidityTokenToTokenInfo(token: {
|
|
11
13
|
id: string;
|
|
12
14
|
symbol: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
import { Ve33PoolInfoI, Ve33PoolOperateProps } from '../types';
|
|
3
|
+
export interface TableListProps {
|
|
4
|
+
chainId: ChainId;
|
|
5
|
+
poolList: Ve33PoolInfoI[];
|
|
6
|
+
usdValueChecked: boolean;
|
|
7
|
+
operatePool: Ve33PoolOperateProps | null;
|
|
8
|
+
setOperatePool: (operate: Ve33PoolOperateProps | null) => void;
|
|
9
|
+
hasMore?: boolean;
|
|
10
|
+
loadMore?: () => void;
|
|
11
|
+
loadMoreLoading?: boolean;
|
|
12
|
+
onClickPoolListRow: (id: string, chainId: ChainId) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const TableList: ({ chainId, poolList, usdValueChecked, operatePool, setOperatePool, hasMore, loadMore, loadMoreLoading, onClickPoolListRow, }: TableListProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
3
|
+
export default function ComparePrice({ lqAndDodoCompareText, baseToken, quoteToken, midPrice, }: {
|
|
4
|
+
lqAndDodoCompareText: string;
|
|
5
|
+
baseToken?: TokenInfo;
|
|
6
|
+
quoteToken?: TokenInfo;
|
|
7
|
+
midPrice?: BigNumber;
|
|
8
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { useTokenStatus } from '../../../../hooks/Token/useTokenStatus';
|
|
2
|
+
export default function OperateBtn({ chainId, baseTokenStatus, quoteTokenStatus, children, }: React.PropsWithChildren<{
|
|
3
|
+
chainId: number;
|
|
4
|
+
baseTokenStatus?: ReturnType<typeof useTokenStatus>;
|
|
5
|
+
quoteTokenStatus?: ReturnType<typeof useTokenStatus>;
|
|
6
|
+
}>): JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BoxProps } from '@dodoex/components';
|
|
2
|
+
import { AUTO_SWAP_SLIPPAGE_PROTECTION } from '../../../../constants/pool';
|
|
3
|
+
import { PoolTypeE } from '../../types';
|
|
4
|
+
export declare const useSlipper: ({ type }: {
|
|
5
|
+
type?: PoolTypeE;
|
|
6
|
+
}) => {
|
|
7
|
+
slipper: number | "auto";
|
|
8
|
+
setSlipper: import("react").Dispatch<import("react").SetStateAction<number | "auto">>;
|
|
9
|
+
slipperValue: number;
|
|
10
|
+
resetSlipper: () => void;
|
|
11
|
+
};
|
|
12
|
+
export default function SlippageSetting({ type, disabled, value, onChange, sx, }: {
|
|
13
|
+
type?: PoolTypeE;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
value: number | typeof AUTO_SWAP_SLIPPAGE_PROTECTION;
|
|
16
|
+
onChange: (val: number | typeof AUTO_SWAP_SLIPPAGE_PROTECTION) => void;
|
|
17
|
+
sx?: BoxProps['sx'];
|
|
18
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
3
|
+
import { useVe33AddLiquidity } from '../hooks/useVe33V2AddLiquidity';
|
|
4
|
+
export default function V2ConfirmDialog({ open, onClose, slippage, baseToken, quoteToken, baseAmount, quoteAmount, lpAmount, fee, price, shareOfPool, pairAddress, stable, createMutation, }: {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
slippage: number;
|
|
8
|
+
baseToken?: TokenInfo;
|
|
9
|
+
quoteToken?: TokenInfo;
|
|
10
|
+
baseAmount: string;
|
|
11
|
+
quoteAmount: string;
|
|
12
|
+
lpAmount: BigNumber | undefined;
|
|
13
|
+
fee: number | undefined;
|
|
14
|
+
price?: BigNumber | null;
|
|
15
|
+
shareOfPool?: string;
|
|
16
|
+
pairAddress?: string;
|
|
17
|
+
stable?: boolean;
|
|
18
|
+
createMutation: ReturnType<typeof useVe33AddLiquidity>;
|
|
19
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
3
|
+
export declare function useDODOPrice({ baseToken, quoteToken, }: {
|
|
4
|
+
baseToken?: TokenInfo;
|
|
5
|
+
quoteToken?: TokenInfo;
|
|
6
|
+
}): {
|
|
7
|
+
comparePrice: BigNumber | null;
|
|
8
|
+
comparePriceText: string;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const lqAndDodoCompareSmallNum = 0.01;
|
|
12
|
+
export declare const lqAndDodoCompareWarningNum = 0.03;
|
|
13
|
+
export declare const useComparePrice: (baseToken?: TokenInfo, quoteToken?: TokenInfo, midPrice?: BigNumber) => {
|
|
14
|
+
lqAndDodoCompare: number;
|
|
15
|
+
lqAndDodoCompareText: string;
|
|
16
|
+
midPrice: BigNumber | undefined;
|
|
17
|
+
isShowCompare: boolean;
|
|
18
|
+
isWarnCompare: boolean;
|
|
19
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { Ve33PoolInfoI } from '../../types';
|
|
3
|
+
export declare function useLiquidityOperateAmount({ pool, maxBaseAmount, maxQuoteAmount, isRemove, }: {
|
|
4
|
+
pool?: Ve33PoolInfoI;
|
|
5
|
+
maxBaseAmount?: BigNumber | null;
|
|
6
|
+
maxQuoteAmount?: BigNumber | null;
|
|
7
|
+
isRemove?: boolean;
|
|
8
|
+
}): {
|
|
9
|
+
baseAmount: string;
|
|
10
|
+
quoteAmount: string;
|
|
11
|
+
handleChangeBaseAmount: () => void;
|
|
12
|
+
handleChangeQuoteAmount: () => void;
|
|
13
|
+
reset: () => void;
|
|
14
|
+
balanceInfo: {
|
|
15
|
+
userLpQuery: import("@tanstack/react-query").UseQueryResult<bigint, Error>;
|
|
16
|
+
totalLpQuery: import("@tanstack/react-query").UseQueryResult<bigint, Error>;
|
|
17
|
+
reserveQuery: import("@tanstack/react-query").UseQueryResult<{
|
|
18
|
+
_reserve0: bigint;
|
|
19
|
+
_reserve1: bigint;
|
|
20
|
+
_blockTimestampLast: bigint;
|
|
21
|
+
}, Error>;
|
|
22
|
+
userLp: BigNumber | undefined;
|
|
23
|
+
totalLp: BigNumber | undefined;
|
|
24
|
+
token0Reserve: BigNumber | undefined;
|
|
25
|
+
token1Reserve: BigNumber | undefined;
|
|
26
|
+
userLpToToken0: BigNumber | undefined;
|
|
27
|
+
userLpToToken1: BigNumber | undefined;
|
|
28
|
+
isRearTokenA: boolean;
|
|
29
|
+
price: import("@uniswap/sdk-core").Price<import("@uniswap/sdk-core").Token, import("@uniswap/sdk-core").Token> | undefined;
|
|
30
|
+
liquidityMinted: BigNumber | undefined;
|
|
31
|
+
poolTokenPercentage: BigNumber | undefined;
|
|
32
|
+
shareOfPool: string;
|
|
33
|
+
userLpToTokenBalanceLoading: boolean;
|
|
34
|
+
userLpToTokenBalanceErrorRefetch: (() => void) | undefined;
|
|
35
|
+
refetch: () => void;
|
|
36
|
+
};
|
|
37
|
+
addPortion?: undefined;
|
|
38
|
+
amountLoading?: undefined;
|
|
39
|
+
amountError?: undefined;
|
|
40
|
+
amountRefetch?: undefined;
|
|
41
|
+
amountCheckedDisabled?: undefined;
|
|
42
|
+
midPrice?: undefined;
|
|
43
|
+
} | {
|
|
44
|
+
baseAmount: string;
|
|
45
|
+
quoteAmount: string;
|
|
46
|
+
handleChangeBaseAmount: (newValue: string) => void;
|
|
47
|
+
handleChangeQuoteAmount: (newValue: string) => void;
|
|
48
|
+
reset: () => void;
|
|
49
|
+
addPortion: BigNumber;
|
|
50
|
+
amountLoading: boolean;
|
|
51
|
+
amountError: boolean;
|
|
52
|
+
amountRefetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
53
|
+
_reserve0: bigint;
|
|
54
|
+
_reserve1: bigint;
|
|
55
|
+
_blockTimestampLast: bigint;
|
|
56
|
+
}, Error>>;
|
|
57
|
+
amountCheckedDisabled: boolean;
|
|
58
|
+
balanceInfo: {
|
|
59
|
+
userLpQuery: import("@tanstack/react-query").UseQueryResult<bigint, Error>;
|
|
60
|
+
totalLpQuery: import("@tanstack/react-query").UseQueryResult<bigint, Error>;
|
|
61
|
+
reserveQuery: import("@tanstack/react-query").UseQueryResult<{
|
|
62
|
+
_reserve0: bigint;
|
|
63
|
+
_reserve1: bigint;
|
|
64
|
+
_blockTimestampLast: bigint;
|
|
65
|
+
}, Error>;
|
|
66
|
+
userLp: BigNumber | undefined;
|
|
67
|
+
totalLp: BigNumber | undefined;
|
|
68
|
+
token0Reserve: BigNumber | undefined;
|
|
69
|
+
token1Reserve: BigNumber | undefined;
|
|
70
|
+
userLpToToken0: BigNumber | undefined;
|
|
71
|
+
userLpToToken1: BigNumber | undefined;
|
|
72
|
+
isRearTokenA: boolean;
|
|
73
|
+
price: import("@uniswap/sdk-core").Price<import("@uniswap/sdk-core").Token, import("@uniswap/sdk-core").Token> | undefined;
|
|
74
|
+
liquidityMinted: BigNumber | undefined;
|
|
75
|
+
poolTokenPercentage: BigNumber | undefined;
|
|
76
|
+
shareOfPool: string;
|
|
77
|
+
userLpToTokenBalanceLoading: boolean;
|
|
78
|
+
userLpToTokenBalanceErrorRefetch: (() => void) | undefined;
|
|
79
|
+
refetch: () => void;
|
|
80
|
+
};
|
|
81
|
+
midPrice: BigNumber | undefined;
|
|
82
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { Ve33PoolInfoI } from '../../types';
|
|
3
|
+
export declare const initSliderPercentage = 50;
|
|
4
|
+
export declare enum RemoveMode {
|
|
5
|
+
quantity = 1,
|
|
6
|
+
percentage = 2
|
|
7
|
+
}
|
|
8
|
+
export declare function usePercentageRemove({ pool, baseOverride, quoteOverride, resetAmount, handleChangeBaseAmount, handleChangeQuoteAmount, }: {
|
|
9
|
+
pool: Ve33PoolInfoI | undefined;
|
|
10
|
+
baseOverride: BigNumber | undefined | null;
|
|
11
|
+
quoteOverride: BigNumber | undefined | null;
|
|
12
|
+
resetAmount: () => void;
|
|
13
|
+
handleChangeBaseAmount: (val: string) => void;
|
|
14
|
+
handleChangeQuoteAmount: (val: string) => void;
|
|
15
|
+
}): {
|
|
16
|
+
mode: RemoveMode;
|
|
17
|
+
modeOptions: {
|
|
18
|
+
key: RemoveMode;
|
|
19
|
+
value: string;
|
|
20
|
+
}[];
|
|
21
|
+
handleChangeMode: (mode: RemoveMode) => void;
|
|
22
|
+
sliderPercentage: number;
|
|
23
|
+
handleChangeSliderPercentage: (val: number) => void;
|
|
24
|
+
resetPercentage: () => void;
|
|
25
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum OperateTab {
|
|
2
|
+
Add = 1,
|
|
3
|
+
Remove = 2
|
|
4
|
+
}
|
|
5
|
+
export declare function usePoolOperateTabs(defaultValue?: OperateTab): {
|
|
6
|
+
operateTab: OperateTab;
|
|
7
|
+
operateTabs: {
|
|
8
|
+
key: OperateTab;
|
|
9
|
+
value: string;
|
|
10
|
+
}[];
|
|
11
|
+
handleChangeTab: (poolTab: OperateTab) => void;
|
|
12
|
+
};
|