Documentation ¶
Index ¶
- Variables
- func DefaultJSONTxDecoder(cdc codec.ProtoCodecMarshaler) sdk.TxDecoder
- func DefaultJSONTxEncoder(cdc codec.ProtoCodecMarshaler) sdk.TxEncoder
- func DefaultTxDecoder(cdc codec.ProtoCodecMarshaler) sdk.TxDecoder
- func DefaultTxEncoder() sdk.TxEncoder
- func DirectSignBytes(bodyBytes, authInfoBytes []byte, chainID string, accnum uint64) ([]byte, error)
- func ModeInfoAndSigToSignatureData(modeInfo *tx.ModeInfo, sig []byte) (signing.SignatureData, error)
- func NewTxConfig(protoCodec codec.ProtoCodecMarshaler, enabledSignModes []signingtypes.SignMode, ...) client.TxConfig
- func NewTxConfigWithHandler(protoCodec codec.ProtoCodecMarshaler, handler signing.SignModeHandler) client.TxConfig
- func NewTxConfigWithTextual(protoCodec codec.ProtoCodecMarshaler, enabledSignModes []signingtypes.SignMode, ...) client.TxConfig
- func NewTxServer(clientCtx client.Context, simulate baseAppSimulateFn, ...) txtypes.ServiceServer
- func QueryTx(clientCtx client.Context, hashHexStr string) (*sdk.TxResponse, error)
- func QueryTxsByEvents(clientCtx client.Context, page, limit int, query, orderBy string) (*sdk.SearchTxsResult, error)
- func RegisterGRPCGatewayRoutes(clientConn gogogrpc.ClientConn, mux *runtime.ServeMux)
- func RegisterTxService(qrt gogogrpc.Server, clientCtx client.Context, simulateFn baseAppSimulateFn, ...)
- func SignatureDataToModeInfoAndSig(data signing.SignatureData) (*tx.ModeInfo, []byte)
- func WrapTx(protoTx *tx.Tx) client.TxBuilder
- type ExtensionOptionsTxBuilder
Constants ¶
This section is empty.
Variables ¶
var DefaultSignModes = []signingtypes.SignMode{ signingtypes.SignMode_SIGN_MODE_DIRECT, signingtypes.SignMode_SIGN_MODE_DIRECT_AUX, signingtypes.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, }
DefaultSignModes are the default sign modes enabled for protobuf transactions.
Functions ¶
func DefaultJSONTxDecoder ¶
func DefaultJSONTxDecoder(cdc codec.ProtoCodecMarshaler) sdk.TxDecoder
DefaultJSONTxDecoder returns a default protobuf JSON TxDecoder using the provided Marshaler.
func DefaultJSONTxEncoder ¶
func DefaultJSONTxEncoder(cdc codec.ProtoCodecMarshaler) sdk.TxEncoder
DefaultJSONTxEncoder returns a default protobuf JSON TxEncoder using the provided Marshaler.
func DefaultTxDecoder ¶
func DefaultTxDecoder(cdc codec.ProtoCodecMarshaler) sdk.TxDecoder
DefaultTxDecoder returns a default protobuf TxDecoder using the provided Marshaler.
func DefaultTxEncoder ¶
DefaultTxEncoder returns a default protobuf TxEncoder using the provided Marshaler
func DirectSignBytes ¶
func DirectSignBytes(bodyBytes, authInfoBytes []byte, chainID string, accnum uint64) ([]byte, error)
DirectSignBytes returns the SIGN_MODE_DIRECT sign bytes for the provided TxBody bytes, AuthInfo bytes, chain ID, account number and sequence.
func ModeInfoAndSigToSignatureData ¶
func ModeInfoAndSigToSignatureData(modeInfo *tx.ModeInfo, sig []byte) (signing.SignatureData, error)
ModeInfoAndSigToSignatureData converts a ModeInfo and raw bytes signature to a SignatureData or returns an error
func NewTxConfig ¶
func NewTxConfig(protoCodec codec.ProtoCodecMarshaler, enabledSignModes []signingtypes.SignMode, customSignModes ...signing.SignModeHandler) client.TxConfig
NewTxConfig returns a new protobuf TxConfig using the provided ProtoCodec and sign modes. The first enabled sign mode will become the default sign mode.
NOTE: Use NewTxConfigWithHandler to provide a custom signing handler in case the sign mode is not supported by default (eg: SignMode_SIGN_MODE_EIP_191). Use NewTxConfigWithTextual to enable SIGN_MODE_TEXTUAL (for testing purposes for now).
func NewTxConfigWithHandler ¶
func NewTxConfigWithHandler(protoCodec codec.ProtoCodecMarshaler, handler signing.SignModeHandler) client.TxConfig
NewTxConfig returns a new protobuf TxConfig using the provided ProtoCodec and signing handler.
func NewTxConfigWithTextual ¶
func NewTxConfigWithTextual(protoCodec codec.ProtoCodecMarshaler, enabledSignModes []signingtypes.SignMode, textual *textual.SignModeHandler, customSignModes ...signing.SignModeHandler) client.TxConfig
NewTxConfigWithTextual is like NewTxConfig with the ability to add a SIGN_MODE_TEXTUAL renderer. It is currently still EXPERIMENTAL, for should be used for TESTING purposes only, until Textual is fully released.
func NewTxServer ¶
func NewTxServer(clientCtx client.Context, simulate baseAppSimulateFn, interfaceRegistry codectypes.InterfaceRegistry) txtypes.ServiceServer
NewTxServer creates a new Tx service server.
func QueryTx ¶
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(clientCtx client.Context, page, limit int, query, orderBy string) (*sdk.SearchTxsResult, error)
QueryTxsByEvents retrieves a list of paginated transactions from CometBFT's TxSearch RPC method given a set of pagination criteria and an events query. Note, the events query must be valid based on CometBFT's query semantics. An error is returned if the query or parsing fails or if the query is empty.
Note, if an empty orderBy is provided, the default behavior is ascending. If negative values are provided for page or limit, defaults will be used.
func RegisterGRPCGatewayRoutes ¶
func RegisterGRPCGatewayRoutes(clientConn gogogrpc.ClientConn, mux *runtime.ServeMux)
RegisterGRPCGatewayRoutes mounts the tx service's GRPC-gateway routes on the given Mux.
func RegisterTxService ¶
func RegisterTxService( qrt gogogrpc.Server, clientCtx client.Context, simulateFn baseAppSimulateFn, interfaceRegistry codectypes.InterfaceRegistry, )
RegisterTxService registers the tx service on the gRPC router.
func SignatureDataToModeInfoAndSig ¶
func SignatureDataToModeInfoAndSig(data signing.SignatureData) (*tx.ModeInfo, []byte)
SignatureDataToModeInfoAndSig converts a SignatureData to a ModeInfo and raw bytes signature
Types ¶
type ExtensionOptionsTxBuilder ¶
type ExtensionOptionsTxBuilder interface { client.TxBuilder SetExtensionOptions(...*codectypes.Any) SetNonCriticalExtensionOptions(...*codectypes.Any) }
ExtensionOptionsTxBuilder defines a TxBuilder that can also set extensions.