@medialane/sdk 0.134.0 → 0.135.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 { bm as ResolvedConfig, bu as TxResult, aH as CreatePopCollectionParams, as as ClaimConditions, aD as CreateDropParams, aM as CreateTicketParams, b6 as MintTicketsParams, aF as CreateMembershipParams, b5 as MintMembershipsParams, aK as CreateSponsorshipOfferParams, bj as ProposeSponsorshipParams, k as ApiClient, b3 as MedialaneConfig, b4 as MedialaneErrorCode, bb as OrderDetails, R as ResolvedFeeConfig, E as ApiFundingIntent, D as ApiFundingInstructions, H as ApiFundingSubmit, J as ApiIntentCreated, bC as SealedOwner, bD as ReceiptProviderLike, bE as WalletExecutor, bF as ExecutedTransaction, bG as PasskeyOwner } from '../errors-BpiH1lap.cjs';
2
- export { bH as CreatedOwner, bI as OwnerSigner, be as PasskeyCancelledError, bJ as PasskeyConfig, bw as UserFacingError, bK as createPasskeyOwner } from '../errors-BpiH1lap.cjs';
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';
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 { bm as ResolvedConfig, bu as TxResult, aH as CreatePopCollectionParams, as as ClaimConditions, aD as CreateDropParams, aM as CreateTicketParams, b6 as MintTicketsParams, aF as CreateMembershipParams, b5 as MintMembershipsParams, aK as CreateSponsorshipOfferParams, bj as ProposeSponsorshipParams, k as ApiClient, b3 as MedialaneConfig, b4 as MedialaneErrorCode, bb as OrderDetails, R as ResolvedFeeConfig, E as ApiFundingIntent, D as ApiFundingInstructions, H as ApiFundingSubmit, J as ApiIntentCreated, bC as SealedOwner, bD as ReceiptProviderLike, bE as WalletExecutor, bF as ExecutedTransaction, bG as PasskeyOwner } from '../errors-BsiYot6M.js';
2
- export { bH as CreatedOwner, bI as OwnerSigner, be as PasskeyCancelledError, bJ as PasskeyConfig, bw as UserFacingError, bK as createPasskeyOwner } from '../errors-BsiYot6M.js';
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';
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';
@@ -348,6 +348,11 @@ var ApiClient = class {
348
348
  getActiveOrdersForToken(contract, tokenId) {
349
349
  return this.get(`/v1/orders/token/${this.addr(contract)}/${tokenId}`);
350
350
  }
351
+ /** Offers others made on the address's assets. */
352
+ getReceivedOffers(address, opts = {}) {
353
+ const params = new URLSearchParams({ page: String(opts.page ?? 1), limit: String(opts.limit ?? 50) });
354
+ return this.get(`/v1/orders/received/${this.addr(address)}?${params}`);
355
+ }
351
356
  getOrdersByUser(address, page = 1, limit = 20) {
352
357
  return this.get(
353
358
  `/v1/orders/user/${this.addr(address)}?page=${page}&limit=${limit}`
@@ -515,6 +520,11 @@ var ApiClient = class {
515
520
  uploadMetadata(metadata) {
516
521
  return this.post("/v1/metadata/upload", metadata);
517
522
  }
523
+ /** Pins several JSON files as one IPFS directory, e.g. a drop's token metadata. */
524
+ async uploadMetadataDirectory(files) {
525
+ const res = await this.post("/v1/metadata/upload-directory", { files });
526
+ return res.data;
527
+ }
518
528
  resolveMetadata(uri) {
519
529
  const params = new URLSearchParams({ uri });
520
530
  return this.get(`/v1/metadata/resolve?${params.toString()}`);
@@ -846,7 +856,7 @@ var ApiClient = class {
846
856
  });
847
857
  }
848
858
  getPopCollections(opts = {}) {
849
- return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "POP_PROTOCOL");
859
+ return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "pop-protocol");
850
860
  }
851
861
  async getPopEligibility(collection, wallet) {
852
862
  const res = await this.get(
@@ -866,6 +876,7 @@ var ApiClient = class {
866
876
  if (opts.page) params.set("page", String(opts.page));
867
877
  if (opts.limit) params.set("limit", String(opts.limit));
868
878
  if (opts.service) params.set("service", opts.service);
879
+ if (opts.sort) params.set("sort", opts.sort);
869
880
  if (opts.chain) params.set("chain", opts.chain);
870
881
  const qs = params.toString();
871
882
  return this.get(`/v1/coins${qs ? `?${qs}` : ""}`);
@@ -896,7 +907,7 @@ var ApiClient = class {
896
907
  });
897
908
  }
898
909
  getDropCollections(opts = {}) {
899
- return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "COLLECTION_DROP");
910
+ return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "drop-collection");
900
911
  }
