client

package
v0.50.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 50 Imported by: 18,767

Documentation

Index

Constants

View Source
const ClientContextKey = sdk.ContextKey("client.context")

ClientContextKey defines the context key used to retrieve a client.Context from a command's Context.

Variables

This section is empty.

Functions

func CamelCaseToString added in v0.46.2

func CamelCaseToString(str string) string

CamelCaseToString converts a camel case string to a string with spaces.

func CheckCometError added in v0.50.0

func CheckCometError(err error, tx cmttypes.Tx) *sdk.TxResponse

CheckCometError checks if the error returned from BroadcastTx is a CometBFT error that is returned before the tx is submitted due to precondition checks that failed. If an CometBFT error is detected, this function returns the correct code back in TxResponse.

TODO: Avoid brittle string matching in favor of error matching. This requires a change to CometBFT's RPCError type to allow retrieval or matching against a concrete error type.

func CheckTendermintError deprecated added in v0.40.0

func CheckTendermintError(err error, tx cmttypes.Tx) *sdk.TxResponse

Deprecated: Use CheckCometError instead.

func FlagSetWithPageKeyDecoded added in v0.47.0

func FlagSetWithPageKeyDecoded(flagSet *pflag.FlagSet) (*pflag.FlagSet, error)

FlagSetWithPageKeyDecoded returns the provided flagSet with the page-key value base64 decoded (if it exists). This is for when the page-key is provided as a base64 string (e.g. from the CLI). ReadPageRequest expects it to be the raw bytes.

Common usage: fs, err := client.FlagSetWithPageKeyDecoded(cmd.Flags()) pageReq, err := client.ReadPageRequest(fs)

func GetFromFields added in v0.36.0

func GetFromFields(clientCtx Context, kr keyring.Keyring, from string) (sdk.AccAddress, string, keyring.KeyType, error)

GetFromFields returns a from account address, account name and keyring type, given either an address or key name. If clientCtx.Simulate is true the keystore is not accessed and a valid address must be provided If clientCtx.GenerateOnly is true the keystore is only accessed if a key name is provided

func MustFlagSetWithPageKeyDecoded added in v0.47.0

func MustFlagSetWithPageKeyDecoded(flagSet *pflag.FlagSet) *pflag.FlagSet

MustFlagSetWithPageKeyDecoded calls FlagSetWithPageKeyDecoded and panics on error.

Common usage: pageReq, err := client.ReadPageRequest(client.MustFlagSetWithPageKeyDecoded(cmd.Flags()))

func NewClientFromNode added in v0.42.5

func NewClientFromNode(nodeURI string) (*rpchttp.HTTP, error)

NewClientFromNode sets up Client implementation that communicates with a CometBFT node over JSON RPC and WebSockets

func NewKeyringFromBackend added in v0.42.5

func NewKeyringFromBackend(ctx Context, backend string) (keyring.Keyring, error)

NewKeyringFromBackend gets a Keyring object from a backend

func Paginate

func Paginate(numObjs, page, limit, defLimit int) (start, end int)

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. The start page is assumed to be 1-indexed. If the start page is invalid, non-positive values are returned signaling the request is invalid; it returns non-positive values if limit is non-positive and defLimit is negative.

func ReadPageRequest added in v0.40.0

func ReadPageRequest(flagSet *pflag.FlagSet) (*query.PageRequest, error)

ReadPageRequest reads and builds the necessary page request flags for pagination.

func SetCmdClientContext added in v0.40.0

func SetCmdClientContext(cmd *cobra.Command, clientCtx Context) error

SetCmdClientContext sets a command's Context value to the provided argument. If the context has not been set, set the given context as the default.

func SetCmdClientContextHandler added in v0.40.0

func SetCmdClientContextHandler(clientCtx Context, cmd *cobra.Command) (err error)

SetCmdClientContextHandler is to be used in a command pre-hook execution to read flags that populate a Context and sets that to the command's Context.

func TxServiceBroadcast added in v0.40.0

func TxServiceBroadcast(_ context.Context, clientCtx Context, req *tx.BroadcastTxRequest) (*tx.BroadcastTxResponse, error)

TxServiceBroadcast is a helper function to broadcast a Tx with the correct gRPC types from the tx service. Calls `clientCtx.BroadcastTx` under the hood.

func ValidateCmd

func ValidateCmd(cmd *cobra.Command, args []string) error

