solego

package module
v0.0.0-...-81fb2a9 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

solana-go-wrapper

A small Solana-Go wrapper written for educational purposes. Work in progress😌

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRPCClient

func NewRPCClient(
	ctx context.Context,
	rpcEndpont string,
) (*rpc.Client, error)

NewRPCClient creates a new Solana RPC client.

func NewWSClient

func NewWSClient(
	ctx context.Context,
	wsEndpoint string,
) (*ws.Client, error)

NewWSClient creates a new Solana WS client.

Types

type Client

type Client struct {
	Accounts map[string]string
	// contains filtered or unexported fields
}

Client wraps Solana-sdk clients.

func New

func New(
	ctx context.Context,
	rpcEndpoint, wsEndpoint string,
) (*Client, error)

New creates a new Solana-wrapper client.

func (*Client) GetBalance

func (cl *Client) GetBalance(
	ctx context.Context,
	account solana.PublicKey,
) (string, error)

GetBalance returns the balance of the account of provided publicKey.

func (*Client) LamportsToSOL

func (cl *Client) LamportsToSOL(
	lamports uint64,
) string

LamportsToSOL converts lamports to sol.

func (*Client) NewWallet

func (c *Client) NewWallet(
	ctx context.Context,
	lamports uint64,
) (*solana.PrivateKey, *solana.Signature, error)

NewWallet creates a new wallet account.

func (*Client) SendTransaction

func (c *Client) SendTransaction(
	ctx context.Context,
	lamports uint64,
	fundingAccount string,
	recipientAccount string,
) (sig *solana.Signature, err error)

SendTransaction transfer tokens from one account to another, and returns transaction signature.

func (*Client) VerifySignatures

func (c *Client) VerifySignatures(sig string) (*solana.Transaction, error)

VerifySignatures wraps solana.VerifySignatures and verifies all the signatures in the transaction.

Jump to

Keyboard shortcuts

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