client

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInfo added in v1.4.0

type AccountInfo struct {
	Lamports  uint64
	Owner     string
	Excutable bool
	RentEpoch uint64
	Data      []byte
}

type Client

type Client struct {
	rpc.RpcClient
}

func NewClient

func NewClient(endpoint string) *Client

func (*Client) GetAccountInfo added in v1.4.0

func (c *Client) GetAccountInfo(ctx context.Context, base58Addr string) (AccountInfo, error)

GetAccountInfo return account's info

func (*Client) GetBalance

func (c *Client) GetBalance(ctx context.Context, base58Addr string) (uint64, error)

GetBalance fetch users lamports(SOL) balance

func (*Client) GetBalanceWithCfg

func (c *Client) GetBalanceWithCfg(ctx context.Context, base58Addr string, cfg rpc.GetBalanceConfig) (uint64, error)

GetBalance fetch users lamports(SOL) balance with specific commitment

func (*Client) GetRecentBlockhash added in v1.4.0

func (c *Client) GetRecentBlockhash(ctx context.Context) (rpc.GetRecentBlockHashResultValue, error)

GetRecentBlockhash return recent blockhash information

func (*Client) SendRawTransaction added in v1.4.0

func (c *Client) SendRawTransaction(ctx context.Context, tx []byte) (string, error)

SendRawTransaction will send your raw tx

func (*Client) SendTransaction added in v1.4.0

func (c *Client) SendTransaction(ctx context.Context, param SendTransactionParam) (string, error)

SendTransaction is a quick way to send tx

type SendTransactionParam added in v1.4.0

type SendTransactionParam struct {
	Instructions []types.Instruction
	Signers      []types.Account
	FeePayer     common.PublicKey
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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