wallet_changeNetwork
Switch the selected network within the wallet.
Switch the active network in the user's Xverse wallet
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 and obtained account read permissions.
Parameters
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 testnetRegtest
for Bitcoin Regtest & Stacks testnet
✅ changeNetwork Result
Null response
This method returns null
if the active chain is switched.
The account switch will emit a networkChange event which your app can catch.
Last updated