client

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: AGPL-3.0 Imports: 42 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthQueryClient

type AuthQueryClient = authtypes.QueryClient

AuthQueryClient is a type to define the auth types Query Client

type AuthzQueryClient

type AuthzQueryClient = authztypes.QueryClient

AuthzQueryClient is a type to define the authz types Query Client

type BankQueryClient

type BankQueryClient = banktypes.QueryClient

BankQueryClient is a type to define the bank types Query Client

type BridgeQueryClient

type BridgeQueryClient = bridgetypes.QueryClient

BridgeQueryClient is a type to define the bridge types Query Client

type ChallengeQueryClient added in v0.0.7

type ChallengeQueryClient = challengetypes.QueryClient

ChallengeQueryClient is a type to define the challenge types Query Client

type CrosschainQueryClient

type CrosschainQueryClient = crosschaintypes.QueryClient

CrosschainQueryClient is a type to define the crosschain types Query Client

type DistrQueryClient

type DistrQueryClient = distrtypes.QueryClient

DistrQueryClient is a type to define the distribution types Query Client

type FeegrantQueryClient

type FeegrantQueryClient = feegranttypes.QueryClient

FeegrantQueryClient is a type to define the feegrant types Query Client

type GashubQueryClient

type GashubQueryClient = gashubtypes.QueryClient

GashubQueryClient is a type to define the gashub types Query Client

type GovQueryClientV1

type GovQueryClientV1 = govv1.QueryClient

GovQueryClientV1 is a type to define the governance types Query Client V1

type GreenfieldClient

type GreenfieldClient struct {
	// AuthQueryClient holds the auth query client.
	AuthQueryClient
	// AuthzQueryClient holds the authz query client.
	AuthzQueryClient
	// BankQueryClient holds the bank query client.
	BankQueryClient
	// ChallengeQueryClient holds the bank query client.
	ChallengeQueryClient
	// CrosschainQueryClient holds the crosschain query client.
	CrosschainQueryClient
	// DistrQueryClient holds the distr query client.
	DistrQueryClient
	// FeegrantQueryClient holds the feegrant query client.
	FeegrantQueryClient
	// GashubQueryClient holds the gashub query client.
	GashubQueryClient
	// PaymentQueryClient holds the payment query client.
	PaymentQueryClient
	// SpQueryClient holds the sp query client.
	SpQueryClient
	// BridgeQueryClient holds the bridge query client.
	BridgeQueryClient
	// StorageQueryClient holds the storage query client.
	StorageQueryClient
	// GovQueryClientV1 holds the gov query client V1.
	GovQueryClientV1
	// OracleQueryClient holds the oracle query client.
	OracleQueryClient
	// SlashingQueryClient holds the slashing query client.
	SlashingQueryClient
	// StakingQueryClient holds the staking query client.
	StakingQueryClient
	// UpgradeQueryClient holds the upgrade query client.
	UpgradeQueryClient
	// VirtualGroupQueryClient holds the virtual group query client
	VirtualGroupQueryClient
	// TxClient holds the tx service client.
	TxClient
	// TmService holds the tendermint service client
	TmClient
	// contains filtered or unexported fields
}

GreenfieldClient holds all necessary information for creating/querying transactions.

func NewCustomGreenfieldClient added in v0.2.3

func NewCustomGreenfieldClient(rpcAddr, chainId string, customDialer func(string) (*http.Client, error), opts ...GreenfieldClientOption) (*GreenfieldClient, error)

NewCustomGreenfieldClient is used to create a new GreenfieldClient structure, allows for setting a custom http client

func NewGreenfieldClient

func NewGreenfieldClient(rpcAddr, chainId string, opts ...GreenfieldClientOption) (*GreenfieldClient, error)

NewGreenfieldClient is used to create a new GreenfieldClient structure.

func (*GreenfieldClient) ABCIInfo added in v1.1.0

func (*GreenfieldClient) BroadcastTx

