|
|
|
@ -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
|
|
|
|
|
}
|
|
|
|
|