@medialane/sdk 0.85.3 → 0.85.4

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-D8saJqJw.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-CovenF1m.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 = {}) {
@@ -394,6 +394,7 @@ var ApiClient = class {
394
394
  getActivities(query = {}) {
395
395
  const params = new URLSearchParams();
396
396
  if (query.type) params.set("type", query.type);
397
+ if (query.contract) params.set("contract", query.contract);
397
398
  if (query.page !== void 0) params.set("page", String(query.page));
398
399
  if (query.limit !== void 0) params.set("limit", String(query.limit));
399
400
  if (query.chain) params.set("chain", query.chain);
@@ -492,11 +493,11 @@ var ApiClient = class {
492
493
  }
493
494
  /**
494
495
  * 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.
496
+ * to a buyer's active bid. siwsToken is optional — the endpoint authenticates
497
+ * via the tenant API key; pass a SIWS token only if your backend requires it.
497
498
  */
498
- createCounterOfferIntent(params, clerkToken) {
499
- const extraHeaders = clerkToken ? { "Authorization": `Bearer ${clerkToken}` } : {};
499
+ createCounterOfferIntent(params, siwsToken) {
500
+ const extraHeaders = siwsToken ? { "Authorization": `Bearer ${siwsToken}` } : {};
500
501
  return this.request("/v1/intents/counter-offer", {
501
502
  method: "POST",
502
503
  body: JSON.stringify(params),
@@ -564,13 +565,13 @@ var ApiClient = class {
564
565
  // ─── Collection Claims ──────────────────────────────────────────────────────
565
566
  /**
566
567
  * Path 1: On-chain auto claim. Sends both x-api-key (tenant auth) and
567
- * Authorization: Bearer (Clerk JWT) simultaneously.
568
+ * Authorization: Bearer (SIWS token) simultaneously.
568
569
  */
569
- async claimCollection(contractAddress, walletAddress, clerkToken) {
570
+ async claimCollection(contractAddress, walletAddress, siwsToken) {
570
571
  return this.request("/v1/collections/claim", {
571
572
  method: "POST",
572
573
  body: JSON.stringify({ contractAddress, walletAddress }),
573
- headers: this.bearer(clerkToken)
574
+ headers: this.bearer(siwsToken)
574
575
  });
575
576
  }
576
577
  /**
@@ -598,12 +599,12 @@ var ApiClient = class {
598
599
  );
599
600
  }
600
601
  /**
601
- * Update collection profile. Requires Clerk JWT for ownership check.
602
+ * Update collection profile. Requires SIWS token for ownership check.
602
603
  */
603
- updateCollectionProfile(contractAddress, data, clerkToken) {
604
+ updateCollectionProfile(contractAddress, data, siwsToken) {
604
605
  return this.request(
605
606
  `/v1/collections/${this.addr(contractAddress)}/profile`,
606
- { method: "PATCH", body: JSON.stringify(data), headers: this.bearer(clerkToken) }
607
+ { method: "PATCH", body: JSON.stringify(data), headers: this.bearer(siwsToken) }
607
608
  );
608
609
  }
609
610
  /** No signature required — wallet activity is public on-chain data, read like any other /v1 GET. */
@@ -612,10 +613,10 @@ var ApiClient = class {
612
613
  `/v1/wallet-activity?address=${this.addr(address)}&chain=${chain}`
613
614
  );
614
615
  }
615
- getGatedContent(contractAddress, clerkToken) {
616
+ getGatedContent(contractAddress, siwsToken) {
616
617
  return this.request(
617
618
  `/v1/collections/${this.addr(contractAddress)}/gated-content`,
618
- { method: "GET", headers: this.bearer(clerkToken) },
619
+ { method: "GET", headers: this.bearer(siwsToken) },
619
620
  { allow404: true, allow403: true }
620
621
  );
621
622
  }
@@ -645,12 +646,12 @@ var ApiClient = class {
645
646
  );
646
647
  }
647
648
  /**
648
- * Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
649
+ * Update creator profile. Requires SIWS token; wallet must match authenticated user.
649
650
  */
650
- updateCreatorProfile(walletAddress, data, clerkToken) {
651
+ updateCreatorProfile(walletAddress, data, siwsToken) {
651
652
  return this.request(
652
653
  `/v1/creators/${this.addr(walletAddress)}/profile`,
653
- { method: "PATCH", body: JSON.stringify(data), headers: this.bearer(clerkToken) }
654
+ { method: "PATCH", body: JSON.stringify(data), headers: this.bearer(siwsToken) }
654
655
  );
655
656
  }
656
657
  // ─── Collection Slug Claims ───────────────────────────────────────────────────
@@ -660,19 +661,19 @@ var ApiClient = class {
660
661
  `/v1/collection-slug-claims/check/${encodeURIComponent(slug.toLowerCase().trim())}`
661
662
  );
662
663
  }
663
- /** Submit a slug claim for a collection. Requires Clerk JWT — caller must be the collection owner. */
664
- submitCollectionSlugClaim(contractAddress, slug, clerkToken, notifyEmail) {
664
+ /** Submit a slug claim for a collection. Requires SIWS token — caller must be the collection owner. */
665
+ submitCollectionSlugClaim(contractAddress, slug, siwsToken, notifyEmail) {
665
666
  return this.request("/v1/collection-slug-claims", {
666
667
  method: "POST",
667
668
  body: JSON.stringify({ contractAddress, slug, notifyEmail }),
668
- headers: this.bearer(clerkToken)
669
+ headers: this.bearer(siwsToken)
669
670
  });
670
671
  }
671
- /** Returns all slug claims submitted by the authenticated wallet. Requires Clerk JWT. */
672
- getMyCollectionSlugClaims(clerkToken) {
672
+ /** Returns all slug claims submitted by the authenticated wallet. Requires SIWS token. */
673
+ getMyCollectionSlugClaims(siwsToken) {
673
674
  return this.request("/v1/collection-slug-claims/me", {
674
675
  method: "GET",
675
- headers: this.bearer(clerkToken)
676
+ headers: this.bearer(siwsToken)
676
677
  });
677
678
  }
678
679
  /** Resolve a collection slug to a full collection. Returns null if not found. */
@@ -685,19 +686,14 @@ var ApiClient = class {
685
686
  }
686
687
  // ─── User Wallet ─────────────────────────────────────────────────────────────
687
688
  /**
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).
689
+ * Frictionless wallet registration. Tenant API key only (no SIWS token required).
694
690
  * Idempotent — backend's ensureAccountForWallet upserts and upgrades existing
695
691
  * UNKNOWN walletType rows when a more specific value is supplied.
696
692
  */
697
693
  async registerUser(params) {
698
694
  return this.post("/v1/users/register", params);
699
695
  }
700
- async upsertMyWallet(clerkToken, options = {}) {
696
+ async upsertMyWallet(siwsToken, options = {}) {
701
697
  const body = {
702
698
  walletType: options.walletType ?? "UNKNOWN",
703
699
  appSource: options.appSource ?? "MEDIALANE_SDK"
@@ -709,7 +705,7 @@ var ApiClient = class {
709
705
  return this.request("/v1/users/me", {
710
706
  method: "POST",
711
707
  body: JSON.stringify(body),
712
- headers: this.bearer(clerkToken)
708
+ headers: this.bearer(siwsToken)
713
709
  });
714
710
  }
715
711
  /** 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 +718,12 @@ var ApiClient = class {
722
718
  /**
723
719
  * Get the authenticated user's stored wallet address from the backend DB.
724
720
  * Returns null if the user has not completed onboarding yet.
725
- * Requires Clerk JWT; no tenant API key needed.
721
+ * Requires SIWS token; no tenant API key needed.
726
722
  */
727
- getMyWallet(clerkToken) {
723
+ getMyWallet(siwsToken) {
728
724
  return this.request(
729
725
  "/v1/users/me",
730
- { method: "GET", headers: this.bearer(clerkToken) },
726
+ { method: "GET", headers: this.bearer(siwsToken) },
731
727
  { allow404: true }
732
728
  );
733
729
  }
@@ -745,87 +741,87 @@ var ApiClient = class {
745
741
  );
746
742
  }
747
743
  /**
748
- * Submit a custom remix offer for a token. Requires Clerk JWT.
744
+ * Submit a custom remix offer for a token. Requires SIWS token.
749
745
  */
750
- submitRemixOffer(params, clerkToken) {
746
+ submitRemixOffer(params, siwsToken) {
751
747
  return this.request("/v1/remix-offers", {
752
748
  method: "POST",
753
749
  body: JSON.stringify(params),
754
- headers: { "Authorization": `Bearer ${clerkToken}` }
750
+ headers: { "Authorization": `Bearer ${siwsToken}` }
755
751
  });
756
752
  }
757
753
  /**
758
- * Submit an auto remix offer for a token with an open license. Requires Clerk JWT.
754
+ * Submit an auto remix offer for a token with an open license. Requires SIWS token.
759
755
  */
760
- submitAutoRemixOffer(params, clerkToken) {
756
+ submitAutoRemixOffer(params, siwsToken) {
761
757
  return this.request("/v1/remix-offers/auto", {
762
758
  method: "POST",
763
759
  body: JSON.stringify(params),
764
- headers: { "Authorization": `Bearer ${clerkToken}` }
760
+ headers: { "Authorization": `Bearer ${siwsToken}` }
765
761
  });
766
762
  }
767
763
  /**
768
- * Record a self-remix (owner remixing their own token). Requires Clerk JWT.
764
+ * Record a self-remix (owner remixing their own token). Requires SIWS token.
769
765
  */
770
- confirmSelfRemix(params, clerkToken) {
766
+ confirmSelfRemix(params, siwsToken) {
771
767
  return this.request("/v1/remix-offers/self/confirm", {
772
768
  method: "POST",
773
769
  body: JSON.stringify(params),
774
- headers: { "Authorization": `Bearer ${clerkToken}` }
770
+ headers: { "Authorization": `Bearer ${siwsToken}` }
775
771
  });
776
772
  }
777
773
  /**
778
- * List remix offers by role. Requires Clerk JWT.
774
+ * List remix offers by role. Requires SIWS token.
779
775
  * role="creator" — offers where you are the original creator.
780
776
  * role="requester" — offers you made.
781
777
  */
782
- getRemixOffers(query, clerkToken) {
778
+ getRemixOffers(query, siwsToken) {
783
779
  const params = new URLSearchParams({ role: query.role });
784
780
  if (query.page !== void 0) params.set("page", String(query.page));
785
781
  if (query.limit !== void 0) params.set("limit", String(query.limit));
786
782
  return this.request(`/v1/remix-offers?${params}`, {
787
783
  method: "GET",
788
- headers: this.bearer(clerkToken)
784
+ headers: this.bearer(siwsToken)
789
785
  });
790
786
  }
791
787
  /**
792
- * Get a single remix offer. Clerk JWT optional (price/currency hidden for non-participants).
788
+ * Get a single remix offer. SIWS token optional (price/currency hidden for non-participants).
793
789
  */
794
- getRemixOffer(id, clerkToken) {
790
+ getRemixOffer(id, siwsToken) {
795
791
  return this.request(`/v1/remix-offers/${id}`, {
796
792
  method: "GET",
797
- headers: clerkToken ? this.bearer(clerkToken) : void 0
793
+ headers: siwsToken ? this.bearer(siwsToken) : void 0
798
794
  });
799
795
  }
800
796
  /**
801
- * Creator approves a remix offer (authorises the requester to mint). Requires Clerk JWT.
797
+ * Creator approves a remix offer (authorises the requester to mint). Requires SIWS token.
802
798
  */
803
- confirmRemixOffer(id, params, clerkToken) {
799
+ confirmRemixOffer(id, params, siwsToken) {
804
800
  return this.request(`/v1/remix-offers/${id}/confirm`, {
805
801
  method: "POST",
806
802
  body: JSON.stringify(params),
807
- headers: { "Authorization": `Bearer ${clerkToken}` }
803
+ headers: { "Authorization": `Bearer ${siwsToken}` }
808
804
  });
809
805
  }
810
806
  /**
811
- * Creator rejects a remix offer. Requires Clerk JWT.
807
+ * Creator rejects a remix offer. Requires SIWS token.
812
808
  */
813
- rejectRemixOffer(id, clerkToken) {
809
+ rejectRemixOffer(id, siwsToken) {
814
810
  return this.request(`/v1/remix-offers/${id}/reject`, {
815
811
  method: "POST",
816
812
  body: JSON.stringify({}),
817
- headers: { "Authorization": `Bearer ${clerkToken}` }
813
+ headers: { "Authorization": `Bearer ${siwsToken}` }
818
814
  });
819
815
  }
820
816
  /**
821
817
  * Requester extends the expiry of a pending remix offer by 1–30 days.
822
- * Requires Clerk JWT.
818
+ * Requires SIWS token.
823
819
  */
824
- extendRemixOffer(id, days, clerkToken) {
820
+ extendRemixOffer(id, days, siwsToken) {
825
821
  return this.request(`/v1/remix-offers/${id}/extend`, {
826
822
  method: "POST",
827
823
  body: JSON.stringify({ days }),
828
- headers: { "Authorization": `Bearer ${clerkToken}` }
824
+ headers: { "Authorization": `Bearer ${siwsToken}` }
829
825
  });
830
826
  }
831
827
  // ─── POP Protocol ──────────────────────────────────────────────────────────
@@ -863,7 +859,7 @@ var ApiClient = class {
863
859
  /**
864
860
  * Creator-authed coin profile edit (image/description). Backend authorizes
865
861
  * via `coin.creator` (trustless — from the factory event), not a body param;
866
- * `siwsToken` is the caller's SIWS/Clerk bearer token for `identityAuth`.
862
+ * `siwsToken` is the caller's SIWS bearer token for `identityAuth`.
867
863
  */
868
864
  updateCoinProfile(contract, data, siwsToken) {
869
865
  return this.request(`/v1/coins/${this.addr(contract)}`, {