@medialane/sdk 0.4.8 → 0.5.1

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
@@ -212,10 +212,10 @@ interface ApiCollectionsQuery {
212
212
  sort?: CollectionSort;
213
213
  owner?: string;
214
214
  }
215
- type OrderStatus = "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED";
215
+ type OrderStatus = "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED" | "COUNTER_OFFERED";
216
216
  type SortOrder = "price_asc" | "price_desc" | "recent";
217
217
  type ActivityType = "transfer" | "sale" | "listing" | "offer" | "cancelled";
218
- type IntentType = "CREATE_LISTING" | "MAKE_OFFER" | "FULFILL_ORDER" | "CANCEL_ORDER" | "MINT" | "CREATE_COLLECTION";
218
+ type IntentType = "CREATE_LISTING" | "MAKE_OFFER" | "FULFILL_ORDER" | "CANCEL_ORDER" | "MINT" | "CREATE_COLLECTION" | "COUNTER_OFFER";
219
219
  type IntentStatus = "PENDING" | "SIGNED" | "SUBMITTED" | "CONFIRMED" | "FAILED" | "EXPIRED";
220
220
  type WebhookEventType = "ORDER_CREATED" | "ORDER_FULFILLED" | "ORDER_CANCELLED" | "TRANSFER";
221
221
  type WebhookStatus = "ACTIVE" | "DISABLED";
@@ -287,6 +287,10 @@ interface ApiOrder {
287
287
  updatedAt: string;
288
288
  /** Embedded token metadata (name/image/description). Null when not yet indexed. */
289
289
  token: ApiOrderTokenMeta | null;
290
+ /** Set when this is a counter-offer listing — points to the original buyer bid. */
291
+ parentOrderHash?: string | null;
292
+ /** Optional seller message accompanying a counter-offer. */
293
+ counterOfferMessage?: string | null;
290
294
  }
291
295
  /**
292
296
  * A single OpenSea-compatible ERC-721 attribute.
@@ -453,6 +457,10 @@ interface ApiIntent {
453
457
  signature: string[];
454
458
  txHash: string | null;
455
459
  orderHash: string | null;
460
+ /** Set on COUNTER_OFFER intents — the original bid order hash being countered. */
461
+ parentOrderHash?: string | null;
462
+ /** Optional seller message on counter-offer intents. */
463
+ counterOfferMessage?: string | null;
456
464
  expiresAt: string;
457
465
  createdAt: string;
458
466
  updatedAt: string;
@@ -511,6 +519,101 @@ interface CreateCollectionIntentParams {
511
519
  /** Optional: override the default collection contract address */
512
520
  collectionContract?: string;
513
521
  }
