@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,105 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TokenInfo } from '../../hooks/Token';
|
|
3
|
+
import { ChainId, cpGraphqlQuery } from '@dodoex/api';
|
|
4
|
+
export type FetchCPItem = ReturnType<NonNullable<typeof cpGraphqlQuery.fetchCPList.__apiType>>['crowdPoolings']['0'];
|
|
5
|
+
export type FetchBidPositionItem = ReturnType<NonNullable<typeof cpGraphqlQuery.fetchBidPosition.__apiType>>['bidPositions']['0'];
|
|
6
|
+
export type CrowdpoolingDetail = any;
|
|
7
|
+
export declare const CP_STATUS: {
|
|
8
|
+
WAITING: string;
|
|
9
|
+
PROCESSING: string;
|
|
10
|
+
ENDED: string;
|
|
11
|
+
SETTLING: string;
|
|
12
|
+
CALMING: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const CP_OP_RANK: {
|
|
15
|
+
Verified: string;
|
|
16
|
+
Star: string;
|
|
17
|
+
Wild: string;
|
|
18
|
+
};
|
|
19
|
+
type valueof<T> = T[keyof T];
|
|
20
|
+
export type CPStatusType = valueof<typeof CP_STATUS>;
|
|
21
|
+
export interface Crowdpooling extends Omit<FetchCPItem, 'baseToken' | 'quoteToken' | 'settled'> {
|
|
22
|
+
id: string;
|
|
23
|
+
chainId: ChainId;
|
|
24
|
+
status: CPStatusType;
|
|
25
|
+
progress: number;
|
|
26
|
+
bidPosition?: FetchBidPositionItem;
|
|
27
|
+
bidStartTime: number;
|
|
28
|
+
bidEndTime: number;
|
|
29
|
+
calmEndTime: number;
|
|
30
|
+
freezeDuration: number;
|
|
31
|
+
personalPercentage: number;
|
|
32
|
+
price: BigNumber;
|
|
33
|
+
baseToken: TokenInfo;
|
|
34
|
+
quoteToken: TokenInfo;
|
|
35
|
+
opRank?: string;
|
|
36
|
+
isEscalation: boolean;
|
|
37
|
+
initPrice: BigNumber;
|
|
38
|
+
salesBase: BigNumber;
|
|
39
|
+
weight?: number;
|
|
40
|
+
hardcapPrice?: BigNumber;
|
|
41
|
+
settled?: boolean;
|
|
42
|
+
i: BigNumber;
|
|
43
|
+
k: BigNumber;
|
|
44
|
+
}
|
|
45
|
+
export interface CPDetail extends Omit<Crowdpooling, 'personalPercentage'> {
|
|
46
|
+
utilProtectionTime?: number;
|
|
47
|
+
protectionDays?: string | number;
|
|
48
|
+
salesRatio: BigNumber;
|
|
49
|
+
sessionSupplyAmount: BigNumber;
|
|
50
|
+
targetTakerTokenAmount: BigNumber;
|
|
51
|
+
}
|
|
52
|
+
export interface CPTokenDisplay {
|
|
53
|
+
id: string;
|
|
54
|
+
symbol: string;
|
|
55
|
+
decimals?: number;
|
|
56
|
+
showDecimals?: number;
|
|
57
|
+
address?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface CPDayData {
|
|
60
|
+
date: number;
|
|
61
|
+
investors: string;
|
|
62
|
+
investedQuote: string;
|
|
63
|
+
poolQuote: string;
|
|
64
|
+
newcome: string;
|
|
65
|
+
canceledQuote: string;
|
|
66
|
+
}
|
|
67
|
+
export interface CrowdpoolingOverviewItem {
|
|
68
|
+
description: React.ReactNode;
|
|
69
|
+
value: string | number;
|
|
70
|
+
icon: React.ComponentType;
|
|
71
|
+
}
|
|
72
|
+
export interface LaunchItem {
|
|
73
|
+
title: string;
|
|
74
|
+
description: string;
|
|
75
|
+
}
|
|
76
|
+
export interface DashboardCard {
|
|
77
|
+
totalBase: string;
|
|
78
|
+
address: string;
|
|
79
|
+
baseSymbol: string;
|
|
80
|
+
quoteSymbol: string;
|
|
81
|
+
quoteBaseRate: string;
|
|
82
|
+
poolQuote: string;
|
|
83
|
+
poolQuoteCap: string;
|
|
84
|
+
chain: string;
|
|
85
|
+
}
|
|
86
|
+
export interface CrowdpoolingListItem {
|
|
87
|
+
cp: CPDetail;
|
|
88
|
+
progress: number;
|
|
89
|
+
}
|
|
90
|
+
export type CrowdpoolingTabType = 'all' | 'my';
|
|
91
|
+
export interface CrowdpoolingListProps {
|
|
92
|
+
params?: {
|
|
93
|
+
tab?: CrowdpoolingTabType;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export interface SumCardProps {
|
|
97
|
+
title: React.ReactNode;
|
|
98
|
+
sum: string;
|
|
99
|
+
icon: React.ComponentType;
|
|
100
|
+
}
|
|
101
|
+
export interface ListItemProps {
|
|
102
|
+
label: React.ReactNode;
|
|
103
|
+
value: React.ReactNode;
|
|
104
|
+
}
|
|
105
|
+
export {};
|
|
@@ -24,8 +24,8 @@ export declare function isJoinedOrStakedProcessing({ miningItem, contractDataMap
|
|
|
24
24
|
}): boolean;
|
|
25
25
|
export declare function formatApr(apr?: BigNumber): string;
|
|
26
26
|
export declare function formatDate(time: number | null): string;
|
|
27
|
-
export declare function getOperateAreaWrapperEle(): HTMLElement;
|
|
28
|
-
export declare function getDetailWrapperEle(): HTMLElement;
|
|
27
|
+
export declare function getOperateAreaWrapperEle(): HTMLElement | null;
|
|
28
|
+
export declare function getDetailWrapperEle(): HTMLElement | null;
|
|
29
29
|
export declare function hideExistedNode(ele: HTMLElement): void;
|
|
30
30
|
export declare function showExistedNode(ele: HTMLElement): void;
|
|
31
31
|
export declare function generateMiningDetailUrl({ chainId, miningContractAddress, stakeTokenAddress, }: {
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default function StatBarChart({ unit, data, masterKey, sumKey, }: {
|
|
2
|
+
type BaseData = Record<string, number>;
|
|
3
|
+
export default function StatBarChart<T extends BaseData, U extends BaseData>({ unit, data, dayData, hourData, masterKey, sumKey, investorsCount, }: {
|
|
5
4
|
unit: string;
|
|
6
|
-
data
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
5
|
+
data?: T[];
|
|
6
|
+
dayData?: Array<T & {
|
|
7
|
+
date: number;
|
|
8
|
+
}>;
|
|
9
|
+
hourData?: Array<U & {
|
|
10
|
+
hour: number;
|
|
11
|
+
}>;
|
|
12
|
+
masterKey: keyof U;
|
|
13
|
+
sumKey: keyof U;
|
|
14
|
+
investorsCount?: string | number;
|
|
15
|
+
}): React.JSX.Element | null;
|
|
10
16
|
export {};
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dodoex/widgets",
|
|
3
|
-
"version": "3.20.0-
|
|
3
|
+
"version": "3.20.0-cp.2",
|
|
4
4
|
"description": "DODO Widgets",
|
|
5
5
|
"source": "src/index.tsx",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
7
7
|
"main": "dist/index.cjs",
|
|
8
8
|
"module": "dist/index.js",
|
|
9
|
+
"style": "dist/widgets.css",
|
|
9
10
|
"license": "GPL-3.0-or-later",
|
|
10
11
|
"homepage": "https://github.com/DODOEX/widgets#readme",
|
|
11
12
|
"repository": "https://github.com/DODOEX/widgets",
|
|
@@ -37,7 +38,8 @@
|
|
|
37
38
|
"types": "./dist/types/index.d.ts",
|
|
38
39
|
"import": "./dist/index.js",
|
|
39
40
|
"require": "./dist/index.cjs"
|
|
40
|
-
}
|
|
41
|
+
},
|
|
42
|
+
"./style": "./dist/widgets.css"
|
|
41
43
|
},
|
|
42
44
|
"keywords": [
|
|
43
45
|
"dodo",
|
|
@@ -58,7 +60,7 @@
|
|
|
58
60
|
},
|
|
59
61
|
"dependencies": {
|
|
60
62
|
"@babel/runtime": "^7.17.0",
|
|
61
|
-
"@dodoex/api": "^3.9.0-
|
|
63
|
+
"@dodoex/api": "^3.9.0-cp.1",
|
|
62
64
|
"@dodoex/components": "^3.3.0",
|
|
63
65
|
"@dodoex/contract-request": "^1.3.0",
|
|
64
66
|
"@dodoex/dodo-contract-request": "^1.35.0-alpha.2",
|
|
@@ -83,6 +85,7 @@
|
|
|
83
85
|
"@web3-react/walletconnect-v2": "8.3.6",
|
|
84
86
|
"axios": "^0.27.2",
|
|
85
87
|
"bignumber.js": "^9.0.2",
|
|
88
|
+
"compressorjs": "^1.2.1",
|
|
86
89
|
"d3": "7.6.1",
|
|
87
90
|
"dayjs": "^1.11.11",
|
|
88
91
|
"identicon.js": "^2.3.3",
|
|
@@ -91,6 +94,7 @@
|
|
|
91
94
|
"lodash": "^4.17.21",
|
|
92
95
|
"make-plural": "^7.0.0",
|
|
93
96
|
"moment": "^2.29.4",
|
|
97
|
+
"quill": "^2.0.3",
|
|
94
98
|
"react-datetime": "^3.3.0",
|
|
95
99
|
"react-icons": "^5.0.1",
|
|
96
100
|
"react-infinite-scroller": "^1.2.6",
|
|
@@ -151,6 +155,7 @@
|
|
|
151
155
|
"np": "^7.6.1",
|
|
152
156
|
"rollup": "^4.18.0",
|
|
153
157
|
"rollup-plugin-clear": "^2.0.7",
|
|
158
|
+
"rollup-plugin-css-only": "^4.5.5",
|
|
154
159
|
"rollup-plugin-import-css": "^3.5.5",
|
|
155
160
|
"svg-jest": "^1.0.1",
|
|
156
161
|
"ts-jest": "^29.0.1",
|