Docs

useAuctionWinner

Hook for getting the winner of an auction (or english auction) on a Marketplace or MarketplaceV3 contract.

Example

import { useAuctionWinner, useContract } from "@thirdweb-dev/react";
function App() {
const { contract } = useContract(contractAddress, "marketplace");
const { data, isLoading, error } = useAuctionWinner(
contract,
listingId, // The listing id of the item that you want to get the auction winner for
);
}

Parameters

Returns

The hook's data property, once loaded, contains a string representing the address of the auction winner, or undefined if there is no winner.