@highlightxyz/sdk 0.1.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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +28 -0
  3. package/lib/client.d.ts +10 -0
  4. package/lib/client.d.ts.map +1 -0
  5. package/lib/client.js +8 -0
  6. package/lib/index.d.ts +2 -0
  7. package/lib/index.d.ts.map +1 -0
  8. package/lib/index.js +1 -0
  9. package/lib/v1/gen/client/client.gen.d.ts +3 -0
  10. package/lib/v1/gen/client/client.gen.d.ts.map +1 -0
  11. package/lib/v1/gen/client/client.gen.js +234 -0
  12. package/lib/v1/gen/client/index.d.ts +9 -0
  13. package/lib/v1/gen/client/index.d.ts.map +1 -0
  14. package/lib/v1/gen/client/index.js +6 -0
  15. package/lib/v1/gen/client/types.gen.d.ts +118 -0
  16. package/lib/v1/gen/client/types.gen.d.ts.map +1 -0
  17. package/lib/v1/gen/client/types.gen.js +2 -0
  18. package/lib/v1/gen/client/utils.gen.d.ts +34 -0
  19. package/lib/v1/gen/client/utils.gen.d.ts.map +1 -0
  20. package/lib/v1/gen/client/utils.gen.js +228 -0
  21. package/lib/v1/gen/client.gen.d.ts +13 -0
  22. package/lib/v1/gen/client.gen.d.ts.map +1 -0
  23. package/lib/v1/gen/client.gen.js +3 -0
  24. package/lib/v1/gen/core/auth.gen.d.ts +19 -0
  25. package/lib/v1/gen/core/auth.gen.d.ts.map +1 -0
  26. package/lib/v1/gen/core/auth.gen.js +14 -0
  27. package/lib/v1/gen/core/bodySerializer.gen.d.ts +26 -0
  28. package/lib/v1/gen/core/bodySerializer.gen.d.ts.map +1 -0
  29. package/lib/v1/gen/core/bodySerializer.gen.js +57 -0
  30. package/lib/v1/gen/core/params.gen.d.ts +44 -0
  31. package/lib/v1/gen/core/params.gen.d.ts.map +1 -0
  32. package/lib/v1/gen/core/params.gen.js +100 -0
  33. package/lib/v1/gen/core/pathSerializer.gen.d.ts +34 -0
  34. package/lib/v1/gen/core/pathSerializer.gen.d.ts.map +1 -0
  35. package/lib/v1/gen/core/pathSerializer.gen.js +106 -0
  36. package/lib/v1/gen/core/queryKeySerializer.gen.d.ts +19 -0
  37. package/lib/v1/gen/core/queryKeySerializer.gen.d.ts.map +1 -0
  38. package/lib/v1/gen/core/queryKeySerializer.gen.js +92 -0
  39. package/lib/v1/gen/core/serverSentEvents.gen.d.ts +72 -0
  40. package/lib/v1/gen/core/serverSentEvents.gen.d.ts.map +1 -0
  41. package/lib/v1/gen/core/serverSentEvents.gen.js +133 -0
  42. package/lib/v1/gen/core/types.gen.d.ts +79 -0
  43. package/lib/v1/gen/core/types.gen.d.ts.map +1 -0
  44. package/lib/v1/gen/core/types.gen.js +2 -0
  45. package/lib/v1/gen/core/utils.gen.d.ts +20 -0
  46. package/lib/v1/gen/core/utils.gen.d.ts.map +1 -0
  47. package/lib/v1/gen/core/utils.gen.js +87 -0
  48. package/lib/v1/gen/sdk.gen.d.ts +689 -0
  49. package/lib/v1/gen/sdk.gen.d.ts.map +1 -0
  50. package/lib/v1/gen/sdk.gen.js +1116 -0
  51. package/lib/v1/gen/types.gen.d.ts +2960 -0
  52. package/lib/v1/gen/types.gen.d.ts.map +1 -0
  53. package/lib/v1/gen/types.gen.js +118 -0
  54. package/package.json +69 -0
