|
|
@ -48,6 +48,14 @@ var setLiquidityRuleCommand = cli.Command{
|
|
|
|
Description: "Update or remove the liquidity rule for a channel/peer.",
|
|
|
|
Description: "Update or remove the liquidity rule for a channel/peer.",
|
|
|
|
ArgsUsage: "{shortchanid | peerpubkey}",
|
|
|
|
ArgsUsage: "{shortchanid | peerpubkey}",
|
|
|
|
Flags: []cli.Flag{
|
|
|
|
Flags: []cli.Flag{
|
|
|
|
|
|
|
|
cli.StringFlag{
|
|
|
|
|
|
|
|
Name: "type",
|
|
|
|
|
|
|
|
Usage: "the type of swap to perform, set to 'out' " +
|
|
|
|
|
|
|
|
"for acquiring inbound liquidity or 'in' for " +
|
|
|
|
|
|
|
|
"acquiring outbound liquidity.",
|
|
|
|
|
|
|
|
Value: "out",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
cli.IntFlag{
|
|
|
|
cli.IntFlag{
|
|
|
|
Name: "incoming_threshold",
|
|
|
|
Name: "incoming_threshold",
|
|
|
|
Usage: "the minimum percentage of incoming liquidity " +
|
|
|
|
Usage: "the minimum percentage of incoming liquidity " +
|
|
|
@ -168,7 +176,18 @@ func setRule(ctx *cli.Context) error {
|
|
|
|
newRule := &looprpc.LiquidityRule{
|
|
|
|
newRule := &looprpc.LiquidityRule{
|
|
|
|
ChannelId: chanID,
|
|
|
|
ChannelId: chanID,
|
|
|
|
Type: looprpc.LiquidityRuleType_THRESHOLD,
|
|
|
|
Type: looprpc.LiquidityRuleType_THRESHOLD,
|
|
|
|
SwapType: looprpc.SwapType_LOOP_OUT,
|
|
|
|
}
|
|
|
|
|
|
|
|
if ctx.IsSet("type") {
|
|
|
|
|
|
|
|
switch ctx.String("type") {
|
|
|
|
|
|
|
|
case "in":
|
|
|
|
|
|
|
|
newRule.SwapType = looprpc.SwapType_LOOP_IN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case "out":
|
|
|
|
|
|
|
|
newRule.SwapType = looprpc.SwapType_LOOP_OUT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return errors.New("please set type to in or out")
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if pubkeyRule {
|
|
|
|
if pubkeyRule {
|
|
|
|