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);
function useEstimateGas(): UseMutationResult<
Error,
>;

Returns

let returnType: UseMutationResult<
Error,
>;

A mutation object to estimate gas.