useExecuteAuctionSale() function
This feature is currently in beta and may change based on feedback that we receive.
Execute an auction sale. Can only be executed once the auction has ended and the auction has a winning bid.
Example
const Component = () => {
const {
mutate: executeAuctionSale,
isLoading,
error,
} = useExecuteAuctionSale(">>YourMarketplaceContractInstance<<");
if (error) {
console.error("failed to execute sale", error);
}
return (
<button
disabled={isLoading}
onClick={() => executeAuctionSale({ listingId: 1 })}
>
Execute sale
</button>
);
};
Signature:
export declare function useExecuteAuctionSale(
contract: RequiredParam<Marketplace>,
): import("@tanstack/react-query").UseMutationResult<
import("@ethersproject/abstract-provider").TransactionReceipt,
unknown,
ExecuteAuctionSale,
unknown
>;
Parameters
Parameter | Type | Description |
---|---|---|
contract | RequiredParam<Marketplace> | an instance of a Marketplace contract |
Returns:
import("@tanstack/react-query").UseMutationResult<import("@ethersproject/abstract-provider").TransactionReceipt, unknown, ExecuteAuctionSale, unknown>
a mutation object that can be used to accept an offer on a direct listing