Constructors

  • Creates an instance of ClientJsonRpc.

    Parameters

    • url_: string

      The URL of the JSON-RPC server.

    • Optionalconfig: RequestorJsonRpcConfig
    • OptionalonError: ((err: unknown) => void | Promise<void>)
        • (err): void | Promise<void>
        • Parameters

          • err: unknown

          Returns void | Promise<void>

    Returns RequestorJsonRpc

Properties

maxConcurrent?: number
transport: Transport

Accessors

  • get url(): string
  • Returns the URL of the JSON-RPC server.

    Returns string

    The URL of the JSON-RPC server.

Methods

  • request a JSON-RPC method.

    Parameters

    • rpcMethod: string

      The JSON-RPC method.

    • params: unknown[]

      Params for the method.

    • OptionalinTransformers: (undefined | ((_: any) => unknown))[]

      An array of input transformers.

    • OptionaloutTransformer: ((_: any) => unknown)

      An output transformer function.

        • (_): unknown
        • Parameters

          • _: any

          Returns unknown

    Returns Promise<unknown>

    Method response.

  • Builds a JSON-RPC payload for the given method and parameters.

    Parameters

    • method: string

      The JSON-RPC method name.

    • req: unknown[]

      The parameters for the JSON-RPC method.

    Returns JsonRpcPayload

    The JSON-RPC payload.