522
+ interface CreateCounterOfferIntentParams {
523
+ /** Wallet address of the NFT owner making the counter-offer. */
524
+ sellerAddress: string;
525
+ /** Order hash of the original buyer bid being countered. */
526
+ originalOrderHash: string;
527
+ /** Counter price as a raw wei integer string (not human-readable). */
528
+ counterPrice: string;
529
+ /** Duration in seconds the counter-offer will be valid (3600–2592000). */
530
+ durationSeconds: number;
531
+ /** Optional message from the seller to the buyer. Max 500 chars. */
532
+ message?: string;
533
+ }
534
+ interface ApiCounterOffersQuery {
535
+ /** Original bid order hash — returns the counter-offer for this specific bid. */
536
+ originalOrderHash?: string;
537
+ /** Seller address — returns all counter-offers sent by this seller. */
538
+ sellerAddress?: string;
539
+ page?: number;
540
+ limit?: number;
541
+ }
542
+ declare const OPEN_LICENSES: readonly ["CC0", "CC BY", "CC BY-SA", "CC BY-NC"];
543
+ type OpenLicense = (typeof OPEN_LICENSES)[number];
544
+ type RemixOfferStatus = "PENDING" | "AUTO_PENDING" | "APPROVED" | "COMPLETED" | "REJECTED" | "EXPIRED" | "SELF_MINTED";
545
+ interface ApiRemixOffer {
546
+ id: string;
547
+ status: RemixOfferStatus;
548
+ originalContract: string;
549
+ originalTokenId: string;
550
+ creatorAddress: string;
551
+ requesterAddress: string | null;
552
+ message?: string | null;
553
+ /** Visible only to creator and requester */
554
+ proposedPrice?: string;
555
+ /** Visible only to creator and requester */
556
+ proposedCurrency?: string;
557
+ licenseType: string;
558
+ commercial: boolean;
559
+ derivatives: boolean;
560
+ royaltyPct: number | null;
561
+ approvedCollection: string | null;
562
+ remixContract: string | null;
563
+ remixTokenId: string | null;
564
+ orderHash: string | null;
565
+ createdAt: string;
566
+ expiresAt: string;
567
+ updatedAt: string;
568
+ }
569
+ /** Public remix record — price/currency omitted for non-participants */
570
+ interface ApiPublicRemix {
571
+ id: string;
572
+ remixContract: string | null;
573
+ remixTokenId: string | null;
574
+ licenseType: string;
575
+ commercial: boolean;
576
+ derivatives: boolean;
577
+ createdAt: string;
578
+ }
579
+ interface CreateRemixOfferParams {
580
+ originalContract: string;
581
+ originalTokenId: string;
582
+ licenseType: string;
583
+ commercial: boolean;
584
+ derivatives: boolean;
585
+ royaltyPct?: number;
586
+ proposedPrice?: string;
587
+ proposedCurrency?: string;
588
+ message?: string;
589
+ }
590
+ interface AutoRemixOfferParams {
591
+ originalContract: string;
592
+ originalTokenId: string;
593
+ licenseType: string;
594
+ }
595
+ interface ConfirmSelfRemixParams {
596
+ originalContract: string;
597
+ originalTokenId: string;
598
+ remixContract: string;
599
+ remixTokenId: string;
600
+ licenseType: string;
601
+ commercial: boolean;
602
+ derivatives: boolean;
603
+ royaltyPct?: number;
604
+ }
605
+ interface ConfirmRemixOfferParams {
606
+ approvedCollection: string;
607
+ remixContract: string;
608
+ remixTokenId: string;
609
+ orderHash?: string;
610
+ }
611
+ interface ApiRemixOffersQuery {
612
+ /** "creator" = offers where you are the original creator; "requester" = offers you made */
613
+ role: "creator" | "requester";
614
+ page?: number;
615
+ limit?: number;
616
+ }
514
617
  interface ApiMetadataSignedUrl {
515
618
  url: string;
516
619
  }
