Skip to main content

jsonRpc

Index

Functions

isBatchRequest

isBatchResponse

isResponseRpcError

isResponseWithError

isResponseWithNotification

isResponseWithResult

isSubscriptionResult

isValidResponse

  • isValidResponse<Result, Error>(response: JsonRpcResponse<Result, Error>): boolean
  • Type parameters

    • Result = unknown
    • Error = unknown

    Parameters

    Returns boolean

setRequestIdStart

  • setRequestIdStart(start: undefined | number): void
  • Optionally use to make the jsonrpc id start from a specific number. Without calling this function, the id will be filled with a Uuid. But after this being called with a number, the id will be a number starting from the provided start variable. However, if undefined was passed to this function, the id will be a Uuid again.


    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

toPayload

validateResponse

  • validateResponse<Result, Error>(response: JsonRpcResponse<Result, Error>): boolean
  • Type parameters

    • Result = unknown
    • Error = unknown

    Parameters

    Returns boolean