Socket
Socket
Sign inDemoInstall

web3-errors

Package Overview
Dependencies
Maintainers
2
Versions
309
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 0.1.1-alpha.4 to 1.0.0-rc.0

lib/errors/rpc_errors.d.ts

14

lib/error_codes.d.ts

@@ -10,2 +10,3 @@ export declare const ERR_RESPONSE = 100;

export declare const ERR_EXISTING_PLUGIN_NAMESPACE = 206;
export declare const ERR_INVALID_METHOD_PARAMS = 207;
export declare const ERR_CONTRACT = 300;

@@ -60,2 +61,3 @@ export declare const ERR_CONTRACT_RESOLVER_MISSING = 301;

export declare const ERR_TX_INVALID_RECEIVER = 437;
export declare const ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR = 438;
export declare const ERR_CONN = 500;

@@ -111,2 +113,14 @@ export declare const ERR_CONN_INVALID = 501;

export declare const ERR_CORE_CHAIN_MISMATCH = 1102;
export declare const ERR_RPC_INVALID_JSON = -32700;
export declare const ERR_RPC_INVALID_REQUEST = -32600;
export declare const ERR_RPC_INVALID_METHOD = -32601;
export declare const ERR_RPC_INVALID_PARAMS = -32602;
export declare const ERR_RPC_INTERNAL_ERROR = -32603;
export declare const ERR_RPC_INVALID_INPUT = -32000;
export declare const ERR_RPC_MISSING_RESOURCE = -32001;
export declare const ERR_RPC_UNAVAILABLE_RESOURCE = -32002;
export declare const ERR_RPC_TRANSACTION_REJECTED = -32003;
export declare const ERR_RPC_UNSUPPORTED_METHOD = -32004;
export declare const ERR_RPC_LIMIT_EXCEEDED = -32005;
export declare const ERR_RPC_NOT_SUPPORTED = -32006;
//# sourceMappingURL=error_codes.d.ts.map

20

