@dodoex/widgets 3.20.0-alpha.1 → 3.20.0-cp.2
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-DHlCN-58.cjs → helper-BmahOTDE.cjs} +1 -1
- package/dist/{helper-C__Hw6Nv.js → helper-D9RhyhJl.js} +1 -1
- package/dist/{index-1E8fSg97.cjs → index-8x1SIgE_.cjs} +3 -3
- package/dist/index-BAQjyQGv.js +12 -0
- package/dist/index-BZ9xal_S.js +14 -0
- package/dist/{index-CEFnzcQR.js → index-CBydtjuU.js} +10 -10
- package/dist/index-Cp4W1Mhk.cjs +14 -0
- package/dist/{index-LN0r92OR.cjs → index-DdG6d6qj.cjs} +2 -2
- 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/CopyTooltipToast.d.ts +3 -2
- package/dist/types/components/CountdownTime.d.ts +3 -0
- package/dist/types/components/DataTable.d.ts +16 -0
- package/dist/types/components/RiskDialog.d.ts +4 -4
- package/dist/types/components/RiskQuestionDialog.d.ts +13 -0
- package/dist/types/components/Swap/components/TokenCard/EtherTokenSelect.d.ts +8 -0
- package/dist/types/components/Swap/components/TokenCard/index.d.ts +3 -1
- package/dist/types/components/Table.d.ts +5 -1
- package/dist/types/components/Widget/index.d.ts +8 -1
- package/dist/types/constants/api.d.ts +4 -1
- package/dist/types/constants/localstorage.d.ts +7 -2
- package/dist/types/hooks/ConnectWallet/useWalletInfo.d.ts +1 -0
- package/dist/types/hooks/Submission/types.d.ts +10 -1
- package/dist/types/hooks/contract/useSignMessage.d.ts +6 -0
- package/dist/types/hooks/useCPFavorites.d.ts +46 -0
- package/dist/types/hooks/useRiskDialogState.d.ts +6 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/router/types.d.ts +19 -1
- package/dist/types/utils/time.d.ts +2 -0
- package/dist/types/utils/wallet.d.ts +12 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/ConfirmDialog.d.ts +12 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/ErrorTip.d.ts +6 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/IntroSettings.d.ts +14 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/IntroSettingsConfirmDialog.d.ts +15 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/OptionalSettings.d.ts +13 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/PriceSettings.d.ts +12 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/RichTextEditor/index.d.ts +8 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/TimeSettings.d.ts +12 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/Title.d.ts +5 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/hooks/useCreateCrowdpooling.d.ts +6 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/hooks/useCreateCrowdpoolingState.d.ts +28 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/hooks/useGetCPIntro.d.ts +16 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/hooks/useIntroSettingsValidation.d.ts +8 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/hooks/useOptionalSettingsValidation.d.ts +7 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/hooks/usePriceSettingsValidation.d.ts +7 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/hooks/useSaveCPIntro.d.ts +6 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/hooks/useTimeSettingsValidation.d.ts +8 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/hooks/useUploadImages.d.ts +5 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/index.d.ts +2 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/reducers.d.ts +91 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/utils/imageCompression.d.ts +10 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/components/ActionCard.d.ts +8 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/components/BaseInfo.d.ts +6 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/components/CrowdpoolingInfo.d.ts +6 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/components/ProjectInfo.d.ts +4 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/components/RemoveDialog.d.ts +16 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/components/SettleConfirmDialog.d.ts +8 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/components/Timeline.d.ts +12 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/components/TokenInfo.d.ts +6 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/hooks/useBidCp.d.ts +11 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/hooks/useCPDetail.d.ts +13 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/hooks/useCPDynamicStatus.d.ts +9 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/hooks/useClaimCp.d.ts +8 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/hooks/useFetchCpVote.d.ts +214 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/hooks/useRemoveCp.d.ts +11 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/hooks/useSettleCp.d.ts +7 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingDetail/index.d.ts +5 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingList/components/CPCard.d.ts +7 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingList/components/CrowdpoolingOverview.d.ts +5 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingList/components/Dashboard.d.ts +18 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingList/components/LaunchCampaign.d.ts +7 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingList/components/MyCrowdpooling.d.ts +12 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingList/components/NavTabs.d.ts +11 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingList/components/VoteConfirm.d.ts +7 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingList/components/VoteTopList.d.ts +4 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingList/index.d.ts +13 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingPoolDetail/components/CreatorsTable.d.ts +8 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingPoolDetail/components/CrowdpoolingAmountChart.d.ts +5 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingPoolDetail/components/DepthAndLiquidityChart.d.ts +10 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingPoolDetail/components/EmptyChart.d.ts +4 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingPoolDetail/components/ParametersTable.d.ts +10 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingPoolDetail/components/SwapsTable.d.ts +7 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingPoolDetail/hooks/useCPPmmState.d.ts +17 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingPoolDetail/index.d.ts +5 -0
- package/dist/types/widgets/CrowdpoolingWidget/MyCrowdpoolingList/components/OperationButton.d.ts +7 -0
- package/dist/types/widgets/CrowdpoolingWidget/MyCrowdpoolingList/components/PriceCell.d.ts +9 -0
- package/dist/types/widgets/CrowdpoolingWidget/MyCrowdpoolingList/components/ProgressCell.d.ts +8 -0
- package/dist/types/widgets/CrowdpoolingWidget/MyCrowdpoolingList/components/StatusTag.d.ts +13 -0
- package/dist/types/widgets/CrowdpoolingWidget/MyCrowdpoolingList/hooks/useMyCPList.d.ts +1 -0
- package/dist/types/widgets/CrowdpoolingWidget/MyCrowdpoolingList/index.d.ts +1 -0
- package/dist/types/widgets/CrowdpoolingWidget/helper.d.ts +29 -0
- package/dist/types/widgets/CrowdpoolingWidget/hooks/useCpCountdownTime.d.ts +14 -0
- package/dist/types/widgets/CrowdpoolingWidget/index.d.ts +1 -0
- package/dist/types/widgets/CrowdpoolingWidget/types.d.ts +105 -0
- package/dist/types/widgets/MiningWidget/MiningList/utils.d.ts +2 -2
- package/dist/types/widgets/PoolWidget/PoolDetail/components/StatBarChart.d.ts +13 -7
- package/dist/{assets/bundle-BBymdwHN.css → widgets.css} +4 -0
- package/package.json +8 -3
- package/dist/index-C3eOZR2q.js +0 -14
- package/dist/index-C4PCWK26.js +0 -12
- package/dist/index-CoDKjBJD.cjs +0 -14
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export default function EtherTokenSelect({ chainId, token, onTokenChange, children, }: React.PropsWithChildren<{
|
|
5
|
+
chainId: ChainId | undefined;
|
|
6
|
+
token: TokenInfo | undefined | null;
|
|
7
|
+
onTokenChange?: (token: TokenInfo, isOccupied: boolean) => void;
|
|
8
|
+
}>): React.JSX.Element;
|
|
@@ -34,7 +34,9 @@ export interface TokenCardProps {
|
|
|
34
34
|
hideToken?: boolean;
|
|
35
35
|
checkLogBalance?: BalanceData;
|
|
36
36
|
notTokenPickerModal?: boolean;
|
|
37
|
+
hiddenAddrs?: string[];
|
|
38
|
+
onlyChangeEtherToken?: boolean;
|
|
37
39
|
}
|
|
38
40
|
export declare function CardPlus(): import("react").JSX.Element;
|
|
39
41
|
export declare function CardPlusConnected(): import("react").JSX.Element;
|
|
40
|
-
export declare function TokenCard({ sx, inputSx, 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, notTokenPickerModal, }: TokenCardProps): import("react").JSX.Element;
|
|
42
|
+
export declare function TokenCard({ sx, inputSx, 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, notTokenPickerModal, hiddenAddrs, onlyChangeEtherToken, }: TokenCardProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { BoxProps } from '@dodoex/components';
|
|
2
|
-
export default function Table({ sx, children, hasMore, loadMore, loadMoreLoading, ...props }: BoxProps & {
|
|
2
|
+
export default function Table({ sx, children, empty, hasSearch, errorRefetch, loading, hasMore, loadMore, loadMoreLoading, ...props }: BoxProps & {
|
|
3
|
+
empty?: boolean;
|
|
4
|
+
hasSearch?: boolean;
|
|
5
|
+
errorRefetch?: () => void;
|
|
6
|
+
loading?: boolean;
|
|
3
7
|
hasMore?: boolean;
|
|
4
8
|
loadMore?: () => void;
|
|
5
9
|
loadMoreLoading?: boolean;
|
|
@@ -9,7 +9,7 @@ import { DefaultTokenInfo, TokenInfo } from '../../hooks/Token/type';
|
|
|
9
9
|
import { InitTokenListProps } from '../../hooks/Token/useInitTokenList';
|
|
10
10
|
import { ConfirmProps } from '../Confirm';
|
|
11
11
|
import { DialogProps } from '../Swap/components/Dialog';
|
|
12
|
-
import { Page } from '../../router';
|
|
12
|
+
import { Page, PageType } from '../../router';
|
|
13
13
|
import { ExecutionCtx } from '../../hooks/Submission/types';
|
|
14
14
|
import { TokenPickerDialogProps } from '../Swap/components/TokenCard/TokenPickerDialog';
|
|
15
15
|
export declare const WIDGET_CLASS_NAME = "dodo-widget-container";
|
|
@@ -94,6 +94,13 @@ export interface WidgetProps extends Web3ConnectorsProps, InitTokenListProps, Ex
|
|
|
94
94
|
deadLine?: number;
|
|
95
95
|
submission?: ExecutionCtx;
|
|
96
96
|
disableConnectedProviderRead?: boolean;
|
|
97
|
+
documentUrls?: {
|
|
98
|
+
termsOfService?: string;
|
|
99
|
+
crowdpoolingList?: string;
|
|
100
|
+
crowdpoolingCreate?: string;
|
|
101
|
+
crowdpoolingWhitelist?: string;
|
|
102
|
+
};
|
|
103
|
+
getPageUrl?: (page: PageType, params?: Record<string, any>) => string;
|
|
97
104
|
}
|
|
98
105
|
export { LangProvider } from '../../providers/i18n';
|
|
99
106
|
export { default as Message } from '../Message';
|
|
@@ -4,7 +4,10 @@ export declare enum APIServiceKey {
|
|
|
4
4
|
fiatPrice = "fiatPrice",
|
|
5
5
|
bridgeRoutePrice = "bridgeRoutePrice",
|
|
6
6
|
bridgeEncode = "bridgeEncode",
|
|
7
|
-
bridgeCreateRoute = "bridgeCreateRoute"
|
|
7
|
+
bridgeCreateRoute = "bridgeCreateRoute",
|
|
8
|
+
cpSetIntro = "cpSetIntro",
|
|
9
|
+
cpUploadImages = "cpUploadImages",
|
|
10
|
+
cpGetDetail = "cpGetDetail"
|
|
8
11
|
}
|
|
9
12
|
export type APIServices = {
|
|
10
13
|
[key in APIServiceKey]: string;
|
|
@@ -10,5 +10,10 @@ export declare function getLastToken(side: TokenInfo['side']): LastTokenCache |
|
|
|
10
10
|
export declare function setLastToken(side: TokenInfo['side'], token: LastTokenCache | null): void;
|
|
11
11
|
export declare function getLastSlippage(isBridge: boolean): number | null;
|
|
12
12
|
export declare function setLastSlippage(isBridge: boolean, slippage: number | string | null): void;
|
|
13
|
-
export declare const
|
|
14
|
-
|
|
13
|
+
export declare const enum RiskOncePageLocalStorageKey {
|
|
14
|
+
PoolEditPage = "pool-edit",
|
|
15
|
+
CPJoinDetail = "cp-join-detail",
|
|
16
|
+
CpJoinEntry = "cp-join-entry"
|
|
17
|
+
}
|
|
18
|
+
export declare function getRiskOncePageStoreageIsOpen(type: RiskOncePageLocalStorageKey, suffix?: string): boolean;
|
|
19
|
+
export declare function setRiskOncePageStoreageIsClose(type: RiskOncePageLocalStorageKey, suffix?: string): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Step as StepSpec } from './spec';
|
|
2
2
|
import { ExecutionProps } from './useExecution';
|
|
3
|
+
import type { TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider';
|
|
3
4
|
export declare enum State {
|
|
4
5
|
Running = 0,
|
|
5
6
|
Success = 1,
|
|
@@ -25,6 +26,11 @@ export declare enum MetadataFlag {
|
|
|
25
26
|
stakeMining = "stakeMining",
|
|
26
27
|
unstakeMining = "unstakeMining",
|
|
27
28
|
claimMining = "claimMining",
|
|
29
|
+
createCrowdpooling = "createCrowdpooling",
|
|
30
|
+
bidCrowdpooling = "bidCrowdpooling",
|
|
31
|
+
claimCrowdpooling = "claimCrowdpooling",
|
|
32
|
+
settleCrowdpooling = "settleCrowdpooling",
|
|
33
|
+
removeCrowdpooling = "removeCrowdpooling",
|
|
28
34
|
submissionCreateMetaKey = "submissionCreateMetaKey",
|
|
29
35
|
approve = "approve",
|
|
30
36
|
reset = "reset"
|
|
@@ -76,7 +82,10 @@ export type ExecutionCtx = {
|
|
|
76
82
|
submittedBack?: () => void;
|
|
77
83
|
mixpanelProps?: Record<string, any>;
|
|
78
84
|
submittedConfirmBack?: () => void;
|
|
79
|
-
successBack?: (tx: string, callback
|
|
85
|
+
successBack?: (tx: string, callback: ExecutionProps['onTxSuccess'] | undefined, params: {
|
|
86
|
+
transaction: TransactionResponse;
|
|
87
|
+
receipt: TransactionReceipt;
|
|
88
|
+
}) => void;
|
|
80
89
|
metadata?: Metadata;
|
|
81
90
|
}) => Promise<ExecutionResult>;
|
|
82
91
|
/**
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
export interface CPFavoriteItem {
|
|
3
|
+
id: string;
|
|
4
|
+
chainId: ChainId;
|
|
5
|
+
}
|
|
6
|
+
interface CPFavoritesState {
|
|
7
|
+
favorites: CPFavoriteItem[];
|
|
8
|
+
}
|
|
9
|
+
export declare const useCPFavorites: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<CPFavoritesState>, "setState" | "persist"> & {
|
|
10
|
+
setState(partial: CPFavoritesState | Partial<CPFavoritesState> | ((state: CPFavoritesState) => CPFavoritesState | Partial<CPFavoritesState>), replace?: false | undefined): unknown;
|
|
11
|
+
setState(state: CPFavoritesState | ((state: CPFavoritesState) => CPFavoritesState), replace: true): unknown;
|
|
12
|
+
persist: {
|
|
13
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<CPFavoritesState, CPFavoritesState, unknown>>) => void;
|
|
14
|
+
clearStorage: () => void;
|
|
15
|
+
rehydrate: () => Promise<void> | void;
|
|
16
|
+
hasHydrated: () => boolean;
|
|
17
|
+
onHydrate: (fn: (state: CPFavoritesState) => void) => () => void;
|
|
18
|
+
onFinishHydration: (fn: (state: CPFavoritesState) => void) => () => void;
|
|
19
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<CPFavoritesState, CPFavoritesState, unknown>>;
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Check if a pool is favorited
|
|
24
|
+
*/
|
|
25
|
+
export declare function isFavorite(favorites: CPFavoriteItem[], id: string, chainId: ChainId): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Add a pool to favorites
|
|
28
|
+
*/
|
|
29
|
+
export declare function addFavorite(id: string, chainId: ChainId): void;
|
|
30
|
+
/**
|
|
31
|
+
* Remove a pool from favorites
|
|
32
|
+
*/
|
|
33
|
+
export declare function removeFavorite(id: string, chainId: ChainId): void;
|
|
34
|
+
/**
|
|
35
|
+
* Toggle favorite status of a pool
|
|
36
|
+
*/
|
|
37
|
+
export declare function toggleFavorite(id: string, chainId: ChainId): void;
|
|
38
|
+
/**
|
|
39
|
+
* Get all favorited pools
|
|
40
|
+
*/
|
|
41
|
+
export declare function getFavorites(): CPFavoriteItem[];
|
|
42
|
+
/**
|
|
43
|
+
* Clear all favorites (for maintenance)
|
|
44
|
+
*/
|
|
45
|
+
export declare function clearFavorites(): void;
|
|
46
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -30,6 +30,11 @@ export { MiningCreate } from './widgets/MiningWidget/MiningCreate';
|
|
|
30
30
|
export { default as AddLiquidityV3 } from './widgets/PoolWidget/AMMV3/AddLiquidityV3';
|
|
31
31
|
export { AMMV3PositionsView } from './widgets/PoolWidget/AMMV3/AMMV3PositionsView';
|
|
32
32
|
export { AMMV3PositionManage } from './widgets/PoolWidget/AMMV3/AMMV3PositionManage';
|
|
33
|
+
export { Crowdpooling } from './widgets/CrowdpoolingWidget';
|
|
34
|
+
export { default as CrowdpoolingList } from './widgets/CrowdpoolingWidget/CrowdpoolingList';
|
|
35
|
+
export { default as CrowdpoolingDetail } from './widgets/CrowdpoolingWidget/CrowdpoolingDetail';
|
|
36
|
+
export { default as CrowdpoolingCreate } from './widgets/CrowdpoolingWidget/CrowdpoolingCreate';
|
|
37
|
+
export { default as MyCrowdpoolingList } from './widgets/CrowdpoolingWidget/MyCrowdpoolingList';
|
|
33
38
|
export { useTokenStatus } from './hooks/Token/useTokenStatus';
|
|
34
39
|
export { default as TokenStatusButton } from './components/TokenStatusButton';
|
|
35
40
|
export { default as TokenPairStatusButton } from './components/TokenPairStatusButton';
|
|
@@ -8,7 +8,12 @@ export declare enum PageType {
|
|
|
8
8
|
MiningList = "miningList",
|
|
9
9
|
MiningDetail = "miningDetail",
|
|
10
10
|
createPoolAMMV2 = "createPoolAMMV2",
|
|
11
|
-
createPoolAMMV3 = "createPoolAMMV3"
|
|
11
|
+
createPoolAMMV3 = "createPoolAMMV3",
|
|
12
|
+
CrowdpoolingList = "crowdpoolingList",
|
|
13
|
+
CrowdpoolingDetail = "crowdpoolingDetail",
|
|
14
|
+
CrowdpoolingPoolDetail = "crowdpoolingPoolDetail",
|
|
15
|
+
CreateCrowdpooling = "createCrowdpooling",
|
|
16
|
+
MyCrowdpoolingList = "myCrowdpoolingList"
|
|
12
17
|
}
|
|
13
18
|
interface PageTypeParams {
|
|
14
19
|
[PageType.Pool]: {
|
|
@@ -40,6 +45,19 @@ interface PageTypeParams {
|
|
|
40
45
|
to?: string;
|
|
41
46
|
fee?: string;
|
|
42
47
|
} | undefined;
|
|
48
|
+
[PageType.CrowdpoolingList]: {
|
|
49
|
+
tab?: 'all' | 'my';
|
|
50
|
+
} | undefined;
|
|
51
|
+
[PageType.CrowdpoolingDetail]: {
|
|
52
|
+
address: string;
|
|
53
|
+
chainId: ChainId;
|
|
54
|
+
};
|
|
55
|
+
[PageType.CrowdpoolingPoolDetail]: {
|
|
56
|
+
address: string;
|
|
57
|
+
chainId: ChainId;
|
|
58
|
+
};
|
|
59
|
+
[PageType.CreateCrowdpooling]: undefined;
|
|
60
|
+
[PageType.MyCrowdpoolingList]: undefined;
|
|
43
61
|
}
|
|
44
62
|
export interface Page<T extends PageType = PageType> {
|
|
45
63
|
type: T;
|
|
@@ -10,3 +10,5 @@ export declare function formatReadableTimeDuration({ start, end, showSecondUnit,
|
|
|
10
10
|
export declare function getTimeText(time: Date, split?: string, { noYear, }?: {
|
|
11
11
|
noYear?: boolean;
|
|
12
12
|
}): string;
|
|
13
|
+
export declare const secondsToDays: (seconds: number) => number;
|
|
14
|
+
export declare const secondsToHour: (seconds: number) => number;
|
|
@@ -6,3 +6,15 @@ export declare const isETHChain: (chainId?: number) => {
|
|
|
6
6
|
isGor: boolean;
|
|
7
7
|
};
|
|
8
8
|
export declare const reloadWindow: (interval?: number) => void;
|
|
9
|
+
interface SignHeaderParams {
|
|
10
|
+
address: string;
|
|
11
|
+
signature: string;
|
|
12
|
+
timestamp: number;
|
|
13
|
+
message?: string;
|
|
14
|
+
type?: 'eip191' | 'eip712' | 'eip1271';
|
|
15
|
+
chainId: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function getSignHeader(params: SignHeaderParams): {
|
|
18
|
+
Authorization: string;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/ConfirmDialog.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StateProps } from '../reducers';
|
|
3
|
+
interface ConfirmDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onConfirm: () => void;
|
|
7
|
+
state: StateProps;
|
|
8
|
+
isSubmitting?: boolean;
|
|
9
|
+
showProjectInfo?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export default function ConfirmDialog({ open, onClose, onConfirm, state, isSubmitting, showProjectInfo, }: ConfirmDialogProps): React.JSX.Element;
|
|
12
|
+
export {};
|
package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/IntroSettings.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StateProps, Types, StepStatus } from '../reducers';
|
|
3
|
+
import { useCreateCrodpooling } from '../hooks/useCreateCrowdpooling';
|
|
4
|
+
interface IntroSettingsProps {
|
|
5
|
+
state: StateProps;
|
|
6
|
+
dispatch: (action: {
|
|
7
|
+
type: Types;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
onChangeStep?: (step: StepStatus) => void;
|
|
11
|
+
mutationCreate: ReturnType<typeof useCreateCrodpooling>;
|
|
12
|
+
}
|
|
13
|
+
export default function IntroSettings({ state, dispatch, mutationCreate, }: IntroSettingsProps): React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IntroSettingsType, Types } from '../reducers';
|
|
3
|
+
interface IntroSettingsConfirmDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
cpAddress: string | undefined;
|
|
7
|
+
introSettings: IntroSettingsType;
|
|
8
|
+
chainId: number | undefined;
|
|
9
|
+
dispatch: (action: {
|
|
10
|
+
type: Types;
|
|
11
|
+
payload: any;
|
|
12
|
+
}) => void;
|
|
13
|
+
}
|
|
14
|
+
export default function IntroSettingsConfirmDialog({ open, onClose, cpAddress, introSettings, chainId, dispatch, }: IntroSettingsConfirmDialogProps): React.JSX.Element;
|
|
15
|
+
export {};
|
package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/OptionalSettings.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StateProps, Types, StepStatus } from '../reducers';
|
|
3
|
+
interface OptionalSettingsProps {
|
|
4
|
+
state: StateProps;
|
|
5
|
+
dispatch: (action: {
|
|
6
|
+
type: Types;
|
|
7
|
+
payload: any;
|
|
8
|
+
}) => void;
|
|
9
|
+
onChangeStep?: (step: StepStatus) => void;
|
|
10
|
+
onConfirmSubmit?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export default function OptionalSettings({ state, dispatch, onChangeStep, onConfirmSubmit, }: OptionalSettingsProps): React.JSX.Element;
|
|
13
|
+
export {};
|
package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/PriceSettings.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StateProps, Types, StepStatus } from '../reducers';
|
|
3
|
+
interface PriceSettingsProps {
|
|
4
|
+
state: StateProps;
|
|
5
|
+
dispatch: (action: {
|
|
6
|
+
type: Types;
|
|
7
|
+
payload: any;
|
|
8
|
+
}) => void;
|
|
9
|
+
onChangeStep?: (step: StepStatus) => void;
|
|
10
|
+
}
|
|
11
|
+
export default function PriceSettings({ state, dispatch, onChangeStep, }: PriceSettingsProps): React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import 'quill/dist/quill.snow.css';
|
|
2
|
+
interface RichTextEditorProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
}
|
|
7
|
+
export default function RichTextEditor({ value, onChange, placeholder, }: RichTextEditorProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StateProps, Types, StepStatus } from '../reducers';
|
|
3
|
+
interface TimeSettingsProps {
|
|
4
|
+
state: StateProps;
|
|
5
|
+
dispatch: (action: {
|
|
6
|
+
type: Types;
|
|
7
|
+
payload: any;
|
|
8
|
+
}) => void;
|
|
9
|
+
onChangeStep?: (step: StepStatus) => void;
|
|
10
|
+
}
|
|
11
|
+
export default function TimeSettings({ state, dispatch, onChangeStep, }: TimeSettingsProps): React.JSX.Element;
|
|
12
|
+
export {};
|
package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/hooks/useCreateCrowdpooling.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StateProps } from '../reducers';
|
|
2
|
+
export declare function useCreateCrodpooling({ state, successBack, submittedBack, }: {
|
|
3
|
+
state: StateProps;
|
|
4
|
+
successBack?: () => void;
|
|
5
|
+
submittedBack?: () => void;
|
|
6
|
+
}): import("@tanstack/react-query").UseMutationResult<string | null | undefined, Error, void, unknown>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Types } from '../reducers';
|
|
2
|
+
export declare const useCreateCrowdpoolingState: () => {
|
|
3
|
+
state: {
|
|
4
|
+
priceSettings: {
|
|
5
|
+
baseToken: import("../../../..").TokenInfo | null;
|
|
6
|
+
quoteToken: import("../../../..").TokenInfo | null;
|
|
7
|
+
baseTokenShowDecimals?: number;
|
|
8
|
+
quoteTokenShowDecimals?: number;
|
|
9
|
+
price: string | null;
|
|
10
|
+
baseTokenAmount: string;
|
|
11
|
+
salesRatio: number | null;
|
|
12
|
+
baseTokenSalesAmount: BigNumber;
|
|
13
|
+
quoteCap: number | null;
|
|
14
|
+
k: number;
|
|
15
|
+
hardcapPrice: BigNumber | null;
|
|
16
|
+
targetTakerTokenDisplayAmount: BigNumber;
|
|
17
|
+
};
|
|
18
|
+
curStep: import("../reducers").StepStatus;
|
|
19
|
+
timeSettings: import("../reducers").TimeSettingsType;
|
|
20
|
+
optionalSettings: import("../reducers").OptionalSettingsType;
|
|
21
|
+
introSettings: import("../reducers").IntroSettingsType;
|
|
22
|
+
};
|
|
23
|
+
dispatch: import("react").ActionDispatch<[action: {
|
|
24
|
+
type: Types;
|
|
25
|
+
payload: any;
|
|
26
|
+
}]>;
|
|
27
|
+
account: string | undefined;
|
|
28
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function useGetCPIntro(chainId: number | undefined, crowdpoolingAddress: string | undefined): import("@tanstack/react-query").UseQueryResult<{
|
|
2
|
+
id: string;
|
|
3
|
+
chainId: number;
|
|
4
|
+
name?: string;
|
|
5
|
+
owner: string;
|
|
6
|
+
crowdpoolingAddress: string;
|
|
7
|
+
coverImg?: string;
|
|
8
|
+
tokenName?: string;
|
|
9
|
+
website?: string;
|
|
10
|
+
twitter?: string;
|
|
11
|
+
telegram?: string;
|
|
12
|
+
discord?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
createAt: string;
|
|
15
|
+
updateAt: string;
|
|
16
|
+
} | null, Error>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StateProps } from '../reducers';
|
|
2
|
+
interface IntroSettingsValidationResult {
|
|
3
|
+
errorKey: string;
|
|
4
|
+
isValid: boolean;
|
|
5
|
+
reCheck: (getErrorState?: (isError: boolean) => void) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useIntroSettingsValidation: (state: StateProps) => IntroSettingsValidationResult;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StateProps } from '../reducers';
|
|
2
|
+
interface TimeSettingsValidationResult {
|
|
3
|
+
errorKey: string;
|
|
4
|
+
isValid: boolean;
|
|
5
|
+
reCheck: (getErrorState?: (isError: boolean) => void) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useTimeSettingsValidation: (state: StateProps) => TimeSettingsValidationResult;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TokenInfo } from '../../../hooks/Token/type';
|
|
3
|
+
export interface PriceSettingsType {
|
|
4
|
+
baseToken: TokenInfo | null;
|
|
5
|
+
quoteToken: TokenInfo | null;
|
|
6
|
+
baseTokenShowDecimals?: number;
|
|
7
|
+
quoteTokenShowDecimals?: number;
|
|
8
|
+
price: string | null;
|
|
9
|
+
baseTokenAmount: string;
|
|
10
|
+
salesRatio: number | null;
|
|
11
|
+
baseTokenSalesAmount: BigNumber;
|
|
12
|
+
quoteCap: number | null;
|
|
13
|
+
k: number;
|
|
14
|
+
hardcapPrice: BigNumber | null;
|
|
15
|
+
targetTakerTokenDisplayAmount: BigNumber;
|
|
16
|
+
}
|
|
17
|
+
export interface TimeSettingsType {
|
|
18
|
+
bidStartTime: number | null;
|
|
19
|
+
bidEndTime: number | null;
|
|
20
|
+
freezeDuration: number;
|
|
21
|
+
}
|
|
22
|
+
export interface OptionalSettingsType {
|
|
23
|
+
calmEndTime: number | null;
|
|
24
|
+
delayClaim: boolean;
|
|
25
|
+
initClaimRate: number | null;
|
|
26
|
+
claimStartTime: number | null;
|
|
27
|
+
freeCycle: number | null;
|
|
28
|
+
overflowLimit: boolean;
|
|
29
|
+
poolFeeRate: number;
|
|
30
|
+
isHardCap: boolean;
|
|
31
|
+
hardCapPricePerUser: number | null;
|
|
32
|
+
liquidityAddedPercent: number | null;
|
|
33
|
+
liquidityPoolType: 'dvm' | 'cp';
|
|
34
|
+
creator: string | null;
|
|
35
|
+
}
|
|
36
|
+
export interface IntroSettingsType {
|
|
37
|
+
projectName: string;
|
|
38
|
+
coverImageUrl: string;
|
|
39
|
+
description: string;
|
|
40
|
+
websiteUrl: string;
|
|
41
|
+
twitterUrl: string;
|
|
42
|
+
telegramUrl: string;
|
|
43
|
+
discordUrl: string;
|
|
44
|
+
enabledSocialLinks: {
|
|
45
|
+
website: boolean;
|
|
46
|
+
twitter: boolean;
|
|
47
|
+
discord: boolean;
|
|
48
|
+
telegram: boolean;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface StateProps {
|
|
52
|
+
curStep: StepStatus;
|
|
53
|
+
priceSettings: PriceSettingsType;
|
|
54
|
+
timeSettings: TimeSettingsType;
|
|
55
|
+
optionalSettings: OptionalSettingsType;
|
|
56
|
+
introSettings: IntroSettingsType;
|
|
57
|
+
}
|
|
58
|
+
export declare enum Types {
|
|
59
|
+
UpdateCurStep = 0,
|
|
60
|
+
UpdatePriceSettings = 1,
|
|
61
|
+
UpdateTimeSettings = 2,
|
|
62
|
+
UpdateOptionalSettings = 3,
|
|
63
|
+
UpdateIntroSettings = 4,
|
|
64
|
+
Cover = 5
|
|
65
|
+
}
|
|
66
|
+
export declare enum StepStatus {
|
|
67
|
+
PriceSettings = 1,
|
|
68
|
+
TimeSettings = 2,
|
|
69
|
+
OptionalSettings = 3,
|
|
70
|
+
IntroSettings = 4
|
|
71
|
+
}
|
|
72
|
+
type Payload = {
|
|
73
|
+
[Types.UpdateCurStep]: StepStatus;
|
|
74
|
+
[Types.UpdatePriceSettings]: Partial<PriceSettingsType>;
|
|
75
|
+
[Types.UpdateTimeSettings]: Partial<TimeSettingsType>;
|
|
76
|
+
[Types.UpdateOptionalSettings]: Partial<OptionalSettingsType>;
|
|
77
|
+
[Types.UpdateIntroSettings]: Partial<IntroSettingsType>;
|
|
78
|
+
[Types.Cover]: Partial<StateProps>;
|
|
79
|
+
};
|
|
80
|
+
export type Actions = Payload[keyof Payload];
|
|
81
|
+
export declare const OneDayTime: number;
|
|
82
|
+
export declare const initPriceSettings: PriceSettingsType;
|
|
83
|
+
export declare const initTimeSettings: TimeSettingsType;
|
|
84
|
+
export declare const initOptionalSettings: OptionalSettingsType;
|
|
85
|
+
export declare const initIntroSettings: IntroSettingsType;
|
|
86
|
+
export declare const initState: StateProps;
|
|
87
|
+
export declare function reducer(state: StateProps, action: {
|
|
88
|
+
type: Types;
|
|
89
|
+
payload: any;
|
|
90
|
+
}): StateProps;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ImageCompressionOptions {
|
|
2
|
+
quality?: number;
|
|
3
|
+
maxSize?: number;
|
|
4
|
+
}
|
|
5
|
+
export interface CompressorOptions {
|
|
6
|
+
quality?: number;
|
|
7
|
+
success?: (result: File) => void;
|
|
8
|
+
error?: (err: Error) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function compressImage(file: File, userOptions?: ImageCompressionOptions): Promise<File>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CPDetail, CPStatusType } from '../../types';
|
|
2
|
+
interface ActionCardProps {
|
|
3
|
+
detail: CPDetail | undefined;
|
|
4
|
+
status: CPStatusType;
|
|
5
|
+
refetch: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function ActionCard({ detail, status, refetch: refetchDetail, }: ActionCardProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ChainId } from '@dodoex/api';
|
|
2
|
+
import { TokenInfo } from '../../../../hooks/Token';
|
|
3
|
+
import BigNumber from 'bignumber.js';
|
|
4
|
+
export default function RemoveDialog({ token, baseTokenPosition, balanceLoading, chainId, open, loading, onClose, onConfirm, }: {
|
|
5
|
+
token: TokenInfo | undefined | null;
|
|
6
|
+
baseTokenPosition: BigNumber;
|
|
7
|
+
balanceLoading: boolean;
|
|
8
|
+
chainId: ChainId | undefined;
|
|
9
|
+
open: boolean;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
onConfirm: (params: {
|
|
13
|
+
sharesAmountParseUnit: string;
|
|
14
|
+
isUnWrap: boolean;
|
|
15
|
+
}) => void;
|
|
16
|
+
}): import("react").JSX.Element;
|