Skip to main content

Import

Create Listing Modal

Usage

Make sure you have followed the Getting Started guide to get the collection address and chainId.

Examples

Example of implementing a basic listing creation using the useCreateListingModal hook:
This example uses the useCollectible and useBalanceOfCollectible hooks from marketplace-sdk to verify ownership and get collectible details.

Parameters

The hook accepts an optional callbacks object with the following properties:

Return Type

The hook returns an object with the following methods:

Methods

show

(args: ShowCreateListingModalArgs) => void Opens the create listing modal with the specified parameters.

close

() => void Closes the create listing modal.

Notes

The useCreateListingModal hook provides a convenient way to manage the create listing modal interface for collectible sales. It handles:
  • Opening and closing the modal
  • Managing the listing creation flow state
  • Price and quantity input validation
  • Expiration date selection
  • Error handling and success callbacks
  • Transaction approval and execution steps
  • Support for different orderbook types

Prerequisites

Before using this hook, ensure:
  1. User Authentication: The user must be connected with a wallet
  2. Ownership Verification: Use hooks like useBalanceOfCollectible to verify the user owns the collectible
  3. Collectible Data: Use useCollectible to get metadata for the collectible being listed
  4. Network Configuration: Ensure the marketplace is configured for the target chain