@highlightxyz/sdk 0.1.1 → 0.2.0

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.
@@ -81,10 +81,51 @@ export class Collection extends HeyApiClient {
81
81
  },
82
82
  });
83
83
  }
84
+ /**
85
+ * Trending collections
86
+ *
87
+ * Public leaderboard of collections ranked by units minted within a rolling time window (24h / 7d / 28d), computed live from the mint ledger.
88
+ */
89
+ trending(parameters, options) {
90
+ const params = buildClientParams([parameters], [
91
+ {
92
+ args: [
93
+ { in: "query", key: "window" },
94
+ { in: "query", key: "chainId" },
95
+ { in: "query", key: "limit" },
96
+ ],
97
+ },
98
+ ]);
99
+ return (options?.client ?? this.client).get({
100
+ url: "/collection/trending",
101
+ ...options,
102
+ ...params,
103
+ });
104
+ }
105
+ /**
106
+ * Featured collections
107
+ *
108
+ * Public curated showcase of collections for the home page, ordered by editorial position and paginated by cursor.
109
+ */
110
+ featured(parameters, options) {
111
+ const params = buildClientParams([parameters], [
112
+ {
113
+ args: [
114
+ { in: "query", key: "limit" },
115
+ { in: "query", key: "cursor" },
116
+ ],
117
+ },
118
+ ]);
119
+ return (options?.client ?? this.client).get({
120
+ url: "/collection/featured",
121
+ ...options,
122
+ ...params,
123
+ });
124
+ }
84
125
  /**
85
126
  * Get collection
86
127
  *
87
- * Get a collection by its highlight ID.
128
+ * Get a collection by its highlight ID, or by a contract reference of the form `<chain>:<contractAddress>[:<editionId>]` (chain slug or numeric chainId; editionId defaults to 0), e.g. `ethereum:0x0c3dd3c403b6B5c0CCe2a97F15820a4Eae347FE7:0`.
88
129
  */
89
130
  get(parameters, options) {
90
131
  const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
@@ -94,6 +135,26 @@ export class Collection extends HeyApiClient {
94
135
  ...params,
95
136
  });
96
137
  }
138
+ /**
139
+ * List series previews
140
+ *
141
+ * List sample artwork for a series collection, resolved from its uploaded assets. Returns an empty list for non-series collections or when assets are not ready. Available for public collections without authentication.
142
+ */
143
+ listPreviews(parameters, options) {
144
+ const params = buildClientParams([parameters], [
145
+ {
146
+ args: [
147
+ { in: "path", key: "highlightId" },
148
+ { in: "query", key: "limit" },
149
+ ],
150
+ },
151
+ ]);
152
+ return (options?.client ?? this.client).get({
153
+ url: "/collection/{highlightId}/previews",
154
+ ...options,
155
+ ...params,
156
+ });
157
+ }
97
158
  /**
98
159
  * Finalize collection base URI to Arweave
99
160
  *
@@ -158,9 +219,9 @@ export class Collection extends HeyApiClient {
158
219
  });
159
220
  }
160
221
  /**
161
- * Update edition draft details
222
+ * Update edition details
162
223
  *
163
- * Update edition-specific details for an existing draft.
224
+ * Update edition-specific details (name, description, image, animation, attributes). For a draft collection the change is saved directly. For a live collection it returns a `setEditionURI` transaction to sign — once confirmed on-chain, the backend re-derives the edition and refreshes every token.
164
225
  */
165
226
  updateEditionDetails(parameters, options) {
166
227
  const params = buildClientParams([parameters], [
@@ -321,9 +382,9 @@ export class Collection extends HeyApiClient {
321
382
  });
322
383
  }
323
384
  /**
324
- * Bid on ranked auction sale
385
+ * Bid on an auction sale
325
386
  *
326
- * Build a bid transaction configuration for a ranked auction sale. Returns contract execution data for placing or updating a bid.
387
+ * Build a bid transaction configuration for an auction sale. For ranked auctions, places or updates an on-chain bid. For English auctions, returns an executor-signed bid claim plus the `AuctionManager.bid` call (with `value` = the bid amount); the optional `preferredNftRecipient` sets where the NFT is delivered if this bidder wins.
327
388
  */
328
389
  bidSale(parameters, options) {
329
390
  const params = buildClientParams([parameters], [
@@ -333,6 +394,7 @@ export class Collection extends HeyApiClient {
333
394
  { in: "body", key: "saleId" },
334
395
  { in: "body", key: "bidAmount" },
335
396
  { in: "body", key: "bidId" },
397
+ { in: "body", key: "preferredNftRecipient" },
336
398
  ],
337
399
  },
338
400
  ]);
@@ -348,22 +410,47 @@ export class Collection extends HeyApiClient {
348
410
  });
