Skip to content

Commit f422592

Browse files
authored
Merge pull request #202 from GeorgeTsagk/listaliases
Add `ListAliases` call
2 parents 895a850 + 9af44b7 commit f422592

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

lightning_client.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ type LightningClient interface {
303303
// from the signature.
304304
VerifyMessage(ctx context.Context, data []byte, signature string) (bool,
305305
string, error)
306+
307+
// ListAliases returns the set of all aliases that have ever existed
308+
// with their confirmed SCID (if it exists) and/or the base SCID (in the
309+
// case of zero conf).
310+
ListAliases(ctx context.Context) ([]*lnrpc.AliasMap, error)
306311
}
307312

308313
// Info contains info about the connected lnd node.
@@ -4427,3 +4432,17 @@ func (s *lightningClient) SubscribeTransactions(
44274432

44284433
return txChan, errChan, nil
44294434
}
4435+
4436+
// ListAliases returns the set of all aliases that have ever existed with their
4437+
// confirmed SCID (if it exists) and/or the base SCID (in the case of zero
4438+
// conf).
4439+
func (s *lightningClient) ListAliases(
4440+
ctx context.Context) ([]*lnrpc.AliasMap, error) {
4441+
4442+
res, err := s.client.ListAliases(ctx, &lnrpc.ListAliasesRequest{})
4443+
if err != nil {
4444+
return nil, err
4445+
}
4446+
4447+
return res.AliasMaps, nil
4448+
}

testdata/permissions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,14 @@
696696
}
697697
]
698698
},
699+
"/lnrpc.Lightning/ListAliases": {
700+
"permissions": [
701+
{
702+
"entity": "offchain",
703+
"action": "read"
704+
}
705+
]
706+
},
699707
"/neutrinorpc.NeutrinoKit/AddPeer": {
700708
"permissions": [
701709
{

0 commit comments

Comments
 (0)