Skip to main content

useAuctionWinner() function

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

Use this to get the winner of an auction listing from your marketplace contract.

Example

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

Signature:

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

Parameters

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

Returns:

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

a response object that includes the address of the winner of the auction or undefined if there is no winner yet