@vechain/sdk-errors
Advanced tools
Comparing version 1.0.0-beta.1 to 1.0.0-beta.2
@@ -22,3 +22,3 @@ /** | ||
*/ | ||
type DataType<ErrorCodeT extends ErrorCode> = ErrorCodeT extends RLP.INVALID_RLP ? InvalidRLPErrorData : ErrorCodeT extends HTTP_CLIENT.INVALID_HTTP_REQUEST ? HTTPClientErrorData : ErrorCodeT extends POLL_ERROR.POLL_EXECUTION_ERROR ? PollErrorData : ErrorCodeT extends EIP1193.USER_REJECTED_REQUEST ? EIP1193ProviderRpcErrorData : ErrorCodeT extends EIP1193.UNAUTHORIZED ? EIP1193ProviderRpcErrorData : ErrorCodeT extends EIP1193.UNSUPPORTED_METHOD ? EIP1193ProviderRpcErrorData : ErrorCodeT extends EIP1193.DISCONNECTED ? EIP1193ProviderRpcErrorData : ErrorCodeT extends EIP1193.CHAIN_DISCONNECTED ? EIP1193ProviderRpcErrorData : ErrorCodeT extends JSONRPC.PARSE_ERROR ? JSONRPCErrorData : ErrorCodeT extends JSONRPC.INVALID_REQUEST ? JSONRPCErrorData : ErrorCodeT extends JSONRPC.METHOD_NOT_FOUND ? JSONRPCErrorData : ErrorCodeT extends JSONRPC.INVALID_PARAMS ? JSONRPCErrorData : ErrorCodeT extends JSONRPC.INTERNAL_ERROR ? JSONRPCErrorData : DefaultErrorData; | ||
type DataType<ErrorCodeT extends ErrorCode> = ErrorCodeT extends RLP.INVALID_RLP ? InvalidRLPErrorData : ErrorCodeT extends HTTP_CLIENT.INVALID_HTTP_REQUEST ? HTTPClientErrorData : ErrorCodeT extends POLL_ERROR.POLL_EXECUTION_ERROR ? PollErrorData : ErrorCodeT extends EIP1193.USER_REJECTED_REQUEST ? EIP1193ProviderRpcErrorData : ErrorCodeT extends EIP1193.UNAUTHORIZED ? EIP1193ProviderRpcErrorData : ErrorCodeT extends EIP1193.UNSUPPORTED_METHOD ? EIP1193ProviderRpcErrorData : ErrorCodeT extends EIP1193.DISCONNECTED ? EIP1193ProviderRpcErrorData : ErrorCodeT extends EIP1193.CHAIN_DISCONNECTED ? EIP1193ProviderRpcErrorData : ErrorCodeT extends JSONRPC.INVALID_REQUEST ? JSONRPCErrorData : ErrorCodeT extends JSONRPC.INVALID_PARAMS ? JSONRPCErrorData : ErrorCodeT extends JSONRPC.INTERNAL_ERROR ? JSONRPCErrorData : DefaultErrorData; | ||
/** | ||
@@ -53,3 +53,3 @@ * Default error codes. | ||
*/ | ||
type ErrorType<ErrorCodeT> = ErrorCodeT extends SECP256K1.INVALID_SECP256k1_PRIVATE_KEY ? InvalidSecp256k1PrivateKeyError : ErrorCodeT extends SECP256K1.INVALID_SECP256k1_MESSAGE_HASH ? InvalidSecp256k1MessageHashError : ErrorCodeT extends SECP256K1.INVALID_SECP256k1_SIGNATURE ? InvalidSecp256k1SignatureError : ErrorCodeT extends SECP256K1.INVALID_SECP256k1_SIGNATURE_RECOVERY ? InvalidSecp256k1SignatureRecoveryError : ErrorCodeT extends ADDRESS.INVALID_ADDRESS ? InvalidAddressError : ErrorCodeT extends KEYSTORE.INVALID_KEYSTORE ? InvalidKeystoreError : ErrorCodeT extends KEYSTORE.INVALID_PASSWORD ? InvalidKeystorePasswordError : ErrorCodeT extends HDNODE.INVALID_HDNODE_CHAIN_CODE ? InvalidHDNodeChaincodeError : ErrorCodeT extends HDNODE.INVALID_HDNODE_MNEMONICS ? InvalidHDNodeMnemonicsError : ErrorCodeT extends HDNODE.INVALID_HDNODE_PRIVATE_KEY ? InvalidHDNodePrivateKeyError : ErrorCodeT extends HDNODE.INVALID_HDNODE_PUBLIC_KEY ? InvalidHDNodePublicKeyError : ErrorCodeT extends HDNODE.INVALID_HDNODE_DERIVATION_PATH ? InvalidHDNodeDerivationPathError : ErrorCodeT extends BLOOM.INVALID_BLOOM ? InvalidBloomError : ErrorCodeT extends BLOOM.INVALID_K ? InvalidKError : ErrorCodeT extends CERTIFICATE.CERTIFICATE_NOT_SIGNED ? CertificateNotSignedError : ErrorCodeT extends CERTIFICATE.CERTIFICATE_INVALID_SIGNATURE_FORMAT ? CertificateInvalidSignatureFormatError : ErrorCodeT extends CERTIFICATE.CERTIFICATE_INVALID_SIGNER ? CertificateInvalidSignerError : ErrorCodeT extends ABI.INVALID_EVENT ? InvalidAbiEventError : ErrorCodeT extends ABI.INVALID_DATA_TO_DECODE ? InvalidAbiDataToDecodeError : ErrorCodeT extends ABI.INVALID_DATA_TO_ENCODE ? InvalidAbiDataToEncodeError : ErrorCodeT extends ABI.INVALID_FORMAT_TYPE ? InvalidAbiFormatTypeError : ErrorCodeT extends ABI.INVALID_FUNCTION ? InvalidAbiFunctionError : ErrorCodeT extends ABI.CONTRACT_INTERFACE_ERROR ? ContractInterfaceError : ErrorCodeT extends RLP.INVALID_RLP ? InvalidRLPError : ErrorCodeT extends DATA.INVALID_DATA_TYPE ? InvalidDataTypeError : ErrorCodeT extends DATA.INVALID_DATA_RETURN_TYPE ? InvalidDataReturnTypeError : ErrorCodeT extends TRANSACTION.ALREADY_SIGNED ? TransactionAlreadySignedError : ErrorCodeT extends TRANSACTION.NOT_SIGNED ? TransactionNotSignedError : ErrorCodeT extends TRANSACTION.INVALID_TRANSACTION_BODY ? TransactionBodyError : ErrorCodeT extends TRANSACTION.INVALID_DELEGATION ? TransactionDelegationError : ErrorCodeT extends TRANSACTION.MISSING_PRIVATE_KEY ? TransactionMissingPrivateKeyError : ErrorCodeT extends HTTP_CLIENT.INVALID_HTTP_REQUEST ? HTTPClientError : ErrorCodeT extends POLL_ERROR.POLL_EXECUTION_ERROR ? PollExecutionError : ErrorCodeT extends EIP1193.USER_REJECTED_REQUEST ? EIP1193UserRejectedRequest : ErrorCodeT extends EIP1193.UNAUTHORIZED ? EIP1193Unauthorized : ErrorCodeT extends EIP1193.UNSUPPORTED_METHOD ? EIP1193UnsupportedMethod : ErrorCodeT extends EIP1193.DISCONNECTED ? EIP1193Disconnected : ErrorCodeT extends EIP1193.CHAIN_DISCONNECTED ? EIP1193ChainDisconnected : ErrorCodeT extends FUNCTION.NOT_IMPLEMENTED ? NotImplementedError : ErrorCodeT extends JSONRPC.PARSE_ERROR ? JSONRPCParseError : ErrorCodeT extends JSONRPC.INVALID_REQUEST ? JSONRPCInvalidRequest : ErrorCodeT extends JSONRPC.METHOD_NOT_FOUND ? JSONRPCMethodNotFound : ErrorCodeT extends JSONRPC.INVALID_PARAMS ? JSONRPCInvalidParams : ErrorCodeT extends JSONRPC.INTERNAL_ERROR ? JSONRPCInternalError : ErrorCodeT extends JSONRPC.DEFAULT ? JSONRPCDefaultError : ErrorCodeT extends CONTRACT.CONTRACT_DEPLOYMENT_FAILED ? ContractDeploymentFailedError : never; | ||
type ErrorType<ErrorCodeT> = ErrorCodeT extends SECP256K1.INVALID_SECP256k1_PRIVATE_KEY ? InvalidSecp256k1PrivateKeyError : ErrorCodeT extends SECP256K1.INVALID_SECP256k1_MESSAGE_HASH ? InvalidSecp256k1MessageHashError : ErrorCodeT extends SECP256K1.INVALID_SECP256k1_SIGNATURE ? InvalidSecp256k1SignatureError : ErrorCodeT extends SECP256K1.INVALID_SECP256k1_SIGNATURE_RECOVERY ? InvalidSecp256k1SignatureRecoveryError : ErrorCodeT extends ADDRESS.INVALID_ADDRESS ? InvalidAddressError : ErrorCodeT extends KEYSTORE.INVALID_KEYSTORE ? InvalidKeystoreError : ErrorCodeT extends KEYSTORE.INVALID_PASSWORD ? InvalidKeystorePasswordError : ErrorCodeT extends HDNODE.INVALID_HDNODE_CHAIN_CODE ? InvalidHDNodeChaincodeError : ErrorCodeT extends HDNODE.INVALID_HDNODE_MNEMONICS ? InvalidHDNodeMnemonicsError : ErrorCodeT extends HDNODE.INVALID_HDNODE_PRIVATE_KEY ? InvalidHDNodePrivateKeyError : ErrorCodeT extends HDNODE.INVALID_HDNODE_PUBLIC_KEY ? InvalidHDNodePublicKeyError : ErrorCodeT extends HDNODE.INVALID_HDNODE_DERIVATION_PATH ? InvalidHDNodeDerivationPathError : ErrorCodeT extends BLOOM.INVALID_BLOOM ? InvalidBloomError : ErrorCodeT extends BLOOM.INVALID_K ? InvalidKError : ErrorCodeT extends CERTIFICATE.CERTIFICATE_NOT_SIGNED ? CertificateNotSignedError : ErrorCodeT extends CERTIFICATE.CERTIFICATE_INVALID_SIGNATURE_FORMAT ? CertificateInvalidSignatureFormatError : ErrorCodeT extends CERTIFICATE.CERTIFICATE_INVALID_SIGNER ? CertificateInvalidSignerError : ErrorCodeT extends ABI.INVALID_EVENT ? InvalidAbiEventError : ErrorCodeT extends ABI.INVALID_DATA_TO_DECODE ? InvalidAbiDataToDecodeError : ErrorCodeT extends ABI.INVALID_DATA_TO_ENCODE ? InvalidAbiDataToEncodeError : ErrorCodeT extends ABI.INVALID_FORMAT_TYPE ? InvalidAbiFormatTypeError : ErrorCodeT extends ABI.INVALID_FUNCTION ? InvalidAbiFunctionError : ErrorCodeT extends ABI.CONTRACT_INTERFACE_ERROR ? ContractInterfaceError : ErrorCodeT extends RLP.INVALID_RLP ? InvalidRLPError : ErrorCodeT extends DATA.INVALID_DATA_TYPE ? InvalidDataTypeError : ErrorCodeT extends DATA.INVALID_DATA_RETURN_TYPE ? InvalidDataReturnTypeError : ErrorCodeT extends TRANSACTION.ALREADY_SIGNED ? TransactionAlreadySignedError : ErrorCodeT extends TRANSACTION.NOT_SIGNED ? TransactionNotSignedError : ErrorCodeT extends TRANSACTION.INVALID_TRANSACTION_BODY ? TransactionBodyError : ErrorCodeT extends TRANSACTION.INVALID_DELEGATION ? TransactionDelegationError : ErrorCodeT extends TRANSACTION.MISSING_PRIVATE_KEY ? TransactionMissingPrivateKeyError : ErrorCodeT extends HTTP_CLIENT.INVALID_HTTP_REQUEST ? HTTPClientError : ErrorCodeT extends POLL_ERROR.POLL_EXECUTION_ERROR ? PollExecutionError : ErrorCodeT extends EIP1193.USER_REJECTED_REQUEST ? EIP1193UserRejectedRequest : ErrorCodeT extends EIP1193.UNAUTHORIZED ? EIP1193Unauthorized : ErrorCodeT extends EIP1193.UNSUPPORTED_METHOD ? EIP1193UnsupportedMethod : ErrorCodeT extends EIP1193.DISCONNECTED ? EIP1193Disconnected : ErrorCodeT extends EIP1193.CHAIN_DISCONNECTED ? EIP1193ChainDisconnected : ErrorCodeT extends FUNCTION.NOT_IMPLEMENTED ? NotImplementedError : ErrorCodeT extends JSONRPC.INVALID_REQUEST ? JSONRPCInvalidRequest : ErrorCodeT extends JSONRPC.INVALID_PARAMS ? JSONRPCInvalidParams : ErrorCodeT extends JSONRPC.INTERNAL_ERROR ? JSONRPCInternalError : ErrorCodeT extends JSONRPC.DEFAULT ? JSONRPCDefaultError : ErrorCodeT extends CONTRACT.CONTRACT_DEPLOYMENT_FAILED ? ContractDeploymentFailedError : never; | ||
/** | ||
@@ -506,7 +506,2 @@ * Map to get the error class from the error code. | ||
/** | ||
* Invalid JSON | ||
*/ | ||
declare class JSONRPCParseError extends ErrorBase<JSONRPC.PARSE_ERROR, JSONRPCErrorData> { | ||
} | ||
/** | ||
* JSON is not a valid request object | ||
@@ -517,7 +512,2 @@ */ | ||
/** | ||
* Method does not exist | ||
*/ | ||
declare class JSONRPCMethodNotFound extends ErrorBase<JSONRPC.METHOD_NOT_FOUND, JSONRPCErrorData> { | ||
} | ||
/** | ||
* Invalid method parameters | ||
@@ -545,5 +535,3 @@ */ | ||
declare enum JSONRPC { | ||
PARSE_ERROR = "PARSE_ERROR", | ||
INVALID_REQUEST = "INVALID_REQUEST", | ||
METHOD_NOT_FOUND = "METHOD_NOT_FOUND", | ||
INVALID_PARAMS = "INVALID_PARAMS", | ||
@@ -556,3 +544,3 @@ INTERNAL_ERROR = "INTERNAL_ERROR", | ||
*/ | ||
declare const getJSONRPCErrorCode: (error: JSONRPC) => -32700 | -32600 | -32601 | -32602 | -32603 | -32000; | ||
declare const getJSONRPCErrorCode: (error: JSONRPC) => -32600 | -32602 | -32603 | -32000; | ||
@@ -756,6 +744,2 @@ /** | ||
declare const errors_JSONRPCInvalidRequest: typeof JSONRPCInvalidRequest; | ||
type errors_JSONRPCMethodNotFound = JSONRPCMethodNotFound; | ||
declare const errors_JSONRPCMethodNotFound: typeof JSONRPCMethodNotFound; | ||
type errors_JSONRPCParseError = JSONRPCParseError; | ||
declare const errors_JSONRPCParseError: typeof JSONRPCParseError; | ||
type errors_KEYSTORE = KEYSTORE; | ||
@@ -797,5 +781,5 @@ declare const errors_KEYSTORE: typeof KEYSTORE; | ||
declare namespace errors { | ||
export { errors_ABI as ABI, errors_ADDRESS as ADDRESS, errors_BLOOM as BLOOM, errors_CERTIFICATE as CERTIFICATE, errors_CONTRACT as CONTRACT, errors_CertificateInvalidSignatureFormatError as CertificateInvalidSignatureFormatError, errors_CertificateInvalidSignerError as CertificateInvalidSignerError, errors_CertificateNotSignedError as CertificateNotSignedError, errors_ContractDeploymentFailedError as ContractDeploymentFailedError, errors_ContractInterfaceError as ContractInterfaceError, errors_DATA as DATA, type errors_DataType as DataType, type errors_DefaultErrorData as DefaultErrorData, errors_EIP1193 as EIP1193, errors_EIP1193ChainDisconnected as EIP1193ChainDisconnected, errors_EIP1193Disconnected as EIP1193Disconnected, type errors_EIP1193ProviderRpcErrorData as EIP1193ProviderRpcErrorData, errors_EIP1193Unauthorized as EIP1193Unauthorized, errors_EIP1193UnsupportedMethod as EIP1193UnsupportedMethod, errors_EIP1193UserRejectedRequest as EIP1193UserRejectedRequest, errors_ERROR_CODES as ERROR_CODES, errors_ErrorBase as ErrorBase, errors_ErrorClassMap as ErrorClassMap, type errors_ErrorCode as ErrorCode, type errors_ErrorType as ErrorType, errors_FUNCTION as FUNCTION, errors_HDNODE as HDNODE, errors_HTTPClientError as HTTPClientError, type errors_HTTPClientErrorData as HTTPClientErrorData, errors_HTTP_CLIENT as HTTP_CLIENT, errors_InvalidAbiDataToDecodeError as InvalidAbiDataToDecodeError, errors_InvalidAbiDataToEncodeError as InvalidAbiDataToEncodeError, errors_InvalidAbiEventError as InvalidAbiEventError, errors_InvalidAbiFormatTypeError as InvalidAbiFormatTypeError, errors_InvalidAbiFunctionError as InvalidAbiFunctionError, errors_InvalidAddressError as InvalidAddressError, errors_InvalidBloomError as InvalidBloomError, errors_InvalidDataReturnTypeError as InvalidDataReturnTypeError, errors_InvalidDataTypeError as InvalidDataTypeError, errors_InvalidHDNodeChaincodeError as InvalidHDNodeChaincodeError, errors_InvalidHDNodeDerivationPathError as InvalidHDNodeDerivationPathError, errors_InvalidHDNodeMnemonicsError as InvalidHDNodeMnemonicsError, errors_InvalidHDNodePrivateKeyError as InvalidHDNodePrivateKeyError, errors_InvalidHDNodePublicKeyError as InvalidHDNodePublicKeyError, errors_InvalidKError as InvalidKError, errors_InvalidKeystoreError as InvalidKeystoreError, errors_InvalidKeystorePasswordError as InvalidKeystorePasswordError, errors_InvalidRLPError as InvalidRLPError, type errors_InvalidRLPErrorData as InvalidRLPErrorData, errors_InvalidSecp256k1MessageHashError as InvalidSecp256k1MessageHashError, errors_InvalidSecp256k1PrivateKeyError as InvalidSecp256k1PrivateKeyError, errors_InvalidSecp256k1SignatureError as InvalidSecp256k1SignatureError, errors_InvalidSecp256k1SignatureRecoveryError as InvalidSecp256k1SignatureRecoveryError, errors_JSONRPC as JSONRPC, errors_JSONRPCDefaultError as JSONRPCDefaultError, type errors_JSONRPCErrorData as JSONRPCErrorData, errors_JSONRPCInternalError as JSONRPCInternalError, errors_JSONRPCInvalidParams as JSONRPCInvalidParams, errors_JSONRPCInvalidRequest as JSONRPCInvalidRequest, errors_JSONRPCMethodNotFound as JSONRPCMethodNotFound, errors_JSONRPCParseError as JSONRPCParseError, errors_KEYSTORE as KEYSTORE, errors_NotImplementedError as NotImplementedError, errors_POLL_ERROR as POLL_ERROR, type errors_PollErrorData as PollErrorData, errors_PollExecutionError as PollExecutionError, errors_ProviderRpcError as ProviderRpcError, errors_RLP as RLP, errors_SECP256K1 as SECP256K1, errors_TRANSACTION as TRANSACTION, errors_TransactionAlreadySignedError as TransactionAlreadySignedError, errors_TransactionBodyError as TransactionBodyError, errors_TransactionDelegationError as TransactionDelegationError, errors_TransactionMissingPrivateKeyError as TransactionMissingPrivateKeyError, errors_TransactionNotSignedError as TransactionNotSignedError, errors_assert as assert, errors_assertInnerError as assertInnerError, errors_buildError as buildError, errors_buildErrorMessage as buildErrorMessage, errors_buildProviderError as buildProviderError, errors_getEIP1193ErrorCode as getEIP1193ErrorCode, errors_getJSONRPCErrorCode as getJSONRPCErrorCode, errors_stringifyData as stringifyData }; | ||
export { errors_ABI as ABI, errors_ADDRESS as ADDRESS, errors_BLOOM as BLOOM, errors_CERTIFICATE as CERTIFICATE, errors_CONTRACT as CONTRACT, errors_CertificateInvalidSignatureFormatError as CertificateInvalidSignatureFormatError, errors_CertificateInvalidSignerError as CertificateInvalidSignerError, errors_CertificateNotSignedError as CertificateNotSignedError, errors_ContractDeploymentFailedError as ContractDeploymentFailedError, errors_ContractInterfaceError as ContractInterfaceError, errors_DATA as DATA, type errors_DataType as DataType, type errors_DefaultErrorData as DefaultErrorData, errors_EIP1193 as EIP1193, errors_EIP1193ChainDisconnected as EIP1193ChainDisconnected, errors_EIP1193Disconnected as EIP1193Disconnected, type errors_EIP1193ProviderRpcErrorData as EIP1193ProviderRpcErrorData, errors_EIP1193Unauthorized as EIP1193Unauthorized, errors_EIP1193UnsupportedMethod as EIP1193UnsupportedMethod, errors_EIP1193UserRejectedRequest as EIP1193UserRejectedRequest, errors_ERROR_CODES as ERROR_CODES, errors_ErrorBase as ErrorBase, errors_ErrorClassMap as ErrorClassMap, type errors_ErrorCode as ErrorCode, type errors_ErrorType as ErrorType, errors_FUNCTION as FUNCTION, errors_HDNODE as HDNODE, errors_HTTPClientError as HTTPClientError, type errors_HTTPClientErrorData as HTTPClientErrorData, errors_HTTP_CLIENT as HTTP_CLIENT, errors_InvalidAbiDataToDecodeError as InvalidAbiDataToDecodeError, errors_InvalidAbiDataToEncodeError as InvalidAbiDataToEncodeError, errors_InvalidAbiEventError as InvalidAbiEventError, errors_InvalidAbiFormatTypeError as InvalidAbiFormatTypeError, errors_InvalidAbiFunctionError as InvalidAbiFunctionError, errors_InvalidAddressError as InvalidAddressError, errors_InvalidBloomError as InvalidBloomError, errors_InvalidDataReturnTypeError as InvalidDataReturnTypeError, errors_InvalidDataTypeError as InvalidDataTypeError, errors_InvalidHDNodeChaincodeError as InvalidHDNodeChaincodeError, errors_InvalidHDNodeDerivationPathError as InvalidHDNodeDerivationPathError, errors_InvalidHDNodeMnemonicsError as InvalidHDNodeMnemonicsError, errors_InvalidHDNodePrivateKeyError as InvalidHDNodePrivateKeyError, errors_InvalidHDNodePublicKeyError as InvalidHDNodePublicKeyError, errors_InvalidKError as InvalidKError, errors_InvalidKeystoreError as InvalidKeystoreError, errors_InvalidKeystorePasswordError as InvalidKeystorePasswordError, errors_InvalidRLPError as InvalidRLPError, type errors_InvalidRLPErrorData as InvalidRLPErrorData, errors_InvalidSecp256k1MessageHashError as InvalidSecp256k1MessageHashError, errors_InvalidSecp256k1PrivateKeyError as InvalidSecp256k1PrivateKeyError, errors_InvalidSecp256k1SignatureError as InvalidSecp256k1SignatureError, errors_InvalidSecp256k1SignatureRecoveryError as InvalidSecp256k1SignatureRecoveryError, errors_JSONRPC as JSONRPC, errors_JSONRPCDefaultError as JSONRPCDefaultError, type errors_JSONRPCErrorData as JSONRPCErrorData, errors_JSONRPCInternalError as JSONRPCInternalError, errors_JSONRPCInvalidParams as JSONRPCInvalidParams, errors_JSONRPCInvalidRequest as JSONRPCInvalidRequest, errors_KEYSTORE as KEYSTORE, errors_NotImplementedError as NotImplementedError, errors_POLL_ERROR as POLL_ERROR, type errors_PollErrorData as PollErrorData, errors_PollExecutionError as PollExecutionError, errors_ProviderRpcError as ProviderRpcError, errors_RLP as RLP, errors_SECP256K1 as SECP256K1, errors_TRANSACTION as TRANSACTION, errors_TransactionAlreadySignedError as TransactionAlreadySignedError, errors_TransactionBodyError as TransactionBodyError, errors_TransactionDelegationError as TransactionDelegationError, errors_TransactionMissingPrivateKeyError as TransactionMissingPrivateKeyError, errors_TransactionNotSignedError as TransactionNotSignedError, errors_assert as assert, errors_assertInnerError as assertInnerError, errors_buildError as buildError, errors_buildErrorMessage as buildErrorMessage, errors_buildProviderError as buildProviderError, errors_getEIP1193ErrorCode as getEIP1193ErrorCode, errors_getJSONRPCErrorCode as getJSONRPCErrorCode, errors_stringifyData as stringifyData }; | ||
} | ||
export { ABI, ADDRESS, BLOOM, CERTIFICATE, CONTRACT, CertificateInvalidSignatureFormatError, CertificateInvalidSignerError, CertificateNotSignedError, ContractDeploymentFailedError, ContractInterfaceError, DATA, type DataType, type DefaultErrorData, EIP1193, EIP1193ChainDisconnected, EIP1193Disconnected, type EIP1193ProviderRpcErrorData, EIP1193Unauthorized, EIP1193UnsupportedMethod, EIP1193UserRejectedRequest, ERROR_CODES, ErrorBase, ErrorClassMap, type ErrorCode, type ErrorType, FUNCTION, HDNODE, HTTPClientError, type HTTPClientErrorData, HTTP_CLIENT, InvalidAbiDataToDecodeError, InvalidAbiDataToEncodeError, InvalidAbiEventError, InvalidAbiFormatTypeError, InvalidAbiFunctionError, InvalidAddressError, InvalidBloomError, InvalidDataReturnTypeError, InvalidDataTypeError, InvalidHDNodeChaincodeError, InvalidHDNodeDerivationPathError, InvalidHDNodeMnemonicsError, InvalidHDNodePrivateKeyError, InvalidHDNodePublicKeyError, InvalidKError, InvalidKeystoreError, InvalidKeystorePasswordError, InvalidRLPError, type InvalidRLPErrorData, InvalidSecp256k1MessageHashError, InvalidSecp256k1PrivateKeyError, InvalidSecp256k1SignatureError, InvalidSecp256k1SignatureRecoveryError, JSONRPC, JSONRPCDefaultError, type JSONRPCErrorData, JSONRPCInternalError, JSONRPCInvalidParams, JSONRPCInvalidRequest, JSONRPCMethodNotFound, JSONRPCParseError, KEYSTORE, NotImplementedError, POLL_ERROR, type PollErrorData, PollExecutionError, ProviderRpcError, RLP, SECP256K1, TRANSACTION, TransactionAlreadySignedError, TransactionBodyError, TransactionDelegationError, TransactionMissingPrivateKeyError, TransactionNotSignedError, assert, assertInnerError, buildError, buildErrorMessage, buildProviderError, errors, getEIP1193ErrorCode, getJSONRPCErrorCode, stringifyData }; | ||
export { ABI, ADDRESS, BLOOM, CERTIFICATE, CONTRACT, CertificateInvalidSignatureFormatError, CertificateInvalidSignerError, CertificateNotSignedError, ContractDeploymentFailedError, ContractInterfaceError, DATA, type DataType, type DefaultErrorData, EIP1193, EIP1193ChainDisconnected, EIP1193Disconnected, type EIP1193ProviderRpcErrorData, EIP1193Unauthorized, EIP1193UnsupportedMethod, EIP1193UserRejectedRequest, ERROR_CODES, ErrorBase, ErrorClassMap, type ErrorCode, type ErrorType, FUNCTION, HDNODE, HTTPClientError, type HTTPClientErrorData, HTTP_CLIENT, InvalidAbiDataToDecodeError, InvalidAbiDataToEncodeError, InvalidAbiEventError, InvalidAbiFormatTypeError, InvalidAbiFunctionError, InvalidAddressError, InvalidBloomError, InvalidDataReturnTypeError, InvalidDataTypeError, InvalidHDNodeChaincodeError, InvalidHDNodeDerivationPathError, InvalidHDNodeMnemonicsError, InvalidHDNodePrivateKeyError, InvalidHDNodePublicKeyError, InvalidKError, InvalidKeystoreError, InvalidKeystorePasswordError, InvalidRLPError, type InvalidRLPErrorData, InvalidSecp256k1MessageHashError, InvalidSecp256k1PrivateKeyError, InvalidSecp256k1SignatureError, InvalidSecp256k1SignatureRecoveryError, JSONRPC, JSONRPCDefaultError, type JSONRPCErrorData, JSONRPCInternalError, JSONRPCInvalidParams, JSONRPCInvalidRequest, KEYSTORE, NotImplementedError, POLL_ERROR, type PollErrorData, PollExecutionError, ProviderRpcError, RLP, SECP256K1, TRANSACTION, TransactionAlreadySignedError, TransactionBodyError, TransactionDelegationError, TransactionMissingPrivateKeyError, TransactionNotSignedError, assert, assertInnerError, buildError, buildErrorMessage, buildProviderError, errors, getEIP1193ErrorCode, getJSONRPCErrorCode, stringifyData }; |
@@ -74,4 +74,2 @@ "use strict"; | ||
JSONRPCInvalidRequest: () => JSONRPCInvalidRequest, | ||
JSONRPCMethodNotFound: () => JSONRPCMethodNotFound, | ||
JSONRPCParseError: () => JSONRPCParseError, | ||
KEYSTORE: () => KEYSTORE, | ||
@@ -156,4 +154,2 @@ NotImplementedError: () => NotImplementedError, | ||
JSONRPCInvalidRequest: () => JSONRPCInvalidRequest, | ||
JSONRPCMethodNotFound: () => JSONRPCMethodNotFound, | ||
JSONRPCParseError: () => JSONRPCParseError, | ||
KEYSTORE: () => KEYSTORE, | ||
@@ -412,8 +408,4 @@ NotImplementedError: () => NotImplementedError, | ||
// src/model/json-rpc/json-rpc.ts | ||
var JSONRPCParseError = class extends ErrorBase { | ||
}; | ||
var JSONRPCInvalidRequest = class extends ErrorBase { | ||
}; | ||
var JSONRPCMethodNotFound = class extends ErrorBase { | ||
}; | ||
var JSONRPCInvalidParams = class extends ErrorBase { | ||
@@ -426,5 +418,3 @@ }; | ||
var JSONRPC = /* @__PURE__ */ ((JSONRPC2) => { | ||
JSONRPC2["PARSE_ERROR"] = "PARSE_ERROR"; | ||
JSONRPC2["INVALID_REQUEST"] = "INVALID_REQUEST"; | ||
JSONRPC2["METHOD_NOT_FOUND"] = "METHOD_NOT_FOUND"; | ||
JSONRPC2["INVALID_PARAMS"] = "INVALID_PARAMS"; | ||
@@ -437,8 +427,4 @@ JSONRPC2["INTERNAL_ERROR"] = "INTERNAL_ERROR"; | ||
switch (error) { | ||
case "PARSE_ERROR" /* PARSE_ERROR */: | ||
return -32700; | ||
case "INVALID_REQUEST" /* INVALID_REQUEST */: | ||
return -32600; | ||
case "METHOD_NOT_FOUND" /* METHOD_NOT_FOUND */: | ||
return -32601; | ||
case "INVALID_PARAMS" /* INVALID_PARAMS */: | ||
@@ -561,5 +547,3 @@ return -32602; | ||
// JSONRPC | ||
["PARSE_ERROR" /* PARSE_ERROR */, JSONRPCParseError], | ||
["INVALID_REQUEST" /* INVALID_REQUEST */, JSONRPCInvalidRequest], | ||
["METHOD_NOT_FOUND" /* METHOD_NOT_FOUND */, JSONRPCMethodNotFound], | ||
["INVALID_PARAMS" /* INVALID_PARAMS */, JSONRPCInvalidParams], | ||
@@ -705,4 +689,2 @@ ["INTERNAL_ERROR" /* INTERNAL_ERROR */, JSONRPCInternalError], | ||
JSONRPCInvalidRequest, | ||
JSONRPCMethodNotFound, | ||
JSONRPCParseError, | ||
KEYSTORE, | ||
@@ -709,0 +691,0 @@ NotImplementedError, |
{ | ||
"name": "@vechain/sdk-errors", | ||
"version": "1.0.0-beta.1", | ||
"version": "1.0.0-beta.2", | ||
"description": "This module is dedicated to managing and customizing errors within the SDK", | ||
@@ -5,0 +5,0 @@ "author": "vechain Foundation", |
@@ -22,10 +22,2 @@ /** | ||
/** | ||
* Invalid JSON | ||
*/ | ||
class JSONRPCParseError extends ErrorBase< | ||
JSONRPC.PARSE_ERROR, | ||
JSONRPCErrorData | ||
> {} | ||
/** | ||
* JSON is not a valid request object | ||
@@ -39,10 +31,2 @@ */ | ||
/** | ||
* Method does not exist | ||
*/ | ||
class JSONRPCMethodNotFound extends ErrorBase< | ||
JSONRPC.METHOD_NOT_FOUND, | ||
JSONRPCErrorData | ||
> {} | ||
/** | ||
* Invalid method parameters | ||
@@ -80,5 +64,3 @@ */ | ||
// Standard errors | ||
PARSE_ERROR = 'PARSE_ERROR', | ||
INVALID_REQUEST = 'INVALID_REQUEST', | ||
METHOD_NOT_FOUND = 'METHOD_NOT_FOUND', | ||
INVALID_PARAMS = 'INVALID_PARAMS', | ||
@@ -96,10 +78,6 @@ INTERNAL_ERROR = 'INTERNAL_ERROR', | ||
error: JSONRPC | ||
): -32700 | -32600 | -32601 | -32602 | -32603 | -32000 => { | ||
): -32600 | -32602 | -32603 | -32000 => { | ||
switch (error) { | ||
case JSONRPC.PARSE_ERROR: | ||
return -32700; | ||
case JSONRPC.INVALID_REQUEST: | ||
return -32600; | ||
case JSONRPC.METHOD_NOT_FOUND: | ||
return -32601; | ||
case JSONRPC.INVALID_PARAMS: | ||
@@ -116,5 +94,3 @@ return -32602; | ||
type JSONRPCErrorData, | ||
JSONRPCParseError, | ||
JSONRPCInvalidRequest, | ||
JSONRPCMethodNotFound, | ||
JSONRPCInvalidParams, | ||
@@ -121,0 +97,0 @@ JSONRPCInternalError, |
@@ -53,4 +53,2 @@ import { | ||
JSONRPCInvalidRequest, | ||
JSONRPCMethodNotFound, | ||
JSONRPCParseError, | ||
KEYSTORE, | ||
@@ -132,14 +130,10 @@ NotImplementedError, | ||
: // JSONRPC | ||
ErrorCodeT extends JSONRPC.PARSE_ERROR | ||
ErrorCodeT extends JSONRPC.INVALID_REQUEST | ||
? JSONRPCErrorData | ||
: ErrorCodeT extends JSONRPC.INVALID_REQUEST | ||
: ErrorCodeT extends JSONRPC.INVALID_PARAMS | ||
? JSONRPCErrorData | ||
: ErrorCodeT extends JSONRPC.METHOD_NOT_FOUND | ||
: ErrorCodeT extends JSONRPC.INTERNAL_ERROR | ||
? JSONRPCErrorData | ||
: ErrorCodeT extends JSONRPC.INVALID_PARAMS | ||
? JSONRPCErrorData | ||
: ErrorCodeT extends JSONRPC.INTERNAL_ERROR | ||
? JSONRPCErrorData | ||
: // DEFAULT | ||
DefaultErrorData; | ||
: // DEFAULT | ||
DefaultErrorData; | ||
@@ -270,17 +264,13 @@ /** | ||
: // JSONRPC | ||
ErrorCodeT extends JSONRPC.PARSE_ERROR | ||
? JSONRPCParseError | ||
: ErrorCodeT extends JSONRPC.INVALID_REQUEST | ||
? JSONRPCInvalidRequest | ||
: ErrorCodeT extends JSONRPC.METHOD_NOT_FOUND | ||
? JSONRPCMethodNotFound | ||
: ErrorCodeT extends JSONRPC.INVALID_PARAMS | ||
? JSONRPCInvalidParams | ||
: ErrorCodeT extends JSONRPC.INTERNAL_ERROR | ||
? JSONRPCInternalError | ||
: ErrorCodeT extends JSONRPC.DEFAULT | ||
? JSONRPCDefaultError | ||
: ErrorCodeT extends CONTRACT.CONTRACT_DEPLOYMENT_FAILED | ||
? ContractDeploymentFailedError | ||
: never; | ||
ErrorCodeT extends JSONRPC.INVALID_REQUEST | ||
? JSONRPCInvalidRequest | ||
: ErrorCodeT extends JSONRPC.INVALID_PARAMS | ||
? JSONRPCInvalidParams | ||
: ErrorCodeT extends JSONRPC.INTERNAL_ERROR | ||
? JSONRPCInternalError | ||
: ErrorCodeT extends JSONRPC.DEFAULT | ||
? JSONRPCDefaultError | ||
: ErrorCodeT extends CONTRACT.CONTRACT_DEPLOYMENT_FAILED | ||
? ContractDeploymentFailedError | ||
: never; | ||
@@ -372,5 +362,3 @@ /** | ||
// JSONRPC | ||
[JSONRPC.PARSE_ERROR, JSONRPCParseError], | ||
[JSONRPC.INVALID_REQUEST, JSONRPCInvalidRequest], | ||
[JSONRPC.METHOD_NOT_FOUND, JSONRPCMethodNotFound], | ||
[JSONRPC.INVALID_PARAMS, JSONRPCInvalidParams], | ||
@@ -377,0 +365,0 @@ [JSONRPC.INTERNAL_ERROR, JSONRPCInternalError], |
@@ -13,3 +13,3 @@ import type { DataType, ErrorCode } from '../../types'; | ||
/** | ||
* Function to avoid circular references when stringifying data. | ||
* Function to avoid circular references when stringify data. | ||
*/ | ||
@@ -16,0 +16,0 @@ const getCircularReplacer = (): (( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
171085
3351