-
Notifications
You must be signed in to change notification settings - Fork 560
/
query.go
66 lines (56 loc) · 1.64 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
55
56
57
58
59
60
61
62
63
64
65
66
package cli
import (
"github.com/spf13/cobra"
"github.com/osmosis-labs/osmosis/osmoutils/osmocli"
"github.com/osmosis-labs/osmosis/v21/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(),
)
osmocli.AddQueryCmd(cmd, types.NewQueryClient, GetCmdQueryBaseFee)
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,
)
}
func GetCmdQueryBaseFee() (*osmocli.QueryDescriptor, *types.QueryEipBaseFeeRequest) {
return &osmocli.QueryDescriptor{
Use: "base-fee",
Short: "Query the eip base fee.",
Long: `{{.Short}}{{.ExampleHeader}}
{{.CommandPrefix}} base-fee`,
QueryFnName: "GetEipBaseFee",
}, &types.QueryEipBaseFeeRequest{}
}