@medialane/sdk 0.85.3 → 0.85.5

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,4 +1,4 @@
1
- import { b6 as ResolvedConfig, bf as TxResult, at as CreatePopCollectionParams, ae as ClaimConditions, ap as CreateDropParams, ay as CreateTicketParams, aT as MintTicketsParams, ar as CreateMembershipParams, aS as MintMembershipsParams, aw as CreateSponsorshipOfferParams, b3 as ProposeSponsorshipParams, l as ApiClient, aQ as MedialaneConfig, aR as MedialaneErrorCode, aY as OrderDetails, b7 as ResolvedFeeConfig } from '../services-Yy1coqTe.cjs';
1
+ import { b6 as ResolvedConfig, bf as TxResult, at as CreatePopCollectionParams, ae as ClaimConditions, ap as CreateDropParams, ay as CreateTicketParams, aT as MintTicketsParams, ar as CreateMembershipParams, aS as MintMembershipsParams, aw as CreateSponsorshipOfferParams, b3 as ProposeSponsorshipParams, l as ApiClient, aQ as MedialaneConfig, aR as MedialaneErrorCode, aY as OrderDetails, b7 as ResolvedFeeConfig } from '../services-xJvXhXQi.cjs';
2
2
  import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload } from 'starknet';
3
3
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-sIc3OCpo.cjs';
4
4
  import 'zod';
@@ -1,4 +1,4 @@
1
- import { b6 as ResolvedConfig, bf as TxResult, at as CreatePopCollectionParams, ae as ClaimConditions, ap as CreateDropParams, ay as CreateTicketParams, aT as MintTicketsParams, ar as CreateMembershipParams, aS as MintMembershipsParams, aw as CreateSponsorshipOfferParams, b3 as ProposeSponsorshipParams, l as ApiClient, aQ as MedialaneConfig, aR as MedialaneErrorCode, aY as OrderDetails, b7 as ResolvedFeeConfig } from '../services-14BcGiDF.js';
1
+ import { b6 as ResolvedConfig, bf as TxResult, at as CreatePopCollectionParams, ae as ClaimConditions, ap as CreateDropParams, ay as CreateTicketParams, aT as MintTicketsParams, ar as CreateMembershipParams, aS as MintMembershipsParams, aw as CreateSponsorshipOfferParams, b3 as ProposeSponsorshipParams, l as ApiClient, aQ as MedialaneConfig, aR as MedialaneErrorCode, aY as OrderDetails, b7 as ResolvedFeeConfig } from '../services-hDpCpw3d.js';
2
2
  import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload } from 'starknet';
3
3
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-sIc3OCpo.js';
4
4
  import 'zod';
