/
query.go
54 lines (46 loc) · 1.26 KB
/
query.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
package cli
import (
"github.com/spf13/cobra"
"github.com/osmosis-labs/osmosis/osmoutils/osmocli"
"github.com/tessornetwork/mokita/x/txfees/types"
)
// GetQueryCmd returns the cli query commands for this module.
func GetQueryCmd() *cobra.Command {
cmd := osmocli.QueryIndexCmd(types.ModuleName)
cmd.AddCommand(
GetCmdFeeTokens(),
GetCmdDenomPoolID(),
GetCmdBaseDenom(),
)
return cmd
}
func GetCmdFeeTokens() *cobra.Command {
return osmocli.SimpleQueryCmd[*types.QueryFeeTokensRequest](
"fee-tokens",
"Query the list of non-basedenom fee tokens and their associated pool ids",
`{{.Short}}{{.ExampleHeader}}
{{.CommandPrefix}} fee-tokens
`,
types.ModuleName, types.NewQueryClient,
)
}
func GetCmdDenomPoolID() *cobra.Command {
return osmocli.SimpleQueryCmd[*types.QueryDenomPoolIdRequest](
"denom-pool-id",
"Query the pool id associated with a specific whitelisted fee token",
`{{.Short}}{{.ExampleHeader}}
{{.CommandPrefix}} denom-pool-id [denom]
`,
types.ModuleName, types.NewQueryClient,
)
}
func GetCmdBaseDenom() *cobra.Command {
return osmocli.SimpleQueryCmd[*types.QueryBaseDenomRequest](
"base-denom",
"Query the base fee denom",
`{{.Short}}{{.ExampleHeader}}
{{.CommandPrefix}} base-denom
`,
types.ModuleName, types.NewQueryClient,
)
}