All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.funkatronics.rpccore.RpcResponse.kt Maven / Gradle / Ivy

There is a newer version: 0.2.8
Show newest version
package com.funkatronics.rpccore

import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonElement

interface RpcResponse {
    val result: R?
    val error: RpcError?
    val id: String?
    val jsonrpc: String
}

typealias DefaultRpcResponse = RpcResponse

@Serializable
data class RpcError(val code: Int, val message: String)

@Serializable
open class Rpc20Response(
    override val result: R? = null,
    override val error: RpcError? = null,
    override val id: String? = null
) : RpcResponse {
    override val jsonrpc = "2.0"
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy