Versions in this module Expand all Collapse all v1 v1.0.0 May 10, 2023 Changes in this version + const EarliestBlockNumber + const EngineApi + const FinalizedBlockNumber + const LatestBlockNumber + const MetadataApi + const PendingBlockNumber + const SafeBlockNumber + var DefaultHTTPTimeouts = HTTPTimeouts + var ErrBadResult = errors.New("bad result in JSON-RPC response") + 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") + var MaxBatchResponseSize int = 10_000_000 + func ContextRequestTimeout(ctx context.Context) (time.Duration, bool) + func NewContextWithHeaders(ctx context.Context, h http.Header) context.Context + type API struct + Authenticated bool + Namespace string + Public bool + Service interface{} + Version string + type BatchElem struct + Args []interface{} + Error error + Method string + Result interface{} + type BlockNumber int64 + func (bn *BlockNumber) UnmarshalJSON(data []byte) error + func (bn BlockNumber) Int64() int64 + func (bn BlockNumber) MarshalText() ([]byte, error) + type BlockNumberOrHash struct + BlockHash *common.Hash + BlockNumber *BlockNumber + RequireCanonical bool + func BlockNumberOrHashWithHash(hash common.Hash, canonical bool) BlockNumberOrHash + func BlockNumberOrHashWithNumber(blockNr BlockNumber) BlockNumberOrHash + func (bnh *BlockNumberOrHash) Hash() (common.Hash, bool) + func (bnh *BlockNumberOrHash) Number() (BlockNumber, bool) + func (bnh *BlockNumberOrHash) String() string + func (bnh *BlockNumberOrHash) UnmarshalJSON(data []byte) error + type Client struct + func ClientFromContext(ctx context.Context) (*Client, bool) + func Dial(rawurl string) (*Client, error) + func DialContext(ctx context.Context, rawurl string) (*Client, error) + func DialContextWithRequestHook(ctx context.Context, url string, hook RequestHook) (*Client, error) + func DialHTTP(endpoint string) (*Client, error) + func DialHTTPWithClient(endpoint string, client *http.Client) (*Client, error) + func DialIO(ctx context.Context, in io.Reader, out io.Writer) (*Client, error) + func DialIPC(ctx context.Context, endpoint string) (*Client, error) + func DialInProc(handler *Server) *Client + func DialOptions(ctx context.Context, rawurl string, options ...ClientOption) (*Client, error) + func DialStdIO(ctx context.Context) (*Client, error) + func DialTransport(ctx context.Context, rawUrl string, transport *http.Transport) (*Client, error) + func DialWebsocket(ctx context.Context, endpoint, origin string) (*Client, error) + func DialWebsocketWithDialer(ctx context.Context, endpoint, origin string, dialer websocket.Dialer) (*Client, error) + func (c *Client) BatchCall(b []BatchElem) error + func (c *Client) BatchCallContext(ctx context.Context, b []BatchElem) error + func (c *Client) Call(result interface{}, method string, args ...interface{}) error + func (c *Client) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error + func (c *Client) Close() + func (c *Client) EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (*ClientSubscription, error) + func (c *Client) Notify(ctx context.Context, method string, args ...interface{}) error + func (c *Client) RegisterName(name string, receiver interface{}) error + func (c *Client) SetHeader(key, value string) + func (c *Client) ShhSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (*ClientSubscription, error) + func (c *Client) Subscribe(ctx context.Context, namespace string, channel interface{}, ...) (*ClientSubscription, error) + func (c *Client) SupportedModules() (map[string]string, error) + type ClientOption interface + func WithHTTPAuth(a HTTPAuth) ClientOption + func WithHTTPClient(c *http.Client) ClientOption + func WithHeader(key, value string) ClientOption + func WithHeaders(headers http.Header) ClientOption + func WithWebsocketDialer(dialer websocket.Dialer) ClientOption + type ClientSubscription struct + func (sub *ClientSubscription) Err() <-chan error + func (sub *ClientSubscription) Unsubscribe() + type CodecOption int + const OptionMethodInvocation + const OptionSubscriptions + type Conn interface + SetWriteDeadline func(time.Time) error + type ConnRemoteAddr interface + RemoteAddr func() string + type DataError interface + Error func() string + ErrorData func() interface{} + type Error interface + Error func() string + ErrorCode func() int + type HTTPAuth func(h http.Header) error + type HTTPError struct + Body []byte + Status string + StatusCode int + func (err HTTPError) Error() string + type HTTPTimeouts struct + IdleTimeout time.Duration + ReadHeaderTimeout 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 PeerInfo struct + HTTP struct{ ... } + RemoteAddr string + Transport string + func PeerInfoFromContext(ctx context.Context) PeerInfo + type RPCService struct + func (s *RPCService) Modules() map[string]string + type RequestHook interface + OnRequest func(request interface{}) ResultHook + type ResultHook interface + OnResult func(response interface{}, err error) + type Server struct + func NewServer() *Server + func StartIPCEndpoint(ipcEndpoint string, apis []API) (net.Listener, *Server, error) + func (s *Server) RegisterName(name string, receiver interface{}) error + func (s *Server) ServeCodec(codec ServerCodec, options CodecOption) + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Server) ServeListener(l net.Listener) error + func (s *Server) Stop() + func (s *Server) WebsocketHandler(allowedOrigins []string) http.Handler + type ServerCodec interface + func NewCodec(conn Conn) ServerCodec + func NewFuncCodec(conn deadlineCloser, encode encodeFunc, decode decodeFunc) ServerCodec + type Subscription struct + ID ID + func (s *Subscription) Err() <-chan error + func (s *Subscription) MarshalJSON() ([]byte, error)