Prerequisites
Before this page: have a connected wallet (see Connecting external wallets) on the network you’re transacting on (see Network switching & validation).Transactions are chain-specific. The examples here use the EVM extension (
@dynamic-labs-sdk/evm). The pattern — simulate, confirm with the user, send, wait — is the same on other chains with that chain’s functions.What you’ll build
A trustworthy “review & send” step:- Simulate the transaction to preview asset changes, fees, and a security verdict — before the user signs.
- Show that preview and let the user approve or cancel.
- Send the transaction with the wallet’s client.
- Wait for it to confirm and update your UI.
Simulating before you send
simulateEvmTransaction returns the assets moving in and out, optional feeData, and a Blockaid validation verdict (benign / warning / malicious). Use it to warn — or block — before the user signs.
- TypeScript
- React
Sending and confirming
Get a wallet client for the account, send the transaction to obtain a hash, thenconfirmTransaction resolves once it’s confirmed on-chain.
- TypeScript
- React
Signing a message
For sign-in prompts, approvals, or off-chain proofs,signMessage returns a signature without a transaction.
- TypeScript
- React
Handling errors
See also
- Token balances & display — reflect balance changes after a transaction
- Network switching & validation — make sure the wallet is on the right network first
- Building a swap UI — a higher-level flow built on the same primitives