anchor-sdk 0.1.41-internal.0 → 0.1.41-internal.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -197,16 +197,17 @@ class Api extends HttpClient {
197
197
  ...params,
198
198
  }),
199
199
  /**
200
- * @description get nft series
200
+ * @description 获取团队排行榜,支持分页查询,返回个人团队信息
201
201
  *
202
- * @tags Anchor
203
- * @name NftSeries
204
- * @summary get nft series
205
- * @request GET:/v1/series/{type}
202
+ * @tags TeamV1
203
+ * @name GetTeamLeaderboard
204
+ * @summary Get team leaderboard
205
+ * @request GET:/v1/teams/leaderboard
206
206
  */
207
- nftSeries: (type, params = {}) => this.request({
208
- path: `/v1/series/${type}`,
207
+ getTeamLeaderboard: (query, params = {}) => this.request({
208
+ path: `/v1/teams/leaderboard`,
209
209
  method: "GET",
210
+ query: query,
210
211
  format: "json",
211
212
  ...params,
212
213
  }),
@@ -238,6 +239,34 @@ class Api extends HttpClient {
238
239
  format: "json",
239
240
  ...params,
240
241
  }),
242
+ /**
243
+ * @description 获取团队详情,包含已解锁的徽章信息
244
+ *
245
+ * @tags TeamV1
246
+ * @name GetTeamDetail
247
+ * @summary Get team detail
248
+ * @request GET:/v1/teams/{teamId}/detail
249
+ */
250
+ getTeamDetail: (teamId, params = {}) => this.request({
251
+ path: `/v1/teams/${teamId}/detail`,
252
+ method: "GET",
253
+ format: "json",
254
+ ...params,
255
+ }),
256
+ /**
257
+ * @description 标记指定通知为已读状态
258
+ *
259
+ * @tags TeamV1
260
+ * @name MarkNotificationRead
261
+ * @summary Mark notification as read
262
+ * @request POST:/v1/notifications/{notificationId}/read
263
+ */
264
+ markNotificationRead: (notificationId, params = {}) => this.request({
265
+ path: `/v1/notifications/${notificationId}/read`,
266
+ method: "POST",
267
+ format: "json",
268
+ ...params,
269
+ }),
241
270
  /**
242
271
  * @description list season config
243
272
  *
@@ -252,6 +281,20 @@ class Api extends HttpClient {
252
281
  format: "json",
253
282
  ...params,
254
283
  }),
284
+ /**
285
+ * @description 获取指定徽章的贡献者列表
286
+ *
287
+ * @tags TeamV1
288
+ * @name GetBadgeContributors
289
+ * @summary Get badge contributors
290
+ * @request GET:/v1/teams/badges/{badgeId}/contributors
291
+ */
292
+ getBadgeContributors: (badgeId, params = {}) => this.request({
293
+ path: `/v1/teams/badges/${badgeId}/contributors`,
294
+ method: "GET",
295
+ format: "json",
296
+ ...params,
297
+ }),
255
298
  /**
256
299
  * @description query user claimable or claimed Badges
257
300
  *
@@ -267,6 +310,79 @@ class Api extends HttpClient {
267
310
  format: "json",
268
311
  ...params,
269
312
  }),
313
+ /**
314
+ * @description 获取团队内成员贡献排行榜
315
+ *
316
+ * @tags TeamV1
317
+ * @name GetTeamMemberRanking
318
+ * @summary Get team member ranking
319
+ * @request GET:/v1/teams/{teamId}/members/ranking
320
+ */
321
+ getTeamMemberRanking: (teamId, query, params = {}) => this.request({
322
+ path: `/v1/teams/${teamId}/members/ranking`,
323
+ method: "GET",
324
+ query: query,
325
+ format: "json",
326
+ ...params,
327
+ }),
328
+ /**
329
+ * @description 获取团队所有徽章的状态信息,支持按状态筛选
330
+ *
331
+ * @tags TeamV1
332
+ * @name GetTeamBadges
333
+ * @summary Get team badges
334
+ * @request GET:/v1/teams/badges
335
+ */
336
+ getTeamBadges: (query, params = {}) => this.request({
337
+ path: `/v1/teams/badges`,
338
+ method: "GET",
339
+ query: query,
340
+ format: "json",
341
+ ...params,
342
+ }),
343
+ /**
344
+ * @description get nft series
345
+ *
346
+ * @tags Anchor
347
+ * @name NftSeries
348
+ * @summary get nft series
349
+ * @request GET:/v1/series/{type}
350
+ */
351
+ nftSeries: (type, params = {}) => this.request({
352
+ path: `/v1/series/${type}`,
353
+ method: "GET",
354
+ format: "json",
355
+ ...params,
356
+ }),
357
+ /**
358
+ * @description 获取当前用户的个人概况信息
359
+ *
360
+ * @tags TeamV1
361
+ * @name GetMyTeamProfile
362
+ * @summary Get my team profile
363
+ * @request GET:/v1/teams/members/me
364
+ */
365
+ getMyTeamProfile: (params = {}) => this.request({
366
+ path: `/v1/teams/members/me`,
367
+ method: "GET",
368
+ format: "json",
369
+ ...params,
370
+ }),
371
+ /**
372
+ * @description 获取用户的通知列表
373
+ *
374
+ * @tags TeamV1
375
+ * @name GetNotifications
376
+ * @summary Get notifications
377
+ * @request GET:/v1/notifications
378
+ */
379
+ getNotifications: (query, params = {}) => this.request({
380
+ path: `/v1/notifications`,
381
+ method: "GET",
382
+ query: query,
383
+ format: "json",
384
+ ...params,
385
+ }),
270
386
  /**
271
387
  * @description 前端监听到合约成功事件,调用加快后端事件处理
272
388
  *
@@ -470,6 +586,81 @@ class Api extends HttpClient {
470
586
  }),
471
587
  };
472
588
  this.s1 = {
589
+ /**
590
+ * @description 退出当前团队
591
+ *
592
+ * @tags AnchorS2S
593
+ * @name LeaveTeam
594
+ * @summary Leave team (self)
595
+ * @request DELETE:/s1/teams/leave/{userId}
596
+ */
597
+ leaveTeam: (userId, params = {}) => this.request({
598
+ path: `/s1/teams/leave/${userId}`,
599
+ method: "DELETE",
600
+ format: "json",
601
+ ...params,
602
+ }),
603
+ /**
604
+ * @description 加入团队,支持通过邀请码或直接指定团队ID
605
+ *
606
+ * @tags AnchorS2S
607
+ * @name JoinTeam
608
+ * @summary Join team
609
+ * @request POST:/s1/teams/join
610
+ */
611
+ joinTeam: (data, params = {}) => this.request({
612
+ path: `/s1/teams/join`,
613
+ method: "POST",
614
+ body: data,
615
+ type: ContentType.Json,
616
+ format: "json",
617
+ ...params,
618
+ }),
619
+ /**
620
+ * @description get nft series by id
621
+ *
622
+ * @tags AnchorS2S
623
+ * @name GetNftSeriesDetail
624
+ * @summary get nft series by id
625
+ * @request GET:/s1/series/{type}/{series}
626
+ */
627
+ getNftSeriesDetail: (type, series, query, params = {}) => this.request({
628
+ path: `/s1/series/${type}/${series}`,
629
+ method: "GET",
630
+ query: query,
631
+ format: "json",
632
+ ...params,
633
+ }),
634
+ /**
635
+ * @description 队长移除团队成员
636
+ *
637
+ * @tags AnchorS2S
638
+ * @name RemoveTeamMember
639
+ * @summary Remove member by captain
640
+ * @request DELETE:/s1/teams/remove/{captainUserId}/{userId}
641
+ */
642
+ removeTeamMember: (captainUserId, userId, params = {}) => this.request({
643
+ path: `/s1/teams/remove/${captainUserId}/${userId}`,
644
+ method: "DELETE",
645
+ format: "json",
646
+ ...params,
647
+ }),
648
+ /**
649
+ * @description 重制探测徽章冷却时间
650
+ *
651
+ * @tags AnchorS2S
652
+ * @name IntervalReset
653
+ * @summary interval reset
654
+ * @request POST:/s1/interval/reset
655
+ */
656
+ intervalReset: (data, params = {}) => this.request({
657
+ path: `/s1/interval/reset`,
658
+ method: "POST",
659
+ body: data,
660
+ type: ContentType.Json,
661
+ format: "json",
662
+ ...params,
663
+ }),
473
664
  /**
474
665
  * @description grant badge
475
666
  *
@@ -519,17 +710,18 @@ class Api extends HttpClient {
519
710
  ...params,
520
711
  }),
521
712
  /**
522
- * @description get nft series by id
713
+ * @description 创建新团队,支持设置背景图
523
714
  *
524
715
  * @tags AnchorS2S
525
- * @name GetNftSeriesDetail
526
- * @summary get nft series by id
527
- * @request GET:/s1/series/{type}/{series}
716
+ * @name CreateTeam
717
+ * @summary Create team
718
+ * @request POST:/s1/teams
528
719
  */
529
- getNftSeriesDetail: (type, series, query, params = {}) => this.request({
530
- path: `/s1/series/${type}/${series}`,
531
- method: "GET",
532
- query: query,
720
+ createTeam: (data, params = {}) => this.request({
721
+ path: `/s1/teams`,
722
+ method: "POST",
723
+ body: data,
724
+ type: ContentType.Json,
533
725
  format: "json",
534
726
  ...params,
535
727
  }),
@@ -51,9 +51,9 @@ export declare const useAnchorBadge: () => {
51
51
  loading: boolean;
52
52
  error: Error | null;
53
53
  initialized: boolean;
54
- getClaimableBadges: (customerId?: string) => Promise<import("../index").WebResultBadgeResponse>;
55
- getClaimedBadges: (customerId?: string) => Promise<import("../index").WebResultBadgeResponse>;
56
- getNftSeries: (type?: string) => Promise<import("../index").WebResultNftSeriesResponse>;
57
- getNftSeriesById: (series: string, customerId?: string) => Promise<import("../index").WebResultNftSeriesDetailResponse>;
54
+ getClaimableBadges: () => Promise<import("../index").WebResultBadgeAssetsResponse>;
55
+ getClaimedBadges: () => Promise<import("../index").WebResultBadgeAssetsResponse>;
56
+ getNftSeries: () => Promise<import("../index").WebResultBadgeSeriesResponse>;
57
+ getNftSeriesById: (series: string) => Promise<import("../index").WebResultBadgeSeriesDetailResponse>;
58
58
  };
59
59
  export {};
@@ -141,32 +141,43 @@ exports.useAnchorSDK = useAnchorSDK;
141
141
  const useAnchorBadge = () => {
142
142
  const { sdk, loading, error, initialized } = (0, exports.useAnchorSDK)();
143
143
  // Get badges that user can claim
144
- const getClaimableBadges = async (customerId) => {
144
+ const getClaimableBadges = async () => {
145
145
  if (!sdk?.anchorApi) {
146
146
  throw new Error("Anchor API client not initialized");
147
147
  }
148
- return await sdk.anchorApi.badgeAssets(customerId, "claimable");
148
+ return await sdk.anchorApi.getUserBadgeAssets({
149
+ includeClaimable: true,
150
+ strategy: "BADGE_ALL",
151
+ });
149
152
  };
150
153
  // Get badges that user has claimed
151
- const getClaimedBadges = async (customerId) => {
154
+ const getClaimedBadges = async () => {
152
155
  if (!sdk?.anchorApi) {
153
156
  throw new Error("Anchor API client not initialized");
154
157
  }
155
- return await sdk.anchorApi.badgeAssets(customerId, "claimed");
158
+ return await sdk.anchorApi.getUserBadgeAssets({
159
+ includeClaimable: false,
160
+ strategy: "BADGE_ALL",
161
+ });
156
162
  };
157
163
  // Get NFT series
158
- const getNftSeries = async (type = "badge") => {
164
+ const getNftSeries = async () => {
159
165
  if (!sdk?.anchorApi) {
160
166
  throw new Error("Anchor API client not initialized");
161
167
  }
162
- return await sdk.anchorApi.nftSeries(type);
168
+ return await sdk.anchorApi.getBadgeSeries({
169
+ includeBadges: true,
170
+ limit: 100,
171
+ });
163
172
  };
164
173
  // Get NFT series details
165
- const getNftSeriesById = async (series, customerId) => {
174
+ const getNftSeriesById = async (series) => {
166
175
  if (!sdk?.anchorApi) {
167
176
  throw new Error("Anchor API client not initialized");
168
177
  }
169
- return await sdk.anchorApi.getNftSeriesById("badge", series, customerId);
178
+ return await sdk.anchorApi.getBadgeSeriesDetail(series, {
179
+ status: "active",
180
+ });
170
181
  };
171
182
  return {
172
183
  loading,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anchor-sdk",
3
- "version": "0.1.41-internal.0",
3
+ "version": "0.1.41-internal.2",
4
4
  "description": "TypeScript SDK for interacting with Anchor ecosystem - badge minting, payment processing, and ERC1155 token management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",