grpc

package
v0.0.0-...-8dfb25f Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTLSPort     = "443"
	DefaultGRPCTimeout = 10 * time.Second // detecting conn failure issue: https://github.com/grpc/grpc-go/issues/849
)

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns not found status.

Types

type Client

type Client struct {
	*grpc.ClientConn
}

Client wraps GRPC client connection.

func NewClient

func NewClient(grpcURL string) (*Client, error)

NewClient creates GRPC client.

func (*Client) BroadcastTx

func (c *Client) BroadcastTx(ctx context.Context, txBytes []byte) (*tx.BroadcastTxResponse, error)

BroadcastTx broadcasts transaction.

func (*Client) GetAuthQueryClient

func (c *Client) GetAuthQueryClient() authtypes.QueryClient

GetAuthQueryClient returns a object of queryClient

func (*Client) GetBalance

func (c *Client) GetBalance(ctx context.Context, address string, denom string) (*sdktypes.Coin, error)

GetBalance returns balance of a given account for staking denom.

func (*Client) GetBankQueryClient

func (c *Client) GetBankQueryClient() banktypes.QueryClient

GetBankQueryClient returns a object of queryClient.

func (*Client) GetBaseAccountInfo

func (c *Client) GetBaseAccountInfo(ctx context.Context, address string) (authtypes.BaseAccount, error)

GetBaseAccountInfo returns base account information

func (*Client) GetTxClient

func (c *Client) GetTxClient() tx.ServiceClient

GetTxClient returns an object of ServiceClient.

Jump to

Keyboard shortcuts

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