@medialane/sdk 0.144.0 → 0.146.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.
@@ -600,7 +600,6 @@ interface EmissionParams {
600
600
  chain?: "STARKNET";
601
601
  service: string;
602
602
  owner: string;
603
- /** Recipient emails. */
604
603
  recipients: string[];
605
604
  tokenUri?: string;
606
605
  collectionId?: string;
@@ -1095,7 +1094,6 @@ interface ApiDropState {
1095
1094
  allowlistEnabled: boolean;
1096
1095
  paused: boolean;
1097
1096
  }
1098
- /** An IP Ticket or IP Club membership tier, as read from its contract. Amounts are decimal strings. */
1099
1097
  interface ApiTierOnchain {
1100
1098
  maxSupply: string;
1101
1099
  minted: string;
@@ -1126,7 +1124,6 @@ interface ApiUsernameClaim {
1126
1124
  createdAt: string;
1127
1125
  }
1128
1126
  type ApiReportTargetType = "COLLECTION" | "TOKEN" | "CREATOR" | "COMMENT";
1129
- /** `targetKey` is built from the target fields. */
1130
1127
  interface ApiSubmitReport {
1131
1128
  targetType: ApiReportTargetType;
1132
1129
  targetContract?: string;
@@ -1281,7 +1278,6 @@ declare class ApiClient {
1281
1278
  getOrders(query?: ApiOrdersQuery): Promise<ApiResponse<ApiOrder[]>>;
1282
1279
  getOrder(orderHash: string): Promise<ApiResponse<ApiOrder>>;
1283
1280
  getActiveOrdersForToken(contract: string, tokenId: string): Promise<ApiResponse<ApiOrder[]>>;
1284
- /** Offers others made on the address's assets. */
1285
1281
  getReceivedOffers(address: string, opts?: {
1286
1282
  page?: number;
1287
1283
  limit?: number;
@@ -1331,7 +1327,6 @@ declare class ApiClient {
1331
1327
  getCounterOffers(query: ApiCounterOffersQuery): Promise<ApiResponse<ApiOrder[]>>;
1332
1328
  getMetadataSignedUrl(kind?: "image" | "document" | "media"): Promise<ApiResponse<ApiMetadataSignedUrl>>;
1333
1329
  uploadMetadata(metadata: Record<string, unknown>): Promise<ApiResponse<ApiMetadataUpload>>;
1334
- /** Pins several JSON files as one IPFS directory, e.g. a drop's token metadata. */
1335
1330
  uploadMetadataDirectory(files: {
1336
1331
  name: string;
1337
1332
  content: unknown;
@@ -1352,7 +1347,6 @@ declare class ApiClient {
1352
1347
  }>>;
1353
1348
  getCreditHistory(siwsToken?: string): Promise<ApiResponse<ApiCreditPayment[]>>;
1354
1349
  getSpend(siwsToken?: string): Promise<ApiResponse<ApiPortalSpend>>;
1355
- /** @deprecated Use the funding methods (`createFunding`, or `fundWithChainTransfer` from `@medialane/sdk/starknet`). This call only nudges a legacy scanner and never credits anything itself. */
1356
1350
  checkDeposit(txHash: string, siwsToken?: string): Promise<ApiResponse<{
1357
1351
  deposits: number;
1358
1352
  }>>;
@@ -1451,18 +1445,12 @@ declare class ApiClient {
1451
1445
  requestEmailCode(email: string): Promise<void>;
1452
1446
  registerEmailAccount(email: string): Promise<void>;
1453
1447
  verifyEmailCode(email: string, code: string): Promise<void>;
1454
- /**
1455
- * Makes the passkey the only owner of the session account's wallet. `signature` is the passkey's owner-alive
1456
- * proof for the wallet. Answers 409 when the wallet is already set up.
1457
- */
1458
1448
  setupWalletKey(params: {
1459
1449
  newOwnerPubkey: string;
1460
- signature: string[];
1461
- expiration: number;
1462
1450
  }): Promise<{
1463
1451
  walletAddress: string;
1452
+ removeOwnerGuid: string | null;
1464
1453
  }>;
1465
- /** The session account's wallet, and whether its passkey still has to be set up (`setupWalletKey`). */
1466
1454
  getSessionWallet(): Promise<{
1467
1455
  walletAddress: string;
1468
1456
  needsKeySetup: boolean;
@@ -1575,9 +1563,7 @@ interface RecoveryKey {
1575
1563
  walletAddress: string;
1576
1564
  privateKey: string;
1577
1565
  }
1578
- /** The recovery key a user saves: a wallet address and one of its owner keys, in one string. */
1579
1566
  declare function encodeRecoveryKey(key: RecoveryKey): string;
1580
- /** Reads a saved recovery key. A bare private key, saved before v1, restores the wallet that key first deployed. */
1581
1567
  declare function parseRecoveryKey(input: string): RecoveryKey;
1582
1568
 
1583
1569
  declare class PasskeyCancelledError extends Error {
@@ -1601,7 +1587,6 @@ interface CreatedOwner {
1601
1587
  interface PasskeyOwner {
1602
1588
  createOwnerKey(): Promise<CreatedOwner>;
1603
1589
  unlockOwnerKey(sealed: SealedOwner): Promise<string>;
1604
- /** Seals an owner key restored from a recovery key, for the wallet it owns. */
1605
1590
  sealImportedOwnerKey(recovery: RecoveryKey): Promise<SealedOwner>;
1606
1591
  }
1607
1592
  declare function createPasskeyOwner(config: PasskeyConfig): PasskeyOwner;
@@ -600,7 +600,6 @@ interface EmissionParams {
600
600
  chain?: "STARKNET";
601
601
  service: string;
602
602
  owner: string;
603
- /** Recipient emails. */
604
603
  recipients: string[];
605
604
  tokenUri?: string;
606
605
  collectionId?: string;
@@ -1095,7 +1094,6 @@ interface ApiDropState {
1095
1094
  allowlistEnabled: boolean;
1096
1095
  paused: boolean;
1097
1096
  }
1098
- /** An IP Ticket or IP Club membership tier, as read from its contract. Amounts are decimal strings. */
1099
1097
  interface ApiTierOnchain {
1100
1098
  maxSupply: string;
1101
1099
  minted: string;
@@ -1126,7 +1124,6 @@ interface ApiUsernameClaim {
1126
1124
  createdAt: string;
1127
1125
  }
1128
1126
  type ApiReportTargetType = "COLLECTION" | "TOKEN" | "CREATOR" | "COMMENT";
1129
- /** `targetKey` is built from the target fields. */
1130
1127
  interface ApiSubmitReport {
1131
1128
  targetType: ApiReportTargetType;
1132
1129
  targetContract?: string;
@@ -1281,7 +1278,6 @@ declare class ApiClient {
1281
1278
  getOrders(query?: ApiOrdersQuery): Promise<ApiResponse<ApiOrder[]>>;
1282
1279
  getOrder(orderHash: string): Promise<ApiResponse<ApiOrder>>;
1283
1280
  getActiveOrdersForToken(contract: string, tokenId: string): Promise<ApiResponse<ApiOrder[]>>;
1284
- /** Offers others made on the address's assets. */
1285
1281
  getReceivedOffers(address: string, opts?: {
1286
1282
  page?: number;
1287
1283
  limit?: number;
@@ -1331,7 +1327,6 @@ declare class ApiClient {
1331
1327
  getCounterOffers(query: ApiCounterOffersQuery): Promise<ApiResponse<ApiOrder[]>>;
1332
1328
  getMetadataSignedUrl(kind?: "image" | "document" | "media"): Promise<ApiResponse<ApiMetadataSignedUrl>>;
1333
1329
  uploadMetadata(metadata: Record<string, unknown>): Promise<ApiResponse<ApiMetadataUpload>>;
1334
- /** Pins several JSON files as one IPFS directory, e.g. a drop's token metadata. */
1335
1330
  uploadMetadataDirectory(files: {
1336
1331
  name: string;
1337
1332
  content: unknown;
@@ -1352,7 +1347,6 @@ declare class ApiClient {
1352
1347
  }>>;
1353
1348
  getCreditHistory(siwsToken?: string): Promise<ApiResponse<ApiCreditPayment[]>>;
1354
1349
  getSpend(siwsToken?: string): Promise<ApiResponse<ApiPortalSpend>>;
1355
- /** @deprecated Use the funding methods (`createFunding`, or `fundWithChainTransfer` from `@medialane/sdk/starknet`). This call only nudges a legacy scanner and never credits anything itself. */
1356
1350
  checkDeposit(txHash: string, siwsToken?: string): Promise<ApiResponse<{
1357
1351
  deposits: number;
1358
1352
  }>>;
@@ -1451,18 +1445,12 @@ declare class ApiClient {
1451
1445
  requestEmailCode(email: string): Promise<void>;
1452
1446
  registerEmailAccount(email: string): Promise<void>;
1453
1447
  verifyEmailCode(email: string, code: string): Promise<void>;
1454
- /**
1455
- * Makes the passkey the only owner of the session account's wallet. `signature` is the passkey's owner-alive
1456
- * proof for the wallet. Answers 409 when the wallet is already set up.
1457
- */
1458
1448
  setupWalletKey(params: {
1459
1449
  newOwnerPubkey: string;
1460
- signature: string[];
1461
- expiration: number;
1462
1450
  }): Promise<{
1463
1451
  walletAddress: string;
1452
+ removeOwnerGuid: string | null;
1464
1453
  }>;
1465
- /** The session account's wallet, and whether its passkey still has to be set up (`setupWalletKey`). */
1466
1454
  getSessionWallet(): Promise<{
1467
1455
  walletAddress: string;
1468
1456
  needsKeySetup: boolean;
@@ -1575,9 +1563,7 @@ interface RecoveryKey {
1575
1563
  walletAddress: string;
1576
1564
  privateKey: string;
1577
1565
  }
1578
- /** The recovery key a user saves: a wallet address and one of its owner keys, in one string. */
1579
1566
  declare function encodeRecoveryKey(key: RecoveryKey): string;
1580
- /** Reads a saved recovery key. A bare private key, saved before v1, restores the wallet that key first deployed. */
1581
1567
  declare function parseRecoveryKey(input: string): RecoveryKey;
1582
1568
 
1583
1569
  declare class PasskeyCancelledError extends Error {
@@ -1601,7 +1587,6 @@ interface CreatedOwner {
1601
1587
  interface PasskeyOwner {
1602
1588
  createOwnerKey(): Promise<CreatedOwner>;
1603
1589
  unlockOwnerKey(sealed: SealedOwner): Promise<string>;
1604
- /** Seals an owner key restored from a recovery key, for the wallet it owns. */
1605
1590
  sealImportedOwnerKey(recovery: RecoveryKey): Promise<SealedOwner>;
1606
1591
  }
1607
1592
  declare function createPasskeyOwner(config: PasskeyConfig): PasskeyOwner;
package/dist/index.cjs CHANGED
@@ -379,7 +379,6 @@ var ApiClient = class {
379
379
  getActiveOrdersForToken(contract, tokenId) {
380
380
  return this.get(`/v1/orders/token/${this.addr(contract)}/${tokenId}`);
381
381
  }
382
- /** Offers others made on the address's assets. */
383
382
  getReceivedOffers(address, opts = {}) {
384
383
  const params = new URLSearchParams({ page: String(opts.page ?? 1), limit: String(opts.limit ?? 50) });
385
384
  return this.get(`/v1/orders/received/${this.addr(address)}?${params}`);
@@ -538,7 +537,6 @@ var ApiClient = class {
538
537
  uploadMetadata(metadata) {
539
538
  return this.post("/v1/metadata/upload", metadata);
540
539
  }
541
- /** Pins several JSON files as one IPFS directory, e.g. a drop's token metadata. */
542
540
  async uploadMetadataDirectory(files) {
543
541
  const res = await this.post("/v1/metadata/upload-directory", { files });
544
542
  return res.data;
@@ -592,7 +590,6 @@ var ApiClient = class {
592
590
  headers: this.asSubject(siwsToken)
593
591
  });
594
592
  }
595
- /** @deprecated Use the funding methods (`createFunding`, or `fundWithChainTransfer` from `@medialane/sdk/starknet`). This call only nudges a legacy scanner and never credits anything itself. */
596
593
  checkDeposit(txHash, siwsToken) {
597
594
  return this.request("/v1/portal/credits/check", {
598
595
  method: "POST",
@@ -784,14 +781,9 @@ var ApiClient = class {
784
781
  async verifyEmailCode(email, code) {
785
782
  await this.post("/v1/auth/email/verify-code", { email, code });
786
783
  }
787
- /**
788
- * Makes the passkey the only owner of the session account's wallet. `signature` is the passkey's owner-alive
789
- * proof for the wallet. Answers 409 when the wallet is already set up.
790
- */
791
784
  setupWalletKey(params) {
792
785
  return this.post("/v1/users/me/wallet/key", params);
793
786
  }
794
- /** The session account's wallet, and whether its passkey still has to be set up (`setupWalletKey`). */
795
787
  async getSessionWallet() {
796
788
  const body = await this.post("/v1/users/me/wallet", {});
797
789
  return body.walletAddress ? { walletAddress: body.walletAddress, needsKeySetup: body.needsKeySetup === true } : null;
@@ -1126,6 +1118,7 @@ var ApiClient = class {
1126
1118
  // src/api/launchpad-runs.ts
1127
1119
  var isDataTokenizationRun = (run) => run.service === "data-tokenization-erc721";
1128
1120
  var isTicketingRun = (run) => run.service === "ip-ticketing";
1121
+ var isCertificateEmissionRun = (run) => run.service === "certificate-emission";
1129
1122
  var RunRequestError = class extends Error {
1130
1123
  constructor(message, status, body) {
1131
1124
  super(message);
@@ -1165,13 +1158,21 @@ function createLaunchpadRunsClient({ baseUrl, getToken, fetchImpl = fetch }) {
1165
1158
  uploadUrl: async (id, name) => (await post(`${runBase(id)}/files/upload-url`, { name })).data.url,
1166
1159
  uploaded: async (id, name, cid) => (await post(`${runBase(id)}/files/uploaded`, { name, cid })).data,
1167
1160
  metadata: async (id, userAddress) => (await post(`${runBase(id)}/metadata`, { userAddress })).data,
1168
- /** Guests who still need a wallet deployed; the ones who already have one are recorded on the run. */
1169
1161
  resolveWallets: async (id) => (await post(`${runBase(id)}/wallets/resolve`)).data.pending,
1170
1162
  registerWallet: async (id, request) => (await post(`${runBase(id)}/wallets`, request)).data,
1171
1163
  confirmCollection: (id) => confirm(`${runCollectionBase(id)}/confirm`),
1172
1164
  confirmTier: (id) => confirm(`${runTierBase(id)}/confirm`),
1173
1165
  confirmBatch: (id, index) => confirm(`${runBatchBase(id, index)}/confirm`)
1174
1166
  };
1167
+ const certificateEmission = {
1168
+ uploadUrl: async (id, name) => (await post(`${runBase(id)}/files/upload-url`, { name })).data.url,
1169
+ uploaded: async (id, name, cid) => (await post(`${runBase(id)}/files/uploaded`, { name, cid })).data,
1170
+ metadata: async (id, userAddress) => (await post(`${runBase(id)}/certificate-metadata`, { userAddress })).data,
1171
+ resolveWallets: async (id) => (await post(`${runBase(id)}/recipients/resolve`)).data.pending,
1172
+ registerWallet: async (id, request) => (await post(`${runBase(id)}/recipients`, request)).data,
1173
+ confirmCollection: (id) => confirm(`${runCollectionBase(id)}/confirm`),
1174
+ confirmBatch: (id, index) => confirm(`${runBatchBase(id, index)}/confirm`)
1175
+ };
1175
1176
  return {
1176
1177
  authorizedFetch,
1177
1178
  runBase,
@@ -1179,6 +1180,7 @@ function createLaunchpadRunsClient({ baseUrl, getToken, fetchImpl = fetch }) {
1179
1180
  runCollectionBase,
1180
1181
  runTierBase,
1181
1182
  ticketing,
1183
+ certificateEmission,
1182
1184
  list: async () => (await call(runsUrl)).data,
1183
1185
  get: async (id) => (await call(`${runBase(id)}`)).data,
1184
1186
  create: async (service, spec) => (await post(runsUrl, { service, spec })).data,
@@ -1396,6 +1398,25 @@ var SERVICES = {
1396
1398
  ],
1397
1399
  metadataSchema: { licenseDefault: "CC BY-SA" }
1398
1400
  },
1401
+ "certificate-emission": {
1402
+ id: "certificate-emission",
1403
+ displayName: "Certificate Emission",
1404
+ description: "Issue a soulbound credential to a list of recipients in one run \u2014 everyone gets a wallet and their certificate.",
1405
+ standard: "ERC721",
1406
+ provenance: "MEDIALANE",
1407
+ onchain: {
1408
+ STARKNET: {
1409
+ factoryAddress: SN2.popFactory,
1410
+ classHash: SN2.popCollectionClassHash
1411
+ }
1412
+ },
1413
+ uiVariant: "pop",
1414
+ capabilities: ["mint", "airdrop"],
1415
+ events: [
1416
+ { name: "CollectionCreated", emittedBy: "factory" }
1417
+ ],
1418
+ metadataSchema: { licenseDefault: "CC BY-SA" }
1419
+ },
1399
1420
  "drop-collection": {
1400
1421
  id: "drop-collection",
1401
1422
  displayName: "Collection Drop",
@@ -2375,6 +2396,7 @@ exports.getStarknetCoordinates = getStarknetCoordinates;
2375
2396
  exports.getTokenByAddress = getTokenByAddress;
2376
2397
  exports.getTokenBySymbol = getTokenBySymbol;
2377
2398
  exports.hasCapability = hasCapability;
2399
+ exports.isCertificateEmissionRun = isCertificateEmissionRun;
2378
2400
  exports.isDataTokenizationRun = isDataTokenizationRun;
2379
2401
  exports.isPolicyRefusal = isPolicyRefusal;
2380
2402
  exports.isPrivateHost = isPrivateHost;