forked from osmosis-labs/osmosis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flags.go
106 lines (82 loc) · 3.18 KB
/
flags.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package cli
import (
flag "github.com/spf13/pflag"
)
const (
// Will be parsed to string
FlagPoolFile = "pool-file"
// Names of fields in pool json file
PoolFileWeights = "weights"
PoolFileInitialDeposit = "initial-deposit"
PoolFileSwapFee = "swap-fee"
PoolFileExitFee = "exit-fee"
PoolFileFutureGovernor = "future-governor"
PoolFileSmoothWeightChangeParams = "lbp-params"
PoolFileStartTime = "start-time"
PoolFileDuration = "duration"
PoolFileTargetPoolWeights = "target-pool-weights"
FlagPoolId = "pool-id"
// Will be parsed to sdk.Int
FlagShareAmountOut = "share-amount-out"
// Will be parsed to []sdk.Coin
FlagMaxAmountsIn = "max-amounts-in"
// Will be parsed to sdk.Int
FlagShareAmountIn = "share-amount-in"
// Will be parsed to []sdk.Coin
FlagMinAmountsOut = "min-amounts-out"
// Will be parsed to uint64
FlagSwapRoutePoolIds = "swap-route-pool-ids"
// Will be parsed to []sdk.Coin
FlagSwapRouteAmounts = "swap-route-amounts"
// Will be parsed to []string
FlagSwapRouteDenoms = "swap-route-denoms"
)
type createPoolInputs struct {
Weights string `json:"weights"`
InitialDeposit string `json:"initial-deposit"`
SwapFee string `json:"swap-fee"`
ExitFee string `json:"exit-fee"`
FutureGovernor string `json:"future-governor"`
SmoothWeightChangeParams smoothWeightChangeParamsInputs `json:"lbp-params"`
}
type smoothWeightChangeParamsInputs struct {
StartTime string `json:"start-time"`
Duration string `json:"duration"`
TargetPoolWeights string `json:"target-pool-weights"`
}
func FlagSetQuerySwapRoutes() *flag.FlagSet {
fs := flag.NewFlagSet("", flag.ContinueOnError)
fs.StringArray(FlagSwapRoutePoolIds, []string{""}, "swap route pool id")
fs.StringArray(FlagSwapRouteDenoms, []string{""}, "swap route amount")
return fs
}
func FlagSetSwapAmountOutRoutes() *flag.FlagSet {
fs := flag.NewFlagSet("", flag.ContinueOnError)
fs.StringArray(FlagSwapRoutePoolIds, []string{""}, "swap route pool ids")
fs.StringArray(FlagSwapRouteDenoms, []string{""}, "swap route denoms")
return fs
}
func FlagSetCreatePool() *flag.FlagSet {
fs := flag.NewFlagSet("", flag.ContinueOnError)
fs.String(FlagPoolFile, "", "Pool json file path (if this path is given, other create pool flags should not be used)")
return fs
}
func FlagSetJoinPool() *flag.FlagSet {
fs := flag.NewFlagSet("", flag.ContinueOnError)
fs.Uint64(FlagPoolId, 0, "The id of pool")
fs.String(FlagShareAmountOut, "", "TODO: add description")
fs.StringArray(FlagMaxAmountsIn, []string{""}, "TODO: add description")
return fs
}
func FlagSetExitPool() *flag.FlagSet {
fs := flag.NewFlagSet("", flag.ContinueOnError)
fs.Uint64(FlagPoolId, 0, "The id of pool")
fs.String(FlagShareAmountIn, "", "TODO: add description")
fs.StringArray(FlagMinAmountsOut, []string{""}, "TODO: add description")
return fs
}
func FlagSetJoinSwapExternAmount() *flag.FlagSet {
fs := flag.NewFlagSet("", flag.ContinueOnError)
fs.Uint64(FlagPoolId, 0, "The id of pool")
return fs
}