useSimulateTransaction

A hook to simulate a transaction.

Example

import { useSimulateTransaction } from "thirdweb/react";
const { mutate: simulateTx } = useSimulateTransaction();
// later
const result = await simulateTx(tx);
function useSimulateTransaction(): UseMutationResult<
Awaited<ReturnType<typeof simulateTransaction>>,
Error,
SimulateOptions<abi, abiFn>
>;

Returns

let returnType: UseMutationResult<
Awaited<ReturnType<typeof simulateTransaction>>,
Error,
SimulateOptions<abi, abiFn>
>;

A mutation object to simulate a transaction.