@highlightxyz/sdk 0.3.0 → 0.4.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.
@@ -1,7 +1,7 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
  import { buildClientParams, } from "./client";
3
3
  import { client } from "./client.gen";
4
- import { CaptureSettingsTrigger, CollectionType, ContractStandard, GateMatchMode, GenerativeEditionType, MediaKind, MediaScope, SaleAccessMode, SaleType, SelectorType, } from "./types.gen";
4
+ import { CaptureSettingsTrigger, CollectionType, ContractStandard, GateMatchMode, GenerativeEditionType, MediaPurpose, SaleAccessMode, SaleType, SelectorType, } from "./types.gen";
5
5
  class HeyApiClient {
6
6
  client;
7
7
  constructor(args) {
@@ -62,8 +62,6 @@ export class Collection extends HeyApiClient {
62
62
  { in: "body", key: "description" },
63
63
  { in: "body", key: "contractId" },
64
64
  { in: "body", key: "contract" },
65
- { in: "body", key: "logoMediaId" },
66
- { in: "body", key: "image" },
67
65
  { in: "body", key: "type" },
68
66
  { in: "body", key: "royalty" },
69
67
  { in: "body", key: "tokenManager" },
@@ -158,16 +156,70 @@ export class Collection extends HeyApiClient {
158
156
  /**
159
157
  * Archive collection metadata to Arweave
160
158
  *
161
- * Archive the collection's token-metadata directory to Arweave. The operation is idempotent and does not change the contract's base URI.
159
+ * Archive the collection's current token-metadata directory snapshot to Arweave. The operation is archive-once, leaves the R2 directory appendable, and does not change the contract's base URI.
162
160
  */
163
- finalizeBaseUri(parameters, options) {
161
+ archiveBaseUri(parameters, options) {
164
162
  const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "highlightId" }] }]);
165
163
  return (options?.client ?? this.client).post({
166
- url: "/collection/{highlightId}/finalize-base-uri",
164
+ url: "/collection/{highlightId}/archive-base-uri",
167
165
  ...options,
168
166
  ...params,
169
167
  });
170
168
  }
169
+ /**
170
+ * Create a collection media upload session
171
+ *
172
+ * Start an upload for one of the collection media purposes and return an upload URL with the required request headers.
173
+ */
174
+ createMediaUploadSession(parameters, options) {
175
+ const params = buildClientParams([parameters], [
176
+ {
177
+ args: [
178
+ { in: "path", key: "highlightId" },
179
+ { in: "body", key: "purpose" },
180
+ { in: "body", key: "fileName" },
181
+ { in: "body", key: "mimeType" },
182
+ { in: "body", key: "fileSize" },
183
+ { in: "body", key: "contentHash" },
184
+ ],
185
+ },
186
+ ]);
187
+ return (options?.client ?? this.client).post({
188
+ url: "/collection/{highlightId}/media/upload-session",
189
+ ...options,
190
+ ...params,
191
+ headers: {
192
+ "Content-Type": "application/json",
193
+ ...options?.headers,
194
+ ...params.headers,
195
+ },
196
+ });
197
+ }
198
+ /**
199
+ * Update collection display metadata
200
+ *
201
+ * Update a collection's name, description, and logo. Every field is optional; absent fields are left unchanged.
202
+ */
203
+ updateMetadata(parameters, options) {
204
+ const params = buildClientParams([parameters], [
205
+ {
206
+ args: [
207
+ { in: "path", key: "highlightId" },
208
+ { key: "collectionUpdateMetadataInput", map: "body" },
209
+ ],
210
+ },
211
+ ]);
212
+ return (options?.client ?? this.client).patch({
213
+ url: "/collection/{highlightId}/metadata",
214
+ ...options,
215
+ ...params,
216
+ headers: {
217
+ "Content-Type": "application/json",
218
+ ...options?.headers,
219
+ ...params.headers,
220
+ },
221
+ });
222
+ }
171
223
  /**
172
224
  * Update generative draft details
173
225
  *
@@ -278,7 +330,6 @@ export class Collection extends HeyApiClient {
278
330
  { in: "body", key: "paymentRecipient" },
279
331
  { in: "body", key: "accessMode" },
280
332
  { in: "body", key: "gateId" },
281
- { in: "body", key: "gasSponsored" },
282
333
  { in: "body", key: "mechanicId" },
283
334
  { in: "body", key: "typeConfig" },
284
335
  { in: "body", key: "collectorMessage" },
@@ -570,6 +621,51 @@ export class Collection extends HeyApiClient {
570
621
  ...params,
571
622
  });
572
623
  }
624
+ /**
625
+ * Get Dutch auction standing
626
+ *
627
+ * Get a Dutch auction's descending price ladder, its clock, and its supply/escrow state. An authenticated response also includes the caller's purchase position and any rebate owed. Amounts use the currency's raw on-chain base unit.
628
+ */
629
+ dutchAuctionStanding(parameters, options) {
630
+ const params = buildClientParams([parameters], [
631
+ {
632
+ args: [
633
+ { in: "path", key: "highlightId" },
634
+ { in: "path", key: "saleId" },
635
+ ],
636
+ },
637
+ ]);
638
+ return (options?.client ?? this.client).get({
639
+ url: "/collection/{highlightId}/sales/{saleId}/dutch",
640
+ ...options,
641
+ ...params,
642
+ });
643
+ }
644
+ /**
645
+ * Claim a Dutch auction rebate
646
+ *
647
+ * Build a transaction that refunds the caller the difference between what they paid and the auction's final clearing price. Only available once the auction has reached its resting price or sold out.
648
+ */
649
+ claimDutchRebate(parameters, options) {
650
+ const params = buildClientParams([parameters], [
651
+ {
652
+ args: [
653
+ { in: "path", key: "highlightId" },
654
+ { in: "body", key: "saleId" },
655
+ ],
656
+ },
657
+ ]);
658
+ return (options?.client ?? this.client).post({
659
+ url: "/collection/{highlightId}/sales/dutch/rebate",
660
+ ...options,
661
+ ...params,
662
+ headers: {
663
+ "Content-Type": "application/json",
664
+ ...options?.headers,
665
+ ...params.headers,
666
+ },
667
+ });
668
+ }
573
669
  /**
574
670
  * Initiate collection deployment
575
671
  *
@@ -716,6 +812,17 @@ export class Config extends HeyApiClient {
716
812
  ...options,
717
813
  });
718
814
  }
815
+ /**
816
+ * Get media delivery hosts
817
+ *
818
+ * Public hosts a client uses to build media URLs from a storage location's provider and reference.
819
+ */
820
+ mediaHosts(options) {
821
+ return (options?.client ?? this.client).get({
822
+ url: "/config/media-hosts",
823
+ ...options,
824
+ });
825
+ }
719
826
  /**
720
827
  * Get system contract
721
828
  *
@@ -1124,55 +1231,14 @@ export class Mechanic extends HeyApiClient {
1124
1231
  }
1125
1232
  export class Media extends HeyApiClient {
1126
1233
  /**
1127
- * Create media upload session
1234
+ * Finalize a direct media upload
1128
1235
  *
1129
- * Create a pending media asset and return an upload URL with the required request headers.
1236
+ * Verify the exact object, size, content type, and R2 SHA-256 checksum before exposing it or starting directory extraction. Duplicate calls are idempotent.
1130
1237
  */