349
411
  }
350
412
  /**
351
- * Confirm ranked auction bid
413
+ * Reclaim a non-winning ranked-auction bid
414
+ *
415
+ * Build a transaction to reclaim the funds locked in a non-winning ranked-auction bid after the auction has ended.
416
+ */
417
+ reclaimBid(parameters, options) {
418
+ const params = buildClientParams([parameters], [
419
+ {
420
+ args: [
421
+ { in: "path", key: "highlightId" },
422
+ { in: "body", key: "saleId" },
423
+ { in: "body", key: "bidId" },
424
+ ],
425
+ },
426
+ ]);
427
+ return (options?.client ?? this.client).post({
428
+ url: "/collection/{highlightId}/sales/reclaim",
429
+ ...options,
430
+ ...params,
431
+ headers: {
432
+ "Content-Type": "application/json",
433
+ ...options?.headers,
434
+ ...params.headers,
435
+ },
436
+ });
437
+ }
438
+ /**
439
+ * Withdraw ranked-auction earnings
352
440
  *
353
- * Record a confirmed on-chain bid for a ranked auction sale. Called after the bid transaction is confirmed on-chain.
441
+ * Build a transaction to withdraw a ranked auction's cumulative earnings to the payment recipient after the auction has ended. Native-currency auctions only.
354
442
  */
