DOCS

useMakeOffer

Nake an offer on a direct or auction listing

Example

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

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

  return (
    <button
      disabled={isLoading}
      onClick={() =>
        makeOffer({ listingId: 1, pricePerToken: 0.5, quantity: 1 })
      }
    >
      Bid!
    </button>
  );
};

Parameters

Returns

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