ValidateCmd returns unknown command error or Help display if help flag set

func ValidatePromptAddress added in v0.46.2

func ValidatePromptAddress(input string) error

ValidatePromptAddress validates that the input is a valid Bech32 address.

func ValidatePromptCoins added in v0.46.2

func ValidatePromptCoins(input string) error

ValidatePromptYesNo validates that the input is valid sdk.COins

func ValidatePromptNotEmpty added in v0.46.2

func ValidatePromptNotEmpty(input string) error

ValidatePromptNotEmpty validates that the input is not empty.

func ValidatePromptURL added in v0.46.2

func ValidatePromptURL(input string) error

ValidatePromptURL validates that the input is a valid URL.

Types

type Account added in v0.40.0

type Account interface {
	GetAddress() sdk.AccAddress
	GetPubKey() cryptotypes.PubKey // can return nil.
	GetAccountNumber() uint64
	GetSequence() uint64
}

Account defines a read-only version of the auth module's AccountI.

type AccountRetriever added in v0.40.0

type AccountRetriever interface {
	GetAccount(clientCtx Context, addr sdk.AccAddress) (Account, error)
	GetAccountWithHeight(clientCtx Context, addr sdk.AccAddress) (Account, int64, error)
	EnsureExists(clientCtx Context, addr sdk.AccAddress) error
	GetAccountNumberSequence(clientCtx Context, addr sdk.AccAddress) (accNum, 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 CometRPC added in v0.50.0

type CometRPC interface {
	rpcclient.ABCIClient

	Validators(ctx context.Context, height *int64, page, perPage *int) (*coretypes.ResultValidators, error)
	Status(context.Context) (*coretypes.ResultStatus, error)
	Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error)
	BlockByHash(ctx context.Context, hash []byte) (*coretypes.ResultBlock, error)
	BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error)
	BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*coretypes.ResultBlockchainInfo, error)
	Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error)
	Tx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error)
	TxSearch(
		ctx context.Context,
		query string,
		prove bool,
		page, perPage *int,
		orderBy string,
	) (*coretypes.ResultTxSearch, error)
	BlockSearch(
		ctx context.Context,
		query string,
		page, perPage *int,
		orderBy string,
	) (*coretypes.ResultBlockSearch, error)
}

CometRPC defines the interface of a CometBFT RPC client needed for queries and transaction handling.

type Context added in v0.40.0

type Context struct {
	FromAddress       sdk.AccAddress
	Client            CometRPC
	GRPCClient        *grpc.ClientConn
	ChainID           string
	Codec             codec.Codec
	InterfaceRegistry codectypes.InterfaceRegistry
	Input             io.Reader
	Keyring           keyring.Keyring
	KeyringOptions    []keyring.Option
	Output            io.Writer
	OutputFormat      string
	Height            int64
	HomeDir           string
	KeyringDir        string
	From              string
	BroadcastMode     string
	FromName          string
	SignModeStr       string
	UseLedger         bool
	Simulate          bool
	GenerateOnly      bool
	Offline           bool
	SkipConfirm       bool
	TxConfig          TxConfig
	AccountRetriever  AccountRetriever
	NodeURI           string
	FeePayer          sdk.AccAddress
	FeeGranter        sdk.AccAddress
	Viper             *viper.Viper
	LedgerHasProtobuf bool
	PreprocessTxHook  PreprocessTxFn

	// IsAux is true when the signer is an auxiliary signer (e.g. the tipper).
	IsAux bool

	// TODO: Deprecated (remove).
	LegacyAmino *codec.LegacyAmino

	// CmdContext is the context.Context from the Cobra command.
	CmdContext context.Context
}

Context implements a typical context created in SDK modules for transaction handling and queries.

func GetClientContextFromCmd added in v0.40.0

func GetClientContextFromCmd(cmd *cobra.Command) Context

GetClientContextFromCmd returns a Context from a command or an empty Context if it has not been set.

func GetClientQueryContext added in v0.40.0

func GetClientQueryContext(cmd *cobra.Command) (Context, error)

GetClientQueryContext returns a Context from a command with fields set based on flags defined in AddQueryFlagsToCmd. An error is returned if any flag query fails.

- client.Context field not pre-populated & flag not set: uses default flag value - client.Context field not pre-populated & flag set: uses set flag value - client.Context field pre-populated & flag not set: uses pre-populated value - client.Context field pre-populated & flag set: uses set flag value

