From 6743d9788d2312fb84d16db0f79ff2a52963d46b Mon Sep 17 00:00:00 2001 From: George Tsagkarelis Date: Wed, 13 Nov 2024 16:28:26 +0100 Subject: [PATCH] lndclient: add listaliases call --- lightning_client.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lightning_client.go b/lightning_client.go index 34f52af..a47ff47 100644 --- a/lightning_client.go +++ b/lightning_client.go @@ -303,6 +303,11 @@ type LightningClient interface { // from the signature. VerifyMessage(ctx context.Context, data []byte, signature string) (bool, string, error) + + // ListAliases returns the set of all aliases that have ever existed + // with their confirmed SCID (if it exists) and/or the base SCID (in the + // case of zero conf). + ListAliases(ctx context.Context) ([]*lnrpc.AliasMap, error) } // Info contains info about the connected lnd node. @@ -4427,3 +4432,17 @@ func (s *lightningClient) SubscribeTransactions( return txChan, errChan, nil } + +// ListAliases returns the set of all aliases that have ever existed with their +// confirmed SCID (if it exists) and/or the base SCID (in the case of zero +// conf). +func (s *lightningClient) ListAliases( + ctx context.Context) ([]*lnrpc.AliasMap, error) { + + res, err := s.client.ListAliases(ctx, &lnrpc.ListAliasesRequest{}) + if err != nil { + return nil, err + } + + return res.AliasMaps, nil +}