cmd: add listinstantouts cmd

This commit is contained in:
sputn1ck 2024-03-01 14:35:15 +01:00
parent 1f211e5647
commit 034bc246ca
No known key found for this signature in database
GPG key ID: 671103D881A5F0E4
2 changed files with 29 additions and 1 deletions

View file

@ -202,3 +202,31 @@ func instantOut(ctx *cli.Context) error {
return nil
}
var listInstantOutsCommand = cli.Command{
Name: "listinstantouts",
Usage: "list all instant out swaps",
Description: `
List all instant out swaps.
`,
Action: listInstantOuts,
}
func listInstantOuts(ctx *cli.Context) error {
// First set up the swap client itself.
client, cleanup, err := getClient(ctx)
if err != nil {
return err
}
defer cleanup()
resp, err := client.ListInstantOuts(
context.Background(), &looprpc.ListInstantOutsRequest{},
)
if err != nil {
return err
}
printRespJSON(resp)
return nil
}

View file

@ -148,7 +148,7 @@ func main() {
listSwapsCommand, swapInfoCommand, getLiquidityParamsCommand,
setLiquidityRuleCommand, suggestSwapCommand, setParamsCommand,
getInfoCommand, abandonSwapCommand, reservationsCommands,
instantOutCommand,
instantOutCommand, listInstantOutsCommand,
}
err := app.Run(os.Args)