func GetClientTxContext added in v0.40.0

func GetClientTxContext(cmd *cobra.Command) (Context, error)

GetClientTxContext returns a Context from a command with fields set based on flags defined in AddTxFlagsToCmd. An error is returned if any flag query fails.

- client.Context field not pre-populated & flag not set: uses default flag value - client.Context field not pre-populated & flag set: uses set flag value - client.Context field pre-populated & flag not set: uses pre-populated value - client.Context field pre-populated & flag set: uses set flag value

func ReadPersistentCommandFlags added in v0.40.0

func ReadPersistentCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Context, error)

ReadPersistentCommandFlags returns a Context with fields set for "persistent" or common flags that do not necessarily change with context.

Note, the provided clientCtx may have field pre-populated. The following order of precedence occurs:

- client.Context field not pre-populated & flag not set: uses default flag value - client.Context field not pre-populated & flag set: uses set flag value - client.Context field pre-populated & flag not set: uses pre-populated value - client.Context field pre-populated & flag set: uses set flag value

func (Context) BroadcastTx added in v0.40.0

func (ctx Context) BroadcastTx(txBytes []byte) (res *sdk.TxResponse, err error)

BroadcastTx broadcasts a transactions either synchronously or asynchronously based on the context parameters. The result of the broadcast is parsed into an intermediate structure which is logged if the context has a logger defined.

func (Context) BroadcastTxAsync added in v0.40.0

func (ctx Context) BroadcastTxAsync(txBytes []byte) (*sdk.TxResponse, error)

BroadcastTxAsync broadcasts transaction bytes to a CometBFT node asynchronously (i.e. returns immediately).

func (Context) BroadcastTxSync added in v0.40.0

func (ctx Context) BroadcastTxSync(txBytes []byte) (*sdk.TxResponse, error)

BroadcastTxSync broadcasts transaction bytes to a CometBFT node synchronously (i.e. returns after CheckTx execution).

func (Context) GetFeeGranterAddress added in v0.43.0

func (ctx Context) GetFeeGranterAddress() sdk.AccAddress

GetFeeGranterAddress returns the fee granter address from the context

func (Context) GetFeePayerAddress added in v0.46.0

func (ctx Context) GetFeePayerAddress() sdk.AccAddress

GetFeePayerAddress returns the fee granter address from the context

func (Context) GetFromAddress added in v0.40.0

func (ctx Context) GetFromAddress() sdk.AccAddress

GetFromAddress returns the from address from the context's name.

func (Context) GetFromName added in v0.40.0

func (ctx Context) GetFromName() string

GetFromName returns the key name for the current context.

func (Context) GetNode added in v0.40.0

func (ctx Context) GetNode() (CometRPC, error)

GetNode returns an RPC client. If the context's client is not defined, an error is returned.

func (Context) Invoke added in v0.40.0

func (ctx Context) Invoke(grpcCtx gocontext.Context, method string, req, reply interface{}, opts ...grpc.CallOption) (err error)

Invoke implements the grpc ClientConn.Invoke method

func (Context) NewStream added in v0.40.0

NewStream implements the grpc ClientConn.NewStream method

func (Context) PrintBytes added in v0.40.0

func (ctx Context) PrintBytes(o []byte) error

PrintBytes prints the raw bytes to ctx.Output if it's defined, otherwise to os.Stdout. NOTE: for printing a complex state object, you should use ctx.PrintOutput

func (Context) PrintObjectLegacy added in v0.40.0

func (ctx Context) PrintObjectLegacy(toPrint interface{}) error

PrintObjectLegacy is a variant of PrintProto that doesn't require a proto.Message type and uses amino JSON encoding. Deprecated: It will be removed in the near future!

func (Context) PrintProto added in v0.40.0

func (ctx Context) PrintProto(toPrint proto.Message) error

PrintProto outputs toPrint to the ctx.Output based on ctx.OutputFormat which is either text or json. If text, toPrint will be YAML encoded. Otherwise, toPrint will be JSON encoded using ctx.Codec. An error is returned upon failure.

func (Context) PrintRaw added in v0.46.0

func (ctx Context) PrintRaw(toPrint json.RawMessage) error

PrintRaw is a variant of PrintProto that doesn't require a proto.Message type and uses a raw JSON message. No marshaling is performed.

func (Context) PrintString added in v0.40.0

