Versions in this module Expand all Collapse all v0 v0.8.1 Feb 13, 2022 v0.8.0 Feb 13, 2022 Changes in this version + var ErrNotConnected = errors.New("websocket not connected") + var ErrUrlEmpty = errors.New("url can not be empty") + var ErrUrlNamePassNotAllowed = errors.New("user name and password are not allowed in websocket uri") + var ErrUrlWrongScheme = errors.New("websocket uri must start with ws or wss scheme") + type AccountResult struct + Context struct{ ... } + Value struct{ ... } + type Client struct + func NewClient(wsURL string, verbose bool) *Client + func (c *Client) AccountSubscribe(account solana.PublicKey, commitment rpc.CommitmentType) (*Subscription, error) + func (c *Client) Close() + func (c *Client) CloseAndReconnect() + func (c *Client) Dial(ctx context.Context) (err error) + func (c *Client) IsConnected() bool + func (c *Client) LogSubscribe(account solana.PublicKey, commitment rpc.CommitmentType) (*Subscription, error) + func (c *Client) ProgramSubscribe(programId solana.PublicKey, commitment rpc.CommitmentType) (*Subscription, error) + func (c *Client) SignatureSubscribe(signature string, commitment rpc.CommitmentType) (*Subscription, error) + func (c *Client) SlotSubscribe() (*Subscription, error) + type LogResult struct + Context struct{ ... } + Value struct{ ... } + type ProgramResult struct + Context struct{ ... } + Value struct{ ... } + type SignatureResult struct + Context struct{ ... } + Value struct{ ... } + type SlotResult struct + Parent uint64 + Root uint64 + Slot uint64 + type Subscription struct + func (s *Subscription) Recv(ctx context.Context) (interface{}, error) + func (s *Subscription) Unsubscribe() + type Websocket struct + Errors chan<- error + HandshakeTimeout time.Duration + Id uint64 + Logger *zap.Logger + Meta map[string]interface{} + OnConnect func(ws *Websocket) + OnConnectError func(ws *Websocket, err error) + OnDisconnect func(ws *Websocket) + OnDisconnectError func(ws *Websocket, err error) + OnReadError func(ws *Websocket, err error) + OnWriteError func(ws *Websocket, err error) + Reconnect bool + ReconnectIntervalFactor float64 + ReconnectIntervalMax time.Duration + ReconnectIntervalMin time.Duration + Verbose bool + func (ws *Websocket) Close() + func (ws *Websocket) Connect() + func (ws *Websocket) Dial(urlStr string) error + func (ws *Websocket) GetDialError() error + func (ws *Websocket) GetHTTPResponse() *http.Response + func (ws *Websocket) IsConnected() bool + func (ws *Websocket) ReadMessage() (messageType int, message []byte, err error) + func (ws *Websocket) WriteJSON(v interface{}) error + func (ws *Websocket) WriteMessage(messageType int, data []byte) error + type WsOpts func(dl *websocket.Dialer)