# Migration

### New SDK Version

```
npm install @leapwallet/embedded-wallet-sdk-react@latest
```

### From v0 to v1

1. **Aggregated View:** This view allows dApp to choose multiple chains for which they can show aggregated balances.
2. **Addresses View:** Address page allows user to view and copy addresses of chains for which balances are being showed.
3. **Action Button Customization:** Providing more flexible action button usage by allowing to optionally hide them and change their ordering.
4. **Scan for more discoverable chains:** When using chains which share coin-types with others chains which you might not have passed a record for, they will automatically be discovered and will be used in fetching balances. You can disable this by enabling `restrictChains` as false.

Now you can pass addresses and REST URLs of chains as follows:

```
<AccountModal
  theme="dark"
  chainRecords={chainData}
  isOpen={isModalOpen}
  onClose={closeModal}
/>
```

where `chainData` is a record of address and REST URL, having chain-id as their keys.

### From v1 to v2

1. **Wallet Connection:** Allows dApp to pass their wallet connection management hooks in order to control wallet connection from embedded wallet.
2. **Fetching balances from connected account:** Instead of passing chain records, balances can be fetched using the connected chains via wallet connection itself. dApp can optionally pass a list of chain-ids to restrict balance fetching to only those chains.

{% hint style="info" %}
All exported components like AccountModal and AccountView need to be enclosed by EmbeddedWalletProvider.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.leapwallet.io/cosmos/embedded-wallet-sdk/migration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
