@dodoex/widgets 3.0.0-beta.8 → 3.0.0-taiko.1
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/8de9a184d4ef0a11.svg +6 -0
- package/dist/cjs/8de9a184d4ef0a11.svg +6 -0
- package/dist/cjs/components/AddressWithLinkAndCopy.d.ts +2 -1
- package/dist/cjs/components/Confirm.d.ts +3 -2
- package/dist/cjs/components/Swap/components/Dialog.d.ts +1 -0
- package/dist/cjs/components/Swap/components/ReviewDialog.d.ts +2 -1
- package/dist/cjs/components/Swap/components/TokenCard/BalanceText.d.ts +2 -1
- package/dist/cjs/components/Swap/components/TokenCard/TokenLogoCollapse.d.ts +2 -1
- package/dist/cjs/components/Swap/components/TokenCard/index.d.ts +5 -2
- package/dist/cjs/components/Swap/index.d.ts +4 -1
- package/dist/cjs/components/TokenLogo.d.ts +3 -1
- package/dist/cjs/components/TokenLogoPair.d.ts +1 -1
- package/dist/cjs/components/UserOptionsProvider.d.ts +7 -0
- package/dist/cjs/components/Widget/index.d.ts +6 -3
- package/dist/cjs/components/WidgetContainer.d.ts +1 -0
- package/dist/cjs/constants/api.d.ts +1 -2
- package/dist/cjs/constants/chains.d.ts +2 -0
- package/dist/cjs/{helper-CJs0kk7i.cjs → helper-BqWucj2L.cjs} +1 -1
- package/dist/cjs/{helper-9v1xZPrA.cjs → helper-CA2Unt8z.cjs} +1 -1
- package/dist/cjs/{helper-B2-rZVIE.cjs → helper-Ddx6E78N.cjs} +1 -1
- package/dist/cjs/hooks/ConnectWallet/useCurrentChainId.d.ts +1 -2
- package/dist/cjs/hooks/ConnectWallet/useWalletInfo.d.ts +3 -2
- package/dist/cjs/hooks/Submission/types.d.ts +2 -0
- package/dist/cjs/hooks/Submission/useBalanceUpdateLoading.d.ts +3 -2
- package/dist/cjs/hooks/Submission/useExecution.d.ts +2 -1
- package/dist/cjs/hooks/Swap/index.d.ts +0 -1
- package/dist/cjs/hooks/Swap/useExecuteSwap.d.ts +2 -1
- package/dist/cjs/hooks/Swap/useFetchRoutePrice.d.ts +2 -1
- package/dist/cjs/hooks/Swap/useInitDefaultToken.d.ts +2 -1
- package/dist/cjs/hooks/Token/useTokenStatus.d.ts +2 -2
- package/dist/cjs/{index-CehtAWbq.cjs → index-Bxtcvdw2.cjs} +2 -2
- package/dist/cjs/{index-CjauijUe.cjs → index-ByeimHe5.cjs} +1 -1
- package/dist/cjs/index-C7nZV-Xv.cjs +53 -0
- package/dist/cjs/{index-B7_JblND.cjs → index-CV0irHwe.cjs} +2 -2
- package/dist/cjs/{index-2gIiWluA.cjs → index-CwlNU9tc.cjs} +1 -1
- package/dist/cjs/index-DQdaYoYP.cjs +53 -0
- package/dist/cjs/index-b5ToTyox.cjs +53 -0
- package/dist/cjs/{index-CwNxbpQG.cjs → index-eAzTiLuw.cjs} +2 -2
- package/dist/cjs/{index-DcTfgD7l.cjs → index-oVjjHgRx.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.d.ts +9 -1
- package/dist/cjs/locales/en-US.js +1 -0
- package/dist/cjs/locales/zh-CN.js +1 -0
- package/dist/cjs/providers/GlobalConfigContext.d.ts +14 -3
- package/dist/cjs/router/index.d.ts +2 -1
- package/dist/cjs/store/actions/globals.d.ts +2 -2
- package/dist/cjs/store/actions/settings.d.ts +0 -2
- package/dist/cjs/store/actions/token.d.ts +0 -1
- package/dist/cjs/store/actions/wallet.d.ts +0 -1
- package/dist/cjs/store/reducers/globals.d.ts +1 -3
- package/dist/cjs/store/reducers/settings.d.ts +0 -3
- package/dist/cjs/store/reducers/token.d.ts +1 -3
- package/dist/cjs/store/reducers/wallet.d.ts +0 -1
- package/dist/cjs/store/selectors/globals.d.ts +1 -1
- package/dist/cjs/store/selectors/settings.d.ts +0 -1
- package/dist/cjs/store/selectors/token.d.ts +0 -3
- package/dist/cjs/store/selectors/wallet.d.ts +0 -1
- package/dist/cjs/widgets/MiningWidget/LpTokenMiningOperate/index.d.ts +1 -3
- package/dist/cjs/widgets/MiningWidget/OperateArea/AssociateMine.d.ts +2 -2
- package/dist/cjs/widgets/MiningWidget/OperateArea/StakeButton.d.ts +5 -1
- package/dist/cjs/widgets/MiningWidget/OperateArea/UnstakeButton.d.ts +5 -1
- package/dist/cjs/widgets/MiningWidget/OperateArea/Widgets.d.ts +3 -0
- package/dist/cjs/widgets/MiningWidget/OperateArea/index.d.ts +2 -3
- package/dist/cjs/widgets/MiningWidget/hooks/useClaimMiningSubmit.d.ts +2 -1
- package/dist/cjs/widgets/MiningWidget/hooks/useRewardListAmount.d.ts +1 -0
- package/dist/cjs/widgets/MiningWidget/hooks/useStakeMiningSubmit.d.ts +5 -1
- package/dist/cjs/widgets/MiningWidget/hooks/useUnstakeMiningSubmit.d.ts +5 -1
- package/dist/cjs/widgets/PoolWidget/PoolList/components/LiquidityTable.d.ts +5 -1
- package/dist/cjs/widgets/PoolWidget/PoolList/components/SkeletonTable.d.ts +4 -0
- package/dist/cjs/widgets/PoolWidget/PoolModify/index.d.ts +1 -1
- package/dist/cjs/widgets/PoolWidget/PoolOperate/PoolOperateInner.d.ts +2 -1
- package/dist/cjs/widgets/PoolWidget/PoolOperate/components/OperateBtn.d.ts +2 -1
- package/dist/cjs/widgets/PoolWidget/PoolOperate/components/SlippageSetting.d.ts +3 -6
- package/dist/cjs/widgets/PoolWidget/PoolOperate/index.d.ts +3 -2
- package/dist/cjs/widgets/PoolWidget/hooks/usePoolTypeTag.d.ts +2 -2
- package/dist/cjs/widgets/PoolWidget/utils.d.ts +1 -0
- package/dist/components/AddressWithLinkAndCopy.d.ts +2 -1
- package/dist/components/Confirm.d.ts +3 -2
- package/dist/components/Swap/components/Dialog.d.ts +1 -0
- package/dist/components/Swap/components/ReviewDialog.d.ts +2 -1
- package/dist/components/Swap/components/TokenCard/BalanceText.d.ts +2 -1
- package/dist/components/Swap/components/TokenCard/TokenLogoCollapse.d.ts +2 -1
- package/dist/components/Swap/components/TokenCard/index.d.ts +5 -2
- package/dist/components/Swap/index.d.ts +4 -1
- package/dist/components/TokenLogo.d.ts +3 -1
- package/dist/components/TokenLogoPair.d.ts +1 -1
- package/dist/components/UserOptionsProvider.d.ts +7 -0
- package/dist/components/Widget/index.d.ts +6 -3
- package/dist/components/WidgetContainer.d.ts +1 -0
- package/dist/constants/api.d.ts +1 -2
- package/dist/constants/chains.d.ts +2 -0
- package/dist/{helper-BkVWYFdX.js → helper-Bt2jqmHJ.js} +1 -1
- package/dist/{helper-BnZccHWW.js → helper-CffQwkVy.js} +1 -1
- package/dist/{helper-CRRYcp-I.js → helper-CuF0qqWC.js} +1 -1
- package/dist/hooks/ConnectWallet/useCurrentChainId.d.ts +1 -2
- package/dist/hooks/ConnectWallet/useWalletInfo.d.ts +3 -2
- package/dist/hooks/Submission/types.d.ts +2 -0
- package/dist/hooks/Submission/useBalanceUpdateLoading.d.ts +3 -2
- package/dist/hooks/Submission/useExecution.d.ts +2 -1
- package/dist/hooks/Swap/index.d.ts +0 -1
- package/dist/hooks/Swap/useExecuteSwap.d.ts +2 -1
- package/dist/hooks/Swap/useFetchRoutePrice.d.ts +2 -1
- package/dist/hooks/Swap/useInitDefaultToken.d.ts +2 -1
- package/dist/hooks/Token/useTokenStatus.d.ts +2 -2
- package/dist/{index-BZwfyyd7.js → index-55pJL40G.js} +1 -1
- package/dist/{index-5b4GvkIX.js → index-B4mdq_2j.js} +1 -1
- package/dist/{index-B3VoNr6u.js → index-B5GYrOLU.js} +1 -1
- package/dist/index-BJITf9wa.js +53 -0
- package/dist/index-C9MWtFb0.js +53 -0
- package/dist/{index-BeDXO0sq.js → index-COI8TWZn.js} +1 -1
- package/dist/index-CsmjYFZZ.js +53 -0
- package/dist/{index-Bj86XWJe.js → index-DFbGQPje.js} +1 -1
- package/dist/{index-B9Ld2lke.js → index-dy1bNsNN.js} +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +1 -1
- package/dist/locales/en-US.js +1 -0
- package/dist/locales/zh-CN.js +1 -0
- package/dist/providers/GlobalConfigContext.d.ts +14 -3
- package/dist/router/index.d.ts +2 -1
- package/dist/store/actions/globals.d.ts +2 -2
- package/dist/store/actions/settings.d.ts +0 -2
- package/dist/store/actions/token.d.ts +0 -1
- package/dist/store/actions/wallet.d.ts +0 -1
- package/dist/store/reducers/globals.d.ts +1 -3
- package/dist/store/reducers/settings.d.ts +0 -3
- package/dist/store/reducers/token.d.ts +1 -3
- package/dist/store/reducers/wallet.d.ts +0 -1
- package/dist/store/selectors/globals.d.ts +1 -1
- package/dist/store/selectors/settings.d.ts +0 -1
- package/dist/store/selectors/token.d.ts +0 -3
- package/dist/store/selectors/wallet.d.ts +0 -1
- package/dist/widgets/MiningWidget/LpTokenMiningOperate/index.d.ts +1 -3
- package/dist/widgets/MiningWidget/OperateArea/AssociateMine.d.ts +2 -2
- package/dist/widgets/MiningWidget/OperateArea/StakeButton.d.ts +5 -1
- package/dist/widgets/MiningWidget/OperateArea/UnstakeButton.d.ts +5 -1
- package/dist/widgets/MiningWidget/OperateArea/Widgets.d.ts +3 -0
- package/dist/widgets/MiningWidget/OperateArea/index.d.ts +2 -3
- package/dist/widgets/MiningWidget/hooks/useClaimMiningSubmit.d.ts +2 -1
- package/dist/widgets/MiningWidget/hooks/useRewardListAmount.d.ts +1 -0
- package/dist/widgets/MiningWidget/hooks/useStakeMiningSubmit.d.ts +5 -1
- package/dist/widgets/MiningWidget/hooks/useUnstakeMiningSubmit.d.ts +5 -1
- package/dist/widgets/PoolWidget/PoolList/components/LiquidityTable.d.ts +5 -1
- package/dist/widgets/PoolWidget/PoolList/components/SkeletonTable.d.ts +4 -0
- package/dist/widgets/PoolWidget/PoolModify/index.d.ts +1 -1
- package/dist/widgets/PoolWidget/PoolOperate/PoolOperateInner.d.ts +2 -1
- package/dist/widgets/PoolWidget/PoolOperate/components/OperateBtn.d.ts +2 -1
- package/dist/widgets/PoolWidget/PoolOperate/components/SlippageSetting.d.ts +3 -6
- package/dist/widgets/PoolWidget/PoolOperate/index.d.ts +3 -2
- package/dist/widgets/PoolWidget/hooks/usePoolTypeTag.d.ts +2 -2
- package/dist/widgets/PoolWidget/utils.d.ts +1 -0
- package/package.json +5 -4
- package/dist/cjs/failed-list-DRBOVKWp-DC1nhEC-.cjs +0 -1
- package/dist/cjs/helper-C0YMPIhl.cjs +0 -1
- package/dist/cjs/helper-CLLyxV4k.cjs +0 -1
- package/dist/cjs/helper-DIPGhxwy.cjs +0 -1
- package/dist/cjs/helper-TLfYWcrp.cjs +0 -1
- package/dist/cjs/hooks/Widget/useInitPropsToRedux.d.ts +0 -2
- package/dist/cjs/index-BWnG4lrS.cjs +0 -78
- package/dist/cjs/index-Bav9CAmb.cjs +0 -12
- package/dist/cjs/index-C88-b-Wy.cjs +0 -58
- package/dist/cjs/index-CGYgLzId.cjs +0 -58
- package/dist/cjs/index-CReDAoH1.cjs +0 -58
- package/dist/cjs/index-CRy_F8z-.cjs +0 -58
- package/dist/cjs/index-D0vhEDHr.cjs +0 -12
- package/dist/cjs/index-DVIn_6Rm.cjs +0 -58
- package/dist/cjs/index-DlRXMtyN.cjs +0 -12
- package/dist/cjs/index-Dz-MCVVA.cjs +0 -78
- package/dist/cjs/index-GmVuq-HG.cjs +0 -58
- package/dist/cjs/index-LrumBPzq.cjs +0 -78
- package/dist/cjs/index-NhIIGWO7.cjs +0 -78
- package/dist/cjs/index-O0NwxpAG.cjs +0 -12
- package/dist/cjs/index-rIBJLbpB.cjs +0 -58
- package/dist/cjs/lottie-7NcOWIJ4.cjs +0 -1
- package/dist/cjs/lottie-B6Jr7IL6.cjs +0 -1
- package/dist/cjs/lottie-BdJNUW9a.cjs +0 -1
- package/dist/cjs/lottie-Br_vIGRH.cjs +0 -1
- package/dist/cjs/lottie-CZaIiam5.cjs +0 -1
- package/dist/cjs/lottie-JP26wQPR.cjs +0 -1
- package/dist/cjs/lottie-YDIvS9JC.cjs +0 -1
- package/dist/cjs/multi-entry.js +0 -7
- package/dist/cjs/no-found-BKLZjsgH-DqAhyXyc.cjs +0 -1
- package/dist/cjs/no-result-FTqGvqhr-_3xEQ9ck.cjs +0 -1
- package/dist/failed-list-DRBOVKWp-DRBOVKWp.js +0 -1
- package/dist/helper-CTfrV0Rj.js +0 -1
- package/dist/helper-CxIwwxNg.js +0 -1
- package/dist/helper-DNb0C46N.js +0 -1
- package/dist/helper-qQa3KkTY.js +0 -1
- package/dist/hooks/Widget/useInitPropsToRedux.d.ts +0 -2
- package/dist/index-BRQ-O8V_.js +0 -58
- package/dist/index-BnI0cbY9.js +0 -58
- package/dist/index-C40rjn-m.js +0 -78
- package/dist/index-C6tQX6eZ.js +0 -12
- package/dist/index-CWf6IcCi.js +0 -12
- package/dist/index-D8t1zmBi.js +0 -78
- package/dist/index-DFNQbZdf.js +0 -58
- package/dist/index-DP4xH8dV.js +0 -12
- package/dist/index-DVDdzCO4.js +0 -78
- package/dist/index-DZ4BV65W.js +0 -58
- package/dist/index-DdOBpj2U.js +0 -78
- package/dist/index-DtsZYrPp.js +0 -58
- package/dist/index-dq4v_RjC.js +0 -58
- package/dist/index-gimKgjoZ.js +0 -12
- package/dist/index-s1t2K9PZ.js +0 -58
- package/dist/lottie-AFoy96Z1.js +0 -1
- package/dist/lottie-CFAC9m8a.js +0 -1
- package/dist/lottie-CampOEpU.js +0 -1
- package/dist/lottie-CqX6d-YU.js +0 -1
- package/dist/lottie-DHt3-R9A.js +0 -1
- package/dist/lottie-WSOvHtU6.js +0 -1
- package/dist/lottie-k2Vu6Na2.js +0 -1
- package/dist/multi-entry.js +0 -7
- package/dist/no-found-BKLZjsgH-LomOnbuz.js +0 -1
- package/dist/no-result-FTqGvqhr-DhAfvy2a.js +0 -1
|
@@ -3,7 +3,7 @@ import { Theme } from '@dodoex/components';
|
|
|
3
3
|
import BigNumber from 'bignumber.js';
|
|
4
4
|
export declare const getPoolTypeTag: (type: PoolType, quoteReserve: BigNumber | undefined | null, theme: Theme) => {
|
|
5
5
|
typeLabel: string;
|
|
6
|
-
typeColor:
|
|
6
|
+
typeColor: string;
|
|
7
7
|
typeBgColor: string;
|
|
8
8
|
};
|
|
9
9
|
export declare const usePoolTypeTag: ({ type, quoteReserve, }: {
|
|
@@ -11,6 +11,6 @@ export declare const usePoolTypeTag: ({ type, quoteReserve, }: {
|
|
|
11
11
|
quoteReserve: BigNumber | undefined | null;
|
|
12
12
|
}) => {
|
|
13
13
|
typeLabel: string;
|
|
14
|
-
typeColor:
|
|
14
|
+
typeColor: string;
|
|
15
15
|
typeBgColor: string;
|
|
16
16
|
};
|
|
@@ -5,6 +5,7 @@ import { OperatePool } from './PoolOperate/types';
|
|
|
5
5
|
export declare const poolApi: PoolApi;
|
|
6
6
|
export declare type FetchLiquidityListLqList = ExcludeNone<ReturnType<Exclude<typeof PoolApi.graphql.fetchLiquidityList['__apiType'], undefined>>['liquidity_list']>['lqList'];
|
|
7
7
|
export declare type FetchMyLiquidityListLqList = ExcludeNone<ReturnType<Exclude<typeof PoolApi.graphql.fetchMyLiquidityList['__apiType'], undefined>>['liquidity_list']>['lqList'];
|
|
8
|
+
export declare type FetchMyCreateListLqList = ExcludeNone<ReturnType<Exclude<typeof PoolApi.graphql.fetchDashboardPairList['__apiType'], undefined>>['dashboard_pairs_list']>['list'];
|
|
8
9
|
export declare type FetchPoolList = ExcludeNone<ReturnType<Exclude<typeof PoolApi.graphql.fetchPoolList['__apiType'], undefined>>['pairs']>;
|
|
9
10
|
export declare function convertLiquidityTokenToTokenInfo(token: {
|
|
10
11
|
id: string;
|
|
@@ -17,6 +17,7 @@ interface Props extends AddressTextProps {
|
|
|
17
17
|
iconSpace?: number;
|
|
18
18
|
iconDarkHover?: boolean;
|
|
19
19
|
customChainId?: number;
|
|
20
|
+
onAddressClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
20
21
|
}
|
|
21
|
-
export declare function AddressWithLinkAndCopy({ address, truncate, showCopy, size, iconSize, iconSpace: iconSpaceProps, sx, iconDarkHover, disabledAddress, addressHoverColor, addressHoverShowIcon, customChainId, handleOpen, }: Props): JSX.Element;
|
|
22
|
+
export declare function AddressWithLinkAndCopy({ address, truncate, showCopy, size, iconSize, iconSpace: iconSpaceProps, sx, iconDarkHover, disabledAddress, addressHoverColor, addressHoverShowIcon, customChainId, handleOpen, onAddressClick, }: Props): JSX.Element;
|
|
22
23
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export declare type ConfirmProps = React.PropsWithChildren<{
|
|
3
3
|
open: boolean;
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
title?: React.ReactNode;
|
|
@@ -12,4 +12,5 @@ export default function Confirm({ open, onClose, title, children, singleBtn, dan
|
|
|
12
12
|
confirmLoading?: boolean;
|
|
13
13
|
isManualClose?: boolean;
|
|
14
14
|
onConfirm?: () => void;
|
|
15
|
-
}
|
|
15
|
+
}>;
|
|
16
|
+
export default function Confirm(props: ConfirmProps): JSX.Element;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export declare const transitionTime = 300;
|
|
3
3
|
export interface DialogProps {
|
|
4
4
|
open: boolean;
|
|
5
|
+
id?: 'connect-wallet' | 'submission' | 'error-message' | 'select-chain' | 'select-token' | 'swap-summary' | 'swap-settings' | 'cross-chain-summary' | 'select-cross-chain' | 'pool-operate';
|
|
5
6
|
onClose?: () => void;
|
|
6
7
|
afterClose?: () => void;
|
|
7
8
|
scope?: boolean;
|
|
@@ -17,5 +17,6 @@ export interface ReviewDialogProps {
|
|
|
17
17
|
curToFiatPrice: BigNumber | null;
|
|
18
18
|
curFromFiatPrice: BigNumber | null;
|
|
19
19
|
pricePerFromToken: number | null;
|
|
20
|
+
loading: boolean;
|
|
20
21
|
}
|
|
21
|
-
export declare function ReviewDialog({ open, execute, onClose, toToken, fromToken, fromAmount, toAmount, priceImpact, clearFromAmt, clearToAmt, baseFeeAmount, curToFiatPrice, curFromFiatPrice, pricePerFromToken, additionalFeeAmount, }: ReviewDialogProps): JSX.Element;
|
|
22
|
+
export declare function ReviewDialog({ open, execute, onClose, toToken, fromToken, fromAmount, toAmount, priceImpact, clearFromAmt, clearToAmt, baseFeeAmount, curToFiatPrice, curFromFiatPrice, pricePerFromToken, additionalFeeAmount, loading, }: ReviewDialogProps): JSX.Element;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare function BalanceText({ onClick, balance, decimals, address, showMaxBtn, loading, balanceText, }: {
|
|
3
|
+
export declare function BalanceText({ onClick, balance, decimals, address, showMaxBtn, canClickBalance: canClickBalanceProps, loading, balanceText, }: {
|
|
4
4
|
onClick?: (max: string) => void;
|
|
5
5
|
balance: BigNumber | null;
|
|
6
6
|
decimals?: number;
|
|
7
7
|
address?: string;
|
|
8
8
|
showMaxBtn?: boolean;
|
|
9
|
+
canClickBalance?: boolean;
|
|
9
10
|
loading?: boolean;
|
|
10
11
|
balanceText?: React.ReactNode;
|
|
11
12
|
}): JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TokenInfo } from '../../../../hooks/Token';
|
|
3
|
-
export declare function TokenLogoCollapse({ token, onClick, showChainLogo, readonly, }: {
|
|
3
|
+
export declare function TokenLogoCollapse({ token, onClick, showChainLogo, readonly, showChainName: showChainNameProps, }: {
|
|
4
4
|
token?: TokenInfo | null;
|
|
5
5
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
6
6
|
showChainLogo?: boolean;
|
|
7
7
|
readonly?: boolean;
|
|
8
|
+
showChainName?: boolean;
|
|
8
9
|
}): JSX.Element;
|
|
@@ -4,12 +4,14 @@ import { TokenInfo } from '../../../../hooks/Token';
|
|
|
4
4
|
import { TokenPickerProps } from '../../../TokenPicker';
|
|
5
5
|
import BigNumber from 'bignumber.js';
|
|
6
6
|
import { ChainId } from '@dodoex/api';
|
|
7
|
+
import { BalanceData } from '../../../../hooks/Submission/useBalanceUpdateLoading';
|
|
7
8
|
export interface TokenCardProps {
|
|
8
9
|
amt: string;
|
|
9
10
|
fiatPriceTxt?: string | React.ReactNode;
|
|
10
11
|
sx?: BoxProps['sx'];
|
|
11
12
|
readOnly?: boolean;
|
|
12
13
|
showMaxBtn?: boolean;
|
|
14
|
+
canClickBalance?: boolean;
|
|
13
15
|
occupiedAddrs?: string[];
|
|
14
16
|
occupiedChainId?: TokenPickerProps['occupiedChainId'];
|
|
15
17
|
onMaxClick?: (max: string) => void;
|
|
@@ -20,7 +22,7 @@ export interface TokenCardProps {
|
|
|
20
22
|
onTokenChange?: (token: TokenInfo, isOccupied: boolean) => void;
|
|
21
23
|
side?: TokenPickerProps['side'];
|
|
22
24
|
showChainLogo?: boolean;
|
|
23
|
-
|
|
25
|
+
showChainName?: boolean;
|
|
24
26
|
defaultLoadBalance?: boolean;
|
|
25
27
|
overrideBalance?: BigNumber | null;
|
|
26
28
|
overrideBalanceLoading?: boolean;
|
|
@@ -30,7 +32,8 @@ export interface TokenCardProps {
|
|
|
30
32
|
inputTypography?: string;
|
|
31
33
|
chainId?: ChainId;
|
|
32
34
|
hideToken?: boolean;
|
|
35
|
+
checkLogBalance?: BalanceData;
|
|
33
36
|
}
|
|
34
37
|
export declare function CardPlus(): JSX.Element;
|
|
35
38
|
export declare function CardPlusConnected(): JSX.Element;
|
|
36
|
-
export declare function TokenCard({ sx, amt, token, readOnly, showMaxBtn, onMaxClick, fiatPriceTxt, occupiedAddrs, occupiedChainId, onInputFocus, onTokenClick, onInputChange, onTokenChange, side, showChainLogo,
|
|
39
|
+
export declare function TokenCard({ sx, amt, token, readOnly, showMaxBtn, canClickBalance, onMaxClick, fiatPriceTxt, occupiedAddrs, occupiedChainId, onInputFocus, onTokenClick, onInputChange, onTokenChange, side, showChainLogo, showChainName, defaultLoadBalance, overrideBalance, overrideBalanceLoading, balanceText, showPercentage, inputReadonlyTooltip, inputTypography, chainId, hideToken, checkLogBalance, }: TokenCardProps): JSX.Element;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { TokenInfo } from '../../hooks/Token/type';
|
|
2
3
|
import { GetAutoSlippage } from '../../hooks/setting/useSetAutoSlippage';
|
|
3
4
|
export interface SwapProps {
|
|
4
5
|
/** Higher priority setting slippage */
|
|
5
6
|
getAutoSlippage?: GetAutoSlippage;
|
|
7
|
+
onPayTokenChange?: (token: TokenInfo) => void;
|
|
8
|
+
onReceiveTokenChange?: (token: TokenInfo) => void;
|
|
6
9
|
}
|
|
7
|
-
export declare function Swap({ getAutoSlippage }?: SwapProps): JSX.Element;
|
|
10
|
+
export declare function Swap({ getAutoSlippage, onPayTokenChange, onReceiveTokenChange, }?: SwapProps): JSX.Element;
|
|
@@ -14,5 +14,7 @@ export interface TokenLogoProps {
|
|
|
14
14
|
chainId?: number;
|
|
15
15
|
noShowChain?: boolean;
|
|
16
16
|
noBorder?: boolean;
|
|
17
|
+
chainSize?: number;
|
|
18
|
+
logoOffset?: number;
|
|
17
19
|
}
|
|
18
|
-
export default function TokenLogo({ width, height, marginRight, url, zIndex, cross, address: addressProps, token: tokenProps, sx, chainId, noShowChain, noBorder, }: TokenLogoProps): React.ReactElement;
|
|
20
|
+
export default function TokenLogo({ width, height, marginRight, url, zIndex, cross, address: addressProps, token: tokenProps, sx, chainId, noShowChain, noBorder, chainSize, logoOffset: logoOffsetProps, }: TokenLogoProps): React.ReactElement;
|
|
@@ -14,4 +14,4 @@ export interface TokenLogoPairProps {
|
|
|
14
14
|
showChainLogo?: boolean;
|
|
15
15
|
sx?: BoxProps['sx'];
|
|
16
16
|
}
|
|
17
|
-
export declare function TokenLogoPair({ tokens, width, height, gap, cross, mr, chainId, showChainLogo, sx, }: TokenLogoPairProps): JSX.Element | null;
|
|
17
|
+
export declare function TokenLogoPair({ tokens, width, height, gap, cross, mr, chainId, showChainLogo: showChainLogoProps, sx, }: TokenLogoPairProps): JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WidgetProps } from './Widget';
|
|
3
|
+
export declare const UserOptionsContext: React.Context<WidgetProps | null>;
|
|
4
|
+
declare type UserOptionsProviderProps = React.PropsWithChildren<WidgetProps>;
|
|
5
|
+
export declare function UserOptionsProvider({ children, ...props }: UserOptionsProviderProps): JSX.Element;
|
|
6
|
+
export declare function useUserOptions<T = WidgetProps>(selector?: (state: WidgetProps) => T): T;
|
|
7
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ContractRequests } from '@dodoex/api';
|
|
2
3
|
import { PaletteMode, ThemeOptions } from '@dodoex/components';
|
|
3
4
|
import { SupportedLang } from '../../constants/locales';
|
|
4
5
|
import { Web3ConnectorsProps } from '../../hooks/ConnectWallet';
|
|
@@ -7,12 +8,11 @@ import { ExecutionProps } from '../../hooks/Submission';
|
|
|
7
8
|
import { ChainId } from '@dodoex/api';
|
|
8
9
|
import { DefaultTokenInfo } from '../../hooks/Token/type';
|
|
9
10
|
import { APIServices } from '../../constants/api';
|
|
10
|
-
import { SwapProps } from '../Swap';
|
|
11
11
|
import { GlobalFunctionConfig } from '../../providers/GlobalConfigContext';
|
|
12
12
|
export declare const WIDGET_CLASS_NAME = "dodo-widget-container";
|
|
13
|
-
export interface WidgetProps extends Web3ConnectorsProps, InitTokenListProps, ExecutionProps, GlobalFunctionConfig
|
|
13
|
+
export interface WidgetProps extends Web3ConnectorsProps, InitTokenListProps, ExecutionProps, GlobalFunctionConfig {
|
|
14
14
|
apikey?: string;
|
|
15
|
-
theme?: ThemeOptions
|
|
15
|
+
theme?: PartialDeep<ThemeOptions>;
|
|
16
16
|
colorMode?: PaletteMode;
|
|
17
17
|
defaultChainId?: ChainId;
|
|
18
18
|
width?: string | number;
|
|
@@ -27,9 +27,12 @@ export interface WidgetProps extends Web3ConnectorsProps, InitTokenListProps, Ex
|
|
|
27
27
|
apiServices?: Partial<APIServices>;
|
|
28
28
|
crossChain?: boolean;
|
|
29
29
|
noPowerBy?: boolean;
|
|
30
|
+
noDocumentLink?: boolean;
|
|
31
|
+
onlyChainId?: ChainId;
|
|
30
32
|
/** When the winding status changes, no pop-up window will be displayed. */
|
|
31
33
|
noSubmissionDialog?: boolean;
|
|
32
34
|
onProviderChanged?: (provider?: any) => void;
|
|
33
35
|
gotoBuyToken?: GlobalFunctionConfig['gotoBuyToken'];
|
|
36
|
+
getStaticJsonRpcProviderByChainId?: Exclude<ConstructorParameters<typeof ContractRequests>[0], undefined>['getProvider'];
|
|
34
37
|
}
|
|
35
38
|
export declare function Widget(props: PropsWithChildren<WidgetProps>): JSX.Element;
|
package/dist/constants/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContractRequests,
|
|
1
|
+
import { ContractRequests, TokenApi, ChainId } from '@dodoex/api';
|
|
2
2
|
export declare enum APIServiceKey {
|
|
3
3
|
routePrice = "routePrice",
|
|
4
4
|
fiatPrice = "fiatPrice",
|
|
@@ -17,4 +17,3 @@ export declare function getAPIService(key: APIServiceKey, serviceProps?: Partial
|
|
|
17
17
|
export declare const contractRequests: ContractRequests;
|
|
18
18
|
export declare const tokenContractRequests: ContractRequests;
|
|
19
19
|
export declare const tokenApi: TokenApi;
|
|
20
|
-
export declare const graphQLRequests: GraphQLRequests;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i18n as e}from"@lingui/core";import t from"bignumber.js";import{f as i}from"./index-
|
|
1
|
+
import{i18n as e}from"@lingui/core";import t from"bignumber.js";import{f as i}from"./index-C9MWtFb0.js";function o(t,i){switch(t){case"depth-chart.tips.buy":return e._({id:"q+Q952",message:"Users pay {0} {1} and receive {2} {3}\\nPrice {4} ({5}%)",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol,4:i.priceText,5:i.slippageText}});case"depth-chart.tips.mid-price":return e._({id:"cnbRVW",message:"Initial Price {0} {1} = {2} {3}",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol}});case"depth-chart.tips.sell":return e._({id:"q+Q952",message:"Users pay {0} {1} and receive {2} {3}\\nPrice {4} ({5}%)",values:{0:i.oppositeAmountText,1:i.quoteTokenSymbol,2:i.amountText,3:i.baseTokenSymbol,4:i.priceText,5:i.slippageText}});case"pool.chart.buy-amount":return e._({id:"TaScUS",message:"Users sell {0} amount:",values:{0:i.symbol}});case"pool.chart.price-impact":return e._({id:"I0LXan",message:"Price Impact: {0}",values:{0:i.amount}});case"pool.chart.sell-amount":return e._({id:"F2vX4t",message:"Users buy {0} amount:",values:{0:i.symbol}});case"pool.create.disabled-token-amount":return e._({id:"5QDjef",message:"The token amount is calculated by initial price."});case"pool.create.set-pool.emulator.title":return e._({id:"FQfStS",message:"Emulator"});case"pool.create.set-pool.emulator.title.question":return e._({id:"9D2g7k",message:"The liquidity of DODO is continuous, which is different from the discrete liquidity of UniV3. The ticks shown in the illustration are for demonstration purposes only."});case"pool.chart.liquidity-chart-tip":return e._({id:"YvXHDU",message:"The area of the chart indicates the buy/sell volume of {0} that can be carried by the market when the current price changes to the hover price.",values:{0:i.baseTokenSymbol}});case"pool.chart.liquidity-chart-buy":return e._({id:"TvH4Ym",message:"Bought {0} {1}, price in the pool decreased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});case"pool.chart.liquidity-chart-sell":return e._({id:"0O1wzf",message:"Traders sold {0} {1}, price in the pool increased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});default:throw new Error(`Unknown key ${t}`)}}const l=12,n=18;function s(e){let t=e.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(4===t.length){let e="#";for(let i=1;i<4;i+=1)e+=t.slice(i,i+1).concat(t.slice(i,i+1));t=e}const e=[];for(let i=1;i<7;i+=2)e.push(parseInt(`0x${t.slice(i,i+2)}`));return e.join(",")}return t}function r({val:e,model:i}){let o=e;if(e.isNaN())return{side:"no-one",vert:new t(0),base:new t(0),quote:new t(0)};i.Q0.eq(0)&&e.lt(i.i)&&(o=i.i),i.B0.eq(0)&&e.gt(i.i)&&(o=i.i);const l=i.getPriceDepth(o),n=l.baseAmount,s=l.quoteAmount,{isBuy:r}=l;return{side:r?"ask":"bid",vert:r?n:s,base:n,quote:s}}function a({midPrice:e,q:i,q0:o,pmmModel:l}){let n=t.maximum(i,o,l.B.multipliedBy(e));return n.isNaN()&&(n=new t(10)),n.eq(0)&&(n=new t(1)),{buyBaseVert:n.multipliedBy(1.2),sellBaseVert:n.div(e).multipliedBy(1.2)}}function u(e,i=1){return new t(i).div(e/2)}function m({tooltip:e,x:o,chartWidth:l,chartHeight:n,buyBaseVert:a,sellBaseVert:m,pmmModel:p,midPrice:d,baseTokenSymbol:c,quoteTokenSymbol:h,t:b,baseMinAndZoomMultiples:f,isHover:y,color:g,leftColor:T,rightColor:x}){const{zoomMultiples:v,baseMin:w}=f,k=u(l,v),M=a.div(n),B=m.div(n),q=2*v,S=w.multipliedBy(10**k.multipliedBy(o).toNumber());let N=new t(Math.log(d.div(w).toNumber())/Math.log(10));N=t.minimum(q,N),N=t.maximum(0,N);const P=N.div(k),X=r({val:S,model:p,midPrice:d});if(X.vert.isNaN())return;const A=S.lt(d);let _=n-X.vert.div(M).toNumber();A||(_=n-X.vert.div(B).toNumber());const z=i(S),O=i(X.vert),$=S.minus(d).abs().div(d).multipliedBy(100).toFixed(2),D=P.toNumber(),H=e.findOne("#toolTipVertLine"),L=e.findOne("#toolTipHoriLine"),U=e.findOne("#joinCircle"),V=e.findOne("#toolTip"),j=e.findOne("#priceTextLabel"),W=e.findOne("#slippageTextLabel");if(!V)return;V.x(o),V.y(_-5-6);const Y=V.getText(),F=V.getTag();let I="ask"===X.side?i(X.quote):i(X.base);const Q=p.k.lte(0);Q&&(I=O);const C=i(d),Z={amountText:O,baseTokenSymbol:c,oppositeAmountText:I,quoteTokenSymbol:h,priceText:Q?C:z,slippageText:`${A?"-":"+"}${$}`};if(P.minus(4).lte(o)&&P.plus(2).gte(o)&&y)Y.text(b("depth-chart.tips.mid-price",{amountText:1,baseTokenSymbol:c,oppositeAmountText:C,quoteTokenSymbol:h})),V.x(D),V.y(n/2),null==H||H.hide(),null==L||L.hide(),null==U||U.hide(),null==j||j.hide(),null==W||W.hide();else{Y.text(A?b("depth-chart.tips.buy",{amountText:I,baseTokenSymbol:c,oppositeAmountText:O,quoteTokenSymbol:h,priceText:Q?C:z,slippageText:`${A?"-":"+"}${$}`}):b("depth-chart.tips.sell",Z));const e=g||(A?"#55f6db":"#ff4f73"),t=A?T||"#55f6db":x||"#ff4f73";Y.fill(e),V.width()/2>o?(F.pointerDirection("left"),F.pointerHeight(15),F.pointerWidth(8),V.offsetX(-11),V.offsetY(-11)):V.width()/2+o>l?(F.pointerDirection("right"),F.pointerHeight(15),F.pointerWidth(8),V.offsetX(11),V.offsetY(-11)):(F.pointerDirection("down"),F.pointerHeight(8),F.pointerWidth(15),V.offsetX(0),V.offsetY(0)),null==H||H.points([o,n,o,_]),null==H||H.stroke(t),null==L||L.points(A?[o,_,D,_]:[D,_,o,_]),null==L||L.stroke(t),null==U||U.x(o),null==U||U.y(_),null==U||U.fill(A?T||"rgb(86, 246, 218)":x||"#FF5072"),null==U||U.stroke(A?T?`rgba(${s(T)}, 0.4)`:"rgba(86, 246, 218, 0.3)":x?`rgba(${s(x)}, 0.4)`:"rgba(255, 80, 114, 0.3)"),j&&(j.x(o),j.y(n),j.offsetX(j.width()/2),j.x()-j.width()/2<0?j.x(j.width()/2):j.x()+j.width()/2>l?j.x(l-j.width()/2):j.x(o));const i=null==j?void 0:j.findOne("#priceTextLabel-text");i&&(i.fill(e),i.text(z)),W&&(W.x(A?o+(D-o)/2:o-(o-D)/2),W.y(_),W.offsetY(W.height()/2),W.offsetX(W.width()/2));const r=null==W?void 0:W.findOne("#slippageTextLabel-text");r&&(r.fill(e),r.text(`${A?"-":"+"}${$}%`)),null==H||H.show(),null==L||L.show(),null==U||U.show(),null==j||j.show(),null==W||W.show()}e.show()}function p({dragDistance:e,prevBaseMin:i,chartWidth:o,zoomMultiples:l}){const n=u(o,l);return e>0?i.multipliedBy(1-n.multipliedBy(e).toNumber()):i.multipliedBy(10**n.multipliedBy(new t(e).abs()).plus(0).toNumber())}const d=1;function c({prevZoomMultiples:e,zoomIn:t}){return!t&&e<=.1?e:t?e+.1:e-.1}function h({type:e,targetPrice:i,midPrice:o,width:l}){if("sell"===e){return{zoomMultiples:new t(Math.log10(i.div(o).toNumber())).minus(0).div(3/4).abs(),targetX:l/2*(3/4)+l/2}}const n=new t(Math.log10(i.div(o).toNumber()));return{zoomMultiples:new t(0).minus(n).div(3/4).abs(),targetX:l/2*(1/4)}}function b({currentBaseMinAndZoomMultiples:e,targetPrice:i,midPrice:o,width:l}){const{baseMin:n,zoomMultiples:s}=e,r=new t(Math.log10(n.div(o).toNumber())),a=r.plus(2*s),u=new t(o.multipliedBy(10**a.toNumber()));if(i.gte(n)&&i.lte(u)){return{isSkip:!0,targetX:new t(Math.log10(i.div(o).toNumber())).minus(r).div(2*s).multipliedBy(l).toNumber(),baseMin:new t(0),zoomMultiples:1}}const m=new t(o.multipliedBy(.1)),p=new t(o.multipliedBy(10));if(i.gte(m)&&i.lte(p)){return{isSkip:!1,targetX:new t(Math.log10(i.div(o).toNumber())).minus(-1).div(2).multipliedBy(l).toNumber(),baseMin:m,zoomMultiples:1}}return{isSkip:!1,targetX:-1,baseMin:new t(0),zoomMultiples:1}}function f({midPrice:e,zoomMultiples:t}){return e.multipliedBy(10**-t)}export{a,p as b,u as c,c as d,r as e,f,o as g,n as h,d as i,b as j,h as k,l,s as m,m as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i18n as e}from"@lingui/core";import t from"bignumber.js";import{f as i}from"./index-
|
|
1
|
+
import{i18n as e}from"@lingui/core";import t from"bignumber.js";import{f as i}from"./index-BJITf9wa.js";function o(t,i){switch(t){case"depth-chart.tips.buy":return e._({id:"q+Q952",message:"Users pay {0} {1} and receive {2} {3}\\nPrice {4} ({5}%)",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol,4:i.priceText,5:i.slippageText}});case"depth-chart.tips.mid-price":return e._({id:"cnbRVW",message:"Initial Price {0} {1} = {2} {3}",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol}});case"depth-chart.tips.sell":return e._({id:"q+Q952",message:"Users pay {0} {1} and receive {2} {3}\\nPrice {4} ({5}%)",values:{0:i.oppositeAmountText,1:i.quoteTokenSymbol,2:i.amountText,3:i.baseTokenSymbol,4:i.priceText,5:i.slippageText}});case"pool.chart.buy-amount":return e._({id:"TaScUS",message:"Users sell {0} amount:",values:{0:i.symbol}});case"pool.chart.price-impact":return e._({id:"I0LXan",message:"Price Impact: {0}",values:{0:i.amount}});case"pool.chart.sell-amount":return e._({id:"F2vX4t",message:"Users buy {0} amount:",values:{0:i.symbol}});case"pool.create.disabled-token-amount":return e._({id:"5QDjef",message:"The token amount is calculated by initial price."});case"pool.create.set-pool.emulator.title":return e._({id:"FQfStS",message:"Emulator"});case"pool.create.set-pool.emulator.title.question":return e._({id:"9D2g7k",message:"The liquidity of DODO is continuous, which is different from the discrete liquidity of UniV3. The ticks shown in the illustration are for demonstration purposes only."});case"pool.chart.liquidity-chart-tip":return e._({id:"YvXHDU",message:"The area of the chart indicates the buy/sell volume of {0} that can be carried by the market when the current price changes to the hover price.",values:{0:i.baseTokenSymbol}});case"pool.chart.liquidity-chart-buy":return e._({id:"TvH4Ym",message:"Bought {0} {1}, price in the pool decreased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});case"pool.chart.liquidity-chart-sell":return e._({id:"0O1wzf",message:"Traders sold {0} {1}, price in the pool increased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});default:throw new Error(`Unknown key ${t}`)}}const l=12,n=18;function s(e){let t=e.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(4===t.length){let e="#";for(let i=1;i<4;i+=1)e+=t.slice(i,i+1).concat(t.slice(i,i+1));t=e}const e=[];for(let i=1;i<7;i+=2)e.push(parseInt(`0x${t.slice(i,i+2)}`));return e.join(",")}return t}function r({val:e,model:i}){let o=e;if(e.isNaN())return{side:"no-one",vert:new t(0),base:new t(0),quote:new t(0)};i.Q0.eq(0)&&e.lt(i.i)&&(o=i.i),i.B0.eq(0)&&e.gt(i.i)&&(o=i.i);const l=i.getPriceDepth(o),n=l.baseAmount,s=l.quoteAmount,{isBuy:r}=l;return{side:r?"ask":"bid",vert:r?n:s,base:n,quote:s}}function a({midPrice:e,q:i,q0:o,pmmModel:l}){let n=t.maximum(i,o,l.B.multipliedBy(e));return n.isNaN()&&(n=new t(10)),n.eq(0)&&(n=new t(1)),{buyBaseVert:n.multipliedBy(1.2),sellBaseVert:n.div(e).multipliedBy(1.2)}}function u(e,i=1){return new t(i).div(e/2)}function m({tooltip:e,x:o,chartWidth:l,chartHeight:n,buyBaseVert:a,sellBaseVert:m,pmmModel:p,midPrice:d,baseTokenSymbol:c,quoteTokenSymbol:h,t:b,baseMinAndZoomMultiples:f,isHover:y,color:g,leftColor:T,rightColor:x}){const{zoomMultiples:v,baseMin:w}=f,k=u(l,v),M=a.div(n),B=m.div(n),q=2*v,S=w.multipliedBy(10**k.multipliedBy(o).toNumber());let N=new t(Math.log(d.div(w).toNumber())/Math.log(10));N=t.minimum(q,N),N=t.maximum(0,N);const P=N.div(k),X=r({val:S,model:p,midPrice:d});if(X.vert.isNaN())return;const A=S.lt(d);let _=n-X.vert.div(M).toNumber();A||(_=n-X.vert.div(B).toNumber());const z=i(S),O=i(X.vert),$=S.minus(d).abs().div(d).multipliedBy(100).toFixed(2),D=P.toNumber(),H=e.findOne("#toolTipVertLine"),L=e.findOne("#toolTipHoriLine"),U=e.findOne("#joinCircle"),V=e.findOne("#toolTip"),j=e.findOne("#priceTextLabel"),W=e.findOne("#slippageTextLabel");if(!V)return;V.x(o),V.y(_-5-6);const Y=V.getText(),F=V.getTag();let I="ask"===X.side?i(X.quote):i(X.base);const Q=p.k.lte(0);Q&&(I=O);const C=i(d),Z={amountText:O,baseTokenSymbol:c,oppositeAmountText:I,quoteTokenSymbol:h,priceText:Q?C:z,slippageText:`${A?"-":"+"}${$}`};if(P.minus(4).lte(o)&&P.plus(2).gte(o)&&y)Y.text(b("depth-chart.tips.mid-price",{amountText:1,baseTokenSymbol:c,oppositeAmountText:C,quoteTokenSymbol:h})),V.x(D),V.y(n/2),null==H||H.hide(),null==L||L.hide(),null==U||U.hide(),null==j||j.hide(),null==W||W.hide();else{Y.text(A?b("depth-chart.tips.buy",{amountText:I,baseTokenSymbol:c,oppositeAmountText:O,quoteTokenSymbol:h,priceText:Q?C:z,slippageText:`${A?"-":"+"}${$}`}):b("depth-chart.tips.sell",Z));const e=g||(A?"#55f6db":"#ff4f73"),t=A?T||"#55f6db":x||"#ff4f73";Y.fill(e),V.width()/2>o?(F.pointerDirection("left"),F.pointerHeight(15),F.pointerWidth(8),V.offsetX(-11),V.offsetY(-11)):V.width()/2+o>l?(F.pointerDirection("right"),F.pointerHeight(15),F.pointerWidth(8),V.offsetX(11),V.offsetY(-11)):(F.pointerDirection("down"),F.pointerHeight(8),F.pointerWidth(15),V.offsetX(0),V.offsetY(0)),null==H||H.points([o,n,o,_]),null==H||H.stroke(t),null==L||L.points(A?[o,_,D,_]:[D,_,o,_]),null==L||L.stroke(t),null==U||U.x(o),null==U||U.y(_),null==U||U.fill(A?T||"rgb(86, 246, 218)":x||"#FF5072"),null==U||U.stroke(A?T?`rgba(${s(T)}, 0.4)`:"rgba(86, 246, 218, 0.3)":x?`rgba(${s(x)}, 0.4)`:"rgba(255, 80, 114, 0.3)"),j&&(j.x(o),j.y(n),j.offsetX(j.width()/2),j.x()-j.width()/2<0?j.x(j.width()/2):j.x()+j.width()/2>l?j.x(l-j.width()/2):j.x(o));const i=null==j?void 0:j.findOne("#priceTextLabel-text");i&&(i.fill(e),i.text(z)),W&&(W.x(A?o+(D-o)/2:o-(o-D)/2),W.y(_),W.offsetY(W.height()/2),W.offsetX(W.width()/2));const r=null==W?void 0:W.findOne("#slippageTextLabel-text");r&&(r.fill(e),r.text(`${A?"-":"+"}${$}%`)),null==H||H.show(),null==L||L.show(),null==U||U.show(),null==j||j.show(),null==W||W.show()}e.show()}function p({dragDistance:e,prevBaseMin:i,chartWidth:o,zoomMultiples:l}){const n=u(o,l);return e>0?i.multipliedBy(1-n.multipliedBy(e).toNumber()):i.multipliedBy(10**n.multipliedBy(new t(e).abs()).plus(0).toNumber())}const d=1;function c({prevZoomMultiples:e,zoomIn:t}){return!t&&e<=.1?e:t?e+.1:e-.1}function h({type:e,targetPrice:i,midPrice:o,width:l}){if("sell"===e){return{zoomMultiples:new t(Math.log10(i.div(o).toNumber())).minus(0).div(3/4).abs(),targetX:l/2*(3/4)+l/2}}const n=new t(Math.log10(i.div(o).toNumber()));return{zoomMultiples:new t(0).minus(n).div(3/4).abs(),targetX:l/2*(1/4)}}function b({currentBaseMinAndZoomMultiples:e,targetPrice:i,midPrice:o,width:l}){const{baseMin:n,zoomMultiples:s}=e,r=new t(Math.log10(n.div(o).toNumber())),a=r.plus(2*s),u=new t(o.multipliedBy(10**a.toNumber()));if(i.gte(n)&&i.lte(u)){return{isSkip:!0,targetX:new t(Math.log10(i.div(o).toNumber())).minus(r).div(2*s).multipliedBy(l).toNumber(),baseMin:new t(0),zoomMultiples:1}}const m=new t(o.multipliedBy(.1)),p=new t(o.multipliedBy(10));if(i.gte(m)&&i.lte(p)){return{isSkip:!1,targetX:new t(Math.log10(i.div(o).toNumber())).minus(-1).div(2).multipliedBy(l).toNumber(),baseMin:m,zoomMultiples:1}}return{isSkip:!1,targetX:-1,baseMin:new t(0),zoomMultiples:1}}function f({midPrice:e,zoomMultiples:t}){return e.multipliedBy(10**-t)}export{a,p as b,u as c,c as d,r as e,f,o as g,n as h,d as i,b as j,h as k,l,s as m,m as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i18n as e}from"@lingui/core";import t from"bignumber.js";import{f as i}from"./index-
|
|
1
|
+
import{i18n as e}from"@lingui/core";import t from"bignumber.js";import{f as i}from"./index-CsmjYFZZ.js";function o(t,i){switch(t){case"depth-chart.tips.buy":return e._({id:"q+Q952",message:"Users pay {0} {1} and receive {2} {3}\\nPrice {4} ({5}%)",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol,4:i.priceText,5:i.slippageText}});case"depth-chart.tips.mid-price":return e._({id:"cnbRVW",message:"Initial Price {0} {1} = {2} {3}",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol}});case"depth-chart.tips.sell":return e._({id:"q+Q952",message:"Users pay {0} {1} and receive {2} {3}\\nPrice {4} ({5}%)",values:{0:i.oppositeAmountText,1:i.quoteTokenSymbol,2:i.amountText,3:i.baseTokenSymbol,4:i.priceText,5:i.slippageText}});case"pool.chart.buy-amount":return e._({id:"TaScUS",message:"Users sell {0} amount:",values:{0:i.symbol}});case"pool.chart.price-impact":return e._({id:"I0LXan",message:"Price Impact: {0}",values:{0:i.amount}});case"pool.chart.sell-amount":return e._({id:"F2vX4t",message:"Users buy {0} amount:",values:{0:i.symbol}});case"pool.create.disabled-token-amount":return e._({id:"5QDjef",message:"The token amount is calculated by initial price."});case"pool.create.set-pool.emulator.title":return e._({id:"FQfStS",message:"Emulator"});case"pool.create.set-pool.emulator.title.question":return e._({id:"9D2g7k",message:"The liquidity of DODO is continuous, which is different from the discrete liquidity of UniV3. The ticks shown in the illustration are for demonstration purposes only."});case"pool.chart.liquidity-chart-tip":return e._({id:"YvXHDU",message:"The area of the chart indicates the buy/sell volume of {0} that can be carried by the market when the current price changes to the hover price.",values:{0:i.baseTokenSymbol}});case"pool.chart.liquidity-chart-buy":return e._({id:"TvH4Ym",message:"Bought {0} {1}, price in the pool decreased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});case"pool.chart.liquidity-chart-sell":return e._({id:"0O1wzf",message:"Traders sold {0} {1}, price in the pool increased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});default:throw new Error(`Unknown key ${t}`)}}const l=12,n=18;function s(e){let t=e.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(4===t.length){let e="#";for(let i=1;i<4;i+=1)e+=t.slice(i,i+1).concat(t.slice(i,i+1));t=e}const e=[];for(let i=1;i<7;i+=2)e.push(parseInt(`0x${t.slice(i,i+2)}`));return e.join(",")}return t}function r({val:e,model:i}){let o=e;if(e.isNaN())return{side:"no-one",vert:new t(0),base:new t(0),quote:new t(0)};i.Q0.eq(0)&&e.lt(i.i)&&(o=i.i),i.B0.eq(0)&&e.gt(i.i)&&(o=i.i);const l=i.getPriceDepth(o),n=l.baseAmount,s=l.quoteAmount,{isBuy:r}=l;return{side:r?"ask":"bid",vert:r?n:s,base:n,quote:s}}function a({midPrice:e,q:i,q0:o,pmmModel:l}){let n=t.maximum(i,o,l.B.multipliedBy(e));return n.isNaN()&&(n=new t(10)),n.eq(0)&&(n=new t(1)),{buyBaseVert:n.multipliedBy(1.2),sellBaseVert:n.div(e).multipliedBy(1.2)}}function u(e,i=1){return new t(i).div(e/2)}function m({tooltip:e,x:o,chartWidth:l,chartHeight:n,buyBaseVert:a,sellBaseVert:m,pmmModel:p,midPrice:d,baseTokenSymbol:c,quoteTokenSymbol:h,t:b,baseMinAndZoomMultiples:f,isHover:y,color:g,leftColor:T,rightColor:x}){const{zoomMultiples:v,baseMin:w}=f,k=u(l,v),M=a.div(n),B=m.div(n),q=2*v,S=w.multipliedBy(10**k.multipliedBy(o).toNumber());let N=new t(Math.log(d.div(w).toNumber())/Math.log(10));N=t.minimum(q,N),N=t.maximum(0,N);const P=N.div(k),X=r({val:S,model:p,midPrice:d});if(X.vert.isNaN())return;const A=S.lt(d);let _=n-X.vert.div(M).toNumber();A||(_=n-X.vert.div(B).toNumber());const z=i(S),O=i(X.vert),$=S.minus(d).abs().div(d).multipliedBy(100).toFixed(2),D=P.toNumber(),H=e.findOne("#toolTipVertLine"),L=e.findOne("#toolTipHoriLine"),U=e.findOne("#joinCircle"),V=e.findOne("#toolTip"),j=e.findOne("#priceTextLabel"),W=e.findOne("#slippageTextLabel");if(!V)return;V.x(o),V.y(_-5-6);const Y=V.getText(),F=V.getTag();let I="ask"===X.side?i(X.quote):i(X.base);const Q=p.k.lte(0);Q&&(I=O);const C=i(d),Z={amountText:O,baseTokenSymbol:c,oppositeAmountText:I,quoteTokenSymbol:h,priceText:Q?C:z,slippageText:`${A?"-":"+"}${$}`};if(P.minus(4).lte(o)&&P.plus(2).gte(o)&&y)Y.text(b("depth-chart.tips.mid-price",{amountText:1,baseTokenSymbol:c,oppositeAmountText:C,quoteTokenSymbol:h})),V.x(D),V.y(n/2),null==H||H.hide(),null==L||L.hide(),null==U||U.hide(),null==j||j.hide(),null==W||W.hide();else{Y.text(A?b("depth-chart.tips.buy",{amountText:I,baseTokenSymbol:c,oppositeAmountText:O,quoteTokenSymbol:h,priceText:Q?C:z,slippageText:`${A?"-":"+"}${$}`}):b("depth-chart.tips.sell",Z));const e=g||(A?"#55f6db":"#ff4f73"),t=A?T||"#55f6db":x||"#ff4f73";Y.fill(e),V.width()/2>o?(F.pointerDirection("left"),F.pointerHeight(15),F.pointerWidth(8),V.offsetX(-11),V.offsetY(-11)):V.width()/2+o>l?(F.pointerDirection("right"),F.pointerHeight(15),F.pointerWidth(8),V.offsetX(11),V.offsetY(-11)):(F.pointerDirection("down"),F.pointerHeight(8),F.pointerWidth(15),V.offsetX(0),V.offsetY(0)),null==H||H.points([o,n,o,_]),null==H||H.stroke(t),null==L||L.points(A?[o,_,D,_]:[D,_,o,_]),null==L||L.stroke(t),null==U||U.x(o),null==U||U.y(_),null==U||U.fill(A?T||"rgb(86, 246, 218)":x||"#FF5072"),null==U||U.stroke(A?T?`rgba(${s(T)}, 0.4)`:"rgba(86, 246, 218, 0.3)":x?`rgba(${s(x)}, 0.4)`:"rgba(255, 80, 114, 0.3)"),j&&(j.x(o),j.y(n),j.offsetX(j.width()/2),j.x()-j.width()/2<0?j.x(j.width()/2):j.x()+j.width()/2>l?j.x(l-j.width()/2):j.x(o));const i=null==j?void 0:j.findOne("#priceTextLabel-text");i&&(i.fill(e),i.text(z)),W&&(W.x(A?o+(D-o)/2:o-(o-D)/2),W.y(_),W.offsetY(W.height()/2),W.offsetX(W.width()/2));const r=null==W?void 0:W.findOne("#slippageTextLabel-text");r&&(r.fill(e),r.text(`${A?"-":"+"}${$}%`)),null==H||H.show(),null==L||L.show(),null==U||U.show(),null==j||j.show(),null==W||W.show()}e.show()}function p({dragDistance:e,prevBaseMin:i,chartWidth:o,zoomMultiples:l}){const n=u(o,l);return e>0?i.multipliedBy(1-n.multipliedBy(e).toNumber()):i.multipliedBy(10**n.multipliedBy(new t(e).abs()).plus(0).toNumber())}const d=1;function c({prevZoomMultiples:e,zoomIn:t}){return!t&&e<=.1?e:t?e+.1:e-.1}function h({type:e,targetPrice:i,midPrice:o,width:l}){if("sell"===e){return{zoomMultiples:new t(Math.log10(i.div(o).toNumber())).minus(0).div(3/4).abs(),targetX:l/2*(3/4)+l/2}}const n=new t(Math.log10(i.div(o).toNumber()));return{zoomMultiples:new t(0).minus(n).div(3/4).abs(),targetX:l/2*(1/4)}}function b({currentBaseMinAndZoomMultiples:e,targetPrice:i,midPrice:o,width:l}){const{baseMin:n,zoomMultiples:s}=e,r=new t(Math.log10(n.div(o).toNumber())),a=r.plus(2*s),u=new t(o.multipliedBy(10**a.toNumber()));if(i.gte(n)&&i.lte(u)){return{isSkip:!0,targetX:new t(Math.log10(i.div(o).toNumber())).minus(r).div(2*s).multipliedBy(l).toNumber(),baseMin:new t(0),zoomMultiples:1}}const m=new t(o.multipliedBy(.1)),p=new t(o.multipliedBy(10));if(i.gte(m)&&i.lte(p)){return{isSkip:!1,targetX:new t(Math.log10(i.div(o).toNumber())).minus(-1).div(2).multipliedBy(l).toNumber(),baseMin:m,zoomMultiples:1}}return{isSkip:!1,targetX:-1,baseMin:new t(0),zoomMultiples:1}}function f({midPrice:e,zoomMultiples:t}){return e.multipliedBy(10**-t)}export{a,p as b,u as c,c as d,r as e,f,o as g,n as h,d as i,b as j,h as k,l,s as m,m as u};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function useCurrentChainId(): ChainId;
|
|
1
|
+
export declare function useCurrentChainId(): import("@dodoex/api").ChainId;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
1
2
|
export declare function useWalletInfo(): {
|
|
2
3
|
account: string | undefined;
|
|
3
|
-
chainId:
|
|
4
|
+
chainId: ChainId;
|
|
4
5
|
connectedChainId: number | undefined;
|
|
5
|
-
defaultChainId:
|
|
6
|
+
defaultChainId: ChainId | undefined;
|
|
6
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
|
-
declare type BalanceData = {
|
|
2
|
+
export declare type BalanceData = {
|
|
3
3
|
[address: string]: string;
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
@@ -10,6 +10,7 @@ declare type BalanceData = {
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const useBalanceUpdateLoading: () => {
|
|
12
12
|
balanceData: BalanceData;
|
|
13
|
+
balanceDataDone: BalanceData;
|
|
13
14
|
isTokenLoading: (address: string, balance: BigNumber | number | string) => boolean;
|
|
15
|
+
isTokenLoadingDone: (address: string, balance: BigNumber | number | string) => boolean;
|
|
14
16
|
};
|
|
15
|
-
export {};
|
|
@@ -5,6 +5,7 @@ export interface ExecutionProps {
|
|
|
5
5
|
onTxFail?: (error: Error, data: any) => void;
|
|
6
6
|
onTxSubmit?: (tx: string, data: any) => void;
|
|
7
7
|
onTxSuccess?: (tx: string, data: any) => void;
|
|
8
|
+
onTxReverted?: (tx: string, data: any) => void;
|
|
8
9
|
executionStatus?: {
|
|
9
10
|
showing?: Showing | null;
|
|
10
11
|
showingDone?: boolean;
|
|
@@ -14,7 +15,7 @@ export interface ExecutionProps {
|
|
|
14
15
|
closeShowing?: () => void;
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
|
-
export default function useExecution({ onTxFail, onTxSubmit, onTxSuccess, }?: ExecutionProps): {
|
|
18
|
+
export default function useExecution({ onTxFail, onTxSubmit, onTxSuccess, onTxReverted, }?: ExecutionProps): {
|
|
18
19
|
showing: Showing | null;
|
|
19
20
|
showingDone: boolean;
|
|
20
21
|
transactionTx: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BigNumber as EthersBigNumber } from '@ethersproject/bignumber';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export default function useExecuteSwap(): ({ to, data, useSource, duration, ddl, gasLimit, subtitle, value, }: {
|
|
3
|
+
export default function useExecuteSwap(): ({ to, data, useSource, duration, ddl, gasLimit, subtitle, value, mixpanelProps, }: {
|
|
4
4
|
value: string;
|
|
5
5
|
to: string;
|
|
6
6
|
data: string;
|
|
@@ -9,4 +9,5 @@ export default function useExecuteSwap(): ({ to, data, useSource, duration, ddl,
|
|
|
9
9
|
ddl: number;
|
|
10
10
|
gasLimit?: EthersBigNumber | undefined;
|
|
11
11
|
subtitle: React.ReactNode;
|
|
12
|
+
mixpanelProps?: Record<string, any> | undefined;
|
|
12
13
|
}) => void;
|
|
@@ -13,6 +13,7 @@ export interface FetchRoutePrice {
|
|
|
13
13
|
fromAmount: string;
|
|
14
14
|
toAmount: string;
|
|
15
15
|
estimateGas?: boolean;
|
|
16
|
+
isReverseRouting?: boolean;
|
|
16
17
|
}
|
|
17
18
|
interface IRouteResponse {
|
|
18
19
|
resAmount: number;
|
|
@@ -27,7 +28,7 @@ interface IRouteResponse {
|
|
|
27
28
|
useSource: string;
|
|
28
29
|
duration: number;
|
|
29
30
|
}
|
|
30
|
-
export declare function useFetchRoutePrice({ toToken, fromToken, fromAmount, toAmount, marginAmount, estimateGas, }: FetchRoutePrice): {
|
|
31
|
+
export declare function useFetchRoutePrice({ toToken, fromToken, fromAmount, toAmount, marginAmount, estimateGas, isReverseRouting, }: FetchRoutePrice): {
|
|
31
32
|
status: RoutePriceStatus;
|
|
32
33
|
rawBrief: IRouteResponse | null;
|
|
33
34
|
refetch: () => Promise<void>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TokenInfo } from '../Token';
|
|
3
|
-
export declare function useInitDefaultToken({ fromToken, toToken, setFromToken, setToToken, updateFromAmt, updateToAmt, }: {
|
|
3
|
+
export declare function useInitDefaultToken({ fromToken, toToken, setFromToken, setToToken, updateFromAmt, updateToAmt, setIsReverseRouting, }: {
|
|
4
4
|
fromToken: TokenInfo | null;
|
|
5
5
|
toToken: TokenInfo | null;
|
|
6
6
|
setFromToken: (value: React.SetStateAction<TokenInfo | null>) => void;
|
|
7
7
|
setToToken: (value: React.SetStateAction<TokenInfo | null>) => void;
|
|
8
8
|
updateFromAmt: (v: string | number) => void;
|
|
9
9
|
updateToAmt: (v: string | number) => void;
|
|
10
|
+
setIsReverseRouting: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
11
|
}): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { TokenInfo } from './type';
|
|
3
|
-
export declare function useTokenStatus(token: TokenInfo | undefined | null, { amount, contractAddress, offset, overrideBalance,
|
|
3
|
+
export declare function useTokenStatus(token: TokenInfo | undefined | null, { amount, contractAddress, offset, overrideBalance, skipQuery, }?: {
|
|
4
4
|
amount?: string | number | BigNumber;
|
|
5
5
|
contractAddress?: string;
|
|
6
6
|
offset?: BigNumber;
|
|
7
7
|
overrideBalance?: BigNumber | null;
|
|
8
|
-
|
|
8
|
+
skipQuery?: boolean;
|
|
9
9
|
}): {
|
|
10
10
|
isApproving: boolean;
|
|
11
11
|
isGetApproveLoading: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from"bignumber.js";import{merge as t,throttle as i,debounce as o}from"lodash";import r,{useEffect as n,useMemo as l,useRef as s,useState as a}from"react";import d from"@emotion/styled";import{css as u}from"@emotion/react";import{Stage as c,Layer as p,Rect as m,Line as g,Text as h,Circle as b,Label as f,Tag as M}from"react-konva";import{c as x,e as v,a as y,b as P,d as j,f as w,u as z,g as L,h as k,l as B,i as C,j as S,k as N}from"./helper-
|
|
1
|
+
import e from"bignumber.js";import{merge as t,throttle as i,debounce as o}from"lodash";import r,{useEffect as n,useMemo as l,useRef as s,useState as a}from"react";import d from"@emotion/styled";import{css as u}from"@emotion/react";import{Stage as c,Layer as p,Rect as m,Line as g,Text as h,Circle as b,Label as f,Tag as M}from"react-konva";import{c as x,e as v,a as y,b as P,d as j,f as w,u as z,g as L,h as k,l as B,i as C,j as S,k as N}from"./helper-CffQwkVy.js";import{f as O,j as X,a as T,b as A}from"./index-BJITf9wa.js";import{solveQuadraticFunctionForTarget as q,PMMModel as W}from"@dodoex/api";import"@lingui/core";import"@lingui/react";import"react-dom";import"react-redux";import"identicon.js";import"@web3-react/core";import"@web3-react/eip1193";import"@web3-react/walletconnect-v2";import"@web3-react/metamask";import"@web3-react/types";import"@reduxjs/toolkit";import"redux";import"@tanstack/react-query";import"react-window";import"@ethersproject/bignumber";import"dayjs";import"axios";import"zustand";import"react-infinite-scroller";import"recharts";var E={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},F=r.createContext&&r.createContext(E),H=["attr","size","title"];function Z(e,t){if(null==e)return{};var i,o,r=function(e,t){if(null==e)return{};var i,o,r={},n=Object.keys(e);for(o=0;o<n.length;o++)i=n[o],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o<n.length;o++)i=n[o],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},G.apply(this,arguments)}function D(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function J(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?D(Object(i),!0).forEach((function(t){V(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function V(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var o=i.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Y(e){return e&&e.map(((e,t)=>r.createElement(e.tag,J({key:t},e.attr),Y(e.child))))}function I(e){return t=>r.createElement(R,G({attr:J({},e.attr)},t),Y(e.child))}function R(e){var t=t=>{var i,{attr:o,size:n,title:l}=e,s=Z(e,H),a=n||t.size||"1em";return t.className&&(i=t.className),e.className&&(i=(i?i+" ":"")+e.className),r.createElement("svg",G({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,s,{className:i,style:J(J({color:e.color||t.color},t.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),l&&r.createElement("title",null,l),e.children)};return void 0!==F?r.createElement(F.Consumer,null,(e=>t(e))):t(E)}function $(e){return I({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13.293 6.293 7.586 12l5.707 5.707 1.414-1.414L10.414 12l4.293-4.293z"},child:[]}]})(e)}function Q(e){return I({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10.707 17.707 16.414 12l-5.707-5.707-1.414 1.414L13.586 12l-4.293 4.293z"},child:[]}]})(e)}function K(e){return I({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5 11h14v2H5z"},child:[]}]})(e)}function U(e){return I({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"},child:[]}]})(e)}const _=d.input`
|
|
2
2
|
margin: 4px 10px 4px 6px;
|
|
3
3
|
border-radius: 10px;
|
|
4
4
|
border: 1px solid #373739;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import t from"@emotion/styled";import{merge as e}from"lodash";import{useMemo as i,useRef as n}from"react";import{l as r,g as o,m as l}from"./helper-
|
|
1
|
+
import t from"@emotion/styled";import{merge as e}from"lodash";import{useMemo as i,useRef as n}from"react";import{l as r,g as o,m as l}from"./helper-CffQwkVy.js";import{Line as a,Text as s,Stage as d,Layer as g,Rect as m,Circle as u,Label as h,Tag as p}from"react-konva";import{j as c,f}from"./index-BJITf9wa.js";import x from"bignumber.js";import{solveQuadraticFunctionForTarget as L,PMMState as w,PMMHelper as A}from"@dodoex/api";import"@lingui/core";import"@lingui/react";import"react-dom";import"react-redux";import"identicon.js";import"@web3-react/core";import"@web3-react/eip1193";import"@web3-react/walletconnect-v2";import"@web3-react/metamask";import"@web3-react/types";import"@reduxjs/toolkit";import"redux";import"@tanstack/react-query";import"react-window";import"@ethersproject/bignumber";import"dayjs";import"axios";import"zustand";import"react-infinite-scroller";import"recharts";const b=t.div`
|
|
2
2
|
height: 100%;
|
|
3
3
|
position: relative;
|
|
4
4
|
`,y=t.div`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import t from"@emotion/styled";import{merge as e}from"lodash";import{useMemo as i,useRef as n}from"react";import{l as r,g as o,m as l}from"./helper-
|
|
1
|
+
import t from"@emotion/styled";import{merge as e}from"lodash";import{useMemo as i,useRef as n}from"react";import{l as r,g as o,m as l}from"./helper-Bt2jqmHJ.js";import{Line as a,Text as s,Stage as d,Layer as g,Rect as m,Circle as u,Label as h,Tag as p}from"react-konva";import{j as c,f}from"./index-C9MWtFb0.js";import x from"bignumber.js";import{solveQuadraticFunctionForTarget as L,PMMState as w,PMMHelper as A}from"@dodoex/api";import"@lingui/core";import"@lingui/react";import"react-dom";import"react-redux";import"identicon.js";import"@web3-react/core";import"@web3-react/eip1193";import"@web3-react/walletconnect-v2";import"@web3-react/metamask";import"@web3-react/types";import"@reduxjs/toolkit";import"redux";import"@tanstack/react-query";import"react-window";import"@ethersproject/bignumber";import"dayjs";import"axios";import"zustand";import"react-infinite-scroller";import"recharts";const b=t.div`
|
|
2
2
|
height: 100%;
|
|
3
3
|
position: relative;
|
|
4
4
|
`,y=t.div`
|