Documentation ¶
Index ¶
- func ConfigCmd(defaultCLIHome string) *cobra.Command
- func Paginate(numObjs, page, limit, defLimit int) (start, end int)
- func ReadPageRequest(flagSet *pflag.FlagSet) (*query.PageRequest, error)
- func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router)
- func ValidateCmd(cmd *cobra.Command, args []string) error
- type Account
- type AccountRetriever
- type TxBuilder
- type TxConfig
- type TxEncodingConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigCmd ¶
ConfigCmd returns a CLI command to interactively create an application CLI config file.
func Paginate ¶
Paginate returns the correct starting and ending index for a paginated query, given that client provides a desired page and limit of objects and the handler provides the total number of objects. If the start page is invalid, non-positive values are returned signaling the request is invalid.
NOTE: The start page is assumed to be 1-indexed.
func ReadPageRequest ¶ added in v1.3.0
func ReadPageRequest(flagSet *pflag.FlagSet) (*query.PageRequest, error)
ReadPageRequest reads and builds the necessary page request flags for pagination.
Types ¶
type Account ¶ added in v1.3.0
type Account interface { GetAddress() sdk.AccAddress GetPubKey() crypto.PubKey // can return nil. GetAccountNumber() uint64 GetSequence() uint64 }
Account defines a read-only version of the auth module's AccountI.
type AccountRetriever ¶ added in v1.3.0
type AccountRetriever interface { GetAccount(clientCtx clictx.CLIContext, addr sdk.AccAddress) (Account, error) GetAccountWithHeight(clientCtx clictx.CLIContext, addr sdk.AccAddress) (Account, int64, error) EnsureExists(clientCtx clictx.CLIContext, addr sdk.AccAddress) error GetAccountNumberSequence(clientCtx clictx.CLIContext, addr sdk.AccAddress) (accNum uint64, accSeq uint64, err error) }
AccountRetriever defines the interfaces required by transactions to ensure an account exists and to be able to query for account fields necessary for signing.
type TxBuilder ¶ added in v1.3.0
type TxBuilder interface { GetTx() signingtypes.Tx SetMsgs(msgs ...ibcmsg.Msg) error SetSignatures(signatures ...signing.SignatureV2) error SetMemo(memo string) SetFeeAmount(amount sdk.CoinAdapters) SetGasLimit(limit uint64) SetTimeoutHeight(height uint64) SetFeeGranter(feeGranter sdk.AccAddress) }
TxBuilder defines an interface which an application-defined concrete transaction type must implement. Namely, it must be able to set messages, generate signatures, and provide canonical bytes to sign over. The transaction must also know how to encode itself.
type TxConfig ¶ added in v1.3.0
type TxConfig interface { TxEncodingConfig NewTxBuilder() TxBuilder WrapTxBuilder(tx ibcmsg.Tx) (TxBuilder, error) SignModeHandler() signingtypes.SignModeHandler }
TxConfig defines an interface a client can utilize to generate an application-defined concrete transaction type. The type returned must implement TxBuilder.
type TxEncodingConfig ¶ added in v1.3.0
type TxEncodingConfig interface { TxEncoder() ibcmsg.IBCTxEncoder TxDecoder() ibcmsg.IbcTxDecoder TxJSONEncoder() ibcmsg.IBCTxEncoder //TxJSONDecoder() sdk.TxDecoder MarshalSignatureJSON([]signing.SignatureV2) ([]byte, error) UnmarshalSignatureJSON([]byte) ([]signing.SignatureV2, error) }
TxEncodingConfig defines an interface that contains transaction encoders and decoders