Import
Usage
Make sure you have followed the Getting
Started guide
to get the collection address and chainId.
Example
Example of implementing the make offer functionality using theuseMakeOfferModal
hook:
Parameters
The hook accepts an optionalcallbacks
object with the following properties:
Parameter | Type | Description |
---|---|---|
callbacks.onSuccess | ({ hash, orderId }: { hash?: Hash; orderId?: string }) => void | Optional callback function called when the offer is created successfully |
callbacks.onError | (error: Error) => void | Optional callback function called when an error occurs during offer creation |
callbacks.successActionButtons | Array<{ label: string; action: () => void }> | Optional array of action buttons to show on success |
Return Type
The hook returns an object with the following methods:Methods
show
(args: ShowMakeOfferModalArgs) => void
Opens the make offer modal with the specified parameters.
Parameter | Type | Description |
---|---|---|
collectionAddress | Address | The contract address of the NFT collection |
chainId | number | The blockchain network chain ID where the collection exists |
collectibleId | string | The token ID of the specific collectible to make an offer on |
orderbookKind | OrderbookKind | Optional. The marketplace orderbook to use (defaults to sequence_marketplace_v2 ) |
OrderbookKind Values
You can import theOrderbookKind
type from the marketplace SDK:
close
() => void
Closes the make offer modal.
Notes
TheuseMakeOfferModal
hook provides a convenient way to manage the make offer modal interface for creating offers on collectibles. It handles:
- Opening and closing the modal
- Managing the offer creation flow state
- Token approval for the offer currency (if required)
- Error handling and success callbacks
- Support for different marketplace orderbooks
- Offer expiration date management (defaults to 7 days)
- Currency selection and price input validation
- Select the offer price and currency
- Set the offer quantity (for ERC-1155 tokens)
- Choose an expiration date for the offer
- Complete the necessary blockchain transactions (approval + offer creation)