Skip to content

useFeeRate

Gets the current fee rate for Bitcoin transactions.

Import

ts
import { useFeeRate } from "@midl/react";

Example

tsx
function FeeRate() {
  const { feeRate, isLoading, error } = useFeeRate();

  if (isLoading) return <div>Loading...</div>;
  if (error) return <div>Error: {error.message}</div>;

  return <div>Fee Rate: {feeRate}</div>;
}

Parameters

NameTypeDescription
queryUseQueryOptions(optional) Query options for react-query.
configConfig(optional) Custom config to override the default from context.

Returns

NameTypeDescription
feeRateGetFeeRateResponseThe current fee rate response schema
...restobjectAdditional query state (e.g. isLoading, error, etc.).