1131
- createUploadSession(parameters, options) {
1132
- const params = buildClientParams([parameters], [
1133
- {
1134
- args: [
1135
- { in: "body", key: "kind" },
1136
- { in: "body", key: "scope" },
1137
- { in: "body", key: "fileName" },
1138
- { in: "body", key: "mimeType" },
1139
- { in: "body", key: "fileSize" },
1140
- ],
1141
- },
1142
- ]);
1143
- return (options?.client ?? this.client).post({
1144
- url: "/media/upload-session",
1145
- ...options,
1146
- ...params,
1147
- headers: {
1148
- "Content-Type": "application/json",
1149
- ...options?.headers,
1150
- ...params.headers,
1151
- },
1152
- });
1153
- }
1154
- /**
1155
- * Upload media bytes
1156
- *
1157
- * Write the request body to storage and start processing. Files return Ready; directories return Processing while extraction runs.
1158
- */
1159
- upload(parameters, options) {
1160
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mediaId" }] }]);
1161
- return (options?.client ?? this.client).put({
1162
- url: "/media/{mediaId}/upload",
1163
- ...options,
1164
- ...params,
1165
- });
1166
- }
1167
- /**
1168
- * Process a media asset
1169
- *
1170
- * Retry processing for a failed directory. The operation is idempotent and leaves Ready or Processing assets unchanged.
1171
- */
1172
- process(parameters, options) {
1238
+ finalizeUpload(parameters, options) {
1173
1239
  const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mediaId" }] }]);
1174
1240
  return (options?.client ?? this.client).post({
1175
- url: "/media/{mediaId}/process",
1241
+ url: "/media/{mediaId}/finalize",
1176
1242
  ...options,
1177
1243
  ...params,
1178
1244
  });
@@ -1201,7 +1267,7 @@ export class Media extends HeyApiClient {
1201
1267
  /**
1202
1268
  * Delete a media asset
1203
1269
  *
1204
- * Delete a media record and its R2 objects. An immutable Arweave archive remains available. Returns 409 when a contract or generative collection still references the media.
1270
+ * Delete a media record and its R2 objects. Referenced media returns 409. Immutable Arweave archives remain available.
1205
1271
  */
1206
1272
  delete(parameters, options) {
1207
1273
  const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "mediaId" }] }]);
@@ -1300,6 +1366,68 @@ export class Tx extends HeyApiClient {
1300
1366
  });
1301
1367
  }
1302
1368
  }
