@highlightxyz/cli 0.3.0 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +14 -6
  2. package/lib/index.js +57 -2682
  3. package/package.json +7 -9
package/lib/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // package.json
3
3
  var package_default = {
4
4
  name: "@highlightxyz/cli",
5
- version: "0.3.0",
5
+ version: "0.3.2",
6
6
  description: "Official command-line interface for the Highlight API",
7
7
  keywords: [
8
8
  "cli",
@@ -11,13 +11,8 @@ var package_default = {
11
11
  "nft",
12
12
  "web3"
13
13
  ],
14
- homepage: "https://highlight.xyz",
14
+ homepage: "https://docs.highlight.xyz/cli/setup/",
15
15
  license: "MIT",
16
- repository: {
17
- type: "git",
18
- url: "https://github.com/highlight-xyz/highlight-app.git",
19
- directory: "packages/cli"
20
- },
21
16
  bin: {
22
17
  hl: "./lib/index.js"
23
18
  },
@@ -30,7 +25,7 @@ var package_default = {
30
25
  access: "public"
31
26
  },
32
27
  scripts: {
33
- build: "bun build ./src/index.ts --outfile ./lib/index.js --target node --format esm",
28
+ build: "bun build ./src/index.ts --outfile ./lib/index.js --target node --format esm --external @highlightxyz/sdk",
34
29
  "ts-check": "bunx --bun tsgo --noEmit -p tsconfig.json",
35
30
  test: "bun test",
36
31
  lint: "oxlint ./src",
@@ -40,7 +35,7 @@ var package_default = {
40
35
  prepublishOnly: "bun run build"
41
36
  },
42
37
  dependencies: {
43
- "@highlightxyz/sdk": "*"
38
+ "@highlightxyz/sdk": "^0.10.1"
44
39
  },
45
40
  devDependencies: {
46
41
  "@types/bun": "^1.3.9",
@@ -48,6 +43,9 @@ var package_default = {
48
43
  },
49
44
  engines: {
50
45
  node: ">=20"
46
+ },
47
+ bugs: {
48
+ url: "https://docs.highlight.xyz/reference/support/"
51
49
  }
52
50
  };
53
51
 
@@ -182,2650 +180,9 @@ var positiveNumber = (value, label) => {
182
180
  return parsed;
183
181
  };
184
182
 
185
- // ../sdk/src/v1/gen/types.gen.ts
186
- var CollectionType;
187
- ((CollectionType2) => {
188
- CollectionType2["OpenEdition"] = "OpenEdition";
189
- CollectionType2["LimitedEdition"] = "LimitedEdition";
190
- CollectionType2["OneOfOne"] = "OneOfOne";
191
- CollectionType2["Series"] = "Series";
192
- CollectionType2["GenerativeSeries"] = "GenerativeSeries";
193
- })(CollectionType ||= {});
194
- var ContractStandard;
195
- ((ContractStandard2) => {
196
- ContractStandard2["Erc721"] = "ERC721";
197
- ContractStandard2["Erc1155"] = "ERC1155";
198
- })(ContractStandard ||= {});
199
- var SaleType;
200
- ((SaleType2) => {
201
- SaleType2["FixedPrice"] = "FIXED_PRICE";
202
- SaleType2["DutchAuction"] = "DUTCH_AUCTION";
203
- SaleType2["RankedAuction"] = "RANKED_AUCTION";
204
- SaleType2["EnglishAuction"] = "ENGLISH_AUCTION";
205
- SaleType2["Custom"] = "CUSTOM";
206
- })(SaleType ||= {});
207
- var SaleAccessMode;
208
- ((SaleAccessMode2) => {
209
- SaleAccessMode2["Public"] = "PUBLIC";
210
- SaleAccessMode2["Gated"] = "GATED";
211
- })(SaleAccessMode ||= {});
212
- var MediaPurpose;
213
- ((MediaPurpose2) => {
214
- MediaPurpose2["CollectionLogo"] = "CollectionLogo";
215
- MediaPurpose2["EditionImage"] = "EditionImage";
216
- MediaPurpose2["EditionAnimation"] = "EditionAnimation";
217
- MediaPurpose2["SeriesAssets"] = "SeriesAssets";
218
- MediaPurpose2["GenerativeCode"] = "GenerativeCode";
219
- MediaPurpose2["UserAvatar"] = "UserAvatar";
220
- })(MediaPurpose ||= {});
221
- var GateMatchMode;
222
- ((GateMatchMode2) => {
223
- GateMatchMode2["All"] = "ALL";
224
- GateMatchMode2["Any"] = "ANY";
225
- })(GateMatchMode ||= {});
226
- // ../sdk/src/v1/gen/core/bodySerializer.gen.ts
227
- var jsonBodySerializer = {
228
- bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
229
- };
230
- // ../sdk/src/v1/gen/core/params.gen.ts
231
- var extraPrefixesMap = {
232
- $body_: "body",
233
- $headers_: "headers",
234
- $path_: "path",
235
- $query_: "query"
236
- };
237
- var extraPrefixes = Object.entries(extraPrefixesMap);
238
- var buildKeyMap = (fields, map) => {
239
- if (!map) {
240
- map = new Map;
241
- }
242
- for (const config of fields) {
243
- if ("in" in config) {
244
- if (config.key) {
245
- map.set(config.key, {
246
- in: config.in,
247
- map: config.map
248
- });
249
- }
250
- } else if ("key" in config) {
251
- map.set(config.key, {
252
- map: config.map
253
- });
254
- } else if (config.args) {
255
- buildKeyMap(config.args, map);
256
- }
257
- }
258
- return map;
259
- };
260
- var stripEmptySlots = (params) => {
261
- for (const [slot, value] of Object.entries(params)) {
262
- if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).length) {
263
- delete params[slot];
264
- }
265
- }
266
- };
267
- var buildClientParams = (args, fields) => {
268
- const params = {
269
- body: {},
270
- headers: {},
271
- path: {},
272
- query: {}
273
- };
274
- const map = buildKeyMap(fields);
275
- let config;
276
- for (const [index, arg] of args.entries()) {
277
- if (fields[index]) {
278
- config = fields[index];
279
- }
280
- if (!config) {
281
- continue;
282
- }
283
- if ("in" in config) {
284
- if (config.key) {
285
- const field = map.get(config.key);
286
- const name = field.map || config.key;
287
- if (field.in) {
288
- params[field.in][name] = arg;
289
- }
290
- } else {
291
- params.body = arg;
292
- }
293
- } else {
294
- for (const [key, value] of Object.entries(arg ?? {})) {
295
- const field = map.get(key);
296
- if (field) {
297
- if (field.in) {
298
- const name = field.map || key;
299
- params[field.in][name] = value;
300
- } else {
301
- params[field.map] = value;
302
- }
303
- } else {
304
- const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
305
- if (extra) {
306
- const [prefix, slot] = extra;
307
- params[slot][key.slice(prefix.length)] = value;
308
- } else if ("allowExtra" in config && config.allowExtra) {
309
- for (const [slot, allowed] of Object.entries(config.allowExtra)) {
310
- if (allowed) {
311
- params[slot][key] = value;
312
- break;
313
- }
314
- }
315
- }
316
- }
317
- }
318
- }
319
- }
320
- stripEmptySlots(params);
321
- return params;
322
- };
323
- // ../sdk/src/v1/gen/core/serverSentEvents.gen.ts
324
- var createSseClient = ({
325
- onRequest,
326
- onSseError,
327
- onSseEvent,
328
- responseTransformer,
329
- responseValidator,
330
- sseDefaultRetryDelay,
331
- sseMaxRetryAttempts,
332
- sseMaxRetryDelay,
333
- sseSleepFn,
334
- url,
335
- ...options
336
- }) => {
337
- let lastEventId;
338
- const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
339
- const createStream = async function* () {
340
- let retryDelay = sseDefaultRetryDelay ?? 3000;
341
- let attempt = 0;
342
- const signal = options.signal ?? new AbortController().signal;
343
- while (true) {
344
- if (signal.aborted)
345
- break;
346
- attempt++;
347
- const headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
348
- if (lastEventId !== undefined) {
349
- headers.set("Last-Event-ID", lastEventId);
350
- }
351
- try {
352
- const requestInit = {
353
- redirect: "follow",
354
- ...options,
355
- body: options.serializedBody,
356
- headers,
357
- signal
358
- };
359
- let request = new Request(url, requestInit);
360
- if (onRequest) {
361
- request = await onRequest(url, requestInit);
362
- }
363
- const _fetch = options.fetch ?? globalThis.fetch;
364
- const response = await _fetch(request);
365
- if (!response.ok)
366
- throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
367
- if (!response.body)
368
- throw new Error("No body in SSE response");
369
- const reader = response.body.pipeThrough(new TextDecoderStream).getReader();
370
- let buffer = "";
371
- const abortHandler = () => {
372
- try {
373
- reader.cancel();
374
- } catch {}
375
- };
376
- signal.addEventListener("abort", abortHandler);
377
- try {
378
- while (true) {
379
- const { done, value } = await reader.read();
380
- if (done)
381
- break;
382
- buffer += value;
383
- buffer = buffer.replace(/\r\n/g, `
384
- `).replace(/\r/g, `
385
- `);
386
- const chunks = buffer.split(`
387
-
388
- `);
389
- buffer = chunks.pop() ?? "";
390
- for (const chunk of chunks) {
391
- const lines = chunk.split(`
392
- `);
393
- const dataLines = [];
394
- let eventName;
395
- for (const line of lines) {
396
- if (line.startsWith("data:")) {
397
- dataLines.push(line.replace(/^data:\s*/, ""));
398
- } else if (line.startsWith("event:")) {
399
- eventName = line.replace(/^event:\s*/, "");
400
- } else if (line.startsWith("id:")) {
401
- lastEventId = line.replace(/^id:\s*/, "");
402
- } else if (line.startsWith("retry:")) {
403
- const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
404
- if (!Number.isNaN(parsed)) {
405
- retryDelay = parsed;
406
- }
407
- }
408
- }
409
- let data;
410
- let parsedJson = false;
411
- if (dataLines.length) {
412
- const rawData = dataLines.join(`
413
- `);
414
- try {
415
- data = JSON.parse(rawData);
416
- parsedJson = true;
417
- } catch {
418
- data = rawData;
419
- }
420
- }
421
- if (parsedJson) {
422
- if (responseValidator) {
423
- await responseValidator(data);
424
- }
425
- if (responseTransformer) {
426
- data = await responseTransformer(data);
427
- }
428
- }
429
- onSseEvent?.({
430
- data,
431
- event: eventName,
432
- id: lastEventId,
433
- retry: retryDelay
434
- });
435
- if (dataLines.length) {
436
- yield data;
437
- }
438
- }
439
- }
440
- } finally {
441
- signal.removeEventListener("abort", abortHandler);
442
- reader.releaseLock();
443
- }
444
- break;
445
- } catch (error) {
446
- onSseError?.(error);
447
- if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) {
448
- break;
449
- }
450
- const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000);
451
- await sleep(backoff);
452
- }
453
- }
454
- };
455
- const stream = createStream();
456
- return { stream };
457
- };
458
-
459
- // ../sdk/src/v1/gen/core/pathSerializer.gen.ts
460
- var separatorArrayExplode = (style) => {
461
- switch (style) {
462
- case "label":
463
- return ".";
464
- case "matrix":
465
- return ";";
466
- case "simple":
467
- return ",";
468
- default:
469
- return "&";
470
- }
471
- };
472
- var separatorArrayNoExplode = (style) => {
473
- switch (style) {
474
- case "form":
475
- return ",";
476
- case "pipeDelimited":
477
- return "|";
478
- case "spaceDelimited":
479
- return "%20";
480
- default:
481
- return ",";
482
- }
483
- };
484
- var separatorObjectExplode = (style) => {
485
- switch (style) {
486
- case "label":
487
- return ".";
488
- case "matrix":
489
- return ";";
490
- case "simple":
491
- return ",";
492
- default:
493
- return "&";
494
- }
495
- };
496
- var serializeArrayParam = ({
497
- allowReserved,
498
- explode,
499
- name,
500
- style,
501
- value
502
- }) => {
503
- if (!explode) {
504
- const joinedValues2 = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
505
- switch (style) {
506
- case "label":
507
- return `.${joinedValues2}`;
508
- case "matrix":
509
- return `;${name}=${joinedValues2}`;
510
- case "simple":
511
- return joinedValues2;
512
- default:
513
- return `${name}=${joinedValues2}`;
514
- }
515
- }
516
- const separator = separatorArrayExplode(style);
517
- const joinedValues = value.map((v) => {
518
- if (style === "label" || style === "simple") {
519
- return allowReserved ? v : encodeURIComponent(v);
520
- }
521
- return serializePrimitiveParam({
522
- allowReserved,
523
- name,
524
- value: v
525
- });
526
- }).join(separator);
527
- return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
528
- };
529
- var serializePrimitiveParam = ({
530
- allowReserved,
531
- name,
532
- value
533
- }) => {
534
- if (value === undefined || value === null) {
535
- return "";
536
- }
537
- if (typeof value === "object") {
538
- throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");
539
- }
540
- return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
541
- };
542
- var serializeObjectParam = ({
543
- allowReserved,
544
- explode,
545
- name,
546
- style,
547
- value,
548
- valueOnly
549
- }) => {
550
- if (value instanceof Date) {
551
- return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
552
- }
553
- if (style !== "deepObject" && !explode) {
554
- let values = [];
555
- Object.entries(value).forEach(([key, v]) => {
556
- values = [...values, key, allowReserved ? v : encodeURIComponent(v)];
557
- });
558
- const joinedValues2 = values.join(",");
559
- switch (style) {
560
- case "form":
561
- return `${name}=${joinedValues2}`;
562
- case "label":
563
- return `.${joinedValues2}`;
564
- case "matrix":
565
- return `;${name}=${joinedValues2}`;
566
- default:
567
- return joinedValues2;
568
- }
569
- }
570
- const separator = separatorObjectExplode(style);
571
- const joinedValues = Object.entries(value).map(([key, v]) => serializePrimitiveParam({
572
- allowReserved,
573
- name: style === "deepObject" ? `${name}[${key}]` : key,
574
- value: v
575
- })).join(separator);
576
- return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
577
- };
578
-
579
- // ../sdk/src/v1/gen/core/utils.gen.ts
580
- var PATH_PARAM_RE = /\{[^{}]+\}/g;
581
- var defaultPathSerializer = ({ path, url: _url }) => {
582
- let url = _url;
583
- const matches = _url.match(PATH_PARAM_RE);
584
- if (matches) {
585
- for (const match of matches) {
586
- let explode = false;
587
- let name = match.substring(1, match.length - 1);
588
- let style = "simple";
589
- if (name.endsWith("*")) {
590
- explode = true;
591
- name = name.substring(0, name.length - 1);
592
- }
593
- if (name.startsWith(".")) {
594
- name = name.substring(1);
595
- style = "label";
596
- } else if (name.startsWith(";")) {
597
- name = name.substring(1);
598
- style = "matrix";
599
- }
600
- const value = path[name];
601
- if (value === undefined || value === null) {
602
- continue;
603
- }
604
- if (Array.isArray(value)) {
605
- url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
606
- continue;
607
- }
608
- if (typeof value === "object") {
609
- url = url.replace(match, serializeObjectParam({
610
- explode,
611
- name,
612
- style,
613
- value,
614
- valueOnly: true
615
- }));
616
- continue;
617
- }
618
- if (style === "matrix") {
619
- url = url.replace(match, `;${serializePrimitiveParam({
620
- name,
621
- value
622
- })}`);
623
- continue;
624
- }
625
- const replaceValue = encodeURIComponent(style === "label" ? `.${value}` : value);
626
- url = url.replace(match, replaceValue);
627
- }
628
- }
629
- return url;
630
- };
631
- var getUrl = ({
632
- baseUrl,
633
- path,
634
- query,
635
- querySerializer,
636
- url: _url
637
- }) => {
638
- const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
639
- let url = (baseUrl ?? "") + pathUrl;
640
- if (path) {
641
- url = defaultPathSerializer({ path, url });
642
- }
643
- let search = query ? querySerializer(query) : "";
644
- if (search.startsWith("?")) {
645
- search = search.substring(1);
646
- }
647
- if (search) {
648
- url += `?${search}`;
649
- }
650
- return url;
651
- };
652
- function getValidRequestBody(options) {
653
- const hasBody = options.body !== undefined;
654
- const isSerializedBody = hasBody && options.bodySerializer;
655
- if (isSerializedBody) {
656
- if ("serializedBody" in options) {
657
- const hasSerializedBody = options.serializedBody !== undefined && options.serializedBody !== "";
658
- return hasSerializedBody ? options.serializedBody : null;
659
- }
660
- return options.body !== "" ? options.body : null;
661
- }
662
- if (hasBody) {
663
- return options.body;
664
- }
665
- return;
666
- }
667
-
668
- // ../sdk/src/v1/gen/core/auth.gen.ts
669
- var getAuthToken = async (auth, callback) => {
670
- const token = typeof callback === "function" ? await callback(auth) : callback;
671
- if (!token) {
672
- return;
673
- }
674
- if (auth.scheme === "bearer") {
675
- return `Bearer ${token}`;
676
- }
677
- if (auth.scheme === "basic") {
678
- return `Basic ${btoa(token)}`;
679
- }
680
- return token;
681
- };
682
-
683
- // ../sdk/src/v1/gen/client/utils.gen.ts
684
- var createQuerySerializer = ({
685
- parameters = {},
686
- ...args
687
- } = {}) => {
688
- const querySerializer = (queryParams) => {
689
- const search = [];
690
- if (queryParams && typeof queryParams === "object") {
691
- for (const name in queryParams) {
692
- const value = queryParams[name];
693
- if (value === undefined || value === null) {
694
- continue;
695
- }
696
- const options = parameters[name] || args;
697
- if (Array.isArray(value)) {
698
- const serializedArray = serializeArrayParam({
699
- allowReserved: options.allowReserved,
700
- explode: true,
701
- name,
702
- style: "form",
703
- value,
704
- ...options.array
705
- });
706
- if (serializedArray)
707
- search.push(serializedArray);
708
- } else if (typeof value === "object") {
709
- const serializedObject = serializeObjectParam({
710
- allowReserved: options.allowReserved,
711
- explode: true,
712
- name,
713
- style: "deepObject",
714
- value,
715
- ...options.object
716
- });
717
- if (serializedObject)
718
- search.push(serializedObject);
719
- } else {
720
- const serializedPrimitive = serializePrimitiveParam({
721
- allowReserved: options.allowReserved,
722
- name,
723
- value
724
- });
725
- if (serializedPrimitive)
726
- search.push(serializedPrimitive);
727
- }
728
- }
729
- }
730
- return search.join("&");
731
- };
732
- return querySerializer;
733
- };
734
- var getParseAs = (contentType) => {
735
- if (!contentType) {
736
- return "stream";
737
- }
738
- const cleanContent = contentType.split(";")[0]?.trim();
739
- if (!cleanContent) {
740
- return;
741
- }
742
- if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) {
743
- return "json";
744
- }
745
- if (cleanContent === "multipart/form-data") {
746
- return "formData";
747
- }
748
- if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) {
749
- return "blob";
750
- }
751
- if (cleanContent.startsWith("text/")) {
752
- return "text";
753
- }
754
- return;
755
- };
756
- var checkForExistence = (options, name) => {
757
- if (!name) {
758
- return false;
759
- }
760
- if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) {
761
- return true;
762
- }
763
- return false;
764
- };
765
- var setAuthParams = async ({
766
- security,
767
- ...options
768
- }) => {
769
- for (const auth of security) {
770
- if (checkForExistence(options, auth.name)) {
771
- continue;
772
- }
773
- const token = await getAuthToken(auth, options.auth);
774
- if (!token) {
775
- continue;
776
- }
777
- const name = auth.name ?? "Authorization";
778
- switch (auth.in) {
779
- case "query":
780
- if (!options.query) {
781
- options.query = {};
782
- }
783
- options.query[name] = token;
784
- break;
785
- case "cookie":
786
- options.headers.append("Cookie", `${name}=${token}`);
787
- break;
788
- case "header":
789
- default:
790
- options.headers.set(name, token);
791
- break;
792
- }
793
- }
794
- };
795
- var buildUrl = (options) => getUrl({
796
- baseUrl: options.baseUrl,
797
- path: options.path,
798
- query: options.query,
799
- querySerializer: typeof options.querySerializer === "function" ? options.querySerializer : createQuerySerializer(options.querySerializer),
800
- url: options.url
801
- });
802
- var mergeConfigs = (a, b) => {
803
- const config = { ...a, ...b };
804
- if (config.baseUrl?.endsWith("/")) {
805
- config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
806
- }
807
- config.headers = mergeHeaders(a.headers, b.headers);
808
- return config;
809
- };
810
- var headersEntries = (headers) => {
811
- const entries = [];
812
- headers.forEach((value, key) => {
813
- entries.push([key, value]);
814
- });
815
- return entries;
816
- };
817
- var mergeHeaders = (...headers) => {
818
- const mergedHeaders = new Headers;
819
- for (const header of headers) {
820
- if (!header) {
821
- continue;
822
- }
823
- const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
824
- for (const [key, value] of iterator) {
825
- if (value === null) {
826
- mergedHeaders.delete(key);
827
- } else if (Array.isArray(value)) {
828
- for (const v of value) {
829
- mergedHeaders.append(key, v);
830
- }
831
- } else if (value !== undefined) {
832
- mergedHeaders.set(key, typeof value === "object" ? JSON.stringify(value) : value);
833
- }
834
- }
835
- }
836
- return mergedHeaders;
837
- };
838
-
839
- class Interceptors {
840
- fns = [];
841
- clear() {
842
- this.fns = [];
843
- }
844
- eject(id) {
845
- const index = this.getInterceptorIndex(id);
846
- if (this.fns[index]) {
847
- this.fns[index] = null;
848
- }
849
- }
850
- exists(id) {
851
- const index = this.getInterceptorIndex(id);
852
- return Boolean(this.fns[index]);
853
- }
854
- getInterceptorIndex(id) {
855
- if (typeof id === "number") {
856
- return this.fns[id] ? id : -1;
857
- }
858
- return this.fns.indexOf(id);
859
- }
860
- update(id, fn) {
861
- const index = this.getInterceptorIndex(id);
862
- if (this.fns[index]) {
863
- this.fns[index] = fn;
864
- return id;
865
- }
866
- return false;
867
- }
868
- use(fn) {
869
- this.fns.push(fn);
870
- return this.fns.length - 1;
871
- }
872
- }
873
- var createInterceptors = () => ({
874
- error: new Interceptors,
875
- request: new Interceptors,
876
- response: new Interceptors
877
- });
878
- var defaultQuerySerializer = createQuerySerializer({
879
- allowReserved: false,
880
- array: {
881
- explode: true,
882
- style: "form"
883
- },
884
- object: {
885
- explode: true,
886
- style: "deepObject"
887
- }
888
- });
889
- var defaultHeaders = {
890
- "Content-Type": "application/json"
891
- };
892
- var createConfig = (override = {}) => ({
893
- ...jsonBodySerializer,
894
- headers: defaultHeaders,
895
- parseAs: "auto",
896
- querySerializer: defaultQuerySerializer,
897
- ...override
898
- });
899
-
900
- // ../sdk/src/v1/gen/client/client.gen.ts
901
- var createClient = (config = {}) => {
902
- let _config = mergeConfigs(createConfig(), config);
903
- const getConfig = () => ({ ..._config });
904
- const setConfig = (config2) => {
905
- _config = mergeConfigs(_config, config2);
906
- return getConfig();
907
- };
908
- const interceptors = createInterceptors();
909
- const beforeRequest = async (options) => {
910
- const opts = {
911
- ..._config,
912
- ...options,
913
- fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
914
- headers: mergeHeaders(_config.headers, options.headers),
915
- serializedBody: undefined
916
- };
917
- if (opts.security) {
918
- await setAuthParams({
919
- ...opts,
920
- security: opts.security
921
- });
922
- }
923
- if (opts.requestValidator) {
924
- await opts.requestValidator(opts);
925
- }
926
- if (opts.body !== undefined && opts.bodySerializer) {
927
- opts.serializedBody = opts.bodySerializer(opts.body);
928
- }
929
- if (opts.body === undefined || opts.serializedBody === "") {
930
- opts.headers.delete("Content-Type");
931
- }
932
- const url = buildUrl(opts);
933
- return { opts, url };
934
- };
935
- const request = async (options) => {
936
- const { opts, url } = await beforeRequest(options);
937
- const requestInit = {
938
- redirect: "follow",
939
- ...opts,
940
- body: getValidRequestBody(opts)
941
- };
942
- let request2 = new Request(url, requestInit);
943
- for (const fn of interceptors.request.fns) {
944
- if (fn) {
945
- request2 = await fn(request2, opts);
946
- }
947
- }
948
- const _fetch = opts.fetch;
949
- let response;
950
- try {
951
- response = await _fetch(request2);
952
- } catch (error2) {
953
- let finalError2 = error2;
954
- for (const fn of interceptors.error.fns) {
955
- if (fn) {
956
- finalError2 = await fn(error2, undefined, request2, opts);
957
- }
958
- }
959
- finalError2 = finalError2 || {};
960
- if (opts.throwOnError) {
961
- throw finalError2;
962
- }
963
- return opts.responseStyle === "data" ? undefined : {
964
- error: finalError2,
965
- request: request2,
966
- response: undefined
967
- };
968
- }
969
- for (const fn of interceptors.response.fns) {
970
- if (fn) {
971
- response = await fn(response, request2, opts);
972
- }
973
- }
974
- const result = {
975
- request: request2,
976
- response
977
- };
978
- if (response.ok) {
979
- const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
980
- if (response.status === 204 || response.headers.get("Content-Length") === "0") {
981
- let emptyData;
982
- switch (parseAs) {
983
- case "arrayBuffer":
984
- case "blob":
985
- case "text":
986
- emptyData = await response[parseAs]();
987
- break;
988
- case "formData":
989
- emptyData = new FormData;
990
- break;
991
- case "stream":
992
- emptyData = response.body;
993
- break;
994
- case "json":
995
- default:
996
- emptyData = {};
997
- break;
998
- }
999
- return opts.responseStyle === "data" ? emptyData : {
1000
- data: emptyData,
1001
- ...result
1002
- };
1003
- }
1004
- let data;
1005
- switch (parseAs) {
1006
- case "arrayBuffer":
1007
- case "blob":
1008
- case "formData":
1009
- case "text":
1010
- data = await response[parseAs]();
1011
- break;
1012
- case "json": {
1013
- const text = await response.text();
1014
- data = text ? JSON.parse(text) : {};
1015
- break;
1016
- }
1017
- case "stream":
1018
- return opts.responseStyle === "data" ? response.body : {
1019
- data: response.body,
1020
- ...result
1021
- };
1022
- }
1023
- if (parseAs === "json") {
1024
- if (opts.responseValidator) {
1025
- await opts.responseValidator(data);
1026
- }
1027
- if (opts.responseTransformer) {
1028
- data = await opts.responseTransformer(data);
1029
- }
1030
- }
1031
- return opts.responseStyle === "data" ? data : {
1032
- data,
1033
- ...result
1034
- };
1035
- }
1036
- const textError = await response.text();
1037
- let jsonError;
1038
- try {
1039
- jsonError = JSON.parse(textError);
1040
- } catch {}
1041
- const error = jsonError ?? textError;
1042
- let finalError = error;
1043
- for (const fn of interceptors.error.fns) {
1044
- if (fn) {
1045
- finalError = await fn(error, response, request2, opts);
1046
- }
1047
- }
1048
- finalError = finalError || {};
1049
- if (opts.throwOnError) {
1050
- throw finalError;
1051
- }
1052
- return opts.responseStyle === "data" ? undefined : {
1053
- error: finalError,
1054
- ...result
1055
- };
1056
- };
1057
- const makeMethodFn = (method) => (options) => request({ ...options, method });
1058
- const makeSseFn = (method) => async (options) => {
1059
- const { opts, url } = await beforeRequest(options);
1060
- return createSseClient({
1061
- ...opts,
1062
- body: opts.body,
1063
- headers: opts.headers,
1064
- method,
1065
- onRequest: async (url2, init) => {
1066
- let request2 = new Request(url2, init);
1067
- for (const fn of interceptors.request.fns) {
1068
- if (fn) {
1069
- request2 = await fn(request2, opts);
1070
- }
1071
- }
1072
- return request2;
1073
- },
1074
- serializedBody: getValidRequestBody(opts),
1075
- url
1076
- });
1077
- };
1078
- return {
1079
- buildUrl,
1080
- connect: makeMethodFn("CONNECT"),
1081
- delete: makeMethodFn("DELETE"),
1082
- get: makeMethodFn("GET"),
1083
- getConfig,
1084
- head: makeMethodFn("HEAD"),
1085
- interceptors,
1086
- options: makeMethodFn("OPTIONS"),
1087
- patch: makeMethodFn("PATCH"),
1088
- post: makeMethodFn("POST"),
1089
- put: makeMethodFn("PUT"),
1090
- request,
1091
- setConfig,
1092
- sse: {
1093
- connect: makeSseFn("CONNECT"),
1094
- delete: makeSseFn("DELETE"),
1095
- get: makeSseFn("GET"),
1096
- head: makeSseFn("HEAD"),
1097
- options: makeSseFn("OPTIONS"),
1098
- patch: makeSseFn("PATCH"),
1099
- post: makeSseFn("POST"),
1100
- put: makeSseFn("PUT"),
1101
- trace: makeSseFn("TRACE")
1102
- },
1103
- trace: makeMethodFn("TRACE")
1104
- };
1105
- };
1106
- // ../sdk/src/v1/gen/client.gen.ts
1107
- var client = createClient(createConfig());
1108
-
1109
- // ../sdk/src/v1/gen/sdk.gen.ts
1110
- class HeyApiClient {
1111
- client;
1112
- constructor(args) {
1113
- this.client = args?.client ?? client;
1114
- }
1115
- }
1116
-
1117
- class HeyApiRegistry {
1118
- defaultKey = "default";
1119
- instances = new Map;
1120
- get(key) {
1121
- const instance = this.instances.get(key ?? this.defaultKey);
1122
- if (!instance) {
1123
- throw new Error(`No SDK client found. Create one with "new HighlightClient()" to fix this error.`);
1124
- }
1125
- return instance;
1126
- }
1127
- set(value, key) {
1128
- this.instances.set(key ?? this.defaultKey, value);
1129
- }
1130
- }
1131
-
1132
- class Collection extends HeyApiClient {
1133
- list(parameters, options) {
1134
- const params = buildClientParams([parameters], [
1135
- {
1136
- args: [
1137
- { in: "query", key: "page" },
1138
- { in: "query", key: "limit" },
1139
- { in: "query", key: "sortBy" },
1140
- { in: "query", key: "sortDirection" },
1141
- { in: "query", key: "status" },
1142
- { in: "query", key: "blockchains" },
1143
- { in: "query", key: "testnet" },
1144
- { in: "query", key: "types" }
1145
- ]
1146
- }
1147
- ]);
1148
- return (options?.client ?? this.client).get({
1149
- url: "/collection",
1150
- ...options,
1151
- ...params
1152
- });
1153
- }
1154
- create(parameters, options) {
1155
- const params = buildClientParams([parameters], [
1156
- {
1157
- args: [
1158
- { in: "body", key: "name" },
1159
- { in: "body", key: "description" },
1160
- { in: "body", key: "contractId" },
1161
- { in: "body", key: "contract" },
1162
- { in: "body", key: "type" },
1163
- { in: "body", key: "royalty" },
1164
- { in: "body", key: "tokenManager" }
1165
- ]
1166
- }
1167
- ]);
1168
- return (options?.client ?? this.client).post({
1169
- url: "/collection",
1170
- ...options,
1171
- ...params,
1172
- headers: {
1173
- "Content-Type": "application/json",
1174
- ...options?.headers,
1175
- ...params.headers
1176
- }
1177
- });
1178
- }
1179
- trending(parameters, options) {
1180
- const params = buildClientParams([parameters], [
1181
- {
1182
- args: [
1183
- { in: "query", key: "window" },
1184
- { in: "query", key: "chainId" },
1185
- { in: "query", key: "limit" }
1186
- ]
1187
- }
1188
- ]);
1189
- return (options?.client ?? this.client).get({
1190
- url: "/collection/trending",
1191
- ...options,
1192
- ...params
1193
- });
1194
- }
1195
- featured(parameters, options) {
1196
- const params = buildClientParams([parameters], [
1197
- {
1198
- args: [
1199
- { in: "query", key: "limit" },
1200
- { in: "query", key: "cursor" }
1201
- ]
1202
- }
1203
- ]);
1204
- return (options?.client ?? this.client).get({
1205
- url: "/collection/featured",
1206
- ...options,
1207
- ...params
1208
- });
1209
- }
1210
- get(parameters, options) {
1211
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
1212
- return (options?.client ?? this.client).get({
1213
- url: "/collection/{highlightId}",
1214
- ...options,
1215
- ...params
1216
- });
1217
- }
1218
- listPreviews(parameters, options) {
1219
- const params = buildClientParams([parameters], [
1220
- {
1221
- args: [
1222
- { in: "path", key: "highlightId" },
1223
- { in: "query", key: "limit" }
1224
- ]
1225
- }
1226
- ]);
1227
- return (options?.client ?? this.client).get({
1228
- url: "/collection/{highlightId}/previews",
1229
- ...options,
1230
- ...params
1231
- });
1232
- }
1233
- archiveBaseUri(parameters, options) {
1234
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
1235
- return (options?.client ?? this.client).post({
1236
- url: "/collection/{highlightId}/archive-base-uri",
1237
- ...options,
1238
- ...params
1239
- });
1240
- }
1241
- createMediaUploadSession(parameters, options) {
1242
- const params = buildClientParams([parameters], [
1243
- {
1244
- args: [
1245
- { in: "path", key: "highlightId" },
1246
- { in: "body", key: "purpose" },
1247
- { in: "body", key: "fileName" },
1248
- { in: "body", key: "mimeType" },
1249
- { in: "body", key: "fileSize" },
1250
- { in: "body", key: "contentHash" }
1251
- ]
1252
- }
1253
- ]);
1254
- return (options?.client ?? this.client).post({
1255
- url: "/collection/{highlightId}/media/upload-session",
1256
- ...options,
1257
- ...params,
1258
- headers: {
1259
- "Content-Type": "application/json",
1260
- ...options?.headers,
1261
- ...params.headers
1262
- }
1263
- });
1264
- }
1265
- updateMetadata(parameters, options) {
1266
- const params = buildClientParams([parameters], [
1267
- {
1268
- args: [
1269
- { in: "path", key: "highlightId" },
1270
- { key: "collectionUpdateMetadataInput", map: "body" }
1271
- ]
1272
- }
1273
- ]);
1274
- return (options?.client ?? this.client).patch({
1275
- url: "/collection/{highlightId}/metadata",
1276
- ...options,
1277
- ...params,
1278
- headers: {
1279
- "Content-Type": "application/json",
1280
- ...options?.headers,
1281
- ...params.headers
1282
- }
1283
- });
1284
- }
1285
- updateGenerativeDetails(parameters, options) {
1286
- const params = buildClientParams([parameters], [
1287
- {
1288
- args: [
1289
- { in: "path", key: "highlightId" },
1290
- { in: "body", key: "generative" }
1291
- ]
1292
- }
1293
- ]);
1294
- return (options?.client ?? this.client).patch({
1295
- url: "/collection/{highlightId}/details/generative",
1296
- ...options,
1297
- ...params,
1298
- headers: {
1299
- "Content-Type": "application/json",
1300
- ...options?.headers,
1301
- ...params.headers
1302
- }
1303
- });
1304
- }
1305
- updateSeriesDetails(parameters, options) {
1306
- const params = buildClientParams([parameters], [
1307
- {
1308
- args: [
1309
- { in: "path", key: "highlightId" },
1310
- { in: "body", key: "series" }
1311
- ]
1312
- }
1313
- ]);
1314
- return (options?.client ?? this.client).patch({
1315
- url: "/collection/{highlightId}/details/series",
1316
- ...options,
1317
- ...params,
1318
- headers: {
1319
- "Content-Type": "application/json",
1320
- ...options?.headers,
1321
- ...params.headers
1322
- }
1323
- });
1324
- }
1325
- updateEditionDetails(parameters, options) {
1326
- const params = buildClientParams([parameters], [
1327
- {
1328
- args: [
1329
- { in: "path", key: "highlightId" },
1330
- { in: "body", key: "edition" }
1331
- ]
1332
- }
1333
- ]);
1334
- return (options?.client ?? this.client).patch({
1335
- url: "/collection/{highlightId}/details/edition",
1336
- ...options,
1337
- ...params,
1338
- headers: {
1339
- "Content-Type": "application/json",
1340
- ...options?.headers,
1341
- ...params.headers
1342
- }
1343
- });
1344
- }
1345
- getSales(parameters, options) {
1346
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
1347
- return (options?.client ?? this.client).get({
1348
- url: "/collection/{highlightId}/sales",
1349
- ...options,
1350
- ...params
1351
- });
1352
- }
1353
- addSale(parameters, options) {
1354
- const params = buildClientParams([parameters], [
1355
- {
1356
- args: [
1357
- { in: "path", key: "highlightId" },
1358
- { in: "body", key: "name" },
1359
- { in: "body", key: "type" },
1360
- { in: "body", key: "startAt" },
1361
- { in: "body", key: "endAt" },
1362
- { in: "body", key: "price" },
1363
- { in: "body", key: "currency" },
1364
- { in: "body", key: "maxPerTransaction" },
1365
- { in: "body", key: "maxPerWallet" },
1366
- { in: "body", key: "maxTotal" },
1367
- { in: "body", key: "paymentRecipient" },
1368
- { in: "body", key: "accessMode" },
1369
- { in: "body", key: "gateId" },
1370
- { in: "body", key: "mechanicId" },
1371
- { in: "body", key: "typeConfig" },
1372
- { in: "body", key: "collectorMessage" },
1373
- { in: "body", key: "customMintFee" }
1374
- ]
1375
- }
1376
- ]);
1377
- return (options?.client ?? this.client).post({
1378
- url: "/collection/{highlightId}/sales",
1379
- ...options,
1380
- ...params,
1381
- headers: {
1382
- "Content-Type": "application/json",
1383
- ...options?.headers,
1384
- ...params.headers
1385
- }
1386
- });
1387
- }
1388
- deleteSale(parameters, options) {
1389
- const params = buildClientParams([parameters], [
1390
- {
1391
- args: [
1392
- { in: "path", key: "highlightId" },
1393
- { in: "path", key: "saleId" }
1394
- ]
1395
- }
1396
- ]);
1397
- return (options?.client ?? this.client).delete({
1398
- url: "/collection/{highlightId}/sales/{saleId}",
1399
- ...options,
1400
- ...params
1401
- });
1402
- }
1403
- updateSale(parameters, options) {
1404
- const params = buildClientParams([parameters], [
1405
- {
1406
- args: [
1407
- { in: "path", key: "highlightId" },
1408
- { in: "path", key: "saleId" },
1409
- { in: "body", key: "name" },
1410
- { in: "body", key: "startAt" },
1411
- { in: "body", key: "endAt" },
1412
- { in: "body", key: "price" },
1413
- { in: "body", key: "currency" },
1414
- { in: "body", key: "maxPerTransaction" },
1415
- { in: "body", key: "maxPerWallet" },
1416
- { in: "body", key: "maxTotal" },
1417
- { in: "body", key: "paymentRecipient" },
1418
- { in: "body", key: "paused" },
1419
- { in: "body", key: "collectorMessage" },
1420
- { in: "body", key: "customMintFee" }
1421
- ]
1422
- }
1423
- ]);
1424
- return (options?.client ?? this.client).patch({
1425
- url: "/collection/{highlightId}/sales/{saleId}",
1426
- ...options,
1427
- ...params,
1428
- headers: {
1429
- "Content-Type": "application/json",
1430
- ...options?.headers,
1431
- ...params.headers
1432
- }
1433
- });
1434
- }
1435
- claimSale(parameters, options) {
1436
- const params = buildClientParams([parameters], [
1437
- {
1438
- args: [
1439
- { in: "path", key: "highlightId" },
1440
- { in: "body", key: "saleId" },
1441
- { in: "body", key: "amount" },
1442
- { in: "body", key: "tokenIds" }
1443
- ]
1444
- }
1445
- ]);
1446
- return (options?.client ?? this.client).post({
1447
- url: "/collection/{highlightId}/sales/claim",
1448
- ...options,
1449
- ...params,
1450
- headers: {
1451
- "Content-Type": "application/json",
1452
- ...options?.headers,
1453
- ...params.headers
1454
- }
1455
- });
1456
- }
1457
- bidSale(parameters, options) {
1458
- const params = buildClientParams([parameters], [
1459
- {
1460
- args: [
1461
- { in: "path", key: "highlightId" },
1462
- { in: "body", key: "saleId" },
1463
- { in: "body", key: "bidAmount" },
1464
- { in: "body", key: "bidId" },
1465
- { in: "body", key: "preferredNftRecipient" }
1466
- ]
1467
- }
1468
- ]);
1469
- return (options?.client ?? this.client).post({
1470
- url: "/collection/{highlightId}/sales/bid",
1471
- ...options,
1472
- ...params,
1473
- headers: {
1474
- "Content-Type": "application/json",
1475
- ...options?.headers,
1476
- ...params.headers
1477
- }
1478
- });
1479
- }
1480
- reclaimBid(parameters, options) {
1481
- const params = buildClientParams([parameters], [
1482
- {
1483
- args: [
1484
- { in: "path", key: "highlightId" },
1485
- { in: "body", key: "saleId" },
1486
- { in: "body", key: "bidId" }
1487
- ]
1488
- }
1489
- ]);
1490
- return (options?.client ?? this.client).post({
1491
- url: "/collection/{highlightId}/sales/reclaim",
1492
- ...options,
1493
- ...params,
1494
- headers: {
1495
- "Content-Type": "application/json",
1496
- ...options?.headers,
1497
- ...params.headers
1498
- }
1499
- });
1500
- }
1501
- claimAuctionEarnings(parameters, options) {
1502
- const params = buildClientParams([parameters], [
1503
- {
1504
- args: [
1505
- { in: "path", key: "highlightId" },
1506
- { in: "body", key: "saleId" }
1507
- ]
1508
- }
1509
- ]);
1510
- return (options?.client ?? this.client).post({
1511
- url: "/collection/{highlightId}/sales/earnings",
1512
- ...options,
1513
- ...params,
1514
- headers: {
1515
- "Content-Type": "application/json",
1516
- ...options?.headers,
1517
- ...params.headers
1518
- }
1519
- });
1520
- }
1521
- rankedAuctionStandings(parameters, options) {
1522
- const params = buildClientParams([parameters], [
1523
- {
1524
- args: [
1525
- { in: "path", key: "highlightId" },
1526
- { in: "path", key: "saleId" }
1527
- ]
1528
- }
1529
- ]);
1530
- return (options?.client ?? this.client).get({
1531
- url: "/collection/{highlightId}/sales/{saleId}/standings",
1532
- ...options,
1533
- ...params
1534
- });
1535
- }
1536
- fulfillEnglishAuction(parameters, options) {
1537
- const params = buildClientParams([parameters], [
1538
- {
1539
- args: [
1540
- { in: "path", key: "highlightId" },
1541
- { in: "body", key: "saleId" }
1542
- ]
1543
- }
1544
- ]);
1545
- return (options?.client ?? this.client).post({
1546
- url: "/collection/{highlightId}/sales/auction/fulfill",
1547
- ...options,
1548
- ...params,
1549
- headers: {
1550
- "Content-Type": "application/json",
1551
- ...options?.headers,
1552
- ...params.headers
1553
- }
1554
- });
1555
- }
1556
- cancelEnglishAuction(parameters, options) {
1557
- const params = buildClientParams([parameters], [
1558
- {
1559
- args: [
1560
- { in: "path", key: "highlightId" },
1561
- { in: "body", key: "saleId" }
1562
- ]
1563
- }
1564
- ]);
1565
- return (options?.client ?? this.client).post({
1566
- url: "/collection/{highlightId}/sales/auction/cancel",
1567
- ...options,
1568
- ...params,
1569
- headers: {
1570
- "Content-Type": "application/json",
1571
- ...options?.headers,
1572
- ...params.headers
1573
- }
1574
- });
1575
- }
1576
- englishAuctionStanding(parameters, options) {
1577
- const params = buildClientParams([parameters], [
1578
- {
1579
- args: [
1580
- { in: "path", key: "highlightId" },
1581
- { in: "path", key: "saleId" }
1582
- ]
1583
- }
1584
- ]);
1585
- return (options?.client ?? this.client).get({
1586
- url: "/collection/{highlightId}/sales/{saleId}/auction",
1587
- ...options,
1588
- ...params
1589
- });
1590
- }
1591
- englishAuctionBids(parameters, options) {
1592
- const params = buildClientParams([parameters], [
1593
- {
1594
- args: [
1595
- { in: "path", key: "highlightId" },
1596
- { in: "path", key: "saleId" }
1597
- ]
1598
- }
1599
- ]);
1600
- return (options?.client ?? this.client).get({
1601
- url: "/collection/{highlightId}/sales/{saleId}/auction/bids",
1602
- ...options,
1603
- ...params
1604
- });
1605
- }
1606
- dutchAuctionStanding(parameters, options) {
1607
- const params = buildClientParams([parameters], [
1608
- {
1609
- args: [
1610
- { in: "path", key: "highlightId" },
1611
- { in: "path", key: "saleId" }
1612
- ]
1613
- }
1614
- ]);
1615
- return (options?.client ?? this.client).get({
1616
- url: "/collection/{highlightId}/sales/{saleId}/dutch",
1617
- ...options,
1618
- ...params
1619
- });
1620
- }
1621
- claimDutchRebate(parameters, options) {
1622
- const params = buildClientParams([parameters], [
1623
- {
1624
- args: [
1625
- { in: "path", key: "highlightId" },
1626
- { in: "body", key: "saleId" }
1627
- ]
1628
- }
1629
- ]);
1630
- return (options?.client ?? this.client).post({
1631
- url: "/collection/{highlightId}/sales/dutch/rebate",
1632
- ...options,
1633
- ...params,
1634
- headers: {
1635
- "Content-Type": "application/json",
1636
- ...options?.headers,
1637
- ...params.headers
1638
- }
1639
- });
1640
- }
1641
- deploy(parameters, options) {
1642
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
1643
- return (options?.client ?? this.client).post({
1644
- url: "/collection/{highlightId}/deploy",
1645
- ...options,
1646
- ...params
1647
- });
1648
- }
1649
- deployStatus(parameters, options) {
1650
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
1651
- return (options?.client ?? this.client).get({
1652
- url: "/collection/{highlightId}/deploy/status",
1653
- ...options,
1654
- ...params
1655
- });
1656
- }
1657
- deployCancel(parameters, options) {
1658
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
1659
- return (options?.client ?? this.client).post({
1660
- url: "/collection/{highlightId}/deploy/cancel",
1661
- ...options,
1662
- ...params
1663
- });
1664
- }
1665
- }
1666
-
1667
- class Token extends HeyApiClient {
1668
- list(parameters, options) {
1669
- const params = buildClientParams([parameters], [
1670
- {
1671
- args: [
1672
- { in: "path", key: "highlightId" },
1673
- { in: "query", key: "page" },
1674
- { in: "query", key: "limit" },
1675
- { in: "query", key: "sort" },
1676
- { in: "query", key: "order" },
1677
- { in: "query", key: "ownerAddress" },
1678
- { in: "query", key: "search" },
1679
- { in: "query", key: "attributes" }
1680
- ]
1681
- }
1682
- ]);
1683
- return (options?.client ?? this.client).get({
1684
- url: "/collection/{highlightId}/tokens",
1685
- ...options,
1686
- ...params
1687
- });
1688
- }
1689
- attributeFacets(parameters, options) {
1690
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
1691
- return (options?.client ?? this.client).get({
1692
- url: "/collection/{highlightId}/tokens/attributes",
1693
- ...options,
1694
- ...params
1695
- });
1696
- }
1697
- get(parameters, options) {
1698
- const params = buildClientParams([parameters], [
1699
- {
1700
- args: [
1701
- { in: "path", key: "highlightId" },
1702
- { in: "path", key: "tokenId" }
1703
- ]
1704
- }
1705
- ]);
1706
- return (options?.client ?? this.client).get({
1707
- url: "/collection/{highlightId}/tokens/{tokenId}",
1708
- ...options,
1709
- ...params
1710
- });
1711
- }
1712
- listOwners(parameters, options) {
1713
- const params = buildClientParams([parameters], [
1714
- {
1715
- args: [
1716
- { in: "path", key: "highlightId" },
1717
- { in: "path", key: "tokenId" }
1718
- ]
1719
- }
1720
- ]);
1721
- return (options?.client ?? this.client).get({
1722
- url: "/collection/{highlightId}/tokens/{tokenId}/owners",
1723
- ...options,
1724
- ...params
1725
- });
1726
- }
1727
- redriveReveals(parameters, options) {
1728
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
1729
- return (options?.client ?? this.client).post({
1730
- url: "/collection/{highlightId}/tokens/redrive-reveals",
1731
- ...options,
1732
- ...params
1733
- });
1734
- }
1735
- }
1736
-
1737
- class Config extends HeyApiClient {
1738
- chains(options) {
1739
- return (options?.client ?? this.client).get({
1740
- url: "/config/chains",
1741
- ...options
1742
- });
1743
- }
1744
- mediaHosts(options) {
1745
- return (options?.client ?? this.client).get({
1746
- url: "/config/media-hosts",
1747
- ...options
1748
- });
1749
- }
1750
- systemContract(parameters, options) {
1751
- const params = buildClientParams([parameters], [
1752
- {
1753
- args: [
1754
- { in: "query", key: "chainId" },
1755
- { in: "query", key: "type" }
1756
- ]
1757
- }
1758
- ]);
1759
- return (options?.client ?? this.client).get({
1760
- url: "/config/system-contract",
1761
- ...options,
1762
- ...params
1763
- });
1764
- }
1765
- }
1766
-
1767
- class Contract extends HeyApiClient {
1768
- list(parameters, options) {
1769
- const params = buildClientParams([parameters], [
1770
- {
1771
- args: [
1772
- { in: "query", key: "limit" },
1773
- { in: "query", key: "cursor" }
1774
- ]
1775
- }
1776
- ]);
1777
- return (options?.client ?? this.client).get({
1778
- url: "/contract",
1779
- ...options,
1780
- ...params
1781
- });
1782
- }
1783
- get(parameters, options) {
1784
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "contractId" }] }]);
1785
- return (options?.client ?? this.client).get({
1786
- url: "/contract/{contractId}",
1787
- ...options,
1788
- ...params
1789
- });
1790
- }
1791
- }
1792
-
1793
- class Gate extends HeyApiClient {
1794
- list(options) {
1795
- return (options?.client ?? this.client).get({
1796
- url: "/gate",
1797
- ...options
1798
- });
1799
- }
1800
- create(parameters, options) {
1801
- const params = buildClientParams([parameters], [
1802
- {
1803
- args: [
1804
- { in: "body", key: "name" },
1805
- { in: "body", key: "matchMode" },
1806
- { in: "body", key: "conditions" }
1807
- ]
1808
- }
1809
- ]);
1810
- return (options?.client ?? this.client).post({
1811
- url: "/gate",
1812
- ...options,
1813
- ...params,
1814
- headers: {
1815
- "Content-Type": "application/json",
1816
- ...options?.headers,
1817
- ...params.headers
1818
- }
1819
- });
1820
- }
1821
- remove(parameters, options) {
1822
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "gateId" }] }]);
1823
- return (options?.client ?? this.client).delete({
1824
- url: "/gate/{gateId}",
1825
- ...options,
1826
- ...params
1827
- });
1828
- }
1829
- get(parameters, options) {
1830
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "gateId" }] }]);
1831
- return (options?.client ?? this.client).get({
1832
- url: "/gate/{gateId}",
1833
- ...options,
1834
- ...params
1835
- });
1836
- }
1837
- update(parameters, options) {
1838
- const params = buildClientParams([parameters], [
1839
- {
1840
- args: [
1841
- { in: "path", key: "gateId" },
1842
- { in: "body", key: "name" },
1843
- { in: "body", key: "matchMode" },
1844
- { in: "body", key: "conditions" }
1845
- ]
1846
- }
1847
- ]);
1848
- return (options?.client ?? this.client).patch({
1849
- url: "/gate/{gateId}",
1850
- ...options,
1851
- ...params,
1852
- headers: {
1853
- "Content-Type": "application/json",
1854
- ...options?.headers,
1855
- ...params.headers
1856
- }
1857
- });
1858
- }
1859
- previewCollection(parameters, options) {
1860
- const params = buildClientParams([parameters], [
1861
- {
1862
- args: [
1863
- { in: "path", key: "chainId" },
1864
- { in: "path", key: "address" }
1865
- ]
1866
- }
1867
- ]);
1868
- return (options?.client ?? this.client).get({
1869
- url: "/gate/preview/collection/{chainId}/{address}",
1870
- ...options,
1871
- ...params
1872
- });
1873
- }
1874
- previewAttributes(parameters, options) {
1875
- const params = buildClientParams([parameters], [
1876
- {
1877
- args: [
1878
- { in: "path", key: "chainId" },
1879
- { in: "path", key: "address" }
1880
- ]
1881
- }
1882
- ]);
1883
- return (options?.client ?? this.client).get({
1884
- url: "/gate/preview/collection/{chainId}/{address}/attributes",
1885
- ...options,
1886
- ...params
1887
- });
1888
- }
1889
- previewTokens(parameters, options) {
1890
- const params = buildClientParams([parameters], [
1891
- {
1892
- args: [
1893
- { in: "path", key: "chainId" },
1894
- { in: "path", key: "address" },
1895
- { in: "query", key: "cursor" },
1896
- { in: "query", key: "limit" }
1897
- ]
1898
- }
1899
- ]);
1900
- return (options?.client ?? this.client).get({
1901
- url: "/gate/preview/collection/{chainId}/{address}/tokens",
1902
- ...options,
1903
- ...params
1904
- });
1905
- }
1906
- previewToken(parameters, options) {
1907
- const params = buildClientParams([parameters], [
1908
- {
1909
- args: [
1910
- { in: "path", key: "chainId" },
1911
- { in: "path", key: "address" },
1912
- { in: "path", key: "tokenId" }
1913
- ]
1914
- }
1915
- ]);
1916
- return (options?.client ?? this.client).get({
1917
- url: "/gate/preview/collection/{chainId}/{address}/token/{tokenId}",
1918
- ...options,
1919
- ...params
1920
- });
1921
- }
1922
- previewCurrency(parameters, options) {
1923
- const params = buildClientParams([parameters], [
1924
- {
1925
- args: [
1926
- { in: "path", key: "chainId" },
1927
- { in: "query", key: "contractAddress" }
1928
- ]
1929
- }
1930
- ]);
1931
- return (options?.client ?? this.client).get({
1932
- url: "/gate/preview/currency/{chainId}",
1933
- ...options,
1934
- ...params
1935
- });
1936
- }
1937
- previewFarcaster(parameters, options) {
1938
- const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "query" }] }]);
1939
- return (options?.client ?? this.client).get({
1940
- url: "/gate/preview/farcaster/user",
1941
- ...options,
1942
- ...params
1943
- });
1944
- }
1945
- }
1946
-
1947
- class Mechanic extends HeyApiClient {
1948
- list(parameters, options) {
1949
- const params = buildClientParams([parameters], [
1950
- {
1951
- args: [
1952
- { in: "query", key: "builtIn" },
1953
- { in: "query", key: "type" }
1954
- ]
1955
- }
1956
- ]);
1957
- return (options?.client ?? this.client).get({
1958
- url: "/mechanic",
1959
- ...options,
1960
- ...params
1961
- });
1962
- }
1963
- create(parameters, options) {
1964
- const params = buildClientParams([parameters], [
1965
- {
1966
- args: [
1967
- { in: "body", key: "slug" },
1968
- { in: "body", key: "name" },
1969
- { in: "body", key: "description" },
1970
- { in: "body", key: "configSchema" },
1971
- { in: "body", key: "encodingAbi" }
1972
- ]
1973
- }
1974
- ]);
1975
- return (options?.client ?? this.client).post({
1976
- url: "/mechanic",
1977
- ...options,
1978
- ...params,
1979
- headers: {
1980
- "Content-Type": "application/json",
1981
- ...options?.headers,
1982
- ...params.headers
1983
- }
1984
- });
1985
- }
1986
- get(parameters, options) {
1987
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mechanicId" }] }]);
1988
- return (options?.client ?? this.client).get({
1989
- url: "/mechanic/{mechanicId}",
1990
- ...options,
1991
- ...params
1992
- });
1993
- }
1994
- update(parameters, options) {
1995
- const params = buildClientParams([parameters], [
1996
- {
1997
- args: [
1998
- { in: "path", key: "mechanicId" },
1999
- { in: "body", key: "name" },
2000
- { in: "body", key: "description" },
2001
- { in: "body", key: "configSchema" },
2002
- { in: "body", key: "encodingAbi" }
2003
- ]
2004
- }
2005
- ]);
2006
- return (options?.client ?? this.client).patch({
2007
- url: "/mechanic/{mechanicId}",
2008
- ...options,
2009
- ...params,
2010
- headers: {
2011
- "Content-Type": "application/json",
2012
- ...options?.headers,
2013
- ...params.headers
2014
- }
2015
- });
2016
- }
2017
- removeDeployment(parameters, options) {
2018
- const params = buildClientParams([parameters], [
2019
- {
2020
- args: [
2021
- { in: "path", key: "mechanicId" },
2022
- { in: "body", key: "chainId" }
2023
- ]
2024
- }
2025
- ]);
2026
- return (options?.client ?? this.client).delete({
2027
- url: "/mechanic/{mechanicId}/deployment",
2028
- ...options,
2029
- ...params,
2030
- headers: {
2031
- "Content-Type": "application/json",
2032
- ...options?.headers,
2033
- ...params.headers
2034
- }
2035
- });
2036
- }
2037
- addDeployment(parameters, options) {
2038
- const params = buildClientParams([parameters], [
2039
- {
2040
- args: [
2041
- { in: "path", key: "mechanicId" },
2042
- { in: "body", key: "chainId" },
2043
- { in: "body", key: "address" }
2044
- ]
2045
- }
2046
- ]);
2047
- return (options?.client ?? this.client).post({
2048
- url: "/mechanic/{mechanicId}/deployment",
2049
- ...options,
2050
- ...params,
2051
- headers: {
2052
- "Content-Type": "application/json",
2053
- ...options?.headers,
2054
- ...params.headers
2055
- }
2056
- });
2057
- }
2058
- }
2059
-
2060
- class Media extends HeyApiClient {
2061
- finalizeUpload(parameters, options) {
2062
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mediaId" }] }]);
2063
- return (options?.client ?? this.client).post({
2064
- url: "/media/{mediaId}/finalize",
2065
- ...options,
2066
- ...params
2067
- });
2068
- }
2069
- listChildren(parameters, options) {
2070
- const params = buildClientParams([parameters], [
2071
- {
2072
- args: [
2073
- { in: "path", key: "mediaId" },
2074
- { in: "query", key: "cursor" },
2075
- { in: "query", key: "limit" }
2076
- ]
2077
- }
2078
- ]);
2079
- return (options?.client ?? this.client).get({
2080
- url: "/media/{mediaId}/children",
2081
- ...options,
2082
- ...params
2083
- });
2084
- }
2085
- delete(parameters, options) {
2086
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mediaId" }] }]);
2087
- return (options?.client ?? this.client).delete({
2088
- url: "/media/{mediaId}",
2089
- ...options,
2090
- ...params
2091
- });
2092
- }
2093
- get(parameters, options) {
2094
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mediaId" }] }]);
2095
- return (options?.client ?? this.client).get({
2096
- url: "/media/{mediaId}",
2097
- ...options,
2098
- ...params
2099
- });
2100
- }
2101
- publish(parameters, options) {
2102
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mediaId" }] }]);
2103
- return (options?.client ?? this.client).post({
2104
- url: "/media/{mediaId}/publish",
2105
- ...options,
2106
- ...params
2107
- });
2108
- }
2109
- getChild(parameters, options) {
2110
- const params = buildClientParams([parameters], [
2111
- {
2112
- args: [
2113
- { in: "path", key: "mediaId" },
2114
- { in: "path", key: "path" }
2115
- ]
2116
- }
2117
- ]);
2118
- return (options?.client ?? this.client).get({
2119
- url: "/media/{mediaId}/children/{path}",
2120
- ...options,
2121
- ...params
2122
- });
2123
- }
2124
- }
2125
-
2126
- class Tx extends HeyApiClient {
2127
- status(parameters, options) {
2128
- const params = buildClientParams([parameters], [
2129
- {
2130
- args: [
2131
- { in: "path", key: "chainId" },
2132
- { in: "path", key: "txHash" }
2133
- ]
2134
- }
2135
- ]);
2136
- return (options?.client ?? this.client).get({
2137
- url: "/tx/{chainId}/{txHash}",
2138
- ...options,
2139
- ...params
2140
- });
2141
- }
2142
- submit(parameters, options) {
2143
- const params = buildClientParams([parameters], [
2144
- {
2145
- args: [
2146
- { in: "path", key: "chainId" },
2147
- { in: "path", key: "txHash" }
2148
- ]
2149
- }
2150
- ]);
2151
- return (options?.client ?? this.client).post({
2152
- url: "/tx/{chainId}/{txHash}",
2153
- ...options,
2154
- ...params
2155
- });
2156
- }
2157
- }
2158
-
2159
- class Siwe extends HeyApiClient {
2160
- nonce(options) {
2161
- return (options?.client ?? this.client).post({ url: "/user/signin/siwe/nonce", ...options });
2162
- }
2163
- }
2164
-
2165
- class User extends HeyApiClient {
2166
- createMediaUploadSession(parameters, options) {
2167
- const params = buildClientParams([parameters], [
2168
- {
2169
- args: [
2170
- { in: "body", key: "purpose" },
2171
- { in: "body", key: "fileName" },
2172
- { in: "body", key: "mimeType" },
2173
- { in: "body", key: "fileSize" },
2174
- { in: "body", key: "contentHash" }
2175
- ]
2176
- }
2177
- ]);
2178
- return (options?.client ?? this.client).post({
2179
- url: "/user/media/upload-session",
2180
- ...options,
2181
- ...params,
2182
- headers: {
2183
- "Content-Type": "application/json",
2184
- ...options?.headers,
2185
- ...params.headers
2186
- }
2187
- });
2188
- }
2189
- signin(parameters, options) {
2190
- const params = buildClientParams([parameters], [{ args: [{ key: "body", map: "body" }] }]);
2191
- return (options?.client ?? this.client).post({
2192
- url: "/user/signin",
2193
- ...options,
2194
- ...params,
2195
- headers: {
2196
- "Content-Type": "application/json",
2197
- ...options?.headers,
2198
- ...params.headers
2199
- }
2200
- });
2201
- }
2202
- _siwe;
2203
- get siwe() {
2204
- return this._siwe ??= new Siwe({ client: this.client });
2205
- }
2206
- }
2207
-
2208
- class Profile extends HeyApiClient {
2209
- get(options) {
2210
- return (options?.client ?? this.client).get({ url: "/user/profile", ...options });
2211
- }
2212
- update(parameters, options) {
2213
- const params = buildClientParams([parameters], [
2214
- {
2215
- args: [
2216
- { in: "body", key: "displayName" },
2217
- { in: "body", key: "bio" },
2218
- { in: "body", key: "website" },
2219
- { in: "body", key: "avatarMediaId" }
2220
- ]
2221
- }
2222
- ]);
2223
- return (options?.client ?? this.client).patch({
2224
- url: "/user/profile",
2225
- ...options,
2226
- ...params,
2227
- headers: {
2228
- "Content-Type": "application/json",
2229
- ...options?.headers,
2230
- ...params.headers
2231
- }
2232
- });
2233
- }
2234
- public(parameters, options) {
2235
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "walletAddress" }] }]);
2236
- return (options?.client ?? this.client).get({
2237
- url: "/user/{walletAddress}/profile",
2238
- ...options,
2239
- ...params
2240
- });
2241
- }
2242
- tokens(parameters, options) {
2243
- const params = buildClientParams([parameters], [
2244
- {
2245
- args: [
2246
- { in: "path", key: "walletAddress" },
2247
- { in: "query", key: "page" },
2248
- { in: "query", key: "limit" },
2249
- { in: "query", key: "sort" },
2250
- { in: "query", key: "order" },
2251
- { in: "query", key: "collectionId" },
2252
- { in: "query", key: "search" }
2253
- ]
2254
- }
2255
- ]);
2256
- return (options?.client ?? this.client).get({
2257
- url: "/user/{walletAddress}/tokens",
2258
- ...options,
2259
- ...params
2260
- });
2261
- }
2262
- }
2263
-
2264
- class ApiKey extends HeyApiClient {
2265
- list(options) {
2266
- return (options?.client ?? this.client).get({ url: "/user/api-keys", ...options });
2267
- }
2268
- create(parameters, options) {
2269
- const params = buildClientParams([parameters], [
2270
- {
2271
- args: [
2272
- { in: "body", key: "name" },
2273
- { in: "body", key: "expiresAt" }
2274
- ]
2275
- }
2276
- ]);
2277
- return (options?.client ?? this.client).post({
2278
- url: "/user/api-keys",
2279
- ...options,
2280
- ...params,
2281
- headers: {
2282
- "Content-Type": "application/json",
2283
- ...options?.headers,
2284
- ...params.headers
2285
- }
2286
- });
2287
- }
2288
- revoke(parameters, options) {
2289
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "apiKeyId" }] }]);
2290
- return (options?.client ?? this.client).delete({
2291
- url: "/user/api-keys/{apiKeyId}",
2292
- ...options,
2293
- ...params
2294
- });
2295
- }
2296
- }
2297
-
2298
- class Health extends HeyApiClient {
2299
- get(options) {
2300
- return (options?.client ?? this.client).get({
2301
- url: "/health",
2302
- ...options
2303
- });
2304
- }
2305
- }
2306
-
2307
- class HighlightClient extends HeyApiClient {
2308
- static __registry = new HeyApiRegistry;
2309
- constructor(args) {
2310
- super(args);
2311
- HighlightClient.__registry.set(this, args?.key);
2312
- }
2313
- postIndexerChainsByChainIdActivate(parameters, options) {
2314
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "chainId" }] }]);
2315
- return (options?.client ?? this.client).post({
2316
- url: "/indexer/chains/{chainId}/activate",
2317
- ...options,
2318
- ...params
2319
- });
2320
- }
2321
- postIndexerChainsByChainIdReset(parameters, options) {
2322
- const params = buildClientParams([parameters], [
2323
- {
2324
- args: [
2325
- { in: "path", key: "chainId" },
2326
- { in: "body", key: "blockNumber" }
2327
- ]
2328
- }
2329
- ]);
2330
- return (options?.client ?? this.client).post({
2331
- url: "/indexer/chains/{chainId}/reset",
2332
- ...options,
2333
- ...params,
2334
- headers: {
2335
- "Content-Type": "application/json",
2336
- ...options?.headers,
2337
- ...params.headers
2338
- }
2339
- });
2340
- }
2341
- postIndexerChainsByChainIdPoll(parameters, options) {
2342
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "chainId" }] }]);
2343
- return (options?.client ?? this.client).post({
2344
- url: "/indexer/chains/{chainId}/poll",
2345
- ...options,
2346
- ...params
2347
- });
2348
- }
2349
- _collection;
2350
- get collection() {
2351
- return this._collection ??= new Collection({ client: this.client });
2352
- }
2353
- _token;
2354
- get token() {
2355
- return this._token ??= new Token({ client: this.client });
2356
- }
2357
- _config;
2358
- get config() {
2359
- return this._config ??= new Config({ client: this.client });
2360
- }
2361
- _contract;
2362
- get contract() {
2363
- return this._contract ??= new Contract({ client: this.client });
2364
- }
2365
- _gate;
2366
- get gate() {
2367
- return this._gate ??= new Gate({ client: this.client });
2368
- }
2369
- _mechanic;
2370
- get mechanic() {
2371
- return this._mechanic ??= new Mechanic({ client: this.client });
2372
- }
2373
- _media;
2374
- get media() {
2375
- return this._media ??= new Media({ client: this.client });
2376
- }
2377
- _tx;
2378
- get tx() {
2379
- return this._tx ??= new Tx({ client: this.client });
2380
- }
2381
- _user;
2382
- get user() {
2383
- return this._user ??= new User({ client: this.client });
2384
- }
2385
- _profile;
2386
- get profile() {
2387
- return this._profile ??= new Profile({ client: this.client });
2388
- }
2389
- _apiKey;
2390
- get apiKey() {
2391
- return this._apiKey ??= new ApiKey({ client: this.client });
2392
- }
2393
- _health;
2394
- get health() {
2395
- return this._health ??= new Health({ client: this.client });
2396
- }
2397
- }
2398
-
2399
- // ../sdk/src/client.ts
2400
- function createHighlightClient(config) {
2401
- const resolvedConfig = {
2402
- ...config,
2403
- auth: config?.auth ?? config?.apiKey,
2404
- security: config?.security ?? (config?.auth || config?.apiKey ? [{ type: "http", scheme: "bearer" }] : undefined)
2405
- };
2406
- const client2 = createClient(resolvedConfig);
2407
- return new HighlightClient({ client: client2 });
2408
- }
2409
- // ../../node_modules/@noble/hashes/esm/utils.js
2410
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2411
- function isBytes(a) {
2412
- return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
2413
- }
2414
- function abytes(b, ...lengths) {
2415
- if (!isBytes(b))
2416
- throw new Error("Uint8Array expected");
2417
- if (lengths.length > 0 && !lengths.includes(b.length))
2418
- throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
2419
- }
2420
- function aexists(instance, checkFinished = true) {
2421
- if (instance.destroyed)
2422
- throw new Error("Hash instance has been destroyed");
2423
- if (checkFinished && instance.finished)
2424
- throw new Error("Hash#digest() has already been called");
2425
- }
2426
- function aoutput(out, instance) {
2427
- abytes(out);
2428
- const min = instance.outputLen;
2429
- if (out.length < min) {
2430
- throw new Error("digestInto() expects output buffer of length at least " + min);
2431
- }
2432
- }
2433
- function clean(...arrays) {
2434
- for (let i = 0;i < arrays.length; i++) {
2435
- arrays[i].fill(0);
2436
- }
2437
- }
2438
- function createView(arr) {
2439
- return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
2440
- }
2441
- function rotr(word, shift) {
2442
- return word << 32 - shift | word >>> shift;
2443
- }
2444
- var hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function")();
2445
- var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
2446
- function bytesToHex(bytes) {
2447
- abytes(bytes);
2448
- if (hasHexBuiltin)
2449
- return bytes.toHex();
2450
- let hex = "";
2451
- for (let i = 0;i < bytes.length; i++) {
2452
- hex += hexes[bytes[i]];
2453
- }
2454
- return hex;
2455
- }
2456
- function utf8ToBytes(str) {
2457
- if (typeof str !== "string")
2458
- throw new Error("string expected");
2459
- return new Uint8Array(new TextEncoder().encode(str));
2460
- }
2461
- function toBytes(data) {
2462
- if (typeof data === "string")
2463
- data = utf8ToBytes(data);
2464
- abytes(data);
2465
- return data;
2466
- }
2467
- class Hash {
2468
- }
2469
- function createHasher(hashCons) {
2470
- const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
2471
- const tmp = hashCons();
2472
- hashC.outputLen = tmp.outputLen;
2473
- hashC.blockLen = tmp.blockLen;
2474
- hashC.create = () => hashCons();
2475
- return hashC;
2476
- }
2477
-
2478
- // ../../node_modules/@noble/hashes/esm/_md.js
2479
- function setBigUint64(view, byteOffset, value, isLE) {
2480
- if (typeof view.setBigUint64 === "function")
2481
- return view.setBigUint64(byteOffset, value, isLE);
2482
- const _32n = BigInt(32);
2483
- const _u32_max = BigInt(4294967295);
2484
- const wh = Number(value >> _32n & _u32_max);
2485
- const wl = Number(value & _u32_max);
2486
- const h = isLE ? 4 : 0;
2487
- const l = isLE ? 0 : 4;
2488
- view.setUint32(byteOffset + h, wh, isLE);
2489
- view.setUint32(byteOffset + l, wl, isLE);
2490
- }
2491
- function Chi(a, b, c) {
2492
- return a & b ^ ~a & c;
2493
- }
2494
- function Maj(a, b, c) {
2495
- return a & b ^ a & c ^ b & c;
2496
- }
2497
-
2498
- class HashMD extends Hash {
2499
- constructor(blockLen, outputLen, padOffset, isLE) {
2500
- super();
2501
- this.finished = false;
2502
- this.length = 0;
2503
- this.pos = 0;
2504
- this.destroyed = false;
2505
- this.blockLen = blockLen;
2506
- this.outputLen = outputLen;
2507
- this.padOffset = padOffset;
2508
- this.isLE = isLE;
2509
- this.buffer = new Uint8Array(blockLen);
2510
- this.view = createView(this.buffer);
2511
- }
2512
- update(data) {
2513
- aexists(this);
2514
- data = toBytes(data);
2515
- abytes(data);
2516
- const { view, buffer, blockLen } = this;
2517
- const len = data.length;
2518
- for (let pos = 0;pos < len; ) {
2519
- const take = Math.min(blockLen - this.pos, len - pos);
2520
- if (take === blockLen) {
2521
- const dataView = createView(data);
2522
- for (;blockLen <= len - pos; pos += blockLen)
2523
- this.process(dataView, pos);
2524
- continue;
2525
- }
2526
- buffer.set(data.subarray(pos, pos + take), this.pos);
2527
- this.pos += take;
2528
- pos += take;
2529
- if (this.pos === blockLen) {
2530
- this.process(view, 0);
2531
- this.pos = 0;
2532
- }
2533
- }
2534
- this.length += data.length;
2535
- this.roundClean();
2536
- return this;
2537
- }
2538
- digestInto(out) {
2539
- aexists(this);
2540
- aoutput(out, this);
2541
- this.finished = true;
2542
- const { buffer, view, blockLen, isLE } = this;
2543
- let { pos } = this;
2544
- buffer[pos++] = 128;
2545
- clean(this.buffer.subarray(pos));
2546
- if (this.padOffset > blockLen - pos) {
2547
- this.process(view, 0);
2548
- pos = 0;
2549
- }
2550
- for (let i = pos;i < blockLen; i++)
2551
- buffer[i] = 0;
2552
- setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);
2553
- this.process(view, 0);
2554
- const oview = createView(out);
2555
- const len = this.outputLen;
2556
- if (len % 4)
2557
- throw new Error("_sha2: outputLen should be aligned to 32bit");
2558
- const outLen = len / 4;
2559
- const state = this.get();
2560
- if (outLen > state.length)
2561
- throw new Error("_sha2: outputLen bigger than state");
2562
- for (let i = 0;i < outLen; i++)
2563
- oview.setUint32(4 * i, state[i], isLE);
2564
- }
2565
- digest() {
2566
- const { buffer, outputLen } = this;
2567
- this.digestInto(buffer);
2568
- const res = buffer.slice(0, outputLen);
2569
- this.destroy();
2570
- return res;
2571
- }
2572
- _cloneInto(to) {
2573
- to || (to = new this.constructor);
2574
- to.set(...this.get());
2575
- const { blockLen, buffer, length, finished, destroyed, pos } = this;
2576
- to.destroyed = destroyed;
2577
- to.finished = finished;
2578
- to.length = length;
2579
- to.pos = pos;
2580
- if (length % blockLen)
2581
- to.buffer.set(buffer);
2582
- return to;
2583
- }
2584
- clone() {
2585
- return this._cloneInto();
2586
- }
2587
- }
2588
- var SHA256_IV = /* @__PURE__ */ Uint32Array.from([
2589
- 1779033703,
2590
- 3144134277,
2591
- 1013904242,
2592
- 2773480762,
2593
- 1359893119,
2594
- 2600822924,
2595
- 528734635,
2596
- 1541459225
2597
- ]);
2598
-
2599
- // ../../node_modules/@noble/hashes/esm/sha2.js
2600
- var SHA256_K = /* @__PURE__ */ Uint32Array.from([
2601
- 1116352408,
2602
- 1899447441,
2603
- 3049323471,
2604
- 3921009573,
2605
- 961987163,
2606
- 1508970993,
2607
- 2453635748,
2608
- 2870763221,
2609
- 3624381080,
2610
- 310598401,
2611
- 607225278,
2612
- 1426881987,
2613
- 1925078388,
2614
- 2162078206,
2615
- 2614888103,
2616
- 3248222580,
2617
- 3835390401,
2618
- 4022224774,
2619
- 264347078,
2620
- 604807628,
2621
- 770255983,
2622
- 1249150122,
2623
- 1555081692,
2624
- 1996064986,
2625
- 2554220882,
2626
- 2821834349,
2627
- 2952996808,
2628
- 3210313671,
2629
- 3336571891,
2630
- 3584528711,
2631
- 113926993,
2632
- 338241895,
2633
- 666307205,
2634
- 773529912,
2635
- 1294757372,
2636
- 1396182291,
2637
- 1695183700,
2638
- 1986661051,
2639
- 2177026350,
2640
- 2456956037,
2641
- 2730485921,
2642
- 2820302411,
2643
- 3259730800,
2644
- 3345764771,
2645
- 3516065817,
2646
- 3600352804,
2647
- 4094571909,
2648
- 275423344,
2649
- 430227734,
2650
- 506948616,
2651
- 659060556,
2652
- 883997877,
2653
- 958139571,
2654
- 1322822218,
2655
- 1537002063,
2656
- 1747873779,
2657
- 1955562222,
2658
- 2024104815,
2659
- 2227730452,
2660
- 2361852424,
2661
- 2428436474,
2662
- 2756734187,
2663
- 3204031479,
2664
- 3329325298
2665
- ]);
2666
- var SHA256_W = /* @__PURE__ */ new Uint32Array(64);
2667
-
2668
- class SHA256 extends HashMD {
2669
- constructor(outputLen = 32) {
2670
- super(64, outputLen, 8, false);
2671
- this.A = SHA256_IV[0] | 0;
2672
- this.B = SHA256_IV[1] | 0;
2673
- this.C = SHA256_IV[2] | 0;
2674
- this.D = SHA256_IV[3] | 0;
2675
- this.E = SHA256_IV[4] | 0;
2676
- this.F = SHA256_IV[5] | 0;
2677
- this.G = SHA256_IV[6] | 0;
2678
- this.H = SHA256_IV[7] | 0;
2679
- }
2680
- get() {
2681
- const { A, B, C, D, E, F, G, H } = this;
2682
- return [A, B, C, D, E, F, G, H];
2683
- }
2684
- set(A, B, C, D, E, F, G, H) {
2685
- this.A = A | 0;
2686
- this.B = B | 0;
2687
- this.C = C | 0;
2688
- this.D = D | 0;
2689
- this.E = E | 0;
2690
- this.F = F | 0;
2691
- this.G = G | 0;
2692
- this.H = H | 0;
2693
- }
2694
- process(view, offset) {
2695
- for (let i = 0;i < 16; i++, offset += 4)
2696
- SHA256_W[i] = view.getUint32(offset, false);
2697
- for (let i = 16;i < 64; i++) {
2698
- const W15 = SHA256_W[i - 15];
2699
- const W2 = SHA256_W[i - 2];
2700
- const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
2701
- const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
2702
- SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
2703
- }
2704
- let { A, B, C, D, E, F, G, H } = this;
2705
- for (let i = 0;i < 64; i++) {
2706
- const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
2707
- const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
2708
- const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
2709
- const T2 = sigma0 + Maj(A, B, C) | 0;
2710
- H = G;
2711
- G = F;
2712
- F = E;
2713
- E = D + T1 | 0;
2714
- D = C;
2715
- C = B;
2716
- B = A;
2717
- A = T1 + T2 | 0;
2718
- }
2719
- A = A + this.A | 0;
2720
- B = B + this.B | 0;
2721
- C = C + this.C | 0;
2722
- D = D + this.D | 0;
2723
- E = E + this.E | 0;
2724
- F = F + this.F | 0;
2725
- G = G + this.G | 0;
2726
- H = H + this.H | 0;
2727
- this.set(A, B, C, D, E, F, G, H);
2728
- }
2729
- roundClean() {
2730
- clean(SHA256_W);
2731
- }
2732
- destroy() {
2733
- this.set(0, 0, 0, 0, 0, 0, 0, 0);
2734
- clean(this.buffer);
2735
- }
2736
- }
2737
- var sha256 = /* @__PURE__ */ createHasher(() => new SHA256);
183
+ // src/commands/auth.ts
184
+ import { createHighlightClient as createHighlightClient2 } from "@highlightxyz/sdk";
2738
185
 
