File tree Expand file tree Collapse file tree 2 files changed +56
-1
lines changed Expand file tree Collapse file tree 2 files changed +56
-1
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ func main() {
147147 monitorCommand , quoteCommand , listAuthCommand ,
148148 listSwapsCommand , swapInfoCommand , getLiquidityParamsCommand ,
149149 setLiquidityRuleCommand , suggestSwapCommand , setParamsCommand ,
150- getInfoCommand , abandonSwapCommand ,
150+ getInfoCommand , abandonSwapCommand , reservationsCommands ,
151151 }
152152
153153 err := app .Run (os .Args )
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "context"
5+
6+ "github.com/lightninglabs/loop/looprpc"
7+ "github.com/urfave/cli"
8+ )
9+
10+ var reservationsCommands = cli.Command {
11+
12+ Name : "reservations" ,
13+ ShortName : "r" ,
14+ Usage : "manage reservations" ,
15+ Description : `
16+ With loopd running, you can use this command to manage your
17+ reservations. Reservations are 2-of-2 multisig utxos that
18+ the loop server can open to clients. The reservations are used
19+ to enable instant swaps.
20+ ` ,
21+ Subcommands : []cli.Command {
22+ listReservationsCommand ,
23+ },
24+ }
25+
26+ var (
27+ listReservationsCommand = cli.Command {
28+ Name : "list" ,
29+ ShortName : "l" ,
30+ Usage : "list all reservations" ,
31+ ArgsUsage : "" ,
32+ Description : `
33+ List all reservations.
34+ ` ,
35+ Action : listReservations ,
36+ }
37+ )
38+
39+ func listReservations (ctx * cli.Context ) error {
40+ client , cleanup , err := getClient (ctx )
41+ if err != nil {
42+ return err
43+ }
44+ defer cleanup ()
45+
46+ resp , err := client .ListReservations (
47+ context .Background (), & looprpc.ListReservationsRequest {},
48+ )
49+ if err != nil {
50+ return err
51+ }
52+
53+ printRespJSON (resp )
54+ return nil
55+ }
You can’t perform that action at this time.
0 commit comments