@@ -322,9 +322,9 @@ var ApiClient = class {
322
322
  del(path) {
323
323
  return this.request(path, { method: "DELETE" });
324
324
  }
325
- /** Bearer header for Clerk-JWT-authenticated routes. */
326
- bearer(clerkToken) {
327
- return { Authorization: `Bearer ${clerkToken}` };
325
+ /** Bearer header for SIWS-token-authenticated routes. */
326
+ bearer(siwsToken) {
327
+ return { Authorization: `Bearer ${siwsToken}` };
328
328
  }
329
329
  // ─── Orders ────────────────────────────────────────────────────────────────
330
330
  getOrders(query = {}) {
@@ -370,12 +370,13 @@ var ApiClient = class {
370
370
  );
371
371
  }
372
372
  // ─── Collections ───────────────────────────────────────────────────────────
373
- getCollections(page = 1, limit = 20, isKnown, sort, service, chain) {
373
+ getCollections(page = 1, limit = 20, isKnown, sort, service, chain, standard) {
374
374
  const params = new URLSearchParams({ page: String(page), limit: String(limit) });
375
375
  if (isKnown !== void 0) params.set("isKnown", String(isKnown));
376
376
  if (sort) params.set("sort", sort);
377
377
  if (service) params.set("service", service);
378
378
  if (chain) params.set("chain", chain);
379
+ if (standard) params.set("standard", standard);
379
380
  return this.get(`/v1/collections?${params}`);
380
381
  }
381
382
  getCollectionsByOwner(owner, page = 1, limit = 50) {
@@ -394,6 +395,7 @@ var ApiClient = class {
394
395
  getActivities(query = {}) {
395
396
  const params = new URLSearchParams();
396
397
  if (query.type) params.set("type", query.type);
398
+ if (query.contract) params.set("contract", query.contract);
397
399
  if (query.page !== void 0) params.set("page", String(query.page));
398
400
  if (query.limit !== void 0) params.set("limit", String(query.limit));
399
401
  if (query.chain) params.set("chain", query.chain);
@@ -492,11 +494,11 @@ var ApiClient = class {
492
494
  }
493
495
  /**
494
496
  * Create a counter-offer intent. The seller proposes a new price in response
495
- * to a buyer's active bid. clerkToken is optional — the endpoint authenticates
496
- * via the tenant API key; pass a Clerk JWT only if your backend requires it.
497
+ * to a buyer's active bid. siwsToken is optional — the endpoint authenticates
498
+ * via the tenant API key; pass a SIWS token only if your backend requires it.
497
499
  */
498
- createCounterOfferIntent(params, clerkToken) {
499
- const extraHeaders = clerkToken ? { "Authorization": `Bearer ${clerkToken}` } : {};
500
+ createCounterOfferIntent(params, siwsToken) {
501
+ const extraHeaders = siwsToken ? { "Authorization": `Bearer ${siwsToken}` } : {};
500
502
  return this.request("/v1/intents/counter-offer", {
501
503
  method: "POST",
502
504
  body: JSON.stringify(params),
@@ -564,13 +566,13 @@ var ApiClient = class {
564
566
  // ─── Collection Claims ──────────────────────────────────────────────────────
565
567
  /**
566
568
  * Path 1: On-chain auto claim. Sends both x-api-key (tenant auth) and
567
- * Authorization: Bearer (Clerk JWT) simultaneously.
569
+ * Authorization: Bearer (SIWS token) simultaneously.
568
570
  */
569
- async claimCollection(contractAddress, walletAddress, clerkToken) {
571
+ async claimCollection(contractAddress, walletAddress, siwsToken) {
570
572
  return this.request("/v1/collections/claim", {
571
573
  method: "POST",
572
574
  body: JSON.stringify({ contractAddress, walletAddress }),
573
- headers: this.bearer(clerkToken)
575
+ headers: this.bearer(siwsToken)
574
576
  });
575
577
  }
576
578
  /**
@@ -598,12 +600,12 @@ var ApiClient = class {
598
600
  );
599
601
  }
600
602
  /**
601
- * Update collection profile. Requires Clerk JWT for ownership check.
603
+ * Update collection profile. Requires SIWS token for ownership check.
602
604
  */
603
- updateCollectionProfile(contractAddress, data, clerkToken) {
605
+ updateCollectionProfile(contractAddress, data, siwsToken) {
604
606
  return this.request(
605
607
  `/v1/collections/${this.addr(contractAddress)}/profile`,
606
- { method: "PATCH", body: JSON.stringify(data), headers: this.bearer(clerkToken) }
608
+ { method: "PATCH", body: JSON.stringify(data), headers: this.bearer(siwsToken) }
607
609
  );
608
610
  }
609
611
  /** No signature required — wallet activity is public on-chain data, read like any other /v1 GET. */
@@ -612,10 +614,10 @@ var ApiClient = class {
612
614
  `/v1/wallet-activity?address=${this.addr(address)}&chain=${chain}`
613
615
  );
614
616
  }
615
- getGatedContent(contractAddress, clerkToken) {
617
+ getGatedContent(contractAddress, siwsToken) {
616
618
  return this.request(
617
619
  `/v1/collections/${this.addr(contractAddress)}/gated-content`,
618
- { method: "GET", headers: this.bearer(clerkToken) },
620
+ { method: "GET", headers: this.bearer(siwsToken) },
619
621
  { allow404: true, allow403: true }
620
622
  );
621
623
  }
@@ -645,12 +647,12 @@ var ApiClient = class {
645
647
  );
646
648
  }
647
649
  /**
648
- * Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
650
+ * Update creator profile. Requires SIWS token; wallet must match authenticated user.
649
651
  */
650
- updateCreatorProfile(walletAddress, data, clerkToken) {
652
+ updateCreatorProfile(walletAddress, data, siwsToken) {
651
653
  return this.request(
652
654
  `/v1/creators/${this.addr(walletAddress)}/profile`,
653
- { method: "PATCH", body: JSON.stringify(data), headers: this.bearer(clerkToken) }
655
+ { method: "PATCH", body: JSON.stringify(data), headers: this.bearer(siwsToken) }
654
656
  );
655
657
  }
656
658
  // ─── Collection Slug Claims ───────────────────────────────────────────────────
@@ -660,19 +662,19 @@ var ApiClient = class {
660
662
  `/v1/collection-slug-claims/check/${encodeURIComponent(slug.toLowerCase().trim())}`
661
663
  );
662
664
  }
663
- /** Submit a slug claim for a collection. Requires Clerk JWT — caller must be the collection owner. */
664
- submitCollectionSlugClaim(contractAddress, slug, clerkToken, notifyEmail) {
665
+ /** Submit a slug claim for a collection. Requires SIWS token — caller must be the collection owner. */
666
+ submitCollectionSlugClaim(contractAddress, slug, siwsToken, notifyEmail) {
665
667
  return this.request("/v1/collection-slug-claims", {
666
668
  method: "POST",
667
669
  body: JSON.stringify({ contractAddress, slug, notifyEmail }),
668
- headers: this.bearer(clerkToken)
670
+ headers: this.bearer(siwsToken)
669
671
  });
670
672
  }
671
- /** Returns all slug claims submitted by the authenticated wallet. Requires Clerk JWT. */
672
- getMyCollectionSlugClaims(clerkToken) {
673
+ /** Returns all slug claims submitted by the authenticated wallet. Requires SIWS token. */
674
+ getMyCollectionSlugClaims(siwsToken) {
673
675
  return this.request("/v1/collection-slug-claims/me", {
674
676
  method: "GET",
675
- headers: this.bearer(clerkToken)
677
+ headers: this.bearer(siwsToken)
676
678
  });
677
679
  }
678
680
  /** Resolve a collection slug to a full collection. Returns null if not found. */
@@ -685,19 +687,14 @@ var ApiClient = class {
685
687
  }
686
688
  // ─── User Wallet ─────────────────────────────────────────────────────────────
687
689
  /**
688
- * Upsert the authenticated user's wallet address in the backend DB.
689
- * Call after onboarding when ChipiPay confirms the wallet address.
690
- * Requires Clerk JWT; no tenant API key needed.
691
- */
692
- /**
693
- * Frictionless wallet registration. Tenant API key only (no Clerk JWT required).
690
+ * Frictionless wallet registration. Tenant API key only (no SIWS token required).
694
691
  * Idempotent — backend's ensureAccountForWallet upserts and upgrades existing
695
692
  * UNKNOWN walletType rows when a more specific value is supplied.
696
693
  */
697
694
  async registerUser(params) {
698
695
  return this.post("/v1/users/register", params);
699
696
  }
700
- async upsertMyWallet(clerkToken, options = {}) {
697
+ async upsertMyWallet(siwsToken, options = {}) {
701
698
  const body = {
702
699
  walletType: options.walletType ?? "UNKNOWN",
703
700
  appSource: options.appSource ?? "MEDIALANE_SDK"
@@ -709,7 +706,7 @@ var ApiClient = class {
709
706
  return this.request("/v1/users/me", {
710
707
  method: "POST",
711
708
  body: JSON.stringify(body),
712
- headers: this.bearer(clerkToken)
709
+ headers: this.bearer(siwsToken)
713
710
  });
714
711
  }
715
712
  /** Whether an email already has an account attached — used by io's onboarding to branch into an "already exists" message instead of creating a duplicate account. */
@@ -722,12 +719,12 @@ var ApiClient = class {
722
719
  /**
723
720
  * Get the authenticated user's stored wallet address from the backend DB.
724
721
  * Returns null if the user has not completed onboarding yet.
725
- * Requires Clerk JWT; no tenant API key needed.
722
+ * Requires SIWS token; no tenant API key needed.
726
723
  */
727
- getMyWallet(clerkToken) {
724
+ getMyWallet(siwsToken) {
728
725
  return this.request(
729
726
  "/v1/users/me",
730
- { method: "GET", headers: this.bearer(clerkToken) },
727
+ { method: "GET", headers: this.bearer(siwsToken) },
731
728
  { allow404: true }
732
729
  );
733
730
  }
@@ -745,87 +742,87 @@ var ApiClient = class {
745
742
  );
746
743
  }
747
744
  /**
748
- * Submit a custom remix offer for a token. Requires Clerk JWT.
745
+ * Submit a custom remix offer for a token. Requires SIWS token.
749
746
  */
750
- submitRemixOffer(params, clerkToken) {
747
+ submitRemixOffer(params, siwsToken) {
751
748
  return this.request("/v1/remix-offers", {
752
749
  method: "POST",
753
750
  body: JSON.stringify(params),
754
- headers: { "Authorization": `Bearer ${clerkToken}` }
751
+ headers: { "Authorization": `Bearer ${siwsToken}` }
755
752
  });
756
753
  }
757
754
  /**
758
- * Submit an auto remix offer for a token with an open license. Requires Clerk JWT.
755
+ * Submit an auto remix offer for a token with an open license. Requires SIWS token.
759
756
  */
760
- submitAutoRemixOffer(params, clerkToken) {
757
+ submitAutoRemixOffer(params, siwsToken) {
761
758
  return this.request("/v1/remix-offers/auto", {
762
759
  method: "POST",
763
760
  body: JSON.stringify(params),
764
- headers: { "Authorization": `Bearer ${clerkToken}` }
761
+ headers: { "Authorization": `Bearer ${siwsToken}` }
765
762
  });
766
763
  }
767
764
  /**
768
- * Record a self-remix (owner remixing their own token). Requires Clerk JWT.
765
+ * Record a self-remix (owner remixing their own token). Requires SIWS token.
769
766
  */
770
- confirmSelfRemix(params, clerkToken) {
767
+ confirmSelfRemix(params, siwsToken) {
771
768
  return this.request("/v1/remix-offers/self/confirm", {
772
769
  method: "POST",
773
770
  body: JSON.stringify(params),
774
- headers: { "Authorization": `Bearer ${clerkToken}` }
771
+ headers: { "Authorization": `Bearer ${siwsToken}` }
775
772
  });
776
773
  }
777
774
  /**
778
- * List remix offers by role. Requires Clerk JWT.
775
+ * List remix offers by role. Requires SIWS token.
779
776
  * role="creator" — offers where you are the original creator.
780
777
  * role="requester" — offers you made.
781
778
  */
782
- getRemixOffers(query, clerkToken) {
779
+ getRemixOffers(query, siwsToken) {
783
780
  const params = new URLSearchParams({ role: query.role });
784
781
  if (query.page !== void 0) params.set("page", String(query.page));
785
782
  if (query.limit !== void 0) params.set("limit", String(query.limit));
786
783
  return this.request(`/v1/remix-offers?${params}`, {
787
784
  method: "GET",
788
- headers: this.bearer(clerkToken)
785
+ headers: this.bearer(siwsToken)
789
786
  });
790
787
  }
791
788
  /**
792
- * Get a single remix offer. Clerk JWT optional (price/currency hidden for non-participants).
789
+ * Get a single remix offer. SIWS token optional (price/currency hidden for non-participants).
793
790
  */
794
- getRemixOffer(id, clerkToken) {
791
+ getRemixOffer(id, siwsToken) {
795
792
  return this.request(`/v1/remix-offers/${id}`, {
796
793
  method: "GET",
797
- headers: clerkToken ? this.bearer(clerkToken) : void 0
794
+ headers: siwsToken ? this.bearer(siwsToken) : void 0
798
795
  });
799
796
  }
800
797
  /**
801
- * Creator approves a remix offer (authorises the requester to mint). Requires Clerk JWT.
798
+ * Creator approves a remix offer (authorises the requester to mint). Requires SIWS token.
802
799
  */
803
- confirmRemixOffer(id, params, clerkToken) {
800
+ confirmRemixOffer(id, params, siwsToken) {
804
801
  return this.request(`/v1/remix-offers/${id}/confirm`, {
805
802
  method: "POST",
806
803
  body: JSON.stringify(params),
807
- headers: { "Authorization": `Bearer ${clerkToken}` }
804
+ headers: { "Authorization": `Bearer ${siwsToken}` }
808
805
  });
809
806
  }
810
807
  /**
811
- * Creator rejects a remix offer. Requires Clerk JWT.
808
+ * Creator rejects a remix offer. Requires SIWS token.
812
809
  */
813
- rejectRemixOffer(id, clerkToken) {
810
+ rejectRemixOffer(id, siwsToken) {
814
811
  return this.request(`/v1/remix-offers/${id}/reject`, {
815
812
  method: "POST",
816
813
  body: JSON.stringify({}),
817
- headers: { "Authorization": `Bearer ${clerkToken}` }
814
+ headers: { "Authorization": `Bearer ${siwsToken}` }
818
815
  });
819
816
  }
820
817
  /**
821
818
  * Requester extends the expiry of a pending remix offer by 1–30 days.
822
- * Requires Clerk JWT.
819
+ * Requires SIWS token.
823
820
  */
824
- extendRemixOffer(id, days, clerkToken) {
821
+ extendRemixOffer(id, days, siwsToken) {
825
822
  return this.request(`/v1/remix-offers/${id}/extend`, {
826
823
  method: "POST",
827
824
  body: JSON.stringify({ days }),
828
- headers: { "Authorization": `Bearer ${clerkToken}` }
825
+ headers: { "Authorization": `Bearer ${siwsToken}` }
829
826
  });
830
827
  }
831
828
  // ─── POP Protocol ──────────────────────────────────────────────────────────
@@ -863,7 +860,7 @@ var ApiClient = class {
863
860
  /**
864
861
  * Creator-authed coin profile edit (image/description). Backend authorizes
865
862
  * via `coin.creator` (trustless — from the factory event), not a body param;
866
- * `siwsToken` is the caller's SIWS/Clerk bearer token for `identityAuth`.
863
+ * `siwsToken` is the caller's SIWS bearer token for `identityAuth`.
867
864
  */
868
865
  updateCoinProfile(contract, data, siwsToken) {
869
866
  return this.request(`/v1/coins/${this.addr(contract)}`, {