pkg

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchExtractSigFromTx

func BatchExtractSigFromTx(txns []*solana.Transaction) []solana.Signature
func BuildTransactionLinks(txns []solana.Signature, platform Platform) []string

func ConvertBatchProtobufPacketToTransaction

func ConvertBatchProtobufPacketToTransaction(packets []*proto.Packet) ([]*solana.Transaction, error)

ConvertBatchProtobufPacketToTransaction converts a slice of proto.Packet to a slice of solana-go Transaction.

func ConvertBatchTransactionToProtobufPacket

func ConvertBatchTransactionToProtobufPacket(transactions []*solana.Transaction) ([]*proto.Packet, error)

ConvertBatchTransactionToProtobufPacket converts a slice of solana-go Transaction to a slice of proto.Packet.

func ConvertProtobufPacketToTransaction

func ConvertProtobufPacketToTransaction(packet *proto.Packet) (*solana.Transaction, error)

ConvertProtobufPacketToTransaction converts a proto.Packet to a solana-go Transaction.

func ConvertTransactionToProtobufPacket

func ConvertTransactionToProtobufPacket(transaction *solana.Transaction) (proto.Packet, error)

ConvertTransactionToProtobufPacket converts a solana-go Transaction to a proto.Packet.

func CreateAndObserveGRPCConn

func CreateAndObserveGRPCConn(ctx context.Context, chErr chan error, target string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

CreateAndObserveGRPCConn creates a new gRPC connection and observes its conn status.

func ExtractSigFromTx

func ExtractSigFromTx(tx *solana.Transaction) solana.Signature

ExtractSigFromTx extracts the transaction's signature.

func LamportsToSol

func LamportsToSol(lamports *big.Float) *big.Float

func StrSliceToByteSlice

func StrSliceToByteSlice(s []string) [][]byte

StrSliceToByteSlice converts a string array to a byte array.

func SubscribeTipStream

func SubscribeTipStream(ctx context.Context) (<-chan *TipStreamInfo, <-chan error, error)

SubscribeTipStream establishes a connection to the Jito websocket and receives TipStreamInfo.

Types

type AuthenticationService

type AuthenticationService struct {
	AuthService proto.AuthServiceClient
	GrpcCtx     context.Context
	KeyPair     *Keypair
	BearerToken string
	ExpiresAt   int64 // seconds
	ErrChan     chan error
	// contains filtered or unexported fields
}

func NewAuthenticationService

func NewAuthenticationService(grpcConn *grpc.ClientConn, privateKey solana.PrivateKey) *AuthenticationService

func (*AuthenticationService) AuthenticateAndRefresh

func (as *AuthenticationService) AuthenticateAndRefresh(role proto.Role) error

AuthenticateAndRefresh is a function that authenticates the client and refreshes the access token.

type Keypair

type Keypair struct {
	PublicKey  solana.PublicKey
	PrivateKey solana.PrivateKey
}

func GenerateKeypair

func GenerateKeypair() *Keypair

GenerateKeypair creates a new Solana Keypair.

func NewKeyPair

func NewKeyPair(privateKey solana.PrivateKey) *Keypair

NewKeyPair creates a Keypair from a private key.

type Platform

type Platform string
var (
	SolanaFM       Platform = "https://solana.fm/tx/"
	Solscan        Platform = "https://solscan.io/tx/"
	SolanaExplorer Platform = "https://explorer.solana.com/tx/"
	SolanaBeach    Platform = "https://solanabeach.io/transaction/"
	XRAY           Platform = "https://xray.helius.xyz/tx/"
)

type TipStreamInfo

type TipStreamInfo struct {
	Time                        time.Time `json:"time"`
	LandedTips25ThPercentile    float64   `json:"landed_tips_25th_percentile"`
	LandedTips50ThPercentile    float64   `json:"landed_tips_50th_percentile"`
	LandedTips75ThPercentile    float64   `json:"landed_tips_75th_percentile"`
	LandedTips95ThPercentile    float64   `json:"landed_tips_95th_percentile"`
	LandedTips99ThPercentile    float64   `json:"landed_tips_99th_percentile"`
	EmaLandedTips50ThPercentile float64   `json:"ema_landed_tips_50th_percentile"`
}

Jump to

Keyboard shortcuts

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