mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
cmd: add listwithdrawals command
This commit is contained in:
parent
614d61937e
commit
06bbb90fb1
1 changed files with 33 additions and 0 deletions
|
|
@ -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.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue