JSONRPCResponseBuilder

constructor()(source)

Type Parameters

T

The type of the result value.

E

The type of the error data.

Example:

val success = jsonRPCResponse<Int> {
id = RequestId(1)
result = 42
}

val failure = jsonRPCResponse<Nothing, Nothing> {
id = RequestId(1)
error = JSONRPCError.methodNotFound()
}