> ## 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.

# Sign a transaction on Ethereum/EVM

> Sign an EVM transaction without broadcasting it to the network.

<Card title="Recommended: JavaScript SDK with React Hooks" icon="react" color="#4779FE">
  For new React apps, we recommend the JavaScript SDK with React Hooks (`@dynamic-labs-sdk/react-hooks`) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the [React quickstart (JavaScript SDK)](/javascript/reference/react-quickstart) to get started.
</Card>

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.

```tsx theme={"system"}
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"),
});
```