func (ctx Context) PrintString(str string) error

PrintString prints the raw string to ctx.Output if it's defined, otherwise to os.Stdout

func (Context) Query added in v0.40.0

func (ctx Context) Query(path string) ([]byte, int64, error)

Query performs a query to a CometBFT node with the provided path. It returns the result and height of the query upon success or an error if the query fails.

func (Context) QueryABCI added in v0.40.0

func (ctx Context) QueryABCI(req abci.RequestQuery) (abci.ResponseQuery, error)

QueryABCI performs a query to a CometBFT node with the provide RequestQuery. It returns the ResultQuery obtained from the query. The height used to perform the query is the RequestQuery Height if it is non-zero, otherwise the context height is used.

func (Context) QueryStore added in v0.40.0

func (ctx Context) QueryStore(key []byte, storeName string) ([]byte, int64, error)

QueryStore performs a query to a CometBFT node with the provided key and store name. It returns the result and height of the query upon success or an error if the query fails.

func (Context) QueryWithData added in v0.40.0

func (ctx Context) QueryWithData(path string, data []byte) ([]byte, int64, error)

QueryWithData performs a query to a CometBFT node with the provided path and a data payload. It returns the result and height of the query upon success or an error if the query fails.

func (Context) WithAccountRetriever added in v0.40.0

func (ctx Context) WithAccountRetriever(retriever AccountRetriever) Context

WithAccountRetriever returns the context with an updated AccountRetriever

func (Context) WithAux added in v0.46.0

func (ctx Context) WithAux(isAux bool) Context

WithAux returns a copy of the context with an updated IsAux value.

func (Context) WithBroadcastMode added in v0.40.0

func (ctx Context) WithBroadcastMode(mode string) Context

WithBroadcastMode returns a copy of the context with an updated broadcast mode.

func (Context) WithChainID added in v0.40.0

func (ctx Context) WithChainID(chainID string) Context

WithChainID returns a copy of the context with an updated chain ID.

func (Context) WithClient added in v0.40.0

func (ctx Context) WithClient(client CometRPC) Context

WithClient returns a copy of the context with an updated RPC client instance.

func (Context) WithCmdContext added in v0.50.0

func (ctx Context) WithCmdContext(c context.Context) Context

WithCmdContext returns a copy of the context with an updated context.Context, usually set to the cobra cmd context.

func (Context) WithCodec added in v0.43.0

func (ctx Context) WithCodec(m codec.Codec) Context

WithCodec returns a copy of the Context with an updated Codec.

func (Context) WithFeeGranterAddress added in v0.43.0

func (ctx Context) WithFeeGranterAddress(addr sdk.AccAddress) Context

WithFeeGranterAddress returns a copy of the context with an updated fee granter account address.

func (Context) WithFeePayerAddress added in v0.46.0

func (ctx Context) WithFeePayerAddress(addr sdk.AccAddress) Context

WithFeePayerAddress returns a copy of the context with an updated fee payer account address.

func (Context) WithFrom added in v0.40.0

func (ctx Context) WithFrom(from string) Context

WithFrom returns a copy of the context with an updated from address or name.

func (Context) WithFromAddress added in v0.40.0

func (ctx Context) WithFromAddress(addr sdk.AccAddress) Context

WithFromAddress returns a copy of the context with an updated from account address.

func (Context) WithFromName added in v0.40.0

func (ctx Context) WithFromName(name string) Context

WithFromName returns a copy of the context with an updated from account name.

func (Context) WithGRPCClient added in v0.46.0

func (ctx Context) WithGRPCClient(grpcClient *grpc.ClientConn) Context

WithGRPCClient returns a copy of the context with an updated GRPC client instance.

func (Context) WithGenerateOnly added in v0.40.0

func (ctx Context) WithGenerateOnly(generateOnly bool) Context

WithGenerateOnly returns a copy of the context with updated GenerateOnly value

func (Context) WithHeight added in v0.40.0

func (ctx Context) WithHeight(height int64) Context

WithHeight returns a copy of the context with an updated height.

func (Context) WithHomeDir added in v0.40.0

func (ctx Context) WithHomeDir(dir string) Context

WithHomeDir returns a copy of the Context with HomeDir set.

func (Context) WithInput added in v0.40.0

func (ctx Context) WithInput(r io.Reader) Context

WithInput returns a copy of the context with an updated input.

