Versions in this module Expand all Collapse all v0 v0.2.11 Mar 24, 2026 Changes in this version + var ErrNoAvailableServer = errors.New("no available server") + func ReadAs[T any](v json.RawMessage, e error) (T, error) + func ReadBigInt(v json.RawMessage, e error) (*big.Int, error) + func ReadString(v json.RawMessage, e error) (string, error) + func ReadTo(target any) func(v json.RawMessage, e error) error + func ReadUint64(v json.RawMessage, e error) (uint64, error) + type Api struct + func (a *Api) BlockNumber(ctx context.Context) (uint64, error) + func (a *Api) ChainId(ctx context.Context) (uint64, error) + func (a *Api) Do(method string, args ...any) (json.RawMessage, error) + func (a *Api) To(target any, method string, args ...any) error + func (a *Api) ToCtx(ctx context.Context, target any, method string, args ...any) error + type ErrorObject struct + Code int + Data any + Message string + func (e *ErrorObject) Error() string + type ForwardOptions struct + Cache time.Duration + Pretty bool + type Handler interface + DoCtx func(ctx context.Context, method string, args ...any) (json.RawMessage, error) + func Evaluate(ctx context.Context, servers ...string) (Handler, error) + type RPC struct + HTTPClient *http.Client + func New(h string) *RPC + func (r *RPC) Do(method string, args ...any) (json.RawMessage, error) + func (r *RPC) DoCtx(ctx context.Context, method string, args ...any) (json.RawMessage, error) + func (r *RPC) DoNamed(method string, args map[string]any) (json.RawMessage, error) + func (r *RPC) DoNamedCtx(ctx context.Context, method string, args map[string]any) (json.RawMessage, error) + func (r *RPC) Forward(ctx context.Context, rw http.ResponseWriter, req *Request, ...) + func (r *RPC) GetHost() string + func (r *RPC) Override(method string, fnc any) + func (r *RPC) Send(req *Request) (json.RawMessage, error) + func (r *RPC) SendCtx(ctx context.Context, req *Request) (json.RawMessage, error) + func (r *RPC) SetBasicAuth(username, password string) + func (r *RPC) SetHost(host string) + func (r *RPC) To(target any, method string, args ...any) error + type RPCList []*RPC + func (r RPCList) DoCtx(ctx context.Context, method string, args ...any) (json.RawMessage, error) + type Request struct + Id any + JsonRpc string + Method string + Params any + func NewRequest(method string, params ...any) *Request + func NewRequestMap(method string, params map[string]any) *Request + func (req *Request) HTTPRequest(ctx context.Context, host string) (*http.Request, error) + type Response struct + Error *ErrorObject + Id any + JsonRpc string + Result json.RawMessage + type ResponseIntf struct + Error *ErrorObject + Id any + JsonRpc string + Result any