@medialane/sdk 0.9.2 → 0.10.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.
package/dist/index.d.cts CHANGED
@@ -865,9 +865,23 @@ interface ApiCollectionProfile {
865
865
  telegramUrl: string | null;
866
866
  hasGatedContent: boolean;
867
867
  gatedContentTitle: string | null;
868
+ slug: string | null;
868
869
  updatedBy: string | null;
869
870
  updatedAt: string;
870
871
  }
872
+ interface ApiCollectionSlugClaim {
873
+ id: string;
874
+ slug: string;
875
+ contractAddress: string;
876
+ chain: string;
877
+ walletAddress: string;
878
+ status: "PENDING" | "APPROVED" | "REJECTED";
879
+ adminNotes: string | null;
880
+ notifyEmail: string | null;
881
+ reviewedAt: string | null;
882
+ createdAt: string;
883
+ updatedAt: string;
884
+ }
871
885
  interface ApiCreatorProfile {
872
886
  walletAddress: string;
873
887
  chain: string;
@@ -937,6 +951,7 @@ declare class ApiClient {
937
951
  private post;
938
952
  private patch;
939
953
  private del;
954
+ private checkResponse;
940
955
  getOrders(query?: ApiOrdersQuery): Promise<ApiResponse<ApiOrder[]>>;
941
956
  getOrder(orderHash: string): Promise<ApiResponse<ApiOrder>>;
942
957
  getActiveOrdersForToken(contract: string, tokenId: string): Promise<ApiResponse<ApiOrder[]>>;
@@ -1038,6 +1053,21 @@ declare class ApiClient {
1038
1053
  * Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
1039
1054
  */
1040
1055
  updateCreatorProfile(walletAddress: string, data: Partial<Omit<ApiCreatorProfile, "walletAddress" | "chain" | "updatedAt">>, clerkToken: string): Promise<ApiCreatorProfile>;
1056
+ /** Check if a collection slug is available (public, no auth). */
1057
+ checkCollectionSlugAvailability(slug: string): Promise<{
1058
+ available: boolean;
1059
+ reason?: string;
1060
+ }>;
1061
+ /** Submit a slug claim for a collection. Requires Clerk JWT — caller must be the collection owner. */
1062
+ submitCollectionSlugClaim(contractAddress: string, slug: string, clerkToken: string, notifyEmail?: string): Promise<{
1063
+ claim: ApiCollectionSlugClaim;
1064
+ }>;
1065
+ /** Returns all slug claims submitted by the authenticated wallet. Requires Clerk JWT. */
1066
+ getMyCollectionSlugClaims(clerkToken: string): Promise<{
1067
+ claims: ApiCollectionSlugClaim[];
1068
+ }>;
1069
+ /** Resolve a collection slug to a full collection. Returns null if not found. */
1070
+ getCollectionBySlug(slug: string): Promise<ApiCollection | null>;
1041
1071
  /**
1042
1072
  * Upsert the authenticated user's wallet address in the backend DB.
1043
1073
  * Call after onboarding when ChipiPay confirms the wallet address.
@@ -2991,4 +3021,4 @@ declare function build1155FulfillmentTypedData(message: Record<string, unknown>,
2991
3021
  */
2992
3022
  declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
2993
3023
 
2994
- export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintItemParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_CONTRACT_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type CollectionSource, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, ERC1155_COLLECTION_CLASS_HASH_MAINNET, ERC1155_FACTORY_CONTRACT_MAINNET, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, INDEXER_START_BLOCK_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPMarketplaceABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, MARKETPLACE_CLASS_HASH_MAINNET, MARKETPLACE_CONTRACT_MAINNET, MARKETPLACE_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintItemParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155FulfillmentTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
3024
+ export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintItemParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_CONTRACT_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type CollectionSource, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, ERC1155_COLLECTION_CLASS_HASH_MAINNET, ERC1155_FACTORY_CONTRACT_MAINNET, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, INDEXER_START_BLOCK_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPMarketplaceABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, MARKETPLACE_CLASS_HASH_MAINNET, MARKETPLACE_CONTRACT_MAINNET, MARKETPLACE_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintItemParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155FulfillmentTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
package/dist/index.d.ts CHANGED
@@ -865,9 +865,23 @@ interface ApiCollectionProfile {
865
865
  telegramUrl: string | null;
866
866
  hasGatedContent: boolean;
867
867
  gatedContentTitle: string | null;
868
+ slug: string | null;
868
869
  updatedBy: string | null;
869
870
  updatedAt: string;
870
871
  }
872
+ interface ApiCollectionSlugClaim {
873
+ id: string;
874
+ slug: string;
875
+ contractAddress: string;
876
+ chain: string;
877
+ walletAddress: string;
878
+ status: "PENDING" | "APPROVED" | "REJECTED";
879
+ adminNotes: string | null;
880
+ notifyEmail: string | null;
881
+ reviewedAt: string | null;
882
+ createdAt: string;
883
+ updatedAt: string;
884
+ }
871
885
  interface ApiCreatorProfile {
872
886
  walletAddress: string;
873
887
  chain: string;
@@ -937,6 +951,7 @@ declare class ApiClient {
937
951
  private post;
938
952
  private patch;
939
953
  private del;
954
+ private checkResponse;
940
955
  getOrders(query?: ApiOrdersQuery): Promise<ApiResponse<ApiOrder[]>>;
941
956
  getOrder(orderHash: string): Promise<ApiResponse<ApiOrder>>;
942
957
  getActiveOrdersForToken(contract: string, tokenId: string): Promise<ApiResponse<ApiOrder[]>>;
@@ -1038,6 +1053,21 @@ declare class ApiClient {
1038
1053
  * Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
1039
1054
  */
1040
1055
  updateCreatorProfile(walletAddress: string, data: Partial<Omit<ApiCreatorProfile, "walletAddress" | "chain" | "updatedAt">>, clerkToken: string): Promise<ApiCreatorProfile>;
1056
+ /** Check if a collection slug is available (public, no auth). */
1057
+ checkCollectionSlugAvailability(slug: string): Promise<{
1058
+ available: boolean;
1059
+ reason?: string;
1060
+ }>;
1061
+ /** Submit a slug claim for a collection. Requires Clerk JWT — caller must be the collection owner. */
1062
+ submitCollectionSlugClaim(contractAddress: string, slug: string, clerkToken: string, notifyEmail?: string): Promise<{
1063
+ claim: ApiCollectionSlugClaim;
1064
+ }>;
1065
+ /** Returns all slug claims submitted by the authenticated wallet. Requires Clerk JWT. */
1066
+ getMyCollectionSlugClaims(clerkToken: string): Promise<{
1067
+ claims: ApiCollectionSlugClaim[];
1068
+ }>;
1069
+ /** Resolve a collection slug to a full collection. Returns null if not found. */
1070
+ getCollectionBySlug(slug: string): Promise<ApiCollection | null>;
1041
1071
  /**
1042
1072
  * Upsert the authenticated user's wallet address in the backend DB.
1043
1073
  * Call after onboarding when ChipiPay confirms the wallet address.
@@ -2991,4 +3021,4 @@ declare function build1155FulfillmentTypedData(message: Record<string, unknown>,
2991
3021
  */
2992
3022
  declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
2993
3023
 
2994
- export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintItemParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_CONTRACT_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type CollectionSource, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, ERC1155_COLLECTION_CLASS_HASH_MAINNET, ERC1155_FACTORY_CONTRACT_MAINNET, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, INDEXER_START_BLOCK_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPMarketplaceABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, MARKETPLACE_CLASS_HASH_MAINNET, MARKETPLACE_CONTRACT_MAINNET, MARKETPLACE_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintItemParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155FulfillmentTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
3024
+ export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintItemParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_CONTRACT_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type CollectionSource, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, ERC1155_COLLECTION_CLASS_HASH_MAINNET, ERC1155_FACTORY_CONTRACT_MAINNET, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, INDEXER_START_BLOCK_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPMarketplaceABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, MARKETPLACE_CLASS_HASH_MAINNET, MARKETPLACE_CONTRACT_MAINNET, MARKETPLACE_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintItemParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155FulfillmentTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
package/dist/index.js CHANGED
@@ -2661,6 +2661,21 @@ var ApiClient = class {
2661
2661
  del(path) {
2662
2662
  return this.request(path, { method: "DELETE" });
2663
2663
  }
2664
+ async checkResponse(res, options) {
2665
+ if (options?.allow404 && res.status === 404) return null;
2666
+ if (options?.allow403 && res.status === 403) return null;
2667
+ if (!res.ok) {
2668
+ const text = await res.text().catch(() => res.statusText);
2669
+ let message = text;
2670
+ try {
2671
+ const body = JSON.parse(text);
2672
+ if (body.error) message = body.error;
2673
+ } catch {
2674
+ }
2675
+ throw new MedialaneApiError(res.status, message);
2676
+ }
2677
+ return res.json();
2678
+ }
2664
2679
  // ─── Orders ────────────────────────────────────────────────────────────────
2665
2680
  getOrders(query = {}) {
2666
2681
  const params = new URLSearchParams();
@@ -2869,7 +2884,7 @@ var ApiClient = class {
2869
2884
  },
2870
2885
  body: JSON.stringify({ contractAddress, walletAddress })
2871
2886
  });
2872
- return res.json();
2887
+ return this.checkResponse(res);
2873
2888
  }
2874
2889
  /**
2875
2890
  * Path 3: Manual off-chain claim request (email-based).
@@ -2884,8 +2899,7 @@ var ApiClient = class {
2884
2899
  async getCollectionProfile(contractAddress) {
2885
2900
  const url = `${this.baseUrl.replace(/\/$/, "")}/v1/collections/${normalizeAddress(contractAddress)}/profile`;
2886
2901
  const res = await fetch(url, { headers: this.baseHeaders });
2887
- if (res.status === 404) return null;
2888
- return res.json();
2902
+ return this.checkResponse(res, { allow404: true });
2889
2903
  }
2890
2904
  /**
2891
2905
  * Update collection profile. Requires Clerk JWT for ownership check.
@@ -2901,15 +2915,14 @@ var ApiClient = class {
2901
2915
  },
2902
2916
  body: JSON.stringify(data)
2903
2917
  });
2904
- return res.json();
2918
+ return this.checkResponse(res);
2905
2919
  }
2906
2920
  async getGatedContent(contractAddress, clerkToken) {
2907
2921
  const url = `${this.baseUrl.replace(/\/$/, "")}/v1/collections/${normalizeAddress(contractAddress)}/gated-content`;
2908
2922
  const res = await fetch(url, {
2909
2923
  headers: { ...this.baseHeaders, "Authorization": `Bearer ${clerkToken}` }
2910
2924
  });
2911
- if (res.status === 403 || res.status === 404) return null;
2912
- return res.json();
2925
+ return this.checkResponse(res, { allow404: true, allow403: true });
2913
2926
  }
2914
2927
  // ─── Creator Profiles ───────────────────────────────────────────────────────
2915
2928
  /** List all creators with an approved username. */
@@ -2920,20 +2933,18 @@ var ApiClient = class {
2920
2933
  if (opts.limit) params.set("limit", String(opts.limit));
2921
2934
  const url = `${this.baseUrl.replace(/\/$/, "")}/v1/creators?${params}`;
2922
2935
  const res = await fetch(url, { headers: this.baseHeaders });
2923
- return res.json();
2936
+ return this.checkResponse(res);
2924
2937
  }
2925
2938
  async getCreatorProfile(walletAddress) {
2926
2939
  const url = `${this.baseUrl.replace(/\/$/, "")}/v1/creators/${normalizeAddress(walletAddress)}/profile`;
2927
2940
  const res = await fetch(url, { headers: this.baseHeaders });
2928
- if (res.status === 404) return null;
2929
- return res.json();
2941
+ return this.checkResponse(res, { allow404: true });
2930
2942
  }
2931
2943
  /** Resolve a username slug to a creator profile (public). */
2932
2944
  async getCreatorByUsername(username) {
2933
2945
  const url = `${this.baseUrl.replace(/\/$/, "")}/v1/creators/by-username/${encodeURIComponent(username.toLowerCase().trim())}`;
2934
2946
  const res = await fetch(url, { headers: this.baseHeaders });
2935
- if (res.status === 404) return null;
2936
- return res.json();
2947
+ return this.checkResponse(res, { allow404: true });
2937
2948
  }
2938
2949
  /**
2939
2950
  * Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
@@ -2949,7 +2960,42 @@ var ApiClient = class {
2949
2960
  },
2950
2961
  body: JSON.stringify(data)
2951
2962
  });
2952
- return res.json();
2963
+ return this.checkResponse(res);
2964
+ }
2965
+ // ─── Collection Slug Claims ───────────────────────────────────────────────────
2966
+ /** Check if a collection slug is available (public, no auth). */
2967
+ async checkCollectionSlugAvailability(slug) {
2968
+ const url = `${this.baseUrl.replace(/\/$/, "")}/v1/collection-slug-claims/check/${encodeURIComponent(slug.toLowerCase().trim())}`;
2969
+ const res = await fetch(url, { headers: this.baseHeaders });
2970
+ return this.checkResponse(res);
2971
+ }
2972
+ /** Submit a slug claim for a collection. Requires Clerk JWT — caller must be the collection owner. */
2973
+ async submitCollectionSlugClaim(contractAddress, slug, clerkToken, notifyEmail) {
2974
+ const url = `${this.baseUrl.replace(/\/$/, "")}/v1/collection-slug-claims`;
2975
+ const res = await fetch(url, {
2976
+ method: "POST",
2977
+ headers: {
2978
+ "x-api-key": this.baseHeaders["x-api-key"] ?? "",
2979
+ "Content-Type": "application/json",
2980
+ Authorization: `Bearer ${clerkToken}`
2981
+ },
2982
+ body: JSON.stringify({ contractAddress, slug, notifyEmail })
2983
+ });
2984
+ return this.checkResponse(res);
2985
+ }
2986
+ /** Returns all slug claims submitted by the authenticated wallet. Requires Clerk JWT. */
2987
+ async getMyCollectionSlugClaims(clerkToken) {
2988
+ const url = `${this.baseUrl.replace(/\/$/, "")}/v1/collection-slug-claims/me`;
2989
+ const res = await fetch(url, {
2990
+ headers: { ...this.baseHeaders, Authorization: `Bearer ${clerkToken}` }
2991
+ });
2992
+ return this.checkResponse(res);
2993
+ }
2994
+ /** Resolve a collection slug to a full collection. Returns null if not found. */
2995
+ async getCollectionBySlug(slug) {
2996
+ const url = `${this.baseUrl.replace(/\/$/, "")}/v1/collections/by-slug/${encodeURIComponent(slug.toLowerCase().trim())}`;
2997
+ const res = await fetch(url, { headers: this.baseHeaders });
2998
+ return this.checkResponse(res, { allow404: true });
2953
2999
  }
2954
3000
  // ─── User Wallet ─────────────────────────────────────────────────────────────
2955
3001
  /**
@@ -2966,7 +3012,7 @@ var ApiClient = class {
2966
3012
  "Authorization": `Bearer ${clerkToken}`
2967
3013
  }
2968
3014
  });
2969
- return res.json();
3015
+ return this.checkResponse(res);
2970
3016
  }
2971
3017
  /**
2972
3018
  * Get the authenticated user's stored wallet address from the backend DB.
@@ -2978,8 +3024,7 @@ var ApiClient = class {
2978
3024
  const res = await fetch(url, {
2979
3025
  headers: { "Authorization": `Bearer ${clerkToken}` }
2980
3026
  });
2981
- if (res.status === 404) return null;
2982
- return res.json();
3027
+ return this.checkResponse(res, { allow404: true });
2983
3028
  }
2984
3029
  // ─── Remix Licensing ─────────────────────────────────────────────────────────
2985
3030
  /**
@@ -3037,7 +3082,7 @@ var ApiClient = class {
3037
3082
  const res = await fetch(url, {
3038
3083
  headers: { ...this.baseHeaders, "Authorization": `Bearer ${clerkToken}` }
3039
3084
  });
3040
- return res.json();
3085
+ return this.checkResponse(res);
3041
3086
  }
3042
3087
  /**
3043
3088
  * Get a single remix offer. Clerk JWT optional (price/currency hidden for non-participants).
@@ -3047,7 +3092,7 @@ var ApiClient = class {
3047
3092
  const headers = { ...this.baseHeaders };
3048
3093
  if (clerkToken) headers["Authorization"] = `Bearer ${clerkToken}`;
3049
3094
  const res = await fetch(url, { headers });
3050
- return res.json();
3095
+ return this.checkResponse(res);
3051
3096
  }
3052
3097
  /**
3053
3098
  * Creator approves a remix offer (authorises the requester to mint). Requires Clerk JWT.