lib/error_codes.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ERR_TX_LOCAL_WALLET_NOT_AVAILABLE = exports.ERR_TX_RECEIPT_MISSING_BLOCK_NUMBER = exports.ERR_TX_RECEIPT_MISSING_OR_BLOCKHASH_NULL = exports.ERR_TX_POLLING_TIMEOUT = exports.ERR_TX_DATA_AND_INPUT = exports.ERR_TX_UNSUPPORTED_TYPE = exports.ERR_TX_UNSUPPORTED_EIP_1559 = exports.ERR_TX_UNABLE_TO_POPULATE_NONCE = exports.ERR_TX_INVALID_NONCE_OR_CHAIN_ID = exports.ERR_TX_INVALID_OBJECT = exports.ERR_TX_INVALID_LEGACY_FEE_MARKET = exports.ERR_TX_INVALID_FEE_MARKET_GAS_PRICE = exports.ERR_TX_INVALID_FEE_MARKET_GAS = exports.ERR_TX_INVALID_LEGACY_GAS = exports.ERR_TX_MISSING_GAS = exports.ERR_TX_MISSING_CHAIN_INFO = exports.ERR_TX_INVALID_CHAIN_INFO = exports.ERR_TX_CHAIN_ID_MISMATCH = exports.ERR_TX_MISSING_CUSTOM_CHAIN_ID = exports.ERR_TX_MISSING_CUSTOM_CHAIN = exports.ERR_TX_INVALID_CALL = exports.ERR_TX_INVALID_SENDER = exports.ERR_RAW_TX_UNDEFINED = exports.ERR_TX_OUT_OF_GAS = exports.ERR_TX_REVERT_WITHOUT_REASON = exports.ERR_TX_CONTRACT_NOT_STORED = exports.ERR_TX_NO_CONTRACT_ADDRESS = exports.ERR_TX_REVERT_TRANSACTION = exports.ERR_TX_REVERT_INSTRUCTION = exports.ERR_TX = exports.ERR_CONTRACT_EXECUTION_REVERTED = exports.ERR_CONTRACT_INSTANTIATION = exports.ERR_CONTRACT_MISSING_FROM_ADDRESS = exports.ERR_CONTRACT_MISSING_ADDRESS = exports.ERR_CONTRACT_MISSING_DEPLOY_DATA = exports.ERR_CONTRACT_RESERVED_EVENT = exports.ERR_CONTRACT_EVENT_NOT_EXISTS = exports.ERR_CONTRACT_REQUIRED_CALLBACK = exports.ERR_CONTRACT_ABI_MISSING = exports.ERR_CONTRACT_RESOLVER_MISSING = exports.ERR_CONTRACT = exports.ERR_EXISTING_PLUGIN_NAMESPACE = exports.ERR_ABI_ENCODING = exports.ERR_OPERATION_ABORT = exports.ERR_OPERATION_TIMEOUT = exports.ERR_METHOD_NOT_IMPLEMENTED = exports.ERR_FORMATTERS = exports.ERR_PARAM = exports.ERR_INVALID_RESPONSE = exports.ERR_RESPONSE = void 0;
exports.ERR_INVALID_UNSIGNED_INTEGER = exports.ERR_INVALID_BOOLEAN = exports.ERR_INVALID_TYPE = exports.ERR_INVALID_HEX = exports.ERR_INVALID_ADDRESS = exports.ERR_INVALID_UNIT = exports.ERR_INVALID_NUMBER = exports.ERR_INVALID_BYTES = exports.ERR_INVALID_STRING = exports.ERR_ENS_NETWORK_NOT_SYNCED = exports.ERR_ENS_UNSUPPORTED_NETWORK = exports.ERR_ENS_CHECK_INTERFACE_SUPPORT = exports.JSONRPC_ERR_CHAIN_DISCONNECTED = exports.JSONRPC_ERR_DISCONNECTED = exports.JSONRPC_ERR_UNSUPPORTED_METHOD = exports.JSONRPC_ERR_UNAUTHORIZED = exports.JSONRPC_ERR_REJECTED_REQUEST = exports.GENESIS_BLOCK_NUMBER = exports.ERR_INVALID_SIGNATURE = exports.ERR_SIGNATURE_FAILED = exports.ERR_PBKDF2_ITERATIONS = exports.ERR_INVALID_KEYSTORE = exports.ERR_IV_LENGTH = exports.ERR_INVALID_PASSWORD = exports.ERR_KEY_VERSION_UNSUPPORTED = exports.ERR_KEY_DERIVATION_FAIL = exports.ERR_UNSUPPORTED_KDF = exports.ERR_INVALID_PRIVATE_KEY = exports.ERR_PRIVATE_KEY_LENGTH = exports.ERR_WS_PROVIDER = exports.ERR_SUBSCRIPTION = exports.ERR_INVALID_CLIENT = exports.ERR_INVALID_PROVIDER = exports.ERR_PROVIDER = exports.ERR_REQ_ALREADY_SENT = exports.ERR_CONN_PENDING_REQUESTS = exports.ERR_CONN_MAX_ATTEMPTS = exports.ERR_CONN_CLOSE = exports.ERR_CONN_NOT_OPEN = exports.ERR_CONN_TIMEOUT = exports.ERR_CONN_INVALID = exports.ERR_CONN = exports.ERR_TX_INVALID_RECEIVER = exports.ERR_TX_HARDFORK_MISMATCH = exports.ERR_TX_CHAIN_MISMATCH = exports.ERR_TX_GAS_MISMATCH = exports.ERR_TX_SIGNING = exports.ERR_TX_BLOCK_TIMEOUT = exports.ERR_TX_SEND_TIMEOUT = exports.ERR_TX_NOT_FOUND = void 0;
exports.ERR_CORE_CHAIN_MISMATCH = exports.ERR_CORE_HARDFORK_MISMATCH = exports.ERR_VALIDATION = exports.ERR_INVALID_NIBBLE_WIDTH = exports.ERR_INVALID_TYPE_ABI = exports.ERR_INVALID_BLOCK = exports.ERR_INVALID_LARGE_VALUE = exports.ERR_INVALID_SIZE = void 0;
exports.ERR_TX_RECEIPT_MISSING_BLOCK_NUMBER = exports.ERR_TX_RECEIPT_MISSING_OR_BLOCKHASH_NULL = exports.ERR_TX_POLLING_TIMEOUT = exports.ERR_TX_DATA_AND_INPUT = exports.ERR_TX_UNSUPPORTED_TYPE = exports.ERR_TX_UNSUPPORTED_EIP_1559 = exports.ERR_TX_UNABLE_TO_POPULATE_NONCE = exports.ERR_TX_INVALID_NONCE_OR_CHAIN_ID = exports.ERR_TX_INVALID_OBJECT = exports.ERR_TX_INVALID_LEGACY_FEE_MARKET = exports.ERR_TX_INVALID_FEE_MARKET_GAS_PRICE = exports.ERR_TX_INVALID_FEE_MARKET_GAS = exports.ERR_TX_INVALID_LEGACY_GAS = exports.ERR_TX_MISSING_GAS = exports.ERR_TX_MISSING_CHAIN_INFO = exports.ERR_TX_INVALID_CHAIN_INFO = exports.ERR_TX_CHAIN_ID_MISMATCH = exports.ERR_TX_MISSING_CUSTOM_CHAIN_ID = exports.ERR_TX_MISSING_CUSTOM_CHAIN = exports.ERR_TX_INVALID_CALL = exports.ERR_TX_INVALID_SENDER = exports.ERR_RAW_TX_UNDEFINED = exports.ERR_TX_OUT_OF_GAS = exports.ERR_TX_REVERT_WITHOUT_REASON = exports.ERR_TX_CONTRACT_NOT_STORED = exports.ERR_TX_NO_CONTRACT_ADDRESS = exports.ERR_TX_REVERT_TRANSACTION = exports.ERR_TX_REVERT_INSTRUCTION = exports.ERR_TX = exports.ERR_CONTRACT_EXECUTION_REVERTED = exports.ERR_CONTRACT_INSTANTIATION = exports.ERR_CONTRACT_MISSING_FROM_ADDRESS = exports.ERR_CONTRACT_MISSING_ADDRESS = exports.ERR_CONTRACT_MISSING_DEPLOY_DATA = exports.ERR_CONTRACT_RESERVED_EVENT = exports.ERR_CONTRACT_EVENT_NOT_EXISTS = exports.ERR_CONTRACT_REQUIRED_CALLBACK = exports.ERR_CONTRACT_ABI_MISSING = exports.ERR_CONTRACT_RESOLVER_MISSING = exports.ERR_CONTRACT = exports.ERR_INVALID_METHOD_PARAMS = exports.ERR_EXISTING_PLUGIN_NAMESPACE = exports.ERR_ABI_ENCODING = exports.ERR_OPERATION_ABORT = exports.ERR_OPERATION_TIMEOUT = exports.ERR_METHOD_NOT_IMPLEMENTED = exports.ERR_FORMATTERS = exports.ERR_PARAM = exports.ERR_INVALID_RESPONSE = exports.ERR_RESPONSE = void 0;
exports.ERR_INVALID_TYPE = exports.ERR_INVALID_HEX = exports.ERR_INVALID_ADDRESS = exports.ERR_INVALID_UNIT = exports.ERR_INVALID_NUMBER = exports.ERR_INVALID_BYTES = exports.ERR_INVALID_STRING = exports.ERR_ENS_NETWORK_NOT_SYNCED = exports.ERR_ENS_UNSUPPORTED_NETWORK = exports.ERR_ENS_CHECK_INTERFACE_SUPPORT = exports.JSONRPC_ERR_CHAIN_DISCONNECTED = exports.JSONRPC_ERR_DISCONNECTED = exports.JSONRPC_ERR_UNSUPPORTED_METHOD = exports.JSONRPC_ERR_UNAUTHORIZED = exports.JSONRPC_ERR_REJECTED_REQUEST = exports.GENESIS_BLOCK_NUMBER = exports.ERR_INVALID_SIGNATURE = exports.ERR_SIGNATURE_FAILED = exports.ERR_PBKDF2_ITERATIONS = exports.ERR_INVALID_KEYSTORE = exports.ERR_IV_LENGTH = exports.ERR_INVALID_PASSWORD = exports.ERR_KEY_VERSION_UNSUPPORTED = exports.ERR_KEY_DERIVATION_FAIL = exports.ERR_UNSUPPORTED_KDF = exports.ERR_INVALID_PRIVATE_KEY = exports.ERR_PRIVATE_KEY_LENGTH = exports.ERR_WS_PROVIDER = exports.ERR_SUBSCRIPTION = exports.ERR_INVALID_CLIENT = exports.ERR_INVALID_PROVIDER = exports.ERR_PROVIDER = exports.ERR_REQ_ALREADY_SENT = exports.ERR_CONN_PENDING_REQUESTS = exports.ERR_CONN_MAX_ATTEMPTS = exports.ERR_CONN_CLOSE = exports.ERR_CONN_NOT_OPEN = exports.ERR_CONN_TIMEOUT = exports.ERR_CONN_INVALID = exports.ERR_CONN = exports.ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR = exports.ERR_TX_INVALID_RECEIVER = exports.ERR_TX_HARDFORK_MISMATCH = exports.ERR_TX_CHAIN_MISMATCH = exports.ERR_TX_GAS_MISMATCH = exports.ERR_TX_SIGNING = exports.ERR_TX_BLOCK_TIMEOUT = exports.ERR_TX_SEND_TIMEOUT = exports.ERR_TX_NOT_FOUND = exports.ERR_TX_LOCAL_WALLET_NOT_AVAILABLE = void 0;
exports.ERR_RPC_NOT_SUPPORTED = exports.ERR_RPC_LIMIT_EXCEEDED = exports.ERR_RPC_UNSUPPORTED_METHOD = exports.ERR_RPC_TRANSACTION_REJECTED = exports.ERR_RPC_UNAVAILABLE_RESOURCE = exports.ERR_RPC_MISSING_RESOURCE = exports.ERR_RPC_INVALID_INPUT = exports.ERR_RPC_INTERNAL_ERROR = exports.ERR_RPC_INVALID_PARAMS = exports.ERR_RPC_INVALID_METHOD = exports.ERR_RPC_INVALID_REQUEST = exports.ERR_RPC_INVALID_JSON = exports.ERR_CORE_CHAIN_MISMATCH = exports.ERR_CORE_HARDFORK_MISMATCH = exports.ERR_VALIDATION = exports.ERR_INVALID_NIBBLE_WIDTH = exports.ERR_INVALID_TYPE_ABI = exports.ERR_INVALID_BLOCK = exports.ERR_INVALID_LARGE_VALUE = exports.ERR_INVALID_SIZE = exports.ERR_INVALID_UNSIGNED_INTEGER = exports.ERR_INVALID_BOOLEAN = void 0;
exports.ERR_RESPONSE = 100;

