# 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](https://docs.xverse.app/sats-connect/connecting-to-the-wallet/connect-to-xverse-wallet) and obtained [account read permissions.](https://docs.xverse.app/sats-connect/xverse-wallet-permissions)&#x20;

{% hint style="info" %}
You can fetch the networks that the user's wallet is currently connected to, using [`wallet_getNetwork`](https://docs.xverse.app/sats-connect/wallet-methods/wallet_getnetwork).&#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](https://docs.xverse.app/sats-connect/xverse-wallet-events#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`](https://docs.xverse.app/sats-connect/wallet-methods/wallet_getaccount) method.
{% endhint %}
