@dodoex/widgets 3.0.2-beta.2 → 3.0.2-beta.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/dist/cjs/locales/en-US.js +1 -1
- package/dist/cjs/locales/zh-CN.js +1 -1
- package/dist/{helper-2i0I5a1C.js → helper-0mEEWmLI.js} +1 -1
- package/dist/{helper-CH8xf86A.cjs → helper-Ca1NNN7H.cjs} +1 -1
- package/dist/index-B88bmvE3.js +31 -0
- package/dist/{index-kdGZKKxv.cjs → index-C9SrgBQF.cjs} +6 -6
- package/dist/{index-BMlWKikO.cjs → index-CXnrrEzC.cjs} +2 -2
- package/dist/{index-CDVEYVfl.js → index-Dd6MuO0J.js} +1 -1
- package/dist/index-DzpFHEP1.cjs +31 -0
- package/dist/index-RtpT-Lw5.js +78 -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/Swap/components/TokenCard/TokenPickerDialog.d.ts +3 -2
- package/dist/types/components/TokenLogoPair.d.ts +1 -1
- package/dist/types/components/Widget/index.d.ts +28 -1
- package/dist/types/components/WidgetContainer.d.ts +1 -1
- package/dist/types/components/WithExecutionDialog/index.d.ts +1 -1
- 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/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 -6
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/sdk-core/chains.d.ts +6 -0
- package/dist/types/widgets/PoolWidget/AMMV3/sdks/v3-sdk/constants.d.ts +11 -2
- 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/PoolApyTooltip.d.ts +1 -0
- package/dist/types/widgets/PoolWidget/PoolList/components/migationWidget.d.ts +7 -0
- package/dist/types/widgets/PoolWidget/PoolList/hooks/usePoolListFilterTokenAndPool.d.ts +10 -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 +6 -8
- package/dist/index-B1pv8aH1.js +0 -31
- package/dist/index-BVRTKtom.cjs +0 -31
- package/dist/index-Cdbf_10a.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
|
@@ -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;
|
|
@@ -51,10 +51,12 @@ export declare enum ExecutionResult {
|
|
|
51
51
|
Success = "success",
|
|
52
52
|
Submitted = "submitted"
|
|
53
53
|
}
|
|
54
|
+
type SubmitState = 'loading' | 'submitted';
|
|
54
55
|
export interface Showing {
|
|
55
56
|
brief: string;
|
|
56
57
|
subtitle?: string | React.ReactNode;
|
|
57
58
|
spec: StepSpec;
|
|
59
|
+
submitState?: SubmitState;
|
|
58
60
|
}
|
|
59
61
|
export type ExecutionCtx = {
|
|
60
62
|
/**
|
|
@@ -90,3 +92,4 @@ export declare enum WatchResult {
|
|
|
90
92
|
Failed = 0,
|
|
91
93
|
Success = 1
|
|
92
94
|
}
|
|
95
|
+
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 {};
|
|
@@ -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;
|
|
@@ -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,12 +1,6 @@
|
|
|
1
|
-
import { SupportedChainsType } from './chains';
|
|
2
1
|
type AddressMap = {
|
|
3
2
|
[chainId: number]: string;
|
|
4
3
|
};
|
|
5
|
-
type ChainAddresses = {
|
|
6
|
-
v3CoreFactoryAddress: string;
|
|
7
|
-
nonfungiblePositionManagerAddress?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const CHAIN_TO_ADDRESSES_MAP: Record<SupportedChainsType, ChainAddresses>;
|
|
10
4
|
export declare const V3_CORE_FACTORY_ADDRESSES: AddressMap;
|
|
11
5
|
export declare const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: AddressMap;
|
|
12
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,7 +1,16 @@
|
|
|
1
1
|
import { ChainId } from '../sdk-core';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Taiko UniswapV3Factory
|
|
4
|
+
* @see https://taikoscan.io/address/0x78172691DD3B8ADa7aEbd9bFfB487FB11D735DB2?tab=contract#code
|
|
5
|
+
*/
|
|
6
|
+
export declare const FACTORY_ADDRESS = "0x78172691DD3B8ADa7aEbd9bFfB487FB11D735DB2";
|
|
3
7
|
export declare const ADDRESS_ZERO = "0x0000000000000000000000000000000000000000";
|
|
4
|
-
export declare const POOL_INIT_CODE_HASH = "
|
|
8
|
+
export declare const POOL_INIT_CODE_HASH = "0x5ccd5621c1bb9e44ce98cef8b90d31eb2423dec3793b6239232cefae976936ea";
|
|
9
|
+
/**
|
|
10
|
+
* Taiko POOL_INIT_CODE_HASH
|
|
11
|
+
* @see PoolAddress.sol
|
|
12
|
+
* @see https://taikoscan.io/address/0x202bEE65B164aEcBb6A2318438bf46bEF14E1072?tab=contract#code#F12#L6
|
|
13
|
+
*/
|
|
5
14
|
export declare function poolInitCodeHash(chainId?: ChainId): string;
|
|
6
15
|
/**
|
|
7
16
|
* The default factory enabled fee amounts, denominated in hundredths of bips.
|
|
@@ -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;
|
|
@@ -10,6 +10,7 @@ export default function PoolApyTooltip({ chainId, baseToken, quoteToken, apy, ha
|
|
|
10
10
|
transactionQuoteApy?: string | null;
|
|
11
11
|
miningBaseApy?: string | null;
|
|
12
12
|
miningQuoteApy?: string | null;
|
|
13
|
+
metromMiningApy?: string | null;
|
|
13
14
|
} | undefined | null;
|
|
14
15
|
hasQuote: boolean;
|
|
15
16
|
hasMining: 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;
|
|
@@ -43,6 +51,7 @@ export declare function usePoolListFilterTokenAndPool(): {
|
|
|
43
51
|
miningQuoteApy?: any | null;
|
|
44
52
|
transactionBaseApy?: any | null;
|
|
45
53
|
transactionQuoteApy?: any | null;
|
|
54
|
+
metromMiningApy?: any | null;
|
|
46
55
|
} | null;
|
|
47
56
|
} | null;
|
|
48
57
|
} | null)[] | null | undefined;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dodoex/widgets",
|
|
3
|
-
"version": "3.0.2-beta.
|
|
3
|
+
"version": "3.0.2-beta.21",
|
|
4
4
|
"description": "DODO Widgets",
|
|
5
5
|
"source": "src/index.tsx",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@babel/runtime": "^7.17.0",
|
|
61
|
-
"@dodoex/api": "3.0.3-
|
|
62
|
-
"@dodoex/components": "3.0.1",
|
|
61
|
+
"@dodoex/api": "3.0.3-beta.4",
|
|
62
|
+
"@dodoex/components": "3.0.4-beta.1",
|
|
63
63
|
"@dodoex/contract-request": "^1.3.0",
|
|
64
|
-
"@dodoex/dodo-contract-request": "
|
|
64
|
+
"@dodoex/dodo-contract-request": "1.12.0-alpha.3",
|
|
65
65
|
"@dodoex/icons": "^2.0.2",
|
|
66
66
|
"@emotion/react": "^11.10.0",
|
|
67
67
|
"@emotion/styled": "^11.10.0",
|
|
@@ -106,9 +106,7 @@
|
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"@babel/runtime": ">=7.17.0",
|
|
108
108
|
"react": ">=17.0.1",
|
|
109
|
-
"react-dom": ">=17.0.1"
|
|
110
|
-
"react-redux": ">=7.2.2",
|
|
111
|
-
"redux": ">=4.1.2"
|
|
109
|
+
"react-dom": ">=17.0.1"
|
|
112
110
|
},
|
|
113
111
|
"devDependencies": {
|
|
114
112
|
"@babel/preset-env": "^7.16.11",
|
|
@@ -154,4 +152,4 @@
|
|
|
154
152
|
"ts-jest": "^29.0.1",
|
|
155
153
|
"typescript": "^5.6.3"
|
|
156
154
|
}
|
|
157
|
-
}
|
|
155
|
+
}
|