Functions
createJsonRpcApi
createJsonRpcApi<
TRpcMethods
>(config?
):RpcApi
<TRpcMethods
>
Creates a JavaScript proxy that converts any function call called on it to a RpcPlan by
creating an execute
function that:
- sets the transport payload to a JSON RPC v2 payload object with the requested
methodName
andparams
properties, optionally transformed by RpcApiConfig.requestTransformer. - transforms the transport's response using the RpcApiConfig.responseTransformer function, if provided.
Type Parameters
Type Parameter |
---|
TRpcMethods extends RpcApiMethods |
Parameters
Parameter | Type |
---|---|
config? | Readonly <{ requestTransformer? : RpcRequestTransformer ; responseTransformer? : RpcResponseTransformer ; }> |
Returns
RpcApi
<TRpcMethods
>