2739
- // ../sdk/src/v1/media.ts
2740
- var isReadableStream = (source) => ("getReader" in source);
2741
- var sha256MediaContent = async (source, options) => {
2742
- const hasher = sha256.create();
2743
- let bytesHashed = 0;
2744
- const update = (chunk) => {
2745
- if (options?.signal?.aborted) {
2746
- throw new DOMException("Hashing aborted.", "AbortError");
2747
- }
2748
- hasher.update(chunk);
2749
- bytesHashed += chunk.byteLength;
2750
- options?.onProgress?.(bytesHashed);
2751
- };
2752
- if (isReadableStream(source)) {
2753
- const reader = source.getReader();
2754
- try {
2755
- while (true) {
2756
- const result = await reader.read();
2757
- if (result.done)
2758
- break;
2759
- update(result.value);
2760
- }
2761
- } finally {
2762
- reader.releaseLock();
2763
- }
2764
- } else {
2765
- for await (const chunk of source)
2766
- update(chunk);
2767
- }
2768
- return `sha256:${bytesToHex(hasher.digest())}`;
2769
- };
2770
- var SUPPORTED_IMAGE_CONTENT_TYPES = new Set([
2771
- "image/avif",
2772
- "image/gif",
2773
- "image/heic",
2774
- "image/heif",
2775
- "image/jpeg",
2776
- "image/jpg",
2777
- "image/png",
2778
- "image/webp"
2779
- ]);
2780
- var DEFAULT_MEDIA_DELIVERY_HOSTS = {
2781
- assets: "https://assets.highlight.xyz",
2782
- metadata: "https://metadata.highlight.xyz",
2783
- legacyAssets: "https://highlight-creator-assets.highlight.xyz",
2784
- arweaveGateway: "https://arweave.net",
2785
- ipfsGateway: "https://ipfs.io"
2786
- };
2787
- var LEGACY_REFERENCE = /^main\//;
2788
- var mediaUrl = (media, location, hosts = DEFAULT_MEDIA_DELIVERY_HOSTS) => {
2789
- switch (location.provider) {
2790
- case "R2" /* R2 */: {
2791
- if (LEGACY_REFERENCE.test(location.reference)) {
2792
- return `${hosts.legacyAssets}/${location.reference}`;
2793
- }
2794
- if (media.parentId && media.path) {
2795
- return `${hosts.assets}/${media.parentId}/${media.path}`;
2796
- }
2797
- return media.kind === "Directory" /* Directory */ ? `${hosts.assets}/${media.id}/` : `${hosts.assets}/${media.id}`;
2798
- }
2799
- case "Arweave" /* Arweave */:
2800
- return `${hosts.arweaveGateway}/${location.reference}`;
2801
- case "IPFS" /* Ipfs */:
2802
- return `${hosts.ipfsGateway}/ipfs/${location.reference.replace(/^ipfs:\/\//, "").replace(/^\//, "")}`;
2803
- case "External" /* External */:
2804
- return location.reference;
2805
- default:
2806
- return null;
2807
- }
2808
- };
2809
- var DEFAULT_PREFERENCE = [
2810
- "Archive" /* Archive */,
2811
- "Origin" /* Origin */,
2812
- "Mirror" /* Mirror */
2813
- ];
2814
- var pickLocation = (media, preference) => {
2815
- for (const role of preference) {
2816
- const location = media.locations.find((l) => l.role === role && l.status === "Succeeded" /* Succeeded */);
2817
- if (location)
2818
- return location;
2819
- }
2820
- return null;
2821
- };
2822
- var resolveMediaUrl = (media, options) => {
2823
- if (!media)
2824
- return null;
2825
- const preference = options?.prefer ? Array.isArray(options.prefer) ? options.prefer : [options.prefer] : DEFAULT_PREFERENCE;
2826
- const location = pickLocation(media, preference);
2827
- return location ? mediaUrl(media, location, options?.hosts) : null;
2828
- };
2829
186
  // src/config.ts
