Skip to main content

useActiveListings() function

This feature is currently in beta and may change based on feedback that we receive.

Use this to get a list active listings from your marketplace contract.

Example

const { data: listings, isLoading, error } = useActiveListings(<YourMarketplaceContractInstance>, { seller: "0x...", tokenContract: "0x...", tokenId: 1, start: 0, count: 100 });

Signature:

export declare function useActiveListings(
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