loop: add swap suggestions command

pull/278/head
carla 4 years ago
parent 6b93c70b8a
commit d54d7055fa
No known key found for this signature in database
GPG Key ID: 4CA7FE54A6213C91

@ -170,3 +170,31 @@ func setParam(ctx *cli.Context) error {
return err
}
var suggestSwapCommand = cli.Command{
Name: "suggestswaps",
Usage: "show a list of suggested swaps",
Description: "Displays a list of suggested swaps that aim to obtain " +
"the liquidity balance as specified by the rules set in " +
"the liquidity manager.",
Action: suggestSwap,
}
func suggestSwap(ctx *cli.Context) error {
client, cleanup, err := getClient(ctx)
if err != nil {
return err
}
defer cleanup()
resp, err := client.SuggestSwaps(
context.Background(), &looprpc.SuggestSwapsRequest{},
)
if err != nil {
return err
}
printJSON(resp)
return nil
}

@ -110,7 +110,7 @@ func main() {
loopOutCommand, loopInCommand, termsCommand,
monitorCommand, quoteCommand, listAuthCommand,
listSwapsCommand, swapInfoCommand, getLiquidityParamsCommand,
setLiquidityParamCommand,
setLiquidityParamCommand, suggestSwapCommand,
}
err := app.Run(os.Args)

Loading…
Cancel
Save