jsonRpc
Index
Functions
isBatchRequest
Parameters
request: JsonRpcBatchRequest | JsonRpcOptionalRequest<unknown> | JsonRpcRequest<unknown>
Returns request is JsonRpcBatchRequest
isBatchResponse
Type parameters
- Result = unknown
- Error = unknown
Parameters
response: JsonRpcResponse<Result, Error>
Returns response is JsonRpcBatchResponse<Result, Error>
isResponseRpcError
Parameters
rpcError: JsonRpcResponseWithError<JsonRpcResult>
Returns boolean
isResponseWithError
Type parameters
- Error = unknown
- Result = unknown
Parameters
response: JsonRpcResponse<Result, Error>
Returns response is JsonRpcResponseWithError<Error>
isResponseWithNotification
Type parameters
- Result
Parameters
response: JsonRpcSubscriptionResult | JsonRpcNotification<Result>
Returns response is JsonRpcNotification<Result>
isResponseWithResult
Type parameters
- Result = unknown
- Error = unknown
Parameters
response: JsonRpcResponse<Result, Error>
Returns response is JsonRpcResponseWithResult<Result>
isSubscriptionResult
Type parameters
- Result
Parameters
response: JsonRpcSubscriptionResult | JsonRpcNotification<Result>
Returns response is JsonRpcSubscriptionResult
isValidResponse
Type parameters
- Result = unknown
- Error = unknown
Parameters
response: JsonRpcResponse<Result, Error>
Returns boolean
setRequestIdStart
Parameters
start: undefined | number
a number to start incrementing from. Or
undefined
to use a new Uuid (this is the default behavior)
Returns void
toBatchPayload
Parameters
requests: JsonRpcOptionalRequest<unknown>[]
Returns JsonRpcBatchRequest
toPayload
Type parameters
- ParamType = unknown[]
Parameters
request: JsonRpcOptionalRequest<ParamType>
Returns JsonRpcPayload<ParamType>
validateResponse
Type parameters
- Result = unknown
- Error = unknown
Parameters
response: JsonRpcResponse<Result, Error>
Returns boolean
Optionally use to make the jsonrpc
id
start from a specific number. Without calling this function, theid
will be filled with a Uuid. But after this being called with a number, theid
will be a number starting from the providedstart
variable. However, ifundefined
was passed to this function, theid
will be a Uuid again.