client

package
v0.0.0-...-796e7e7 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignTx

func SignTx(tx *Tx, txCfg sdkclient.TxConfig, privKey *secp256k1.PrivKey) ([]byte, error)

Types

type GRPCClient

type GRPCClient struct {
	// contains filtered or unexported fields
}

func ConnectGRPC

func ConnectGRPC(ctx context.Context, addr string, useTLS bool, opts ...grpc.DialOption) (*GRPCClient, error)

func ConnectGRPCWithTimeout

func ConnectGRPCWithTimeout(ctx context.Context, addr string, useTLS bool, timeout time.Duration, opts ...grpc.DialOption) (*GRPCClient, error)

func (*GRPCClient) BroadcastTx

func (c *GRPCClient) BroadcastTx(ctx context.Context, txBytes []byte, mode sdktx.BroadcastMode) (*sdktx.BroadcastTxResponse, error)

func (*GRPCClient) Close

func (c *GRPCClient) Close() error

func (*GRPCClient) GetAccount

func (c *GRPCClient) GetAccount(ctx context.Context, addr string) (authtypes.BaseAccount, error)

func (*GRPCClient) QueryBalances

func (c *GRPCClient) QueryBalances(ctx context.Context, addr string) (*banktypes.QueryAllBalancesResponse, error)

type RPCClient

type RPCClient struct {
	// contains filtered or unexported fields
}

func ConnectRPCWithTimeout

func ConnectRPCWithTimeout(addr string, timeout time.Duration) (*RPCClient, error)

ConnectRPCWithTimeout connects RPC client connection with timeout.

func (*RPCClient) Block

func (c *RPCClient) Block(ctx context.Context, height int64) (*tmctypes.ResultBlock, error)

Block returns block information for the height.

func (*RPCClient) LatestBlockHeight

func (c *RPCClient) LatestBlockHeight(ctx context.Context) (int64, error)

LatestBlockHeight returns the latest block height on the network.

func (*RPCClient) NetworkChainID

func (c *RPCClient) NetworkChainID(ctx context.Context) (string, error)

NetworkChainID returns network chain id.

func (*RPCClient) Status

func (c *RPCClient) Status(ctx context.Context) (*tmctypes.ResultStatus, error)

Status returns the status of the blockchain network.

type Tx

type Tx struct {
	ChainID        string
	AccNum, AccSeq uint64
	GasLimit       uint64
	Fees           sdk.Coins
	Msgs           []sdk.Msg
}

func NewTx

func NewTx(chainID string, accNum, accSeq, gasLimit uint64, fees sdk.Coins, msgs ...sdk.Msg) *Tx

Jump to

Keyboard shortcuts

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