Function useAcceptDirectListingOffer

  • Accept a specific offer on a direct listing

    Parameters

    • contract: RequiredParam<Marketplace>

      an instance of a Marketplace contract

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

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

    Remarks

    will accept the latest offer by the given offeror.

    Example

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

    if (error) {
    console.error("failed to accept offer", error);
    }

    return (
    <button
    disabled={isLoading}
    onClick={() => acceptOffer({ listingId: 1, addressOfOfferor: "{{wallet_address}}" })}
    >
    Accept offer
    </button>
    );
    };

    See

    Documentation

Generated using TypeDoc