AddEthereumChain constructor

AddEthereumChain({
  1. required String chainId,
  2. required List<String> rpcUrls,
  3. String? chainName,
  4. Currency? nativeCurrency,
  5. List<String>? iconUrls,
  6. List<String>? blockExplorerUrls,
})

Implementation

AddEthereumChain({
  required String chainId,
  required List<String> rpcUrls,
  String? chainName,
  Currency? nativeCurrency,
  List<String>? iconUrls,
  List<String>? blockExplorerUrls,
}) : super(
        method: 'wallet_addEthereumChain',
        paramsJson: jsonEncode({
          'chainId': chainId,
          'rpcUrls': rpcUrls,
          if (chainName != null) 'chainName': chainName,
          if (nativeCurrency != null) 'nativeCurrency': nativeCurrency,
          if (iconUrls != null) 'iconUrls': iconUrls,
          if (blockExplorerUrls != null)
            'blockExplorerUrls': blockExplorerUrls,
        }),
      );