> For the complete documentation index, see [llms.txt](https://docs.xverse.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xverse.app/sats-connect/wallet-methods/wallet_changenetwork.md).

# wallet\_changeNetwork

Switch the selected network within the wallet.

## 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.![](https://3630714736-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F33DLypUqgcjkBSmN0gZn%2Fuploads%2FWKYwVqbJYafeKtczHox2%2Fimage.png?alt=media\&token=cd585673-0bc0-40c8-8c6c-76815a33840f)
* 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.xverse.app/sats-connect/wallet-methods/wallet_changenetwork.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
