Docs

useEstimateGas

A hook to estimate the gas for a given transaction.

Example

import { useEstimateGas } from "thirdweb/react";
const { mutate: estimateGas, data: gasEstimate } = useEstimateGas();
// later
const estimatedGas = await estimateGas(tx);

Returns

A mutation object to estimate gas.