Function useCancelListing

  • Beta

    Cancel a listing

    Parameters

    • contract: RequiredParam<Marketplace>

      an instance of a Marketplace contract

    Returns UseMutationResult<Omit<{
        data: (() => Promise<unknown>);
        receipt: providers.TransactionReceipt;
    }, "data">, unknown, Pick<AuctionListing | DirectListing, "type" | "id">, unknown>

    a mutation object that can be used to cancel a listing

    Example

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

    if (error) {
    console.error("failed to cancel auction listing", error);
    }

    return (
    <button
    disabled={isLoading}
    onClick={cancelListing}
    >
    Cancel Auction Listing!
    </button>
    );
    };

    See

    Documentation

Generated using TypeDoc