import { any, literal, nullable, number, string, type, union } from "superstruct";
// JSON-RPC 2.0 Error object
// See JSON-RPC 2.0 Specification section 5 Reponse object
// https://www.jsonrpc.org/specification
export var JsonRpcError = type({
    jsonrpc: literal("2.0"),
    id: union([number(), string()]),
    error: type({
        code: number(),
        message: string(),
        data: nullable(any()),
    }),
});
// Generic/unknown RPC error (may embed a JsonRpcError).
export var RpcError = type({
    reason: string(),
    body: string(),
});
//# sourceMappingURL=types.js.map