@medialane/sdk 0.135.0 → 0.137.0

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,5 +1,5 @@
1
- import { bD as ResolvedConfig, bL as TxResult, aY as CreatePopCollectionParams, aJ as ClaimConditions, aU as CreateDropParams, b1 as CreateTicketParams, bn as MintTicketsParams, aW as CreateMembershipParams, bm as MintMembershipsParams, a$ as CreateSponsorshipOfferParams, bA as ProposeSponsorshipParams, k as ApiClient, bk as MedialaneConfig, bl as MedialaneErrorCode, bs as OrderDetails, R as ResolvedFeeConfig, H as ApiFundingIntent, G as ApiFundingInstructions, K as ApiFundingSubmit, M as ApiIntentCreated, bT as SealedOwner, bU as ReceiptProviderLike, bV as WalletExecutor, bW as ExecutedTransaction, bX as PasskeyOwner } from '../errors-BQGalSIU.cjs';
2
- export { bY as CreatedOwner, bZ as OwnerSigner, bv as PasskeyCancelledError, b_ as PasskeyConfig, bN as UserFacingError, b$ as createPasskeyOwner } from '../errors-BQGalSIU.cjs';
1
+ import { bG as ResolvedConfig, bO as TxResult, a$ as CreatePopCollectionParams, aM as ClaimConditions, aX as CreateDropParams, b4 as CreateTicketParams, bq as MintTicketsParams, aZ as CreateMembershipParams, bp as MintMembershipsParams, b2 as CreateSponsorshipOfferParams, bD as ProposeSponsorshipParams, k as ApiClient, bn as MedialaneConfig, bo as MedialaneErrorCode, bv as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, bW as SealedOwner, bX as ReceiptProviderLike, bY as WalletExecutor, bZ as ExecutedTransaction, b_ as PasskeyOwner } from '../errors-Ca-A70L7.cjs';
2
+ export { b$ as CreatedOwner, c0 as OwnerSigner, by as PasskeyCancelledError, c1 as PasskeyConfig, bQ as UserFacingError, c2 as createPasskeyOwner } from '../errors-Ca-A70L7.cjs';
3
3
  import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
4
4
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-CuSlc_YE.cjs';
5
5
  import 'zod';
@@ -1,5 +1,5 @@
1
- import { bD as ResolvedConfig, bL as TxResult, aY as CreatePopCollectionParams, aJ as ClaimConditions, aU as CreateDropParams, b1 as CreateTicketParams, bn as MintTicketsParams, aW as CreateMembershipParams, bm as MintMembershipsParams, a$ as CreateSponsorshipOfferParams, bA as ProposeSponsorshipParams, k as ApiClient, bk as MedialaneConfig, bl as MedialaneErrorCode, bs as OrderDetails, R as ResolvedFeeConfig, H as ApiFundingIntent, G as ApiFundingInstructions, K as ApiFundingSubmit, M as ApiIntentCreated, bT as SealedOwner, bU as ReceiptProviderLike, bV as WalletExecutor, bW as ExecutedTransaction, bX as PasskeyOwner } from '../errors-BsNfDL85.js';
2
- export { bY as CreatedOwner, bZ as OwnerSigner, bv as PasskeyCancelledError, b_ as PasskeyConfig, bN as UserFacingError, b$ as createPasskeyOwner } from '../errors-BsNfDL85.js';
1
+ import { bG as ResolvedConfig, bO as TxResult, a$ as CreatePopCollectionParams, aM as ClaimConditions, aX as CreateDropParams, b4 as CreateTicketParams, bq as MintTicketsParams, aZ as CreateMembershipParams, bp as MintMembershipsParams, b2 as CreateSponsorshipOfferParams, bD as ProposeSponsorshipParams, k as ApiClient, bn as MedialaneConfig, bo as MedialaneErrorCode, bv as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, bW as SealedOwner, bX as ReceiptProviderLike, bY as WalletExecutor, bZ as ExecutedTransaction, b_ as PasskeyOwner } from '../errors-CC1H8Usc.js';
2
+ export { b$ as CreatedOwner, c0 as OwnerSigner, by as PasskeyCancelledError, c1 as PasskeyConfig, bQ as UserFacingError, c2 as createPasskeyOwner } from '../errors-CC1H8Usc.js';
3
3
  import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
4
4
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-CuSlc_YE.js';
5
5
  import 'zod';
@@ -729,12 +729,13 @@ var ApiClient = class {
729
729
  headers: this.bearer(siwsToken)
730
730
  });
731
731
  }
