This function was introduced in SDK version 0.4.0.
addNetwork to add a network to a wallet provider. This function requests that the wallet provider add a network to its list of available networks.
Usage
React
Parameters
walletAccount- The wallet account to add the network for.networkData- The network configuration to add to the wallet, as aNetworkDataobject. Get an existing one fromgetNetworksDataor build it yourself withblockExplorerUrls,chain,displayName,iconUrl,name,nativeCurrency,networkId,rpcUrlsandtestnet.client(optional) - The Dynamic client instance. Only required when using multiple Dynamic clients.
Error Handling
TheaddNetwork function can throw the following errors:
NetworkAddingUnavailableError
If the wallet provider does not support adding networks, the function will throw aNetworkAddingUnavailableError error. In this case, the user must manually add the network in their wallet.