Function useExecuteAuctionSale

  • Beta

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

    Parameters

    • contract: RequiredParam<Marketplace>

      an instance of a Marketplace contract

    Returns UseMutationResult<Omit<{
        data: (() => Promise<unknown>);
        receipt: providers.TransactionReceipt;
    }, "data">, unknown, ExecuteAuctionSale, unknown>

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

    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>
    );
    };

    See

    Documentation

Generated using TypeDoc