901
912
  async getDropMintStatus(collection, wallet) {
902
913
  const res = await this.get(
@@ -904,6 +915,123 @@ var ApiClient = class {
904
915
  );
905
916
  return res.data;
906
917
  }
918
+ async getDropInfo(contract) {
919
+ const res = await this.request(
920
+ `/v1/drop/${this.addr(contract)}/info`,
921
+ { method: "GET" },
922
+ { allow404: true }
923
+ );
924
+ return res?.data ?? null;
925
+ }
926
+ async getDropState(contract) {
927
+ const res = await this.get(`/v1/drop/${this.addr(contract)}/state`);
928
+ return res.data;
929
+ }
930
+ async getTicket(contract, tokenId) {
931
+ const res = await this.get(`/v1/tickets/${this.addr(contract)}/${tokenId}`);
932
+ return res.data;
933
+ }
934
+ async getTicketCount(contract) {
935
+ const res = await this.get(`/v1/tickets/${this.addr(contract)}/count`);
936
+ return res.data.count;
937
+ }
938
+ async getClubMembership(contract, tokenId) {
939
+ const res = await this.get(`/v1/club/${this.addr(contract)}/${tokenId}`);
940
+ return res.data;
941
+ }
942
+ async isClubMember(contract, tokenId, wallet) {
943
+ const res = await this.get(
944
+ `/v1/club/${this.addr(contract)}/${tokenId}/member/${this.addr(wallet)}`
945
+ );
946
+ return res.data.isMember;
947
+ }
948
+ async getIpNftTokenData(contract, tokenId) {
949
+ const res = await this.get(`/v1/ipnft/${this.addr(contract)}/${tokenId}`);
950
+ return res.data;
951
+ }
952
+ async getPlatformStats() {
953
+ const res = await this.get("/v1/stats");
954
+ return res.data;
955
+ }
956
+ getTokens(query = {}) {
957
+ const params = new URLSearchParams();
958
+ if (query.page !== void 0) params.set("page", String(query.page));
959
+ if (query.limit !== void 0) params.set("limit", String(query.limit));
960
+ if (query.sort) params.set("sort", query.sort);
961
+ if (query.ipType) params.set("ipType", query.ipType);
962
+ if (query.derivatives) params.set("derivatives", query.derivatives);
963
+ const qs = params.toString();
964
+ return this.get(`/v1/tokens${qs ? `?${qs}` : ""}`);
965
+ }
966
+ async isCreatorHidden(wallet) {
967
+ const res = await this.get(`/v1/creators/${this.addr(wallet)}/hidden`);
968
+ return res.isHidden;
969
+ }
970
+ getMyUsernameClaim(siwsToken) {
971
+ return this.request("/v1/username-claims/me", {
972
+ method: "GET",
973
+ headers: this.bearer(siwsToken)
974
+ });
975
+ }
976
+ checkUsernameAvailability(username) {
977
+ return this.get(
978
+ `/v1/username-claims/check/${encodeURIComponent(username)}`
979
+ );
980
+ }
981
+ async submitUsernameClaim(username, siwsToken, notifyEmail) {
982
+ const res = await this.request("/v1/username-claims", {
983
+ method: "POST",
984
+ headers: this.bearer(siwsToken),
985
+ body: JSON.stringify({ username, ...notifyEmail ? { notifyEmail } : {} })
986
+ });
987
+ return res.claim;
988
+ }
989
+ async submitReport(report, siwsToken) {
990
+ await this.request("/v1/reports", {
991
+ method: "POST",
992
+ headers: this.bearer(siwsToken),
993
+ body: JSON.stringify(report)
994
+ });
995
+ }
996
+ generateWallet(newWalletSiwsToken, siwsToken) {
997
+ return this.request("/v1/users/me/generate-wallet", {
998
+ method: "POST",
999
+ headers: this.bearer(siwsToken),
1000
+ body: JSON.stringify({ newWalletSiwsToken })
1001
+ });
1002
+ }
1003
+ syncCoin(coinAddress, owner) {
1004
+ return this.post("/v1/coins/sync", { coinAddress, ...owner ? { owner } : {} });
1005
+ }
1006
+ registerCollection(contractAddress) {
1007
+ return this.post("/v1/collections/register", { contractAddress });
1008
+ }
1009
+ getSponsorshipOffers(query = {}) {
1010
+ const params = new URLSearchParams({ limit: String(query.limit ?? 50) });
1011
+ if (query.nftContract) params.set("nftContract", query.nftContract);
1012
+ if (query.author) params.set("author", query.author);
1013
+ if (query.owner) params.set("owner", query.owner);
1014
+ if (query.open !== void 0) params.set("open", String(query.open));
1015
+ return this.get(`/v1/sponsorship/offers?${params}`);
1016
+ }
1017
+ async getSponsorshipBids(offerId) {
1018
+ const res = await this.get(`/v1/sponsorship/offers/${encodeURIComponent(offerId)}/bids`);
1019
+ return res.data;
1020
+ }
1021
+ getSponsorshipProposals(query = {}) {
1022
+ const params = new URLSearchParams({ limit: String(query.limit ?? 50) });
1023
+ if (query.nftContract) params.set("nftContract", query.nftContract);
1024
+ if (query.proposer) params.set("proposer", query.proposer);
1025
+ if (query.owner) params.set("owner", query.owner);
1026
+ if (query.open !== void 0) params.set("open", String(query.open));
1027
+ return this.get(`/v1/sponsorship/proposals?${params}`);
1028
+ }
1029
+ getSponsorshipLicenses(query = {}) {
1030
+ const params = new URLSearchParams({ limit: String(query.limit ?? 50) });
1031
+ if (query.holder) params.set("holder", query.holder);
1032
+ if (query.author) params.set("author", query.author);
1033
+ return this.get(`/v1/sponsorship/licenses?${params}`);
1034
+ }
907
1035
  async getRewards(address) {
908
1036
  const res = await this.get(`/v1/rewards/${this.addr(address)}`);
909
1037
  return res.data;