Skip to content

Commit 3deeb3a

Browse files
sputn1ckhieblmi
authored andcommitted
loopcli/staticaddr: explicit loop in command
1 parent 115558b commit 3deeb3a

File tree

1 file changed

+38
-32
lines changed

1 file changed

+38
-32
lines changed

cmd/loop/staticaddr.go

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,38 +29,8 @@ var staticAddressCommands = cli.Command{
2929
listStaticAddressSwapsCommand,
3030
withdrawalCommand,
3131
summaryCommand,
32+
staticAddressLoopInCommand,
3233
},
33-
Description: `
34-
Requests a loop-in swap based on static address deposits. After the
35-
creation of a static address funds can be send to it. Once the funds are
36-
confirmed on-chain they can be swapped instantaneously. If deposited
37-
funds are not needed they can we withdrawn back to the local lnd wallet.
38-
`,
39-
Flags: []cli.Flag{
40-
cli.StringSliceFlag{
41-
Name: "utxo",
42-
Usage: "specify the utxos of deposits as " +
43-
"outpoints(tx:idx) that should be looped in.",
44-
},
45-
cli.BoolFlag{
46-
Name: "all",
47-
Usage: "loop in all static address deposits.",
48-
},
49-
cli.DurationFlag{
50-
Name: "payment_timeout",
51-
Usage: "the maximum time in seconds that the server " +
52-
"is allowed to take for the swap payment. " +
53-
"The client can retry the swap with adjusted " +
54-
"parameters after the payment timed out.",
55-
},
56-
lastHopFlag,
57-
labelFlag,
58-
routeHintsFlag,
59-
privateFlag,
60-
forceFlag,
61-
verboseFlag,
62-
},
63-
Action: staticAddressLoopIn,
6434
}
6535

6636
var newStaticAddressCommand = cli.Command{
@@ -427,9 +397,45 @@ func NewProtoOutPoint(op string) (*looprpc.OutPoint, error) {
427397
}, nil
428398
}
429399

400+
var staticAddressLoopInCommand = cli.Command{
401+
Name: "in",
402+
Usage: "Loop in funds from static address deposits.",
403+
Description: `
404+
Requests a loop-in swap based on static address deposits. After the
405+
creation of a static address funds can be sent to it. Once the funds are
406+
confirmed on-chain they can be swapped instantaneously. If deposited
407+
funds are not needed they can we withdrawn back to the local lnd wallet.
408+
`,
409+
Flags: []cli.Flag{
410+
cli.StringSliceFlag{
411+
Name: "utxo",
412+
Usage: "specify the utxos of deposits as " +
413+
"outpoints(tx:idx) that should be looped in.",
414+
},
415+
cli.BoolFlag{
416+
Name: "all",
417+
Usage: "loop in all static address deposits.",
418+
},
419+
cli.DurationFlag{
420+
Name: "payment_timeout",
421+
Usage: "the maximum time in seconds that the server " +
422+
"is allowed to take for the swap payment. " +
423+
"The client can retry the swap with adjusted " +
424+
"parameters after the payment timed out.",
425+
},
426+
lastHopFlag,
427+
labelFlag,
428+
routeHintsFlag,
429+
privateFlag,
430+
forceFlag,
431+
verboseFlag,
432+
},
433+
Action: staticAddressLoopIn,
434+
}
435+
430436
func staticAddressLoopIn(ctx *cli.Context) error {
431437
if ctx.NumFlags() == 0 && ctx.NArg() == 0 {
432-
return cli.ShowAppHelp(ctx)
438+
return cli.ShowCommandHelp(ctx, "in")
433439
}
434440

435441
client, cleanup, err := getClient(ctx)

0 commit comments

Comments
 (0)