func (c *GreenfieldClient) BroadcastTx(ctx context.Context, msgs []sdk.Msg, txOpt *types.TxOption, opts ...grpc.CallOption) (*tx.BroadcastTxResponse, error)

BroadcastTx signs and broadcasts a tx with simulated gas(if not provided in txOpt)

func (*GreenfieldClient) BroadcastVote added in v0.2.3

func (c *GreenfieldClient) BroadcastVote(ctx context.Context, vote votepool.Vote) error

func (*GreenfieldClient) GetAccountByAddr added in v0.2.2

func (c *GreenfieldClient) GetAccountByAddr(ctx context.Context, addr sdk.AccAddress) (authtypes.AccountI, error)

func (*GreenfieldClient) GetBlock added in v0.2.3

func (c *GreenfieldClient) GetBlock(ctx context.Context, height *int64) (*ctypes.ResultBlock, error)

GetBlock by height, gets the latest block if height is nil

func (*GreenfieldClient) GetBlockResults added in v0.2.3

func (c *GreenfieldClient) GetBlockResults(ctx context.Context, height *int64) (*ctypes.ResultBlockResults, error)

GetBlockResults by height, gets the latest block result if height is nil

func (*GreenfieldClient) GetChainId

func (c *GreenfieldClient) GetChainId() (string, error)

GetChainId returns the chain ID set in the GreenfieldClient structure.

func (*GreenfieldClient) GetCodec added in v0.1.2

func (c *GreenfieldClient) GetCodec() *codec.ProtoCodec

func (*GreenfieldClient) GetCommit added in v0.2.3

func (c *GreenfieldClient) GetCommit(ctx context.Context, height int64) (*ctypes.ResultCommit, error)

func (*GreenfieldClient) GetHeader added in v0.2.3

func (c *GreenfieldClient) GetHeader(ctx context.Context, height *int64) (*ctypes.ResultHeader, error)

GetHeader by height, gets the latest block header if height is nil

func (*GreenfieldClient) GetKeyManager

func (c *GreenfieldClient) GetKeyManager() (keys.KeyManager, error)

GetKeyManager returns the key manager set in the GreenfieldClient structure.

func (*GreenfieldClient) GetNonce added in v0.0.7

func (c *GreenfieldClient) GetNonce(ctx context.Context) (uint64, error)

func (*GreenfieldClient) GetNonceByAddr added in v0.2.2

func (c *GreenfieldClient) GetNonceByAddr(ctx context.Context, addr sdk.AccAddress) (uint64, error)

func (*GreenfieldClient) GetStatus added in v0.2.3

func (c *GreenfieldClient) GetStatus(ctx context.Context) (*ctypes.ResultStatus, error)

func (*GreenfieldClient) GetUnconfirmedTxs added in v0.2.3

func (c *GreenfieldClient) GetUnconfirmedTxs(ctx context.Context, limit *int) (*ctypes.ResultUnconfirmedTxs, error)

GetUnconfirmedTxs by height, gets the latest block header if height is nil

func (*GreenfieldClient) GetValidators added in v0.2.3

func (c *GreenfieldClient) GetValidators(ctx context.Context, height *int64) (*ctypes.ResultValidators, error)

GetValidators by height, gets the latest validators if height is nil

func (*GreenfieldClient) QueryVote added in v0.2.3

func (c *GreenfieldClient) QueryVote(ctx context.Context, eventType int, eventHash []byte) (*ctypes.ResultQueryVote, error)

func (*GreenfieldClient) SetChainId

func (c *GreenfieldClient) SetChainId(id string)

SetChainId sets the chain ID in the GreenfieldClient structure.

func (*GreenfieldClient) SetKeyManager

func (c *GreenfieldClient) SetKeyManager(keyManager keys.KeyManager)

SetKeyManager sets a key manager in the GreenfieldClient structure.

func (*GreenfieldClient) SignTx

func (c *GreenfieldClient) SignTx(ctx context.Context, msgs []sdk.Msg, txOpt *types.TxOption) ([]byte, error)

SignTx signs the tx with private key and returns bytes

func (*GreenfieldClient) SimulateTx

