@medialane/sdk 0.85.2 → 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-Cm9PVUkA.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-DDAdIU4r.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"
@@ -705,10 +701,11 @@ var ApiClient = class {
705
701
  if (options.chain) body.chain = options.chain;
706
702
  if (options.emailVerificationToken) body.emailVerificationToken = options.emailVerificationToken;
707
703
  if (options.email) body.email = options.email;
704
+ if (options.accountToken) body.accountToken = options.accountToken;
708
705
  return this.request("/v1/users/me", {
709
706
  method: "POST",
710
707
  body: JSON.stringify(body),
711
- headers: this.bearer(clerkToken)
708
+ headers: this.bearer(siwsToken)
712
709
  });
713
710
  }
714
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. */
@@ -721,12 +718,12 @@ var ApiClient = class {
721
718
  /**
722
719
  * Get the authenticated user's stored wallet address from the backend DB.
723
720
  * Returns null if the user has not completed onboarding yet.
724
- * Requires Clerk JWT; no tenant API key needed.
721
+ * Requires SIWS token; no tenant API key needed.
725
722
  */
726
- getMyWallet(clerkToken) {
723
+ getMyWallet(siwsToken) {
727
724
  return this.request(
728
725
  "/v1/users/me",
729
- { method: "GET", headers: this.bearer(clerkToken) },
726
+ { method: "GET", headers: this.bearer(siwsToken) },
730
727
  { allow404: true }
731
728
  );
732
729
  }
@@ -744,87 +741,87 @@ var ApiClient = class {
744
741
  );
745
742
  }
746
743
  /**
747
- * Submit a custom remix offer for a token. Requires Clerk JWT.
744
+ * Submit a custom remix offer for a token. Requires SIWS token.
748
745
  */
749
- submitRemixOffer(params, clerkToken) {
746
+ submitRemixOffer(params, siwsToken) {
750
747
  return this.request("/v1/remix-offers", {
751
748
  method: "POST",
752
749
  body: JSON.stringify(params),
753
- headers: { "Authorization": `Bearer ${clerkToken}` }
750
+ headers: { "Authorization": `Bearer ${siwsToken}` }
754
751
  });
755
752
  }
756
753
  /**
757
- * 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.
758
755
  */
759
- submitAutoRemixOffer(params, clerkToken) {
756
+ submitAutoRemixOffer(params, siwsToken) {
760
757
  return this.request("/v1/remix-offers/auto", {
761
758
  method: "POST",
762
759
  body: JSON.stringify(params),
763
- headers: { "Authorization": `Bearer ${clerkToken}` }
760
+ headers: { "Authorization": `Bearer ${siwsToken}` }
764
761
  });
765
762
  }
766
763
  /**
767
- * 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.
768
765
  */
769
- confirmSelfRemix(params, clerkToken) {
766
+ confirmSelfRemix(params, siwsToken) {
770
767
  return this.request("/v1/remix-offers/self/confirm", {
771
768
  method: "POST",
772
769
  body: JSON.stringify(params),
773
- headers: { "Authorization": `Bearer ${clerkToken}` }
770
+ headers: { "Authorization": `Bearer ${siwsToken}` }
774
771
  });
775
772
  }
776
773
  /**
777
- * List remix offers by role. Requires Clerk JWT.
774
+ * List remix offers by role. Requires SIWS token.
778
775
  * role="creator" — offers where you are the original creator.
779
776
  * role="requester" — offers you made.
780
777
  */
781
- getRemixOffers(query, clerkToken) {
778
+ getRemixOffers(query, siwsToken) {
782
779
  const params = new URLSearchParams({ role: query.role });
783
780
  if (query.page !== void 0) params.set("page", String(query.page));
784
781
  if (query.limit !== void 0) params.set("limit", String(query.limit));
785
782
  return this.request(`/v1/remix-offers?${params}`, {
786
783
  method: "GET",
787
- headers: this.bearer(clerkToken)
784
+ headers: this.bearer(siwsToken)
788
785
  });
789
786
  }
790
787
  /**
791
- * 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).
792
789
  */
793
- getRemixOffer(id, clerkToken) {
790
+ getRemixOffer(id, siwsToken) {
794
791
  return this.request(`/v1/remix-offers/${id}`, {
795
792
  method: "GET",
796
- headers: clerkToken ? this.bearer(clerkToken) : void 0
793
+ headers: siwsToken ? this.bearer(siwsToken) : void 0
797
794
  });
798
795
  }
799
796
  /**
800
- * 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.
801
798
  */
802
- confirmRemixOffer(id, params, clerkToken) {
799
+ confirmRemixOffer(id, params, siwsToken) {
803
800
  return this.request(`/v1/remix-offers/${id}/confirm`, {
804
801
  method: "POST",
805
802
  body: JSON.stringify(params),
806
- headers: { "Authorization": `Bearer ${clerkToken}` }
803
+ headers: { "Authorization": `Bearer ${siwsToken}` }
807
804
  });
808
805
  }
809
806
  /**
810
- * Creator rejects a remix offer. Requires Clerk JWT.
807
+ * Creator rejects a remix offer. Requires SIWS token.
811
808
  */
812
- rejectRemixOffer(id, clerkToken) {
809
+ rejectRemixOffer(id, siwsToken) {
813
810
  return this.request(`/v1/remix-offers/${id}/reject`, {
814
811
  method: "POST",
815
812
  body: JSON.stringify({}),
816
- headers: { "Authorization": `Bearer ${clerkToken}` }
813
+ headers: { "Authorization": `Bearer ${siwsToken}` }
817
814
  });
818
815
  }
819
816
  /**
820
817
  * Requester extends the expiry of a pending remix offer by 1–30 days.
821
- * Requires Clerk JWT.
818
+ * Requires SIWS token.
822
819
  */
823
- extendRemixOffer(id, days, clerkToken) {
820
+ extendRemixOffer(id, days, siwsToken) {
824
821
  return this.request(`/v1/remix-offers/${id}/extend`, {
825
822
  method: "POST",
826
823
  body: JSON.stringify({ days }),
827
- headers: { "Authorization": `Bearer ${clerkToken}` }
824
+ headers: { "Authorization": `Bearer ${siwsToken}` }
828
825
  });
829
826
  }
830
827
  // ─── POP Protocol ──────────────────────────────────────────────────────────
@@ -862,7 +859,7 @@ var ApiClient = class {
862
859
  /**
863
860
  * Creator-authed coin profile edit (image/description). Backend authorizes
864
861
  * via `coin.creator` (trustless — from the factory event), not a body param;
865
- * `siwsToken` is the caller's SIWS/Clerk bearer token for `identityAuth`.
862
+ * `siwsToken` is the caller's SIWS bearer token for `identityAuth`.
866
863
  */
867
864
  updateCoinProfile(contract, data, siwsToken) {
868
865
  return this.request(`/v1/coins/${this.addr(contract)}`, {