JSONRPCResponse Serializer
class JSONRPCResponseSerializer<T, E>(resultSerializer: KSerializer<T>, errorDataSerializer: KSerializer<E>) : KSerializer<JSONRPCResponse<T, E>> (source)
Content-based polymorphic serializer for JSONRPCResponse.
Discriminates between JSONRPCResponse.Success and JSONRPCResponse.Error based on the presence of the "error" or "result" field in the JSON object.
Parameters
result Serializer
Serializer for the result field.
error Data Serializer
Serializer for the error's data field.
Type Parameters
T
The type of the result value in JSONRPCResponse.Success.
E
The type of the error data in JSONRPCResponse.Error.