toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'chainId': chainHexId,
    'chainName': chainName,
    'nativeCurrency': {
      'name': tokenName,
      'symbol': tokenName,
      'decimals': 18,
    },
    'rpcUrls': [
      rpcUrl,
      ...extraRpcUrls,
    ],
    if (blockExplorer != null && blockExplorer!.url.isNotEmpty)
      'blockExplorerUrls': [
        blockExplorer!.url,
      ],
  };
}