• Beta

    Make a bid on an auction listing

    Parameters

    • contract: RequiredParam<Marketplace>

      an instance of a Marketplace contract

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

    a mutation object that can be used to make a bid on an auction listing

    Example

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

    if (error) {
    console.error("failed to make a bid", error);
    }

    return (
    <button
    disabled={isLoading}
    onClick={() => makeBid({ listingId: 1, bid: 2 })}
    >
    Bid!
    </button>
    );
    };

    See

    Documentation

Generated using TypeDoc