Skip to main content
In the React SDK you read balances with useTokenBalances() and wallet.getBalance(), and the widget rendered the transaction confirmation modal (simulation preview, fees, security warnings) before a send. The JavaScript SDK exposes the same balance data and the same simulation result as functions and matching React hooks, and leaves the confirmation UI to you.

What maps to what

Reading balances

wallet.getBalance() returned a single native-balance string; getNativeBalance({ walletAccount }) returns { balance } (a human-readable string, or null while unavailable) and getTokenBalances({ walletAccount }) returns one entry per token. Watch two renamed options when migrating: the React SDK’s includeFiat is now includePrices, and includeNativeBalance is now includeNative.
balance on a TokenBalance is already scaled by the token’s decimals for display. When you need the exact integer amount (for a transfer, say), use rawBalanceString — it preserves precision a JavaScript number can lose.
The balance UI itself is the same build in any JavaScript SDK app, so it isn’t duplicated here. Token balances & display (Building UI) covers the native balance, token holdings, and the options worth knowing. Both queries auto-refetch when the wallet’s balances or network change — the same auto-refresh the widget gave you.

Simulating and sending a transaction

The one migration change is that the React SDK’s confirmation modal — which ran a simulation, showed asset changes, fees, and a security verdict, then sent — is gone. You now call simulateEvmTransaction yourself, render your own review step, gate the approve button on validation.result (block 'malicious', warn on 'warning'), then send with the wallet client and wait for confirmTransaction.
Transactions are chain-specific. Use the EVM extension (@dynamic-labs-sdk/evm) shown in the Building UI guide; the simulate → review → send → confirm pattern is the same on other chains with that chain’s functions.
The full review-and-send build lives in Transaction confirmation & simulation (Building UI):

See also

Last modified on July 23, 2026