Skip to main content

useListing() function

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

Use this to get a specific listing from the marketplace.

Example

const { data: listing, isLoading, error } = useListing(<YourMarketplaceContractInstance>, <listingId>);

Signature:

export declare function useListing(
contract: RequiredParam<Marketplace>,
listingId: RequiredParam<BigNumberish>,
): import("@tanstack/react-query").UseQueryResult<
AuctionListing | DirectListing,
unknown
>;

Parameters

ParameterTypeDescription
contractRequiredParam<Marketplace>an instance of a marketplace contract
listingIdRequiredParam<BigNumberish>the listing id to check

Returns:

import("@tanstack/react-query").UseQueryResult<AuctionListing | DirectListing, unknown>

a response object that includes an array of listings