732
- getCollectionBySlug(slug) {
733
- return this.request(
732
+ async getCollectionBySlug(slug) {
733
+ const res = await this.request(
734
734
  `/v1/collections/by-slug/${encodeURIComponent(slug.toLowerCase().trim())}`,
735
735
  { method: "GET" },
736
736
  { allow404: true }
737
737
  );
738
+ return res?.data ?? null;
738
739
  }
739
740
  async registerUser(params) {
740
741
  return this.post("/v1/users/register", params);
@@ -821,6 +822,7 @@ var ApiClient = class {
821
822
  }
822
823
  getRemixOffers(query, siwsToken) {
823
824
  const params = new URLSearchParams({ role: query.role });
825
+ if (query.status) params.set("status", query.status);
824
826
  if (query.page !== void 0) params.set("page", String(query.page));
825
827
  if (query.limit !== void 0) params.set("limit", String(query.limit));
826
828
  return this.request(`/v1/remix-offers?${params}`, {
@@ -877,6 +879,7 @@ var ApiClient = class {
877
879
  if (opts.limit) params.set("limit", String(opts.limit));
878
880
  if (opts.service) params.set("service", opts.service);
879
881
  if (opts.sort) params.set("sort", opts.sort);
882
+ if (opts.creator) params.set("creator", this.addr(opts.creator));
880
883
  if (opts.chain) params.set("chain", opts.chain);
881
884
  const qs = params.toString();
882
885
  return this.get(`/v1/coins${qs ? `?${qs}` : ""}`);
@@ -987,12 +990,41 @@ var ApiClient = class {
987
990
  return res.claim;
988
991
  }
989
992
  async submitReport(report, siwsToken) {
993
+ const targetContract = report.targetContract ? this.addr(report.targetContract) : void 0;
994
+ const targetAddress = report.targetAddress ? this.addr(report.targetAddress) : void 0;
995
+ let targetKey = null;
996
+ if (report.targetType === "TOKEN" && targetContract && report.targetTokenId) {
997
+ targetKey = `TOKEN:${targetContract}:${report.targetTokenId}`;
998
+ } else if (report.targetType === "COLLECTION" && targetContract) {
999
+ targetKey = `COLLECTION:${targetContract}`;
1000
+ } else if (report.targetType === "CREATOR" && targetAddress) {
1001
+ targetKey = `CREATOR:${targetAddress}`;
1002
+ } else if (report.targetType === "COMMENT" && report.targetId) {
1003
+ targetKey = `COMMENT::${report.targetId}`;
1004
+ }
1005
+ if (!targetKey) throw new Error(`A ${report.targetType} report needs its target`);
990
1006
  await this.request("/v1/reports", {
991
1007
  method: "POST",
992
1008
  headers: this.bearer(siwsToken),
993
- body: JSON.stringify(report)
1009
+ body: JSON.stringify({ ...report, targetKey, targetContract, targetAddress })
994
1010
  });
995
1011
  }
1012
+ getPricing() {
1013
+ return this.get("/v1/pricing");
1014
+ }
1015
+ listCollections(query = {}) {
1016
+ const params = new URLSearchParams();
1017
+ if (query.page !== void 0) params.set("page", String(query.page));
1018
+ if (query.limit !== void 0) params.set("limit", String(query.limit));
1019
+ if (query.owner) params.set("owner", this.addr(query.owner));
1020
+ if (query.service) params.set("service", query.service);
1021
+ if (query.sort) params.set("sort", query.sort);
1022
+ if (query.isFeatured !== void 0) params.set("isFeatured", String(query.isFeatured));
1023
+ if (query.hideEmpty !== void 0) params.set("hideEmpty", String(query.hideEmpty));
1024
+ if (query.chain) params.set("chain", query.chain);
1025
+ const qs = params.toString();
1026
+ return this.get(`/v1/collections${qs ? `?${qs}` : ""}`);
1027
+ }
996
1028
  generateWallet(newWalletSiwsToken, siwsToken) {
997
1029
  return this.request("/v1/users/me/generate-wallet", {
998
1030
  method: "POST",
@@ -1014,6 +1046,22 @@ var ApiClient = class {
1014
1046
  if (query.open !== void 0) params.set("open", String(query.open));
1015
1047
  return this.get(`/v1/sponsorship/offers?${params}`);
1016
1048
  }
1049
+ async getSponsorshipOffer(offerId) {
1050
+ const res = await this.request(
1051
+ `/v1/sponsorship/offers/${encodeURIComponent(offerId)}`,
1052
+ { method: "GET" },
1053
+ { allow404: true }
1054
+ );
1055
+ return res?.data ?? null;
1056
+ }
1057
+ async getSponsorshipProposal(proposalId) {
1058
+ const res = await this.request(
1059
+ `/v1/sponsorship/proposals/${encodeURIComponent(proposalId)}`,
1060
+ { method: "GET" },
1061
+ { allow404: true }
1062
+ );
1063
+ return res?.data ?? null;
1064
+ }
1017
1065
  async getSponsorshipBids(offerId) {
1018
1066
  const res = await this.get(`/v1/sponsorship/offers/${encodeURIComponent(offerId)}/bids`);
1019
1067
  return res.data;