DOCS

useExecuteAuctionSale

Execute an auction sale. Can only be executed once the auction has ended and the auction has a winning bid.

Example

const Component = () => {
  const { contract } = useContract("{{contract_address}}");
  const {
    mutate: executeAuctionSale,
    isLoading,
    error,
  } = useExecuteAuctionSale(contract);

  if (error) {
    console.error("failed to execute sale", error);
  }

  return (
    <button
      disabled={isLoading}
      onClick={() => executeAuctionSale({ listingId: 1 })}
    >
      Execute sale
    </button>
  );
};

Parameters

Returns

a mutation object that can be used to accept an offer on a direct listing