Skip to content

Commit 06bbb90

Browse files
committed
cmd: add listwithdrawals command
1 parent 614d619 commit 06bbb90

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

cmd/loop/staticaddr.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var staticAddressCommands = cli.Command{
3030
newStaticAddressCommand,
3131
listUnspentCommand,
3232
listDepositsCommand,
33+
listWithdrawalsCommand,
3334
listStaticAddressSwapsCommand,
3435
withdrawalCommand,
3536
summaryCommand,
@@ -312,6 +313,38 @@ func listDeposits(ctx *cli.Context) error {
312313
return nil
313314
}
314315

316+
var listWithdrawalsCommand = cli.Command{
317+
Name: "listwithdrawals",
318+
Usage: "Display a summary of past withdrawals.",
319+
Description: `
320+
`,
321+
Action: listWithdrawals,
322+
}
323+
324+
func listWithdrawals(ctx *cli.Context) error {
325+
ctxb := context.Background()
326+
if ctx.NArg() > 0 {
327+
return cli.ShowCommandHelp(ctx, "withdrawals")
328+
}
329+
330+
client, cleanup, err := getClient(ctx)
331+
if err != nil {
332+
return err
333+
}
334+
defer cleanup()
335+
336+
resp, err := client.ListStaticAddressWithdrawals(
337+
ctxb, &looprpc.ListStaticAddressWithdrawalRequest{},
338+
)
339+
if err != nil {
340+
return err
341+
}
342+
343+
printRespJSON(resp)
344+
345+
return nil
346+
}
347+
315348
var listStaticAddressSwapsCommand = cli.Command{
316349
Name: "listswaps",
317350
Usage: "Shows a list of finalized static address swaps.",

0 commit comments

Comments
 (0)