1369
+ export class Siwe extends HeyApiClient {
1370
+ /**
1371
+ * Issue a SIWE nonce
1372
+ *
1373
+ * Issue a single-use, short-lived nonce for the `nonce` field of a SIWE (EIP-4361) message.
1374
+ */
1375
+ nonce(options) {
1376
+ return (options?.client ?? this.client).post({ url: "/user/signin/siwe/nonce", ...options });
1377
+ }
1378
+ }
1379
+ export class User extends HeyApiClient {
1380
+ /**
1381
+ * Create a user media upload session
1382
+ *
1383
+ * Start an upload for one of the user media purposes and return an upload URL with the required request headers.
1384
+ */
1385
+ createMediaUploadSession(parameters, options) {
1386
+ const params = buildClientParams([parameters], [
1387
+ {
1388
+ args: [
1389
+ { in: "body", key: "purpose" },
1390
+ { in: "body", key: "fileName" },
1391
+ { in: "body", key: "mimeType" },
1392
+ { in: "body", key: "fileSize" },
1393
+ { in: "body", key: "contentHash" },
1394
+ ],
1395
+ },
1396
+ ]);
1397
+ return (options?.client ?? this.client).post({
1398
+ url: "/user/media/upload-session",
1399
+ ...options,
1400
+ ...params,
1401
+ headers: {
1402
+ "Content-Type": "application/json",
1403
+ ...options?.headers,
1404
+ ...params.headers,
1405
+ },
1406
+ });
1407
+ }
1408
+ /**
1409
+ * Sign in
1410
+ *
1411
+ * Exchange a Privy ID token or signed SIWE message for Highlight access and refresh tokens.
1412
+ */
1413
+ signin(parameters, options) {
1414
+ const params = buildClientParams([parameters], [{ args: [{ key: "body", map: "body" }] }]);
1415
+ return (options?.client ?? this.client).post({
1416
+ url: "/user/signin",
1417
+ ...options,
1418
+ ...params,
1419
+ headers: {
1420
+ "Content-Type": "application/json",
1421
+ ...options?.headers,
1422
+ ...params.headers,
1423
+ },
1424
+ });
1425
+ }
1426
+ _siwe;
1427
+ get siwe() {
1428
+ return (this._siwe ??= new Siwe({ client: this.client }));
1429
+ }
1430
+ }
1303
1431
  export class Profile extends HeyApiClient {
1304
1432
  /**
1305
1433
  * Get authenticated profile
@@ -1312,7 +1440,7 @@ export class Profile extends HeyApiClient {
1312
1440
  /**
1313
1441
  * Update authenticated profile
1314
1442
  *
1315
- * Update private profile fields. Avatar media must be an owned, ready User-scope image file.
1443
+ * Update private profile fields. Avatar media must be an owned, ready User-namespace image file.
1316
1444
  */
1317
1445
  update(parameters, options) {
1318
1446
  const params = buildClientParams([parameters], [
@@ -1375,40 +1503,6 @@ export class Profile extends HeyApiClient {
1375
1503
  });
1376
1504
  }
1377
1505
  }
1378
- export class Siwe extends HeyApiClient {
1379
- /**
1380
- * Issue a SIWE nonce
1381
- *
1382
- * Issue a single-use, short-lived nonce for the `nonce` field of a SIWE (EIP-4361) message.
1383
- */
1384
- nonce(options) {
1385
- return (options?.client ?? this.client).post({ url: "/user/signin/siwe/nonce", ...options });
1386
- }
1387
- }
1388
- export class User extends HeyApiClient {
1389
- /**
1390
- * Sign in
1391
- *
1392
- * Exchange a Privy ID token or signed SIWE message for Highlight access and refresh tokens.
1393
- */
1394
- signin(parameters, options) {
1395
- const params = buildClientParams([parameters], [{ args: [{ key: "body", map: "body" }] }]);
1396
- return (options?.client ?? this.client).post({
1397
- url: "/user/signin",
1398
- ...options,
1399
- ...params,
1400
- headers: {
1401
- "Content-Type": "application/json",
1402
- ...options?.headers,
1403
- ...params.headers,
1404
- },
1405
- });
1406
- }
1407
- _siwe;
1408
- get siwe() {
1409
- return (this._siwe ??= new Siwe({ client: this.client }));
1410
- }
1411
- }
1412
1506
  export class ApiKey extends HeyApiClient {
1413
1507
  /**
1414
1508
  * List API keys
@@ -1559,14 +1653,14 @@ export class HighlightClient extends HeyApiClient {
1559
1653
  get tx() {
1560
1654
  return (this._tx ??= new Tx({ client: this.client }));
1561
1655
  }
1562
- _profile;
1563
- get profile() {
1564
- return (this._profile ??= new Profile({ client: this.client }));
1565
- }
1566
1656
  _user;
1567
1657
  get user() {
1568
1658
  return (this._user ??= new User({ client: this.client }));
1569
1659
  }
1660
+ _profile;
1661
+ get profile() {
1662
+ return (this._profile ??= new Profile({ client: this.client }));
1663
+ }
1570
1664
  _apiKey;
1571
1665
  get apiKey() {
1572
1666
  return (this._apiKey ??= new ApiKey({ client: this.client }));