@@ -0,0 +1,1116 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { buildClientParams, } from "./client";
3
+ import { client } from "./client.gen";
4
+ import { CaptureSettingsTrigger, CollectionType, ContractStandard, GateMatchMode, GenerativeEditionType, MediaKind, MediaScope, SaleAccessMode, SaleType, SelectorType, } from "./types.gen";
5
+ class HeyApiClient {
6
+ client;
7
+ constructor(args) {
8
+ this.client = args?.client ?? client;
9
+ }
10
+ }
11
+ class HeyApiRegistry {
12
+ defaultKey = "default";
13
+ instances = new Map();
14
+ get(key) {
15
+ const instance = this.instances.get(key ?? this.defaultKey);
16
+ if (!instance) {
17
+ throw new Error(`No SDK client found. Create one with "new HighlightClient()" to fix this error.`);
18
+ }
19
+ return instance;
20
+ }
21
+ set(value, key) {
22
+ this.instances.set(key ?? this.defaultKey, value);
23
+ }
24
+ }
25
+ export class Collection extends HeyApiClient {
26
+ /**
27
+ * List collections
28
+ *
29
+ * Get a paginated list of collections.
30
+ */
31
+ list(parameters, options) {
32
+ const params = buildClientParams([parameters], [
33
+ {
34
+ args: [
35
+ { in: "query", key: "page" },
36
+ { in: "query", key: "limit" },
37
+ { in: "query", key: "sortBy" },
38
+ { in: "query", key: "sortDirection" },
39
+ { in: "query", key: "status" },
40
+ { in: "query", key: "blockchains" },
41
+ { in: "query", key: "testnet" },
42
+ { in: "query", key: "types" },
43
+ ],
44
+ },
45
+ ]);
46
+ return (options?.client ?? this.client).get({
47
+ url: "/collection",
48
+ ...options,
49
+ ...params,
50
+ });
51
+ }
52
+ /**
53
+ * Create collection
54
+ *
55
+ * Create a draft collection and bind it to an existing or new draft contract.
56
+ */
57
+ create(parameters, options) {
58
+ const params = buildClientParams([parameters], [
59
+ {
60
+ args: [
61
+ { in: "body", key: "name" },
62
+ { in: "body", key: "description" },
63
+ { in: "body", key: "contractId" },
64
+ { in: "body", key: "contract" },
65
+ { in: "body", key: "logoMediaId" },
66
+ { in: "body", key: "image" },
67
+ { in: "body", key: "type" },
68
+ { in: "body", key: "royalty" },
69
+ { in: "body", key: "tokenManager" },
70
+ ],
71
+ },
72
+ ]);
73
+ return (options?.client ?? this.client).post({
74
+ url: "/collection",
75
+ ...options,
76
+ ...params,
77
+ headers: {
78
+ "Content-Type": "application/json",
79
+ ...options?.headers,
80
+ ...params.headers,
81
+ },
82
+ });
83
+ }
84
+ /**
85
+ * Get collection
86
+ *
87
+ * Get a collection by its highlight ID.
88
+ */
89
+ get(parameters, options) {
90
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
91
+ return (options?.client ?? this.client).get({
92
+ url: "/collection/{highlightId}",
93
+ ...options,
94
+ ...params,
95
+ });
96
+ }
97
+ /**
98
+ * Finalize collection base URI to Arweave
99
+ *
100
+ * Publish the collection's token-metadata base URI Directory to Arweave. Call once the collection is complete (sellout or manual trigger) to freeze metadata permanently. Idempotent — safe to call if already archived.
101
+ */
102
+ finalizeBaseUri(parameters, options) {
103
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
104
+ return (options?.client ?? this.client).post({
105
+ url: "/collection/{highlightId}/finalize-base-uri",
106
+ ...options,
107
+ ...params,
108
+ });
109
+ }
110
+ /**
111
+ * Update generative draft details
112
+ *
113
+ * Update generative-specific details for an existing draft.
114
+ */
115
+ updateGenerativeDetails(parameters, options) {
116
+ const params = buildClientParams([parameters], [
117
+ {
118
+ args: [
119
+ { in: "path", key: "highlightId" },
120
+ { in: "body", key: "generative" },
121
+ ],
122
+ },
123
+ ]);
124
+ return (options?.client ?? this.client).patch({
125
+ url: "/collection/{highlightId}/details/generative",
126
+ ...options,
127
+ ...params,
128
+ headers: {
129
+ "Content-Type": "application/json",
130
+ ...options?.headers,
131
+ ...params.headers,
132
+ },
133
+ });
134
+ }
135
+ /**
136
+ * Update series draft details
137
+ *
138
+ * Update series-specific details for an existing draft.
139
+ */
140
+ updateSeriesDetails(parameters, options) {
141
+ const params = buildClientParams([parameters], [
142
+ {
143
+ args: [
144
+ { in: "path", key: "highlightId" },
145
+ { in: "body", key: "series" },
146
+ ],
147
+ },
148
+ ]);
149
+ return (options?.client ?? this.client).patch({
150
+ url: "/collection/{highlightId}/details/series",
151
+ ...options,
152
+ ...params,
153
+ headers: {
154
+ "Content-Type": "application/json",
155
+ ...options?.headers,
156
+ ...params.headers,
157
+ },
158
+ });
159
+ }
160
+ /**
161
+ * Update edition draft details
162
+ *
163
+ * Update edition-specific details for an existing draft.
164
+ */
165
+ updateEditionDetails(parameters, options) {
166
+ const params = buildClientParams([parameters], [
167
+ {
168
+ args: [
169
+ { in: "path", key: "highlightId" },
170
+ { in: "body", key: "edition" },
171
+ ],
172
+ },
173
+ ]);
174
+ return (options?.client ?? this.client).patch({
175
+ url: "/collection/{highlightId}/details/edition",
176
+ ...options,
177
+ ...params,
178
+ headers: {
179
+ "Content-Type": "application/json",
180
+ ...options?.headers,
181
+ ...params.headers,
182
+ },
183
+ });
184
+ }
185
+ /**
186
+ * Get collection sales
187
+ *
188
+ * Get all sales for a collection.
189
+ */
190
+ getSales(parameters, options) {
191
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
192
+ return (options?.client ?? this.client).get({
193
+ url: "/collection/{highlightId}/sales",
194
+ ...options,
195
+ ...params,
196
+ });
197
+ }
198
+ /**
199
+ * Add a sale to a collection
200
+ *
201
+ * Add a new sale to a collection. Draft collections can have one sale at a time. For live collections, gated sales go live immediately; public sales return a contract execution for on-chain registration.
202
+ */
203
+ addSale(parameters, options) {
204
+ const params = buildClientParams([parameters], [
205
+ {
206
+ args: [
207
+ { in: "path", key: "highlightId" },
208
+ { in: "body", key: "name" },
209
+ { in: "body", key: "type" },
210
+ { in: "body", key: "startAt" },
211
+ { in: "body", key: "endAt" },
212
+ { in: "body", key: "price" },
213
+ { in: "body", key: "currency" },
214
+ { in: "body", key: "maxPerTransaction" },
215
+ { in: "body", key: "maxPerWallet" },
216
+ { in: "body", key: "maxTotal" },
217
+ { in: "body", key: "paymentRecipient" },
218
+ { in: "body", key: "accessMode" },
219
+ { in: "body", key: "gateId" },
220
+ { in: "body", key: "gasSponsored" },
221
+ { in: "body", key: "mechanicId" },
222
+ { in: "body", key: "typeConfig" },
223
+ { in: "body", key: "collectorMessage" },
224
+ { in: "body", key: "customMintFee" },
225
+ ],
226
+ },
227
+ ]);
228
+ return (options?.client ?? this.client).post({
229
+ url: "/collection/{highlightId}/sales",
230
+ ...options,
231
+ ...params,
232
+ headers: {
233
+ "Content-Type": "application/json",
234
+ ...options?.headers,
235
+ ...params.headers,
236
+ },
237
+ });
238
+ }
239
+ /**
240
+ * Delete a sale
241
+ *
242
+ * Delete a draft sale from a collection. Live sales cannot be deleted — use update to pause or set an end date instead.
243
+ */
244
+ deleteSale(parameters, options) {
245
+ const params = buildClientParams([parameters], [
246
+ {
247
+ args: [
248
+ { in: "path", key: "highlightId" },
249
+ { in: "path", key: "saleId" },
250
+ ],
251
+ },
252
+ ]);
253
+ return (options?.client ?? this.client).delete({
254
+ url: "/collection/{highlightId}/sales/{saleId}",
255
+ ...options,
256
+ ...params,
257
+ });
258
+ }
259
+ /**
260
+ * Update a sale
261
+ *
262
+ * Update an existing sale. Draft sales can be updated freely. Live public sales return a contract execution for on-chain updates when on-chain fields change.
263
+ */
264
+ updateSale(parameters, options) {
265
+ const params = buildClientParams([parameters], [
266
+ {
267
+ args: [
268
+ { in: "path", key: "highlightId" },
269
+ { in: "path", key: "saleId" },
270
+ { in: "body", key: "name" },
271
+ { in: "body", key: "startAt" },
272
+ { in: "body", key: "endAt" },
273
+ { in: "body", key: "price" },
274
+ { in: "body", key: "currency" },
275
+ { in: "body", key: "maxPerTransaction" },
276
+ { in: "body", key: "maxPerWallet" },
277
+ { in: "body", key: "maxTotal" },
278
+ { in: "body", key: "paymentRecipient" },
279
+ { in: "body", key: "paused" },
280
+ { in: "body", key: "collectorMessage" },
281
+ { in: "body", key: "customMintFee" },
282
+ ],
283
+ },
284
+ ]);
285
+ return (options?.client ?? this.client).patch({
286
+ url: "/collection/{highlightId}/sales/{saleId}",
287
+ ...options,
288
+ ...params,
289
+ headers: {
290
+ "Content-Type": "application/json",
291
+ ...options?.headers,
292
+ ...params.headers,
293
+ },
294
+ });
295
+ }
296
+ /**
297
+ * Claim collection sale
298
+ *
299
+ * Build a claim transaction configuration for a collector sale action.
300
+ */
301
+ claimSale(parameters, options) {
302
+ const params = buildClientParams([parameters], [
303
+ {
304
+ args: [
305
+ { in: "path", key: "highlightId" },
306
+ { in: "body", key: "saleId" },
307
+ { in: "body", key: "amount" },
308
+ { in: "body", key: "tokenIds" },
309
+ ],
310
+ },
311
+ ]);
312
+ return (options?.client ?? this.client).post({
313
+ url: "/collection/{highlightId}/sales/claim",
314
+ ...options,
315
+ ...params,
316
+ headers: {
317
+ "Content-Type": "application/json",
318
+ ...options?.headers,
319
+ ...params.headers,
320
+ },
321
+ });
322
+ }
323
+ /**
324
+ * Bid on ranked auction sale
325
+ *
326
+ * Build a bid transaction configuration for a ranked auction sale. Returns contract execution data for placing or updating a bid.
327
+ */
328
+ bidSale(parameters, options) {
329
+ const params = buildClientParams([parameters], [
330
+ {
331
+ args: [
332
+ { in: "path", key: "highlightId" },
333
+ { in: "body", key: "saleId" },
334
+ { in: "body", key: "bidAmount" },
335
+ { in: "body", key: "bidId" },
336
+ ],
337
+ },
338
+ ]);
339
+ return (options?.client ?? this.client).post({
340
+ url: "/collection/{highlightId}/sales/bid",
341
+ ...options,
342
+ ...params,
343
+ headers: {
344
+ "Content-Type": "application/json",
345
+ ...options?.headers,
346
+ ...params.headers,
347
+ },
348
+ });
349
+ }
350
+ /**
351
+ * Confirm ranked auction bid
352
+ *
353
+ * Record a confirmed on-chain bid for a ranked auction sale. Called after the bid transaction is confirmed on-chain.
354
+ */
355
+ confirmBid(parameters, options) {
356
+ const params = buildClientParams([parameters], [
357
+ {
358
+ args: [
359
+ { in: "path", key: "highlightId" },
360
+ { in: "body", key: "saleId" },
361
+ { in: "body", key: "txHash" },
362
+ ],
363
+ },
364
+ ]);
365
+ return (options?.client ?? this.client).post({
366
+ url: "/collection/{highlightId}/sales/bid/confirm",
367
+ ...options,
368
+ ...params,
369
+ headers: {
370
+ "Content-Type": "application/json",
371
+ ...options?.headers,
372
+ ...params.headers,
373
+ },
374
+ });
375
+ }
376
+ /**
377
+ * Confirm sale deployment
378
+ *
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.
380
+ */
381
+ confirmSale(parameters, options) {
382
+ const params = buildClientParams([parameters], [
383
+ {
384
+ args: [
385
+ { in: "path", key: "highlightId" },
386
+ { in: "path", key: "saleId" },
387
+ { in: "body", key: "txHash" },
388
+ ],
389
+ },
390
+ ]);
391
+ return (options?.client ?? this.client).post({
392
+ url: "/collection/{highlightId}/sales/{saleId}/confirm",
393
+ ...options,
394
+ ...params,
395
+ headers: {
396
+ "Content-Type": "application/json",
397
+ ...options?.headers,
398
+ ...params.headers,
399
+ },
400
+ });
401
+ }
402
+ /**
403
+ * Initiate collection deployment
404
+ *
405
+ * Start the deployment workflow for a draft collection.
406
+ */
407
+ deploy(parameters, options) {
408
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
409
+ return (options?.client ?? this.client).post({
410
+ url: "/collection/{highlightId}/deploy",
411
+ ...options,
412
+ ...params,
413
+ });
414
+ }
415
+ /**
416
+ * Get deployment status
417
+ *
418
+ * Get the current deployment status for a collection.
419
+ */
420
+ deployStatus(parameters, options) {
421
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
422
+ return (options?.client ?? this.client).get({
423
+ url: "/collection/{highlightId}/deploy/status",
424
+ ...options,
425
+ ...params,
426
+ });
427
+ }
428
+ /**
429
+ * Confirm deployment transaction
430
+ *
431
+ * Submit the transaction hash for a deployment awaiting confirmation.
432
+ */
433
+ deployConfirm(parameters, options) {
434
+ const params = buildClientParams([parameters], [
435
+ {
436
+ args: [
437
+ { in: "path", key: "highlightId" },
438
+ { in: "body", key: "txHash" },
439
+ ],
440
+ },
441
+ ]);
442
+ return (options?.client ?? this.client).post({
443
+ url: "/collection/{highlightId}/deploy/confirm",
444
+ ...options,
445
+ ...params,
446
+ headers: {
447
+ "Content-Type": "application/json",
448
+ ...options?.headers,
449
+ ...params.headers,
450
+ },
451
+ });
452
+ }
453
+ }
454
+ export class Token extends HeyApiClient {
455
+ /**
456
+ * List tokens
457
+ *
458
+ * Get a paginated list of minted tokens for a collection. Returns tokens for public collections without authentication. Supports filtering by owner address.
459
+ */
460
+ list(parameters, options) {
461
+ const params = buildClientParams([parameters], [
462
+ {
463
+ args: [
464
+ { in: "path", key: "highlightId" },
465
+ { in: "query", key: "page" },
466
+ { in: "query", key: "limit" },
467
+ { in: "query", key: "sort" },
468
+ { in: "query", key: "order" },
469
+ { in: "query", key: "ownerAddress" },
470
+ { in: "query", key: "search" },
471
+ ],
472
+ },
473
+ ]);
474
+ return (options?.client ?? this.client).get({
475
+ url: "/collection/{highlightId}/tokens",
476
+ ...options,
477
+ ...params,
478
+ });
479
+ }
480
+ /**
481
+ * Get token
482
+ *
483
+ * Get a single minted token by its on-chain token ID. Returns token details for public collections without authentication.
484
+ */
485
+ get(parameters, options) {
486
+ const params = buildClientParams([parameters], [
487
+ {
488
+ args: [
489
+ { in: "path", key: "highlightId" },
490
+ { in: "path", key: "tokenId" },
491
+ ],
492
+ },
493
+ ]);
494
+ return (options?.client ?? this.client).get({
495
+ url: "/collection/{highlightId}/tokens/{tokenId}",
496
+ ...options,
497
+ ...params,
498
+ });
499
+ }
500
+ }
501
+ export class Config extends HeyApiClient {
502
+ /**
503
+ * List chains
504
+ *
505
+ * Get the list of supported chains and their configuration.
506
+ */
507
+ chains(options) {
508
+ return (options?.client ?? this.client).get({
509
+ url: "/config/chains",
510
+ ...options,
511
+ });
512
+ }
513
+ /**
514
+ * Get system contract
515
+ *
516
+ * Get a configured system contract address for a chain and contract type.
517
+ */
518
+ systemContract(parameters, options) {
519
+ const params = buildClientParams([parameters], [
520
+ {
521
+ args: [
522
+ { in: "query", key: "chainId" },
523
+ { in: "query", key: "type" },
524
+ ],
525
+ },
526
+ ]);
527
+ return (options?.client ?? this.client).get({
528
+ url: "/config/system-contract",
529
+ ...options,
530
+ ...params,
531
+ });
532
+ }
533
+ }
534
+ export class Contract extends HeyApiClient {
535
+ /**
536
+ * List contracts
537
+ *
538
+ * Get a cursor-paginated list of contracts.
539
+ */
540
+ list(parameters, options) {
541
+ const params = buildClientParams([parameters], [
542
+ {
543
+ args: [
544
+ { in: "query", key: "limit" },
545
+ { in: "query", key: "cursor" },
546
+ ],
547
+ },
548
+ ]);
549
+ return (options?.client ?? this.client).get({
550
+ url: "/contract",
551
+ ...options,
552
+ ...params,
553
+ });
554
+ }
555
+ /**
556
+ * Get contract
557
+ *
558
+ * Get a contract by its ID.
559
+ */
560
+ get(parameters, options) {
561
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "contractId" }] }]);
562
+ return (options?.client ?? this.client).get({
563
+ url: "/contract/{contractId}",
564
+ ...options,
565
+ ...params,
566
+ });
567
+ }
568
+ }
569
+ export class Gate extends HeyApiClient {
570
+ /**
571
+ * List gates
572
+ *
573
+ * List all gates for the authenticated user.
574
+ */
575
+ list(options) {
576
+ return (options?.client ?? this.client).get({
577
+ url: "/gate",
578
+ ...options,
579
+ });
580
+ }
581
+ /**
582
+ * Create gate
583
+ *
584
+ * Create a new gate with conditions.
585
+ */
586
+ create(parameters, options) {
587
+ const params = buildClientParams([parameters], [
588
+ {
589
+ args: [
590
+ { in: "body", key: "name" },
591
+ { in: "body", key: "matchMode" },
592
+ { in: "body", key: "conditions" },
593
+ ],
594
+ },
595
+ ]);
596
+ return (options?.client ?? this.client).post({
597
+ url: "/gate",
598
+ ...options,
599
+ ...params,
600
+ headers: {
601
+ "Content-Type": "application/json",
602
+ ...options?.headers,
603
+ ...params.headers,
604
+ },
605
+ });
606
+ }
607
+ /**
608
+ * Delete gate
609
+ *
610
+ * Delete a gate and all its conditions.
611
+ */
612
+ remove(parameters, options) {
613
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "gateId" }] }]);
614
+ return (options?.client ?? this.client).delete({
615
+ url: "/gate/{gateId}",
616
+ ...options,
617
+ ...params,
618
+ });
619
+ }
620
+ /**
621
+ * Get gate
622
+ *
623
+ * Get a gate by its ID.
624
+ */
625
+ get(parameters, options) {
626
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "gateId" }] }]);
627
+ return (options?.client ?? this.client).get({
628
+ url: "/gate/{gateId}",
629
+ ...options,
630
+ ...params,
631
+ });
632
+ }
633
+ /**
634
+ * Update gate
635
+ *
636
+ * Update a gate's name, match mode, or conditions.
637
+ */
638
+ update(parameters, options) {
639
+ const params = buildClientParams([parameters], [
640
+ {
641
+ args: [
642
+ { in: "path", key: "gateId" },
643
+ { in: "body", key: "name" },
644
+ { in: "body", key: "matchMode" },
645
+ { in: "body", key: "conditions" },
646
+ ],
647
+ },
648
+ ]);
649
+ return (options?.client ?? this.client).patch({
650
+ url: "/gate/{gateId}",
651
+ ...options,
652
+ ...params,
653
+ headers: {
654
+ "Content-Type": "application/json",
655
+ ...options?.headers,
656
+ ...params.headers,
657
+ },
658
+ });
659
+ }
660
+ }
661
+ export class Mechanic extends HeyApiClient {
662
+ /**
663
+ * List mechanics
664
+ *
665
+ * List all registered mechanics. Optionally filter by built-in status.
666
+ */
667
+ list(parameters, options) {
668
+ const params = buildClientParams([parameters], [
669
+ {
670
+ args: [
671
+ { in: "query", key: "builtIn" },
672
+ { in: "query", key: "type" },
673
+ ],
674
+ },
675
+ ]);
676
+ return (options?.client ?? this.client).get({
677
+ url: "/mechanic",
678
+ ...options,
679
+ ...params,
680
+ });
681
+ }
682
+ /**
683
+ * Create mechanic
684
+ *
685
+ * Register a new custom mechanic contract.
686
+ */
687
+ create(parameters, options) {
688
+ const params = buildClientParams([parameters], [
689
+ {
690
+ args: [
691
+ { in: "body", key: "slug" },
692
+ { in: "body", key: "name" },
693
+ { in: "body", key: "description" },
694
+ { in: "body", key: "configSchema" },
695
+ { in: "body", key: "encodingAbi" },
696
+ ],
697
+ },
698
+ ]);
699
+ return (options?.client ?? this.client).post({
700
+ url: "/mechanic",
701
+ ...options,
702
+ ...params,
703
+ headers: {
704
+ "Content-Type": "application/json",
705
+ ...options?.headers,
706
+ ...params.headers,
707
+ },
708
+ });
709
+ }
710
+ /**
711
+ * Get mechanic
712
+ *
713
+ * Get a mechanic by its ID.
714
+ */
715
+ get(parameters, options) {
716
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mechanicId" }] }]);
717
+ return (options?.client ?? this.client).get({
718
+ url: "/mechanic/{mechanicId}",
719
+ ...options,
720
+ ...params,
721
+ });
722
+ }
723
+ /**
724
+ * Update mechanic
725
+ *
726
+ * Update a custom mechanic. Built-in mechanics cannot be modified.
727
+ */
728
+ update(parameters, options) {
729
+ const params = buildClientParams([parameters], [
730
+ {
731
+ args: [
732
+ { in: "path", key: "mechanicId" },
733
+ { in: "body", key: "name" },
734
+ { in: "body", key: "description" },
735
+ { in: "body", key: "configSchema" },
736
+ { in: "body", key: "encodingAbi" },
737
+ ],
738
+ },
739
+ ]);
740
+ return (options?.client ?? this.client).patch({
741
+ url: "/mechanic/{mechanicId}",
742
+ ...options,
743
+ ...params,
744
+ headers: {
745
+ "Content-Type": "application/json",
746
+ ...options?.headers,
747
+ ...params.headers,
748
+ },
749
+ });
750
+ }
751
+ /**
752
+ * Remove mechanic deployment
753
+ *
754
+ * Remove a mechanic contract deployment from a specific chain.
755
+ */
756
+ removeDeployment(parameters, options) {
757
+ const params = buildClientParams([parameters], [
758
+ {
759
+ args: [
760
+ { in: "path", key: "mechanicId" },
761
+ { in: "body", key: "chainId" },
762
+ ],
763
+ },
764
+ ]);
765
+ return (options?.client ?? this.client).delete({
766
+ url: "/mechanic/{mechanicId}/deployment",
767
+ ...options,
768
+ ...params,
769
+ headers: {
770
+ "Content-Type": "application/json",
771
+ ...options?.headers,
772
+ ...params.headers,
773
+ },
774
+ });
775
+ }
776
+ /**
777
+ * Add mechanic deployment
778
+ *
779
+ * Register a mechanic contract deployment on a specific chain. Upserts if a deployment already exists for the chain.
780
+ */
781
+ addDeployment(parameters, options) {
782
+ const params = buildClientParams([parameters], [
783
+ {
784
+ args: [
785
+ { in: "path", key: "mechanicId" },
786
+ { in: "body", key: "chainId" },
787
+ { in: "body", key: "address" },
788
+ ],
789
+ },
790
+ ]);
791
+ return (options?.client ?? this.client).post({
792
+ url: "/mechanic/{mechanicId}/deployment",
793
+ ...options,
794
+ ...params,
795
+ headers: {
796
+ "Content-Type": "application/json",
797
+ ...options?.headers,
798
+ ...params.headers,
799
+ },
800
+ });
801
+ }
802
+ }
803
+ export class Media extends HeyApiClient {
804
+ /**
805
+ * Create media upload session
806
+ *
807
+ * Create a media asset and return the worker upload URL the client should PUT bytes to. Call /:mediaId/process once the PUT completes.
808
+ */
809
+ createUploadSession(parameters, options) {
810
+ const params = buildClientParams([parameters], [
811
+ {
812
+ args: [
813
+ { in: "body", key: "kind" },
814
+ { in: "body", key: "scope" },
815
+ { in: "body", key: "fileName" },
816
+ { in: "body", key: "mimeType" },
817
+ { in: "body", key: "fileSize" },
818
+ ],
819
+ },
820
+ ]);
821
+ return (options?.client ?? this.client).post({
822
+ url: "/media/upload-session",
823
+ ...options,
824
+ ...params,
825
+ headers: {
826
+ "Content-Type": "application/json",
827
+ ...options?.headers,
828
+ ...params.headers,
829
+ },
830
+ });
831
+ }
832
+ /**
833
+ * Upload media bytes
834
+ *
835
+ * Stream the file body to the worker, which writes it to storage and immediately drives the asset through processing. File assets come back Ready; Directory assets come back Processing (zip extraction running). Call /:mediaId/process to retry a Failed Directory.
836
+ */
837
+ upload(parameters, options) {
838
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mediaId" }] }]);
839
+ return (options?.client ?? this.client).put({
840
+ url: "/media/{mediaId}/upload",
841
+ ...options,
842
+ ...params,
843
+ });
844
+ }
845
+ /**
846
+ * Process a media asset
847
+ *
848
+ * Drive the media asset toward Ready. Call after PUTting bytes to /:mediaId/upload to finalize the upload (File assets become Ready; Directory assets trigger zip extraction). Idempotent — assets that are already Ready or currently Processing are returned as-is. Failed Directory assets re-trigger extraction.
849
+ */
850
+ process(parameters, options) {
851
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mediaId" }] }]);
852
+ return (options?.client ?? this.client).post({
853
+ url: "/media/{mediaId}/process",
854
+ ...options,
855
+ ...params,
856
+ });
857
+ }
858
+ /**
859
+ * List children of a Directory media asset
860
+ *
861
+ * Returns a paginated list of File children (e.g. per-token metadata or extracted archive files).
862
+ */
863
+ listChildren(parameters, options) {
864
+ const params = buildClientParams([parameters], [
865
+ {
866
+ args: [
867
+ { in: "path", key: "mediaId" },
868
+ { in: "query", key: "cursor" },
869
+ { in: "query", key: "limit" },
870
+ ],
871
+ },
872
+ ]);
873
+ return (options?.client ?? this.client).get({
874
+ url: "/media/{mediaId}/children",
875
+ ...options,
876
+ ...params,
877
+ });
878
+ }
879
+ /**
880
+ * Delete a media asset
881
+ *
882
+ * Delete the media asset and its R2 objects. Arweave archive locations remain on-chain (immutable) but are no longer referenced. Fails with 409 if still referenced by a collection contract or generative collection code.
883
+ */
884
+ delete(parameters, options) {
885
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mediaId" }] }]);
886
+ return (options?.client ?? this.client).delete({
887
+ url: "/media/{mediaId}",
888
+ ...options,
889
+ ...params,
890
+ });
891
+ }
892
+ /**
893
+ * Get media asset
894
+ *
895
+ * Get media asset details including kind, locations, and status.
896
+ */
897
+ get(parameters, options) {
898
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mediaId" }] }]);
899
+ return (options?.client ?? this.client).get({
900
+ url: "/media/{mediaId}",
901
+ ...options,
902
+ ...params,
903
+ });
904
+ }
905
+ /**
906
+ * Publish media to archive
907
+ *
908
+ * Mirror the media asset to its immutable archive provider (Arweave). File media publishes the single blob; Directory media publishes a manifest of all children. Idempotent — returns early if already archived.
909
+ */
910
+ publish(parameters, options) {
911
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mediaId" }] }]);
912
+ return (options?.client ?? this.client).post({
913
+ url: "/media/{mediaId}/publish",
914
+ ...options,
915
+ ...params,
916
+ });
917
+ }
918
+ /**
919
+ * Get a child File Entity by path
920
+ *
921
+ * Returns the child File's full Entity (with locations and status). Use `entity.url` to fetch bytes directly from the storage provider.
922
+ */
923
+ getChild(parameters, options) {
924
+ const params = buildClientParams([parameters], [
925
+ {
926
+ args: [
927
+ { in: "path", key: "mediaId" },
928
+ { in: "path", key: "path" },
929
+ ],
930
+ },
931
+ ]);
932
+ return (options?.client ?? this.client).get({
933
+ url: "/media/{mediaId}/children/{path}",
934
+ ...options,
935
+ ...params,
936
+ });
937
+ }
938
+ }
939
+ export class Siwe extends HeyApiClient {
940
+ /**
941
+ * Issue a SIWE nonce
942
+ *
943
+ * Issues a single-use, short-lived nonce for use as the `nonce` field of a SIWE (EIP-4361) message.
944
+ */
945
+ nonce(options) {
946
+ return (options?.client ?? this.client).post({ url: "/user/signin/siwe/nonce", ...options });
947
+ }
948
+ }
949
+ export class User extends HeyApiClient {
950
+ /**
951
+ * Sign in user
952
+ *
953
+ * Sign in with a provider credential (Privy id_token or SIWE message + signature) and receive access/refresh tokens plus user.
954
+ */
955
+ signin(parameters, options) {
956
+ const params = buildClientParams([parameters], [{ args: [{ key: "body", map: "body" }] }]);
957
+ return (options?.client ?? this.client).post({
958
+ url: "/user/signin",
959
+ ...options,
960
+ ...params,
961
+ headers: {
962
+ "Content-Type": "application/json",
963
+ ...options?.headers,
964
+ ...params.headers,
965
+ },
966
+ });
967
+ }
968
+ _siwe;
969
+ get siwe() {
970
+ return (this._siwe ??= new Siwe({ client: this.client }));
971
+ }
972
+ }
973
+ export class ApiKey extends HeyApiClient {
974
+ /**
975
+ * List API keys
976
+ *
977
+ * List all API keys for the authenticated account.
978
+ */
979
+ list(options) {
980
+ return (options?.client ?? this.client).get({ url: "/user/api-keys", ...options });
981
+ }
982
+ /**
983
+ * Create API key
984
+ *
985
+ * Create a new API key. The plaintext key is returned only once in this response.
986
+ */
987
+ create(parameters, options) {
988
+ const params = buildClientParams([parameters], [
989
+ {
990
+ args: [
991
+ { in: "body", key: "name" },
992
+ { in: "body", key: "expiresAt" },
993
+ ],
994
+ },
995
+ ]);
996
+ return (options?.client ?? this.client).post({
997
+ url: "/user/api-keys",
998
+ ...options,
999
+ ...params,
1000
+ headers: {
1001
+ "Content-Type": "application/json",
1002
+ ...options?.headers,
1003
+ ...params.headers,
1004
+ },
1005
+ });
1006
+ }
1007
+ /**
1008
+ * Revoke API key
1009
+ *
1010
+ * Revoke an API key. Revoked keys can no longer authenticate requests.
1011
+ */
1012
+ revoke(parameters, options) {
1013
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "apiKeyId" }] }]);
1014
+ return (options?.client ?? this.client).delete({
1015
+ url: "/user/api-keys/{apiKeyId}",
1016
+ ...options,
1017
+ ...params,
1018
+ });
1019
+ }
1020
+ }
1021
+ export class Health extends HeyApiClient {
1022
+ /**
1023
+ * Health check
1024
+ *
1025
+ * Check if the service is healthy.
1026
+ */
1027
+ get(options) {
1028
+ return (options?.client ?? this.client).get({
1029
+ url: "/health",
1030
+ ...options,
1031
+ });
1032
+ }
1033
+ }
1034
+ export class HighlightClient extends HeyApiClient {
1035
+ static __registry = new HeyApiRegistry();
1036
+ constructor(args) {
1037
+ super(args);
1038
+ HighlightClient.__registry.set(this, args?.key);
1039
+ }
1040
+ postIndexerChainsByChainIdActivate(parameters, options) {
1041
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "chainId" }] }]);
1042
+ return (options?.client ?? this.client).post({
1043
+ url: "/indexer/chains/{chainId}/activate",
1044
+ ...options,
1045
+ ...params,
1046
+ });
1047
+ }
1048
+ postIndexerChainsByChainIdReset(parameters, options) {
1049
+ const params = buildClientParams([parameters], [
1050
+ {
1051
+ args: [
1052
+ { in: "path", key: "chainId" },
1053
+ { in: "body", key: "blockNumber" },
1054
+ ],
1055
+ },
1056
+ ]);
1057
+ return (options?.client ?? this.client).post({
1058
+ url: "/indexer/chains/{chainId}/reset",
1059
+ ...options,
1060
+ ...params,
1061
+ headers: {
1062
+ "Content-Type": "application/json",
1063
+ ...options?.headers,
1064
+ ...params.headers,
1065
+ },
1066
+ });
1067
+ }
1068
+ postIndexerChainsByChainIdPoll(parameters, options) {
1069
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "chainId" }] }]);
1070
+ return (options?.client ?? this.client).post({
1071
+ url: "/indexer/chains/{chainId}/poll",
1072
+ ...options,
1073
+ ...params,
1074
+ });
1075
+ }
1076
+ _collection;
1077
+ get collection() {
1078
+ return (this._collection ??= new Collection({ client: this.client }));
1079
+ }
1080
+ _token;
1081
+ get token() {
1082
+ return (this._token ??= new Token({ client: this.client }));
1083
+ }
1084
+ _config;
1085
+ get config() {
1086
+ return (this._config ??= new Config({ client: this.client }));
1087
+ }
1088
+ _contract;
1089
+ get contract() {
1090
+ return (this._contract ??= new Contract({ client: this.client }));
1091
+ }
1092
+ _gate;
1093
+ get gate() {
1094
+ return (this._gate ??= new Gate({ client: this.client }));
1095
+ }
1096
+ _mechanic;
1097
+ get mechanic() {
1098
+ return (this._mechanic ??= new Mechanic({ client: this.client }));
1099
+ }
1100
+ _media;
1101
+ get media() {
1102
+ return (this._media ??= new Media({ client: this.client }));
1103
+ }
1104
+ _user;
1105
+ get user() {
1106
+ return (this._user ??= new User({ client: this.client }));
1107
+ }
1108
+ _apiKey;
1109
+ get apiKey() {
1110
+ return (this._apiKey ??= new ApiKey({ client: this.client }));
1111
+ }
1112
+ _health;
1113
+ get health() {
1114
+ return (this._health ??= new Health({ client: this.client }));
1115
+ }
1116
+ }