github.com/lino-network/lino@v0.6.11/x/price/client/cli/query.go (about)

     1  package cli
     2  
     3  import (
     4  	// "fmt"
     5  
     6  	"github.com/cosmos/cosmos-sdk/client"
     7  	"github.com/cosmos/cosmos-sdk/codec"
     8  	"github.com/spf13/cobra"
     9  
    10  	linotypes "github.com/lino-network/lino/types"
    11  	"github.com/lino-network/lino/utils"
    12  	"github.com/lino-network/lino/x/price/model"
    13  	"github.com/lino-network/lino/x/price/types"
    14  )
    15  
    16  func GetQueryCmd(cdc *codec.Codec) *cobra.Command {
    17  	cmd := &cobra.Command{
    18  		Use:                        types.ModuleName,
    19  		Short:                      "Querying commands for the price module",
    20  		DisableFlagParsing:         true,
    21  		SuggestionsMinimumDistance: 2,
    22  		RunE:                       client.ValidateCmd,
    23  	}
    24  	cmd.AddCommand(client.GetCommands(
    25  		utils.SimpleQueryCmd(
    26  			"current",
    27  			"current",
    28  			types.QuerierRoute, types.QueryPriceCurrent,
    29  			0, &linotypes.MiniDollar{})(cdc),
    30  		utils.SimpleQueryCmd(
    31  			"history",
    32  			"history",
    33  			types.QuerierRoute, types.QueryPriceHistory,
    34  			0, &([]model.FeedHistory{}))(cdc),
    35  		utils.SimpleQueryCmd(
    36  			"last-feed <username>",
    37  			"last-feed <username>",
    38  			types.QuerierRoute, types.QueryLastFeed,
    39  			1, &model.FedPrice{})(cdc),
    40  	)...)
    41  	return cmd
    42  }