useSendTransaction
A hook to send a transaction.
import { useSendTransaction } from "thirdweb/react";const { mutate: sendTx, data: transactionResult } = useSendTransaction(); // latersendTx(tx);
function useSendTransaction(): UseMutationResult< { chain: { readonly blockExplorers?: Array<{ apiUrl?: string; name: string; url: string; }>; readonly experimental?: { increaseZeroByteCount?: boolean }; readonly faucets?: Array<string>; readonly icon?: Icon; readonly id: number; readonly name?: string; readonly nativeCurrency?: { decimals?: number; name?: string; symbol?: string; }; readonly rpc: string; readonly testnet?: true; }; maxBlocksWaitTime?: number; readonly transactionHash: `0x${string}`; }, Error,>;
Configuration for the useSendTransaction
hook.
Refer to SendTransactionConfig
for more details.
let returnType: UseMutationResult< { chain: { readonly blockExplorers?: Array<{ apiUrl?: string; name: string; url: string; }>; readonly experimental?: { increaseZeroByteCount?: boolean }; readonly faucets?: Array<string>; readonly icon?: Icon; readonly id: number; readonly name?: string; readonly nativeCurrency?: { decimals?: number; name?: string; symbol?: string; }; readonly rpc: string; readonly testnet?: true; }; maxBlocksWaitTime?: number; readonly transactionHash: `0x${string}`; }, Error,>;
A mutation object to send a transaction.