Versions in this module Expand all Collapse all v0 v0.0.1 Nov 17, 2020 Changes in this version + var DefaultChannelTimeouts = ChannelTimeouts + var DefaultHTTPTimeouts = HTTPTimeouts + var ErrClientQuit = errors.New("client is closed") + var ErrNoResult = errors.New("no result in JSON-RPC response") + var ErrNotificationsUnsupported = errors.New("notifications not supported") + var ErrSubscriptionNotFound = errors.New("subscription not found") + var ErrSubscriptionQueueOverflow = errors.New("subscription queue overflow") + type API struct + Namespace string + Public bool + Service interface{} + Version string + type BatchElem struct + Args []interface{} + Error error + Method string + Result interface{} + type ChannelTimeouts struct + IdleTimeout time.Duration + ReadTimeout time.Duration + WriteTimeout time.Duration + type ClientSubscription struct + func (sub *ClientSubscription) Err() <-chan error + func (sub *ClientSubscription) Unsubscribe() + type Conn interface + SetWriteDeadline func(time.Time) error + type ConnRemoteAddr interface + RemoteAddr func() string + type Connection struct + func ClientFromContext(ctx context.Context) (*Connection, bool) + func DialChannelWithClient(endpoint string, config *tls.Config, groupID int) (*Connection, error) + func DialContextChannel(rawurl, caFile, certFile, keyFile string, groupID int) (*Connection, error) + func DialContextHTTP(rawurl string) (*Connection, error) + func DialHTTP(endpoint string) (*Connection, error) + func DialHTTPWithClient(endpoint string, client *http.Client) (*Connection, error) + func (c *Connection) AsyncSendTransaction(ctx context.Context, handler func(*types.Receipt, error), method string, ...) error + func (c *Connection) BatchCall(b []BatchElem) error + func (c *Connection) BatchCallContext(ctx context.Context, b []BatchElem) error + func (c *Connection) BroadcastAMOPMsg(topic string, data []byte) error + func (c *Connection) BroadcastAMOPPrivateMsg(topic string, data []byte) error + func (c *Connection) Call(result interface{}, method string, args ...interface{}) error + func (c *Connection) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error + func (c *Connection) Close() + func (c *Connection) EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (*ClientSubscription, error) + func (c *Connection) GetBlockNumber() int64 + func (c *Connection) IsHTTP() bool + func (c *Connection) Notify(ctx context.Context, method string, args ...interface{}) error + func (c *Connection) PublishPrivateTopic(topic string, publicKey []*ecdsa.PublicKey) error + func (c *Connection) RegisterName(name string, receiver interface{}) error + func (c *Connection) SendAMOPMsg(topic string, data []byte) ([]byte, error) + func (c *Connection) SendAMOPPrivateMsg(topic string, data []byte) ([]byte, error) + func (c *Connection) ShhSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (*ClientSubscription, error) + func (c *Connection) Subscribe(ctx context.Context, namespace string, channel interface{}, ...) (*ClientSubscription, error) + func (c *Connection) SubscribeBlockNumberNotify(groupID uint64, handler func(int64)) error + func (c *Connection) SubscribePrivateTopic(topic string, privateKey *ecdsa.PrivateKey, handler func([]byte, *[]byte)) error + func (c *Connection) SubscribeTopic(topic string, handler func([]byte, *[]byte)) error + func (c *Connection) SupportedModules() (map[string]string, error) + func (c *Connection) UnsubscribeBlockNumberNotify(groupID uint64) error + func (c *Connection) UnsubscribePrivateTopic(topic string) error + func (c *Connection) UnsubscribeTopic(topic string) error + type Error interface + Error func() string + ErrorCode func() int + type HTTPTimeouts struct + IdleTimeout time.Duration + ReadTimeout time.Duration + WriteTimeout time.Duration + type ID string + func NewID() ID + type Notifier struct + func NotifierFromContext(ctx context.Context) (*Notifier, bool) + func (n *Notifier) Closed() <-chan interface{} + func (n *Notifier) CreateSubscription() *Subscription + func (n *Notifier) Notify(id ID, data interface{}) error + type ServerCodec interface + Close func() + Read func() (msgs []*jsonrpcMessage, isBatch bool, err error) + func NewCodec(conn Conn, encode, decode func(v interface{}) error) ServerCodec + func NewJSONCodec(conn Conn) ServerCodec + type Subscription struct + ID ID + func (s *Subscription) Err() <-chan error + func (s *Subscription) MarshalJSON() ([]byte, error)