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