impl

package
v2.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: BSD-2-Clause Imports: 30 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// QueryModeConfigKey is the client.toml key that selects the configured
	// query backend.
	QueryModeConfigKey = "query-mode"
)

Variables

View Source
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

func ConfigCmd() *cobra.Command

ConfigCmd returns the Nibiru-owned command for reading and updating client configuration values in client.toml.

func QueryCmd

func QueryCmd() *cobra.Command

QueryCmd returns the root `nibid query` command with all app module queries.

func QueryTxCmd

func QueryTxCmd() *cobra.Command

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

func SetQueryMode(cmd *cobra.Command, mode QueryMode)

SetQueryMode records the validated configured mode on the executed Cobra command. Query adapters can retrieve it with QueryModeFromCmd.

func TxCmd

func TxCmd() *cobra.Command

TxCmd returns the root `nibid tx` command with all app module transactions.

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

func (h EVMTxHash) Canonical() string

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.

func (EVMTxHash) String

func (h EVMTxHash) String() string

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.

const (
	// QueryModeGQL selects the GraphQL-backed query mode for eligible reads.
	QueryModeGQL QueryMode = "gql"
	// QueryModeDirect keeps all reads on the direct RPC path.
	QueryModeDirect QueryMode = "direct"
)

func QueryModeFromCmd

func QueryModeFromCmd(cmd *cobra.Command) QueryMode

QueryModeFromCmd returns the configured query mode for cmd. Commands that did not run the root pre-run use the safe gql default.

func ReadFromClientConfig

func ReadFromClientConfig(ctx client.Context) (client.Context, QueryMode, error)

ReadFromClientConfig loads client.toml, repairs a missing or invalid query-mode value to gql, and initializes the Cosmos client context.

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

func ClassifyTxHash(input string) (TxHash, error)

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.

Jump to

Keyboard shortcuts

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