sonr/x/vault/client/cli/query.go
Prad Nukala 60c48d2409
feature/did accounts (#23)
* feat: add support for DID number as primary key for Controllers

* refactor: rename pkg/proxy to app/proxy

* feat: add vault module keeper tests

* feat(vault): add DID keeper to vault module

* refactor: move vault client code to its own package

* refactor(vault): extract schema definition

* refactor: use vaulttypes for MsgAllocateVault

* refactor: update vault assembly logic to use new methods

* feat: add dwn-proxy command

* refactor: remove unused context.go file

* refactor: remove unused web-related code

* feat: add DWN proxy server

* feat: add BuildTx RPC to vault module

* fix: Implement BuildTx endpoint

* feat: add devbox integration to project
2024-09-25 19:45:28 -04:00

51 lines
1.1 KiB
Go

package cli
import (
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/onsonr/sonr/x/vault/types"
)
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
func GetQueryCmd() *cobra.Command {
queryCmd := &cobra.Command{
Use: types.ModuleName,
Short: "Querying commands for " + types.ModuleName,
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
}
queryCmd.AddCommand(
GetCmdParams(),
)
return queryCmd
}
func GetCmdParams() *cobra.Command {
cmd := &cobra.Command{
Use: "params",
Short: "Show all module params",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)
res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
if err != nil {
return err
}
return clientCtx.PrintProto(res)
},
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
}