rpc

package
v0.0.0-...-43f947b Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// defaultPageLimit is the default number of signatures to fetch in one GetSignaturesForAddressWithOpts call
	DefaultPageLimit = 1000

	// RPCAlertLatency is the default threshold for RPC latency to be considered unhealthy and trigger an alert.
	// The 'HEALTH_CHECK_SLOT_DISTANCE' is default to 150 slots, which is 150 * 0.4s = 60s
	RPCAlertLatency = time.Duration(60) * time.Second
)

Variables

This section is empty.

Functions

func CheckRPCStatus

func CheckRPCStatus(ctx context.Context, client interfaces.SolanaRPCClient, privnet bool) (time.Time, error)

CheckRPCStatus checks the RPC status of the solana chain

func GetFirstSignatureForAddress

func GetFirstSignatureForAddress(
	ctx context.Context,
	client interfaces.SolanaRPCClient,
	address solana.PublicKey,
	pageLimit int,
) (solana.Signature, error)

GetFirstSignatureForAddress searches the first signature for the given address. Note: make sure that the rpc provider used has enough transaction history.

func GetSignaturesForAddressUntil

func GetSignaturesForAddressUntil(
	ctx context.Context,
	client interfaces.SolanaRPCClient,
	address solana.PublicKey,
	untilSig solana.Signature,
	pageLimit int,
) ([]*rpc.TransactionSignature, error)

GetSignaturesForAddressUntil searches for signatures for the given address until the given signature (exclusive). Note: make sure that the rpc provider used has enough transaction history.

Types

This section is empty.

Jump to

Keyboard shortcuts

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