useListings() function
This feature is currently in beta and may change based on feedback that we receive.
Use this to get a list all listings from your marketplace contract.
Example
const { data: listings, isLoading, error } = useListings(<YourMarketplaceContractInstance>, { start: 0, count: 100 });
Signature:
export declare function useListings(
contract: RequiredParam<Marketplace>,
filter?: MarketplaceFilter,
): import("@tanstack/react-query").UseQueryResult<
(
| import("@thirdweb-dev/sdk/dist/browser").AuctionListing
| import("@thirdweb-dev/sdk/dist/browser").DirectListing
)[],
unknown
>;
Parameters
Parameter | Type | Description |
---|---|---|
contract | RequiredParam<Marketplace> | an instance of a marketplace contract |
filter | MarketplaceFilter | (Optional) filter to pass to the query for the sake of pagination & filtering |
Returns:
import("@tanstack/react-query").UseQueryResult<(import("@thirdweb-dev/sdk/dist/browser").AuctionListing | import("@thirdweb-dev/sdk/dist/browser").DirectListing)[], unknown>
a response object that includes an array of listings