@taskon/core 0.0.1-beta.1 → 0.0.1-beta.3
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/index.cjs +528 -151
- package/dist/index.d.ts +294 -87
- package/dist/index.js +526 -151
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1376,7 +1376,7 @@ interface TaskParamItem {
|
|
|
1376
1376
|
custom_name?: string;
|
|
1377
1377
|
/** 重复类型 */
|
|
1378
1378
|
recurrence?: RecurrenceType$1;
|
|
1379
|
-
/**
|
|
1379
|
+
/** 是否为富文本(兼容字段) */
|
|
1380
1380
|
is_rich_text?: boolean;
|
|
1381
1381
|
/** 进行中时是否可修改 */
|
|
1382
1382
|
can_modify_while_ongoing?: boolean;
|
|
@@ -1585,7 +1585,7 @@ interface CommonTemplateTaskValue {
|
|
|
1585
1585
|
hint?: string;
|
|
1586
1586
|
/** 描述文本 */
|
|
1587
1587
|
desc?: string;
|
|
1588
|
-
/**
|
|
1588
|
+
/** 是否富文本(兼容字段) */
|
|
1589
1589
|
is_rich_text?: boolean;
|
|
1590
1590
|
/** 描述字段列表 */
|
|
1591
1591
|
desc_fields?: DescField[];
|
|
@@ -1631,6 +1631,19 @@ interface SubmitTaskResult$1 {
|
|
|
1631
1631
|
/** 冷却时间(毫秒,验证失败时可能返回) */
|
|
1632
1632
|
cool_down: number;
|
|
1633
1633
|
}
|
|
1634
|
+
/** 获取单个任务卡片参数 */
|
|
1635
|
+
interface GetCommunityTaskCardInfoParams {
|
|
1636
|
+
/**
|
|
1637
|
+
* 卡片 ID
|
|
1638
|
+
* - 对 GTCTask:对应 task id
|
|
1639
|
+
* - 对 TaskChain:对应 task chain id
|
|
1640
|
+
*/
|
|
1641
|
+
card_id: number;
|
|
1642
|
+
/** 卡片类型(用于后端区分读取来源) */
|
|
1643
|
+
card_type: TaskCardType;
|
|
1644
|
+
/** 是否预览模式(B 端预览场景) */
|
|
1645
|
+
is_preview?: boolean;
|
|
1646
|
+
}
|
|
1634
1647
|
/**
|
|
1635
1648
|
* 社区任务 API 接口
|
|
1636
1649
|
*/
|
|
@@ -1644,8 +1657,14 @@ interface CommunityTaskApi {
|
|
|
1644
1657
|
community_id?: number;
|
|
1645
1658
|
community_key?: string;
|
|
1646
1659
|
is_preview?: boolean;
|
|
1647
|
-
sector_id?: number;
|
|
1660
|
+
sector_id?: number[];
|
|
1648
1661
|
}) => Promise<CommunitySectorTaskCardsItem[]>;
|
|
1662
|
+
/**
|
|
1663
|
+
* 获取单个任务卡片详情
|
|
1664
|
+
* @param params 请求参数
|
|
1665
|
+
* @returns 单个任务卡片
|
|
1666
|
+
*/
|
|
1667
|
+
getCommunityTaskCardInfo: (params: GetCommunityTaskCardInfoParams) => Promise<UserTaskCardInfo>;
|
|
1649
1668
|
/**
|
|
1650
1669
|
* 提交/验证任务
|
|
1651
1670
|
* @param params 提交参数
|
|
@@ -3251,6 +3270,7 @@ interface TaskValueItem {
|
|
|
3251
3270
|
is_ecosystem_task: boolean;
|
|
3252
3271
|
name: string;
|
|
3253
3272
|
recurrence?: RecurrenceType;
|
|
3273
|
+
/** 是否为富文本(兼容字段) */
|
|
3254
3274
|
is_rich_text?: boolean;
|
|
3255
3275
|
custom_name?: string;
|
|
3256
3276
|
}
|
|
@@ -4029,7 +4049,7 @@ interface QuestTaskInput {
|
|
|
4029
4049
|
params: string;
|
|
4030
4050
|
/** 任务名称 */
|
|
4031
4051
|
name?: string;
|
|
4032
|
-
/**
|
|
4052
|
+
/** 是否富文本(兼容字段) */
|
|
4033
4053
|
is_rich_text?: boolean;
|
|
4034
4054
|
}
|
|
4035
4055
|
|
|
@@ -4389,6 +4409,42 @@ interface WithdrawResult {
|
|
|
4389
4409
|
/** 接收地址 */
|
|
4390
4410
|
receiver_address: string;
|
|
4391
4411
|
}
|
|
4412
|
+
/**
|
|
4413
|
+
* 根据 nonce 查询同批次提现请求参数
|
|
4414
|
+
*/
|
|
4415
|
+
interface GetTokenWithdrawByNonceParams {
|
|
4416
|
+
/** 链标识 */
|
|
4417
|
+
chain: string;
|
|
4418
|
+
/** 提现 nonce */
|
|
4419
|
+
nonce: string;
|
|
4420
|
+
}
|
|
4421
|
+
/**
|
|
4422
|
+
* 同批次提现请求项
|
|
4423
|
+
*
|
|
4424
|
+
* 说明:
|
|
4425
|
+
* - 用于“冻结资产重发”场景,复原原始提现批次的 token 列表与金额。
|
|
4426
|
+
* - 前端应优先使用该接口返回的数据发起重发,避免使用当前余额替代历史请求金额。
|
|
4427
|
+
*/
|
|
4428
|
+
interface TokenWithdrawRequest {
|
|
4429
|
+
/** Token ID */
|
|
4430
|
+
token_id: number;
|
|
4431
|
+
/** Token 名称 */
|
|
4432
|
+
token_name: string;
|
|
4433
|
+
/** Token 合约地址 */
|
|
4434
|
+
token_address: string;
|
|
4435
|
+
/** Token 符号 */
|
|
4436
|
+
token_symbol: string;
|
|
4437
|
+
/** 提现金额(显示单位) */
|
|
4438
|
+
token_amount: string;
|
|
4439
|
+
/** Token 精度 */
|
|
4440
|
+
token_decimals: number;
|
|
4441
|
+
/** 链标识 */
|
|
4442
|
+
chain: string;
|
|
4443
|
+
/** 提现 nonce */
|
|
4444
|
+
nonce: string;
|
|
4445
|
+
/** 当前是否允许提现 */
|
|
4446
|
+
can_withdraw: boolean;
|
|
4447
|
+
}
|
|
4392
4448
|
/**
|
|
4393
4449
|
* 提现 Token 项(合约调用用)
|
|
4394
4450
|
*/
|
|
@@ -4406,50 +4462,6 @@ interface WithdrawTokenItem {
|
|
|
4406
4462
|
* 提现状态
|
|
4407
4463
|
*/
|
|
4408
4464
|
type WithdrawStatus = "init" | "noEnough" | "confirm" | "loading" | "cancel" | "success";
|
|
4409
|
-
/**
|
|
4410
|
-
* Gas Station 请求状态
|
|
4411
|
-
*/
|
|
4412
|
-
declare enum GasStationRequestStatus {
|
|
4413
|
-
All = "All",
|
|
4414
|
-
Pending = "Pending",
|
|
4415
|
-
Processing = "Processing",
|
|
4416
|
-
Success = "Success",
|
|
4417
|
-
Failed = "Failed"
|
|
4418
|
-
}
|
|
4419
|
-
/**
|
|
4420
|
-
* 免 Gas 提现请求参数(与普通提现参数相同)
|
|
4421
|
-
*/
|
|
4422
|
-
type TokenWithdrawFromGasStationParams = TokenWithdrawParams;
|
|
4423
|
-
/**
|
|
4424
|
-
* 免 Gas 提现响应(返回请求 ID)
|
|
4425
|
-
*/
|
|
4426
|
-
interface TokenWithdrawFromGasStationResult {
|
|
4427
|
-
/** Gas Station 请求 ID */
|
|
4428
|
-
gas_station_request_id: number;
|
|
4429
|
-
}
|
|
4430
|
-
/**
|
|
4431
|
-
* Gas Station 提现结果查询参数
|
|
4432
|
-
*/
|
|
4433
|
-
interface GetGasStationAirdropResultParams {
|
|
4434
|
-
/** Gas Station 请求 ID */
|
|
4435
|
-
gas_station_request_id?: number;
|
|
4436
|
-
}
|
|
4437
|
-
/**
|
|
4438
|
-
* Gas Station 提现结果
|
|
4439
|
-
*/
|
|
4440
|
-
interface GasStationAirdropResult {
|
|
4441
|
-
/** 交易哈希 */
|
|
4442
|
-
tx_hash: string;
|
|
4443
|
-
/** 请求状态 */
|
|
4444
|
-
gas_station_request_status: GasStationRequestStatus;
|
|
4445
|
-
}
|
|
4446
|
-
/**
|
|
4447
|
-
* 获取免 Gas 提现次数参数
|
|
4448
|
-
*/
|
|
4449
|
-
interface GetTokenWithdrawGasFreeTimesParams {
|
|
4450
|
-
/** 链标识 */
|
|
4451
|
-
chain: string;
|
|
4452
|
-
}
|
|
4453
4465
|
/**
|
|
4454
4466
|
* 获取 Token 元数据参数
|
|
4455
4467
|
*/
|
|
@@ -4702,6 +4714,8 @@ interface MyCommunityRewardDetails {
|
|
|
4702
4714
|
campaign_name: string;
|
|
4703
4715
|
/** 奖励类型 */
|
|
4704
4716
|
reward_type: RewardType;
|
|
4717
|
+
/** 奖励 ID(用于领取/提现等操作) */
|
|
4718
|
+
reward_id: number;
|
|
4705
4719
|
/** 奖励时间 */
|
|
4706
4720
|
reward_time: number;
|
|
4707
4721
|
/** 奖励分发方式 */
|
|
@@ -4825,17 +4839,11 @@ interface UserCenterApi {
|
|
|
4825
4839
|
*/
|
|
4826
4840
|
tokenWithdraw(params: TokenWithdrawParams): Promise<WithdrawResult>;
|
|
4827
4841
|
/**
|
|
4828
|
-
*
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
/**
|
|
4832
|
-
* 查询 Gas Station 提现结果
|
|
4833
|
-
*/
|
|
4834
|
-
getGasStationAirdropResult(params: GetGasStationAirdropResultParams): Promise<GasStationAirdropResult>;
|
|
4835
|
-
/**
|
|
4836
|
-
* 获取免 Gas 提现剩余次数
|
|
4842
|
+
* 根据 nonce 查询同批次提现请求
|
|
4843
|
+
*
|
|
4844
|
+
* 用于冻结资产重发场景,返回原始提现请求中的 token 列表。
|
|
4837
4845
|
*/
|
|
4838
|
-
|
|
4846
|
+
getTokenWithdrawByNonce(params: GetTokenWithdrawByNonceParams): Promise<TokenWithdrawRequest[]>;
|
|
4839
4847
|
/**
|
|
4840
4848
|
* 获取链信息(包含合约地址等配置)
|
|
4841
4849
|
* @param chainName - 可选,指定链名称过滤,不传则返回所有链
|
|
@@ -5117,13 +5125,15 @@ declare function getDefaultTabConfig(): UserCenterConfig;
|
|
|
5117
5125
|
* NftClaim 模块类型定义
|
|
5118
5126
|
*
|
|
5119
5127
|
* 包含 NFT Claim 所需的所有类型定义
|
|
5120
|
-
* 支持 Minted NFT
|
|
5128
|
+
* 支持 Standard NFT / Minted NFT / CAP NFT 三种类型
|
|
5121
5129
|
*/
|
|
5122
5130
|
|
|
5123
5131
|
/**
|
|
5124
5132
|
* NFT Claim 类型
|
|
5125
5133
|
*/
|
|
5126
5134
|
declare enum NftClaimType {
|
|
5135
|
+
/** 标准 NFT(使用 TaskOnFundNFT withdraw 方法) */
|
|
5136
|
+
Standard = "standard",
|
|
5127
5137
|
/** B 端铸造的 NFT(使用 claim 合约方法) */
|
|
5128
5138
|
Minted = "minted",
|
|
5129
5139
|
/** TaskOn 平台 NFT(使用 mint 合约方法) */
|
|
@@ -5169,13 +5179,38 @@ interface ClaimCampaignRewardNftParams {
|
|
|
5169
5179
|
reward_id: number;
|
|
5170
5180
|
}
|
|
5171
5181
|
/**
|
|
5172
|
-
*
|
|
5182
|
+
* NFT 提现请求中的单个 token 信息
|
|
5183
|
+
* 与主站 NftWithdrawTokenId 保持一致
|
|
5173
5184
|
*/
|
|
5174
|
-
interface
|
|
5175
|
-
/**
|
|
5176
|
-
|
|
5177
|
-
/**
|
|
5178
|
-
|
|
5185
|
+
interface NftWithdrawTokenId {
|
|
5186
|
+
/** NFT token id */
|
|
5187
|
+
token_id: string;
|
|
5188
|
+
/** 提现数量 */
|
|
5189
|
+
quantity: number;
|
|
5190
|
+
}
|
|
5191
|
+
/**
|
|
5192
|
+
* 标准 NFT 提现参数
|
|
5193
|
+
* 与主站 NftWithdrawParams 保持一致
|
|
5194
|
+
*/
|
|
5195
|
+
interface NftWithdrawParams {
|
|
5196
|
+
/** 链标识 */
|
|
5197
|
+
chain: string;
|
|
5198
|
+
/** NFT collection id */
|
|
5199
|
+
collection_id: number;
|
|
5200
|
+
/** 接收地址 */
|
|
5201
|
+
receiver_address: string;
|
|
5202
|
+
/** token 列表 */
|
|
5203
|
+
token_ids: NftWithdrawTokenId[];
|
|
5204
|
+
/** 重发时的原交易 nonce */
|
|
5205
|
+
nonce?: string;
|
|
5206
|
+
/** campaign/event id(主站两者都走 campaign_id 字段) */
|
|
5207
|
+
campaign_id?: number;
|
|
5208
|
+
/** campaign/event 奖励 id */
|
|
5209
|
+
reward_id?: number;
|
|
5210
|
+
/** referral 奖励 id(预留) */
|
|
5211
|
+
referral_reward_id?: number;
|
|
5212
|
+
/** benefit 订单 id(预留) */
|
|
5213
|
+
benefit_order_id?: number;
|
|
5179
5214
|
}
|
|
5180
5215
|
/**
|
|
5181
5216
|
* Minted NFT Claim 签名响应
|
|
@@ -5217,6 +5252,20 @@ interface ClaimCampaignRewardNftResult {
|
|
|
5217
5252
|
/** 总限制数量 */
|
|
5218
5253
|
total: number;
|
|
5219
5254
|
}
|
|
5255
|
+
/**
|
|
5256
|
+
* 标准 NFT 提现签名结果
|
|
5257
|
+
* 与主站 WithdrawResult 保持一致
|
|
5258
|
+
*/
|
|
5259
|
+
interface NftWithdrawResult {
|
|
5260
|
+
/** 后端签名列表 */
|
|
5261
|
+
signatures: string[];
|
|
5262
|
+
/** 交易 nonce */
|
|
5263
|
+
nonce: string;
|
|
5264
|
+
/** 过期区块高度 */
|
|
5265
|
+
expired_height: number;
|
|
5266
|
+
/** 接收地址 */
|
|
5267
|
+
receiver_address: string;
|
|
5268
|
+
}
|
|
5220
5269
|
/**
|
|
5221
5270
|
* Pending 交易信息
|
|
5222
5271
|
*/
|
|
@@ -5288,6 +5337,52 @@ interface ClaimMintedNftParams extends NftTransactionParams {
|
|
|
5288
5337
|
interface ClaimCapNftParams extends NftTransactionParams {
|
|
5289
5338
|
/** API 返回的签名响应 */
|
|
5290
5339
|
sigRes: ClaimCampaignRewardNftResult;
|
|
5340
|
+
/** CAP NFT 合约地址(对齐主站,使用 chain.contract) */
|
|
5341
|
+
contractAddress: string;
|
|
5342
|
+
}
|
|
5343
|
+
/**
|
|
5344
|
+
* Standard NFT 类型
|
|
5345
|
+
*/
|
|
5346
|
+
type WithdrawNftType = "ERC721" | "ERC1155";
|
|
5347
|
+
/**
|
|
5348
|
+
* Standard NFT 合约 withdraw 参数中的 token 数组项
|
|
5349
|
+
*/
|
|
5350
|
+
interface WithdrawNftTokenAmount {
|
|
5351
|
+
/** token id */
|
|
5352
|
+
tokenId: string;
|
|
5353
|
+
/** 数量 */
|
|
5354
|
+
amount: number;
|
|
5355
|
+
}
|
|
5356
|
+
/**
|
|
5357
|
+
* Standard NFT Withdraw 交易参数
|
|
5358
|
+
*/
|
|
5359
|
+
interface WithdrawNftTransactionParams extends NftTransactionParams {
|
|
5360
|
+
/** NftClaim API 实例 */
|
|
5361
|
+
api: NftClaimApi;
|
|
5362
|
+
/** 用户 ID */
|
|
5363
|
+
userId: number;
|
|
5364
|
+
/** 链名称(用于调用 /v1/nftWithdraw) */
|
|
5365
|
+
chainName: string;
|
|
5366
|
+
/** target id(campaign/event id) */
|
|
5367
|
+
targetId: number;
|
|
5368
|
+
/** target type(当前仅对齐 campaign/event) */
|
|
5369
|
+
targetType: "campaign" | "event";
|
|
5370
|
+
/** 奖励 ID */
|
|
5371
|
+
rewardId: number;
|
|
5372
|
+
/** TaskOnFund NFT 合约地址 */
|
|
5373
|
+
taskonfundNftContract: string;
|
|
5374
|
+
/** NFT collection id */
|
|
5375
|
+
collectionId: number;
|
|
5376
|
+
/** NFT 合约地址 */
|
|
5377
|
+
nftContract: string;
|
|
5378
|
+
/** NFT 类型(ERC721/ERC1155) */
|
|
5379
|
+
nftType: WithdrawNftType;
|
|
5380
|
+
/** token 列表 */
|
|
5381
|
+
tokens: WithdrawNftTokenAmount[];
|
|
5382
|
+
/** 重发接收地址(存在时使用原地址) */
|
|
5383
|
+
receiveAddress?: string;
|
|
5384
|
+
/** 重发 nonce(存在时触发重发) */
|
|
5385
|
+
nonce?: string;
|
|
5291
5386
|
}
|
|
5292
5387
|
/**
|
|
5293
5388
|
* NftClaim API 接口
|
|
@@ -5308,10 +5403,9 @@ interface NftClaimApi {
|
|
|
5308
5403
|
*/
|
|
5309
5404
|
claimCampaignRewardNft(params: ClaimCampaignRewardNftParams): Promise<ClaimCampaignRewardNftResult>;
|
|
5310
5405
|
/**
|
|
5311
|
-
*
|
|
5312
|
-
* 成功后不返回 txHash,需要轮询查询结果
|
|
5406
|
+
* 获取标准 NFT 提现签名参数
|
|
5313
5407
|
*/
|
|
5314
|
-
|
|
5408
|
+
nftWithdraw(params: NftWithdrawParams): Promise<NftWithdrawResult>;
|
|
5315
5409
|
}
|
|
5316
5410
|
/**
|
|
5317
5411
|
* NFT 奖励值的共同字段(用于类型判断)
|
|
@@ -5350,6 +5444,8 @@ interface StandardNftRewardValue extends NftRewardValueBase {
|
|
|
5350
5444
|
collection_id: number;
|
|
5351
5445
|
collection_name: string;
|
|
5352
5446
|
nft_address: string;
|
|
5447
|
+
nft_type?: "ERC721" | "ERC1155";
|
|
5448
|
+
token_id?: string;
|
|
5353
5449
|
quantity: number;
|
|
5354
5450
|
receiver_address?: string;
|
|
5355
5451
|
nonce?: string;
|
|
@@ -5432,6 +5528,103 @@ declare abstract class NftTransaction {
|
|
|
5432
5528
|
abstract claim(): Promise<string>;
|
|
5433
5529
|
}
|
|
5434
5530
|
|
|
5531
|
+
declare const _exports$2: {
|
|
5532
|
+
inputs: ({
|
|
5533
|
+
internalType: string;
|
|
5534
|
+
name: string;
|
|
5535
|
+
type: string;
|
|
5536
|
+
components?: undefined;
|
|
5537
|
+
} | {
|
|
5538
|
+
components: {
|
|
5539
|
+
internalType: string;
|
|
5540
|
+
name: string;
|
|
5541
|
+
type: string;
|
|
5542
|
+
}[];
|
|
5543
|
+
internalType: string;
|
|
5544
|
+
name: string;
|
|
5545
|
+
type: string;
|
|
5546
|
+
})[];
|
|
5547
|
+
name: string;
|
|
5548
|
+
outputs: never[];
|
|
5549
|
+
stateMutability: string;
|
|
5550
|
+
type: string;
|
|
5551
|
+
}[];
|
|
5552
|
+
|
|
5553
|
+
/**
|
|
5554
|
+
* Withdraw Standard NFT 交易类
|
|
5555
|
+
*
|
|
5556
|
+
* 用于领取普通 NFT 奖励(RewardType.Nft)
|
|
5557
|
+
* 逻辑与主站 WithdrawNft 保持一致:
|
|
5558
|
+
* 1. 调 /v1/nftWithdraw 获取签名参数
|
|
5559
|
+
* 2. 调 TaskOnFundNFT 合约 withdraw 方法
|
|
5560
|
+
*/
|
|
5561
|
+
|
|
5562
|
+
/**
|
|
5563
|
+
* Standard NFT Withdraw 交易类
|
|
5564
|
+
*/
|
|
5565
|
+
declare class WithdrawNft extends NftTransaction {
|
|
5566
|
+
/** API 实例 */
|
|
5567
|
+
private readonly api;
|
|
5568
|
+
/** 用户 ID */
|
|
5569
|
+
private readonly userId;
|
|
5570
|
+
/** 链名称 */
|
|
5571
|
+
private readonly chainName;
|
|
5572
|
+
/** target id(campaign/event id) */
|
|
5573
|
+
private readonly targetId;
|
|
5574
|
+
/** target type */
|
|
5575
|
+
private readonly targetType;
|
|
5576
|
+
/** 奖励 ID */
|
|
5577
|
+
private readonly rewardId;
|
|
5578
|
+
/** TaskOnFund NFT 合约地址 */
|
|
5579
|
+
private readonly taskonfundNftContract;
|
|
5580
|
+
/** NFT collection id */
|
|
5581
|
+
private readonly collectionId;
|
|
5582
|
+
/** NFT 合约地址 */
|
|
5583
|
+
private readonly nftContract;
|
|
5584
|
+
/** NFT 类型 */
|
|
5585
|
+
private readonly nftType;
|
|
5586
|
+
/** token 列表 */
|
|
5587
|
+
private readonly tokens;
|
|
5588
|
+
/** 重发接收地址 */
|
|
5589
|
+
private readonly receiveAddress?;
|
|
5590
|
+
/** 重发 nonce */
|
|
5591
|
+
private readonly nonce?;
|
|
5592
|
+
constructor(params: WithdrawNftTransactionParams);
|
|
5593
|
+
/**
|
|
5594
|
+
* 执行 Standard NFT withdraw
|
|
5595
|
+
*/
|
|
5596
|
+
withdraw(): Promise<string>;
|
|
5597
|
+
/**
|
|
5598
|
+
* 与 NftTransaction 接口保持一致
|
|
5599
|
+
*/
|
|
5600
|
+
claim(): Promise<string>;
|
|
5601
|
+
/**
|
|
5602
|
+
* 获取合约调用参数(供外部编码库使用)
|
|
5603
|
+
*/
|
|
5604
|
+
getContractCallParams(withdrawResult: NftWithdrawResult): {
|
|
5605
|
+
contractAddress: string;
|
|
5606
|
+
methodName: string;
|
|
5607
|
+
args: [
|
|
5608
|
+
bigint,
|
|
5609
|
+
number,
|
|
5610
|
+
string,
|
|
5611
|
+
{
|
|
5612
|
+
tokenId: bigint;
|
|
5613
|
+
amount: bigint;
|
|
5614
|
+
}[],
|
|
5615
|
+
string,
|
|
5616
|
+
bigint,
|
|
5617
|
+
bigint,
|
|
5618
|
+
string[]
|
|
5619
|
+
];
|
|
5620
|
+
abi: typeof _exports$2;
|
|
5621
|
+
};
|
|
5622
|
+
/**
|
|
5623
|
+
* 执行链上 withdraw 调用
|
|
5624
|
+
*/
|
|
5625
|
+
private invokeWithdraw;
|
|
5626
|
+
}
|
|
5627
|
+
|
|
5435
5628
|
declare const _exports$1: {
|
|
5436
5629
|
inputs: ({
|
|
5437
5630
|
internalType: string;
|
|
@@ -5551,6 +5744,7 @@ declare const _exports: {
|
|
|
5551
5744
|
* chainId: 1,
|
|
5552
5745
|
* userAddress: '0x...',
|
|
5553
5746
|
* sigRes: apiResponse,
|
|
5747
|
+
* contractAddress: chain.contract,
|
|
5554
5748
|
* });
|
|
5555
5749
|
*
|
|
5556
5750
|
* const txHash = await tx.claim();
|
|
@@ -5559,6 +5753,8 @@ declare const _exports: {
|
|
|
5559
5753
|
declare class ClaimCapNft extends NftTransaction {
|
|
5560
5754
|
/** API 返回的签名响应 */
|
|
5561
5755
|
private readonly sigRes;
|
|
5756
|
+
/** CAP NFT 合约地址(对齐主站 chain.contract) */
|
|
5757
|
+
private readonly contractAddress;
|
|
5562
5758
|
constructor(params: ClaimCapNftParams);
|
|
5563
5759
|
/**
|
|
5564
5760
|
* 执行 Claim 操作
|
|
@@ -5607,20 +5803,20 @@ declare class ClaimCapNft extends NftTransaction {
|
|
|
5607
5803
|
* }
|
|
5608
5804
|
* }
|
|
5609
5805
|
*
|
|
5610
|
-
* pendingKey
|
|
5611
|
-
* -
|
|
5612
|
-
* -
|
|
5806
|
+
* pendingKey 格式(与主站保持一致):
|
|
5807
|
+
* - Campaign: `campaign-${targetId}-${rewardId}`
|
|
5808
|
+
* - Event: `event-${targetId}-${rewardId}`
|
|
5613
5809
|
*/
|
|
5614
5810
|
|
|
5615
5811
|
/**
|
|
5616
5812
|
* 生成 Pending Key
|
|
5617
5813
|
*
|
|
5618
|
-
* @param
|
|
5814
|
+
* @param targetType - claim 目标类型(campaign / event / 其他业务前缀)
|
|
5619
5815
|
* @param campaignId - Campaign ID
|
|
5620
5816
|
* @param rewardId - 奖励 ID
|
|
5621
5817
|
* @returns 格式化的 pending key
|
|
5622
5818
|
*/
|
|
5623
|
-
declare function generatePendingKey(
|
|
5819
|
+
declare function generatePendingKey(targetType: string, campaignId: number, rewardId: number | string): string;
|
|
5624
5820
|
/**
|
|
5625
5821
|
* 设置 Pending Hash
|
|
5626
5822
|
*
|
|
@@ -5635,7 +5831,7 @@ declare function setPendingHash(userId: number, pendingKey: string, hash: string
|
|
|
5635
5831
|
*
|
|
5636
5832
|
* @param userId - 用户 ID
|
|
5637
5833
|
* @param pendingKey - Pending Key
|
|
5638
|
-
* @returns Pending
|
|
5834
|
+
* @returns Pending 信息,如果不存在则返回 null
|
|
5639
5835
|
*/
|
|
5640
5836
|
declare function getPendingHash(userId: number, pendingKey: string): PendingTxInfo | null;
|
|
5641
5837
|
/**
|
|
@@ -5660,7 +5856,9 @@ declare function getUserPendingHashes(userId: number): Record<string, PendingTxI
|
|
|
5660
5856
|
declare function clearAllUserPendingHashes(userId: number): void;
|
|
5661
5857
|
/**
|
|
5662
5858
|
* 清除所有过期的 Pending Hash
|
|
5663
|
-
*
|
|
5859
|
+
*
|
|
5860
|
+
* 为兼容历史 API 而保留:
|
|
5861
|
+
* 当前策略已改为与原版一致(无自动过期),因此该函数不执行任何操作。
|
|
5664
5862
|
*/
|
|
5665
5863
|
declare function cleanupExpiredPendingHashes(): void;
|
|
5666
5864
|
|
|
@@ -5682,6 +5880,12 @@ declare function isMintedNftReward(value: NftRewardValue): value is MintedNftRew
|
|
|
5682
5880
|
* CAP NFT 特征:有 gas_covered_by 字段但没有 nft_address
|
|
5683
5881
|
*/
|
|
5684
5882
|
declare function isCapNftReward(value: NftRewardValue): value is CapNftRewardValue;
|
|
5883
|
+
/**
|
|
5884
|
+
* 判断 NFT 奖励值是否是 Standard NFT 类型
|
|
5885
|
+
*
|
|
5886
|
+
* Standard NFT 特征:有 nft_address 且没有 gas_covered_by
|
|
5887
|
+
*/
|
|
5888
|
+
declare function isStandardNftReward(value: NftRewardValue): value is StandardNftRewardValue;
|
|
5685
5889
|
/**
|
|
5686
5890
|
* 获取 NFT Claim 类型
|
|
5687
5891
|
*
|
|
@@ -5702,14 +5906,7 @@ declare function getNftChainName(value: NftRewardValue): string;
|
|
|
5702
5906
|
* @param value - NFT 奖励值
|
|
5703
5907
|
* @returns Gas 覆盖类型,如果没有则返回 undefined
|
|
5704
5908
|
*/
|
|
5705
|
-
declare function getGasCoveredBy(value: NftRewardValue):
|
|
5706
|
-
/**
|
|
5707
|
-
* 判断是否使用 Gas Station(项目方/TaskOn 代付 Gas)
|
|
5708
|
-
*
|
|
5709
|
-
* @param value - NFT 奖励值
|
|
5710
|
-
* @returns 是否使用 Gas Station
|
|
5711
|
-
*/
|
|
5712
|
-
declare function shouldUseGasStation(value: NftRewardValue): boolean;
|
|
5909
|
+
declare function getGasCoveredBy(value: NftRewardValue): string | undefined;
|
|
5713
5910
|
/**
|
|
5714
5911
|
* 获取 NFT 的 collection_id
|
|
5715
5912
|
*
|
|
@@ -5799,8 +5996,6 @@ declare enum NftClaimErrorType {
|
|
|
5799
5996
|
InsufficientGas = "INSUFFICIENT_GAS",
|
|
5800
5997
|
/** 获取签名失败 */
|
|
5801
5998
|
SignatureError = "SIGNATURE_ERROR",
|
|
5802
|
-
/** Gas Station 次数不足 */
|
|
5803
|
-
GasStationNotEnough = "GAS_STATION_NOT_ENOUGH",
|
|
5804
5999
|
/** API 请求失败 */
|
|
5805
6000
|
ApiError = "API_ERROR",
|
|
5806
6001
|
/** 缺少必要的 reward_id */
|
|
@@ -5839,6 +6034,14 @@ declare class NftClaimError extends Error {
|
|
|
5839
6034
|
* 根据错误消息推断错误类型
|
|
5840
6035
|
*/
|
|
5841
6036
|
private static inferErrorType;
|
|
6037
|
+
/**
|
|
6038
|
+
* 从 unknown 错误中尽量提取可读 message,避免落到 "[object Object]"。
|
|
6039
|
+
*/
|
|
6040
|
+
private static extractErrorMessage;
|
|
6041
|
+
/**
|
|
6042
|
+
* 通过常见错误码识别是否为用户主动取消。
|
|
6043
|
+
*/
|
|
6044
|
+
private static hasUserRejectedCode;
|
|
5842
6045
|
/**
|
|
5843
6046
|
* 判断是否是用户主动取消
|
|
5844
6047
|
*/
|
|
@@ -6023,6 +6226,10 @@ interface CommunityTaskContentConfig {
|
|
|
6023
6226
|
sectors: CommunityTaskSectorItem[];
|
|
6024
6227
|
/** Display options */
|
|
6025
6228
|
displayOptions: CommunityTaskDisplayOptions;
|
|
6229
|
+
/** How reward details are displayed: popup dialog or redirect to URL */
|
|
6230
|
+
rewardDisplayMode?: RewardDisplayMode;
|
|
6231
|
+
/** Redirect URL for reward details (used when rewardDisplayMode is 'redirect') */
|
|
6232
|
+
rewardRedirectUrl?: string;
|
|
6026
6233
|
}
|
|
6027
6234
|
|
|
6028
6235
|
/**
|
|
@@ -6253,5 +6460,5 @@ declare function createPageBuilderApi(client: TaskOnClient): PageBuilderApi;
|
|
|
6253
6460
|
*/
|
|
6254
6461
|
declare function parsePageBuilderConfig(configJson?: string): PageBuilderConfig;
|
|
6255
6462
|
|
|
6256
|
-
export { ApiError, AutomaticallyWinnerDrawType$1 as AutomaticallyWinnerDrawType, CampaignAuditResult, CampaignStatus, CampaignType$1 as CampaignType, Chain$1 as Chain, ChainType, ChangeType, ClaimCapNft, ClaimMintedNft, CommonTemplateAssetType, CommunityStatus, DEFAULT_DISPLAY_OPTIONS, DEFAULT_ERROR_MESSAGES, DEFAULT_PAGE_BUILDER_CONFIG, EligibilityTemplateId, EligibilityType, EligiblityExpression, ErrorCode, FROZEN_ASSETS_PAGE_SIZE, GasCoveredByType$1 as GasCoveredByType,
|
|
6257
|
-
export type { AllTimeLeaderboardParams, AllTimeLeaderboardResponse, AllTimeRankItem, AssetInfo, BMintNftClaimSigResp, BUserBriefInfo, BindAddressParams, BindAddressResult, BindSNSParams, BindSNSResult, BoundSocialAccount, BoundWalletAddress, CampaignGasStationInfo, CampaignInfo$1 as CampaignInfo, CampaignLeaderboardParams, CampaignLeaderboardResponse, CampaignRankItem, CampaignStatusInfo, CampaignWinnerReward, CapNftRewardValue, ChainApi, ChainInfo, ChangedTaskItem, CheckUserCampaignEligibilityParams, ClaimCampaignRewardNftParams, ClaimCampaignRewardNftResult, ClaimCapNftParams,
|
|
6463
|
+
export { ApiError, AutomaticallyWinnerDrawType$1 as AutomaticallyWinnerDrawType, CampaignAuditResult, CampaignStatus, CampaignType$1 as CampaignType, Chain$1 as Chain, ChainType, ChangeType, ClaimCapNft, ClaimMintedNft, CommonTemplateAssetType, CommunityStatus, DEFAULT_DISPLAY_OPTIONS, DEFAULT_ERROR_MESSAGES, DEFAULT_PAGE_BUILDER_CONFIG, EligibilityTemplateId, EligibilityType, EligiblityExpression, ErrorCode, FROZEN_ASSETS_PAGE_SIZE, GasCoveredByType$1 as GasCoveredByType, GetTaskClass, LEADERBOARD_ROWS_OPTIONS, LEADERBOARD_TABLE_COLUMNS_BY_TYPE, LEADERBOARD_TYPE_LABELS, LeaderboardContentType, LeaderboardTableColumn, LeaderboardTableColumnRequirement, LockedType, MediaType$1 as MediaType, MeetConditionStatus, MilestoneMetricType$1 as MilestoneMetricType, NftClaimError, NftClaimErrorType, NftClaimType, NftTransaction, Operator, OuterAPIAccountType, OuterAPISnsType, PAGE_BUILDER_CONFIG_VERSION, PowTaskType, ProjectCategory, AutomaticallyWinnerDrawType as QuestAutomaticallyWinnerDrawType, MilestoneMetricType as QuestMilestoneMetricType, NftType$1 as QuestNftType, RecurrenceType as QuestRecurrenceType, RewardType as QuestRewardType, RewardsDistributeType as QuestRewardsDistributeType, TokenType as QuestTokenType, WinnerDrawType as QuestWinnerDrawType, WinnerRangeType as QuestWinnerRangeType, RecurrenceType$1 as RecurrenceType, RewardDistributedByType$1 as RewardDistributedByType, RewardType, RewardWhiteListType, RewardsDistributeType$1 as RewardsDistributeType, RouletteRewardType, SECTION_LAYOUT_RATIOS, SectionLayoutType, SnsType, TaskCardType, TaskReviewResult, TaskStatus, TaskTemplateId, TokenType$1 as TokenType, USER_CENTER_PAGE_SIZE, USER_CENTER_REWARD_CARD_LABELS, USER_CENTER_REWARD_CARD_TYPES, USER_CENTER_TAB_LABELS, UserCenterAccountType, UserCenterChainType, UserCenterRewardCardType, UserCenterTabType, UserEligibleStatus, UserIdentityType, VerifyCodeType, WidgetTypeEnum, WinnerDrawType$1 as WinnerDrawType, WinnerRangeType$1 as WinnerRangeType, WithdrawNft, apiIcon, _exports$1 as bMintedNftAbi, buildSwapTokenText, calculatePrizePool, _exports as capNftAbi, checkinIcon, cleanupExpiredPendingHashes, clearAllUserPendingHashes, clearPendingHash, contractInteractiveIcon, createChainApi, createCommonApi, createCommunityTaskApi, createLeaderboardApi, createNftClaimApi, createPageBuilderApi, createQuestApi, createTaskOnClient, createUserApi, createUserCenterApi, createWidgetApi, discordIcon, filterEnabledAccounts, filterEnabledCards, filterEnabledTabs, filterEnabledWallets, formatAddress, formatLocalDate, formatLongNumber, formatRankRange, formatRewardText, formatSwapTokensForDisplay, formatTokenAmount, formatTxHash, formatUtcDuration, formatUtcTime, formatWalletAddress, generateLeaderboardId, generatePendingKey, getChainIcon, getChainName, getCollectionId, getDefaultColumns, getDefaultTabConfig, getDefaultTitle, getGasCoveredBy, getNftChainName, getNftClaimType, getPendingHash, getReceiverAddress, getSocialIcon, getSwapDexTitleExpress, getTxExplorerLink, getTxExplorerUrl, getUserPendingHashes, isAllTimeResponse, isCampaignResponse, isCapNftReward, isManualDrop, isMintedNftReward, isNftClaimable, isNftClaimed, isStandardNftReward, isUnauthorizedError, linkIcon, needsCustomComponent, _exports$2 as nftWithdrawAbi, normalizeCampaignInfo, normalizeQuestTask, normalizeQuestTaskInput, normalizeQuestTasks, normalizeTask, normalizeTaskCards, openInNewTab, parsePageBuilderConfig, parseTitleExpress, parseWidgetConfig, powIcon, quizIcon, retweetIcon, setPendingHash, signMessage, telegramIcon, toWei, tokenIcon, truncateAddress, twitterIcon };
|
|
6464
|
+
export type { AllTimeLeaderboardParams, AllTimeLeaderboardResponse, AllTimeRankItem, AssetInfo, BMintNftClaimSigResp, BUserBriefInfo, BindAddressParams, BindAddressResult, BindSNSParams, BindSNSResult, BoundSocialAccount, BoundWalletAddress, CampaignGasStationInfo, CampaignInfo$1 as CampaignInfo, CampaignLeaderboardParams, CampaignLeaderboardResponse, CampaignRankItem, CampaignStatusInfo, CampaignWinnerReward, CapNftRewardValue, ChainApi, ChainInfo, ChangedTaskItem, CheckUserCampaignEligibilityParams, ClaimCampaignRewardNftParams, ClaimCampaignRewardNftResult, ClaimCapNftParams, ClaimMintedNftParams, ClaimStatus, CloudColorTheme, CloudThemeConfig, CombineCampaignOperateTextInfo, CombineCampaignOperateTextItem, CommonApi, CommonTemplateTaskValue, CommunityBaseInfo, CommunityIdOrKeyParams, CommunityInfo, CommunityPreTaskParams, CommunityRewardInfo, CommunitySectorTaskCardsItem, CommunitySectorTasksItem, CommunityTaskApi, CommunityTaskContentConfig, CommunityTaskDisplayOptions, CommunityTaskInfo, CommunityTaskSectorItem, CommunityUserLevelParams, DescField, DidNotDistributeRewardReport, DiscordRoleParams, EligibilityDetail, EligibilityItem, EligibilityValueItem, FormValueTime, FormatTokenAmountOptions, GetBMintNFTCampaignNftSigParams, GetBMintNFTClaimNftSigParams, GetCampaignInfoParams, GetCampaignStatusInfoParams, GetCampaignWinnersParams, GetCampaignWinnersResponse, GetCommunityTaskCardInfoParams, GetLockedTokenListParams, GetLockedTokenListResponse, GetMyCampaignHistoryParams, GetMyCampaignHistoryResponse, GetTokenWithdrawByNonceParams, GetUserCampaignStatusParams, GetUserPointsHistoryParams, GetUserPointsHistoryResponse, GetUserTokenBalanceParams, GetUserTokenBalanceResponse, GtcUserInfo, GtcUserTaskStatus, LeaderboardApi, LeaderboardContentConfig, LeaderboardData, LeaderboardDisplayOptions, LeaderboardItem, LeaderboardRowsOption, LeaderboardTableColumnConfig, ListMyCommunityRewardDetailsReq, ListMyCommunityRewardDetailsRes, LockedTokenListItem, LoginResult, MeetCondition, MintedNftRewardValue, MobileStackOrder, MyCampaignHistoryListItem, MyCommunityRewardDetails, MyCommunityRewards, NftClaimApi, NftHolderEligibilityParams, NftHolderTaskValue, NftRewardTokenId, NftRewardValue, NftTransactionParams, NftWithdrawParams, NftWithdrawResult, NftWithdrawTokenId, NormalizedTaskInfo, OuterAPITaskValue, OuterPointAPITaskValue, Page$1 as Page, PageBuilderApi, PageBuilderConfig, PageBuilderInfo, PageBuilderSection, PageBuilderSlot, ParsedTitleItem, ParsedWidgetConfig, PendingHashMap, PendingTxInfo, PointsInfo$2 as PointsInfo, PointsReward, PowQaUserTaskValue, PowQaWithAnswerUserTaskValue, PowTaskParams, PowTaskValue, PowUserTaskValue, QuestApi, CampaignInfo as QuestCampaignInfo, QuestContentConfig, PointsInfo as QuestPointsInfo, RewardInfo as QuestRewardInfo, RewardInfoSimple as QuestRewardInfoSimple, SubmitTaskParams as QuestSubmitTaskParams, SubmitTaskResult as QuestSubmitTaskResult, QuestTaskInput, WinnerLayer as QuestWinnerLayer, WinnerLayerReward as QuestWinnerLayerReward, WinnerRankRange as QuestWinnerRankRange, WinnerRewards as QuestWinnerRewards, QuizChooseUserTaskValue, RankRangeResult, RelateLuckyPassInfo, RequestOptions, RewardBMintedNftParameters, RewardBMintedNftValue, RewardBadgeParameter, RewardCapParameters, RewardCapValue, RewardDiscordRoleParameters, RewardDiscordRoleValue, RewardDisplayMode, RewardExpParameters, RewardExpValue, RewardGemParameters, RewardInfo$1 as RewardInfo, RewardInfoSimple$1 as RewardInfoSimple, RewardNftParameters, RewardNftValue, RewardParams, RewardPointsValue, RewardTokenParameters, RewardTokenValue, RewardValue, RewardValueInfo, RewardWhitelistParameters, RewardWhitelistValue, SectorValue, SendTransactionParams, SigType, SignResult, SignType, SnsItem, StandardNftRewardValue, SubmitCampaignParams, SubmitCampaignResult, SubmitTaskParams$1 as SubmitTaskParams, SubmitTaskResult$1 as SubmitTaskResult, SurveyChooseUserTaskValue, SwapDexTitleOptions, SwapTokenInfo, TaskChainInfo, TaskOnClient, TaskOnClientConfig, TaskOnResponse, TaskParamItem, TaskValueItem, TgData, ThemeMode, TokenBalanceEligibilityParams, TokenBalanceTaskParams, TokenBalanceTaskValue, TokenIdAndAmount, TokenReward, TokenWithdrawParams, TokenWithdrawRequest, UnbindAddressParams, UnbindSNSParams, UploadImageParams, UploadImageResult, UploadProgressCallback, UserAddress, UserApi, BindSNSResult as UserBindResult, UserBriefInfo, UserCampaignStatus, UserCampaignStatusInfo, UserCenterAccountConfig, UserCenterAccountOption, UserCenterAccountParams, UserCenterApi, UserCenterConfig, UserCenterContentConfig, UserCenterRewardCardConfig, UserCenterRewardCardOption, UserCenterTabConfig, UserCenterTabOption, UserCenterWalletConfig, UserCenterWalletOption, UserEarnedRewardAmount, UserEligibilityInfo, UserInfo, UserPointsHistoryListItem, UserPointsInfo, UserTaskCardInfo, UserTaskInfo, UserTaskStatus, UserTaskValue, UserTokenBalanceListItem, WalletProvider, WidgetApi, WidgetFunctionConfig, WidgetInfo, WinnerInfo, WinnerLayer$1 as WinnerLayer, WinnerLayerReward$1 as WinnerLayerReward, WinnerRankRange$1 as WinnerRankRange, WinnerRewardInfo, WinnerRewards$1 as WinnerRewards, WithdrawNftTokenAmount, WithdrawNftTransactionParams, WithdrawNftType, WithdrawResult, WithdrawStatus, WithdrawTokenItem };
|