yellowstone_geyser

package
v0.0.0-...-7276322 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchConvertBlockHash

func BatchConvertBlockHash(geyserBlocks ...*yellowstone_geyser_pb.SubscribeUpdateBlock) []*rpc.GetBlockResult

func BatchConvertTransaction

func BatchConvertTransaction(geyserTxns ...*yellowstone_geyser_pb.SubscribeUpdateTransaction) []*rpc.GetTransactionResult

func ConvertBlockHash

func ConvertBlockHash(geyserBlock *yellowstone_geyser_pb.SubscribeUpdateBlock) *rpc.GetBlockResult

ConvertBlockHash converts a Geyser type block to a github.com/gagliardetto/solana-go Solana block.

func ConvertTransaction

func ConvertTransaction(geyserTx *yellowstone_geyser_pb.SubscribeUpdateTransaction) (*rpc.GetTransactionResult, error)

ConvertTransaction converts a Geyser parsed transaction into an rpc.GetTransactionResult format.

Types

type Client

type Client struct {
	Ctx    context.Context
	Geyser yellowstone_geyser_pb.GeyserClient
	ErrCh  chan error
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, grpcDialURL string, md metadata.MD) (*Client, error)

New creates a new Client instance.

func (*Client) AddStreamClient

func (c *Client) AddStreamClient(ctx context.Context, streamName string, commitmentLevel yellowstone_geyser_pb.CommitmentLevel, opts ...grpc.CallOption) error

AddStreamClient creates a new Geyser subscribe stream client. You can retrieve it with GetStreamClient.

func (*Client) Close

func (c *Client) Close() error

Close closes the client and all the streams.

func (*Client) GetStreamClient

func (c *Client) GetStreamClient(streamName string) *StreamClient

GetStreamClient returns a StreamClient for the given streamName from the client's map.

func (*Client) Ping

func (c *Client) Ping(count int32) (*yellowstone_geyser_pb.PongResponse, error)

type StreamClient

type StreamClient struct {
	Ctx context.Context

	Ch    chan *yellowstone_geyser_pb.SubscribeUpdate
	ErrCh chan error
	// contains filtered or unexported fields
}

func (*StreamClient) AppendAccounts

func (s *StreamClient) AppendAccounts(filterName string, accounts ...string) error

AppendAccounts appends accounts to an existing subscription and sends the request.

func (*StreamClient) GetAccounts

func (s *StreamClient) GetAccounts(filterName string) []string

GetAccounts returns all account addresses for the given filter name.

func (*StreamClient) NewRequest

func (s *StreamClient) NewRequest() *yellowstone_geyser_pb.SubscribeRequest

NewRequest creates a new empty *geyser_pb.SubscribeRequest.

func (*StreamClient) SendCustomRequest

func (s *StreamClient) SendCustomRequest(request *yellowstone_geyser_pb.SubscribeRequest) error

SendCustomRequest sends a custom *geyser_pb.SubscribeRequest using the Geyser client.

func (*StreamClient) SetCommitmentLevel

func (s *StreamClient) SetCommitmentLevel(commitmentLevel yellowstone_geyser_pb.CommitmentLevel)

SetCommitmentLevel modifies the commitment level of the stream's request.

func (*StreamClient) SetRequest

func (s *StreamClient) SetRequest(req *yellowstone_geyser_pb.SubscribeRequest)

SetRequest sets a custom request to be used across all methods.

func (*StreamClient) Stop

func (s *StreamClient) Stop()

func (*StreamClient) SubscribeAccountDataSlice

func (s *StreamClient) SubscribeAccountDataSlice(req []*yellowstone_geyser_pb.SubscribeRequestAccountsDataSlice) error

SubscribeAccountDataSlice subscribes to account data slice updates.

func (*StreamClient) SubscribeAccounts

func (s *StreamClient) SubscribeAccounts(filterName string, req *yellowstone_geyser_pb.SubscribeRequestFilterAccounts) error

SubscribeAccounts subscribes to account updates. Note: This will overwrite existing subscriptions for the given ID. To add new accounts without overwriting, use AppendAccounts.

func (*StreamClient) SubscribeBlocks

func (s *StreamClient) SubscribeBlocks(filterName string, req *yellowstone_geyser_pb.SubscribeRequestFilterBlocks) error

SubscribeBlocks subscribes to block updates.

func (*StreamClient) SubscribeBlocksMeta

func (s *StreamClient) SubscribeBlocksMeta(filterName string, req *yellowstone_geyser_pb.SubscribeRequestFilterBlocksMeta) error

SubscribeBlocksMeta subscribes to block metadata updates.

func (*StreamClient) SubscribeEntry

func (s *StreamClient) SubscribeEntry(filterName string, req *yellowstone_geyser_pb.SubscribeRequestFilterEntry) error

SubscribeEntry subscribes to entry updates.

func (*StreamClient) SubscribeSlots

func (s *StreamClient) SubscribeSlots(filterName string, req *yellowstone_geyser_pb.SubscribeRequestFilterSlots) error

SubscribeSlots subscribes to slot updates.

func (*StreamClient) SubscribeTransaction

func (s *StreamClient) SubscribeTransaction(filterName string, req *yellowstone_geyser_pb.SubscribeRequestFilterTransactions) error

SubscribeTransaction subscribes to transaction updates.

func (*StreamClient) SubscribeTransactionStatus

func (s *StreamClient) SubscribeTransactionStatus(filterName string, req *yellowstone_geyser_pb.SubscribeRequestFilterTransactions) error

SubscribeTransactionStatus subscribes to transaction status updates.

func (*StreamClient) UnsubscribeAccountDataSlice

func (s *StreamClient) UnsubscribeAccountDataSlice() error

func (*StreamClient) UnsubscribeAccounts

func (s *StreamClient) UnsubscribeAccounts(filterName string, accounts ...string) error

UnsubscribeAccounts unsubscribes specific accounts.

func (*StreamClient) UnsubscribeAllAccounts

func (s *StreamClient) UnsubscribeAllAccounts(filterName string) error

func (*StreamClient) UnsubscribeBlocks

func (s *StreamClient) UnsubscribeBlocks(filterName string) error

func (*StreamClient) UnsubscribeBlocksMeta

func (s *StreamClient) UnsubscribeBlocksMeta(filterName string) error

func (*StreamClient) UnsubscribeEntry

func (s *StreamClient) UnsubscribeEntry(filterName string) error

func (*StreamClient) UnsubscribeSlots

func (s *StreamClient) UnsubscribeSlots(filterName string) error

UnsubscribeSlots unsubscribes from slot updates.

func (*StreamClient) UnsubscribeTransaction

func (s *StreamClient) UnsubscribeTransaction(filterName string) error

UnsubscribeTransaction unsubscribes from transaction updates.

func (*StreamClient) UnsubscribeTransactionStatus

func (s *StreamClient) UnsubscribeTransactionStatus(filterName string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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