diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index daf69ac8..ca4383a5 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -1491,3 +1491,25 @@ func decodePayReq(ctx *cli.Context) error { printRespJson(resp) return nil } + +var ListChainTxns = cli.Command{ + Name: "listchaintxns", + Usage: "List transactions from the wallet.", + Description: "List all transactions an address of the wallet was involved in.", + Action: listChainTxns, +} + +func listChainTxns(ctx *cli.Context) error { + ctxb := context.Background() + client, cleanUp := getClient(ctx) + defer cleanUp() + + resp, err := client.GetTransactions(ctxb, &lnrpc.GetTransactionsRequest{}) + + if err != nil { + return err + } + + printRespJson(resp) + return nil +} diff --git a/cmd/lncli/main.go b/cmd/lncli/main.go index fe5f68e4..de2c7b19 100644 --- a/cmd/lncli/main.go +++ b/cmd/lncli/main.go @@ -77,6 +77,7 @@ func main() { GetNetworkInfoCommand, DebugLevel, DecodePayReq, + ListChainTxns, } if err := app.Run(os.Args); err != nil {