func (c *GreenfieldClient) SimulateTx(ctx context.Context, msgs []sdk.Msg, txOpt *types.TxOption, opts ...grpc.CallOption) (*tx.SimulateResponse, error)

SimulateTx simulates a tx and gets Gas info

func (*GreenfieldClient) Tx added in v0.2.3

func (c *GreenfieldClient) Tx(ctx context.Context, txHash string) (*ctypes.ResultTx, error)

Tx gets a tx by detail by the tx hash

type GreenfieldClientOption

type GreenfieldClientOption interface {
	Apply(*GreenfieldClient)
}

GreenfieldClientOption configures how we set up the greenfield client.

func WithGrpcConnectionAndDialOption added in v0.1.2

func WithGrpcConnectionAndDialOption(grpcAddr string, opts ...grpc.DialOption) GreenfieldClientOption

WithGrpcConnectionAndDialOption returns a GreenfieldClientOption which configures a grpc client connection with grpc dail options.

func WithKeyManager

func WithKeyManager(km keys.KeyManager) GreenfieldClientOption

WithKeyManager returns a GreenfieldClientOption which configures a client key manager option.

func WithWebSocketClient added in v0.2.3

func WithWebSocketClient() GreenfieldClientOption

WithWebSocketClient returns a GreenfieldClientOption which specify that connection is a websocket connection

type GreenfieldClientOptionFunc

type GreenfieldClientOptionFunc func(*GreenfieldClient)

GreenfieldClientOptionFunc defines an applied function for setting the greenfield client.

func (GreenfieldClientOptionFunc) Apply

Apply set up the option field to the client instance.

type OracleQueryClient

type OracleQueryClient = oracletypes.QueryClient

OracleQueryClient is a type to define the oracle types Query Client

type PaymentQueryClient

type PaymentQueryClient = paymenttypes.QueryClient

PaymentQueryClient is a type to define the payment types Query Client

type SlashingQueryClient

type SlashingQueryClient = slashingtypes.QueryClient

SlashingQueryClient is a type to define the slashing types Query Client

type SpQueryClient

type SpQueryClient = sptypes.QueryClient

SpQueryClient is a type to define the sp types Query Client

type StakingQueryClient

type StakingQueryClient = stakingtypes.QueryClient

StakingQueryClient is a type to define the staking types Query Client

type StorageQueryClient

type StorageQueryClient = storagetypes.QueryClient

StorageQueryClient is a type to define the storage types Query Client

type TendermintClient

type TendermintClient struct {
	TmClient client.Client
}

func NewTendermintClient

func NewTendermintClient(addr string) TendermintClient

type TmClient added in v0.1.2

type TmClient = tmservice.ServiceClient

TmClient is a type to define the tendermint service client

type TransactionClient

type TransactionClient interface {
	BroadcastTx(ctx context.Context, msgs []sdk.Msg, txOpt *types.TxOption, opts ...grpc.CallOption) (*tx.BroadcastTxResponse, error)
	SimulateTx(ctx context.Context, msgs []sdk.Msg, txOpt *types.TxOption, opts ...grpc.CallOption) (*tx.SimulateResponse, error)
	SignTx(ctx context.Context, msgs []sdk.Msg, txOpt *types.TxOption) ([]byte, error)
	GetNonce(ctx context.Context) (uint64, error)
	GetNonceByAddr(ctx context.Context, addr sdk.AccAddress) (uint64, error)
	GetAccountByAddr(ctx context.Context, addr sdk.AccAddress) (authtypes.AccountI, error)
}

type TxClient

type TxClient = tx.ServiceClient

TxClient is a type to define the tx Service Client

type UpgradeQueryClient

type UpgradeQueryClient = upgradetypes.QueryClient

UpgradeQueryClient is a type to define the upgrade types Query Client

type VirtualGroupQueryClient added in v0.2.3

type VirtualGroupQueryClient = virtualgroupmoduletypes.QueryClient

VirtualGroupQueryClient is a type to define the virtual group types Query Client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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