diff --git a/lightning_client.go b/lightning_client.go index 34f52afe..a47ff47f 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 +} diff --git a/testdata/permissions.json b/testdata/permissions.json index d385379d..e8ef6412 100644 --- a/testdata/permissions.json +++ b/testdata/permissions.json @@ -696,6 +696,14 @@ } ] }, + "/lnrpc.Lightning/ListAliases": { + "permissions": [ + { + "entity": "offchain", + "action": "read" + } + ] + }, "/neutrinorpc.NeutrinoKit/AddPeer": { "permissions": [ {