Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

web3-errors

Package Overview
Dependencies
Maintainers
4
Versions
326
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-errors - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1-dev.1cdc86c.0

8

lib/commonjs/errors/response_errors.js

@@ -45,2 +45,10 @@ "use strict";

this.request = request;
let errorOrErrors;
if (`error` in response) {
errorOrErrors = response.error;
}
else if (response instanceof Array) {
errorOrErrors = response.map(r => r.error);
}
this.innerError = errorOrErrors;
}

@@ -47,0 +55,0 @@ toJSON() {

36

lib/commonjs/errors/rpc_error_messages.js

@@ -20,3 +20,3 @@ "use strict";

exports.RpcErrorMessages = exports.genericRpcErrorMessageTemplate = void 0;
const error_codes_1 = require("../error_codes");
const error_codes_js_1 = require("../error_codes.js");
/**

@@ -32,47 +32,47 @@ * A template string for a generic Rpc Error. The `*code*` will be replaced with the code number.

// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md
[error_codes_1.ERR_RPC_INVALID_JSON]: {
[error_codes_js_1.ERR_RPC_INVALID_JSON]: {
message: 'Parse error',
description: 'Invalid JSON',
},
[error_codes_1.ERR_RPC_INVALID_REQUEST]: {
[error_codes_js_1.ERR_RPC_INVALID_REQUEST]: {
message: 'Invalid request',
description: 'JSON is not a valid request object ',
},
[error_codes_1.ERR_RPC_INVALID_METHOD]: {
[error_codes_js_1.ERR_RPC_INVALID_METHOD]: {
message: 'Method not found',
description: 'Method does not exist ',
},
[error_codes_1.ERR_RPC_INVALID_PARAMS]: {
[error_codes_js_1.ERR_RPC_INVALID_PARAMS]: {
message: 'Invalid params',
description: 'Invalid method parameters',
},
[error_codes_1.ERR_RPC_INTERNAL_ERROR]: {
[error_codes_js_1.ERR_RPC_INTERNAL_ERROR]: {
message: 'Internal error',
description: 'Internal JSON-RPC error',
},
[error_codes_1.ERR_RPC_INVALID_INPUT]: {
[error_codes_js_1.ERR_RPC_INVALID_INPUT]: {
message: 'Invalid input',
description: 'Missing or invalid parameters',
},
[error_codes_1.ERR_RPC_MISSING_RESOURCE]: {
[error_codes_js_1.ERR_RPC_MISSING_RESOURCE]: {
message: 'Resource not found',
description: 'Requested resource not found',
},
[error_codes_1.ERR_RPC_UNAVAILABLE_RESOURCE]: {
[error_codes_js_1.ERR_RPC_UNAVAILABLE_RESOURCE]: {
message: 'Resource unavailable',
description: 'Requested resource not available',
},
[error_codes_1.ERR_RPC_TRANSACTION_REJECTED]: {
[error_codes_js_1.ERR_RPC_TRANSACTION_REJECTED]: {
message: 'Transaction rejected',
description: 'Transaction creation failed',
},
[error_codes_1.ERR_RPC_UNSUPPORTED_METHOD]: {
[error_codes_js_1.ERR_RPC_UNSUPPORTED_METHOD]: {
message: 'Method not supported',
description: 'Method is not implemented',
},
[error_codes_1.ERR_RPC_LIMIT_EXCEEDED]: {
[error_codes_js_1.ERR_RPC_LIMIT_EXCEEDED]: {
message: 'Limit exceeded',
description: 'Request exceeds defined limit',
},
[error_codes_1.ERR_RPC_NOT_SUPPORTED]: {
[error_codes_js_1.ERR_RPC_NOT_SUPPORTED]: {
message: 'JSON-RPC version not supported',

@@ -83,19 +83,19 @@ description: 'Version of JSON-RPC protocol is not supported',

// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md#provider-errors
[error_codes_1.JSONRPC_ERR_REJECTED_REQUEST]: {
[error_codes_js_1.JSONRPC_ERR_REJECTED_REQUEST]: {
name: 'User Rejected Request',
message: 'The user rejected the request.',
},
[error_codes_1.JSONRPC_ERR_UNAUTHORIZED]: {
[error_codes_js_1.JSONRPC_ERR_UNAUTHORIZED]: {
name: 'Unauthorized',
message: 'The requested method and/or account has not been authorized by the user.',
},
[error_codes_1.JSONRPC_ERR_UNSUPPORTED_METHOD]: {
[error_codes_js_1.JSONRPC_ERR_UNSUPPORTED_METHOD]: {
name: 'Unsupported Method',
message: 'The Provider does not support the requested method.',
},
[error_codes_1.JSONRPC_ERR_DISCONNECTED]: {
[error_codes_js_1.JSONRPC_ERR_DISCONNECTED]: {
name: 'Disconnected',
message: 'The Provider is disconnected from all chains.',
},
[error_codes_1.JSONRPC_ERR_CHAIN_DISCONNECTED]: {
[error_codes_js_1.JSONRPC_ERR_CHAIN_DISCONNECTED]: {
name: 'Chain Disconnected',

@@ -102,0 +102,0 @@ message: 'The Provider is not connected to the requested chain.',

@@ -42,2 +42,10 @@ /*

this.request = request;
let errorOrErrors;
if (`error` in response) {
errorOrErrors = response.error;
}
else if (response instanceof Array) {
errorOrErrors = response.map(r => r.error);
}
this.innerError = errorOrErrors;
}

@@ -44,0 +52,0 @@ toJSON() {

@@ -17,3 +17,3 @@ /*

*/
import { ERR_RPC_INTERNAL_ERROR, ERR_RPC_INVALID_INPUT, ERR_RPC_INVALID_JSON, ERR_RPC_INVALID_METHOD, ERR_RPC_INVALID_PARAMS, ERR_RPC_INVALID_REQUEST, ERR_RPC_LIMIT_EXCEEDED, ERR_RPC_MISSING_RESOURCE, ERR_RPC_NOT_SUPPORTED, ERR_RPC_TRANSACTION_REJECTED, ERR_RPC_UNAVAILABLE_RESOURCE, ERR_RPC_UNSUPPORTED_METHOD, JSONRPC_ERR_CHAIN_DISCONNECTED, JSONRPC_ERR_DISCONNECTED, JSONRPC_ERR_REJECTED_REQUEST, JSONRPC_ERR_UNAUTHORIZED, JSONRPC_ERR_UNSUPPORTED_METHOD, } from '../error_codes';
import { ERR_RPC_INTERNAL_ERROR, ERR_RPC_INVALID_INPUT, ERR_RPC_INVALID_JSON, ERR_RPC_INVALID_METHOD, ERR_RPC_INVALID_PARAMS, ERR_RPC_INVALID_REQUEST, ERR_RPC_LIMIT_EXCEEDED, ERR_RPC_MISSING_RESOURCE, ERR_RPC_NOT_SUPPORTED, ERR_RPC_TRANSACTION_REJECTED, ERR_RPC_UNAVAILABLE_RESOURCE, ERR_RPC_UNSUPPORTED_METHOD, JSONRPC_ERR_CHAIN_DISCONNECTED, JSONRPC_ERR_DISCONNECTED, JSONRPC_ERR_REJECTED_REQUEST, JSONRPC_ERR_UNAUTHORIZED, JSONRPC_ERR_UNSUPPORTED_METHOD, } from '../error_codes.js';
/**

@@ -20,0 +20,0 @@ * A template string for a generic Rpc Error. The `*code*` will be replaced with the code number.

{
"name": "web3-errors",
"version": "1.1.0",
"version": "1.1.1-dev.1cdc86c.0+1cdc86c",
"description": "This package has web3 error classes",

@@ -44,3 +44,3 @@ "main": "./lib/commonjs/index.js",

"dependencies": {
"web3-types": "^1.1.0"
"web3-types": "1.1.1-dev.1cdc86c.0+1cdc86c"
},

@@ -61,3 +61,3 @@ "devDependencies": {

},
"gitHead": "af3bad15061c7615f7e2ce75509acf624c9d567b"
"gitHead": "1cdc86cd1543615cc30279199ed890d8abd285b1"
}

@@ -70,2 +70,10 @@ /*

this.request = request;
let errorOrErrors: JsonRpcError | JsonRpcError[] | undefined;
if (`error` in response) {
errorOrErrors = response.error as JsonRpcError;
} else if (response instanceof Array) {
errorOrErrors = response.map(r => r.error) as JsonRpcError[];
}
this.innerError = errorOrErrors as Error | Error[] | undefined;
}

@@ -88,3 +96,2 @@

this.code = ERR_INVALID_RESPONSE;
let errorOrErrors: JsonRpcError | JsonRpcError[] | undefined;

@@ -91,0 +98,0 @@ if (`error` in result) {

@@ -36,3 +36,3 @@ /*

JSONRPC_ERR_UNSUPPORTED_METHOD,
} from '../error_codes';
} from '../error_codes.js';

@@ -39,0 +39,0 @@ /**

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc