> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Transactions & balance

> The React SDK gave you balance hooks and a built-in transaction confirmation modal. In the JavaScript SDK you read balances and drive the review-and-send flow yourself.

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

| React SDK                                    | JavaScript SDK                                                  |
| -------------------------------------------- | --------------------------------------------------------------- |
| `await wallet.getBalance()`                  | `getNativeBalance({ walletAccount })` / `useGetNativeBalance()` |
| `useTokenBalances({ includeFiat })`          | `getTokenBalances({ includePrices })` / `useGetTokenBalances()` |
| `useTokenBalances({ includeNativeBalance })` | `getTokenBalances({ includeNative })`                           |
| `useEVMTransactionSimulation()`              | `simulateEvmTransaction({ walletAccount, transaction })`        |
| built-in transaction confirmation modal      | you build the review UI from the simulation result              |
| `await wallet.signMessage(message)`          | `signMessage({ walletAccount, message })` / `useSignMessage()`  |

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

<Note>
  `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.
</Note>

The balance UI itself is the same build in any JavaScript SDK app, so it isn't duplicated here. [**Token balances & display** (Building UI)](/docs/javascript/building-ui/token-balances-display) covers the [native balance](/docs/javascript/building-ui/token-balances-display#native-balance), [token holdings](/docs/javascript/building-ui/token-balances-display#token-holdings), and the [options worth knowing](/docs/javascript/building-ui/token-balances-display#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`.

<Note>
  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.
</Note>

The full review-and-send build lives in [**Transaction confirmation & simulation** (Building UI)](/docs/javascript/building-ui/transaction-confirmation):

* [Simulating before you send](/docs/javascript/building-ui/transaction-confirmation#simulating-before-you-send) — the review step with `outAssets` / `inAssets`, `feeData`, and the `validation` verdict.
* [Sending and confirming](/docs/javascript/building-ui/transaction-confirmation#sending-and-confirming) — send with the wallet client, then wait on `confirmTransaction`.
* [Signing a message](/docs/javascript/building-ui/transaction-confirmation#signing-a-message) — `signMessage({ walletAccount, message })` returns `{ signature }`.
* [Handling errors](/docs/javascript/building-ui/transaction-confirmation#handling-errors) — malicious/warning verdicts, rejected prompts, and slow confirmations.

## See also

* [Network management](/docs/javascript/migrating-from-react/network-management) — make sure the wallet is on the right network before sending
* [Transaction confirmation & simulation (Building UI)](/docs/javascript/building-ui/transaction-confirmation) — build the full review step
* [Token balances & display (Building UI)](/docs/javascript/building-ui/token-balances-display) — build the balance UI