355
- confirmBid(parameters, options) {
443
+ claimAuctionEarnings(parameters, options) {
356
444
  const params = buildClientParams([parameters], [
357
445
  {
358
446
  args: [
359
447
  { in: "path", key: "highlightId" },
360
448
  { in: "body", key: "saleId" },
361
- { in: "body", key: "txHash" },
362
449
  ],
363
450
  },
364
451
  ]);
365
452
  return (options?.client ?? this.client).post({
366
- url: "/collection/{highlightId}/sales/bid/confirm",
453
+ url: "/collection/{highlightId}/sales/earnings",
367
454
  ...options,
368
455
  ...params,
369
456
  headers: {
@@ -374,22 +461,66 @@ export class Collection extends HeyApiClient {
374
461
  });
375
462
  }
376
463
  /**
377
- * Confirm sale deployment
464
+ * Get ranked-auction live standings
378
465
  *
379
- * Confirm on-chain deployment of a public sale added to a live collection. Extracts the vector ID from the transaction receipt and sets the sale status to Live.
466
+ * Public read-model for a ranked auction: the current clearing price and each bid's winning/losing status (provisional while live, frozen once settled). Includes the authenticated viewer's winning-bid count and tokens left to claim when a bearer token is supplied.
380
467
  */
381
- confirmSale(parameters, options) {
468
+ rankedAuctionStandings(parameters, options) {
382
469
  const params = buildClientParams([parameters], [
383
470
  {
384
471
  args: [
385
472
  { in: "path", key: "highlightId" },
386
473
  { in: "path", key: "saleId" },
387
- { in: "body", key: "txHash" },
474
+ ],
475
+ },
476
+ ]);
477
+ return (options?.client ?? this.client).get({
478
+ url: "/collection/{highlightId}/sales/{saleId}/standings",
479
+ ...options,
480
+ ...params,
481
+ });
482
+ }
483
+ /**
484
+ * Fulfill (settle) an English auction
485
+ *
486
+ * Build the permissionless `AuctionManager.fulfillAuction` transaction. After the auction's end time anyone may settle it: the contract delivers the escrowed NFT to the winner's preferred recipient and splits the proceeds (95% recipient / 5% platform).
487
+ */
488
+ fulfillEnglishAuction(parameters, options) {
489
+ const params = buildClientParams([parameters], [
490
+ {
491
+ args: [
492
+ { in: "path", key: "highlightId" },
493
+ { in: "body", key: "saleId" },
494
+ ],
495
+ },
496
+ ]);
497
+ return (options?.client ?? this.client).post({
498
+ url: "/collection/{highlightId}/sales/auction/fulfill",
499
+ ...options,
500
+ ...params,
501
+ headers: {
502
+ "Content-Type": "application/json",
503
+ ...options?.headers,
504
+ ...params.headers,
505
+ },
506
+ });
507
+ }
508
+ /**
509
+ * Cancel an English auction
510
+ *
511
+ * Build the `AuctionManager.cancelAuctionOnChain` transaction. The contract enforces owner-only and that no reserve-meeting bid has landed; any escrowed NFT is returned to the owner. Creator only.
512
+ */
513
+ cancelEnglishAuction(parameters, options) {
514
+ const params = buildClientParams([parameters], [
515
+ {
516
+ args: [
517
+ { in: "path", key: "highlightId" },
518
+ { in: "body", key: "saleId" },
388
519
  ],
389
520
  },
390
521
  ]);
391
522
  return (options?.client ?? this.client).post({
392
- url: "/collection/{highlightId}/sales/{saleId}/confirm",
523
+ url: "/collection/{highlightId}/sales/auction/cancel",
393
524
  ...options,
394
525
  ...params,
395
526
  headers: {
@@ -399,6 +530,46 @@ export class Collection extends HeyApiClient {
399
530
  },
400
531
  });
401
532
  }
533
+ /**
534
+ * Get English auction standings
535
+ *
536
+ * Public read-model for an English auction: lifecycle state, reserve, current highest bid/bidder, end time, escrowed token, and creator earnings — served from the chain-reconciled projection. Includes whether the authenticated viewer is the current highest bidder when a bearer token is supplied.
537
+ */
538
+ englishAuctionStanding(parameters, options) {
539
+ const params = buildClientParams([parameters], [
540
+ {
541
+ args: [
542
+ { in: "path", key: "highlightId" },
543
+ { in: "path", key: "saleId" },
544
+ ],
545
+ },
546
+ ]);
547
+ return (options?.client ?? this.client).get({
548
+ url: "/collection/{highlightId}/sales/{saleId}/auction",
549
+ ...options,
550
+ ...params,
551
+ });
552
+ }
553
+ /**
554
+ * Get English auction bid history
555
+ *
556
+ * Public read-model: the English auction's bid history (newest first), sourced from the indexer's `Bid`-event ledger. Amounts are raw on-chain base units (wei) in the sale's currency.
557
+ */
558
+ englishAuctionBids(parameters, options) {
559
+ const params = buildClientParams([parameters], [
560
+ {
561
+ args: [
562
+ { in: "path", key: "highlightId" },
563
+ { in: "path", key: "saleId" },
564
+ ],
565
+ },
566
+ ]);
567
+ return (options?.client ?? this.client).get({
568
+ url: "/collection/{highlightId}/sales/{saleId}/auction/bids",
569
+ ...options,
570
+ ...params,
571
+ });
572
+ }
402
573
  /**
403
574
  * Initiate collection deployment
404
575
  *
@@ -438,37 +609,12 @@ export class Collection extends HeyApiClient {
438
609
  ...params,
439
610
  });
440
611
  }
441
- /**
442
- * Confirm deployment transaction
443
- *
444
- * Submit the transaction hash for a deployment awaiting confirmation.
445
- */
446
- deployConfirm(parameters, options) {
447
- const params = buildClientParams([parameters], [
448
- {
449
- args: [
450
- { in: "path", key: "highlightId" },
451
- { in: "body", key: "txHash" },
452
- ],
453
- },
454
- ]);
455
- return (options?.client ?? this.client).post({
456
- url: "/collection/{highlightId}/deploy/confirm",
457
- ...options,
458
- ...params,
459
- headers: {
460
- "Content-Type": "application/json",
461
- ...options?.headers,
462
- ...params.headers,
463
- },
464
- });
465
- }
466
612
  }
467
613
  export class Token extends HeyApiClient {
468
614
  /**
469
615
  * List tokens
470
616
  *
471
- * Get a paginated list of minted tokens for a collection. Returns tokens for public collections without authentication. Supports filtering by owner address.
617
+ * Get a paginated list of minted tokens for a collection. Returns tokens for public collections without authentication. Supports filtering by owner address and by trait attributes.
472
618
  */
473
619
  list(parameters, options) {
474
620
  const params = buildClientParams([parameters], [
@@ -481,6 +627,7 @@ export class Token extends HeyApiClient {
481
627
  { in: "query", key: "order" },
482
628
  { in: "query", key: "ownerAddress" },
483
629
  { in: "query", key: "search" },
630
+ { in: "query", key: "attributes" },
484
631
  ],
485
632
  },
486
633
  ]);
@@ -490,6 +637,19 @@ export class Token extends HeyApiClient {
490
637
  ...params,
491
638
  });
492
639
  }
640
+ /**
641
+ * List token attribute facets
642
+ *
643
+ * Get the trait/value facets with token counts for a collection — the data a filter sidebar renders. Available for public collections without authentication.
644
+ */
645
+ attributeFacets(parameters, options) {
646
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
647
+ return (options?.client ?? this.client).get({
648
+ url: "/collection/{highlightId}/tokens/attributes",
649
+ ...options,
650
+ ...params,
651
+ });
652
+ }
493
653
  /**
494
654
  * Get token
495
655
  *
@@ -510,6 +670,26 @@ export class Token extends HeyApiClient {
510
670
  ...params,
511
671
  });
512
672
  }
673
+ /**
674
+ * List token owners
675
+ *
676
+ * Get the current owners of a minted token with their balances. A single entry for ERC721 tokens; ERC1155 tokens can have many. Available for public collections without authentication.
677
+ */
678
+ listOwners(parameters, options) {
679
+ const params = buildClientParams([parameters], [
680
+ {
681
+ args: [
682
+ { in: "path", key: "highlightId" },
683
+ { in: "path", key: "tokenId" },
684
+ ],
685
+ },
686
+ ]);
687
+ return (options?.client ?? this.client).get({
688
+ url: "/collection/{highlightId}/tokens/{tokenId}/owners",
689
+ ...options,
690
+ ...params,
691
+ });
692
+ }
513
693
  }
514
694
  export class Config extends HeyApiClient {
515
695
  /**
@@ -670,6 +850,122 @@ export class Gate extends HeyApiClient {
670
850
  },
671
851
  });
672
852
  }
853
+ /**
854
+ * Preview a collection
855
+ *
856
+ * Resolve an NFT contract for the gate builder — a Highlight collection if we host it, otherwise external NFT data.
857
+ */
858
+ previewCollection(parameters, options) {
859
+ const params = buildClientParams([parameters], [
860
+ {
861
+ args: [
862
+ { in: "path", key: "chainId" },
863
+ { in: "path", key: "address" },
864
+ ],
865
+ },
866
+ ]);
867
+ return (options?.client ?? this.client).get({
868
+ url: "/gate/preview/collection/{chainId}/{address}",
869
+ ...options,
870
+ ...params,
871
+ });
872
+ }
873
+ /**
874
+ * Preview collection attributes
875
+ *
876
+ * List a collection's trait types and values for the TOKEN_ATTRIBUTE builder.
877
+ */
878
+ previewAttributes(parameters, options) {
879
+ const params = buildClientParams([parameters], [
880
+ {
881
+ args: [
882
+ { in: "path", key: "chainId" },
883
+ { in: "path", key: "address" },
884
+ ],
885
+ },
886
+ ]);
887
+ return (options?.client ?? this.client).get({
888
+ url: "/gate/preview/collection/{chainId}/{address}/attributes",
889
+ ...options,
890
+ ...params,
891
+ });
892
+ }
893
+ /**
894
+ * Preview collection tokens
895
+ *
896
+ * Page through a collection's tokens for the SPECIFIC_TOKEN builder.
897
+ */
898
+ previewTokens(parameters, options) {
899
+ const params = buildClientParams([parameters], [
900
+ {
901
+ args: [
902
+ { in: "path", key: "chainId" },
903
+ { in: "path", key: "address" },
904
+ { in: "query", key: "cursor" },
905
+ { in: "query", key: "limit" },
906
+ ],
907
+ },
908
+ ]);
909
+ return (options?.client ?? this.client).get({
910
+ url: "/gate/preview/collection/{chainId}/{address}/tokens",
911
+ ...options,
912
+ ...params,
913
+ });
914
+ }
915
+ /**
916
+ * Preview a token
917
+ *
918
+ * Resolve a single token to confirm a SPECIFIC_TOKEN condition.
919
+ */
920
+ previewToken(parameters, options) {
921
+ const params = buildClientParams([parameters], [
922
+ {
923
+ args: [
924
+ { in: "path", key: "chainId" },
925
+ { in: "path", key: "address" },
926
+ { in: "path", key: "tokenId" },
927
+ ],
928
+ },
929
+ ]);
930
+ return (options?.client ?? this.client).get({
931
+ url: "/gate/preview/collection/{chainId}/{address}/token/{tokenId}",
932
+ ...options,
933
+ ...params,
934
+ });
935
+ }
936
+ /**
937
+ * Preview a currency
938
+ *
939
+ * Resolve the native gas token (no contractAddress) or an ERC-20 for the CURRENCY_BALANCE builder.
940
+ */
941
+ previewCurrency(parameters, options) {
942
+ const params = buildClientParams([parameters], [
943
+ {
944
+ args: [
945
+ { in: "path", key: "chainId" },
946
+ { in: "query", key: "contractAddress" },
947
+ ],
948
+ },
949
+ ]);
950
+ return (options?.client ?? this.client).get({
951
+ url: "/gate/preview/currency/{chainId}",
952
+ ...options,
953
+ ...params,
954
+ });
955
+ }
956
+ /**
957
+ * Preview a Farcaster user
958
+ *
959
+ * Resolve a numeric fid or @handle to a Farcaster user for the FARCASTER_FOLLOW builder.
960
+ */
961
+ previewFarcaster(parameters, options) {
962
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "query" }] }]);
963
+ return (options?.client ?? this.client).get({
964
+ url: "/gate/preview/farcaster/user",
965
+ ...options,
966
+ ...params,
967
+ });
968
+ }
673
969
  }
