@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
|
@@ -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-
|
|
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';
|
package/dist/starknet/index.d.ts
CHANGED
|
@@ -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-
|
|
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';
|
package/dist/starknet/index.js
CHANGED
|
@@ -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
|
|
326
|
-
bearer(
|
|
327
|
-
return { Authorization: `Bearer ${
|
|
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.
|
|
496
|
-
* via the tenant API key; pass a
|
|
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,
|
|
499
|
-
const extraHeaders =
|
|
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 (
|
|
569
|
+
* Authorization: Bearer (SIWS token) simultaneously.
|
|
568
570
|
*/
|
|
569
|
-
async claimCollection(contractAddress, walletAddress,
|
|
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(
|
|
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
|
|
603
|
+
* Update collection profile. Requires SIWS token for ownership check.
|
|
602
604
|
*/
|
|
603
|
-
updateCollectionProfile(contractAddress, data,
|
|
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(
|
|
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,
|
|
617
|
+
getGatedContent(contractAddress, siwsToken) {
|
|
616
618
|
return this.request(
|
|
617
619
|
`/v1/collections/${this.addr(contractAddress)}/gated-content`,
|
|
618
|
-
{ method: "GET", headers: this.bearer(
|
|
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
|
|
650
|
+
* Update creator profile. Requires SIWS token; wallet must match authenticated user.
|
|
649
651
|
*/
|
|
650
|
-
updateCreatorProfile(walletAddress, data,
|
|
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(
|
|
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
|
|
664
|
-
submitCollectionSlugClaim(contractAddress, slug,
|
|
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(
|
|
670
|
+
headers: this.bearer(siwsToken)
|
|
669
671
|
});
|
|
670
672
|
}
|
|
671
|
-
/** Returns all slug claims submitted by the authenticated wallet. Requires
|
|
672
|
-
getMyCollectionSlugClaims(
|
|
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(
|
|
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
|
-
*
|
|
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(
|
|
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(
|
|
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
|
|
722
|
+
* Requires SIWS token; no tenant API key needed.
|
|
726
723
|
*/
|
|
727
|
-
getMyWallet(
|
|
724
|
+
getMyWallet(siwsToken) {
|
|
728
725
|
return this.request(
|
|
729
726
|
"/v1/users/me",
|
|
730
|
-
{ method: "GET", headers: this.bearer(
|
|
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
|
|
745
|
+
* Submit a custom remix offer for a token. Requires SIWS token.
|
|
749
746
|
*/
|
|
750
|
-
submitRemixOffer(params,
|
|
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 ${
|
|
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
|
|
755
|
+
* Submit an auto remix offer for a token with an open license. Requires SIWS token.
|
|
759
756
|
*/
|
|
760
|
-
submitAutoRemixOffer(params,
|
|
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 ${
|
|
761
|
+
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
765
762
|
});
|
|
766
763
|
}
|
|
767
764
|
/**
|
|
768
|
-
* Record a self-remix (owner remixing their own token). Requires
|
|
765
|
+
* Record a self-remix (owner remixing their own token). Requires SIWS token.
|
|
769
766
|
*/
|
|
770
|
-
confirmSelfRemix(params,
|
|
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 ${
|
|
771
|
+
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
775
772
|
});
|
|
776
773
|
}
|
|
777
774
|
/**
|
|
778
|
-
* List remix offers by role. Requires
|
|
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,
|
|
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(
|
|
785
|
+
headers: this.bearer(siwsToken)
|
|
789
786
|
});
|
|
790
787
|
}
|
|
791
788
|
/**
|
|
792
|
-
* Get a single remix offer.
|
|
789
|
+
* Get a single remix offer. SIWS token optional (price/currency hidden for non-participants).
|
|
793
790
|
*/
|
|
794
|
-
getRemixOffer(id,
|
|
791
|
+
getRemixOffer(id, siwsToken) {
|
|
795
792
|
return this.request(`/v1/remix-offers/${id}`, {
|
|
796
793
|
method: "GET",
|
|
797
|
-
headers:
|
|
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
|
|
798
|
+
* Creator approves a remix offer (authorises the requester to mint). Requires SIWS token.
|
|
802
799
|
*/
|
|
803
|
-
confirmRemixOffer(id, params,
|
|
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 ${
|
|
804
|
+
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
808
805
|
});
|
|
809
806
|
}
|
|
810
807
|
/**
|
|
811
|
-
* Creator rejects a remix offer. Requires
|
|
808
|
+
* Creator rejects a remix offer. Requires SIWS token.
|
|
812
809
|
*/
|
|
813
|
-
rejectRemixOffer(id,
|
|
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 ${
|
|
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
|
|
819
|
+
* Requires SIWS token.
|
|
823
820
|
*/
|
|
824
|
-
extendRemixOffer(id, days,
|
|
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 ${
|
|
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
|
|
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)}`, {
|