# wallet\_changeNetwork

## Switch the active network in the user's Xverse wallet&#x20;

The `wallet_changeNetwork` method allows your DApp to prompt the user's wallet to switch between different blockchain networks. This feature is essential for workflows that require switching networks, such as bridging assets between different chains or testing features on testnets.

The app must have first [connected to the wallet](/sats-connect/connecting-to-the-wallet/connect-to-xverse-wallet.md) and obtained [account read permissions.](/sats-connect/xverse-wallet-permissions.md)&#x20;

{% hint style="info" %}
You can fetch the networks that the user's wallet is currently connected to, using [`wallet_getNetwork`](/sats-connect/wallet-methods/wallet_getnetwork.md).&#x20;
{% endhint %}

### Parameters

<table><thead><tr><th width="270">Request parameters</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><p>a string representing the network the wallet should switch to. This is a required parameter and should be one of the supported network names:</p><p></p><pre class="language-typescript"><code class="lang-typescript"> enum BitcoinNetworkType {
  Mainnet = 'Mainnet',
  Testnet = 'Testnet',
  Testnet4 = 'Testnet4',
  Signet = 'Signet',
  Regtest = 'Regtest',
}
</code></pre><ul><li><code>Mainnet</code> for Bitcoin Mainnet | Spark Mainnet | Stacks Mainnet | Starknet Mainnet</li><li><code>Regtest</code> for Bitcoin Regtest | Spark Regtest | Stacks Testnet | Starknet Sepolia</li><li><code>Testnet</code> for Bitcoin Testnet | Spark Regtest | Stacks Testnet | Starknet Sepolia</li><li><code>Signet</code> for Bitcoin Signet | Spark Regtest | Stacks Testnet | Starknet Sepolia</li></ul></td></tr></tbody></table>

```typescript
import Wallet from 'sats-connect';

async function example() {
  const res = await Wallet.request('wallet_changeNetwork', {
    name: 'Signet'
  });
  if (res.status === 'error') {
    console.error(res.error);
    return;
  }

  console.log(res.result);
}
```

## :white\_check\_mark: changeNetwork Result&#x20;

The method will&#x20;

* prompt the user to switch their Xverse wallet to the network your app specified.![](/files/YXyevgVzN93ahnlsgbWR)
* return `null` if the user accepts to switch their wallet to the new network -> **Null response**

The account switch in the wallet will emit a [networkChange](/sats-connect/xverse-wallet-events.md#networkchange-event) event which your app can catch.

{% hint style="info" %}
Your app can then fetch the user's active Xverse account under the new network with the [`wallet_getAccount`](/sats-connect/wallet-methods/wallet_getaccount.md) method.
{% 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.xverse.app/sats-connect/wallet-methods/wallet_changenetwork.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.
