client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 53 Imported by: 11

Documentation

Overview

APACHE NOTICE Sourced with modifications from https://github.com/strangelove-ventures/lens

APACHE NOTICE Sourced with modifications from https://github.com/strangelove-ventures/lens

APACHE NOTICE Sourced with modifications from https://github.com/strangelove-ventures/lens

APACHE NOTICE Sourced with modifications from https://github.com/strangelove-ventures/lens

Index

Constants

This section is empty.

Variables

View Source
var (
	// Provides a default set of AppModuleBasics that are included in the ChainClientConfig
	// This is used to provide a default set of modules that will be used for protobuf registration and in-app decoding of RPC responses
	DefaultModuleBasics = []module.AppModuleBasic{
		auth.AppModuleBasic{},
		authz.AppModuleBasic{},
		bank.AppModuleBasic{},
		capability.AppModuleBasic{},
		gov.AppModuleBasic{},
		crisis.AppModuleBasic{},
		distribution.AppModuleBasic{},
		feegrant.AppModuleBasic{},
		mint.AppModuleBasic{},
		params.AppModuleBasic{},
		slashing.AppModuleBasic{},
		staking.AppModuleBasic{},
		vesting.AppModuleBasic{},
		wasm.AppModuleBasic{},
		ibc.AppModuleBasic{},
		ibcTransfer.AppModuleBasic{},
		ibcTm.AppModuleBasic{},
	}
)

Functions

func GetHeightFromMetadata

func GetHeightFromMetadata(md metadata.MD) (int64, error)

func GetProveFromMetadata

func GetProveFromMetadata(md metadata.MD) (bool, error)

func NewRPCClient

func NewRPCClient(addr string, timeout time.Duration) (*rpchttp.HTTP, error)

func RegisterOsmosisInterfaces

func RegisterOsmosisInterfaces(registry types.InterfaceRegistry)

Split out from base codec to not include explicitly. Should be included only when needed.

func RegisterTendermintLiquidityInterfaces

func RegisterTendermintLiquidityInterfaces(aminoCodec *codec.LegacyAmino, registry types.InterfaceRegistry)

Split out from base codec to not include explicitly. Should be included only when needed.

func SetHeightOnContext

func SetHeightOnContext(ctx context.Context, height int64) context.Context

func SetProveOnContext

func SetProveOnContext(ctx context.Context, prove bool) context.Context

Types

type ChainClient

type ChainClient struct {
	Config         *ChainClientConfig
	Keybase        keyring.Keyring
	KeyringOptions []keyring.Option
	RPCClient      rpcclient.Client
	Input          io.Reader
	Output         io.Writer
	Codec          Codec
	Logger         log.Logger
}

func NewChainClient

func NewChainClient(ccc *ChainClientConfig, homepath string, input io.Reader, output io.Writer, kro ...keyring.Option) (*ChainClient, error)

func (*ChainClient) Init

func (cc *ChainClient) Init() error

func (*ChainClient) Invoke

func (cc *ChainClient) Invoke(ctx context.Context, method string, req, reply interface{}, opts ...grpc.CallOption) (err error)

Invoke implements the grpc ClientConn.Invoke method, but only for querying state

func (*ChainClient) NewStream

NewStream implements the grpc ClientConn.NewStream method

func (*ChainClient) QueryABCI

func (cc *ChainClient) QueryABCI(req abci.RequestQuery) (abci.ResponseQuery, error)

func (*ChainClient) RunGRPCQuery

func (cc *ChainClient) RunGRPCQuery(ctx context.Context, method string, req interface{}, md metadata.MD) (abci.ResponseQuery, metadata.MD, error)

RunGRPCQuery runs a gRPC query from the clientCtx, given all necessary arguments for the gRPC method, and returns the ABCI response. It is used to factorize code between client (Invoke) and server (RegisterGRPCServer) gRPC handlers.

type ChainClientConfig

type ChainClientConfig struct {
	Key                   string                  `json:"key" yaml:"key"`
	ChainID               string                  `json:"chain-id" yaml:"chain-id"`
	RPCAddr               string                  `json:"rpc-addr" yaml:"rpc-addr"`
	AccountPrefix         string                  `json:"account-prefix" yaml:"account-prefix"`
	KeyringBackend        string                  `json:"keyring-backend" yaml:"keyring-backend"`
	KeyDirectory          string                  `json:"key-directory" yaml:"key-directory"`
	Debug                 bool                    `json:"debug" yaml:"debug"`
	Timeout               string                  `json:"timeout" yaml:"timeout"`
	OutputFormat          string                  `json:"output-format" yaml:"output-format"`
	Modules               []module.AppModuleBasic `json:"-" yaml:"-"`
	CustomMsgTypeRegistry map[string]sdkTypes.Msg `json:"-" yaml:"-"`
}

type Codec

type Codec struct {
	ProbeInterfaceRegistry *probeCodecTypes.ProbeInterfaceRegistry
	InterfaceRegistry      types.InterfaceRegistry
	Marshaler              codec.Codec
	TxConfig               client.TxConfig
	Amino                  *codec.LegacyAmino
}

func MakeCodec

func MakeCodec(moduleBasics []module.AppModuleBasic, customMsgTypeRegistry map[string]sdkTypes.Msg) (Codec, error)

func MakeCodecConfig

func MakeCodecConfig() Codec

Directories

Path Synopsis
codec
types
Sourced with modifications from https://github.com/cosmos/cosmos-sdk/blob/d1b5b0c5ae2c51206cc1849e09e4d59986742cc3/codec/types/interface_registry.go
Sourced with modifications from https://github.com/cosmos/cosmos-sdk/blob/d1b5b0c5ae2c51206cc1849e09e4d59986742cc3/codec/types/interface_registry.go

Jump to

Keyboard shortcuts

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