wallet_changeNetwork
Switch the selected network within the wallet.
Last updated
Switch the selected network within the wallet.
Last updated
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 and obtained
name
a string representing the network the wallet should switch to. This is a required parameter and should be one of the supported network names:
Mainnet
for Bitcoin & Stacks mainnet
Testnet
for Bitcoin & Stacks testnet
Signet
for Bitcoin Signet & Stacks testnet
Regtest
for Bitcoin Regtest & Stacks testnet
Null response
This method returns null
if the active chain is switched.
The account switch will emit a event which your app can catch.
Your app can then fetch the user's active Xverse account under the new network with the method.