def get_info(self) -> Info: info = self.lrpc.getinfo() pubkey = info['id'] binding = info.get('binding') uris = [] if binding: for b in binding: address = b['address'] if ':' not in address: # TODO: Change type of uri to LightningAddress. port = b['port'] uri = f"{pubkey}@{address}:{port}" uris.append(uri) return Info(uris=uris, )
def info(uris): yield Info(uris=uris, )
def info_with_no_uris(): yield Info(uris=[], )
def get_info(self) -> Info: get_info_request = lnd_pb2.GetInfoRequest() get_info_response = self.stub.GetInfo(get_info_request, ) return Info(uris=get_info_response.uris, )