674
970
  export class Mechanic extends HeyApiClient {
675
971
  /**
@@ -931,7 +1227,7 @@ export class Media extends HeyApiClient {
931
1227
  /**
932
1228
  * Get a child File Entity by path
933
1229
  *
934
- * Returns the child File's full Entity (with locations and status). Use `entity.url` to fetch bytes directly from the storage provider.
1230
+ * Returns the child File's full Entity (with locations and status). Use a location's `url` to fetch bytes directly from the storage provider.
935
1231
  */
936
1232
  getChild(parameters, options) {
937
1233
  const params = buildClientParams([parameters], [
@@ -949,6 +1245,48 @@ export class Media extends HeyApiClient {
949
1245
  });
950
1246
  }
951
1247
  }
1248
+ export class Tx extends HeyApiClient {
1249
+ /**
1250
+ * Get transaction finalization status
1251
+ *
1252
+ * Returns the current finalization status for a transaction: the set of domain milestones (e.g. collection going live, sale going live) it must complete, and whether each is done. Overall is `Ready` only when every expected milestone is done. Use the `/ws` variant for live push updates instead of polling.
1253
+ */
1254
+ status(parameters, options) {
1255
+ const params = buildClientParams([parameters], [
1256
+ {
1257
+ args: [
1258
+ { in: "path", key: "chainId" },
1259
+ { in: "path", key: "txHash" },
1260
+ ],
1261
+ },
1262
+ ]);
1263
+ return (options?.client ?? this.client).get({
1264
+ url: "/tx/{chainId}/{txHash}",
1265
+ ...options,
1266
+ ...params,
1267
+ });
1268
+ }
1269
+ /**
1270
+ * Submit a transaction for tracking
1271
+ *
1272
+ * Hand a broadcast transaction hash to the backend so it is processed end-to-end (collection/sale/bid/mint effects) and its finalization milestones become available. Returns the current status snapshot; subscribe to the `/ws` variant to await finalization.
1273
+ */
1274
+ submit(parameters, options) {
1275
+ const params = buildClientParams([parameters], [
1276
+ {
1277
+ args: [
1278
+ { in: "path", key: "chainId" },
1279
+ { in: "path", key: "txHash" },
1280
+ ],
1281
+ },
1282
+ ]);
1283
+ return (options?.client ?? this.client).post({
1284
+ url: "/tx/{chainId}/{txHash}",
1285
+ ...options,
1286
+ ...params,
1287
+ });
1288
+ }
1289
+ }
952
1290
  export class Siwe extends HeyApiClient {
953
1291
  /**
954
1292
  * Issue a SIWE nonce
@@ -1114,6 +1452,10 @@ export class HighlightClient extends HeyApiClient {
1114
1452
  get media() {
1115
1453
  return (this._media ??= new Media({ client: this.client }));
1116
1454
  }
1455
+ _tx;
1456
+ get tx() {
1457
+ return (this._tx ??= new Tx({ client: this.client }));
1458
+ }
1117
1459
  _user;
1118
1460
  get user() {
1119
1461
  return (this._user ??= new User({ client: this.client }));