Comparing version 1.0.17 to 2.0.0
/// <reference lib="dom" /> | ||
import { Client, ClientOptions } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, JsonRpcDisabledError, MalformedJsonRpcError, QueueFullError, LogCallback } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, JsonRpcDisabledError, QueueFullError, LogCallback } from './public-types.js'; | ||
/** | ||
@@ -5,0 +5,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.start = exports.QueueFullError = exports.MalformedJsonRpcError = exports.JsonRpcDisabledError = exports.CrashError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
exports.start = exports.QueueFullError = exports.JsonRpcDisabledError = exports.CrashError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
const no_auto_bytecode_browser_js_1 = require("./no-auto-bytecode-browser.js"); | ||
@@ -15,3 +15,2 @@ const bytecode_browser_js_1 = require("./bytecode-browser.js"); | ||
Object.defineProperty(exports, "JsonRpcDisabledError", { enumerable: true, get: function () { return public_types_js_1.JsonRpcDisabledError; } }); | ||
Object.defineProperty(exports, "MalformedJsonRpcError", { enumerable: true, get: function () { return public_types_js_1.MalformedJsonRpcError; } }); | ||
Object.defineProperty(exports, "QueueFullError", { enumerable: true, get: function () { return public_types_js_1.QueueFullError; } }); | ||
@@ -18,0 +17,0 @@ /** |
import { Client, ClientOptions } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, MalformedJsonRpcError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.start = exports.JsonRpcDisabledError = exports.QueueFullError = exports.MalformedJsonRpcError = exports.CrashError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
exports.start = exports.JsonRpcDisabledError = exports.QueueFullError = exports.CrashError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
const no_auto_bytecode_deno_js_1 = require("./no-auto-bytecode-deno.js"); | ||
@@ -14,3 +14,2 @@ const bytecode_deno_js_1 = require("./bytecode-deno.js"); | ||
Object.defineProperty(exports, "CrashError", { enumerable: true, get: function () { return public_types_js_1.CrashError; } }); | ||
Object.defineProperty(exports, "MalformedJsonRpcError", { enumerable: true, get: function () { return public_types_js_1.MalformedJsonRpcError; } }); | ||
Object.defineProperty(exports, "QueueFullError", { enumerable: true, get: function () { return public_types_js_1.QueueFullError; } }); | ||
@@ -17,0 +16,0 @@ Object.defineProperty(exports, "JsonRpcDisabledError", { enumerable: true, get: function () { return public_types_js_1.JsonRpcDisabledError; } }); |
import { Client, ClientOptions } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, MalformedJsonRpcError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.start = exports.JsonRpcDisabledError = exports.QueueFullError = exports.MalformedJsonRpcError = exports.CrashError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
exports.start = exports.JsonRpcDisabledError = exports.QueueFullError = exports.CrashError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
const no_auto_bytecode_nodejs_js_1 = require("./no-auto-bytecode-nodejs.js"); | ||
@@ -14,3 +14,2 @@ const bytecode_nodejs_js_1 = require("./bytecode-nodejs.js"); | ||
Object.defineProperty(exports, "CrashError", { enumerable: true, get: function () { return public_types_js_1.CrashError; } }); | ||
Object.defineProperty(exports, "MalformedJsonRpcError", { enumerable: true, get: function () { return public_types_js_1.MalformedJsonRpcError; } }); | ||
Object.defineProperty(exports, "QueueFullError", { enumerable: true, get: function () { return public_types_js_1.QueueFullError; } }); | ||
@@ -17,0 +16,0 @@ Object.defineProperty(exports, "JsonRpcDisabledError", { enumerable: true, get: function () { return public_types_js_1.JsonRpcDisabledError; } }); |
@@ -312,11 +312,6 @@ "use strict"; | ||
throw new public_types_js_1.JsonRpcDisabledError(); | ||
if (request.length >= 64 * 1024 * 1024) { | ||
throw new public_types_js_1.MalformedJsonRpcError(); | ||
} | ||
; | ||
const retVal = state.instance.instance.request(request, chainId); | ||
switch (retVal) { | ||
case 0: break; | ||
case 1: throw new public_types_js_1.MalformedJsonRpcError(); | ||
case 2: throw new public_types_js_1.QueueFullError(); | ||
case 1: throw new public_types_js_1.QueueFullError(); | ||
default: throw new Error("Internal error: unknown json_rpc_send error code: " + retVal); | ||
@@ -323,0 +318,0 @@ } |
@@ -472,3 +472,3 @@ "use strict"; | ||
if (!state.instance) | ||
return 2; // TODO: return a different error code? should be documented | ||
return 1; // TODO: return a different error code? should be documented | ||
state.bufferIndices[0] = new TextEncoder().encode(request); | ||
@@ -475,0 +475,0 @@ return state.instance.exports.json_rpc_send(0, chainId) >>> 0; |
/// <reference lib="dom" /> | ||
import { Client, ClientOptionsWithBytecode } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, JsonRpcDisabledError, MalformedJsonRpcError, QueueFullError, LogCallback } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, JsonRpcDisabledError, QueueFullError, LogCallback } from './public-types.js'; | ||
/** | ||
@@ -5,0 +5,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -15,3 +15,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.startWithBytecode = exports.QueueFullError = exports.MalformedJsonRpcError = exports.JsonRpcDisabledError = exports.CrashError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
exports.startWithBytecode = exports.QueueFullError = exports.JsonRpcDisabledError = exports.CrashError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
const client_js_1 = require("./internals/client.js"); | ||
@@ -23,3 +23,2 @@ var public_types_js_1 = require("./public-types.js"); | ||
Object.defineProperty(exports, "JsonRpcDisabledError", { enumerable: true, get: function () { return public_types_js_1.JsonRpcDisabledError; } }); | ||
Object.defineProperty(exports, "MalformedJsonRpcError", { enumerable: true, get: function () { return public_types_js_1.MalformedJsonRpcError; } }); | ||
Object.defineProperty(exports, "QueueFullError", { enumerable: true, get: function () { return public_types_js_1.QueueFullError; } }); | ||
@@ -26,0 +25,0 @@ /** |
import { Client, ClientOptionsWithBytecode } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, MalformedJsonRpcError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -15,3 +15,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.startWithBytecode = exports.JsonRpcDisabledError = exports.QueueFullError = exports.MalformedJsonRpcError = exports.CrashError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
exports.startWithBytecode = exports.JsonRpcDisabledError = exports.QueueFullError = exports.CrashError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
const client_js_1 = require("./internals/client.js"); | ||
@@ -22,3 +22,2 @@ var public_types_js_1 = require("./public-types.js"); | ||
Object.defineProperty(exports, "CrashError", { enumerable: true, get: function () { return public_types_js_1.CrashError; } }); | ||
Object.defineProperty(exports, "MalformedJsonRpcError", { enumerable: true, get: function () { return public_types_js_1.MalformedJsonRpcError; } }); | ||
Object.defineProperty(exports, "QueueFullError", { enumerable: true, get: function () { return public_types_js_1.QueueFullError; } }); | ||
@@ -25,0 +24,0 @@ Object.defineProperty(exports, "JsonRpcDisabledError", { enumerable: true, get: function () { return public_types_js_1.JsonRpcDisabledError; } }); |
import { Client, ClientOptionsWithBytecode } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, MalformedJsonRpcError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.startWithBytecode = exports.JsonRpcDisabledError = exports.QueueFullError = exports.MalformedJsonRpcError = exports.CrashError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
exports.startWithBytecode = exports.JsonRpcDisabledError = exports.QueueFullError = exports.CrashError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
const client_js_1 = require("./internals/client.js"); | ||
@@ -17,3 +17,2 @@ const ws_1 = require("ws"); | ||
Object.defineProperty(exports, "CrashError", { enumerable: true, get: function () { return public_types_js_1.CrashError; } }); | ||
Object.defineProperty(exports, "MalformedJsonRpcError", { enumerable: true, get: function () { return public_types_js_1.MalformedJsonRpcError; } }); | ||
Object.defineProperty(exports, "QueueFullError", { enumerable: true, get: function () { return public_types_js_1.QueueFullError; } }); | ||
@@ -20,0 +19,0 @@ Object.defineProperty(exports, "JsonRpcDisabledError", { enumerable: true, get: function () { return public_types_js_1.JsonRpcDisabledError; } }); |
@@ -29,8 +29,2 @@ /** | ||
/** | ||
* Thrown in case a malformed JSON-RPC request is sent. | ||
*/ | ||
export declare class MalformedJsonRpcError extends Error { | ||
constructor(); | ||
} | ||
/** | ||
* Thrown in case the buffer of JSON-RPC requests is full and cannot accept any more request. | ||
@@ -107,11 +101,8 @@ */ | ||
* | ||
* A {@link MalformedJsonRpcError} is thrown if the request isn't a valid JSON-RPC request | ||
* (for example if it is not valid JSON) or if the request is unreasonably large (64 MiB at the | ||
* time of writing of this comment). | ||
* If the request is not a valid JSON-RPC request, then a JSON-RPC error response is later | ||
* generated with an `id` equal to `null`, in accordance with the JSON-RPC 2.0 specification. | ||
* | ||
* If, however, the request is a valid JSON-RPC request but that concerns an unknown method, or | ||
* if for example some parameters are missing, an error response is properly generated and | ||
* yielded through the JSON-RPC callback. | ||
* In other words, a {@link MalformedJsonRpcError} is thrown in situations where something | ||
* is *so wrong* with the request that it is not possible for smoldot to send back an error | ||
* through the JSON-RPC callback. | ||
* | ||
@@ -125,3 +116,2 @@ * Two JSON-RPC APIs are supported by smoldot: | ||
* | ||
* @throws {@link MalformedJsonRpcError} If the payload isn't valid JSON-RPC. | ||
* @throws {@link QueueFullError} If the queue of JSON-RPC requests of the chain is full. | ||
@@ -128,0 +118,0 @@ * @throws {@link AlreadyDestroyedError} If the chain has been removed or the client has been terminated. |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.QueueFullError = exports.MalformedJsonRpcError = exports.CrashError = exports.JsonRpcDisabledError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
exports.QueueFullError = exports.CrashError = exports.JsonRpcDisabledError = exports.AlreadyDestroyedError = exports.AddChainError = void 0; | ||
// This program is free software: you can redistribute it and/or modify | ||
@@ -61,11 +61,2 @@ // it under the terms of the GNU General Public License as published by | ||
/** | ||
* Thrown in case a malformed JSON-RPC request is sent. | ||
*/ | ||
class MalformedJsonRpcError extends Error { | ||
constructor() { | ||
super("JSON-RPC request is malformed"); | ||
} | ||
} | ||
exports.MalformedJsonRpcError = MalformedJsonRpcError; | ||
/** | ||
* Thrown in case the buffer of JSON-RPC requests is full and cannot accept any more request. | ||
@@ -72,0 +63,0 @@ */ |
/// <reference lib="dom" /> | ||
import { Client, ClientOptions } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, JsonRpcDisabledError, MalformedJsonRpcError, QueueFullError, LogCallback } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, JsonRpcDisabledError, QueueFullError, LogCallback } from './public-types.js'; | ||
/** | ||
@@ -5,0 +5,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -6,3 +6,3 @@ // Smoldot | ||
import { compileBytecode } from './bytecode-browser.js'; | ||
export { AddChainError, AlreadyDestroyedError, CrashError, JsonRpcDisabledError, MalformedJsonRpcError, QueueFullError } from './public-types.js'; | ||
export { AddChainError, AlreadyDestroyedError, CrashError, JsonRpcDisabledError, QueueFullError } from './public-types.js'; | ||
/** | ||
@@ -9,0 +9,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
import { Client, ClientOptions } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, MalformedJsonRpcError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -6,3 +6,3 @@ // Smoldot | ||
import { compileBytecode } from './bytecode-deno.js'; | ||
export { AddChainError, AlreadyDestroyedError, CrashError, MalformedJsonRpcError, QueueFullError, JsonRpcDisabledError } from './public-types.js'; | ||
export { AddChainError, AlreadyDestroyedError, CrashError, QueueFullError, JsonRpcDisabledError } from './public-types.js'; | ||
/** | ||
@@ -9,0 +9,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
import { Client, ClientOptions } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, MalformedJsonRpcError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -6,3 +6,3 @@ // Smoldot | ||
import { compileBytecode } from './bytecode-nodejs.js'; | ||
export { AddChainError, AlreadyDestroyedError, CrashError, MalformedJsonRpcError, QueueFullError, JsonRpcDisabledError } from './public-types.js'; | ||
export { AddChainError, AlreadyDestroyedError, CrashError, QueueFullError, JsonRpcDisabledError } from './public-types.js'; | ||
/** | ||
@@ -9,0 +9,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -23,3 +23,3 @@ // Smoldot | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
import { QueueFullError, AlreadyDestroyedError, AddChainError, JsonRpcDisabledError, MalformedJsonRpcError, CrashError } from '../public-types.js'; | ||
import { QueueFullError, AlreadyDestroyedError, AddChainError, JsonRpcDisabledError, CrashError } from '../public-types.js'; | ||
import * as instance from './local-instance.js'; | ||
@@ -310,11 +310,6 @@ import * as remote from './remote-instance.js'; | ||
throw new JsonRpcDisabledError(); | ||
if (request.length >= 64 * 1024 * 1024) { | ||
throw new MalformedJsonRpcError(); | ||
} | ||
; | ||
const retVal = state.instance.instance.request(request, chainId); | ||
switch (retVal) { | ||
case 0: break; | ||
case 1: throw new MalformedJsonRpcError(); | ||
case 2: throw new QueueFullError(); | ||
case 1: throw new QueueFullError(); | ||
default: throw new Error("Internal error: unknown json_rpc_send error code: " + retVal); | ||
@@ -321,0 +316,0 @@ } |
@@ -469,3 +469,3 @@ // Smoldot | ||
if (!state.instance) | ||
return 2; // TODO: return a different error code? should be documented | ||
return 1; // TODO: return a different error code? should be documented | ||
state.bufferIndices[0] = new TextEncoder().encode(request); | ||
@@ -472,0 +472,0 @@ return state.instance.exports.json_rpc_send(0, chainId) >>> 0; |
/// <reference lib="dom" /> | ||
import { Client, ClientOptionsWithBytecode } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, JsonRpcDisabledError, MalformedJsonRpcError, QueueFullError, LogCallback } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, JsonRpcDisabledError, QueueFullError, LogCallback } from './public-types.js'; | ||
/** | ||
@@ -5,0 +5,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -14,3 +14,3 @@ // Smoldot | ||
import { start as innerStart } from './internals/client.js'; | ||
export { AddChainError, AlreadyDestroyedError, CrashError, JsonRpcDisabledError, MalformedJsonRpcError, QueueFullError } from './public-types.js'; | ||
export { AddChainError, AlreadyDestroyedError, CrashError, JsonRpcDisabledError, QueueFullError } from './public-types.js'; | ||
/** | ||
@@ -17,0 +17,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
import { Client, ClientOptionsWithBytecode } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, MalformedJsonRpcError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -14,3 +14,3 @@ // Smoldot | ||
import { start as innerStart } from './internals/client.js'; | ||
export { AddChainError, AlreadyDestroyedError, CrashError, MalformedJsonRpcError, QueueFullError, JsonRpcDisabledError } from './public-types.js'; | ||
export { AddChainError, AlreadyDestroyedError, CrashError, QueueFullError, JsonRpcDisabledError } from './public-types.js'; | ||
/** | ||
@@ -17,0 +17,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
import { Client, ClientOptionsWithBytecode } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, MalformedJsonRpcError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
export { AddChainError, AddChainOptions, AlreadyDestroyedError, Chain, Client, ClientOptions, ClientOptionsWithBytecode, SmoldotBytecode, CrashError, QueueFullError, JsonRpcDisabledError, LogCallback } from './public-types.js'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -9,3 +9,3 @@ // Smoldot | ||
import { randomFillSync } from 'node:crypto'; | ||
export { AddChainError, AlreadyDestroyedError, CrashError, MalformedJsonRpcError, QueueFullError, JsonRpcDisabledError } from './public-types.js'; | ||
export { AddChainError, AlreadyDestroyedError, CrashError, QueueFullError, JsonRpcDisabledError } from './public-types.js'; | ||
/** | ||
@@ -12,0 +12,0 @@ * Initializes a new client. This is a pre-requisite to connecting to a blockchain. |
@@ -29,8 +29,2 @@ /** | ||
/** | ||
* Thrown in case a malformed JSON-RPC request is sent. | ||
*/ | ||
export declare class MalformedJsonRpcError extends Error { | ||
constructor(); | ||
} | ||
/** | ||
* Thrown in case the buffer of JSON-RPC requests is full and cannot accept any more request. | ||
@@ -107,11 +101,8 @@ */ | ||
* | ||
* A {@link MalformedJsonRpcError} is thrown if the request isn't a valid JSON-RPC request | ||
* (for example if it is not valid JSON) or if the request is unreasonably large (64 MiB at the | ||
* time of writing of this comment). | ||
* If the request is not a valid JSON-RPC request, then a JSON-RPC error response is later | ||
* generated with an `id` equal to `null`, in accordance with the JSON-RPC 2.0 specification. | ||
* | ||
* If, however, the request is a valid JSON-RPC request but that concerns an unknown method, or | ||
* if for example some parameters are missing, an error response is properly generated and | ||
* yielded through the JSON-RPC callback. | ||
* In other words, a {@link MalformedJsonRpcError} is thrown in situations where something | ||
* is *so wrong* with the request that it is not possible for smoldot to send back an error | ||
* through the JSON-RPC callback. | ||
* | ||
@@ -125,3 +116,2 @@ * Two JSON-RPC APIs are supported by smoldot: | ||
* | ||
* @throws {@link MalformedJsonRpcError} If the payload isn't valid JSON-RPC. | ||
* @throws {@link QueueFullError} If the queue of JSON-RPC requests of the chain is full. | ||
@@ -128,0 +118,0 @@ * @throws {@link AlreadyDestroyedError} If the chain has been removed or the client has been terminated. |
@@ -53,10 +53,2 @@ // Smoldot | ||
/** | ||
* Thrown in case a malformed JSON-RPC request is sent. | ||
*/ | ||
export class MalformedJsonRpcError extends Error { | ||
constructor() { | ||
super("JSON-RPC request is malformed"); | ||
} | ||
} | ||
/** | ||
* Thrown in case the buffer of JSON-RPC requests is full and cannot accept any more request. | ||
@@ -63,0 +55,0 @@ */ |
{ | ||
"name": "smoldot", | ||
"version": "1.0.17", | ||
"version": "2.0.0", | ||
"description": "Light client that connects to Polkadot and Substrate-based blockchains", | ||
@@ -83,5 +83,5 @@ "contributors": [ | ||
"dtslint": "^4.0.6", | ||
"typedoc": "^0.24.8", | ||
"typedoc": "^0.25.0", | ||
"typescript": "^5.1.3" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6254123
30314