@taskon/widget-react 0.0.1-beta.4 → 0.0.1-beta.6
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/README.md +13 -4
- package/dist/CommunityTaskList.css +119 -111
- package/dist/EligibilityInfo.css +114 -110
- package/dist/LeaderboardWidget.css +73 -71
- package/dist/PageBuilder.css +5 -0
- package/dist/Quest.css +259 -255
- package/dist/TaskOnProvider.css +2 -0
- package/dist/UserCenterWidget.css +6 -6
- package/dist/UserCenterWidget2.css +1626 -1601
- package/dist/{dynamic-import-helper.css → WidgetShell.css} +2 -2
- package/dist/chunks/{CommunityTaskList-C9Gv8KOF.js → CommunityTaskList-Hde2OKHH.js} +1070 -580
- package/dist/chunks/{EligibilityInfo-D-Fuy9GE.js → EligibilityInfo-BV0Z2TgY.js} +1972 -1028
- package/dist/chunks/{LeaderboardWidget-BV2D2q1N.js → LeaderboardWidget-BNGRD5Bu.js} +270 -249
- package/dist/chunks/{PageBuilder-DQoU4Mwf.js → PageBuilder-C5DSHiW9.js} +5 -5
- package/dist/chunks/{Quest-B5NyVr3o.js → Quest-DG9zfXJo.js} +723 -513
- package/dist/chunks/{TaskOnProvider-93UxARFo.js → TaskOnProvider-BhamHIyY.js} +98 -68
- package/dist/chunks/{ThemeProvider-CPI_roeh.js → ThemeProvider-mXLdLSkq.js} +107 -20
- package/dist/chunks/{UserCenterWidget-cADBSVg7.js → UserCenterWidget-D5ttw4hO.js} +1328 -1337
- package/dist/chunks/{UserCenterWidget-BRtigY_S.js → UserCenterWidget-jDO5zTN1.js} +358 -254
- package/dist/chunks/{dynamic-import-helper-DwXlQC0S.js → WidgetShell-D7yC894Y.js} +447 -457
- package/dist/chunks/communitytask-es-CBNnS4o2.js +521 -0
- package/dist/chunks/communitytask-ja-GRf9cbdx.js +521 -0
- package/dist/chunks/communitytask-ko-Bf24PQKI.js +521 -0
- package/dist/chunks/communitytask-ru-CZm2CPoV.js +521 -0
- package/dist/chunks/leaderboardwidget-es-vKjrjQaz.js +146 -0
- package/dist/chunks/leaderboardwidget-ja-Q6u0HxKG.js +146 -0
- package/dist/chunks/leaderboardwidget-ko-CG6SWgxf.js +146 -0
- package/dist/chunks/leaderboardwidget-ru-DCcHcJGz.js +146 -0
- package/dist/chunks/quest-es-Dyyy0zaw.js +863 -0
- package/dist/chunks/quest-ja-Depog33y.js +863 -0
- package/dist/chunks/quest-ko-BMu3uRQJ.js +863 -0
- package/dist/chunks/quest-ru-xne814Rw.js +863 -0
- package/dist/chunks/taskwidget-es-Do9b3Mqw.js +245 -0
- package/dist/chunks/taskwidget-ja-CqSu-yWA.js +245 -0
- package/dist/chunks/taskwidget-ko-EHgXFV4B.js +245 -0
- package/dist/chunks/taskwidget-ru-CMbLQDK4.js +245 -0
- package/dist/chunks/usercenter-es-Dz3Wp2vV.js +512 -0
- package/dist/chunks/usercenter-ja-CKE4DJC6.js +512 -0
- package/dist/chunks/usercenter-ko-Dtpkn2qb.js +512 -0
- package/dist/chunks/usercenter-ru-DnBGee45.js +512 -0
- package/dist/community-task.d.ts +0 -390
- package/dist/community-task.js +2 -7
- package/dist/core.d.ts +46 -10
- package/dist/core.js +11 -11
- package/dist/index.d.ts +46 -667
- package/dist/index.js +19 -28
- package/dist/leaderboard.d.ts +0 -498
- package/dist/leaderboard.js +2 -16
- package/dist/page-builder.js +1 -1
- package/dist/quest.d.ts +0 -289
- package/dist/quest.js +2 -5
- package/dist/user-center.d.ts +0 -1608
- package/dist/user-center.js +2 -494
- package/package.json +5 -2
- package/dist/chunks/leaderboardwidget-ja-Bj6gz6y1.js +0 -119
- package/dist/chunks/leaderboardwidget-ko-f1cLO9ic.js +0 -119
- package/dist/chunks/usercenter-ja-B2465c1O.js +0 -326
- package/dist/chunks/usercenter-ko-xAEYxqLg.js +0 -326
package/dist/user-center.d.ts
CHANGED
|
@@ -1,1129 +1,7 @@
|
|
|
1
|
-
import { ChainType } from '@taskon/core';
|
|
2
1
|
import { default as default_2 } from 'react';
|
|
3
|
-
import { getChainIcon } from '@taskon/core';
|
|
4
|
-
import { getChainName } from '@taskon/core';
|
|
5
|
-
import { getSocialIcon } from '@taskon/core';
|
|
6
|
-
import { GtcUserInfo } from '@taskon/core';
|
|
7
|
-
import { LockedTokenListItem } from '@taskon/core';
|
|
8
|
-
import { MyCampaignHistoryListItem } from '@taskon/core';
|
|
9
|
-
import { MyCommunityRewardDetails } from '@taskon/core';
|
|
10
|
-
import { MyCommunityRewards } from '@taskon/core';
|
|
11
|
-
import { PointsInfo } from '@taskon/core';
|
|
12
|
-
import { RewardType } from '@taskon/core';
|
|
13
|
-
import { SnsItem } from '@taskon/core';
|
|
14
|
-
import { SnsType } from '@taskon/core';
|
|
15
|
-
import { toWei } from '@taskon/core';
|
|
16
|
-
import { truncateAddress } from '@taskon/core';
|
|
17
|
-
import { UserAddress } from '@taskon/core';
|
|
18
|
-
import { UserCenterAccountType } from '@taskon/core';
|
|
19
|
-
import { UserCenterChainType } from '@taskon/core';
|
|
20
2
|
import { UserCenterConfig } from '@taskon/core';
|
|
21
3
|
import { UserCenterRewardCardType } from '@taskon/core';
|
|
22
4
|
import { UserCenterTabType } from '@taskon/core';
|
|
23
|
-
import { UserPointsHistoryListItem } from '@taskon/core';
|
|
24
|
-
import { UserPointsInfo } from '@taskon/core';
|
|
25
|
-
import { UserTokenBalanceListItem } from '@taskon/core';
|
|
26
|
-
import { WithdrawStatus } from '@taskon/core';
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* ActivityHistoryList 组件
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```tsx
|
|
33
|
-
* const { data, loading, error, pagination } = useActivityHistory();
|
|
34
|
-
*
|
|
35
|
-
* <ActivityHistoryList
|
|
36
|
-
* data={data}
|
|
37
|
-
* loading={loading}
|
|
38
|
-
* error={error}
|
|
39
|
-
* pagination={pagination}
|
|
40
|
-
* messages={messages}
|
|
41
|
-
* />
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export declare function ActivityHistoryList({ data, loading, error, pagination, messages, mode, onItemClick, onRetry, }: ActivityHistoryListProps): default_2.ReactElement;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* ActivityHistoryList 属性
|
|
48
|
-
*/
|
|
49
|
-
export declare interface ActivityHistoryListProps {
|
|
50
|
-
/** 活动历史数据 */
|
|
51
|
-
data: MyCampaignHistoryListItem[];
|
|
52
|
-
/** 是否加载中 */
|
|
53
|
-
loading: boolean;
|
|
54
|
-
/** 错误信息 */
|
|
55
|
-
error: Error | null;
|
|
56
|
-
/** 分页控制器 */
|
|
57
|
-
pagination: UsePaginationResult;
|
|
58
|
-
/** 国际化消息 */
|
|
59
|
-
messages: UserCenterMessages;
|
|
60
|
-
/** 分页模式 */
|
|
61
|
-
mode?: PaginationMode;
|
|
62
|
-
/** 点击活动项回调 */
|
|
63
|
-
onItemClick?: (item: MyCampaignHistoryListItem) => void;
|
|
64
|
-
/** 重试回调 */
|
|
65
|
-
onRetry?: () => void;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* AssetCard 组件
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```tsx
|
|
73
|
-
* <AssetCard
|
|
74
|
-
* type="Token"
|
|
75
|
-
* value="$100.00"
|
|
76
|
-
* selected={selectedType === "Token"}
|
|
77
|
-
* onClick={() => setSelectedType("Token")}
|
|
78
|
-
* messages={messages}
|
|
79
|
-
* />
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
export declare function AssetCard({ type, value, selected, onClick, messages, pointsData, }: AssetCardProps): default_2.ReactElement;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* AssetCard 属性
|
|
86
|
-
*/
|
|
87
|
-
export declare interface AssetCardProps {
|
|
88
|
-
/** 卡片类型 */
|
|
89
|
-
type: UserCenterRewardCardType;
|
|
90
|
-
/** 显示值 */
|
|
91
|
-
value: string;
|
|
92
|
-
/** 是否选中 */
|
|
93
|
-
selected?: boolean;
|
|
94
|
-
/** 点击回调 */
|
|
95
|
-
onClick?: () => void;
|
|
96
|
-
/** 国际化消息 */
|
|
97
|
-
messages: UserCenterMessages;
|
|
98
|
-
/** 积分数据(仅 Points 类型) */
|
|
99
|
-
pointsData?: PointsInfo;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* AssetCarousel 组件
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```tsx
|
|
107
|
-
* const { cards, selectedCard, selectCard } = useUserRewards();
|
|
108
|
-
*
|
|
109
|
-
* <AssetCarousel
|
|
110
|
-
* cards={cards}
|
|
111
|
-
* selectedCard={selectedCard}
|
|
112
|
-
* onSelectCard={selectCard}
|
|
113
|
-
* messages={messages}
|
|
114
|
-
* />
|
|
115
|
-
* ```
|
|
116
|
-
*/
|
|
117
|
-
export declare function AssetCarousel({ cards, selectedCard, selectedPointsId, onSelectCard, messages, }: AssetCarouselProps): default_2.ReactElement;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* AssetCarousel 属性
|
|
121
|
-
*/
|
|
122
|
-
export declare interface AssetCarouselProps {
|
|
123
|
-
/** 卡片数据列表 */
|
|
124
|
-
cards: RewardCardData[];
|
|
125
|
-
/** 当前选中的卡片类型 */
|
|
126
|
-
selectedCard: UserCenterRewardCardType | null;
|
|
127
|
-
/** 当前选中的 Points ID(用于区分多个 Points 类型卡片) */
|
|
128
|
-
selectedPointsId?: number | null;
|
|
129
|
-
/** 选择卡片回调 */
|
|
130
|
-
onSelectCard: (type: UserCenterRewardCardType, pointsId?: number) => void;
|
|
131
|
-
/** 国际化消息 */
|
|
132
|
-
messages: UserCenterMessages;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* 构建奖励卡片列表
|
|
137
|
-
*
|
|
138
|
-
* @param rewards - 奖励汇总数据
|
|
139
|
-
* @param userInfo - 用户社区信息(包含等级数据)
|
|
140
|
-
* @returns 奖励卡片列表
|
|
141
|
-
*/
|
|
142
|
-
export declare function buildRewardCards(rewards: MyCommunityRewards, userInfo: GtcUserInfo | null): RewardCardData[];
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* 链类型(string literal,与 User/types.ts 的定义对齐)
|
|
146
|
-
*/
|
|
147
|
-
export declare type ChainTypeString = "evm" | "solana" | "aptos" | "sui" | "tron" | "starknet" | "btc" | "nibiru" | "kaspa" | "ton";
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* EmptyState 组件
|
|
151
|
-
*/
|
|
152
|
-
export declare function EmptyState({ message, icon, className, }: EmptyStateProps): default_2.ReactElement;
|
|
153
|
-
|
|
154
|
-
export declare interface EmptyStateProps {
|
|
155
|
-
/** 提示消息 */
|
|
156
|
-
message: string;
|
|
157
|
-
/** 自定义图标 */
|
|
158
|
-
icon?: default_2.ReactNode;
|
|
159
|
-
/** 自定义类名 */
|
|
160
|
-
className?: string;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* 格式化 Token 金额
|
|
165
|
-
*
|
|
166
|
-
* @param amount - Token 金额字符串
|
|
167
|
-
* @returns 格式化后的金额显示(带 $ 和 K/M 后缀)
|
|
168
|
-
*
|
|
169
|
-
* @deprecated 请使用 @taskon/core 的 formatTokenAmount 并传入 options
|
|
170
|
-
*/
|
|
171
|
-
export declare function formatTokenAmount(amount: string): string;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* FrozenAssetList 组件
|
|
175
|
-
*
|
|
176
|
-
* @example
|
|
177
|
-
* ```tsx
|
|
178
|
-
* const { data, loading, error, pagination, canResend } = useFrozenAssets({
|
|
179
|
-
* tokenId: 123,
|
|
180
|
-
* });
|
|
181
|
-
*
|
|
182
|
-
* <FrozenAssetList
|
|
183
|
-
* data={data}
|
|
184
|
-
* loading={loading}
|
|
185
|
-
* error={error}
|
|
186
|
-
* pagination={pagination}
|
|
187
|
-
* messages={messages}
|
|
188
|
-
* canResend={canResend}
|
|
189
|
-
* onResend={(item) => handleResend(item)}
|
|
190
|
-
* />
|
|
191
|
-
* ```
|
|
192
|
-
*/
|
|
193
|
-
export declare function FrozenAssetList({ data, loading, error, pagination, messages, canResend, onResend, onClose, }: FrozenAssetListProps): default_2.ReactElement;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* FrozenAssetList 属性
|
|
197
|
-
*/
|
|
198
|
-
export declare interface FrozenAssetListProps {
|
|
199
|
-
/** 冻结资产列表 */
|
|
200
|
-
data: LockedTokenListItem[];
|
|
201
|
-
/** 是否加载中 */
|
|
202
|
-
loading: boolean;
|
|
203
|
-
/** 错误信息 */
|
|
204
|
-
error: Error | null;
|
|
205
|
-
/** 分页控制器 */
|
|
206
|
-
pagination: UsePaginationResult;
|
|
207
|
-
/** 国际化消息 */
|
|
208
|
-
messages: UserCenterMessages;
|
|
209
|
-
/** 检查是否可重发 */
|
|
210
|
-
canResend: (item: LockedTokenListItem) => boolean;
|
|
211
|
-
/** 重发回调 */
|
|
212
|
-
onResend?: (item: LockedTokenListItem) => void;
|
|
213
|
-
/** 关闭回调 */
|
|
214
|
-
onClose?: () => void;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export { getChainIcon }
|
|
218
|
-
|
|
219
|
-
export { getChainName }
|
|
220
|
-
|
|
221
|
-
export { getSocialIcon }
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* LoadingState 组件
|
|
225
|
-
*/
|
|
226
|
-
export declare function LoadingState({ message, className, }: LoadingStateProps): default_2.ReactElement;
|
|
227
|
-
|
|
228
|
-
export declare interface LoadingStateProps {
|
|
229
|
-
/** 提示消息 */
|
|
230
|
-
message?: string;
|
|
231
|
-
/** 自定义类名 */
|
|
232
|
-
className?: string;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Pagination 组件
|
|
237
|
-
*/
|
|
238
|
-
export declare function Pagination({ page, totalPages, hasPrevious, hasNext, onPrevious, onNext, messages, className, showRange, }: PaginationProps): default_2.ReactElement | null;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* 分页模式
|
|
242
|
-
*/
|
|
243
|
-
declare type PaginationMode = "pagination" | "infinite";
|
|
244
|
-
|
|
245
|
-
export declare interface PaginationProps {
|
|
246
|
-
/** 当前页码(从 0 开始) */
|
|
247
|
-
page: number;
|
|
248
|
-
/** 总页数 */
|
|
249
|
-
totalPages: number;
|
|
250
|
-
/** 是否有上一页 */
|
|
251
|
-
hasPrevious: boolean;
|
|
252
|
-
/** 是否有下一页 */
|
|
253
|
-
hasNext: boolean;
|
|
254
|
-
/** 上一页回调 */
|
|
255
|
-
onPrevious: () => void;
|
|
256
|
-
/** 下一页回调 */
|
|
257
|
-
onNext: () => void;
|
|
258
|
-
/** 国际化消息 */
|
|
259
|
-
messages: UserCenterMessages;
|
|
260
|
-
/** 自定义类名 */
|
|
261
|
-
className?: string;
|
|
262
|
-
/** 显示范围信息(可选) */
|
|
263
|
-
showRange?: {
|
|
264
|
-
start: number;
|
|
265
|
-
end: number;
|
|
266
|
-
total: number;
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* 冻结资产重发参数
|
|
272
|
-
*
|
|
273
|
-
* 用于重发之前失败的提现交易
|
|
274
|
-
*/
|
|
275
|
-
export declare interface ResendParams {
|
|
276
|
-
/** 原交易 nonce(从 LockedTokenListItem 获取) */
|
|
277
|
-
nonce: string;
|
|
278
|
-
/** 原接收地址(从 LockedTokenListItem 获取) */
|
|
279
|
-
receiverAddress: string;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* 奖励卡片数据
|
|
284
|
-
*/
|
|
285
|
-
export declare interface RewardCardData {
|
|
286
|
-
/** 卡片类型 */
|
|
287
|
-
type: UserCenterRewardCardType;
|
|
288
|
-
/** 显示值(格式化后) */
|
|
289
|
-
value: string;
|
|
290
|
-
/** 原始数值 */
|
|
291
|
-
rawValue: number | string;
|
|
292
|
-
/** 是否显示(有数据时显示) */
|
|
293
|
-
visible: boolean;
|
|
294
|
-
/** 积分相关数据(仅 Points 类型) */
|
|
295
|
-
pointsData?: PointsInfo;
|
|
296
|
-
/** XP Level 相关数据(仅 XpLevel 类型) */
|
|
297
|
-
xpLevelData?: XpLevelCardData;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* RewardDetailList 组件
|
|
302
|
-
*
|
|
303
|
-
* @example
|
|
304
|
-
* ```tsx
|
|
305
|
-
* <RewardDetailList
|
|
306
|
-
* rewardType="Token"
|
|
307
|
-
* data={tokenHistory}
|
|
308
|
-
* loading={loading}
|
|
309
|
-
* error={error}
|
|
310
|
-
* pagination={pagination}
|
|
311
|
-
* messages={messages}
|
|
312
|
-
* />
|
|
313
|
-
* ```
|
|
314
|
-
*/
|
|
315
|
-
export declare function RewardDetailList({ rewardType, data, loading, error, pagination, messages, onItemClick, onClaim, onTxClick, }: RewardDetailListProps): default_2.ReactElement;
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* RewardDetailList 属性
|
|
319
|
-
*/
|
|
320
|
-
export declare interface RewardDetailListProps {
|
|
321
|
-
/** 奖励类型 */
|
|
322
|
-
rewardType: RewardType;
|
|
323
|
-
/** 奖励详情列表 */
|
|
324
|
-
data: MyCommunityRewardDetails[];
|
|
325
|
-
/** 是否加载中 */
|
|
326
|
-
loading: boolean;
|
|
327
|
-
/** 错误信息 */
|
|
328
|
-
error: Error | null;
|
|
329
|
-
/** 分页控制器 */
|
|
330
|
-
pagination: UsePaginationResult;
|
|
331
|
-
/** 国际化消息 */
|
|
332
|
-
messages: UserCenterMessages;
|
|
333
|
-
/** 点击项目回调 */
|
|
334
|
-
onItemClick?: (item: MyCommunityRewardDetails) => void;
|
|
335
|
-
/** NFT Claim 回调 - 可领取状态点击 Claim 按钮时触发 */
|
|
336
|
-
onClaim?: (item: MyCommunityRewardDetails) => void;
|
|
337
|
-
/** NFT 已领取交易点击回调 - 点击 "Claimed (Txn)" 链接时触发 */
|
|
338
|
-
onTxClick?: (item: MyCommunityRewardDetails) => void;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
export { SnsType }
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* 社交账号数据
|
|
345
|
-
*/
|
|
346
|
-
export declare interface SocialAccountData {
|
|
347
|
-
/** 账号类型(Widget 配置枚举) */
|
|
348
|
-
accountType: UserCenterAccountType;
|
|
349
|
-
/** SNS 类型 */
|
|
350
|
-
snsType: SnsType;
|
|
351
|
-
/** 是否已绑定 */
|
|
352
|
-
isBound: boolean;
|
|
353
|
-
/** 绑定的账号信息(未绑定时为 null) */
|
|
354
|
-
account: SnsItem | null;
|
|
355
|
-
/** 跳转链接(已绑定时生成) */
|
|
356
|
-
profileUrl: string | null;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* TabBar 组件
|
|
361
|
-
*/
|
|
362
|
-
export declare function TabBar({ activeTab, tabs, onTabChange, messages, className, }: TabBarProps): default_2.ReactElement;
|
|
363
|
-
|
|
364
|
-
export declare interface TabBarProps {
|
|
365
|
-
/** 当前选中的 Tab */
|
|
366
|
-
activeTab: UserCenterTabType;
|
|
367
|
-
/** Tab 列表 */
|
|
368
|
-
tabs: UserCenterTabType[];
|
|
369
|
-
/** Tab 切换回调 */
|
|
370
|
-
onTabChange: (tab: UserCenterTabType) => void;
|
|
371
|
-
/** 国际化消息 */
|
|
372
|
-
messages: UserCenterMessages;
|
|
373
|
-
/** 自定义类名 */
|
|
374
|
-
className?: string;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* TokenAssetList 组件
|
|
379
|
-
*
|
|
380
|
-
* @example
|
|
381
|
-
* ```tsx
|
|
382
|
-
* <TokenAssetList
|
|
383
|
-
* data={tokenAssets}
|
|
384
|
-
* loading={loading}
|
|
385
|
-
* error={error}
|
|
386
|
-
* messages={messages}
|
|
387
|
-
* onWithdraw={(token) => handleWithdraw(token)}
|
|
388
|
-
* />
|
|
389
|
-
* ```
|
|
390
|
-
*/
|
|
391
|
-
export declare function TokenAssetList({ data, loading, error, messages, pendingWithdrawals, onWithdraw, onViewFrozen, }: TokenAssetListProps): default_2.ReactElement;
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* TokenAssetList 属性
|
|
395
|
-
*/
|
|
396
|
-
export declare interface TokenAssetListProps {
|
|
397
|
-
/** Token 余额列表 */
|
|
398
|
-
data: UserTokenBalanceListItem[];
|
|
399
|
-
/** 是否加载中 */
|
|
400
|
-
loading: boolean;
|
|
401
|
-
/** 错误信息 */
|
|
402
|
-
error: Error | null;
|
|
403
|
-
/** 国际化消息 */
|
|
404
|
-
messages: UserCenterMessages;
|
|
405
|
-
/** 待处理提现数量 */
|
|
406
|
-
pendingWithdrawals?: number;
|
|
407
|
-
/** 提现按钮点击回调 */
|
|
408
|
-
onWithdraw?: (token: UserTokenBalanceListItem) => void;
|
|
409
|
-
/** 批量提现点击回调 */
|
|
410
|
-
onBatchWithdraw?: () => void;
|
|
411
|
-
/** 查看冻结资产回调 */
|
|
412
|
-
onViewFrozen?: (token: UserTokenBalanceListItem) => void;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
export { toWei }
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* 将 Token 余额转换为提现项(普通提现)
|
|
419
|
-
*
|
|
420
|
-
* @param token - Token 余额项
|
|
421
|
-
* @param decimals - Token 精度(需要通过 getTokenMetadata API 获取,默认 18)
|
|
422
|
-
*/
|
|
423
|
-
export declare function toWithdrawItem(token: UserTokenBalanceListItem, decimals?: number): WithdrawTokenItem;
|
|
424
|
-
|
|
425
|
-
export { truncateAddress }
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* 交易错误类型枚举
|
|
429
|
-
*
|
|
430
|
-
* 与 Vue 主站保持一致的错误类型
|
|
431
|
-
*/
|
|
432
|
-
declare enum TxErrorType {
|
|
433
|
-
/** 用户取消交易 */
|
|
434
|
-
Canceled = "canceled",
|
|
435
|
-
/** 连接钱包失败 */
|
|
436
|
-
ConnectFailed = "connect_failed",
|
|
437
|
-
/** 账户地址不匹配 */
|
|
438
|
-
AccountMismatch = "account_mismatch",
|
|
439
|
-
/** 链/网络不匹配 */
|
|
440
|
-
ChainMismatch = "chain_mismatch",
|
|
441
|
-
/** 余额不足 */
|
|
442
|
-
BalanceNotEnough = "balance_not_enough",
|
|
443
|
-
/** 交易失败 */
|
|
444
|
-
TransactionFailed = "transaction_failed",
|
|
445
|
-
/** 签名失败 */
|
|
446
|
-
SignFailed = "sign_failed"
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* 解绑状态
|
|
451
|
-
*/
|
|
452
|
-
declare type UnbindStatus = "idle" | "loading" | "success" | "error";
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
* 解绑检查结果
|
|
456
|
-
*/
|
|
457
|
-
declare interface UnlinkCheckResult {
|
|
458
|
-
/** 是否禁止解绑 */
|
|
459
|
-
disabled: boolean;
|
|
460
|
-
/** 禁用原因 */
|
|
461
|
-
reason: UnlinkDisableReason;
|
|
462
|
-
/** 禁用原因描述 */
|
|
463
|
-
message: string | null;
|
|
464
|
-
/** 冷却期剩余时间(毫秒,如果在冷却期内) */
|
|
465
|
-
cooldownRemaining: number | null;
|
|
466
|
-
/** 是否需要 KYC 警告(解绑已 KYC 验证的地址) */
|
|
467
|
-
needsKycWarning: boolean;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* 解绑禁用原因
|
|
472
|
-
*/
|
|
473
|
-
declare type UnlinkDisableReason = "cooldown" | "lastLoginMethod" | "kycVerified" | null;
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* 获取用户活动历史
|
|
477
|
-
*
|
|
478
|
-
* @param options - 配置选项
|
|
479
|
-
* @returns 活动历史数据和操作方法
|
|
480
|
-
*
|
|
481
|
-
* @example
|
|
482
|
-
* ```tsx
|
|
483
|
-
* // 传统分页模式
|
|
484
|
-
* const { data, loading, pagination } = useActivityHistory({
|
|
485
|
-
* mode: 'pagination',
|
|
486
|
-
* });
|
|
487
|
-
*
|
|
488
|
-
* // 无限滚动模式
|
|
489
|
-
* const { data, loading, pagination } = useActivityHistory({
|
|
490
|
-
* mode: 'infinite',
|
|
491
|
-
* });
|
|
492
|
-
*
|
|
493
|
-
* // 加载更多
|
|
494
|
-
* <button onClick={pagination.loadMore} disabled={!pagination.hasMore}>
|
|
495
|
-
* Load More
|
|
496
|
-
* </button>
|
|
497
|
-
* ```
|
|
498
|
-
*/
|
|
499
|
-
export declare function useActivityHistory(options?: UseActivityHistoryOptions): UseActivityHistoryResult;
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* useActivityHistory Hook 配置选项
|
|
503
|
-
*/
|
|
504
|
-
export declare interface UseActivityHistoryOptions {
|
|
505
|
-
/** 每页条数,默认 10 */
|
|
506
|
-
pageSize?: number;
|
|
507
|
-
/** 分页模式:pagination(传统分页)或 infinite(无限滚动) */
|
|
508
|
-
mode?: PaginationMode;
|
|
509
|
-
/** 是否自动加载,默认 true */
|
|
510
|
-
autoLoad?: boolean;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* useActivityHistory Hook 返回结果
|
|
515
|
-
*/
|
|
516
|
-
export declare interface UseActivityHistoryResult {
|
|
517
|
-
/** 活动历史列表 */
|
|
518
|
-
data: MyCampaignHistoryListItem[];
|
|
519
|
-
/** 是否正在加载 */
|
|
520
|
-
loading: boolean;
|
|
521
|
-
/** 错误信息 */
|
|
522
|
-
error: Error | null;
|
|
523
|
-
/** 总条数 */
|
|
524
|
-
total: number;
|
|
525
|
-
/** 分页控制器 */
|
|
526
|
-
pagination: UsePaginationResult;
|
|
527
|
-
/** 手动刷新 */
|
|
528
|
-
refresh: () => Promise<void>;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
/**
|
|
532
|
-
* 钱包地址绑定/解绑 Hook
|
|
533
|
-
*
|
|
534
|
-
* @param options - 配置选项
|
|
535
|
-
* @returns 绑定/解绑操作和状态
|
|
536
|
-
*
|
|
537
|
-
* @example
|
|
538
|
-
* ```tsx
|
|
539
|
-
* const { bind, unbind, bindStatus, unbindStatus, error } = useBindWallet({
|
|
540
|
-
* onBindSuccess: () => {
|
|
541
|
-
* toast.success("绑定成功");
|
|
542
|
-
* refreshUserInfo();
|
|
543
|
-
* },
|
|
544
|
-
* onUnbindSuccess: () => {
|
|
545
|
-
* toast.success("解绑成功");
|
|
546
|
-
* refreshUserInfo();
|
|
547
|
-
* },
|
|
548
|
-
* });
|
|
549
|
-
*
|
|
550
|
-
* // 绑定 EVM 钱包
|
|
551
|
-
* await bind("evm");
|
|
552
|
-
*
|
|
553
|
-
* // 解绑 Solana 钱包
|
|
554
|
-
* await unbind("solana", "address...");
|
|
555
|
-
* ```
|
|
556
|
-
*/
|
|
557
|
-
export declare function useBindWallet(options?: UseBindWalletOptions): UseBindWalletResult;
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
* useBindWallet Hook 配置选项
|
|
561
|
-
*/
|
|
562
|
-
export declare interface UseBindWalletOptions {
|
|
563
|
-
/** 绑定成功回调 */
|
|
564
|
-
onBindSuccess?: () => void;
|
|
565
|
-
/** 绑定失败回调 */
|
|
566
|
-
onBindError?: (error: Error) => void;
|
|
567
|
-
/** 解绑成功回调 */
|
|
568
|
-
onUnbindSuccess?: () => void;
|
|
569
|
-
/** 解绑失败回调 */
|
|
570
|
-
onUnbindError?: (error: Error) => void;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
/**
|
|
574
|
-
* useBindWallet Hook 返回结果
|
|
575
|
-
*/
|
|
576
|
-
export declare interface UseBindWalletResult {
|
|
577
|
-
/** 当前绑定状态 */
|
|
578
|
-
bindStatus: WalletBindStatus;
|
|
579
|
-
/** 当前解绑状态 */
|
|
580
|
-
unbindStatus: WalletBindStatus;
|
|
581
|
-
/** 错误信息 */
|
|
582
|
-
error: Error | null;
|
|
583
|
-
/** 正在处理的链类型 */
|
|
584
|
-
processingChain: ChainType | null;
|
|
585
|
-
/**
|
|
586
|
-
* 绑定钱包地址
|
|
587
|
-
* 会自动连接钱包、获取签名、提交绑定请求
|
|
588
|
-
*/
|
|
589
|
-
bind: (chainType: ChainType) => Promise<boolean>;
|
|
590
|
-
/**
|
|
591
|
-
* 解绑钱包地址
|
|
592
|
-
* 需要签名验证
|
|
593
|
-
*/
|
|
594
|
-
unbind: (chainType: ChainType, address: string) => Promise<boolean>;
|
|
595
|
-
/** 重置状态 */
|
|
596
|
-
reset: () => void;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
/**
|
|
600
|
-
* 解绑禁用逻辑检查 Hook
|
|
601
|
-
*
|
|
602
|
-
* 检查规则:
|
|
603
|
-
* 1. 用户必须至少保留一个登录方式
|
|
604
|
-
* 2. 绑定后 1 天内不能解绑
|
|
605
|
-
* 3. KYC 已验证的地址解绑时显示警告(不禁止)
|
|
606
|
-
*
|
|
607
|
-
* @returns 解绑检查方法和状态
|
|
608
|
-
*
|
|
609
|
-
* @example
|
|
610
|
-
* ```tsx
|
|
611
|
-
* const { checkSocialUnlink, checkWalletUnlink, isLastLoginMethod } = useDisableUnlink();
|
|
612
|
-
*
|
|
613
|
-
* // 检查是否可以解绑 Twitter
|
|
614
|
-
* const twitterCheck = checkSocialUnlink(twitterAccount);
|
|
615
|
-
* if (twitterCheck.disabled) {
|
|
616
|
-
* toast.error(twitterCheck.message);
|
|
617
|
-
* return;
|
|
618
|
-
* }
|
|
619
|
-
*
|
|
620
|
-
* // 检查是否可以解绑钱包
|
|
621
|
-
* const walletCheck = checkWalletUnlink(evmAddress, true); // isKycVerified = true
|
|
622
|
-
* if (walletCheck.needsKycWarning) {
|
|
623
|
-
* // 显示 KYC 警告确认
|
|
624
|
-
* }
|
|
625
|
-
* ```
|
|
626
|
-
*/
|
|
627
|
-
export declare function useDisableUnlink(): UseDisableUnlinkResult;
|
|
628
|
-
|
|
629
|
-
/**
|
|
630
|
-
* useDisableUnlink Hook 返回结果
|
|
631
|
-
*/
|
|
632
|
-
declare interface UseDisableUnlinkResult {
|
|
633
|
-
/**
|
|
634
|
-
* 检查是否可以解绑社交账号
|
|
635
|
-
*/
|
|
636
|
-
checkSocialUnlink: (account: SnsItem) => UnlinkCheckResult;
|
|
637
|
-
/**
|
|
638
|
-
* 检查是否可以解绑钱包地址
|
|
639
|
-
*/
|
|
640
|
-
checkWalletUnlink: (address: UserAddress, isKycVerified?: boolean) => UnlinkCheckResult;
|
|
641
|
-
/** 已绑定的总数(社交 + 钱包) */
|
|
642
|
-
totalBoundCount: number;
|
|
643
|
-
/** 是否只剩最后一个登录方式 */
|
|
644
|
-
isLastLoginMethod: boolean;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
/**
|
|
648
|
-
* 获取用户冻结资产列表
|
|
649
|
-
*
|
|
650
|
-
* @param options - 配置选项
|
|
651
|
-
* @returns 冻结资产数据和操作方法
|
|
652
|
-
*
|
|
653
|
-
* @example
|
|
654
|
-
* ```tsx
|
|
655
|
-
* const { data, loading, canResend } = useFrozenAssets({
|
|
656
|
-
* tokenId: 123,
|
|
657
|
-
* });
|
|
658
|
-
*
|
|
659
|
-
* // 渲染冻结资产列表
|
|
660
|
-
* {data.map(item => (
|
|
661
|
-
* <div key={item.lock_time}>
|
|
662
|
-
* <span>{item.locked_amount}</span>
|
|
663
|
-
* {canResend(item) && (
|
|
664
|
-
* <button onClick={() => handleResend(item)}>Resend</button>
|
|
665
|
-
* )}
|
|
666
|
-
* </div>
|
|
667
|
-
* ))}
|
|
668
|
-
* ```
|
|
669
|
-
*/
|
|
670
|
-
export declare function useFrozenAssets(options: UseFrozenAssetsOptions): UseFrozenAssetsResult;
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* useFrozenAssets Hook 配置选项
|
|
674
|
-
*/
|
|
675
|
-
export declare interface UseFrozenAssetsOptions {
|
|
676
|
-
/** Token ID */
|
|
677
|
-
tokenId: number;
|
|
678
|
-
/** 每页条数,默认 10 */
|
|
679
|
-
pageSize?: number;
|
|
680
|
-
/** 是否自动加载,默认 true */
|
|
681
|
-
autoLoad?: boolean;
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
/**
|
|
685
|
-
* useFrozenAssets Hook 返回结果
|
|
686
|
-
*/
|
|
687
|
-
export declare interface UseFrozenAssetsResult {
|
|
688
|
-
/** 冻结资产列表 */
|
|
689
|
-
data: LockedTokenListItem[];
|
|
690
|
-
/** 是否正在加载 */
|
|
691
|
-
loading: boolean;
|
|
692
|
-
/** 错误信息 */
|
|
693
|
-
error: Error | null;
|
|
694
|
-
/** 总条数 */
|
|
695
|
-
total: number;
|
|
696
|
-
/** 分页控制器 */
|
|
697
|
-
pagination: UsePaginationResult;
|
|
698
|
-
/** 手动刷新 */
|
|
699
|
-
refresh: () => Promise<void>;
|
|
700
|
-
/** 检查是否可重发(type === 'Withdraw') */
|
|
701
|
-
canResend: (item: LockedTokenListItem) => boolean;
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
/**
|
|
705
|
-
* 获取用户 Identity 数据
|
|
706
|
-
*
|
|
707
|
-
* 从 TaskOnContext 的 userInfo 中提取社交账号和钱包地址信息,
|
|
708
|
-
* 并转换为 Identity Tab 展示所需的格式。
|
|
709
|
-
*
|
|
710
|
-
* @returns Identity 数据和状态
|
|
711
|
-
*
|
|
712
|
-
* @example
|
|
713
|
-
* ```tsx
|
|
714
|
-
* const { socialAccounts, walletAddresses, isLoaded } = useIdentityData();
|
|
715
|
-
*
|
|
716
|
-
* // 渲染社交账号列表
|
|
717
|
-
* {socialAccounts.map((account) => (
|
|
718
|
-
* <SocialAccountItem
|
|
719
|
-
* key={account.snsType}
|
|
720
|
-
* type={account.snsType}
|
|
721
|
-
* isBound={account.isBound}
|
|
722
|
-
* username={account.account?.sns_user_name}
|
|
723
|
-
* profileUrl={account.profileUrl}
|
|
724
|
-
* />
|
|
725
|
-
* ))}
|
|
726
|
-
* ```
|
|
727
|
-
*/
|
|
728
|
-
export declare function useIdentityData(): UseIdentityDataResult;
|
|
729
|
-
|
|
730
|
-
/**
|
|
731
|
-
* useIdentityData Hook 返回结果
|
|
732
|
-
*/
|
|
733
|
-
export declare interface UseIdentityDataResult {
|
|
734
|
-
/** 社交账号列表 */
|
|
735
|
-
socialAccounts: SocialAccountData[];
|
|
736
|
-
/** 钱包地址列表 */
|
|
737
|
-
walletAddresses: WalletAddressData[];
|
|
738
|
-
/** 原始 SNS 列表 */
|
|
739
|
-
rawSns: SnsItem[];
|
|
740
|
-
/** 原始地址列表 */
|
|
741
|
-
rawAddresses: UserAddress[];
|
|
742
|
-
/** 是否已加载用户信息 */
|
|
743
|
-
isLoaded: boolean;
|
|
744
|
-
/** 已绑定的账号总数(社交 + 钱包) */
|
|
745
|
-
totalBoundCount: number;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
/**
|
|
749
|
-
* usePagination Hook 返回值
|
|
750
|
-
*/
|
|
751
|
-
declare interface UsePaginationResult {
|
|
752
|
-
/** 当前页码(从 0 开始) */
|
|
753
|
-
page: number;
|
|
754
|
-
/** 总页数 */
|
|
755
|
-
totalPages: number;
|
|
756
|
-
/** 是否有上一页 */
|
|
757
|
-
hasPrevious: boolean;
|
|
758
|
-
/** 是否有下一页 */
|
|
759
|
-
hasNext: boolean;
|
|
760
|
-
/** 跳转到指定页 */
|
|
761
|
-
goToPage: (page: number) => void;
|
|
762
|
-
/** 上一页 */
|
|
763
|
-
goToPrevious: () => void;
|
|
764
|
-
/** 下一页 */
|
|
765
|
-
goToNext: () => void;
|
|
766
|
-
/** 重置到第一页 */
|
|
767
|
-
reset: () => void;
|
|
768
|
-
/** 当前页显示的起始序号(从 1 开始) */
|
|
769
|
-
startIndex: number;
|
|
770
|
-
/** 当前页显示的结束序号 */
|
|
771
|
-
endIndex: number;
|
|
772
|
-
/** 加载更多(infinite 模式专用) */
|
|
773
|
-
loadMore: () => void;
|
|
774
|
-
/** 是否还有更多数据(infinite 模式专用) */
|
|
775
|
-
hasMore: boolean;
|
|
776
|
-
/** 当前已加载的总条数(infinite 模式专用) */
|
|
777
|
-
loadedCount: number;
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
/**
|
|
781
|
-
* 获取用户积分历史 Hook
|
|
782
|
-
*
|
|
783
|
-
* @example
|
|
784
|
-
* ```tsx
|
|
785
|
-
* const {
|
|
786
|
-
* data,
|
|
787
|
-
* loading,
|
|
788
|
-
* error,
|
|
789
|
-
* pagination,
|
|
790
|
-
* refresh
|
|
791
|
-
* } = usePointsHistory({
|
|
792
|
-
* pointsId: 456,
|
|
793
|
-
* });
|
|
794
|
-
* ```
|
|
795
|
-
*/
|
|
796
|
-
export declare function usePointsHistory(options: UsePointsHistoryOptions): UsePointsHistoryResult;
|
|
797
|
-
|
|
798
|
-
/**
|
|
799
|
-
* usePointsHistory 配置选项
|
|
800
|
-
*/
|
|
801
|
-
export declare interface UsePointsHistoryOptions {
|
|
802
|
-
/** 积分 ID */
|
|
803
|
-
pointsId: number;
|
|
804
|
-
/** 每页条数,默认 10 */
|
|
805
|
-
pageSize?: number;
|
|
806
|
-
/** 是否自动加载 */
|
|
807
|
-
autoLoad?: boolean;
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
/**
|
|
811
|
-
* usePointsHistory 返回结果
|
|
812
|
-
*/
|
|
813
|
-
export declare interface UsePointsHistoryResult {
|
|
814
|
-
/** 积分历史列表 */
|
|
815
|
-
data: UserPointsHistoryListItem[];
|
|
816
|
-
/** 加载状态 */
|
|
817
|
-
loading: boolean;
|
|
818
|
-
/** 错误信息 */
|
|
819
|
-
error: Error | null;
|
|
820
|
-
/** 总数 */
|
|
821
|
-
total: number;
|
|
822
|
-
/** 分页控制器 */
|
|
823
|
-
pagination: UsePaginationResult;
|
|
824
|
-
/** 刷新数据 */
|
|
825
|
-
refresh: () => void;
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
/**
|
|
829
|
-
* UserCenter Widget 国际化消息类型定义
|
|
830
|
-
*/
|
|
831
|
-
export declare interface UserCenterMessages {
|
|
832
|
-
/** My Rewards Tab */
|
|
833
|
-
tabMyRewards: string;
|
|
834
|
-
/** Identity Tab */
|
|
835
|
-
tabIdentity: string;
|
|
836
|
-
/** Activity History Tab */
|
|
837
|
-
tabActivityHistory: string;
|
|
838
|
-
/** Rewards Tab (新设计) */
|
|
839
|
-
tabRewards: string;
|
|
840
|
-
/** Sprint & Odyssey History Tab (新设计) */
|
|
841
|
-
tabSprintOdysseyHistory: string;
|
|
842
|
-
/** "You have earned" 标题 */
|
|
843
|
-
sectionYouHaveEarned: string;
|
|
844
|
-
/** Token 卡片标题 */
|
|
845
|
-
rewardToken: string;
|
|
846
|
-
/** XP & Level 卡片标题 */
|
|
847
|
-
rewardXpLevel: string;
|
|
848
|
-
/** NFT 卡片标题 */
|
|
849
|
-
rewardNft: string;
|
|
850
|
-
/** Whitelist 卡片标题 */
|
|
851
|
-
rewardWhitelist: string;
|
|
852
|
-
/** Discord Role 卡片标题 */
|
|
853
|
-
rewardDiscordRole: string;
|
|
854
|
-
/** Points 卡片标题 */
|
|
855
|
-
rewardPoints: string;
|
|
856
|
-
/** 可提取资产标题 */
|
|
857
|
-
withdrawableAssets: string;
|
|
858
|
-
/** Token 历史标题 */
|
|
859
|
-
tokenHistory: string;
|
|
860
|
-
/** 提现按钮 */
|
|
861
|
-
withdraw: string;
|
|
862
|
-
/** 批量提现 */
|
|
863
|
-
batchWithdraw: string;
|
|
864
|
-
/** 冻结资产 */
|
|
865
|
-
frozenAssets: string;
|
|
866
|
-
/** 重发交易 */
|
|
867
|
-
resend: string;
|
|
868
|
-
/** 待处理提现提示 */
|
|
869
|
-
pendingWithdrawals: string;
|
|
870
|
-
/** 提现确认标题 */
|
|
871
|
-
withdrawConfirm: string;
|
|
872
|
-
/** 提现成功 */
|
|
873
|
-
withdrawSuccess: string;
|
|
874
|
-
/** 提现取消 */
|
|
875
|
-
withdrawCanceled: string;
|
|
876
|
-
/** Gas 不足 */
|
|
877
|
-
gasNotEnough: string;
|
|
878
|
-
/** 重试按钮 */
|
|
879
|
-
retry: string;
|
|
880
|
-
/** 确认提现提示文本 */
|
|
881
|
-
confirmWithdraw: string;
|
|
882
|
-
/** 提现处理中 */
|
|
883
|
-
withdrawing: string;
|
|
884
|
-
/** 确认按钮 */
|
|
885
|
-
confirm: string;
|
|
886
|
-
/** 取消按钮 */
|
|
887
|
-
cancel: string;
|
|
888
|
-
/** 关闭按钮 */
|
|
889
|
-
close: string;
|
|
890
|
-
/** Detail 列标题 */
|
|
891
|
-
columnDetail: string;
|
|
892
|
-
/** Duration 列标题 */
|
|
893
|
-
columnDuration: string;
|
|
894
|
-
/** 活动名称列标题 */
|
|
895
|
-
activityName: string;
|
|
896
|
-
/** 活动时间列标题 */
|
|
897
|
-
activityTime: string;
|
|
898
|
-
/** 等级标签 */
|
|
899
|
-
level: string;
|
|
900
|
-
/** 总 XP 标签 */
|
|
901
|
-
totalXp: string;
|
|
902
|
-
/** 升级所需 XP */
|
|
903
|
-
xpToNextLevel: string;
|
|
904
|
-
/** XP 历史标题 */
|
|
905
|
-
xpHistory: string;
|
|
906
|
-
/** 总积分标签 */
|
|
907
|
-
totalPoints: string;
|
|
908
|
-
/** 空状态 - 无积分 */
|
|
909
|
-
emptyPoints: string;
|
|
910
|
-
/** 积分历史标题 */
|
|
911
|
-
pointsHistory: string;
|
|
912
|
-
/** 页码文本 */
|
|
913
|
-
page: string;
|
|
914
|
-
/** of 文本 */
|
|
915
|
-
of: string;
|
|
916
|
-
/** 上一页 */
|
|
917
|
-
previous: string;
|
|
918
|
-
/** 下一页 */
|
|
919
|
-
next: string;
|
|
920
|
-
/** 加载更多 */
|
|
921
|
-
loadMore: string;
|
|
922
|
-
/** 显示范围文本 (如 "Showing 1-10 of 100") */
|
|
923
|
-
showing: string;
|
|
924
|
-
/** 社交账号区域标题 */
|
|
925
|
-
socialAccounts: string;
|
|
926
|
-
/** 钱包地址区域标题 */
|
|
927
|
-
walletAddresses: string;
|
|
928
|
-
/** Email Address 区域标题 */
|
|
929
|
-
emailAddress: string;
|
|
930
|
-
/** 绑定按钮 */
|
|
931
|
-
bind: string;
|
|
932
|
-
/** 解绑按钮 */
|
|
933
|
-
unbind: string;
|
|
934
|
-
/** 连接钱包按钮 */
|
|
935
|
-
connectWallet: string;
|
|
936
|
-
/** 绑定中提示 */
|
|
937
|
-
binding: string;
|
|
938
|
-
/** 解绑中提示 */
|
|
939
|
-
unbinding: string;
|
|
940
|
-
/** 社交账号绑定 TODO 提示 */
|
|
941
|
-
bindSocialTodo: string;
|
|
942
|
-
/** 确认解绑标题 */
|
|
943
|
-
confirmUnbind: string;
|
|
944
|
-
/** 解绑警告 */
|
|
945
|
-
unbindWarning: string;
|
|
946
|
-
/** KYC 警告 */
|
|
947
|
-
kycWarning: string;
|
|
948
|
-
/** 解绑冷却期提示 */
|
|
949
|
-
unbindCooldown: string;
|
|
950
|
-
/** 最后登录方式提示 */
|
|
951
|
-
lastLoginMethod: string;
|
|
952
|
-
/** 解绑成功 */
|
|
953
|
-
unbindSuccess: string;
|
|
954
|
-
/** 解绑失败 */
|
|
955
|
-
unbindFailed: string;
|
|
956
|
-
/** 绑定成功 */
|
|
957
|
-
bindSuccess: string;
|
|
958
|
-
/** 绑定失败 */
|
|
959
|
-
bindFailed: string;
|
|
960
|
-
/** 钱包连接中 */
|
|
961
|
-
connectingWallet: string;
|
|
962
|
-
/** 签名中 */
|
|
963
|
-
signingMessage: string;
|
|
964
|
-
/** 空状态 - 无配置的身份选项 */
|
|
965
|
-
emptyIdentity: string;
|
|
966
|
-
/** 绑定邮箱账号标题 */
|
|
967
|
-
linkEmailAccount?: string;
|
|
968
|
-
/** 请输入邮箱地址 */
|
|
969
|
-
pleaseEnterEmail?: string;
|
|
970
|
-
/** 请输入有效的邮箱地址 */
|
|
971
|
-
pleaseEnterValidEmail?: string;
|
|
972
|
-
/** 验证码 */
|
|
973
|
-
verificationCode?: string;
|
|
974
|
-
/** 请输入验证码 */
|
|
975
|
-
pleaseEnterCode?: string;
|
|
976
|
-
/** 请输入有效的验证码 */
|
|
977
|
-
pleaseEnterValidCode?: string;
|
|
978
|
-
/** 发送验证码 */
|
|
979
|
-
sendVerificationCode?: string;
|
|
980
|
-
/** 重发验证码 */
|
|
981
|
-
resendCode?: string;
|
|
982
|
-
/** 邮箱已被其他账号绑定 */
|
|
983
|
-
emailAlreadyLinked?: string;
|
|
984
|
-
/** 发送验证码成功 */
|
|
985
|
-
sendCodeSuccess?: string;
|
|
986
|
-
/** 发送验证码失败 */
|
|
987
|
-
sendCodeFailed?: string;
|
|
988
|
-
/** 加载中 */
|
|
989
|
-
loading: string;
|
|
990
|
-
/** 错误提示 */
|
|
991
|
-
error: string;
|
|
992
|
-
/** 空状态 - 无奖励 */
|
|
993
|
-
emptyRewards: string;
|
|
994
|
-
/** 空状态 - 无活动历史 */
|
|
995
|
-
emptyActivityHistory: string;
|
|
996
|
-
/** 空状态 - 无 Token */
|
|
997
|
-
emptyToken: string;
|
|
998
|
-
/** 空状态 - 无 NFT */
|
|
999
|
-
emptyNft: string;
|
|
1000
|
-
/** 空状态通用 */
|
|
1001
|
-
noData: string;
|
|
1002
|
-
/** Claim 按钮文本 */
|
|
1003
|
-
claim: string;
|
|
1004
|
-
/** 已领取(交易)链接文本 */
|
|
1005
|
-
claimedTxn: string;
|
|
1006
|
-
/** 手动发放文本 */
|
|
1007
|
-
manualDrop: string;
|
|
1008
|
-
/** NFT 列标题 */
|
|
1009
|
-
columnNft: string;
|
|
1010
|
-
/** Whitelist 列标题 */
|
|
1011
|
-
columnWhitelist: string;
|
|
1012
|
-
/** Discord Role 列标题 */
|
|
1013
|
-
columnDiscordRole: string;
|
|
1014
|
-
/** Time 列标题 */
|
|
1015
|
-
columnTime: string;
|
|
1016
|
-
/** Status 列标题 */
|
|
1017
|
-
columnStatus: string;
|
|
1018
|
-
/** Amount 列标题 */
|
|
1019
|
-
columnAmount: string;
|
|
1020
|
-
/** Deposited(TaskOn 托管发放) */
|
|
1021
|
-
deposited: string;
|
|
1022
|
-
/** Distributed by(社区自己发放) */
|
|
1023
|
-
distributedBy: string;
|
|
1024
|
-
/** 类型列标题 */
|
|
1025
|
-
columnTokenType: string;
|
|
1026
|
-
/** 可提现金额列标题 */
|
|
1027
|
-
columnAmountWithdrawable: string;
|
|
1028
|
-
/** 提现金额列标题 */
|
|
1029
|
-
columnWithdrawAmount: string;
|
|
1030
|
-
/** 选择 Token 标签 */
|
|
1031
|
-
selectToken: string;
|
|
1032
|
-
/** Token 金额标签 */
|
|
1033
|
-
tokenAmount: string;
|
|
1034
|
-
/** 接收地址标签 */
|
|
1035
|
-
receiveAddress: string;
|
|
1036
|
-
/** 最大值按钮 */
|
|
1037
|
-
max: string;
|
|
1038
|
-
/** 可用余额 */
|
|
1039
|
-
availableBalance: string;
|
|
1040
|
-
/** 请选择 Token */
|
|
1041
|
-
pleaseSelectToken: string;
|
|
1042
|
-
/** 请输入有效金额 */
|
|
1043
|
-
pleaseEnterValidAmount: string;
|
|
1044
|
-
/** 金额超过可用余额 */
|
|
1045
|
-
amountExceedsBalance: string;
|
|
1046
|
-
/** 提现处理中提示 */
|
|
1047
|
-
withdrawingTip: string;
|
|
1048
|
-
/** Token Symbol 列标题 */
|
|
1049
|
-
columnTokenSymbol?: string;
|
|
1050
|
-
/** Network 列标题 */
|
|
1051
|
-
columnNetwork?: string;
|
|
1052
|
-
/** Withdrawable 列标题 */
|
|
1053
|
-
columnWithdrawable?: string;
|
|
1054
|
-
/** Action 列标题 */
|
|
1055
|
-
columnAction?: string;
|
|
1056
|
-
/** OK 按钮文本 */
|
|
1057
|
-
ok?: string;
|
|
1058
|
-
/** Claim NFT 弹窗标题 */
|
|
1059
|
-
claimNft?: string;
|
|
1060
|
-
/** 已绑定标签 */
|
|
1061
|
-
linked?: string;
|
|
1062
|
-
/** 连接平台账号文本(支持 {platform} 变量) */
|
|
1063
|
-
linkPlatformAccount?: string;
|
|
1064
|
-
/** 提现取消提示信息 */
|
|
1065
|
-
withdrawCanceledMessage?: string;
|
|
1066
|
-
/** Campaign 锁定 */
|
|
1067
|
-
frozenTypeCampaign?: string;
|
|
1068
|
-
/** 提现中 */
|
|
1069
|
-
frozenTypeWithdraw?: string;
|
|
1070
|
-
/** 邀请奖励锁定 */
|
|
1071
|
-
frozenTypeReferral?: string;
|
|
1072
|
-
/** 权益锁定 */
|
|
1073
|
-
frozenTypeBenefit?: string;
|
|
1074
|
-
/** TG Mini App */
|
|
1075
|
-
frozenTypeTgMiniApp?: string;
|
|
1076
|
-
/** 里程碑锁定 */
|
|
1077
|
-
frozenTypeMilestone?: string;
|
|
1078
|
-
/** Claiming 中提示 */
|
|
1079
|
-
claimingNft?: string;
|
|
1080
|
-
/** 连接钱包中 */
|
|
1081
|
-
claimConnectingWallet?: string;
|
|
1082
|
-
/** 切换网络中 */
|
|
1083
|
-
claimSwitchingNetwork?: string;
|
|
1084
|
-
/** 获取签名中 */
|
|
1085
|
-
claimGettingSignature?: string;
|
|
1086
|
-
/** 请在钱包中确认 */
|
|
1087
|
-
claimConfirmInWallet?: string;
|
|
1088
|
-
/** 交易 Pending 中 */
|
|
1089
|
-
claimTransactionPending?: string;
|
|
1090
|
-
/** Claim 成功 */
|
|
1091
|
-
claimSuccess?: string;
|
|
1092
|
-
/** Claim 失败 */
|
|
1093
|
-
claimFailed?: string;
|
|
1094
|
-
/** 用户取消 Claim */
|
|
1095
|
-
claimCanceled?: string;
|
|
1096
|
-
/** 查看交易 */
|
|
1097
|
-
viewOnExplorer?: string;
|
|
1098
|
-
/** Pending 交易标题 */
|
|
1099
|
-
pendingTransaction?: string;
|
|
1100
|
-
/** Pending 交易提示 */
|
|
1101
|
-
pendingTxMessage?: string;
|
|
1102
|
-
/** Pending 标题(原版文案) */
|
|
1103
|
-
claimPendingTitle?: string;
|
|
1104
|
-
/** Pending 跳转区块浏览器提示 */
|
|
1105
|
-
claimPendingCheckExplorer?: string;
|
|
1106
|
-
/** Pending 哈希标签 */
|
|
1107
|
-
claimPendingHashLabel?: string;
|
|
1108
|
-
/** Claim Again 风险提示 */
|
|
1109
|
-
claimPendingClaimAgainWarn?: string;
|
|
1110
|
-
/** 重发时接收地址不可更改提示 */
|
|
1111
|
-
claimPendingReceiveAddressNoChange?: string;
|
|
1112
|
-
/** 继续等待 */
|
|
1113
|
-
continueWaiting?: string;
|
|
1114
|
-
/** 重新 Claim */
|
|
1115
|
-
claimAgain?: string;
|
|
1116
|
-
/** 无钱包错误 */
|
|
1117
|
-
errorNoWallet?: string;
|
|
1118
|
-
/** 地址不匹配错误 */
|
|
1119
|
-
errorAddressMismatch?: string;
|
|
1120
|
-
/** 网络切换失败 */
|
|
1121
|
-
errorNetworkSwitch?: string;
|
|
1122
|
-
/** Gas 不足错误 */
|
|
1123
|
-
errorInsufficientGas?: string;
|
|
1124
|
-
/** 提现前未绑定钱包地址 */
|
|
1125
|
-
walletNotBind?: string;
|
|
1126
|
-
}
|
|
1127
5
|
|
|
1128
6
|
/**
|
|
1129
7
|
* UserCenterWidget 外层组件
|
|
@@ -1175,490 +53,4 @@ export declare interface UserCenterWidgetProps {
|
|
|
1175
53
|
style?: default_2.CSSProperties;
|
|
1176
54
|
}
|
|
1177
55
|
|
|
1178
|
-
/**
|
|
1179
|
-
* 获取用户社区奖励详情列表
|
|
1180
|
-
*
|
|
1181
|
-
* @param options - 配置选项
|
|
1182
|
-
* @returns 奖励详情数据和操作方法
|
|
1183
|
-
*
|
|
1184
|
-
* @example
|
|
1185
|
-
* ```tsx
|
|
1186
|
-
* // 获取 Token 奖励历史
|
|
1187
|
-
* const { data, loading, pagination } = useRewardDetails({
|
|
1188
|
-
* rewardType: 'Token',
|
|
1189
|
-
* });
|
|
1190
|
-
*
|
|
1191
|
-
* // 获取 NFT 列表
|
|
1192
|
-
* const { data: nfts } = useRewardDetails({
|
|
1193
|
-
* rewardType: 'Nft',
|
|
1194
|
-
* });
|
|
1195
|
-
* ```
|
|
1196
|
-
*/
|
|
1197
|
-
export declare function useRewardDetails(options: UseRewardDetailsOptions): UseRewardDetailsResult;
|
|
1198
|
-
|
|
1199
|
-
/**
|
|
1200
|
-
* useRewardDetails Hook 配置选项
|
|
1201
|
-
*/
|
|
1202
|
-
export declare interface UseRewardDetailsOptions {
|
|
1203
|
-
/** 奖励类型 */
|
|
1204
|
-
rewardType: RewardType;
|
|
1205
|
-
/** 每页条数,默认 10 */
|
|
1206
|
-
pageSize?: number;
|
|
1207
|
-
/** 分页模式 */
|
|
1208
|
-
mode?: PaginationMode;
|
|
1209
|
-
/** 是否自动加载,默认 true */
|
|
1210
|
-
autoLoad?: boolean;
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
/**
|
|
1214
|
-
* useRewardDetails Hook 返回结果
|
|
1215
|
-
*/
|
|
1216
|
-
export declare interface UseRewardDetailsResult {
|
|
1217
|
-
/** 奖励详情列表 */
|
|
1218
|
-
data: MyCommunityRewardDetails[];
|
|
1219
|
-
/** 是否正在加载 */
|
|
1220
|
-
loading: boolean;
|
|
1221
|
-
/** 错误信息 */
|
|
1222
|
-
error: Error | null;
|
|
1223
|
-
/** 总条数 */
|
|
1224
|
-
total: number;
|
|
1225
|
-
/** 分页控制器 */
|
|
1226
|
-
pagination: UsePaginationResult;
|
|
1227
|
-
/** 手动刷新 */
|
|
1228
|
-
refresh: () => Promise<void>;
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
/**
|
|
1232
|
-
* 获取用户可提取的 Token 资产列表
|
|
1233
|
-
*
|
|
1234
|
-
* @param options - 配置选项
|
|
1235
|
-
* @returns Token 资产数据和操作方法
|
|
1236
|
-
*
|
|
1237
|
-
* @example
|
|
1238
|
-
* ```tsx
|
|
1239
|
-
* const { data, loading, pendingWithdrawals } = useTokenAssets();
|
|
1240
|
-
*
|
|
1241
|
-
* // 渲染 Token 列表
|
|
1242
|
-
* <TokenAssetList
|
|
1243
|
-
* data={data}
|
|
1244
|
-
* loading={loading}
|
|
1245
|
-
* pendingWithdrawals={pendingWithdrawals}
|
|
1246
|
-
* />
|
|
1247
|
-
* ```
|
|
1248
|
-
*/
|
|
1249
|
-
export declare function useTokenAssets(options?: UseTokenAssetsOptions): UseTokenAssetsResult;
|
|
1250
|
-
|
|
1251
|
-
/**
|
|
1252
|
-
* useTokenAssets Hook 配置选项
|
|
1253
|
-
*/
|
|
1254
|
-
export declare interface UseTokenAssetsOptions {
|
|
1255
|
-
/** 每页条数,默认 10 */
|
|
1256
|
-
pageSize?: number;
|
|
1257
|
-
/** 分页模式 */
|
|
1258
|
-
mode?: PaginationMode;
|
|
1259
|
-
/** 是否自动加载,默认 true */
|
|
1260
|
-
autoLoad?: boolean;
|
|
1261
|
-
/** 是否获取全部 */
|
|
1262
|
-
getAll?: boolean;
|
|
1263
|
-
/** 指定 token 查询,0 表示全部 */
|
|
1264
|
-
tokenId?: number;
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
|
-
/**
|
|
1268
|
-
* useTokenAssets Hook 返回结果
|
|
1269
|
-
*/
|
|
1270
|
-
export declare interface UseTokenAssetsResult {
|
|
1271
|
-
/** Token 余额列表 */
|
|
1272
|
-
data: UserTokenBalanceListItem[];
|
|
1273
|
-
/** 是否正在加载 */
|
|
1274
|
-
loading: boolean;
|
|
1275
|
-
/** 错误信息 */
|
|
1276
|
-
error: Error | null;
|
|
1277
|
-
/** 总条数 */
|
|
1278
|
-
total: number;
|
|
1279
|
-
/** 待处理提现数量 */
|
|
1280
|
-
pendingWithdrawals: number;
|
|
1281
|
-
/** 分页控制器 */
|
|
1282
|
-
pagination: UsePaginationResult;
|
|
1283
|
-
/** 手动刷新 */
|
|
1284
|
-
refresh: () => Promise<void>;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
/**
|
|
1288
|
-
* Token 提现状态机 Hook
|
|
1289
|
-
*
|
|
1290
|
-
* @param options - 配置选项
|
|
1291
|
-
* @returns 提现状态和操作方法
|
|
1292
|
-
*
|
|
1293
|
-
* @example
|
|
1294
|
-
* ```tsx
|
|
1295
|
-
* const {
|
|
1296
|
-
* status,
|
|
1297
|
-
* tokens,
|
|
1298
|
-
* isGasInsufficient,
|
|
1299
|
-
* initWithdraw,
|
|
1300
|
-
* checkAndConnect,
|
|
1301
|
-
* confirmWithdraw,
|
|
1302
|
-
* cancelWithdraw,
|
|
1303
|
-
* } = useTokenWithdraw({
|
|
1304
|
-
* userAddress: user.bindAddress,
|
|
1305
|
-
* onSuccess: (txHash) => console.log('提现成功:', txHash),
|
|
1306
|
-
* });
|
|
1307
|
-
*
|
|
1308
|
-
* // 发起提现
|
|
1309
|
-
* const handleWithdraw = async (token) => {
|
|
1310
|
-
* initWithdraw(token);
|
|
1311
|
-
* const canProceed = await checkAndConnect();
|
|
1312
|
-
* if (canProceed && !isGasInsufficient) {
|
|
1313
|
-
* // 显示确认弹窗
|
|
1314
|
-
* }
|
|
1315
|
-
* };
|
|
1316
|
-
*
|
|
1317
|
-
* // 用户确认后
|
|
1318
|
-
* await confirmWithdraw();
|
|
1319
|
-
* ```
|
|
1320
|
-
*/
|
|
1321
|
-
export declare function useTokenWithdraw(options?: UseTokenWithdrawOptions): UseTokenWithdrawResult;
|
|
1322
|
-
|
|
1323
|
-
/**
|
|
1324
|
-
* useTokenWithdraw Hook 配置选项
|
|
1325
|
-
*/
|
|
1326
|
-
export declare interface UseTokenWithdrawOptions {
|
|
1327
|
-
/** 用户绑定的钱包地址(用于验证) */
|
|
1328
|
-
userAddress?: string;
|
|
1329
|
-
/** 冻结资产重发参数(用于重发失败的提现交易) */
|
|
1330
|
-
resend?: ResendParams;
|
|
1331
|
-
/** 提现完成回调 */
|
|
1332
|
-
onSuccess?: (txHash: string) => void;
|
|
1333
|
-
/** 提现取消回调 */
|
|
1334
|
-
onCancel?: () => void;
|
|
1335
|
-
/** 提现失败回调 */
|
|
1336
|
-
onError?: (error: Error) => void;
|
|
1337
|
-
/** 钱包连接成功回调 */
|
|
1338
|
-
onConnect?: (address: string) => void;
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
/**
|
|
1342
|
-
* useTokenWithdraw Hook 返回结果
|
|
1343
|
-
*/
|
|
1344
|
-
export declare interface UseTokenWithdrawResult {
|
|
1345
|
-
/** 当前状态 */
|
|
1346
|
-
status: WithdrawStatus;
|
|
1347
|
-
/** 待提现的 Token 列表 */
|
|
1348
|
-
tokens: WithdrawTokenItem[];
|
|
1349
|
-
/** 错误信息 */
|
|
1350
|
-
error: Error | null;
|
|
1351
|
-
/** 错误类型 */
|
|
1352
|
-
errorType: TxErrorType | null;
|
|
1353
|
-
/** 交易哈希(成功后) */
|
|
1354
|
-
txHash: string | null;
|
|
1355
|
-
/** 是否 Gas 不足 */
|
|
1356
|
-
isGasInsufficient: boolean;
|
|
1357
|
-
/** 是否为重发交易 */
|
|
1358
|
-
isResend: boolean;
|
|
1359
|
-
/** 链信息是否已加载 */
|
|
1360
|
-
chainMapLoaded: boolean;
|
|
1361
|
-
/** 已连接的钱包地址 */
|
|
1362
|
-
connectedAddress: string | null;
|
|
1363
|
-
/** 初始化提现(单个 Token) */
|
|
1364
|
-
initWithdraw: (token: UserTokenBalanceListItem) => void;
|
|
1365
|
-
/** 初始化批量提现 */
|
|
1366
|
-
initBatchWithdraw: (tokens: UserTokenBalanceListItem[]) => void;
|
|
1367
|
-
/** 初始化提现(使用预构建的 WithdrawTokenItem,包含正确精度) */
|
|
1368
|
-
initWithdrawTokens: (items: WithdrawTokenItem[]) => void;
|
|
1369
|
-
/** 检查钱包并连接(在确认前调用) */
|
|
1370
|
-
checkAndConnect: () => Promise<boolean>;
|
|
1371
|
-
/** 确认提现 */
|
|
1372
|
-
confirmWithdraw: () => Promise<void>;
|
|
1373
|
-
/** 取消提现 */
|
|
1374
|
-
cancelWithdraw: () => void;
|
|
1375
|
-
/** 重置状态 */
|
|
1376
|
-
reset: () => void;
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
/**
|
|
1380
|
-
* 社交账号解绑 Hook
|
|
1381
|
-
*
|
|
1382
|
-
* @param options - 配置选项
|
|
1383
|
-
* @returns 解绑操作和状态
|
|
1384
|
-
*
|
|
1385
|
-
* @example
|
|
1386
|
-
* ```tsx
|
|
1387
|
-
* const { unbind, unbindStatus, error } = useUnbindSocial({
|
|
1388
|
-
* onUnbindSuccess: () => {
|
|
1389
|
-
* toast.success("解绑成功");
|
|
1390
|
-
* refreshUserInfo();
|
|
1391
|
-
* },
|
|
1392
|
-
* });
|
|
1393
|
-
*
|
|
1394
|
-
* // 解绑 Discord
|
|
1395
|
-
* await unbind("discord_user_id", "discord");
|
|
1396
|
-
* ```
|
|
1397
|
-
*/
|
|
1398
|
-
export declare function useUnbindSocial(options?: UseUnbindSocialOptions): UseUnbindSocialResult;
|
|
1399
|
-
|
|
1400
|
-
/**
|
|
1401
|
-
* useUnbindSocial Hook 配置选项
|
|
1402
|
-
*/
|
|
1403
|
-
declare interface UseUnbindSocialOptions {
|
|
1404
|
-
/** 解绑成功回调 */
|
|
1405
|
-
onUnbindSuccess?: () => void;
|
|
1406
|
-
/** 解绑失败回调 */
|
|
1407
|
-
onUnbindError?: (error: Error) => void;
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
/**
|
|
1411
|
-
* useUnbindSocial Hook 返回结果
|
|
1412
|
-
*/
|
|
1413
|
-
declare interface UseUnbindSocialResult {
|
|
1414
|
-
/** 当前解绑状态 */
|
|
1415
|
-
unbindStatus: UnbindStatus;
|
|
1416
|
-
/** 错误信息 */
|
|
1417
|
-
error: Error | null;
|
|
1418
|
-
/** 正在处理的账号类型 */
|
|
1419
|
-
processingType: SnsType | null;
|
|
1420
|
-
/**
|
|
1421
|
-
* 解绑社交账号
|
|
1422
|
-
*/
|
|
1423
|
-
unbind: (snsId: string, type: SnsType) => Promise<boolean>;
|
|
1424
|
-
/** 重置状态 */
|
|
1425
|
-
reset: () => void;
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
|
-
/**
|
|
1429
|
-
* 获取用户社区奖励汇总
|
|
1430
|
-
*
|
|
1431
|
-
* @param options - 配置选项
|
|
1432
|
-
* @returns 奖励数据和操作方法
|
|
1433
|
-
*
|
|
1434
|
-
* @example
|
|
1435
|
-
* ```tsx
|
|
1436
|
-
* const { rewards, cards, selectedCard, selectCard, loading } = useUserRewards();
|
|
1437
|
-
*
|
|
1438
|
-
* // 渲染奖励卡片
|
|
1439
|
-
* {cards.filter(c => c.visible).map(card => (
|
|
1440
|
-
* <AssetCard
|
|
1441
|
-
* key={card.type}
|
|
1442
|
-
* type={card.type}
|
|
1443
|
-
* value={card.value}
|
|
1444
|
-
* selected={selectedCard === card.type}
|
|
1445
|
-
* onClick={() => selectCard(card.type)}
|
|
1446
|
-
* />
|
|
1447
|
-
* ))}
|
|
1448
|
-
* ```
|
|
1449
|
-
*/
|
|
1450
|
-
export declare function useUserRewards(options?: UseUserRewardsOptions): UseUserRewardsResult;
|
|
1451
|
-
|
|
1452
|
-
/**
|
|
1453
|
-
* useUserRewards Hook 配置选项
|
|
1454
|
-
*/
|
|
1455
|
-
export declare interface UseUserRewardsOptions {
|
|
1456
|
-
/** 是否自动加载,默认 true */
|
|
1457
|
-
autoLoad?: boolean;
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
/**
|
|
1461
|
-
* useUserRewards Hook 返回结果
|
|
1462
|
-
*/
|
|
1463
|
-
export declare interface UseUserRewardsResult {
|
|
1464
|
-
/** 原始奖励数据 */
|
|
1465
|
-
rewards: MyCommunityRewards | null;
|
|
1466
|
-
/** 用户社区信息(包含等级数据) */
|
|
1467
|
-
userInfo: GtcUserInfo | null;
|
|
1468
|
-
/** 奖励卡片列表(已格式化) */
|
|
1469
|
-
cards: RewardCardData[];
|
|
1470
|
-
/** 当前选中的卡片类型 */
|
|
1471
|
-
selectedCard: UserCenterRewardCardType | null;
|
|
1472
|
-
/** 选择卡片 */
|
|
1473
|
-
selectCard: (type: UserCenterRewardCardType) => void;
|
|
1474
|
-
/** 是否正在加载 */
|
|
1475
|
-
loading: boolean;
|
|
1476
|
-
/** 错误信息 */
|
|
1477
|
-
error: Error | null;
|
|
1478
|
-
/** 手动刷新 */
|
|
1479
|
-
refresh: () => Promise<void>;
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
/**
|
|
1483
|
-
* 获取用户 XP Level 数据
|
|
1484
|
-
*
|
|
1485
|
-
* @param options - 配置选项
|
|
1486
|
-
* @returns XP Level 数据和操作方法
|
|
1487
|
-
*
|
|
1488
|
-
* @example
|
|
1489
|
-
* ```tsx
|
|
1490
|
-
* const { xpData, loading, error } = useXpLevel();
|
|
1491
|
-
*
|
|
1492
|
-
* if (xpData) {
|
|
1493
|
-
* console.log(`Level ${xpData.level}, ${xpData.percent}% to next level`);
|
|
1494
|
-
* }
|
|
1495
|
-
* ```
|
|
1496
|
-
*/
|
|
1497
|
-
export declare function useXpLevel(options?: UseXpLevelOptions): UseXpLevelResult;
|
|
1498
|
-
|
|
1499
|
-
/**
|
|
1500
|
-
* useXpLevel Hook 配置选项
|
|
1501
|
-
*/
|
|
1502
|
-
export declare interface UseXpLevelOptions {
|
|
1503
|
-
/** 是否自动加载,默认 true */
|
|
1504
|
-
autoLoad?: boolean;
|
|
1505
|
-
}
|
|
1506
|
-
|
|
1507
|
-
/**
|
|
1508
|
-
* useXpLevel Hook 返回结果
|
|
1509
|
-
*/
|
|
1510
|
-
export declare interface UseXpLevelResult {
|
|
1511
|
-
/** 原始用户信息数据 */
|
|
1512
|
-
userInfo: GtcUserInfo | null;
|
|
1513
|
-
/** XP Level 数据(已计算) */
|
|
1514
|
-
xpData: XpLevelData | null;
|
|
1515
|
-
/** XP Level 积分信息 */
|
|
1516
|
-
xpPointsInfo: UserPointsInfo | null;
|
|
1517
|
-
/** 所有积分列表(不包含第一个 XP Level 积分) */
|
|
1518
|
-
otherPointsList: UserPointsInfo[];
|
|
1519
|
-
/** 是否正在加载 */
|
|
1520
|
-
loading: boolean;
|
|
1521
|
-
/** 错误信息 */
|
|
1522
|
-
error: Error | null;
|
|
1523
|
-
/** 手动刷新 */
|
|
1524
|
-
refresh: () => Promise<void>;
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
/**
|
|
1528
|
-
* 钱包地址数据
|
|
1529
|
-
*/
|
|
1530
|
-
export declare interface WalletAddressData {
|
|
1531
|
-
/** 链类型(Widget 配置枚举) */
|
|
1532
|
-
chainType: UserCenterChainType;
|
|
1533
|
-
/** 链类型(字符串) */
|
|
1534
|
-
coreChainType: ChainTypeString;
|
|
1535
|
-
/** 是否已绑定 */
|
|
1536
|
-
isBound: boolean;
|
|
1537
|
-
/** 绑定的地址信息(未绑定时为 null) */
|
|
1538
|
-
address: UserAddress | null;
|
|
1539
|
-
/** 是否是主地址 */
|
|
1540
|
-
isPrimary: boolean;
|
|
1541
|
-
/** 是否已 KYC 验证(如果有此信息) */
|
|
1542
|
-
isKycVerified?: boolean;
|
|
1543
|
-
}
|
|
1544
|
-
|
|
1545
|
-
/**
|
|
1546
|
-
* 绑定/解绑状态
|
|
1547
|
-
*/
|
|
1548
|
-
export declare type WalletBindStatus = "idle" | "connecting" | "signing" | "submitting" | "success" | "error";
|
|
1549
|
-
|
|
1550
|
-
/**
|
|
1551
|
-
* WithdrawModal 组件
|
|
1552
|
-
*
|
|
1553
|
-
* @example
|
|
1554
|
-
* ```tsx
|
|
1555
|
-
* const { status, tokens, confirmWithdraw, cancelWithdraw, reset } = useTokenWithdraw();
|
|
1556
|
-
*
|
|
1557
|
-
* <WithdrawModal
|
|
1558
|
-
* open={status === 'confirm' || status === 'loading'}
|
|
1559
|
-
* status={status}
|
|
1560
|
-
* tokens={tokens}
|
|
1561
|
-
* messages={messages}
|
|
1562
|
-
* onConfirm={confirmWithdraw}
|
|
1563
|
-
* onCancel={cancelWithdraw}
|
|
1564
|
-
* onClose={reset}
|
|
1565
|
-
* />
|
|
1566
|
-
* ```
|
|
1567
|
-
*/
|
|
1568
|
-
export declare function WithdrawModal({ open, status, tokens, messages, error, txHash, isGasInsufficient, onConfirm, onCancel, onClose, }: WithdrawModalProps): default_2.ReactElement | null;
|
|
1569
|
-
|
|
1570
|
-
/**
|
|
1571
|
-
* WithdrawModal 属性
|
|
1572
|
-
*/
|
|
1573
|
-
export declare interface WithdrawModalProps {
|
|
1574
|
-
/** 是否显示 */
|
|
1575
|
-
open: boolean;
|
|
1576
|
-
/** 当前状态 */
|
|
1577
|
-
status: WithdrawStatus;
|
|
1578
|
-
/** 待提现的 Token 列表 */
|
|
1579
|
-
tokens: WithdrawTokenItem[];
|
|
1580
|
-
/** 国际化消息 */
|
|
1581
|
-
messages: UserCenterMessages;
|
|
1582
|
-
/** 错误信息 */
|
|
1583
|
-
error?: Error | null;
|
|
1584
|
-
/** 交易哈希(成功后) */
|
|
1585
|
-
txHash?: string | null;
|
|
1586
|
-
/** 是否 Gas 不足 */
|
|
1587
|
-
isGasInsufficient?: boolean;
|
|
1588
|
-
/** 确认提现 */
|
|
1589
|
-
onConfirm: () => void;
|
|
1590
|
-
/** 取消提现 */
|
|
1591
|
-
onCancel: () => void;
|
|
1592
|
-
/** 关闭弹窗 */
|
|
1593
|
-
onClose: () => void;
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
/**
|
|
1597
|
-
* 提现 Token 项
|
|
1598
|
-
*/
|
|
1599
|
-
export declare interface WithdrawTokenItem {
|
|
1600
|
-
/** Token ID */
|
|
1601
|
-
tokenId: number;
|
|
1602
|
-
/** Token 符号 */
|
|
1603
|
-
tokenSymbol: string;
|
|
1604
|
-
/** Token 图标 */
|
|
1605
|
-
tokenIcon: string;
|
|
1606
|
-
/** Token 合约地址 */
|
|
1607
|
-
tokenAddress: string;
|
|
1608
|
-
/** Token 精度(小数位数) */
|
|
1609
|
-
tokenDecimals: number;
|
|
1610
|
-
/** 链标识 */
|
|
1611
|
-
chain: string;
|
|
1612
|
-
/** 链名称 */
|
|
1613
|
-
chainLabel: string;
|
|
1614
|
-
/** 提现金额(显示值) */
|
|
1615
|
-
amount: string;
|
|
1616
|
-
/** 提现金额(Wei 单位,用于合约调用) */
|
|
1617
|
-
amountInWei?: string;
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
|
-
/**
|
|
1621
|
-
* XP Level 卡片数据
|
|
1622
|
-
*/
|
|
1623
|
-
export declare interface XpLevelCardData {
|
|
1624
|
-
/** 当前等级 */
|
|
1625
|
-
level: number;
|
|
1626
|
-
/** 当前 XP 数量 */
|
|
1627
|
-
currentXp: number;
|
|
1628
|
-
/** 下一级所需 XP */
|
|
1629
|
-
nextLevelXp: number;
|
|
1630
|
-
/** 进度百分比 (0-100) */
|
|
1631
|
-
percent: number;
|
|
1632
|
-
/** XP 积分 ID */
|
|
1633
|
-
xpPointsId: number;
|
|
1634
|
-
/** XP 积分名称 */
|
|
1635
|
-
xpPointsName: string;
|
|
1636
|
-
/** XP 积分图标 */
|
|
1637
|
-
xpPointsIcon: string;
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
/**
|
|
1641
|
-
* XP Level 数据(用于 UI 展示)
|
|
1642
|
-
*/
|
|
1643
|
-
export declare interface XpLevelData {
|
|
1644
|
-
/** 当前等级 */
|
|
1645
|
-
level: number;
|
|
1646
|
-
/** 当前 XP 数量(points_list[0].amount) */
|
|
1647
|
-
currentXp: number;
|
|
1648
|
-
/** 下一级所需 XP */
|
|
1649
|
-
nextLevelXp: number;
|
|
1650
|
-
/** 总 XP(等于 currentXp) */
|
|
1651
|
-
totalXp: number;
|
|
1652
|
-
/** 进度百分比 (0-100) */
|
|
1653
|
-
percent: number;
|
|
1654
|
-
/** 距离下一级还需要的 XP */
|
|
1655
|
-
xpToNextLevel: number;
|
|
1656
|
-
/** XP 积分 ID(用于获取历史记录) */
|
|
1657
|
-
xpPointsId: number;
|
|
1658
|
-
/** XP 积分名称 */
|
|
1659
|
-
xpPointsName: string;
|
|
1660
|
-
/** XP 积分图标 */
|
|
1661
|
-
xpPointsIcon: string;
|
|
1662
|
-
}
|
|
1663
|
-
|
|
1664
56
|
export { }
|