Docs

useCancelEnglishAuction

Hook for canceling an english auction on a MarketplaceV3 contract.

English auctions cannot be canceled if a bid has been placed

This hook is only for Marketplace V3 contracts.

For Marketplace contracts, use useCancelListing instead.

Example

import {
useCancelEnglishAuction,
useContract,
Web3Button,
} from "@thirdweb-dev/react";
function App() {
const { contract } = useContract(contractAddress, "marketplace-v3");
const {
mutateAsync: cancelEnglishAuction,
isLoading,
error,
} = useCancelEnglishAuction(contract);
return (
<Web3Button
contractAddress={contractAddress}
action={() => cancelEnglishAuction(listingId)}
>
Cancel English Auction
</Web3Button>
);
}

Parameters

Returns

Mutation object to cancel an english auction

const { mutateAsync, isLoading, error } = useCancelEnglishAuction(contract);

The mutation function takes the listingId as an argument.

The error property is set if the listing is not active, cannot be canceled, or was not created by the wallet.

listingId

The ID of the listing you want to cancel.