Skip to content

Commit 982dcb6

Browse files
committed
cmd: add listinstantouts cmd
1 parent d65ac2b commit 982dcb6

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

cmd/loop/instantout.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,31 @@ func instantOut(ctx *cli.Context) error {
195195

196196
return nil
197197
}
198+
199+
var listInstantOutsCommand = cli.Command{
200+
Name: "listinstantouts",
201+
Usage: "list all instant out swaps",
202+
Description: `
203+
List all instant out swaps.
204+
`,
205+
Action: listInstantOuts,
206+
}
207+
208+
func listInstantOuts(ctx *cli.Context) error {
209+
// First set up the swap client itself.
210+
client, cleanup, err := getClient(ctx)
211+
if err != nil {
212+
return err
213+
}
214+
defer cleanup()
215+
216+
resp, err := client.ListInstantOuts(
217+
context.Background(), &looprpc.ListInstantOutsRequest{},
218+
)
219+
if err != nil {
220+
return err
221+
}
222+
223+
printRespJSON(resp)
224+
return nil
225+
}

cmd/loop/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func main() {
148148
listSwapsCommand, swapInfoCommand, getLiquidityParamsCommand,
149149
setLiquidityRuleCommand, suggestSwapCommand, setParamsCommand,
150150
getInfoCommand, abandonSwapCommand, reservationsCommands,
151-
instantOutCommand,
151+
instantOutCommand, listInstantOutsCommand,
152152
}
153153

154154
err := app.Run(os.Args)

0 commit comments

Comments
 (0)