Documentation ¶
Index ¶
- func BatchConvertBlockHash(geyserBlocks ...*geyser_pb.SubscribeUpdateBlock) []*rpc.GetBlockResult
- func BatchConvertTransaction(geyserTxns ...*geyser_pb.SubscribeUpdateTransaction) []*rpc.GetTransactionResult
- func ConvertBlockHash(geyserBlock *geyser_pb.SubscribeUpdateBlock) *rpc.GetBlockResult
- func ConvertTransaction(geyserTx *geyser_pb.SubscribeUpdateTransaction) (*rpc.GetTransactionResult, error)
- type Client
- func (c *Client) AddStreamClient(ctx context.Context, streamName string, ...) error
- func (c *Client) AddStreamClientWithoutSubscribe(ctx context.Context, streamName string, ...) error
- func (c *Client) Close() error
- func (c *Client) GetStreamClient(streamName string) *StreamClient
- func (c *Client) Ping(count int32) (*geyser_pb.PongResponse, error)
- type StreamClient
- func (s *StreamClient) AppendAccounts(filterName string, accounts ...string) error
- func (s *StreamClient) GetAccounts(filterName string) []string
- func (s *StreamClient) NewRequest() *geyser_pb.SubscribeRequest
- func (s *StreamClient) SendCustomRequest(request *geyser_pb.SubscribeRequest) error
- func (s *StreamClient) SetCommitmentLevel(commitmentLevel *geyser_pb.CommitmentLevel)
- func (s *StreamClient) SetRequest(req *geyser_pb.SubscribeRequest)
- func (s *StreamClient) Stop()
- func (s *StreamClient) SubscribeAccountDataSlice(req []*geyser_pb.SubscribeRequestAccountsDataSlice) error
- func (s *StreamClient) SubscribeAccounts(filterName string, req *geyser_pb.SubscribeRequestFilterAccounts) error
- func (s *StreamClient) SubscribeBlocks(filterName string, req *geyser_pb.SubscribeRequestFilterBlocks) error
- func (s *StreamClient) SubscribeBlocksMeta(filterName string, req *geyser_pb.SubscribeRequestFilterBlocksMeta) error
- func (s *StreamClient) SubscribeEntry(filterName string, req *geyser_pb.SubscribeRequestFilterEntry) error
- func (s *StreamClient) SubscribeSlots(filterName string, req *geyser_pb.SubscribeRequestFilterSlots) error
- func (s *StreamClient) SubscribeTransaction(filterName string, req *geyser_pb.SubscribeRequestFilterTransactions) error
- func (s *StreamClient) SubscribeTransactionStatus(filterName string, req *geyser_pb.SubscribeRequestFilterTransactions) error
- func (s *StreamClient) UnsubscribeAccountDataSlice() error
- func (s *StreamClient) UnsubscribeAccounts(filterName string, accounts ...string) error
- func (s *StreamClient) UnsubscribeAllAccounts(filterName string) error
- func (s *StreamClient) UnsubscribeBlocks(filterName string) error
- func (s *StreamClient) UnsubscribeBlocksMeta(filterName string) error
- func (s *StreamClient) UnsubscribeEntry(filterName string) error
- func (s *StreamClient) UnsubscribeSlots(filterName string) error
- func (s *StreamClient) UnsubscribeTransaction(filterName string) error
- func (s *StreamClient) UnsubscribeTransactionStatus(filterName string) error
- type StreamManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchConvertBlockHash ¶
func BatchConvertBlockHash(geyserBlocks ...*geyser_pb.SubscribeUpdateBlock) []*rpc.GetBlockResult
func BatchConvertTransaction ¶
func BatchConvertTransaction(geyserTxns ...*geyser_pb.SubscribeUpdateTransaction) []*rpc.GetTransactionResult
func ConvertBlockHash ¶
func ConvertBlockHash(geyserBlock *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 *geyser_pb.SubscribeUpdateTransaction) (*rpc.GetTransactionResult, error)
ConvertTransaction converts a Geyser parsed transaction into an rpc.GetTransactionResult format.
Types ¶
type Client ¶ added in v0.0.2
type Client struct { Ctx context.Context Geyser geyser_pb.GeyserClient ErrCh chan error // contains filtered or unexported fields }
func New ¶
func New(ctx context.Context, grpcDialURL string, useGzipCompression bool, md metadata.MD) (*Client, error)
New creates a new Client instance.
func (*Client) AddStreamClient ¶ added in v0.0.2
func (c *Client) AddStreamClient(ctx context.Context, streamName string, commitmentLevel *geyser_pb.CommitmentLevel, opts ...grpc.CallOption) error
AddStreamClient creates a new Geyser subscribe stream client. You can retrieve it with GetStreamClient.
func (*Client) AddStreamClientWithoutSubscribe ¶ added in v0.0.4
func (*Client) GetStreamClient ¶ added in v0.0.2
func (c *Client) GetStreamClient(streamName string) *StreamClient
GetStreamClient returns a StreamClient for the given streamName from the client's map.
type StreamClient ¶ added in v0.0.2
type StreamClient struct { Ctx context.Context UpdateCh chan *geyser_pb.SubscribeUpdate ErrCh chan error // contains filtered or unexported fields }
func (*StreamClient) AppendAccounts ¶ added in v0.0.2
func (s *StreamClient) AppendAccounts(filterName string, accounts ...string) error
AppendAccounts appends accounts to an existing subscription and sends the request.
func (*StreamClient) GetAccounts ¶ added in v0.0.2
func (s *StreamClient) GetAccounts(filterName string) []string
GetAccounts returns all account addresses for the given filter name.
func (*StreamClient) NewRequest ¶ added in v0.0.2
func (s *StreamClient) NewRequest() *geyser_pb.SubscribeRequest
NewRequest creates a new empty *geyser_pb.SubscribeRequest.
func (*StreamClient) SendCustomRequest ¶ added in v0.0.2
func (s *StreamClient) SendCustomRequest(request *geyser_pb.SubscribeRequest) error
SendCustomRequest sends a custom *geyser_pb.SubscribeRequest using the Geyser client.
func (*StreamClient) SetCommitmentLevel ¶ added in v0.0.2
func (s *StreamClient) SetCommitmentLevel(commitmentLevel *geyser_pb.CommitmentLevel)
SetCommitmentLevel modifies the commitment level of the stream's request.
func (*StreamClient) SetRequest ¶ added in v0.0.2
func (s *StreamClient) SetRequest(req *geyser_pb.SubscribeRequest)
SetRequest sets a custom request to be used across all methods.
func (*StreamClient) Stop ¶ added in v0.0.2
func (s *StreamClient) Stop()
func (*StreamClient) SubscribeAccountDataSlice ¶ added in v0.0.2
func (s *StreamClient) SubscribeAccountDataSlice(req []*geyser_pb.SubscribeRequestAccountsDataSlice) error
SubscribeAccountDataSlice subscribes to account data slice updates.
func (*StreamClient) SubscribeAccounts ¶ added in v0.0.2
func (s *StreamClient) SubscribeAccounts(filterName string, req *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 ¶ added in v0.0.2
func (s *StreamClient) SubscribeBlocks(filterName string, req *geyser_pb.SubscribeRequestFilterBlocks) error
SubscribeBlocks subscribes to block updates.
func (*StreamClient) SubscribeBlocksMeta ¶ added in v0.0.2
func (s *StreamClient) SubscribeBlocksMeta(filterName string, req *geyser_pb.SubscribeRequestFilterBlocksMeta) error
SubscribeBlocksMeta subscribes to block metadata updates.
func (*StreamClient) SubscribeEntry ¶ added in v0.0.2
func (s *StreamClient) SubscribeEntry(filterName string, req *geyser_pb.SubscribeRequestFilterEntry) error
SubscribeEntry subscribes to entry updates.
func (*StreamClient) SubscribeSlots ¶ added in v0.0.2
func (s *StreamClient) SubscribeSlots(filterName string, req *geyser_pb.SubscribeRequestFilterSlots) error
SubscribeSlots subscribes to slot updates.
func (*StreamClient) SubscribeTransaction ¶ added in v0.0.2
func (s *StreamClient) SubscribeTransaction(filterName string, req *geyser_pb.SubscribeRequestFilterTransactions) error
SubscribeTransaction subscribes to transaction updates.
func (*StreamClient) SubscribeTransactionStatus ¶ added in v0.0.2
func (s *StreamClient) SubscribeTransactionStatus(filterName string, req *geyser_pb.SubscribeRequestFilterTransactions) error
SubscribeTransactionStatus subscribes to transaction status updates.
func (*StreamClient) UnsubscribeAccountDataSlice ¶ added in v0.0.2
func (s *StreamClient) UnsubscribeAccountDataSlice() error
func (*StreamClient) UnsubscribeAccounts ¶ added in v0.0.2
func (s *StreamClient) UnsubscribeAccounts(filterName string, accounts ...string) error
UnsubscribeAccounts unsubscribes specific accounts.
func (*StreamClient) UnsubscribeAllAccounts ¶ added in v0.0.2
func (s *StreamClient) UnsubscribeAllAccounts(filterName string) error
func (*StreamClient) UnsubscribeBlocks ¶ added in v0.0.2
func (s *StreamClient) UnsubscribeBlocks(filterName string) error
func (*StreamClient) UnsubscribeBlocksMeta ¶ added in v0.0.2
func (s *StreamClient) UnsubscribeBlocksMeta(filterName string) error
func (*StreamClient) UnsubscribeEntry ¶ added in v0.0.2
func (s *StreamClient) UnsubscribeEntry(filterName string) error
func (*StreamClient) UnsubscribeSlots ¶ added in v0.0.2
func (s *StreamClient) UnsubscribeSlots(filterName string) error
UnsubscribeSlots unsubscribes from slot updates.
func (*StreamClient) UnsubscribeTransaction ¶ added in v0.0.2
func (s *StreamClient) UnsubscribeTransaction(filterName string) error
UnsubscribeTransaction unsubscribes from transaction updates.
func (*StreamClient) UnsubscribeTransactionStatus ¶ added in v0.0.2
func (s *StreamClient) UnsubscribeTransactionStatus(filterName string) error
type StreamManager ¶ added in v0.0.2
type StreamManager struct {
// contains filtered or unexported fields
}