2830
187
  import { chmod, mkdir, readFile, rename, writeFile } from "node:fs/promises";
2831
188
  import path from "node:path";
@@ -2971,15 +328,16 @@ var printDeployStatus = (runtime, status) => {
2971
328
  runtime.stdout(JSON.stringify(status.contractConfig, null, 2));
2972
329
  }
2973
330
  };
2974
- var printMedia = (runtime, media2, resolvedUrl) => {
2975
- runtime.stdout(`Media ${media2.id}: ${media2.status}`);
2976
- runtime.stdout(`File: ${media2.fileName}`);
2977
- runtime.stdout(`Kind: ${media2.kind}`);
331
+ var printMedia = (runtime, media, resolvedUrl) => {
332
+ runtime.stdout(`Media ${media.id}: ${media.status}`);
333
+ runtime.stdout(`File: ${media.fileName}`);
334
+ runtime.stdout(`Kind: ${media.kind}`);
2978
335
  if (resolvedUrl)
2979
336
  runtime.stdout(`URL: ${resolvedUrl}`);
2980
337
  };
2981
338
 
2982
339
  // src/sdk.ts
340
+ import { createHighlightClient } from "@highlightxyz/sdk";
2983
341
  var createPublicClientContext = async (runtime, global) => {
2984
342
  const config = await loadConfig(runtime);
2985
343
  const profileName = profileNameFor(config, global.profile);
@@ -2987,7 +345,7 @@ var createPublicClientContext = async (runtime, global) => {
2987
345
  const environmentKey = runtime.env.HIGHLIGHT_API_KEY;
2988
346
  const apiKey = environmentKey ?? profile.apiKey;
2989
347
  const apiUrl = global.apiUrl ?? runtime.env.HIGHLIGHT_API_URL ?? profile.apiUrl ?? DEFAULT_API_URL;
2990
- const client3 = createHighlightClient({
348
+ const client = createHighlightClient({
2991
349
  apiKey,
2992
350
  baseUrl: apiUrl,
2993
351
  fetch: runtime.fetch
@@ -2995,7 +353,7 @@ var createPublicClientContext = async (runtime, global) => {
2995
353
  return {
2996
354
  apiKey,
2997
355
  apiUrl,
2998
- client: client3,
356
+ client,
2999
357
  config,
3000
358
  credentialSource: apiKey ? environmentKey ? "environment" : "profile" : undefined,
3001
359
  profileName
@@ -3053,12 +411,12 @@ var login = async (args, global, runtime) => {
3053
411
  const profileName = profileNameFor(config, global.profile);
3054
412
  const profile = profileFor(config, profileName);
3055
413
  const apiUrl = validateApiUrl(global.apiUrl ?? runtime.env.HIGHLIGHT_API_URL ?? profile.apiUrl ?? DEFAULT_API_URL);
3056
- const client3 = createHighlightClient({
414
+ const client = createHighlightClient2({
3057
415
  apiKey,
3058
416
  baseUrl: apiUrl,
3059
417
  fetch: runtime.fetch
3060
418
  });
3061
- const keys = unwrap(await client3.apiKey.list());
419
+ const keys = unwrap(await client.apiKey.list());
3062
420
  const activeKey = keys.find((key) => key.last4 === apiKey.slice(-4) && !key.revokedAt);
3063
421
  await saveConfig(runtime, updateProfile(config, profileName, { apiKey, apiUrl }));
3064
422
  const result = {
@@ -3204,6 +562,12 @@ var systemContract = async (args, global, runtime) => {
3204
562
  runtime.stdout(`${result.type} on ${result.chainId}: ${result.address}`);
3205
563
  };
3206
564
 
565
+ // src/commands/collections.ts
566
+ import {
567
+ CollectionType,
568
+ ContractStandard
569
+ } from "@highlightxyz/sdk";
570
+
3207
571
  // src/json-input.ts
3208
572
  import { readFile as readFile2 } from "node:fs/promises";
3209
573
  import path2 from "node:path";
@@ -3236,7 +600,7 @@ var requiredInputPath = (inputPath) => {
3236
600
  var isCollectionCreateInput = (value) => {
3237
601
  if (!isRecord3(value))
3238
602
  return false;
3239
- if (typeof value.name !== "string" || typeof value.description !== "string" || typeof value.logoMediaId !== "string" || !Object.values(CollectionType).includes(value.type) || !isOptionalString(value.contractId) || !isOptionalString(value.tokenManager)) {
603
+ if (typeof value.name !== "string" || !isOptionalString(value.description) || !Object.values(CollectionType).includes(value.type) || !isOptionalString(value.contractId) || !isOptionalString(value.tokenManager)) {
3240
604
  return false;
3241
605
  }
3242
606
  if (value.contract !== undefined) {
@@ -3325,7 +689,7 @@ var create = async (args, global, runtime) => {
3325
689
  });
3326
690
  assertNoExtraPositionals(parsed.positionals, 0);
3327
691
  const inputPath = requiredInputPath(parsed.values.input);
3328
- const input = await readTypedJsonInput(inputPath, runtime, isCollectionCreateInput, "a collection.create object containing name, description, logoMediaId, type, and valid contract details");
692
+ const input = await readTypedJsonInput(inputPath, runtime, isCollectionCreateInput, "a collection.create object containing name, type, and valid contract details");
3329
693
  const context = await createClientContext(runtime, global);
3330
694
  const collection = unwrap(await context.client.collection.create(input));
3331
695
  if (global.json) {
@@ -3446,6 +810,7 @@ var get2 = async (args, global, runtime) => {
3446
810
  };
3447
811
 
3448
812
  // src/commands/gates.ts
813
+ import { GateMatchMode } from "@highlightxyz/sdk";
3449
814
  var isOptionalMatchMode = (value) => value === undefined || Object.values(GateMatchMode).includes(value);
3450
815
  var isGateCondition = (value) => {
3451
816
  if (!isRecord3(value) || !isRecord3(value.config))
@@ -3547,6 +912,11 @@ import { createReadStream } from "node:fs";
3547
912
  import { stat } from "node:fs/promises";
3548
913
  import path3 from "node:path";
3549
914
  import { Readable } from "node:stream";
915
+ import {
916
+ MediaPurpose,
917
+ resolveMediaUrl,
918
+ sha256MediaContent
919
+ } from "@highlightxyz/sdk";
3550
920
  var MIME_TYPES = {
3551
921
  ".css": "text/css",
3552
922
  ".gif": "image/gif",
@@ -3576,18 +946,18 @@ var parseResponseError = async (response) => {
3576
946
  };
3577
947
  var waitUntilReady = async (mediaId, initial, timeoutSeconds, pollIntervalSeconds, runtime, getMedia) => {
3578
948
  const deadline = runtime.now() + timeoutSeconds * 1000;
3579
- let media2 = initial;
3580
- while (media2.status !== "Ready" && media2.status !== "Failed") {
949
+ let media = initial;
950
+ while (media.status !== "Ready" && media.status !== "Failed") {
3581
951
  if (runtime.now() >= deadline) {
3582
952
  throw new CliError(`Timed out waiting for media ${mediaId} to become ready`);
3583
953
  }
3584
954
  await runtime.sleep(pollIntervalSeconds * 1000);
3585
- media2 = await getMedia();
955
+ media = await getMedia();
3586
956
  }
3587
- if (media2.status === "Failed") {
957
+ if (media.status === "Failed") {
3588
958
  throw new CliError(`Media processing failed for ${mediaId}`);
3589
959
  }
3590
- return media2;
960
+ return media;
3591
961
  };
3592
962
  var upload = async (args, global, runtime) => {
3593
963
  const parsed = parseCommandArgs(args, {
@@ -3613,7 +983,7 @@ var upload = async (args, global, runtime) => {
3613
983
  throw new CliError(`--purpose must be one of: ${purposes.join(", ")}`, 2);
3614
984
  }
3615
985
  const collectionId = parsed.values.collection;
3616
- const needsCollection = purpose !== "UserAvatar" /* UserAvatar */;
986
+ const needsCollection = purpose !== MediaPurpose.UserAvatar;
3617
987
  if (needsCollection && !collectionId) {
3618
988
  throw new CliError(`--collection is required for ${purpose} uploads`, 2);
3619
989
  }
@@ -3643,47 +1013,51 @@ var upload = async (args, global, runtime) => {
3643
1013
  if (!response.ok) {
3644
1014
  throw new ApiError(await parseResponseError(response), response.status);
3645
1015
  }
3646
- let media2 = unwrap(await context.client.media.finalizeUpload({
1016
+ let media = unwrap(await context.client.media.finalizeUpload({
3647
1017
  mediaId: session.uploadMediaId
3648
1018
  }));
3649
1019
  if (!parsed.values["no-wait"]) {
3650
- media2 = await waitUntilReady(media2.id, media2, positiveNumber(parsed.values.timeout, "--timeout") ?? 300, positiveNumber(parsed.values["poll-interval"], "--poll-interval") ?? 2, runtime, async () => unwrap(await context.client.media.get({ mediaId: media2.id })));
1020
+ media = await waitUntilReady(media.id, media, positiveNumber(parsed.values.timeout, "--timeout") ?? 300, positiveNumber(parsed.values["poll-interval"], "--poll-interval") ?? 2, runtime, async () => unwrap(await context.client.media.get({ mediaId: media.id })));
3651
1021
  }
3652
1022
  const result = {
3653
- media: media2,
3654
- url: resolveMediaUrl(media2)
1023
+ media,
1024
+ url: resolveMediaUrl(media)
3655
1025
  };
3656
1026
  if (global.json)
3657
1027
  printJson(runtime, result);
3658
1028
  else
3659
- printMedia(runtime, media2, result.url);
1029
+ printMedia(runtime, media, result.url);
3660
1030
  };
3661
1031
  var get4 = async (args, global, runtime) => {
3662
1032
  const parsed = parseCommandArgs(args, { options: {} });
3663
1033
  const mediaId = requiredPositional(parsed.positionals, 0, "media-id");
3664
1034
  assertNoExtraPositionals(parsed.positionals, 1);
3665
1035
  const context = await createClientContext(runtime, global);
3666
- const media2 = unwrap(await context.client.media.get({ mediaId }));
3667
- const result = { media: media2, url: resolveMediaUrl(media2) };
1036
+ const media = unwrap(await context.client.media.get({ mediaId }));
1037
+ const result = { media, url: resolveMediaUrl(media) };
3668
1038
  if (global.json)
3669
1039
  printJson(runtime, result);
3670
1040
  else
3671
- printMedia(runtime, media2, result.url);
1041
+ printMedia(runtime, media, result.url);
3672
1042
  };
3673
1043
  var publish = async (args, global, runtime) => {
3674
1044
  const parsed = parseCommandArgs(args, { options: {} });
3675
1045
  const mediaId = requiredPositional(parsed.positionals, 0, "media-id");
3676
1046
  assertNoExtraPositionals(parsed.positionals, 1);
3677
1047
  const context = await createClientContext(runtime, global);
3678
- const media2 = unwrap(await context.client.media.publish({ mediaId }));
3679
- const result = { media: media2, url: resolveMediaUrl(media2) };
1048
+ const media = unwrap(await context.client.media.publish({ mediaId }));
1049
+ const result = { media, url: resolveMediaUrl(media) };
3680
1050
  if (global.json)
3681
1051
  printJson(runtime, result);
3682
1052
  else
3683
- printMedia(runtime, media2, result.url);
1053
+ printMedia(runtime, media, result.url);
3684
1054
  };
3685
1055
 
3686
1056
  // src/commands/sales.ts
1057
+ import {
1058
+ SaleAccessMode,
1059
+ SaleType
1060
+ } from "@highlightxyz/sdk";
3687
1061
  var isOptionalNumber = (value) => value === undefined || typeof value === "number" && Number.isFinite(value);
3688
1062
  var isOptionalBoolean = (value) => value === undefined || typeof value === "boolean";
3689
1063
  var isSaleCreateInput = (value) => {
@@ -3795,6 +1169,7 @@ var remove2 = async (args, global, runtime) => {
3795
1169
  };
3796
1170
 
3797
1171
  // src/commands/tokens.ts
1172
+ import { resolveMediaUrl as resolveMediaUrl2 } from "@highlightxyz/sdk";
3798
1173
  var list6 = async (args, global, runtime) => {
3799
1174
  const parsed = parseCommandArgs(args, {
3800
1175
  options: {
@@ -3846,7 +1221,7 @@ var list6 = async (args, global, runtime) => {
3846
1221
  token.name,
3847
1222
  token.status,
3848
1223
  token.mintedAt,
3849
- resolveMediaUrl(token.imageMedia)
1224
+ resolveMediaUrl2(token.imageMedia)
3850
1225
  ]));
3851
1226
  runtime.stdout(`Page ${result.pageInfo.page}/${Math.max(result.pageInfo.totalPages, 1)} · ${result.pageInfo.totalCount} total`);
3852
1227
  };
@@ -3863,8 +1238,8 @@ var get5 = async (args, global, runtime) => {
3863
1238
  }
3864
1239
  runtime.stdout(`${token.name ?? `Token ${token.tokenId}`} (${token.tokenId})`);
3865
1240
  runtime.stdout(`Status: ${token.status}`);
3866
- runtime.stdout(`Image: ${resolveMediaUrl(token.imageMedia) ?? "unavailable"}`);
3867
- runtime.stdout(`Animation: ${resolveMediaUrl(token.animationMedia) ?? "unavailable"}`);
1241
+ runtime.stdout(`Image: ${resolveMediaUrl2(token.imageMedia) ?? "unavailable"}`);
1242
+ runtime.stdout(`Animation: ${resolveMediaUrl2(token.animationMedia) ?? "unavailable"}`);
3868
1243
  if (token.description)
3869
1244
  runtime.stdout(`Description: ${token.description}`);
3870
1245
  };