setDefaultChain method
void
setDefaultChain({
- Web3ModalChains? web3modalChain,
- Map<
String, RequiredNamespace> ? requiredNamespaces,
override
Sets the default chain to use for the session.
web3modalChain or requiredNamespaces must be provided, if both are null this function
will do nothing.
Implementation
@override
void setDefaultChain({
Web3ModalChains? web3modalChain,
Map<String, RequiredNamespace>? requiredNamespaces,
}) {
_checkInitialized();
if (web3modalChain != null) {
switch (web3modalChain) {
case Web3ModalChains.ethereum:
_requiredNamespaces = NamespaceConstants.ethereum;
break;
case Web3ModalChains.polygon:
_requiredNamespaces = NamespaceConstants.polygon;
break;
}
}
if (requiredNamespaces != null) {
_requiredNamespaces = requiredNamespaces;
}
notifyListeners();
}