Documentation
¶
Overview ¶
Package query provides interfaces used to query the state of the blockchain. These interfaces abstract the underlying request/response types and provide a single method to query for a specific piece of information from the chain.
Index ¶
- Constants
- Variables
- func NewAccountQuerier(deps depinject.Config) (client.AccountQueryClient, error)
- func NewApplicationQuerier(deps depinject.Config) (client.ApplicationQueryClient, error)
- func NewBankQuerier(deps depinject.Config) (client.BankQueryClient, error)
- func NewGRPCClientWithDebugMetrics(clientConn grpc.ClientConn) grpc.ClientConn
- func NewProofQuerier(deps depinject.Config) (client.ProofQueryClient, error)
- func NewServiceQuerier(deps depinject.Config) (client.ServiceQueryClient, error)
- func NewSessionQuerier(deps depinject.Config) (client.SessionQueryClient, error)
- func NewSharedQuerier(deps depinject.Config) (client.SharedQueryClient, error)
- func NewSupplierQuerier(deps depinject.Config) (client.SupplierQueryClient, error)
- type Balance
- type BlockHash
- type ComponentCtxRelayMiner
- type Context
Constants ¶
const ( ComponentCtxRelayMinerUnknown = iota // ComponentCtxRelayMinerProxy is the identifier for the proxy component in the relayer. ComponentCtxRelayMinerProxy // ComponentCtxRelayMinerMiner is the identifier for the miner component in the relayer. ComponentCtxRelayMinerMiner // ComponentCtxRelayMinerSessionsManager is the identifier for the sessions manager component in the relayer. ComponentCtxRelayMinerSessionsManager )
Variables ¶
var ( ErrQueryAccountNotFound = sdkerrors.Register(codespace, 1, "account not found") ErrQueryUnableToDeserializeAccount = sdkerrors.Register(codespace, 2, "unable to deserialize account") ErrQueryRetrieveSession = sdkerrors.Register(codespace, 3, "error while trying to retrieve a session") ErrQueryPubKeyNotFound = sdkerrors.Register(codespace, 4, "account pub key not found") ErrQuerySessionParams = sdkerrors.Register(codespace, 5, "unable to query session params") ErrQueryRetrieveService = sdkerrors.Register(codespace, 6, "error while trying to retrieve a service") ErrQueryBalanceNotFound = sdkerrors.Register(codespace, 7, "balance not found") )
Functions ¶
func NewAccountQuerier ¶
func NewAccountQuerier(deps depinject.Config) (client.AccountQueryClient, error)
NewAccountQuerier returns a new instance of a client.AccountQueryClient by injecting the dependencies provided by the depinject.Config.
Required dependencies: - clientCtx - polylog.Logger - cache.KeyValueCache[types.AccountI]
func NewApplicationQuerier ¶
func NewApplicationQuerier(deps depinject.Config) (client.ApplicationQueryClient, error)
NewApplicationQuerier returns a new instance of a client.ApplicationQueryClient by injecting the dependencies provided by the depinject.Config
Required dependencies: - clientCtx
func NewBankQuerier ¶ added in v0.0.10
func NewBankQuerier(deps depinject.Config) (client.BankQueryClient, error)
NewBankQuerier returns a new instance of a client.BankQueryClient by injecting the dependencies provided by the depinject.Config.
Required dependencies: - clientCtx - polylog.Logger - cache.KeyValueCache[Balance]
func NewGRPCClientWithDebugMetrics ¶ added in v0.1.28
func NewGRPCClientWithDebugMetrics(clientConn grpc.ClientConn) grpc.ClientConn
NewGRPCClientWithDebugMetrics creates a new grpcClientWithDebugMetrics that wraps the provided grpc.ClientConn. It is used to instrument gRPC calls for performance monitoring.
func NewProofQuerier ¶ added in v0.0.3
func NewProofQuerier(deps depinject.Config) (client.ProofQueryClient, error)
NewProofQuerier returns a new instance of a client.ProofQueryClient by injecting the dependencies provided by the depinject.Config.
Required dependencies: - grpc.ClientConn - polylog.Logger - client.ParamsCache[prooftypes.Params] - cache.KeyValueCache[prooftypes.Claim]
func NewServiceQuerier ¶ added in v0.0.8
func NewServiceQuerier(deps depinject.Config) (client.ServiceQueryClient, error)
NewServiceQuerier returns a new instance of a client.ServiceQueryClient by injecting the dependencies provided by the depinject.Config.
Required dependencies: - clientCtx (grpc.ClientConn) - polylog.Logger - cache.KeyValueCache[sharedtypes.Service] - cache.KeyValueCache[servicetypes.RelayMiningDifficulty]
func NewSessionQuerier ¶
func NewSessionQuerier(deps depinject.Config) (client.SessionQueryClient, error)
NewSessionQuerier returns a new instance of a client.SessionQueryClient by injecting the dependencies provided by the depinject.Config.
Required dependencies: - clientCtx (grpc.ClientConn)
func NewSharedQuerier ¶ added in v0.0.3
func NewSharedQuerier(deps depinject.Config) (client.SharedQueryClient, error)
NewSharedQuerier returns a new instance of a client.SharedQueryClient by injecting the dependencies provided by the depinject.Config.
Required dependencies: - clientCtx (grpc.ClientConn) - client.BlockQueryClient
func NewSupplierQuerier ¶
func NewSupplierQuerier(deps depinject.Config) (client.SupplierQueryClient, error)
NewSupplierQuerier returns a new instance of a client.SupplierQueryClient by injecting the dependencies provided by the depinject.Config.
Required dependencies: - grpc.ClientConn - polylog.Logger - cache.KeyValueCache[sharedtypes.Supplier]
Types ¶
type Balance ¶ added in v0.0.14
type Balance *cosmostypes.Coin
Balance represents a pointer to a Cosmos SDK Coin used for bank balance queries. It is defined as a distinct type (not an alias) to: - Ensure clear dependency injection - Differentiate from other coin caches in the system - Maintain separation of concerns between coin-related data in the caching layer
type BlockHash ¶ added in v0.0.14
type BlockHash []byte
BlockHash represents a byte slice used for bank balance query caches. It is defined as a distinct type (not an alias) to: - Ensure clear dependency injection - Differentiate from other byte slice caches - Maintain separation of concerns between byte slice data in caching layer
type ComponentCtxRelayMiner ¶ added in v0.1.28
type ComponentCtxRelayMiner string
ComponentCtxRelayMiner is a type used to identify the component making the gRPC call.
const ComponentCtxRelayMinerKey ComponentCtxRelayMiner = "component"
ComponentCtxRelayMinerKey is the context key used to identify the component calling the gRPC method using the context.WithValue method.
type Context ¶ added in v0.0.14
type Context cosmosclient.Context
Context represents a CosmosSDK client Context used for query operations. It is defined as a distinct type (not an alias) to: - Ensure clear dependency injection - Differentiate from transaction-related contexts - Maintain separation of concerns between query and transaction operations