Documentation ¶
Index ¶
- func CalculateGas(queryFunc func(string, []byte) ([]byte, int64, error), cdc *codec.Codec, ...) (sdk.SimulationResponse, uint64, error)
- func CliConvertCoinToCoinAdapter(coin sdk.Coin) sdk.CoinAdapter
- func CliConvertCoinToCoinAdapters(coins sdk.Coins) sdk.CoinAdapters
- func CompleteAndBroadcastTxCLI(txBldr authtypes.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) error
- func ConvCM39EventsTCM40(es []types.Event) []abci.Event
- func ConvCM39SimulateResultTCM40(cm39 *types.Result) *cm40types.Result
- func EnrichWithGas(txBldr authtypes.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) (authtypes.TxBuilder, error)
- func GenerateOrBroadcastMsgs(cliCtx context.CLIContext, txBldr authtypes.TxBuilder, msgs []sdk.Msg) error
- func GetTxEncoder(cdc *codec.Codec, options ...Option) (encoder sdk.TxEncoder)
- func NewPbTxConfig(reg types2.InterfaceRegistry) client.TxConfig
- func NewTxServer(clientCtx cliContext.CLIContext, simulate baseAppSimulateFn, ...) tx.ServiceServer
- func PbTxBuildAndSign(clientCtx context.CLIContext, txConfig client.TxConfig, ...) ([]byte, error)
- func PrepareTxBuilder(txBldr authtypes.TxBuilder, cliCtx context.CLIContext) (authtypes.TxBuilder, error)
- func PrintUnsignedStdTx(txBldr authtypes.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) error
- func Query40Tx(cliCtx context.CLIContext, hashHexStr string) (*types.TxResponse, error)
- func Query40TxsByEvents(cliCtx context.CLIContext, events []string, page, limit int) (*types.SearchTxsResult, error)
- func QueryTx(cliCtx context.CLIContext, hashHexStr string) (sdk.TxResponse, error)
- func QueryTxsByEvents(cliCtx context.CLIContext, events []string, page, limit int) (*sdk.SearchTxsResult, error)
- func ReadStdTxFromFile(cdc *codec.Codec, filename string) (*authtypes.StdTx, error)
- func RegisterTxService(qrt gogogrpc.Server, clientCtx cliContext.CLIContext, ...)
- func SetParseAppTx(hanlder ParseAppTxHandler)
- func SignStdTx(txBldr authtypes.TxBuilder, cliCtx context.CLIContext, name string, ...) (*authtypes.StdTx, error)
- func SignStdTxWithSignerAddress(txBldr authtypes.TxBuilder, cliCtx context.CLIContext, addr sdk.AccAddress, ...) (signedStdTx *authtypes.StdTx, err error)
- func ValidateTxResult(cliCtx context.CLIContext, resTx *ctypes.ResultTx) error
- func WriteGenerateStdTxResponse(w http.ResponseWriter, cliCtx context.CLIContext, br rest.BaseReq, ...)
- type GasEstimateResponse
- type Option
- type ParseAppTxHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateGas ¶
func CalculateGas( queryFunc func(string, []byte) ([]byte, int64, error), cdc *codec.Codec, txBytes []byte, adjustment float64, ) (sdk.SimulationResponse, uint64, error)
CalculateGas simulates the execution of a transaction and returns the simulation response obtained by the query and the adjusted gas amount.
func CliConvertCoinToCoinAdapter ¶
func CliConvertCoinToCoinAdapter(coin sdk.Coin) sdk.CoinAdapter
func CliConvertCoinToCoinAdapters ¶
func CliConvertCoinToCoinAdapters(coins sdk.Coins) sdk.CoinAdapters
func CompleteAndBroadcastTxCLI ¶
func CompleteAndBroadcastTxCLI(txBldr authtypes.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) error
CompleteAndBroadcastTxCLI implements a utility function that facilitates sending a series of messages in a signed transaction given a TxBuilder and a QueryContext. It ensures that the account exists, has a proper number and sequence set. In addition, it builds and signs a transaction with the supplied messages. Finally, it broadcasts the signed transaction to a node.
func EnrichWithGas ¶
func EnrichWithGas(txBldr authtypes.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) (authtypes.TxBuilder, error)
EnrichWithGas calculates the gas estimate that would be consumed by the transaction and set the transaction's respective value accordingly.
func GenerateOrBroadcastMsgs ¶
func GenerateOrBroadcastMsgs(cliCtx context.CLIContext, txBldr authtypes.TxBuilder, msgs []sdk.Msg) error
GenerateOrBroadcastMsgs creates a StdTx given a series of messages. If the provided context has generate-only enabled, the tx will only be printed to STDOUT in a fully offline manner. Otherwise, the tx will be signed and broadcasted.
func GetTxEncoder ¶
GetTxEncoder return tx encoder from global sdk configuration if ones is defined. Otherwise returns encoder with default logic.
func NewPbTxConfig ¶
func NewPbTxConfig(reg types2.InterfaceRegistry) client.TxConfig
func NewTxServer ¶
func NewTxServer(clientCtx cliContext.CLIContext, simulate baseAppSimulateFn, interfaceRegistry codectypes.InterfaceRegistry) tx.ServiceServer
NewTxServer creates a new Tx service server.
func PbTxBuildAndSign ¶
func PrepareTxBuilder ¶
func PrepareTxBuilder(txBldr authtypes.TxBuilder, cliCtx context.CLIContext) (authtypes.TxBuilder, error)
PrepareTxBuilder populates a TxBuilder in preparation for the build of a Tx.
func PrintUnsignedStdTx ¶
func PrintUnsignedStdTx(txBldr authtypes.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) error
PrintUnsignedStdTx builds an unsigned StdTx and prints it to os.Stdout.
func Query40Tx ¶
func Query40Tx(cliCtx context.CLIContext, hashHexStr string) (*types.TxResponse, error)
func Query40TxsByEvents ¶
func Query40TxsByEvents(cliCtx context.CLIContext, events []string, page, limit int) (*types.SearchTxsResult, error)
func QueryTx ¶
func QueryTx(cliCtx context.CLIContext, hashHexStr string) (sdk.TxResponse, error)
QueryTx queries for a single transaction by a hash string in hex format. An error is returned if the transaction does not exist or cannot be queried.
func QueryTxsByEvents ¶
func QueryTxsByEvents(cliCtx context.CLIContext, events []string, page, limit int) (*sdk.SearchTxsResult, error)
QueryTxsByEvents performs a search for transactions for a given set of events via the Tendermint RPC. An event takes the form of: "{eventAttribute}.{attributeKey} = '{attributeValue}'". Each event is concatenated with an 'AND' operand. It returns a slice of Info object containing txs and metadata. An error is returned if the query fails.
func ReadStdTxFromFile ¶
Read and decode a StdTx from the given filename. Can pass "-" to read from stdin.
func RegisterTxService ¶
func RegisterTxService( qrt gogogrpc.Server, clientCtx cliContext.CLIContext, simulateFn baseAppSimulateFn, interfaceRegistry codectypes.InterfaceRegistry, )
RegisterTxService registers the tx service on the gRPC router.
func SetParseAppTx ¶
func SetParseAppTx(hanlder ParseAppTxHandler)
func SignStdTx ¶
func SignStdTx( txBldr authtypes.TxBuilder, cliCtx context.CLIContext, name string, stdTx *authtypes.StdTx, appendSig bool, offline bool, ) (*authtypes.StdTx, error)
SignStdTx appends a signature to a StdTx and returns a copy of it. If appendSig is false, it replaces the signatures already attached with the new signature. Don't perform online validation or lookups if offline is true.
func SignStdTxWithSignerAddress ¶
func SignStdTxWithSignerAddress(txBldr authtypes.TxBuilder, cliCtx context.CLIContext, addr sdk.AccAddress, name string, stdTx *authtypes.StdTx, offline bool) (signedStdTx *authtypes.StdTx, err error)
SignStdTxWithSignerAddress attaches a signature to a StdTx and returns a copy of a it. Don't perform online validation or lookups if offline is true, else populate account and sequence numbers from a foreign account.
func ValidateTxResult ¶
func ValidateTxResult(cliCtx context.CLIContext, resTx *ctypes.ResultTx) error
ValidateTxResult performs transaction verification.
func WriteGenerateStdTxResponse ¶
func WriteGenerateStdTxResponse(w http.ResponseWriter, cliCtx context.CLIContext, br rest.BaseReq, msgs []sdk.Msg)
WriteGenerateStdTxResponse writes response for the generate only mode.
Types ¶
type GasEstimateResponse ¶
type GasEstimateResponse struct {
GasEstimate uint64 `json:"gas_estimate" yaml:"gas_estimate"`
}
GasEstimateResponse defines a response definition for tx gas estimation.
func (GasEstimateResponse) String ¶
func (gr GasEstimateResponse) String() string
type Option ¶
type Option func(config *txEncoderConfig)
func WithEthereumTx ¶
func WithEthereumTx() Option