Documentation Index
Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
Use signTransaction to sign a transaction without sending it. This is useful when you need to prepare a signed transaction for later submission or for use with external services.
import { parseEther } from "viem";
import { useDynamicContext } from "@dynamic-labs/sdk-react-core";
import { isEthereumWallet } from "@dynamic-labs/ethereum";
const { primaryWallet } = useDynamicContext();
if (!primaryWallet || !isEthereumWallet(primaryWallet)) return null;
const walletClient = await primaryWallet.getWalletClient();
const signedTransaction = await walletClient.signTransaction({
to: "0x...",
value: parseEther("0.05"),
});