Skip to content

Commit afa6ba2

Browse files
GeorgeTsagkguggero
authored andcommitted
lndclient: add listaliases call
1 parent 1181960 commit afa6ba2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-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+
}

0 commit comments

Comments
 (0)