JsonRpcErrorBody

data class JsonRpcErrorBody(val code: Int, val message: String, val data: JsonElement? = null)

The error member of a JSON-RPC response.

Constructors

Link copied to clipboard
constructor(code: Int, message: String, data: JsonElement? = null)

Types

Link copied to clipboard
object Companion

Conversions between the wire body and DappException.

Properties

Link copied to clipboard
val code: Int
Link copied to clipboard
val data: JsonElement?
Link copied to clipboard

Functions

Link copied to clipboard
fun encode(): JsonObject

The body as a JSON object; data is omitted when null.

Link copied to clipboard

Maps onto DappException. An unrecognised code becomes DappErrorCode.INTERNAL rather than throwing: a wallet is free to use codes this SDK predates, and losing the message would be worse than losing the exact code.