Map<String, dynamic> toJson() { return { 'address': address, 'chain': chainName, 'networkId': chainId, 'self': self?.toJson(), 'peer': peer?.toJson(), }; }