anchor-sdk 0.1.41-internal.1 → 0.1.41-internal.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/AnchorApiClientV2.d.ts +9 -91
- package/dist/AnchorApiClientV2.js +7 -153
- package/dist/generated/Api.d.ts +1040 -27
- package/dist/generated/Api.js +207 -15
- package/dist/react/AnchorReactSDK.d.ts +4 -4
- package/dist/react/AnchorReactSDK.js +19 -8
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BadgeClaimSignatureRequest, BadgeSingleCheckRequest, BatchMintRequestVO, MintResponse, NFTMintRequestVO, UserOpHashProcessRequest, WebResultBadgeAssetsResponse, WebResultBadgeCheckResponse, WebResultBadgeClaimSignatureResponse, WebResultBadgeClaimableListResponse, WebResultBadgeDetailResponse, WebResultBadgeSeriesDetailResponse, WebResultBadgeSeriesResponse, WebResultBadgeVerifiersResponse, WebResultTransactionHashProcess, WebResultUserOpHashProcess } from "./generated/Api";
|
|
2
2
|
import { Chain } from "viem";
|
|
3
3
|
/**
|
|
4
4
|
* Anchor API V2 客户端配置
|
|
@@ -99,7 +99,7 @@ export declare class AnchorApiClientV2 {
|
|
|
99
99
|
/**
|
|
100
100
|
* 获取用户徽章资产
|
|
101
101
|
* @param params 查询参数
|
|
102
|
-
* @param params.
|
|
102
|
+
* @param params.includeClaimable 徽章状态是否包含可领取
|
|
103
103
|
* @param params.strategy 返回策略 BADGE_ALL/BADGE_MAX/BADGE_REWARD
|
|
104
104
|
* @param params.series 徽章系列过滤器
|
|
105
105
|
* @param params.limit 每页项目数
|
|
@@ -107,9 +107,9 @@ export declare class AnchorApiClientV2 {
|
|
|
107
107
|
* @returns 徽章资产响应
|
|
108
108
|
*/
|
|
109
109
|
getUserBadgeAssets(params?: {
|
|
110
|
-
|
|
110
|
+
includeClaimable?: boolean;
|
|
111
111
|
strategy?: string;
|
|
112
|
-
series?: string;
|
|
112
|
+
series?: string[];
|
|
113
113
|
limit?: number;
|
|
114
114
|
nextToken?: string;
|
|
115
115
|
}): Promise<WebResultBadgeAssetsResponse>;
|
|
@@ -143,7 +143,7 @@ export declare class AnchorApiClientV2 {
|
|
|
143
143
|
* @param data 徽章检查请求
|
|
144
144
|
* @returns 徽章检查响应
|
|
145
145
|
*/
|
|
146
|
-
checkUserClaimableBadges(data:
|
|
146
|
+
checkUserClaimableBadges(data: object): Promise<WebResultBadgeCheckResponse>;
|
|
147
147
|
/**
|
|
148
148
|
* 获取徽章领取签名
|
|
149
149
|
* @param data 徽章领取签名请求
|
|
@@ -179,54 +179,6 @@ export declare class AnchorApiClientV2 {
|
|
|
179
179
|
* @returns 批量铸造响应
|
|
180
180
|
*/
|
|
181
181
|
batchMint(type: string, data: BatchMintRequestVO): Promise<MintResponse>;
|
|
182
|
-
/**
|
|
183
|
-
* 根据 ID 获取 NFT 系列
|
|
184
|
-
* @param type NFT 类型
|
|
185
|
-
* @param series 系列标识符
|
|
186
|
-
* @param customerId 客户 ID
|
|
187
|
-
* @returns NFT 系列详情响应
|
|
188
|
-
*/
|
|
189
|
-
getNftSeriesById(type: string, series: string, customerId?: string): Promise<WebResultNftSeriesDetailResponse>;
|
|
190
|
-
/**
|
|
191
|
-
* 获取 NFT 系列
|
|
192
|
-
* @param type NFT 类型
|
|
193
|
-
* @returns NFT 系列响应
|
|
194
|
-
*/
|
|
195
|
-
nftSeries(type: string): Promise<WebResultNftSeriesResponse>;
|
|
196
|
-
/**
|
|
197
|
-
* Anchor 检查
|
|
198
|
-
* @param type 检查类型
|
|
199
|
-
* @returns 检查响应
|
|
200
|
-
*/
|
|
201
|
-
check(type: string): Promise<WebResultCheckResponse>;
|
|
202
|
-
/**
|
|
203
|
-
* 获取检查结果
|
|
204
|
-
* @param type 检查类型
|
|
205
|
-
* @returns 检查结果响应
|
|
206
|
-
*/
|
|
207
|
-
getCheckResult(type: string): Promise<WebResultCheckResultResponse>;
|
|
208
|
-
/**
|
|
209
|
-
* 获取赛季配置列表
|
|
210
|
-
* @returns 赛季配置列表响应
|
|
211
|
-
*/
|
|
212
|
-
listSeasonConfig(): Promise<WebResultListSeasonConfigVO>;
|
|
213
|
-
/**
|
|
214
|
-
* 查询用户可领取或已领取的徽章
|
|
215
|
-
* @param customerId 客户 ID
|
|
216
|
-
* @param status 徽章状态
|
|
217
|
-
* @param strategy 返回策略
|
|
218
|
-
* @param series 徽章系列
|
|
219
|
-
* @param limit 每页条数
|
|
220
|
-
* @param nextToken 分页参数
|
|
221
|
-
* @returns 徽章响应
|
|
222
|
-
*/
|
|
223
|
-
badgeAssets(customerId?: string, status?: string, strategy?: string, series?: string, limit?: number, nextToken?: string): Promise<WebResultBadgeResponse>;
|
|
224
|
-
/**
|
|
225
|
-
* 处理用户操作哈希
|
|
226
|
-
* @param data 用户操作哈希处理请求
|
|
227
|
-
* @returns 用户操作哈希处理响应
|
|
228
|
-
*/
|
|
229
|
-
userOpHashProcess(data: UserOpHashProcessRequest): Promise<WebResultUserOpHashProcess>;
|
|
230
182
|
/**
|
|
231
183
|
* 处理交易哈希(加速交易处理)
|
|
232
184
|
* @param txHash 交易哈希
|
|
@@ -234,43 +186,9 @@ export declare class AnchorApiClientV2 {
|
|
|
234
186
|
*/
|
|
235
187
|
transactionHashProcess(txHash: string): Promise<WebResultTransactionHashProcess>;
|
|
236
188
|
/**
|
|
237
|
-
*
|
|
238
|
-
* @param data
|
|
239
|
-
* @returns
|
|
240
|
-
*/
|
|
241
|
-
grantBadge(data: WebResultGrantBadgeRequestVO): Promise<WebResultGrantBadgeResponseVO>;
|
|
242
|
-
/**
|
|
243
|
-
* 购买铸造(带签名)
|
|
244
|
-
* @param type 购买类型
|
|
245
|
-
* @param data 购买请求数据
|
|
246
|
-
* @returns 购买响应
|
|
247
|
-
*/
|
|
248
|
-
purchaseMint(type: string, data: PurchaseRequest): Promise<WebResultPurchaseResponse>;
|
|
249
|
-
/**
|
|
250
|
-
* 查询资产
|
|
251
|
-
* @param type 资产类型
|
|
252
|
-
* @param data 查询请求数据
|
|
253
|
-
* @returns 资产响应
|
|
254
|
-
*/
|
|
255
|
-
queryAssets(type: string, data: QueryAssetsRequest): Promise<WebResultAssetsBadgeResponse>;
|
|
256
|
-
/**
|
|
257
|
-
* 根据 ID 获取 NFT 系列详情
|
|
258
|
-
* @param type NFT 类型
|
|
259
|
-
* @param series 系列标识符
|
|
260
|
-
* @param customerId 客户 ID
|
|
261
|
-
* @returns NFT 系列详情响应
|
|
262
|
-
*/
|
|
263
|
-
getNftSeriesDetail(type: string, series: string, customerId?: string): Promise<WebResultNftSeriesDetailResponse>;
|
|
264
|
-
/**
|
|
265
|
-
* 根据事件检查
|
|
266
|
-
* @param data 检查事件请求
|
|
267
|
-
* @returns 检查事件响应
|
|
268
|
-
*/
|
|
269
|
-
checkByEvent(data: CheckEventRequest): Promise<WebResultCheckEventResponse>;
|
|
270
|
-
/**
|
|
271
|
-
* 徽章检查
|
|
272
|
-
* @param data 徽章检查请求
|
|
273
|
-
* @returns 徽章检查响应
|
|
189
|
+
* 处理用户操作哈希
|
|
190
|
+
* @param data 用户操作哈希处理请求
|
|
191
|
+
* @returns 用户操作哈希处理响应
|
|
274
192
|
*/
|
|
275
|
-
|
|
193
|
+
userOpHashProcess(data: UserOpHashProcessRequest): Promise<WebResultUserOpHashProcess>;
|
|
276
194
|
}
|
|
@@ -165,7 +165,7 @@ class AnchorApiClientV2 {
|
|
|
165
165
|
/**
|
|
166
166
|
* 获取用户徽章资产
|
|
167
167
|
* @param params 查询参数
|
|
168
|
-
* @param params.
|
|
168
|
+
* @param params.includeClaimable 徽章状态是否包含可领取
|
|
169
169
|
* @param params.strategy 返回策略 BADGE_ALL/BADGE_MAX/BADGE_REWARD
|
|
170
170
|
* @param params.series 徽章系列过滤器
|
|
171
171
|
* @param params.limit 每页项目数
|
|
@@ -276,92 +276,7 @@ class AnchorApiClientV2 {
|
|
|
276
276
|
return response.data;
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
// ====================
|
|
280
|
-
/**
|
|
281
|
-
* 根据 ID 获取 NFT 系列
|
|
282
|
-
* @param type NFT 类型
|
|
283
|
-
* @param series 系列标识符
|
|
284
|
-
* @param customerId 客户 ID
|
|
285
|
-
* @returns NFT 系列详情响应
|
|
286
|
-
*/
|
|
287
|
-
async getNftSeriesById(type, series, customerId) {
|
|
288
|
-
return this.handleApiCall(async () => {
|
|
289
|
-
const query = customerId ? { customerId } : undefined;
|
|
290
|
-
const response = await this.generatedApi.v1.getNftSeriesById(type, series, query, this.getRequestParams());
|
|
291
|
-
return response.data;
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* 获取 NFT 系列
|
|
296
|
-
* @param type NFT 类型
|
|
297
|
-
* @returns NFT 系列响应
|
|
298
|
-
*/
|
|
299
|
-
async nftSeries(type) {
|
|
300
|
-
return this.handleApiCall(async () => {
|
|
301
|
-
const response = await this.generatedApi.v1.nftSeries(type, this.getRequestParams());
|
|
302
|
-
return response.data;
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Anchor 检查
|
|
307
|
-
* @param type 检查类型
|
|
308
|
-
* @returns 检查响应
|
|
309
|
-
*/
|
|
310
|
-
async check(type) {
|
|
311
|
-
return this.handleApiCall(async () => {
|
|
312
|
-
const response = await this.generatedApi.v1.check(type, this.getRequestParams());
|
|
313
|
-
return response.data;
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* 获取检查结果
|
|
318
|
-
* @param type 检查类型
|
|
319
|
-
* @returns 检查结果响应
|
|
320
|
-
*/
|
|
321
|
-
async getCheckResult(type) {
|
|
322
|
-
return this.handleApiCall(async () => {
|
|
323
|
-
const response = await this.generatedApi.v1.getCheckResult(type, this.getRequestParams());
|
|
324
|
-
return response.data;
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* 获取赛季配置列表
|
|
329
|
-
* @returns 赛季配置列表响应
|
|
330
|
-
*/
|
|
331
|
-
async listSeasonConfig() {
|
|
332
|
-
return this.handleApiCall(async () => {
|
|
333
|
-
const response = await this.generatedApi.v1.listSeasonConfig(this.getRequestParams());
|
|
334
|
-
return response.data;
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* 查询用户可领取或已领取的徽章
|
|
339
|
-
* @param customerId 客户 ID
|
|
340
|
-
* @param status 徽章状态
|
|
341
|
-
* @param strategy 返回策略
|
|
342
|
-
* @param series 徽章系列
|
|
343
|
-
* @param limit 每页条数
|
|
344
|
-
* @param nextToken 分页参数
|
|
345
|
-
* @returns 徽章响应
|
|
346
|
-
*/
|
|
347
|
-
async badgeAssets(customerId, status, strategy, series, limit, nextToken) {
|
|
348
|
-
return this.handleApiCall(async () => {
|
|
349
|
-
const query = { customerId, status, strategy, series, limit, nextToken };
|
|
350
|
-
const response = await this.generatedApi.v1.badgeAssets(query, this.getRequestParams());
|
|
351
|
-
return response.data;
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* 处理用户操作哈希
|
|
356
|
-
* @param data 用户操作哈希处理请求
|
|
357
|
-
* @returns 用户操作哈希处理响应
|
|
358
|
-
*/
|
|
359
|
-
async userOpHashProcess(data) {
|
|
360
|
-
return this.handleApiCall(async () => {
|
|
361
|
-
const response = await this.generatedApi.v1.userOpHashProcess(data, this.getRequestParams());
|
|
362
|
-
return response.data;
|
|
363
|
-
});
|
|
364
|
-
}
|
|
279
|
+
// ==================== Transaction Methods ====================
|
|
365
280
|
/**
|
|
366
281
|
* 处理交易哈希(加速交易处理)
|
|
367
282
|
* @param txHash 交易哈希
|
|
@@ -373,75 +288,14 @@ class AnchorApiClientV2 {
|
|
|
373
288
|
return response.data;
|
|
374
289
|
});
|
|
375
290
|
}
|
|
376
|
-
// ==================== S1 API Methods ====================
|
|
377
|
-
/**
|
|
378
|
-
* 授予徽章
|
|
379
|
-
* @param data 授予徽章请求
|
|
380
|
-
* @returns 授予徽章响应
|
|
381
|
-
*/
|
|
382
|
-
async grantBadge(data) {
|
|
383
|
-
return this.handleApiCall(async () => {
|
|
384
|
-
const response = await this.generatedApi.s1.grantBadge(data, this.getRequestParams());
|
|
385
|
-
return response.data;
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* 购买铸造(带签名)
|
|
390
|
-
* @param type 购买类型
|
|
391
|
-
* @param data 购买请求数据
|
|
392
|
-
* @returns 购买响应
|
|
393
|
-
*/
|
|
394
|
-
async purchaseMint(type, data) {
|
|
395
|
-
return this.handleApiCall(async () => {
|
|
396
|
-
const response = await this.generatedApi.s1.purchaseMint(type, data, this.getRequestParams());
|
|
397
|
-
return response.data;
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* 查询资产
|
|
402
|
-
* @param type 资产类型
|
|
403
|
-
* @param data 查询请求数据
|
|
404
|
-
* @returns 资产响应
|
|
405
|
-
*/
|
|
406
|
-
async queryAssets(type, data) {
|
|
407
|
-
return this.handleApiCall(async () => {
|
|
408
|
-
const response = await this.generatedApi.s1.queryAssets(type, data, this.getRequestParams());
|
|
409
|
-
return response.data;
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
291
|
/**
|
|
413
|
-
*
|
|
414
|
-
* @param
|
|
415
|
-
* @
|
|
416
|
-
* @param customerId 客户 ID
|
|
417
|
-
* @returns NFT 系列详情响应
|
|
418
|
-
*/
|
|
419
|
-
async getNftSeriesDetail(type, series, customerId) {
|
|
420
|
-
return this.handleApiCall(async () => {
|
|
421
|
-
const query = customerId ? { customerId } : undefined;
|
|
422
|
-
const response = await this.generatedApi.s1.getNftSeriesDetail(type, series, query, this.getRequestParams());
|
|
423
|
-
return response.data;
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* 根据事件检查
|
|
428
|
-
* @param data 检查事件请求
|
|
429
|
-
* @returns 检查事件响应
|
|
430
|
-
*/
|
|
431
|
-
async checkByEvent(data) {
|
|
432
|
-
return this.handleApiCall(async () => {
|
|
433
|
-
const response = await this.generatedApi.s1.checkByEvent(data, this.getRequestParams());
|
|
434
|
-
return response.data;
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* 徽章检查
|
|
439
|
-
* @param data 徽章检查请求
|
|
440
|
-
* @returns 徽章检查响应
|
|
292
|
+
* 处理用户操作哈希
|
|
293
|
+
* @param data 用户操作哈希处理请求
|
|
294
|
+
* @returns 用户操作哈希处理响应
|
|
441
295
|
*/
|
|
442
|
-
async
|
|
296
|
+
async userOpHashProcess(data) {
|
|
443
297
|
return this.handleApiCall(async () => {
|
|
444
|
-
const response = await this.generatedApi.
|
|
298
|
+
const response = await this.generatedApi.v1.userOpHashProcess(data, this.getRequestParams());
|
|
445
299
|
return response.data;
|
|
446
300
|
});
|
|
447
301
|
}
|