Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigCmd() *cobra.Command
- func QueryCmd() *cobra.Command
- func QueryTxCmd() *cobra.Command
- func SetQueryMode(cmd *cobra.Command, mode QueryMode)
- func TxCmd() *cobra.Command
- type CometBFTTxHash
- type EVMTransactionSummary
- type EVMTxHash
- type QueryMode
- type TransactionSummary
- type TxHash
Constants ¶
const ( // QueryModeConfigKey is the client.toml key that selects the configured // query backend. QueryModeConfigKey = "query-mode" )
Variables ¶
var ErrInvalidTxHash = errors.New("invalid transaction hash")
ErrInvalidTxHash indicates that a transaction hash failed syntax validation before any backend query can run.
Functions ¶
func ConfigCmd ¶
ConfigCmd returns the Nibiru-owned command for reading and updating client configuration values in client.toml.
func QueryTxCmd ¶
QueryTxCmd returns the Nibiru-owned q tx command. Hash lookups support both CometBFT and EVM hashes. The account-sequence and signature query forms keep the Cosmos SDK behavior.
func SetQueryMode ¶
SetQueryMode records the validated configured mode on the executed Cobra command. Query adapters can retrieve it with QueryModeFromCmd.
Types ¶
type CometBFTTxHash ¶
type CometBFTTxHash struct {
// contains filtered or unexported fields
}
CometBFTTxHash is the fixed-size digest returned by types.Tx.Hash.
func (CometBFTTxHash) Bytes ¶
func (h CometBFTTxHash) Bytes() []byte
Bytes returns a copy of the 32-byte CometBFT transaction hash.
func (CometBFTTxHash) Canonical ¶
func (h CometBFTTxHash) Canonical() string
Canonical returns uppercase hexadecimal without a 0x prefix, matching the repository's CometBFT hash formatter.
func (CometBFTTxHash) String ¶
func (h CometBFTTxHash) String() string
type EVMTransactionSummary ¶
type EVMTransactionSummary struct {
Hash gethcommon.Hash `json:"hash"`
BlockHash *gethcommon.Hash `json:"block_hash,omitempty"`
BlockNumber *hexutil.Big `json:"block_number,omitempty"`
From gethcommon.Address `json:"from"`
Gas hexutil.Uint64 `json:"gas"`
GasPrice *hexutil.Big `json:"gas_price"`
MaxFeePerGas *hexutil.Big `json:"max_fee_per_gas,omitempty"`
MaxPriorityFee *hexutil.Big `json:"max_priority_fee_per_gas,omitempty"`
Input hexutil.Bytes `json:"input"`
Nonce hexutil.Uint64 `json:"nonce"`
To *gethcommon.Address `json:"to"`
TransactionIndex *hexutil.Uint64 `json:"transaction_index,omitempty"`
Value *hexutil.Big `json:"value"`
Type hexutil.Uint64 `json:"type"`
}
EVMTransactionSummary contains the EVM fields users commonly inspect while retaining the smaller default transaction response.
type EVMTxHash ¶
type EVMTxHash struct {
// contains filtered or unexported fields
}
EVMTxHash is an Ethereum transaction hash backed by geth's common.Hash.
func (EVMTxHash) Canonical ¶
Canonical returns the 0x-prefixed lowercase hexadecimal spelling generated by geth's common.Hash.Hex method.
func (EVMTxHash) Hash ¶
func (h EVMTxHash) Hash() gethcommon.Hash
Hash returns the validated geth common.Hash value.
type QueryMode ¶
type QueryMode string
QueryMode selects the configured backend for eligible CLI read operations. The effective backend also depends on the chain ID and operation allowlist.
func QueryModeFromCmd ¶
QueryModeFromCmd returns the configured query mode for cmd. Commands that did not run the root pre-run use the safe gql default.
type TransactionSummary ¶
type TransactionSummary struct {
TxHash string `json:"txhash"`
EthHash string `json:"eth_hash"`
Height *string `json:"height,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
Code *uint32 `json:"code,omitempty"`
Codespace string `json:"codespace,omitempty"`
Data string `json:"data"`
Info string `json:"info"`
GasWanted *string `json:"gas_wanted,omitempty"`
GasUsed *string `json:"gas_used,omitempty"`
Messages []string `json:"messages,omitempty"`
RawLog string `json:"raw_log"`
Logs json.RawMessage `json:"logs"`
Events json.RawMessage `json:"events"`
Tx json.RawMessage `json:"tx,omitempty"`
EVM *EVMTransactionSummary `json:"evm,omitempty"`
Pending bool `json:"pending,omitempty"`
}
TransactionSummary preserves the native TxResponse fields for committed transactions and adds message types and EVM transaction information.
type TxHash ¶
type TxHash interface {
Canonical() string
// contains filtered or unexported methods
}
TxHash is the closed set of transaction-hash representations accepted by the CLI. Its concrete value is either CometBFTTxHash or EVMTxHash.
func ClassifyTxHash ¶
ClassifyTxHash validates and classifies a user-supplied transaction hash.
A bare 64-character hexadecimal value uses the CometBFT spelling. An EVM hash must use the 0x-prefixed spelling so the two families have distinct CLI syntax. This function validates syntax only. It does not check whether the transaction exists or is indexed.