Module

x/json_rpc_ts/mod.ts

A strictly typed json-rpc(2.0) implementation, zero dependency, minimal abstraction, with simple api
Latest
import * as mod from "https://dotland.deno.dev/x/json_rpc_ts@v0.2.0/mod.ts";

Classes

Provide a external requestForResponse function to the constructor, it should accept a string (json encoded from one or more json rpc request) and your customized function should send this string to a json rpc server for any response represented as string

The client cannot parse the server response

You should create this object via method from JSONRPCClient, it generate id for you.

You should create this object via method from JSONRPCClient, it generate id for you.

Provide a method set object to the constructor, it should contains a record with it's key is a string and value is a function that handle the rpc calls.

Functions

This ONLY check if x is JSONRPCErrorInterface

WARN: this check if x is JSONRPCNotification or JSONRPCRequest

Interfaces

Any function in method set will accept single params variable, should otherwise return/resolve JSONRPCValue, or must throw/reject JSONRPCError

Type Aliases

This can be but not mean to javascript Generator Just means a source of ID

Represent any json rpc method, any detailed method should extend it

This can be used for constrain of type that can be converted to json