diff --git a/cmd/loop/staticaddr.go b/cmd/loop/staticaddr.go index 8f595f72..c9e08db5 100644 --- a/cmd/loop/staticaddr.go +++ b/cmd/loop/staticaddr.go @@ -30,6 +30,7 @@ var staticAddressCommands = cli.Command{ newStaticAddressCommand, listUnspentCommand, listDepositsCommand, + listWithdrawalsCommand, listStaticAddressSwapsCommand, withdrawalCommand, summaryCommand, @@ -312,6 +313,38 @@ func listDeposits(ctx *cli.Context) error { return nil } +var listWithdrawalsCommand = cli.Command{ + Name: "listwithdrawals", + Usage: "Display a summary of past withdrawals.", + Description: ` + `, + Action: listWithdrawals, +} + +func listWithdrawals(ctx *cli.Context) error { + ctxb := context.Background() + if ctx.NArg() > 0 { + return cli.ShowCommandHelp(ctx, "withdrawals") + } + + client, cleanup, err := getClient(ctx) + if err != nil { + return err + } + defer cleanup() + + resp, err := client.ListStaticAddressWithdrawals( + ctxb, &looprpc.ListStaticAddressWithdrawalRequest{}, + ) + if err != nil { + return err + } + + printRespJSON(resp) + + return nil +} + var listStaticAddressSwapsCommand = cli.Command{ Name: "listswaps", Usage: "Shows a list of finalized static address swaps.",