func (Context) WithInterfaceRegistry added in v0.40.0

func (ctx Context) WithInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) Context

WithInterfaceRegistry returns the context with an updated InterfaceRegistry

func (Context) WithKeyring added in v0.40.0

func (ctx Context) WithKeyring(k keyring.Keyring) Context

WithKeyring returns a copy of the context with an updated keyring.

func (Context) WithKeyringDir added in v0.40.0

func (ctx Context) WithKeyringDir(dir string) Context

WithKeyringDir returns a copy of the Context with KeyringDir set.

func (Context) WithKeyringOptions added in v0.43.0

func (ctx Context) WithKeyringOptions(opts ...keyring.Option) Context

WithKeyringOptions returns a copy of the context with an updated keyring.

func (Context) WithLedgerHasProtobuf added in v0.47.0

func (ctx Context) WithLedgerHasProtobuf(val bool) Context

WithLedgerHasProto returns the context with the provided boolean value, indicating whether the target Ledger application can support Protobuf payloads.

func (Context) WithLegacyAmino added in v0.40.0

func (ctx Context) WithLegacyAmino(cdc *codec.LegacyAmino) Context

WithLegacyAmino returns a copy of the context with an updated LegacyAmino codec. TODO: Deprecated (remove).

func (Context) WithNodeURI added in v0.40.0

func (ctx Context) WithNodeURI(nodeURI string) Context

WithNodeURI returns a copy of the context with an updated node URI.

func (Context) WithOffline added in v0.40.0

func (ctx Context) WithOffline(offline bool) Context

WithOffline returns a copy of the context with updated Offline value.

func (Context) WithOutput added in v0.40.0

func (ctx Context) WithOutput(w io.Writer) Context

WithOutput returns a copy of the context with an updated output writer (e.g. stdout).

func (Context) WithOutputFormat added in v0.40.0

func (ctx Context) WithOutputFormat(format string) Context

WithOutputFormat returns a copy of the context with an updated OutputFormat field.

func (Context) WithPreprocessTxHook added in v0.47.0

func (ctx Context) WithPreprocessTxHook(preprocessFn PreprocessTxFn) Context

WithPreprocessTxHook returns the context with the provided preprocessing hook, which enables chains to preprocess the transaction using the builder.

func (Context) WithSignModeStr added in v0.40.0

func (ctx Context) WithSignModeStr(signModeStr string) Context

WithSignModeStr returns a copy of the context with an updated SignMode value.

func (Context) WithSimulation added in v0.40.0

func (ctx Context) WithSimulation(simulate bool) Context

WithSimulation returns a copy of the context with updated Simulate value

func (Context) WithSkipConfirmation added in v0.40.0

func (ctx Context) WithSkipConfirmation(skip bool) Context

WithSkipConfirmation returns a copy of the context with an updated SkipConfirm value.

func (Context) WithTxConfig added in v0.40.0

func (ctx Context) WithTxConfig(generator TxConfig) Context

WithTxConfig returns the context with an updated TxConfig

func (Context) WithUseLedger added in v0.40.0

func (ctx Context) WithUseLedger(useLedger bool) Context

WithUseLedger returns a copy of the context with an updated UseLedger flag.

func (Context) WithViper added in v0.42.5

func (ctx Context) WithViper(prefix string) Context

WithViper returns the context with Viper field. This Viper instance is used to read client-side config from the config file.

type ExtendedTxBuilder added in v0.47.3

type ExtendedTxBuilder interface {
	SetExtensionOptions(extOpts ...*codectypes.Any)
}

ExtendedTxBuilder extends the TxBuilder interface, which is used to set extension options to be included in a transaction.

type MockAccountRetriever added in v0.47.0

type MockAccountRetriever struct {
	ReturnAccNum, ReturnAccSeq uint64
}

MockAccountRetriever defines a no-op basic AccountRetriever that can be used in mocked contexts. Tests or context that need more sophisticated testing state should implement their own mock AccountRetriever.

func (MockAccountRetriever) EnsureExists added in v0.47.0

func (mar MockAccountRetriever) EnsureExists(_ Context, _ sdk.AccAddress) error

func (MockAccountRetriever) GetAccount added in v0.47.0

func (mar MockAccountRetriever) GetAccount(_ Context, _ sdk.AccAddress) (Account, error)

func (MockAccountRetriever) GetAccountNumberSequence added in v0.47.0