@@ -15,2 +15,3 @@ exports.ERR_INVALID_RESPONSE = 101;

exports.ERR_EXISTING_PLUGIN_NAMESPACE = 206;
exports.ERR_INVALID_METHOD_PARAMS = 207;
exports.ERR_CONTRACT = 300;

@@ -65,2 +66,3 @@ exports.ERR_CONTRACT_RESOLVER_MISSING = 301;

exports.ERR_TX_INVALID_RECEIVER = 437;
exports.ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR = 438;
exports.ERR_CONN = 500;

@@ -116,2 +118,14 @@ exports.ERR_CONN_INVALID = 501;

exports.ERR_CORE_CHAIN_MISMATCH = 1102;
exports.ERR_RPC_INVALID_JSON = -32700;
exports.ERR_RPC_INVALID_REQUEST = -32600;
exports.ERR_RPC_INVALID_METHOD = -32601;
exports.ERR_RPC_INVALID_PARAMS = -32602;
exports.ERR_RPC_INTERNAL_ERROR = -32603;
exports.ERR_RPC_INVALID_INPUT = -32000;
exports.ERR_RPC_MISSING_RESOURCE = -32001;
exports.ERR_RPC_UNAVAILABLE_RESOURCE = -32002;
exports.ERR_RPC_TRANSACTION_REJECTED = -32003;
exports.ERR_RPC_UNSUPPORTED_METHOD = -32004;
exports.ERR_RPC_LIMIT_EXCEEDED = -32005;
exports.ERR_RPC_NOT_SUPPORTED = -32006;
//# sourceMappingURL=error_codes.js.map

20

lib/errors/account_errors.d.ts

@@ -1,35 +0,35 @@

