Skip to main content

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

ParameterTypeDescription
contractRequiredParam<Marketplace>an instance of a marketplace contract
filterMarketplaceFilter(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