cmd: add listwithdrawals command

This commit is contained in:
Slyghtning 2025-06-02 15:50:05 +02:00
parent 614d61937e
commit 06bbb90fb1
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -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.",