solana

package
v0.0.0-...-58f8dfc Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Slot was skipped, or missing due to ledger jump to recent snapshot
	ErrSlotSkippedCode = -32007

	//Slot was skipped, or missing in long-term storage
	ErrLongTermStorageSlotSkippedCode = -32009
)

https://github.com/solana-labs/solana/blob/master/rpc-client-api/src/custom_error.rs

Variables

View Source
var (
	ErrTooManyRequests = errors.New("too many requests")
	ErrSlotSkipped     = errors.New("slot was skipped")
)

Functions

This section is empty.

Types

type GetBlockResult

type GetBlockResult struct {
	IsConfirmed  bool
	Transactions []rpc.TransactionWithMeta
	BlockTime    *time.Time
}

type GetLatestBlockResult

type GetLatestBlockResult struct {
	Block     uint64
	Timestamp time.Time
}

type Options

type Options func(*SolanaSDK)

func WithRetries

func WithRetries(retries uint, delay time.Duration) Options

type SolanaSDK

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

func NewSolanaSDK

func NewSolanaSDK(url string, rl ratelimit.Limiter, metrics metrics.Metrics, opts ...Options) *SolanaSDK

func (*SolanaSDK) GetBlock

func (s *SolanaSDK) GetBlock(ctx context.Context, block uint64) (*GetBlockResult, error)

func (*SolanaSDK) GetLatestBlock

func (s *SolanaSDK) GetLatestBlock(ctx context.Context) (*GetLatestBlockResult, error)

func (*SolanaSDK) GetSignaturesForAddress

func (s *SolanaSDK) GetSignaturesForAddress(ctx context.Context, address solana.PublicKey) ([]*rpc.TransactionSignature, error)

func (*SolanaSDK) GetTransaction

func (s *SolanaSDK) GetTransaction(ctx context.Context, txSignature solana.Signature) (*rpc.GetTransactionResult, error)

Jump to

Keyboard shortcuts

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