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