Skip to content

Commit 034bc24

Browse files
committed
cmd: add listinstantouts cmd
1 parent 1f211e5 commit 034bc24

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
@@ -202,3 +202,31 @@ func instantOut(ctx *cli.Context) error {
202202

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

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)