@dodoex/widgets 3.0.2-bartio.2 → 3.0.2-bartio.21
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/LICENSE +674 -674
- package/README.md +69 -69
- package/dist/{8de9a184d4ef0a11.svg → 219f8611c6c9e6e2.svg} +6 -6
- package/dist/{28442382d977858a.svg → 34acf2e58b457195.svg} +9 -9
- package/dist/{b3f16b2626f03378.svg → 44df077bd19df476.svg} +10 -10
- package/dist/{ed726d76d93d4899.svg → 5c5d298f247819e1.svg} +10 -10
- package/dist/{e4364db573253fd1.svg → 7feb1ff0e03a571d.svg} +9 -9
- package/dist/cjs/locales/en-US.js +1 -1
- package/dist/cjs/locales/zh-CN.js +1 -1
- package/dist/{helper-BhZWILyg.js → helper-Bwk-pafn.js} +1 -1
- package/dist/{helper-D6LlnQ1M.cjs → helper-BxZqNcaq.cjs} +1 -1
- package/dist/index-B4_cnc94.cjs +67 -0
- package/dist/{index-DDsCP5_a.cjs → index-BDehUNkw.cjs} +2 -2
- package/dist/index-Bk4cKKCz.js +78 -0
- package/dist/index-DQp2ouTr.js +67 -0
- package/dist/{index-CAmXGIvF.js → index-DRV1A2No.js} +1 -1
- package/dist/{index-7x0JpwJJ.cjs → index-cEhELacT.cjs} +6 -6
- 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/Swap/components/ConnectWallet/index.d.ts +2 -1
- package/dist/types/components/Swap/components/SwitchBox.d.ts +2 -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/TokenSelect.d.ts +2 -1
- package/dist/types/components/Widget/index.d.ts +27 -1
- package/dist/types/components/WidgetContainer.d.ts +1 -1
- package/dist/types/components/WithExecutionDialog/index.d.ts +1 -1
- package/dist/types/constants/chains.d.ts +0 -3
- package/dist/types/hooks/Submission/types.d.ts +3 -0
- package/dist/types/hooks/Submission/useExecution.d.ts +2 -0
- package/dist/types/hooks/contract/useFetchBlockNumber.d.ts +1 -1
- package/dist/types/hooks/useGlobalState.d.ts +32 -0
- package/dist/types/hooks/useTokenState.d.ts +18 -0
- package/dist/types/index.d.ts +4 -1
- package/dist/types/utils/address.d.ts +1 -1
- package/dist/types/utils/token.d.ts +1 -1
- 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/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/Algebra/AddLiquidity.d.ts +7 -1
- package/dist/types/widgets/PoolWidget/Algebra/components/ClaimButton.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/Algebra/components/InputStepCounter.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/Algebra/components/LiquidityChartRangeInput/index.d.ts +11 -9
- package/dist/types/widgets/PoolWidget/Algebra/components/RangeSelector.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/Algebra/components/RateToggle.d.ts +3 -3
- package/dist/types/widgets/PoolWidget/Algebra/components/RemoveButton.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/Algebra/hooks/usePoolActiveLiquidityChartData.d.ts +37 -0
- package/dist/types/widgets/PoolWidget/Algebra/utils/computeSurroundingTicks.d.ts +2 -2
- package/dist/types/widgets/PoolWidget/Algebra/utils/getPositionAmountWithSlippage.d.ts +3 -2
- package/dist/types/widgets/PoolWidget/Algebra/utils/getTickToPrice.d.ts +1 -9
- package/dist/types/widgets/PoolWidget/Algebra/utils/tryParseTick.d.ts +2 -5
- package/dist/types/widgets/PoolWidget/PoolList/AddLiquidity.d.ts +7 -1
- package/dist/types/widgets/PoolWidget/PoolList/MyLiquidity.d.ts +7 -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 +11 -1
- package/dist/types/widgets/PoolWidget/hooks/contract/getModifyDPPPoolParams.d.ts +2 -1
- package/dist/types/widgets/PoolWidget/hooks/usePoolDetail.d.ts +35 -0
- package/package.json +156 -157
- package/dist/index-BduZdyfz.cjs +0 -31
- package/dist/index-Dl7FV9-C.js +0 -31
- package/dist/index-h5hit_bx.js +0 -78
- 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/PoolWidget/Algebra/components/LiquidityChartRangeInput/hooks.d.ts +0 -12
- package/dist/types/widgets/PoolWidget/Algebra/hooks/usePoolTickData.d.ts +0 -20
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChainId, ContractRequests, GraphQLRequests } from '@dodoex/api';
|
|
2
|
-
import { PaletteMode, ThemeOptions } from '@dodoex/components';
|
|
2
|
+
import { EmptyDataIcon, PaletteMode, ThemeOptions } from '@dodoex/components';
|
|
3
3
|
import { PropsWithChildren } from 'react';
|
|
4
4
|
import { APIServices } from '../../constants/api';
|
|
5
5
|
import { SupportedLang } from '../../constants/locales';
|
|
@@ -10,6 +10,8 @@ import { InitTokenListProps } from '../../hooks/Token/useInitTokenList';
|
|
|
10
10
|
import { ConfirmProps } from '../Confirm';
|
|
11
11
|
import { DialogProps } from '../Swap/components/Dialog';
|
|
12
12
|
import { Page } from '../../router';
|
|
13
|
+
import { ExecutionCtx } from '../../hooks/Submission/types';
|
|
14
|
+
import { TokenPickerDialogProps } from '../Swap/components/TokenCard/TokenPickerDialog';
|
|
13
15
|
export declare const WIDGET_CLASS_NAME = "dodo-widget-container";
|
|
14
16
|
export interface WidgetProps extends Web3ConnectorsProps, InitTokenListProps, ExecutionProps {
|
|
15
17
|
apikey?: string;
|
|
@@ -64,9 +66,33 @@ export interface WidgetProps extends Web3ConnectorsProps, InitTokenListProps, Ex
|
|
|
64
66
|
url?: string;
|
|
65
67
|
chainId?: number;
|
|
66
68
|
}) => string;
|
|
69
|
+
onSharePool?: (share: {
|
|
70
|
+
chainId: number;
|
|
71
|
+
baseToken?: {
|
|
72
|
+
address: string;
|
|
73
|
+
symbol: string;
|
|
74
|
+
};
|
|
75
|
+
quoteToken?: {
|
|
76
|
+
address: string;
|
|
77
|
+
symbol: string;
|
|
78
|
+
};
|
|
79
|
+
poolId: string;
|
|
80
|
+
apy?: {
|
|
81
|
+
miningBaseApy?: any;
|
|
82
|
+
miningQuoteApy?: any;
|
|
83
|
+
transactionBaseApy?: any;
|
|
84
|
+
transactionQuoteApy?: any;
|
|
85
|
+
} | null;
|
|
86
|
+
isSingle?: boolean;
|
|
87
|
+
}) => void;
|
|
67
88
|
graphQLRequests?: GraphQLRequests;
|
|
68
89
|
ConfirmComponent?: React.FunctionComponent<ConfirmProps>;
|
|
69
90
|
DialogComponent?: React.FunctionComponent<DialogProps>;
|
|
91
|
+
EmptyDataIcon?: React.FunctionComponent<Parameters<typeof EmptyDataIcon>[0]>;
|
|
92
|
+
TokenPickerDialog?: React.FunctionComponent<TokenPickerDialogProps>;
|
|
93
|
+
/** Default deadLine when it cannot be set. Unit: seconds */
|
|
94
|
+
deadLine?: number;
|
|
95
|
+
submission?: ExecutionCtx;
|
|
70
96
|
}
|
|
71
97
|
export { LangProvider } from '../../providers/i18n';
|
|
72
98
|
export { default as Message } from '../Message';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BoxProps } from '@dodoex/components';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const WIDGET_MODULE_CLASS_NAME = "widget-module-container";
|
|
4
|
-
declare const WidgetContainer: React.ForwardRefExoticComponent<Pick<BoxProps, "key" | "nonce" | "id" | "
|
|
4
|
+
declare const WidgetContainer: React.ForwardRefExoticComponent<Pick<BoxProps, "key" | "nonce" | "id" | "onChange" | "children" | "p" | "slot" | "style" | "title" | "height" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "translate" | "component" | "sx" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default WidgetContainer;
|
|
@@ -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;
|
|
@@ -6,9 +6,6 @@ export declare const rpcServerMap: {
|
|
|
6
6
|
export declare const getRpcSingleUrlMap: (newRpcServerMap?: {
|
|
7
7
|
[chainId: number]: string[];
|
|
8
8
|
}) => { [key in ChainId]: string; };
|
|
9
|
-
export declare const platformIdMap: {
|
|
10
|
-
[key in ChainId]: string;
|
|
11
|
-
};
|
|
12
9
|
export declare const scanUrlDomainMap: {
|
|
13
10
|
[key in ChainId]: string;
|
|
14
11
|
};
|
|
@@ -55,10 +55,12 @@ export declare enum ExecutionResult {
|
|
|
55
55
|
Success = "success",
|
|
56
56
|
Submitted = "submitted"
|
|
57
57
|
}
|
|
58
|
+
type SubmitState = 'loading' | 'submitted';
|
|
58
59
|
export interface Showing {
|
|
59
60
|
brief: string;
|
|
60
61
|
subtitle?: string | React.ReactNode;
|
|
61
62
|
spec: StepSpec;
|
|
63
|
+
submitState?: SubmitState;
|
|
62
64
|
}
|
|
63
65
|
export type ExecutionCtx = {
|
|
64
66
|
/**
|
|
@@ -94,3 +96,4 @@ export declare enum WatchResult {
|
|
|
94
96
|
Failed = 0,
|
|
95
97
|
Success = 1
|
|
96
98
|
}
|
|
99
|
+
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
|
};
|
|
@@ -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
|
@@ -32,11 +32,14 @@ export { AlgebraPositionManage } from './widgets/PoolWidget/Algebra/AlgebraPosit
|
|
|
32
32
|
export { default as AddLiquidityV3 } from './widgets/PoolWidget/AMMV3/AddLiquidityV3';
|
|
33
33
|
export { AMMV3PositionsView } from './widgets/PoolWidget/AMMV3/AMMV3PositionsView';
|
|
34
34
|
export { AMMV3PositionManage } from './widgets/PoolWidget/AMMV3/AMMV3PositionManage';
|
|
35
|
+
export { useTokenStatus } from './hooks/Token/useTokenStatus';
|
|
36
|
+
export { default as TokenStatusButton } from './components/TokenStatusButton';
|
|
37
|
+
export { default as TokenPairStatusButton } from './components/TokenPairStatusButton';
|
|
35
38
|
export { TokenCard } from './components/Swap/components/TokenCard';
|
|
36
39
|
export { default as TokenLogo } from './components/TokenLogo';
|
|
37
40
|
export { FailedList } from './components/List/FailedList';
|
|
38
41
|
export { EmptyList } from './components/List/EmptyList';
|
|
39
|
-
export { getEtherscanPage } from './utils/address';
|
|
42
|
+
export { getEtherscanPage, ALGEBRA_POOL_DEPLOYER_ADDRESSES, ALGEBRA_POOL_INIT_CODE_HASH, } from './utils/address';
|
|
40
43
|
export { formatReadableNumber, formatTokenAmountNumber, formatShortNumber, formatPercentageNumber, } from './utils/formatter';
|
|
41
44
|
export declare function SwapWidget(props: SwapWidgetProps): JSX.Element;
|
|
42
45
|
export declare function PoolWidget(props: SwapWidgetProps): JSX.Element;
|
|
@@ -29,7 +29,7 @@ export declare function openEtherscanPage(path: string | undefined, chainId: Cha
|
|
|
29
29
|
* @returns
|
|
30
30
|
* @see https://test-explorer.plumenetwork.xyz/address/0x3A7Bc5F9E41356728f037f17D88c642EE46d1Aaa?tab=contract
|
|
31
31
|
*/
|
|
32
|
-
export declare const getUniInitCodeHash: (chainId: number) => "
|
|
32
|
+
export declare const getUniInitCodeHash: (chainId: number) => "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f" | "0x007722521498f3d29a63d1eb6ab35e202874706c77ce73d45c1ad9da88174a3f" | "0x67a372377cf6d7f78cfdcc9df0bc21e1139bd49e5a47c33ee0de5389a4396410" | "0x2ebf1082215ab683deab4ee8ff50d42205db2059829b641717ab3f61f18d481a";
|
|
33
33
|
export declare function sortsBefore(tokenA: TokenInfo, tokenB: TokenInfo): boolean;
|
|
34
34
|
export declare function sortsBeforeTokenAddress(tokenA: string, tokenB: string): boolean;
|
|
35
35
|
export declare const computePairAddress: ({ factoryAddress, tokenA, tokenB, fee, }: {
|
|
@@ -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;
|
|
@@ -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
|
|
@@ -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,8 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { TokenInfo } from '../../../hooks/Token';
|
|
2
|
+
import { FetchTicks } from './hooks/usePoolActiveLiquidityChartData';
|
|
3
|
+
export default function AddLiquidity({ params, border, fetchTicks, onBaseTokenChange, onQuoteTokenChange, }: {
|
|
2
4
|
params?: {
|
|
3
5
|
from?: string;
|
|
4
6
|
to?: string;
|
|
5
7
|
fee?: string;
|
|
6
8
|
};
|
|
7
9
|
border?: boolean;
|
|
10
|
+
fetchTicks?: FetchTicks;
|
|
11
|
+
ticksErrorRefetch?: () => void;
|
|
12
|
+
onBaseTokenChange?: (token: TokenInfo | undefined) => void;
|
|
13
|
+
onQuoteTokenChange?: (token: TokenInfo | undefined) => void;
|
|
8
14
|
}): JSX.Element;
|
|
@@ -3,6 +3,7 @@ export interface ClaimButtonProps {
|
|
|
3
3
|
chainId: ChainId;
|
|
4
4
|
disabled: boolean;
|
|
5
5
|
isLoading: boolean;
|
|
6
|
+
border?: boolean;
|
|
6
7
|
onConfirm: () => void;
|
|
7
8
|
}
|
|
8
|
-
export declare const ClaimButton: ({ chainId, disabled, isLoading, onConfirm, }: ClaimButtonProps) => JSX.Element;
|
|
9
|
+
export declare const ClaimButton: ({ chainId, disabled, isLoading, border, onConfirm, }: ClaimButtonProps) => JSX.Element;
|
|
@@ -11,6 +11,7 @@ interface StepCounterProps {
|
|
|
11
11
|
title: ReactNode;
|
|
12
12
|
tokenA?: string;
|
|
13
13
|
tokenB?: string;
|
|
14
|
+
border?: boolean;
|
|
14
15
|
}
|
|
15
|
-
declare const StepCounter: ({ value, decrement, increment, decrementDisabled, incrementDisabled, locked, onUserInput, title, tokenA, tokenB, }: StepCounterProps) => JSX.Element;
|
|
16
|
+
declare const StepCounter: ({ value, decrement, increment, decrementDisabled, incrementDisabled, locked, onUserInput, title, tokenA, tokenB, border, }: StepCounterProps) => JSX.Element;
|
|
16
17
|
export default StepCounter;
|
package/dist/types/widgets/PoolWidget/Algebra/components/LiquidityChartRangeInput/index.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { Currency, Price } from '../../sdks/sdk-core';
|
|
2
|
-
import { FeeAmount } from '../../sdks/v3-sdk';
|
|
3
1
|
import { Bound } from '../../types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { TokenInfo } from '../../../../../hooks/Token';
|
|
3
|
+
import { Price } from '../../../../../utils/fractions';
|
|
4
|
+
import { usePoolActiveLiquidityChartData } from '../../hooks/usePoolActiveLiquidityChartData';
|
|
5
|
+
export default function LiquidityChartRangeInput({ currencyA, currencyB, isSorted, ticksAtLimit, price, priceLower, priceUpper, onLeftRangeInput, onRightRangeInput, interactive, chartData, }: {
|
|
6
|
+
currencyA?: TokenInfo;
|
|
7
|
+
currencyB?: TokenInfo;
|
|
8
|
+
isSorted: boolean;
|
|
8
9
|
ticksAtLimit: {
|
|
9
10
|
[bound in Bound]?: boolean | undefined;
|
|
10
11
|
};
|
|
11
12
|
price?: number;
|
|
12
|
-
priceLower?: Price
|
|
13
|
-
priceUpper?: Price
|
|
13
|
+
priceLower?: Price;
|
|
14
|
+
priceUpper?: Price;
|
|
14
15
|
onLeftRangeInput: (typedValue: string) => void;
|
|
15
16
|
onRightRangeInput: (typedValue: string) => void;
|
|
16
17
|
interactive: boolean;
|
|
17
|
-
|
|
18
|
+
chartData: ReturnType<typeof usePoolActiveLiquidityChartData>;
|
|
19
|
+
}): JSX.Element | null;
|
|
@@ -16,5 +16,6 @@ export interface RangeSelectorProps {
|
|
|
16
16
|
[bound in Bound]?: boolean | undefined;
|
|
17
17
|
};
|
|
18
18
|
isSorted: boolean;
|
|
19
|
+
border?: boolean;
|
|
19
20
|
}
|
|
20
|
-
export declare const RangeSelector: ({ priceLower, priceUpper, onLeftRangeInput, onRightRangeInput, getDecrementLower, getIncrementLower, getDecrementUpper, getIncrementUpper, tokenA, tokenB, ticksAtLimit, isSorted, }: RangeSelectorProps) => JSX.Element;
|
|
21
|
+
export declare const RangeSelector: ({ priceLower, priceUpper, onLeftRangeInput, onRightRangeInput, getDecrementLower, getIncrementLower, getDecrementUpper, getIncrementUpper, tokenA, tokenB, ticksAtLimit, isSorted, border, }: RangeSelectorProps) => JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BoxProps } from '@dodoex/components';
|
|
2
2
|
import { TokenInfo } from '../../../../hooks/Token';
|
|
3
3
|
export interface RateToggleProps {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
baseToken: TokenInfo | undefined;
|
|
5
|
+
quoteToken: TokenInfo | undefined;
|
|
6
6
|
handleRateToggle: () => void;
|
|
7
7
|
sx?: BoxProps['sx'];
|
|
8
8
|
}
|
|
9
|
-
export declare const RateToggle: ({
|
|
9
|
+
export declare const RateToggle: ({ baseToken, quoteToken, handleRateToggle, sx, }: RateToggleProps) => JSX.Element;
|
|
@@ -6,5 +6,6 @@ export interface ButtonsProps {
|
|
|
6
6
|
isLoading: boolean;
|
|
7
7
|
error?: React.ReactNode;
|
|
8
8
|
onConfirm: () => void;
|
|
9
|
+
border?: boolean;
|
|
9
10
|
}
|
|
10
|
-
export declare const RemoveButton: ({ chainId, disabled, removed, isLoading, error, onConfirm, }: ButtonsProps) => JSX.Element;
|
|
11
|
+
export declare const RemoveButton: ({ chainId, disabled, removed, isLoading, error, onConfirm, border, }: ButtonsProps) => JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import JSBI from 'jsbi';
|
|
2
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
3
|
+
import { Price } from '../../../../utils/fractions';
|
|
4
|
+
import { ChartEntry } from '../components/LiquidityChartRangeInput/types';
|
|
5
|
+
export interface TickProcessed {
|
|
6
|
+
tick: number;
|
|
7
|
+
liquidityActive: JSBI;
|
|
8
|
+
liquidityNet: JSBI;
|
|
9
|
+
price0: string;
|
|
10
|
+
sdkPrice: Price;
|
|
11
|
+
}
|
|
12
|
+
export interface FetchTicks {
|
|
13
|
+
ticks: Array<{
|
|
14
|
+
id: string;
|
|
15
|
+
liquidityNet: string;
|
|
16
|
+
poolAddress?: string;
|
|
17
|
+
price0: string;
|
|
18
|
+
price1: string;
|
|
19
|
+
tickIdx: string;
|
|
20
|
+
}> | undefined | null;
|
|
21
|
+
isLoading: boolean;
|
|
22
|
+
isError: boolean;
|
|
23
|
+
refetch: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function usePoolActiveLiquidityChartData({ tickCurrent, liquidity, fetchTicks, token0, token1, }: {
|
|
26
|
+
tickCurrent: number | undefined;
|
|
27
|
+
liquidity: number | undefined;
|
|
28
|
+
fetchTicks?: FetchTicks;
|
|
29
|
+
token0: TokenInfo | undefined;
|
|
30
|
+
token1: TokenInfo | undefined;
|
|
31
|
+
}): {
|
|
32
|
+
hidden: boolean;
|
|
33
|
+
isLoading: boolean;
|
|
34
|
+
error: boolean;
|
|
35
|
+
data: TickProcessed[] | undefined;
|
|
36
|
+
formattedData: ChartEntry[] | undefined;
|
|
37
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Ticks } from '@dodoex/api';
|
|
2
2
|
import { TickProcessed } from '../hooks/usePoolTickData';
|
|
3
|
-
import {
|
|
4
|
-
export default function computeSurroundingTicks(token0:
|
|
3
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
4
|
+
export default function computeSurroundingTicks(token0: TokenInfo, token1: TokenInfo, activeTickProcessed: TickProcessed, sortedTickData: Ticks, pivot: number, ascending: boolean): TickProcessed[];
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import JSBI from 'jsbi';
|
|
2
2
|
import { Percent } from '../../../../utils/fractions';
|
|
3
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
3
4
|
/**
|
|
4
5
|
* Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position
|
|
5
6
|
* with the given slippage tolerance
|
|
6
7
|
* @param slippageTolerance Tolerance of unfavorable slippage from the current price
|
|
7
8
|
* @returns The amounts, with slippage
|
|
8
9
|
*/
|
|
9
|
-
export declare function mintAmountsWithSlippage(tickCurrent: number,
|
|
10
|
+
export declare function mintAmountsWithSlippage(tickCurrent: number, slippageTolerance: Percent, tickLower: number, tickUpper: number, baseToken: TokenInfo, quoteToken: TokenInfo, amount0: string, amount1: string): {
|
|
10
11
|
amount0: JSBI;
|
|
11
12
|
amount1: JSBI;
|
|
12
13
|
};
|
|
@@ -16,7 +17,7 @@ export declare function mintAmountsWithSlippage(tickCurrent: number, sorted: boo
|
|
|
16
17
|
* @param slippageTolerance tolerance of unfavorable slippage from the current price
|
|
17
18
|
* @returns The amounts, with slippage
|
|
18
19
|
*/
|
|
19
|
-
export declare function burnAmountsWithSlippage(tickCurrent: number,
|
|
20
|
+
export declare function burnAmountsWithSlippage(tickCurrent: number, slippageTolerance: Percent, tickLower: number, tickUpper: number, liquidity: number | bigint | JSBI | string, baseToken: TokenInfo, quoteToken: TokenInfo): Readonly<{
|
|
20
21
|
amount0: JSBI;
|
|
21
22
|
amount1: JSBI;
|
|
22
23
|
}>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import JSBI from 'jsbi';
|
|
2
1
|
import { TokenInfo } from '../../../../hooks/Token';
|
|
3
2
|
import { Price } from '../../../../utils/fractions';
|
|
4
3
|
/**
|
|
@@ -6,13 +5,6 @@ import { Price } from '../../../../utils/fractions';
|
|
|
6
5
|
* @param price for which to return the closest tick that represents a price less than or equal to the input price,
|
|
7
6
|
* i.e. the price of the returned tick is less than or equal to the input price
|
|
8
7
|
*/
|
|
9
|
-
export declare function priceToClosestTick(
|
|
10
|
-
numerator: JSBI;
|
|
11
|
-
denominator: JSBI;
|
|
12
|
-
}): number;
|
|
8
|
+
export declare function priceToClosestTick(price: Price): number;
|
|
13
9
|
export declare function tickToPrice(baseToken: TokenInfo, quoteToken: TokenInfo, tickCurrent: number | bigint): Price;
|
|
14
10
|
export declare function getTickToPrice(baseToken?: TokenInfo, quoteToken?: TokenInfo, tickCurrent?: number | bigint): string | undefined;
|
|
15
|
-
export declare function getTickToPriceParams(tickCurrent: number | bigint, sorted: boolean): {
|
|
16
|
-
numerator: JSBI;
|
|
17
|
-
denominator: JSBI;
|
|
18
|
-
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import JSBI from 'jsbi';
|
|
2
1
|
import { TokenInfo } from '../../../../hooks/Token';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
numerator: JSBI;
|
|
6
|
-
} | undefined;
|
|
2
|
+
import { Price } from '../../../../utils/fractions';
|
|
3
|
+
export declare function tryParsePrice(baseToken?: TokenInfo, quoteToken?: TokenInfo, value?: string): Price | undefined;
|
|
7
4
|
export declare function tryParseTick(baseToken?: TokenInfo, quoteToken?: TokenInfo, value?: string, tickSpacing?: number): number | undefined;
|
|
@@ -1,7 +1,8 @@
|
|
|
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
|
-
export default function AddLiquidityList({ scrollParentRef, filterChainIds, activeChainId, handleChangeActiveChainId, operatePool, setOperatePool, }: {
|
|
5
|
+
export default function AddLiquidityList({ scrollParentRef, filterChainIds, activeChainId, handleChangeActiveChainId, operatePool, setOperatePool, tokenAndPoolFilter, getMigrationPairAndMining, }: {
|
|
5
6
|
scrollParentRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
6
7
|
account?: string;
|
|
7
8
|
filterChainIds?: ChainId[];
|
|
@@ -9,4 +10,9 @@ export default function AddLiquidityList({ scrollParentRef, filterChainIds, acti
|
|
|
9
10
|
handleChangeActiveChainId: (chainId: number | undefined) => void;
|
|
10
11
|
operatePool: Partial<PoolOperateProps> | null;
|
|
11
12
|
setOperatePool: (operate: Partial<PoolOperateProps> | null) => void;
|
|
13
|
+
tokenAndPoolFilter?: TokenAndPoolFilterUserOptions;
|
|
14
|
+
getMigrationPairAndMining?: (p: {
|
|
15
|
+
address: string;
|
|
16
|
+
chainId: number;
|
|
17
|
+
}) => void;
|
|
12
18
|
}): JSX.Element;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { ChainId } from '@dodoex/api';
|
|
2
|
+
import { TokenAndPoolFilterUserOptions } from './hooks/usePoolListFilterTokenAndPool';
|
|
2
3
|
import { PoolOperateProps } from '../PoolOperate';
|
|
3
|
-
export default function MyLiquidity({ account, filterChainIds, activeChainId, handleChangeActiveChainId, operatePool, setOperatePool, }: {
|
|
4
|
+
export default function MyLiquidity({ account, filterChainIds, activeChainId, handleChangeActiveChainId, operatePool, setOperatePool, getMigrationPairAndMining, tokenAndPoolFilter, }: {
|
|
4
5
|
account?: string;
|
|
5
6
|
filterChainIds?: ChainId[];
|
|
6
7
|
activeChainId: ChainId | undefined;
|
|
7
8
|
handleChangeActiveChainId: (chainId: number | undefined) => void;
|
|
8
9
|
operatePool: Partial<PoolOperateProps> | null;
|
|
9
10
|
setOperatePool: (operate: Partial<PoolOperateProps> | null) => void;
|
|
11
|
+
getMigrationPairAndMining?: (p: {
|
|
12
|
+
address: string;
|
|
13
|
+
chainId: number;
|
|
14
|
+
}) => void;
|
|
15
|
+
tokenAndPoolFilter?: TokenAndPoolFilterUserOptions;
|
|
10
16
|
}): 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,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Page, PageType } from '../../../router/types';
|
|
3
|
-
|
|
3
|
+
import { PoolOperateProps } from '../PoolOperate';
|
|
4
|
+
import { TokenAndPoolFilterUserOptions } from './hooks/usePoolListFilterTokenAndPool';
|
|
5
|
+
export default function PoolList({ params, scrollRef: scrollParentRefProps, tokenAndPoolFilter, operatePMMPoolElement, operatePool: operatePoolProps, onOperatePool, getMigrationPairAndMining, }: {
|
|
4
6
|
params?: Page<PageType.Pool>['params'];
|
|
5
7
|
scrollRef?: React.RefObject<any>;
|
|
8
|
+
tokenAndPoolFilter?: TokenAndPoolFilterUserOptions;
|
|
9
|
+
operatePMMPoolElement?: React.ReactElement;
|
|
10
|
+
operatePool?: Partial<PoolOperateProps> | null;
|
|
11
|
+
onOperatePool?: (pool: Partial<PoolOperateProps> | null) => boolean;
|
|
12
|
+
getMigrationPairAndMining?: (p: {
|
|
13
|
+
address: string;
|
|
14
|
+
chainId: number;
|
|
15
|
+
}) => void;
|
|
6
16
|
}): JSX.Element;
|