import { Web3Error } from '../web3_error_base';
export declare class PrivateKeyLengthError extends Web3Error {
import { BaseWeb3Error } from '../web3_error_base';
export declare class PrivateKeyLengthError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class InvalidPrivateKeyError extends Web3Error {
export declare class InvalidPrivateKeyError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class InvalidSignatureError extends Web3Error {
export declare class InvalidSignatureError extends BaseWeb3Error {
code: number;
constructor(errorDetails: string);
}
export declare class InvalidKdfError extends Web3Error {
export declare class InvalidKdfError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class KeyDerivationError extends Web3Error {
export declare class KeyDerivationError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class KeyStoreVersionError extends Web3Error {
export declare class KeyStoreVersionError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class InvalidPasswordError extends Web3Error {
export declare class InvalidPasswordError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class IVLengthError extends Web3Error {
export declare class IVLengthError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class PBKDF2IterationsError extends Web3Error {
export declare class PBKDF2IterationsError extends BaseWeb3Error {
code: number;

@@ -36,0 +36,0 @@ constructor();

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

const web3_error_base_1 = require("../web3_error_base");
class PrivateKeyLengthError extends web3_error_base_1.Web3Error {
class PrivateKeyLengthError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -14,3 +14,3 @@ super(`Private key must be 32 bytes.`);

exports.PrivateKeyLengthError = PrivateKeyLengthError;
class InvalidPrivateKeyError extends web3_error_base_1.Web3Error {
class InvalidPrivateKeyError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -22,3 +22,3 @@ super(`Invalid Private Key, Not a valid string or buffer`);

exports.InvalidPrivateKeyError = InvalidPrivateKeyError;
class InvalidSignatureError extends web3_error_base_1.Web3Error {
class InvalidSignatureError extends web3_error_base_1.BaseWeb3Error {
constructor(errorDetails) {

@@ -30,3 +30,3 @@ super(`"${errorDetails}"`);

exports.InvalidSignatureError = InvalidSignatureError;
class InvalidKdfError extends web3_error_base_1.Web3Error {
class InvalidKdfError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -38,3 +38,3 @@ super(`Invalid key derivation function`);

exports.InvalidKdfError = InvalidKdfError;
class KeyDerivationError extends web3_error_base_1.Web3Error {
class KeyDerivationError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -46,3 +46,3 @@ super(`Key derivation failed - possibly wrong password`);

exports.KeyDerivationError = KeyDerivationError;
class KeyStoreVersionError extends web3_error_base_1.Web3Error {
class KeyStoreVersionError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -54,3 +54,3 @@ super('Unsupported key store version');

exports.KeyStoreVersionError = KeyStoreVersionError;
class InvalidPasswordError extends web3_error_base_1.Web3Error {
class InvalidPasswordError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -62,3 +62,3 @@ super('Password cannot be empty');

exports.InvalidPasswordError = InvalidPasswordError;
class IVLengthError extends web3_error_base_1.Web3Error {
class IVLengthError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -70,3 +70,3 @@ super('Initialization vector must be 16 bytes');

exports.IVLengthError = IVLengthError;
class PBKDF2IterationsError extends web3_error_base_1.Web3Error {
class PBKDF2IterationsError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -73,0 +73,0 @@ super('c > 1000, pbkdf2 is less secure with less iterations');

import { ConnectionEvent } from 'web3-types';
import { Web3Error } from '../web3_error_base';
export declare class ConnectionError extends Web3Error {
import { BaseWeb3Error } from '../web3_error_base';
export declare class ConnectionError extends BaseWeb3Error {
code: number;

@@ -50,3 +50,3 @@ errorCode?: number;

export declare class MaxAttemptsReachedOnReconnectingError extends ConnectionError {
constructor();
constructor(numberOfAttempts: number);
}

@@ -53,0 +53,0 @@ export declare class PendingRequestsOnReconnectingError extends ConnectionError {

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

const web3_error_base_1 = require("../web3_error_base");
class ConnectionError extends web3_error_base_1.Web3Error {
class ConnectionError extends web3_error_base_1.BaseWeb3Error {
constructor(message, event) {

@@ -59,4 +59,4 @@ super(message);

class MaxAttemptsReachedOnReconnectingError extends ConnectionError {
constructor() {
super('Maximum number of reconnect attempts reached!');
constructor(numberOfAttempts) {
super(`Maximum number of reconnect attempts reached! (${numberOfAttempts})`);
this.code = error_codes_1.ERR_CONN_MAX_ATTEMPTS;

@@ -63,0 +63,0 @@ }

import { JsonRpcError, TransactionReceipt, HexString } from 'web3-types';
import { Web3Error } from '../web3_error_base';
export declare class Web3ContractError extends Web3Error {
import { BaseWeb3Error } from '../web3_error_base';
export declare class Web3ContractError extends BaseWeb3Error {
code: number;

@@ -8,3 +8,3 @@ receipt?: TransactionReceipt;

}
export declare class ResolverMethodMissingError extends Web3Error {
export declare class ResolverMethodMissingError extends BaseWeb3Error {
address: string;

@@ -22,11 +22,11 @@ name: string;

}
export declare class ContractMissingABIError extends Web3Error {
export declare class ContractMissingABIError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class ContractOnceRequiresCallbackError extends Web3Error {
export declare class ContractOnceRequiresCallbackError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class ContractEventDoesNotExistError extends Web3Error {
export declare class ContractEventDoesNotExistError extends BaseWeb3Error {
eventName: string;

@@ -43,3 +43,3 @@ code: number;

}
export declare class ContractReservedEventError extends Web3Error {
export declare class ContractReservedEventError extends BaseWeb3Error {
type: string;

@@ -56,15 +56,15 @@ code: number;

}
export declare class ContractMissingDeployDataError extends Web3Error {
export declare class ContractMissingDeployDataError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class ContractNoAddressDefinedError extends Web3Error {
export declare class ContractNoAddressDefinedError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class ContractNoFromAddressDefinedError extends Web3Error {
export declare class ContractNoFromAddressDefinedError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class ContractInstantiationError extends Web3Error {
export declare class ContractInstantiationError extends BaseWeb3Error {
code: number;

@@ -71,0 +71,0 @@ }

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

const web3_error_base_1 = require("../web3_error_base");
class Web3ContractError extends web3_error_base_1.Web3Error {
class Web3ContractError extends web3_error_base_1.BaseWeb3Error {
constructor(message, receipt) {

@@ -15,3 +15,3 @@ super(message);

exports.Web3ContractError = Web3ContractError;
class ResolverMethodMissingError extends web3_error_base_1.Web3Error {
class ResolverMethodMissingError extends web3_error_base_1.BaseWeb3Error {
constructor(address, name) {

@@ -28,3 +28,3 @@ super(`The resolver at ${address} does not implement requested method: "${name}".`);

exports.ResolverMethodMissingError = ResolverMethodMissingError;
class ContractMissingABIError extends web3_error_base_1.Web3Error {
class ContractMissingABIError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -36,3 +36,3 @@ super('You must provide the json interface of the contract when instantiating a contract object.');

exports.ContractMissingABIError = ContractMissingABIError;
class ContractOnceRequiresCallbackError extends web3_error_base_1.Web3Error {
class ContractOnceRequiresCallbackError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -44,3 +44,3 @@ super('Once requires a callback as the second parameter.');

exports.ContractOnceRequiresCallbackError = ContractOnceRequiresCallbackError;
class ContractEventDoesNotExistError extends web3_error_base_1.Web3Error {
class ContractEventDoesNotExistError extends web3_error_base_1.BaseWeb3Error {
constructor(eventName) {

@@ -56,3 +56,3 @@ super(`Event "${eventName}" doesn't exist in this contract.`);

exports.ContractEventDoesNotExistError = ContractEventDoesNotExistError;
class ContractReservedEventError extends web3_error_base_1.Web3Error {
class ContractReservedEventError extends web3_error_base_1.BaseWeb3Error {
constructor(type) {

@@ -68,3 +68,3 @@ super(`Event "${type}" doesn't exist in this contract.`);

exports.ContractReservedEventError = ContractReservedEventError;
class ContractMissingDeployDataError extends web3_error_base_1.Web3Error {
class ContractMissingDeployDataError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -76,3 +76,3 @@ super(`No "data" specified in neither the given options, nor the default options.`);

exports.ContractMissingDeployDataError = ContractMissingDeployDataError;
class ContractNoAddressDefinedError extends web3_error_base_1.Web3Error {
class ContractNoAddressDefinedError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -84,3 +84,3 @@ super("This contract object doesn't have address set yet, please set an address first.");

exports.ContractNoAddressDefinedError = ContractNoAddressDefinedError;
class ContractNoFromAddressDefinedError extends web3_error_base_1.Web3Error {
class ContractNoFromAddressDefinedError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -92,3 +92,3 @@ super('No "from" address specified in neither the given options, nor the default options.');

exports.ContractNoFromAddressDefinedError = ContractNoFromAddressDefinedError;
class ContractInstantiationError extends web3_error_base_1.Web3Error {
class ContractInstantiationError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -95,0 +95,0 @@ super(...arguments);

@@ -1,7 +0,7 @@

import { Web3Error } from '../web3_error_base';
export declare class ConfigHardforkMismatchError extends Web3Error {
import { BaseWeb3Error } from '../web3_error_base';
export declare class ConfigHardforkMismatchError extends BaseWeb3Error {
code: number;
constructor(defaultHardfork: string, commonHardFork: string);
}
export declare class ConfigChainMismatchError extends Web3Error {
export declare class ConfigChainMismatchError extends BaseWeb3Error {
code: number;

@@ -8,0 +8,0 @@ constructor(defaultHardfork: string, commonHardFork: string);

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

const error_codes_1 = require("../error_codes");
class ConfigHardforkMismatchError extends web3_error_base_1.Web3Error {
class ConfigHardforkMismatchError extends web3_error_base_1.BaseWeb3Error {
constructor(defaultHardfork, commonHardFork) {

@@ -14,3 +14,3 @@ super(`Web3Config hardfork doesnt match in defaultHardfork ${defaultHardfork} and common.hardfork ${commonHardFork}`);

exports.ConfigHardforkMismatchError = ConfigHardforkMismatchError;
class ConfigChainMismatchError extends web3_error_base_1.Web3Error {
class ConfigChainMismatchError extends web3_error_base_1.BaseWeb3Error {
constructor(defaultHardfork, commonHardFork) {

@@ -17,0 +17,0 @@ super(`Web3Config chain doesnt match in defaultHardfork ${defaultHardfork} and common.hardfork ${commonHardFork}`);

@@ -1,11 +0,11 @@

import { Web3Error } from '../web3_error_base';
export declare class ENSCheckInterfaceSupportError extends Web3Error {
import { BaseWeb3Error } from '../web3_error_base';
export declare class ENSCheckInterfaceSupportError extends BaseWeb3Error {
code: number;
constructor(errorDetails: string);
}
export declare class ENSUnsupportedNetworkError extends Web3Error {
export declare class ENSUnsupportedNetworkError extends BaseWeb3Error {
code: number;
constructor(networkType: string);
}
export declare class ENSNetworkNotSyncedError extends Web3Error {
export declare class ENSNetworkNotSyncedError extends BaseWeb3Error {
code: number;

@@ -12,0 +12,0 @@ constructor();

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

const web3_error_base_1 = require("../web3_error_base");
class ENSCheckInterfaceSupportError extends web3_error_base_1.Web3Error {
class ENSCheckInterfaceSupportError extends web3_error_base_1.BaseWeb3Error {
constructor(errorDetails) {

@@ -14,3 +14,3 @@ super(`ENS resolver check interface support error. "${errorDetails}"`);

exports.ENSCheckInterfaceSupportError = ENSCheckInterfaceSupportError;
class ENSUnsupportedNetworkError extends web3_error_base_1.Web3Error {
class ENSUnsupportedNetworkError extends web3_error_base_1.BaseWeb3Error {
constructor(networkType) {

@@ -22,3 +22,3 @@ super(`ENS is not supported on network ${networkType}`);

exports.ENSUnsupportedNetworkError = ENSUnsupportedNetworkError;
class ENSNetworkNotSyncedError extends web3_error_base_1.Web3Error {
class ENSNetworkNotSyncedError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -25,0 +25,0 @@ super(`Network not synced`);

@@ -1,3 +0,3 @@

import { Web3Error } from '../web3_error_base';
export declare class InvalidNumberOfParamsError extends Web3Error {
import { BaseWeb3Error } from '../web3_error_base';
export declare class InvalidNumberOfParamsError extends BaseWeb3Error {
got: number;

@@ -18,19 +18,31 @@ expected: number;

}
export declare class FormatterError extends Web3Error {
export declare class InvalidMethodParamsError extends BaseWeb3Error {
hint?: string | undefined;
code: number;
constructor(hint?: string | undefined);
toJSON(): {
hint: string | undefined;
name: string;
code: number;
message: string;
innerError: Error | Error[] | undefined;
};
}
export declare class MethodNotImplementedError extends Web3Error {
export declare class FormatterError extends BaseWeb3Error {
code: number;
}
export declare class MethodNotImplementedError extends BaseWeb3Error {
code: number;
constructor();
}
export declare class OperationTimeoutError extends Web3Error {
export declare class OperationTimeoutError extends BaseWeb3Error {
code: number;
}
export declare class OperationAbortError extends Web3Error {
export declare class OperationAbortError extends BaseWeb3Error {
code: number;
}
export declare class AbiError extends Web3Error {
export declare class AbiError extends BaseWeb3Error {
code: number;
}
export declare class ExistingPluginNamespaceError extends Web3Error {
export declare class ExistingPluginNamespaceError extends BaseWeb3Error {
code: number;

@@ -37,0 +49,0 @@ constructor(pluginNamespace: string);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExistingPluginNamespaceError = exports.AbiError = exports.OperationAbortError = exports.OperationTimeoutError = exports.MethodNotImplementedError = exports.FormatterError = exports.InvalidNumberOfParamsError = void 0;
exports.ExistingPluginNamespaceError = exports.AbiError = exports.OperationAbortError = exports.OperationTimeoutError = exports.MethodNotImplementedError = exports.FormatterError = exports.InvalidMethodParamsError = exports.InvalidNumberOfParamsError = void 0;
const error_codes_1 = require("../error_codes");
const web3_error_base_1 = require("../web3_error_base");
class InvalidNumberOfParamsError extends web3_error_base_1.Web3Error {
class InvalidNumberOfParamsError extends web3_error_base_1.BaseWeb3Error {
constructor(got, expected, method) {

@@ -19,3 +19,14 @@ super(`Invalid number of parameters for "${method}". Got "${got}" expected "${expected}"!`);

exports.InvalidNumberOfParamsError = InvalidNumberOfParamsError;
class FormatterError extends web3_error_base_1.Web3Error {
class InvalidMethodParamsError extends web3_error_base_1.BaseWeb3Error {
constructor(hint) {
super(`Invalid parameters passed. "${typeof hint !== 'undefined' ? hint : ''}"`);
this.hint = hint;
this.code = error_codes_1.ERR_INVALID_METHOD_PARAMS;
}
toJSON() {
return Object.assign(Object.assign({}, super.toJSON()), { hint: this.hint });
}
}
exports.InvalidMethodParamsError = InvalidMethodParamsError;
class FormatterError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -27,3 +38,3 @@ super(...arguments);

exports.FormatterError = FormatterError;
class MethodNotImplementedError extends web3_error_base_1.Web3Error {
class MethodNotImplementedError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -35,3 +46,3 @@ super("The method you're trying to call is not implemented.");

exports.MethodNotImplementedError = MethodNotImplementedError;
class OperationTimeoutError extends web3_error_base_1.Web3Error {
class OperationTimeoutError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -43,3 +54,3 @@ super(...arguments);

exports.OperationTimeoutError = OperationTimeoutError;
class OperationAbortError extends web3_error_base_1.Web3Error {
class OperationAbortError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -51,3 +62,3 @@ super(...arguments);

exports.OperationAbortError = OperationAbortError;
class AbiError extends web3_error_base_1.Web3Error {
class AbiError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -59,3 +70,3 @@ super(...arguments);

exports.AbiError = AbiError;
class ExistingPluginNamespaceError extends web3_error_base_1.Web3Error {
class ExistingPluginNamespaceError extends web3_error_base_1.BaseWeb3Error {
constructor(pluginNamespace) {

@@ -62,0 +73,0 @@ super(`A plugin with the namespace: ${pluginNamespace} has already been registered.`);

@@ -1,6 +0,6 @@

import { Web3Error } from '../web3_error_base';
export declare class ProviderError extends Web3Error {
import { BaseWeb3Error } from '../web3_error_base';
export declare class ProviderError extends BaseWeb3Error {
code: number;
}
export declare class InvalidProviderError extends Web3Error {
export declare class InvalidProviderError extends BaseWeb3Error {
clientUrl: string;

@@ -10,12 +10,12 @@ code: number;

}
export declare class InvalidClientError extends Web3Error {
export declare class InvalidClientError extends BaseWeb3Error {
code: number;
constructor(clientUrl: string);
}
export declare class SubscriptionError extends Web3Error {
export declare class SubscriptionError extends BaseWeb3Error {
code: number;
}
export declare class Web3WSProviderError extends Web3Error {
export declare class Web3WSProviderError extends BaseWeb3Error {
code: number;
}
//# sourceMappingURL=provider_errors.d.ts.map

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

const web3_error_base_1 = require("../web3_error_base");
class ProviderError extends web3_error_base_1.Web3Error {
class ProviderError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -14,3 +14,3 @@ super(...arguments);

exports.ProviderError = ProviderError;
class InvalidProviderError extends web3_error_base_1.Web3Error {
class InvalidProviderError extends web3_error_base_1.BaseWeb3Error {
constructor(clientUrl) {

@@ -23,3 +23,3 @@ super(`Provider with url "${clientUrl}" is not set or invalid`);

exports.InvalidProviderError = InvalidProviderError;
class InvalidClientError extends web3_error_base_1.Web3Error {
class InvalidClientError extends web3_error_base_1.BaseWeb3Error {
constructor(clientUrl) {

@@ -31,3 +31,3 @@ super(`Client URL "${clientUrl}" is invalid.`);

exports.InvalidClientError = InvalidClientError;
class SubscriptionError extends web3_error_base_1.Web3Error {
class SubscriptionError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -39,3 +39,3 @@ super(...arguments);

exports.SubscriptionError = SubscriptionError;
class Web3WSProviderError extends web3_error_base_1.Web3Error {
class Web3WSProviderError extends web3_error_base_1.BaseWeb3Error {
constructor() {

@@ -42,0 +42,0 @@ super(...arguments);

@@ -1,9 +0,11 @@

import { JsonRpcResponse } from 'web3-types';
import { Web3Error } from '../web3_error_base';
export declare class ResponseError<ErrorType = unknown> extends Web3Error {
import { JsonRpcPayload, JsonRpcResponse } from 'web3-types';
import { BaseWeb3Error } from '../web3_error_base';
export declare class ResponseError<ErrorType = unknown, RequestType = unknown> extends BaseWeb3Error {
code: number;
data?: ErrorType | ErrorType[];
constructor(response: JsonRpcResponse<unknown, ErrorType>, message?: string);
request?: JsonRpcPayload<RequestType>;
constructor(response: JsonRpcResponse<unknown, ErrorType>, message?: string, request?: JsonRpcPayload<RequestType>);
toJSON(): {
data: ErrorType | ErrorType[] | undefined;
request: JsonRpcPayload<RequestType> | undefined;
name: string;

@@ -15,5 +17,5 @@ code: number;

}
export declare class InvalidResponseError<ErrorType = unknown> extends ResponseError<ErrorType> {
constructor(result: JsonRpcResponse<unknown, ErrorType>);
export declare class InvalidResponseError<ErrorType = unknown, RequestType = unknown> extends ResponseError<ErrorType, RequestType> {
constructor(result: JsonRpcResponse<unknown, ErrorType>, request?: JsonRpcPayload<RequestType>);
}
//# sourceMappingURL=response_errors.d.ts.map

@@ -13,4 +13,4 @@ "use strict";

const buildErrorMessage = (response) => isResponseWithError(response) ? response.error.message : '';
class ResponseError extends web3_error_base_1.Web3Error {
constructor(response, message) {
class ResponseError extends web3_error_base_1.BaseWeb3Error {
constructor(response, message, request) {
var _a;

@@ -26,5 +26,6 @@ super(message !== null && message !== void 0 ? message : `Returned error: ${Array.isArray(response)

}
this.request = request;
}
toJSON() {
return Object.assign(Object.assign({}, super.toJSON()), { data: this.data });
return Object.assign(Object.assign({}, super.toJSON()), { data: this.data, request: this.request });
}

@@ -34,4 +35,4 @@ }

class InvalidResponseError extends ResponseError {
constructor(result) {
super(result);
constructor(result, request) {
super(result, undefined, request);
this.code = error_codes_1.ERR_INVALID_RESPONSE;

@@ -38,0 +39,0 @@ let errorOrErrors;

import { Bytes, HexString, Numbers, TransactionReceipt } from 'web3-types';
import { InvalidValueError, Web3Error } from '../web3_error_base';
export declare class TransactionError<ReceiptType = TransactionReceipt> extends Web3Error {
import { InvalidValueError, BaseWeb3Error } from '../web3_error_base';
export declare class TransactionError<ReceiptType = TransactionReceipt> extends BaseWeb3Error {
receipt?: ReceiptType | undefined;

@@ -15,3 +15,3 @@ code: number;

}
export declare class RevertInstructionError extends Web3Error {
export declare class RevertInstructionError extends BaseWeb3Error {
reason: string;

@@ -30,12 +30,14 @@ signature: string;

}
export declare class TransactionRevertError extends Web3Error {
export declare class TransactionRevertInstructionError<ReceiptType = TransactionReceipt> extends BaseWeb3Error {
reason: string;
signature?: string | undefined;
receipt?: TransactionReceipt | undefined;
receipt?: ReceiptType | undefined;
data?: string | undefined;
code: number;
constructor(reason: string, signature?: string | undefined, receipt?: TransactionReceipt | undefined);
constructor(reason: string, signature?: string | undefined, receipt?: ReceiptType | undefined, data?: string | undefined);
toJSON(): {
reason: string;
signature: string | undefined;
receipt: TransactionReceipt | undefined;
receipt: ReceiptType | undefined;
data: string | undefined;
name: string;

@@ -47,2 +49,26 @@ code: number;

}
export declare class TransactionRevertWithCustomError<ReceiptType = TransactionReceipt> extends TransactionRevertInstructionError<ReceiptType> {
reason: string;
customErrorName: string;
customErrorDecodedSignature: string;
customErrorArguments: Record<string, unknown>;
signature?: string | undefined;
receipt?: ReceiptType | undefined;
data?: string | undefined;
code: number;
constructor(reason: string, customErrorName: string, customErrorDecodedSignature: string, customErrorArguments: Record<string, unknown>, signature?: string | undefined, receipt?: ReceiptType | undefined, data?: string | undefined);
toJSON(): {
reason: string;
customErrorName: string;
customErrorDecodedSignature: string;
customErrorArguments: Record<string, unknown>;
signature: string | undefined;
receipt: ReceiptType | undefined;
data: string | undefined;
name: string;
code: number;
message: string;
innerError: Error | Error[] | undefined;
};
}
export declare class NoContractAddressFoundError extends TransactionError {

@@ -61,4 +87,4 @@ constructor(receipt: TransactionReceipt);

}
export declare class TransactionRevertedWithoutReasonError extends TransactionError {
constructor(receipt: TransactionReceipt);
export declare class TransactionRevertedWithoutReasonError<ReceiptType = TransactionReceipt> extends TransactionError<ReceiptType> {
constructor(receipt?: ReceiptType);
}

@@ -201,3 +227,3 @@ export declare class TransactionOutOfGasError extends TransactionError {

}
export declare class TransactionSendTimeoutError extends Web3Error {
export declare class TransactionSendTimeoutError extends BaseWeb3Error {
code: number;

@@ -209,3 +235,3 @@ constructor(value: {

}
export declare class TransactionPollingTimeoutError extends Web3Error {
export declare class TransactionPollingTimeoutError extends BaseWeb3Error {
code: number;

@@ -217,3 +243,3 @@ constructor(value: {

}
export declare class TransactionBlockTimeoutError extends Web3Error {
export declare class TransactionBlockTimeoutError extends BaseWeb3Error {
code: number;

@@ -240,3 +266,3 @@ constructor(value: {

}
export declare class TransactionSigningError extends Web3Error {
export declare class TransactionSigningError extends BaseWeb3Error {
code: number;

@@ -243,0 +269,0 @@ constructor(errorDetails: string);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LocalWalletNotAvailableError = exports.TransactionSigningError = exports.TransactionReceiptMissingBlockNumberError = exports.TransactionMissingReceiptOrBlockHashError = exports.TransactionBlockTimeoutError = exports.TransactionPollingTimeoutError = exports.TransactionSendTimeoutError = exports.TransactionDataAndInputError = exports.UnsupportedTransactionTypeError = exports.Eip1559NotSupportedError = exports.UnableToPopulateNonceError = exports.InvalidNonceOrChainIdError = exports.InvalidTransactionObjectError = exports.UnsupportedFeeMarketError = exports.Eip1559GasPriceError = exports.InvalidMaxPriorityFeePerGasOrMaxFeePerGas = exports.InvalidGasOrGasPrice = exports.TransactionGasMismatchError = exports.MissingGasError = exports.MissingChainOrHardforkError = exports.CommonOrChainAndHardforkError = exports.HardforkMismatchError = exports.ChainMismatchError = exports.ChainIdMismatchError = exports.MissingCustomChainIdError = exports.MissingCustomChainError = exports.InvalidTransactionCall = exports.InvalidTransactionWithReceiver = exports.InvalidTransactionWithSender = exports.TransactionNotFound = exports.UndefinedRawTransactionError = exports.TransactionOutOfGasError = exports.TransactionRevertedWithoutReasonError = exports.ContractCodeNotStoredError = exports.NoContractAddressFoundError = exports.TransactionRevertError = exports.RevertInstructionError = exports.TransactionError = void 0;
exports.LocalWalletNotAvailableError = exports.TransactionSigningError = exports.TransactionReceiptMissingBlockNumberError = exports.TransactionMissingReceiptOrBlockHashError = exports.TransactionBlockTimeoutError = exports.TransactionPollingTimeoutError = exports.TransactionSendTimeoutError = exports.TransactionDataAndInputError = exports.UnsupportedTransactionTypeError = exports.Eip1559NotSupportedError = exports.UnableToPopulateNonceError = exports.InvalidNonceOrChainIdError = exports.InvalidTransactionObjectError = exports.UnsupportedFeeMarketError = exports.Eip1559GasPriceError = exports.InvalidMaxPriorityFeePerGasOrMaxFeePerGas = exports.InvalidGasOrGasPrice = exports.TransactionGasMismatchError = exports.MissingGasError = exports.MissingChainOrHardforkError = exports.CommonOrChainAndHardforkError = exports.HardforkMismatchError = exports.ChainMismatchError = exports.ChainIdMismatchError = exports.MissingCustomChainIdError = exports.MissingCustomChainError = exports.InvalidTransactionCall = exports.InvalidTransactionWithReceiver = exports.InvalidTransactionWithSender = exports.TransactionNotFound = exports.UndefinedRawTransactionError = exports.TransactionOutOfGasError = exports.TransactionRevertedWithoutReasonError = exports.ContractCodeNotStoredError = exports.NoContractAddressFoundError = exports.TransactionRevertWithCustomError = exports.TransactionRevertInstructionError = exports.RevertInstructionError = exports.TransactionError = void 0;
const error_codes_1 = require("../error_codes");
const web3_error_base_1 = require("../web3_error_base");
class TransactionError extends web3_error_base_1.Web3Error {
class TransactionError extends web3_error_base_1.BaseWeb3Error {
constructor(message, receipt) {

@@ -17,3 +17,3 @@ super(message);

exports.TransactionError = TransactionError;
class RevertInstructionError extends web3_error_base_1.Web3Error {
class RevertInstructionError extends web3_error_base_1.BaseWeb3Error {
constructor(reason, signature) {

@@ -30,15 +30,33 @@ super(`Your request got reverted with the following reason string: ${reason}`);

exports.RevertInstructionError = RevertInstructionError;
class TransactionRevertError extends web3_error_base_1.Web3Error {
constructor(reason, signature, receipt) {
super(`Transaction has been reverted by the EVM:\n ${JSON.stringify(receipt, undefined, 2)}`);
class TransactionRevertInstructionError extends web3_error_base_1.BaseWeb3Error {
constructor(reason, signature, receipt, data) {
super(`Transaction has been reverted by the EVM${receipt === undefined ? '' : `:\n ${web3_error_base_1.BaseWeb3Error.convertToString(receipt)}`}`);
this.reason = reason;
this.signature = signature;
this.receipt = receipt;
this.data = data;
this.code = error_codes_1.ERR_TX_REVERT_TRANSACTION;
}
toJSON() {
return Object.assign(Object.assign({}, super.toJSON()), { reason: this.reason, signature: this.signature, receipt: this.receipt });
return Object.assign(Object.assign({}, super.toJSON()), { reason: this.reason, signature: this.signature, receipt: this.receipt, data: this.data });
}
}
exports.TransactionRevertError = TransactionRevertError;
exports.TransactionRevertInstructionError = TransactionRevertInstructionError;
class TransactionRevertWithCustomError extends TransactionRevertInstructionError {
constructor(reason, customErrorName, customErrorDecodedSignature, customErrorArguments, signature, receipt, data) {
super(reason);
this.reason = reason;
this.customErrorName = customErrorName;
this.customErrorDecodedSignature = customErrorDecodedSignature;
this.customErrorArguments = customErrorArguments;
this.signature = signature;
this.receipt = receipt;
this.data = data;
this.code = error_codes_1.ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR;
}
toJSON() {
return Object.assign(Object.assign({}, super.toJSON()), { reason: this.reason, customErrorName: this.customErrorName, customErrorDecodedSignature: this.customErrorDecodedSignature, customErrorArguments: this.customErrorArguments, signature: this.signature, receipt: this.receipt, data: this.data });
}
}
exports.TransactionRevertWithCustomError = TransactionRevertWithCustomError;
class NoContractAddressFoundError extends TransactionError {

@@ -63,3 +81,3 @@ constructor(receipt) {

constructor(receipt) {
super(`Transaction has been reverted by the EVM:\n ${JSON.stringify(receipt, undefined, 2)}`, receipt);
super(`Transaction has been reverted by the EVM${receipt === undefined ? '' : `:\n ${web3_error_base_1.BaseWeb3Error.convertToString(receipt)}`}`, receipt);
this.code = error_codes_1.ERR_TX_REVERT_WITHOUT_REASON;

@@ -252,3 +270,3 @@ }

exports.TransactionDataAndInputError = TransactionDataAndInputError;
class TransactionSendTimeoutError extends web3_error_base_1.Web3Error {
class TransactionSendTimeoutError extends web3_error_base_1.BaseWeb3Error {
constructor(value) {

@@ -263,3 +281,3 @@ super(`The connected Ethereum Node did not respond within ${value.numberOfSeconds} seconds, please make sure your transaction was properly sent and you are connected to a healthy Node. Be aware that transaction might still be pending or mined!\n\tTransaction Hash: ${value.transactionHash ? value.transactionHash.toString() : 'not available'}`);

}
class TransactionPollingTimeoutError extends web3_error_base_1.Web3Error {
class TransactionPollingTimeoutError extends web3_error_base_1.BaseWeb3Error {
constructor(value) {

@@ -271,3 +289,3 @@ super(`Transaction was not mined within ${value.numberOfSeconds} seconds. ${transactionTimeoutHint(value.transactionHash)}`);

exports.TransactionPollingTimeoutError = TransactionPollingTimeoutError;
class TransactionBlockTimeoutError extends web3_error_base_1.Web3Error {
class TransactionBlockTimeoutError extends web3_error_base_1.BaseWeb3Error {
constructor(value) {

@@ -294,3 +312,3 @@ super(`Transaction started at ${value.starterBlockNumber} but was not mined within ${value.numberOfBlocks} blocks. ${transactionTimeoutHint(value.transactionHash)}`);

exports.TransactionReceiptMissingBlockNumberError = TransactionReceiptMissingBlockNumberError;
class TransactionSigningError extends web3_error_base_1.Web3Error {
class TransactionSigningError extends web3_error_base_1.BaseWeb3Error {
constructor(errorDetails) {

@@ -297,0 +315,0 @@ super(`Invalid signature. "${errorDetails}"`);

@@ -14,2 +14,3 @@ export * from './error_codes';

export * from './errors/core_errors';
export * from './errors/rpc_errors';
//# sourceMappingURL=index.d.ts.map

@@ -30,2 +30,3 @@ "use strict";

__exportStar(require("./errors/core_errors"), exports);
__exportStar(require("./errors/rpc_errors"), exports);
//# sourceMappingURL=index.js.map

@@ -1,3 +0,3 @@

import { Web3Error as ErrorInterface } from 'web3-types';
export declare abstract class Web3Error extends Error implements ErrorInterface {
import { Web3Error } from 'web3-types';
export declare abstract class BaseWeb3Error extends Error implements Web3Error {
readonly name: string;

@@ -16,3 +16,3 @@ abstract readonly code: number;

}
export declare abstract class InvalidValueError extends Web3Error {
export declare abstract class InvalidValueError extends BaseWeb3Error {
readonly name: string;

@@ -19,0 +19,0 @@ constructor(value: unknown, msg: string);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvalidValueError = exports.Web3Error = void 0;
class Web3Error extends Error {
exports.InvalidValueError = exports.BaseWeb3Error = void 0;
class BaseWeb3Error extends Error {
constructor(msg, innerError) {

@@ -33,6 +33,6 @@ super(msg);

}
exports.Web3Error = Web3Error;
class InvalidValueError extends Web3Error {
exports.BaseWeb3Error = BaseWeb3Error;
class InvalidValueError extends BaseWeb3Error {
constructor(value, msg) {
super(`Invalid value given "${Web3Error.convertToString(value, true)}". Error: ${msg}.`);
super(`Invalid value given "${BaseWeb3Error.convertToString(value, true)}". Error: ${msg}.`);
this.name = this.constructor.name;

@@ -39,0 +39,0 @@ }

{
"name": "web3-errors",
"version": "0.1.1-alpha.4",
"version": "1.0.0-rc.0",
"description": "This package has web3 error classes",

@@ -9,2 +9,6 @@ "main": "lib/index.js",

"license": "LGPL-3.0",
"engines": {
"node": ">=14",
"npm": ">=6.12.0"
},
"files": [

@@ -22,3 +26,3 @@ "lib/**/*"

"test": "jest --config=./test/unit/jest.config.js",
"test:coverage": "jest --config=./test/unit/jest.config.js --coverage=true --coverage-reporters=text",
"test:coverage:unit": "jest --config=./test/unit/jest.config.js --coverage=true --coverage-reporters=text",
"test:ci": "jest --coverage=true --coverage-reporters=json --verbose",

@@ -30,3 +34,3 @@ "test:watch": "npm test -- --watch",

"dependencies": {
"web3-types": "^0.1.1-alpha.4"
"web3-types": "^1.0.0-rc.0"
},

@@ -47,3 +51,3 @@ "devDependencies": {

},
"gitHead": "ae1ae53c9192ddef32931c3cbf68c2a7e2946ec5"
"gitHead": "e7d290c6921755dde95a029dec4d98aef05d4929"
}

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

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

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

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

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