A hook to send a transaction.
import { useSendTransaction } from "thirdweb/react";const { mutate: sendTx, data: transactionResult } = useSendTransaction(); // latersendTx(tx);
function useSendTransaction( config: SendTransactionConfig,): UseMutationResult< { chain: Readonly<ChainOptions & { rpc: string }>; client: ThirdwebClient; maxBlocksWaitTime?: number; readonly transactionHash: `0x${string}`; }, Error, PreparedTransaction>;
Configuration for the useSendTransaction hook. Refer to SendTransactionConfig for more details.
useSendTransaction
SendTransactionConfig
let config: SendTransactionConfig;
let returnType: UseMutationResult< { chain: Readonly<ChainOptions & { rpc: string }>; client: ThirdwebClient; maxBlocksWaitTime?: number; readonly transactionHash: `0x${string}`; }, Error, PreparedTransaction>;
A mutation object to send a transaction.