@@ -658,6 +761,17 @@ declare class ApiClient {
658
761
  submitIntentSignature(id: string, signature: string[]): Promise<ApiResponse<ApiIntent>>;
659
762
  createMintIntent(params: CreateMintIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
660
763
  createCollectionIntent(params: CreateCollectionIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
764
+ /**
765
+ * Create a counter-offer intent. The seller proposes a new price in response
766
+ * to a buyer's active bid. clerkToken is optional — the endpoint authenticates
767
+ * via the tenant API key; pass a Clerk JWT only if your backend requires it.
768
+ */
769
+ createCounterOfferIntent(params: CreateCounterOfferIntentParams, clerkToken?: string): Promise<ApiResponse<ApiIntentCreated>>;
770
+ /**
771
+ * Fetch counter-offers. Pass `originalOrderHash` (buyer view) or
772
+ * `sellerAddress` (seller view) — at least one is required.
773
+ */
774
+ getCounterOffers(query: ApiCounterOffersQuery): Promise<ApiResponse<ApiOrder[]>>;
661
775
  getMetadataSignedUrl(): Promise<ApiResponse<ApiMetadataSignedUrl>>;
662
776
  uploadMetadata(metadata: Record<string, unknown>): Promise<ApiResponse<ApiMetadataUpload>>;
663
777
  resolveMetadata(uri: string): Promise<ApiResponse<unknown>>;
@@ -726,6 +840,43 @@ declare class ApiClient {
726
840
  * Requires Clerk JWT; no tenant API key needed.
727
841
  */
728
842
  getMyWallet(clerkToken: string): Promise<ApiUserWallet | null>;
843
+ /**
844
+ * Get public remixes of a token (open to everyone).
845
+ */
846
+ getTokenRemixes(contract: string, tokenId: string, opts?: {
847
+ page?: number;
848
+ limit?: number;
849
+ }): Promise<ApiResponse<ApiPublicRemix[]>>;
850
+ /**
851
+ * Submit a custom remix offer for a token. Requires Clerk JWT.
852
+ */
853
+ submitRemixOffer(params: CreateRemixOfferParams, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
854
+ /**
855
+ * Submit an auto remix offer for a token with an open license. Requires Clerk JWT.
856
+ */
857
+ submitAutoRemixOffer(params: AutoRemixOfferParams, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
858
+ /**
859
+ * Record a self-remix (owner remixing their own token). Requires Clerk JWT.
860
+ */
861
+ confirmSelfRemix(params: ConfirmSelfRemixParams, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
862
+ /**
863
+ * List remix offers by role. Requires Clerk JWT.
864
+ * role="creator" — offers where you are the original creator.
865
+ * role="requester" — offers you made.
866
+ */
867
+ getRemixOffers(query: ApiRemixOffersQuery, clerkToken: string): Promise<ApiResponse<ApiRemixOffer[]>>;
868
+ /**
869
+ * Get a single remix offer. Clerk JWT optional (price/currency hidden for non-participants).
870
+ */
871
+ getRemixOffer(id: string, clerkToken?: string): Promise<ApiResponse<ApiRemixOffer>>;
872
+ /**
873
+ * Creator approves a remix offer (authorises the requester to mint). Requires Clerk JWT.
874
+ */
875
+ confirmRemixOffer(id: string, params: ConfirmRemixOfferParams, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
876
+ /**
877
+ * Creator rejects a remix offer. Requires Clerk JWT.
878
+ */
879
+ rejectRemixOffer(id: string, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
729
880
  }
730
881
 
731
882
  declare class MedialaneClient {
@@ -1173,4 +1324,4 @@ declare function buildFulfillmentTypedData(message: Record<string, unknown>, cha
1173
1324
  */
1174
1325
  declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
1175
1326
 
1176
- export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, type ApiComment, 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 ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_CONTRACT_MAINNET, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintParams, type Network, type OfferItem, type Order, type OrderParameters, type OrderStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
1327
+ 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 ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_CONTRACT_MAINNET, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintParams, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderParameters, type OrderStatus, type RemixOfferStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
package/dist/index.d.ts CHANGED
@@ -212,10 +212,10 @@ interface ApiCollectionsQuery {
212
212
  sort?: CollectionSort;
213
213
  owner?: string;
214
214
  }
215
- type OrderStatus = "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED";
215
+ type OrderStatus = "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED" | "COUNTER_OFFERED";
216
216
  type SortOrder = "price_asc" | "price_desc" | "recent";
217
217
  type ActivityType = "transfer" | "sale" | "listing" | "offer" | "cancelled";
218
- type IntentType = "CREATE_LISTING" | "MAKE_OFFER" | "FULFILL_ORDER" | "CANCEL_ORDER" | "MINT" | "CREATE_COLLECTION";
218
+ type IntentType = "CREATE_LISTING" | "MAKE_OFFER" | "FULFILL_ORDER" | "CANCEL_ORDER" | "MINT" | "CREATE_COLLECTION" | "COUNTER_OFFER";
219
219
  type IntentStatus = "PENDING" | "SIGNED" | "SUBMITTED" | "CONFIRMED" | "FAILED" | "EXPIRED";
220
220
  type WebhookEventType = "ORDER_CREATED" | "ORDER_FULFILLED" | "ORDER_CANCELLED" | "TRANSFER";
221
221
  type WebhookStatus = "ACTIVE" | "DISABLED";
@@ -287,6 +287,10 @@ interface ApiOrder {
287
287
  updatedAt: string;
288
288
  /** Embedded token metadata (name/image/description). Null when not yet indexed. */
289
289
  token: ApiOrderTokenMeta | null;
290
+ /** Set when this is a counter-offer listing — points to the original buyer bid. */
291
+ parentOrderHash?: string | null;
292
+ /** Optional seller message accompanying a counter-offer. */
293
+ counterOfferMessage?: string | null;
290
294
  }
291
295
  /**
292
296
  * A single OpenSea-compatible ERC-721 attribute.
@@ -453,6 +457,10 @@ interface ApiIntent {
453
457
  signature: string[];
454
458
  txHash: string | null;
455
459
  orderHash: string | null;
460
+ /** Set on COUNTER_OFFER intents — the original bid order hash being countered. */
461
+ parentOrderHash?: string | null;
462
+ /** Optional seller message on counter-offer intents. */
463
+ counterOfferMessage?: string | null;
456
464
  expiresAt: string;
457
465
  createdAt: string;
458
466
  updatedAt: string;
@@ -511,6 +519,101 @@ interface CreateCollectionIntentParams {
511
519
  /** Optional: override the default collection contract address */
512
520
  collectionContract?: string;
513
521
  }
522
+ interface CreateCounterOfferIntentParams {
523
+ /** Wallet address of the NFT owner making the counter-offer. */
524
+ sellerAddress: string;
525
+ /** Order hash of the original buyer bid being countered. */
526
+ originalOrderHash: string;
527
+ /** Counter price as a raw wei integer string (not human-readable). */
528
+ counterPrice: string;
529
+ /** Duration in seconds the counter-offer will be valid (3600–2592000). */
530
+ durationSeconds: number;
531
+ /** Optional message from the seller to the buyer. Max 500 chars. */
532
+ message?: string;
533
+ }
534
+ interface ApiCounterOffersQuery {
535
+ /** Original bid order hash — returns the counter-offer for this specific bid. */
536
+ originalOrderHash?: string;
537
+ /** Seller address — returns all counter-offers sent by this seller. */
538
+ sellerAddress?: string;
539
+ page?: number;
540
+ limit?: number;
541
+ }
542
+ declare const OPEN_LICENSES: readonly ["CC0", "CC BY", "CC BY-SA", "CC BY-NC"];
543
+ type OpenLicense = (typeof OPEN_LICENSES)[number];
544
+ type RemixOfferStatus = "PENDING" | "AUTO_PENDING" | "APPROVED" | "COMPLETED" | "REJECTED" | "EXPIRED" | "SELF_MINTED";
545
+ interface ApiRemixOffer {
546
+ id: string;
547
+ status: RemixOfferStatus;
548
+ originalContract: string;
549
+ originalTokenId: string;
550
+ creatorAddress: string;
551
+ requesterAddress: string | null;
552
+ message?: string | null;
553
+ /** Visible only to creator and requester */
554
+ proposedPrice?: string;
555
+ /** Visible only to creator and requester */
556
+ proposedCurrency?: string;
557
+ licenseType: string;
558
+ commercial: boolean;
559
+ derivatives: boolean;
560
+ royaltyPct: number | null;
561
+ approvedCollection: string | null;
562
+ remixContract: string | null;
563
+ remixTokenId: string | null;
564
+ orderHash: string | null;
565
+ createdAt: string;
566
+ expiresAt: string;
567
+ updatedAt: string;
568
+ }
569
+ /** Public remix record — price/currency omitted for non-participants */
570
+ interface ApiPublicRemix {
571
+ id: string;
572
+ remixContract: string | null;
573
+ remixTokenId: string | null;
574
+ licenseType: string;
575
+ commercial: boolean;
576
+ derivatives: boolean;
577
+ createdAt: string;
578
+ }
579
+ interface CreateRemixOfferParams {
580
+ originalContract: string;
581
+ originalTokenId: string;
582
+ licenseType: string;
583
+ commercial: boolean;
584
+ derivatives: boolean;
585
+ royaltyPct?: number;
586
+ proposedPrice?: string;
587
+ proposedCurrency?: string;
588
+ message?: string;
589
+ }
590
+ interface AutoRemixOfferParams {
591
+ originalContract: string;
592
+ originalTokenId: string;
593
+ licenseType: string;
594
+ }
595
+ interface ConfirmSelfRemixParams {
596
+ originalContract: string;
597
+ originalTokenId: string;
598
+ remixContract: string;
599
+ remixTokenId: string;
600
+ licenseType: string;
601
+ commercial: boolean;
602
+ derivatives: boolean;
603
+ royaltyPct?: number;
604
+ }
605
+ interface ConfirmRemixOfferParams {
606
+ approvedCollection: string;
607
+ remixContract: string;
608
+ remixTokenId: string;
609
+ orderHash?: string;
610
+ }
611
+ interface ApiRemixOffersQuery {
612
+ /** "creator" = offers where you are the original creator; "requester" = offers you made */
613
+ role: "creator" | "requester";
614
+ page?: number;
615
+ limit?: number;
616
+ }
514
617
  interface ApiMetadataSignedUrl {
515
618
  url: string;
516
619
  }
@@ -658,6 +761,17 @@ declare class ApiClient {
658
761
  submitIntentSignature(id: string, signature: string[]): Promise<ApiResponse<ApiIntent>>;
659
762
  createMintIntent(params: CreateMintIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
660
763
  createCollectionIntent(params: CreateCollectionIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
764
+ /**
765
+ * Create a counter-offer intent. The seller proposes a new price in response
766
+ * to a buyer's active bid. clerkToken is optional — the endpoint authenticates
767
+ * via the tenant API key; pass a Clerk JWT only if your backend requires it.
768
+ */
769
+ createCounterOfferIntent(params: CreateCounterOfferIntentParams, clerkToken?: string): Promise<ApiResponse<ApiIntentCreated>>;
770
+ /**
771
+ * Fetch counter-offers. Pass `originalOrderHash` (buyer view) or
772
+ * `sellerAddress` (seller view) — at least one is required.
773
+ */
774
+ getCounterOffers(query: ApiCounterOffersQuery): Promise<ApiResponse<ApiOrder[]>>;
661
775
  getMetadataSignedUrl(): Promise<ApiResponse<ApiMetadataSignedUrl>>;
662
776
  uploadMetadata(metadata: Record<string, unknown>): Promise<ApiResponse<ApiMetadataUpload>>;
663
777
  resolveMetadata(uri: string): Promise<ApiResponse<unknown>>;
@@ -726,6 +840,43 @@ declare class ApiClient {
726
840
  * Requires Clerk JWT; no tenant API key needed.
727
841
  */
728
842
  getMyWallet(clerkToken: string): Promise<ApiUserWallet | null>;
843
+ /**
844
+ * Get public remixes of a token (open to everyone).
845
+ */
846
+ getTokenRemixes(contract: string, tokenId: string, opts?: {
847
+ page?: number;
848
+ limit?: number;
849
+ }): Promise<ApiResponse<ApiPublicRemix[]>>;
850
+ /**
851
+ * Submit a custom remix offer for a token. Requires Clerk JWT.
852
+ */
853
+ submitRemixOffer(params: CreateRemixOfferParams, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
854
+ /**
855
+ * Submit an auto remix offer for a token with an open license. Requires Clerk JWT.
856
+ */
857
+ submitAutoRemixOffer(params: AutoRemixOfferParams, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
858
+ /**
859
+ * Record a self-remix (owner remixing their own token). Requires Clerk JWT.
860
+ */
861
+ confirmSelfRemix(params: ConfirmSelfRemixParams, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
862
+ /**
863
+ * List remix offers by role. Requires Clerk JWT.
864
+ * role="creator" — offers where you are the original creator.
865
+ * role="requester" — offers you made.
866
+ */
867
+ getRemixOffers(query: ApiRemixOffersQuery, clerkToken: string): Promise<ApiResponse<ApiRemixOffer[]>>;
868
+ /**
869
+ * Get a single remix offer. Clerk JWT optional (price/currency hidden for non-participants).
870
+ */
871
+ getRemixOffer(id: string, clerkToken?: string): Promise<ApiResponse<ApiRemixOffer>>;
872
+ /**
873
+ * Creator approves a remix offer (authorises the requester to mint). Requires Clerk JWT.
874
+ */
875
+ confirmRemixOffer(id: string, params: ConfirmRemixOfferParams, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
876
+ /**
877
+ * Creator rejects a remix offer. Requires Clerk JWT.
878
+ */
879
+ rejectRemixOffer(id: string, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
729
880
  }
730
881
 
731
882
  declare class MedialaneClient {
@@ -1173,4 +1324,4 @@ declare function buildFulfillmentTypedData(message: Record<string, unknown>, cha
1173
1324
  */
1174
1325
  declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
1175
1326
 
1176
- export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, type ApiComment, 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 ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_CONTRACT_MAINNET, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintParams, type Network, type OfferItem, type Order, type OrderParameters, type OrderStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
1327
+ 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 ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_CONTRACT_MAINNET, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintParams, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderParameters, type OrderStatus, type RemixOfferStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
package/dist/index.js CHANGED
@@ -1145,6 +1145,31 @@ var ApiClient = class {
1145
1145
  createCollectionIntent(params) {
1146
1146
  return this.post("/v1/intents/create-collection", params);
1147
1147
  }
1148
+ /**
1149
+ * Create a counter-offer intent. The seller proposes a new price in response
1150
+ * to a buyer's active bid. clerkToken is optional — the endpoint authenticates
1151
+ * via the tenant API key; pass a Clerk JWT only if your backend requires it.
1152
+ */
1153
+ createCounterOfferIntent(params, clerkToken) {
1154
+ const extraHeaders = clerkToken ? { "Authorization": `Bearer ${clerkToken}` } : {};
1155
+ return this.request("/v1/intents/counter-offer", {
1156
+ method: "POST",
1157
+ body: JSON.stringify(params),
1158
+ headers: extraHeaders
1159
+ });
1160
+ }
1161
+ /**
1162
+ * Fetch counter-offers. Pass `originalOrderHash` (buyer view) or
1163
+ * `sellerAddress` (seller view) — at least one is required.
1164
+ */
1165
+ getCounterOffers(query) {
1166
+ const params = new URLSearchParams();
1167
+ if (query.originalOrderHash) params.set("originalOrderHash", query.originalOrderHash);
1168
+ if (query.sellerAddress) params.set("sellerAddress", query.sellerAddress);
1169
+ if (query.page !== void 0) params.set("page", String(query.page));
1170
+ if (query.limit !== void 0) params.set("limit", String(query.limit));
1171
+ return this.get(`/v1/orders/counter-offers?${params}`);
1172
+ }
1148
1173
  // ─── Metadata ──────────────────────────────────────────────────────────────
1149
1174
  getMetadataSignedUrl() {
1150
1175
  return this.get("/v1/metadata/signed-url");
@@ -1311,6 +1336,94 @@ var ApiClient = class {
1311
1336
  if (res.status === 404) return null;
1312
1337
  return res.json();
1313
1338
  }
1339
+ // ─── Remix Licensing ─────────────────────────────────────────────────────────
1340
+ /**
1341
+ * Get public remixes of a token (open to everyone).
1342
+ */
1343
+ getTokenRemixes(contract, tokenId, opts = {}) {
1344
+ const params = new URLSearchParams();
1345
+ if (opts.page !== void 0) params.set("page", String(opts.page));
1346
+ if (opts.limit !== void 0) params.set("limit", String(opts.limit));
1347
+ const qs = params.toString();
1348
+ return this.get(
1349
+ `/v1/tokens/${normalizeAddress(contract)}/${tokenId}/remixes${qs ? `?${qs}` : ""}`
1350
+ );
1351
+ }
1352
+ /**
1353
+ * Submit a custom remix offer for a token. Requires Clerk JWT.
1354
+ */
1355
+ submitRemixOffer(params, clerkToken) {
1356
+ return this.request("/v1/remix-offers", {
1357
+ method: "POST",
1358
+ body: JSON.stringify(params),
1359
+ headers: { "Authorization": `Bearer ${clerkToken}` }
1360
+ });
1361
+ }
1362
+ /**
1363
+ * Submit an auto remix offer for a token with an open license. Requires Clerk JWT.
1364
+ */
1365
+ submitAutoRemixOffer(params, clerkToken) {
1366
+ return this.request("/v1/remix-offers/auto", {
1367
+ method: "POST",
1368
+ body: JSON.stringify(params),
1369
+ headers: { "Authorization": `Bearer ${clerkToken}` }
1370
+ });
1371
+ }
1372
+ /**
1373
+ * Record a self-remix (owner remixing their own token). Requires Clerk JWT.
1374
+ */
1375
+ confirmSelfRemix(params, clerkToken) {
1376
+ return this.request("/v1/remix-offers/self/confirm", {
1377
+ method: "POST",
1378
+ body: JSON.stringify(params),
1379
+ headers: { "Authorization": `Bearer ${clerkToken}` }
1380
+ });
1381
+ }
1382
+ /**
1383
+ * List remix offers by role. Requires Clerk JWT.
1384
+ * role="creator" — offers where you are the original creator.
1385
+ * role="requester" — offers you made.
1386
+ */
1387
+ async getRemixOffers(query, clerkToken) {
1388
+ const params = new URLSearchParams({ role: query.role });
1389
+ if (query.page !== void 0) params.set("page", String(query.page));
1390
+ if (query.limit !== void 0) params.set("limit", String(query.limit));
1391
+ const url = `${this.baseUrl.replace(/\/$/, "")}/v1/remix-offers?${params}`;
1392
+ const res = await fetch(url, {
1393
+ headers: { ...this.baseHeaders, "Authorization": `Bearer ${clerkToken}` }
1394
+ });
1395
+ return res.json();
1396
+ }
1397
+ /**
1398
+ * Get a single remix offer. Clerk JWT optional (price/currency hidden for non-participants).
1399
+ */
1400
+ async getRemixOffer(id, clerkToken) {
1401
+ const url = `${this.baseUrl.replace(/\/$/, "")}/v1/remix-offers/${id}`;
1402
+ const headers = { ...this.baseHeaders };
1403
+ if (clerkToken) headers["Authorization"] = `Bearer ${clerkToken}`;
1404
+ const res = await fetch(url, { headers });
1405
+ return res.json();
1406
+ }
1407
+ /**
1408
+ * Creator approves a remix offer (authorises the requester to mint). Requires Clerk JWT.
1409
+ */
1410
+ confirmRemixOffer(id, params, clerkToken) {
1411
+ return this.request(`/v1/remix-offers/${id}/confirm`, {
1412
+ method: "POST",
1413
+ body: JSON.stringify(params),
1414
+ headers: { "Authorization": `Bearer ${clerkToken}` }
1415
+ });
1416
+ }
1417
+ /**
1418
+ * Creator rejects a remix offer. Requires Clerk JWT.
1419
+ */
1420
+ rejectRemixOffer(id, clerkToken) {
1421
+ return this.request(`/v1/remix-offers/${id}/reject`, {
1422
+ method: "POST",
1423
+ body: JSON.stringify({}),
1424
+ headers: { "Authorization": `Bearer ${clerkToken}` }
1425
+ });
1426
+ }
1314
1427
  };
1315
1428
 
1316
1429
  // src/client.ts
@@ -1343,6 +1456,9 @@ var MedialaneClient = class {
1343
1456
  }
1344
1457
  };
1345
1458
 
1346
- export { ApiClient, COLLECTION_CONTRACT_MAINNET, DEFAULT_RPC_URLS, IPMarketplaceABI, MARKETPLACE_CONTRACT_MAINNET, MarketplaceModule, MedialaneApiError, MedialaneClient, MedialaneError, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
1459
+ // src/types/api.ts
1460
+ var OPEN_LICENSES = ["CC0", "CC BY", "CC BY-SA", "CC BY-NC"];
1461
+
1462
+ export { ApiClient, COLLECTION_CONTRACT_MAINNET, DEFAULT_RPC_URLS, IPMarketplaceABI, MARKETPLACE_CONTRACT_MAINNET, MarketplaceModule, MedialaneApiError, MedialaneClient, MedialaneError, OPEN_LICENSES, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
1347
1463
  //# sourceMappingURL=index.js.map
1348
1464
  //# sourceMappingURL=index.js.map