searcher_client

package
v0.0.0-...-5aa976a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDroppedBundle

func NewDroppedBundle(message string) error

func NewInternalError

func NewInternalError(message string) error

func NewSimulationFailureError

func NewSimulationFailureError(tx string, message string) error

func NewStateAuctionBidRejectedError

func NewStateAuctionBidRejectedError(auction string, tip uint64) error

func NewWinningBatchBidRejectedError

func NewWinningBatchBidRejectedError(auction string, tip uint64) error

Types

type Account

type Account struct {
	Executable bool     `json:"executable"`
	Owner      string   `json:"owner"`
	Lamports   int      `json:"lamports"`
	Data       []string `json:"data"`
	RentEpoch  *big.Int `json:"rentEpoch,omitempty"`
}

type BundleRejectionError

type BundleRejectionError struct {
	Message string
}

func (BundleRejectionError) Error

func (e BundleRejectionError) Error() string

type Client

type Client struct {
	GrpcConn *grpc.ClientConn
	RpcConn  *rpc.Client

	SearcherService proto.SearcherServiceClient

	Auth *pkg.AuthenticationService

	ErrChan     chan error
	GrpcErrChan chan error
}

func NewSearcherClient

func NewSearcherClient(grpcDialURL string, rpcClient *rpc.Client, privateKey solana.PrivateKey, tlsConfig *tls.Config, opts ...grpc.DialOption) (*Client, error)

func (*Client) AssembleBundle

func (c *Client) AssembleBundle(transactions []*solana.Transaction) (*proto.Bundle, error)

func (*Client) BroadcastBundle

func (c *Client) BroadcastBundle(transactions []*solana.Transaction, opts ...grpc.CallOption) (*proto.SendBundleResponse, error)

func (*Client) BroadcastBundleWithConfirmation

func (c *Client) BroadcastBundleWithConfirmation(ctx context.Context, transactions []*solana.Transaction, opts ...grpc.CallOption) (*proto.SendBundleResponse, error)

BroadcastBundleWithConfirmation is a function that sends a bundle of packets to the SearcherService and subscribes to the results.

func (*Client) GenerateTipInstruction

func (c *Client) GenerateTipInstruction(tipAmount uint64, from, tipAccount solana.PublicKey) solana.Instruction

GenerateTipInstruction is a function that generates a Solana tip instruction.

func (*Client) GenerateTipRandomAccountInstruction

func (c *Client) GenerateTipRandomAccountInstruction(tipAmount uint64, from solana.PublicKey) (solana.Instruction, error)

func (*Client) GetConnectedLeaders

func (c *Client) GetConnectedLeaders(opts ...grpc.CallOption) (*proto.ConnectedLeadersResponse, error)

func (*Client) GetConnectedLeadersRegioned

func (c *Client) GetConnectedLeadersRegioned(regions []string, opts ...grpc.CallOption) (*proto.ConnectedLeadersRegionedResponse, error)

func (*Client) GetNextScheduledLeader

func (c *Client) GetNextScheduledLeader(regions []string, opts ...grpc.CallOption) (*proto.NextScheduledLeaderResponse, error)

func (*Client) GetRandomTipAccount

func (c *Client) GetRandomTipAccount(opts ...grpc.CallOption) (string, error)

func (*Client) GetRegions

func (c *Client) GetRegions(opts ...grpc.CallOption) (*proto.GetRegionsResponse, error)

func (*Client) GetTipAccounts

func (c *Client) GetTipAccounts(opts ...grpc.CallOption) (*proto.GetTipAccountsResponse, error)

func (*Client) NewMempoolStreamAccount

func (c *Client) NewMempoolStreamAccount(accounts, regions []string) (proto.SearcherService_SubscribeMempoolClient, error)

NewMempoolStreamAccount creates a new mempool subscription on specific accounts.

func (*Client) NewMempoolStreamProgram

func (c *Client) NewMempoolStreamProgram(programs, regions []string) (proto.SearcherService_SubscribeMempoolClient, error)

func (*Client) SimulateBundle

func (c *Client) SimulateBundle(ctx context.Context, bundleParams SimulateBundleParams, simulationConfigs SimulateBundleConfig) (*SimulatedBundleResponse, error)

SimulateBundle is an RPC method that simulates a bundle – exclusively available to Jito-Solana validator.

func (*Client) SubscribeAccountsMempoolTransactions

func (c *Client) SubscribeAccountsMempoolTransactions(payload *SubscribeAccountsMempoolTransactionsPayload) error

SubscribeAccountsMempoolTransactions subscribes to the mempool transactions of the provided accounts.

func (*Client) SubscribeBundleResults

func (c *Client) SubscribeBundleResults(opts ...grpc.CallOption) (proto.SearcherService_SubscribeBundleResultsClient, error)

func (*Client) SubscribeProgramsMempoolTransactions

func (c *Client) SubscribeProgramsMempoolTransactions(payload *SubscribeProgramsMempoolTransactionsPayload) error

SubscribeProgramsMempoolTransactions subscribes to the mempool transactions of the provided programs.

type ExecutionAccounts

type ExecutionAccounts struct {
	Encoding  string   `json:"encoding"`
	Addresses []string `json:"addresses"`
}

type ReturnData

type ReturnData struct {
	ProgramId string    `json:"programId"`
	Data      [2]string `json:"data"`
}

type SimulateBundleConfig

type SimulateBundleConfig struct {
	PreExecutionAccountsConfigs  []ExecutionAccounts `json:"preExecutionAccountsConfigs"`
	PostExecutionAccountsConfigs []ExecutionAccounts `json:"postExecutionAccountsConfigs"`
}

type SimulateBundleParams

type SimulateBundleParams struct {
	EncodedTransactions []string `json:"encodedTransactions"`
}

type SimulatedBundleResponse

type SimulatedBundleResponse struct {
	Context interface{}                   `json:"context"`
	Value   SimulatedBundleResponseStruct `json:"value"`
}

type SimulatedBundleResponseStruct

type SimulatedBundleResponseStruct struct {
	Summary           interface{}         `json:"summary"`
	TransactionResult []TransactionResult `json:"transactionResults"`
}

type SubscribeAccountsMempoolTransactionsPayload

type SubscribeAccountsMempoolTransactionsPayload struct {
	Ctx      context.Context
	Accounts []string
	Regions  []string
	TxCh     chan *solana.Transaction
	ErrCh    chan error
}

type SubscribeProgramsMempoolTransactionsPayload

type SubscribeProgramsMempoolTransactionsPayload struct {
	Ctx      context.Context
	Accounts []string
	Regions  []string
	TxCh     chan *solana.Transaction
	ErrCh    chan error
}

type TransactionResult

type TransactionResult struct {
	Err                   interface{} `json:"err,omitempty"`
	Logs                  []string    `json:"logs,omitempty"`
	PreExecutionAccounts  []Account   `json:"preExecutionAccounts,omitempty"`
	PostExecutionAccounts []Account   `json:"postExecutionAccounts,omitempty"`
	UnitsConsumed         *int        `json:"unitsConsumed,omitempty"`
	ReturnData            *ReturnData `json:"returnData,omitempty"`
}

Jump to

Keyboard shortcuts

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