func (mar MockAccountRetriever) GetAccountNumberSequence(_ Context, _ sdk.AccAddress) (uint64, uint64, error)

func (MockAccountRetriever) GetAccountWithHeight added in v0.47.0

func (mar MockAccountRetriever) GetAccountWithHeight(_ Context, _ sdk.AccAddress) (Account, int64, error)

type PreprocessTxFn added in v0.47.0

type PreprocessTxFn func(chainID string, key keyring.KeyType, tx TxBuilder) error

PreprocessTxFn defines a hook by which chains can preprocess transactions before broadcasting

type TestAccount added in v0.40.0

type TestAccount struct {
	Address sdk.AccAddress
	Num     uint64
	Seq     uint64
}

TestAccount represents a client Account that can be used in unit tests

func (TestAccount) GetAccountNumber added in v0.40.0

func (t TestAccount) GetAccountNumber() uint64

GetAccountNumber implements client Account.GetAccountNumber

func (TestAccount) GetAddress added in v0.40.0

func (t TestAccount) GetAddress() sdk.AccAddress

GetAddress implements client Account.GetAddress

func (TestAccount) GetPubKey added in v0.40.0

func (t TestAccount) GetPubKey() cryptotypes.PubKey

GetPubKey implements client Account.GetPubKey

func (TestAccount) GetSequence added in v0.40.0

func (t TestAccount) GetSequence() uint64

GetSequence implements client Account.GetSequence

type TestAccountRetriever added in v0.40.0

type TestAccountRetriever struct {
	Accounts map[string]TestAccount
}

TestAccountRetriever is an AccountRetriever that can be used in unit tests

func (TestAccountRetriever) EnsureExists added in v0.40.0

func (t TestAccountRetriever) EnsureExists(_ Context, addr sdk.AccAddress) error

EnsureExists implements AccountRetriever.EnsureExists

func (TestAccountRetriever) GetAccount added in v0.40.0

func (t TestAccountRetriever) GetAccount(_ Context, addr sdk.AccAddress) (Account, error)

GetAccount implements AccountRetriever.GetAccount

func (TestAccountRetriever) GetAccountNumberSequence added in v0.40.0

func (t TestAccountRetriever) GetAccountNumberSequence(_ Context, addr sdk.AccAddress) (accNum, accSeq uint64, err error)

GetAccountNumberSequence implements AccountRetriever.GetAccountNumberSequence

func (TestAccountRetriever) GetAccountWithHeight added in v0.40.0

func (t TestAccountRetriever) GetAccountWithHeight(clientCtx Context, addr sdk.AccAddress) (Account, int64, error)

GetAccountWithHeight implements AccountRetriever.GetAccountWithHeight

type TxBuilder added in v0.40.0

type TxBuilder interface {
	GetTx() signing.Tx

	SetMsgs(msgs ...sdk.Msg) error
	SetSignatures(signatures ...signingtypes.SignatureV2) error
	SetMemo(memo string)
	SetFeeAmount(amount sdk.Coins)
	SetFeePayer(feePayer sdk.AccAddress)
	SetGasLimit(limit uint64)
	SetTimeoutHeight(height uint64)
	SetFeeGranter(feeGranter sdk.AccAddress)
	AddAuxSignerData(tx.AuxSignerData) error
}

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 v0.40.0

type TxConfig interface {
	TxEncodingConfig

	NewTxBuilder() TxBuilder
	WrapTxBuilder(sdk.Tx) (TxBuilder, error)
	SignModeHandler() *txsigning.HandlerMap
	SigningContext() *txsigning.Context
}

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 v0.40.0

type TxEncodingConfig interface {
	TxEncoder() sdk.TxEncoder
	TxDecoder() sdk.TxDecoder
	TxJSONEncoder() sdk.TxEncoder
	TxJSONDecoder() sdk.TxDecoder
	MarshalSignatureJSON([]signingtypes.SignatureV2) ([]byte, error)
	UnmarshalSignatureJSON([]byte) ([]signingtypes.SignatureV2, error)
}

TxEncodingConfig defines an interface that contains transaction encoders and decoders

Directories

Path Synopsis
module
grpc
cmtservice
Package cmtservice is a reverse proxy.
Package cmtservice is a reverse proxy.
node
Package node is a reverse proxy.
Package node is a reverse proxy.
reflection
Package reflection is a reverse proxy.
Package reflection is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL