mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-17 13:06:51 +02:00
loop: add swap suggestions command
This commit is contained in:
parent
6b93c70b8a
commit
d54d7055fa
2 changed files with 29 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue