viem 0.3.0-main.20230412T014704 → 0.3.0-main.20230412T014743
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/errors/base.js +27 -21
- package/dist/cjs/errors/base.js.map +1 -1
- package/dist/cjs/errors/index.js +27 -23
- package/dist/cjs/errors/index.js.map +1 -1
- package/dist/cjs/errors/request.js +50 -259
- package/dist/cjs/errors/request.js.map +1 -1
- package/dist/cjs/errors/rpc.js +271 -50
- package/dist/cjs/errors/rpc.js.map +1 -1
- package/dist/cjs/errors/version.js +1 -1
- package/dist/cjs/index.js +9 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/buildRequest.js +12 -2
- package/dist/cjs/utils/buildRequest.js.map +1 -1
- package/dist/cjs/utils/errors/getNodeError.js +28 -27
- package/dist/cjs/utils/errors/getNodeError.js.map +1 -1
- package/dist/cjs/utils/rpc.js +3 -3
- package/dist/cjs/utils/rpc.js.map +1 -1
- package/dist/esm/errors/base.js +27 -21
- package/dist/esm/errors/base.js.map +1 -1
- package/dist/esm/errors/index.js +4 -4
- package/dist/esm/errors/index.js.map +1 -1
- package/dist/esm/errors/request.js +45 -241
- package/dist/esm/errors/request.js.map +1 -1
- package/dist/esm/errors/rpc.js +249 -45
- package/dist/esm/errors/rpc.js.map +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/buildRequest.js +12 -2
- package/dist/esm/utils/buildRequest.js.map +1 -1
- package/dist/esm/utils/errors/getNodeError.js +3 -2
- package/dist/esm/utils/errors/getNodeError.js.map +1 -1
- package/dist/esm/utils/rpc.js +4 -4
- package/dist/esm/utils/rpc.js.map +1 -1
- package/dist/types/errors/base.d.ts +1 -0
- package/dist/types/errors/base.d.ts.map +1 -1
- package/dist/types/errors/index.d.ts +4 -4
- package/dist/types/errors/index.d.ts.map +1 -1
- package/dist/types/errors/request.d.ts +42 -80
- package/dist/types/errors/request.d.ts.map +1 -1
- package/dist/types/errors/rpc.d.ts +189 -43
- package/dist/types/errors/rpc.d.ts.map +1 -1
- package/dist/types/errors/version.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/buildRequest.d.ts.map +1 -1
- package/dist/types/utils/errors/getNodeError.d.ts +1 -1
- package/dist/types/utils/errors/getNodeError.d.ts.map +1 -1
- package/dist/types/utils/rpc.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/errors/base.ts +6 -4
- package/src/errors/index.ts +15 -11
- package/src/errors/request.ts +82 -175
- package/src/errors/rpc.ts +355 -89
- package/src/errors/version.ts +1 -1
- package/src/index.ts +5 -1
- package/src/utils/buildRequest.ts +13 -2
- package/src/utils/errors/getNodeError.ts +2 -3
- package/src/utils/rpc.ts +6 -4
package/dist/cjs/errors/base.js
CHANGED
|
@@ -4,27 +4,7 @@ exports.BaseError = void 0;
|
|
|
4
4
|
const utils_js_1 = require("./utils.js");
|
|
5
5
|
class BaseError extends Error {
|
|
6
6
|
constructor(shortMessage, args = {}) {
|
|
7
|
-
|
|
8
|
-
? args.cause.details
|
|
9
|
-
: args.cause?.message
|
|
10
|
-
? args.cause.message
|
|
11
|
-
: args.details;
|
|
12
|
-
const docsPath = args.cause instanceof BaseError
|
|
13
|
-
? args.cause.docsPath || args.docsPath
|
|
14
|
-
: args.docsPath;
|
|
15
|
-
const message = [
|
|
16
|
-
shortMessage || 'An error occurred.',
|
|
17
|
-
'',
|
|
18
|
-
...(args.metaMessages ? [...args.metaMessages, ''] : []),
|
|
19
|
-
...(docsPath
|
|
20
|
-
? [
|
|
21
|
-
`Docs: https://viem.sh${docsPath}.html${args.docsSlug ? `#${args.docsSlug}` : ''}`,
|
|
22
|
-
]
|
|
23
|
-
: []),
|
|
24
|
-
...(details ? [`Details: ${details}`] : []),
|
|
25
|
-
`Version: ${(0, utils_js_1.getVersion)()}`,
|
|
26
|
-
].join('\n');
|
|
27
|
-
super(message);
|
|
7
|
+
super();
|
|
28
8
|
Object.defineProperty(this, "details", {
|
|
29
9
|
enumerable: true,
|
|
30
10
|
configurable: true,
|
|
@@ -55,6 +35,32 @@ class BaseError extends Error {
|
|
|
55
35
|
writable: true,
|
|
56
36
|
value: 'ViemError'
|
|
57
37
|
});
|
|
38
|
+
Object.defineProperty(this, "version", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
configurable: true,
|
|
41
|
+
writable: true,
|
|
42
|
+
value: (0, utils_js_1.getVersion)()
|
|
43
|
+
});
|
|
44
|
+
const details = args.cause instanceof BaseError
|
|
45
|
+
? args.cause.details
|
|
46
|
+
: args.cause?.message
|
|
47
|
+
? args.cause.message
|
|
48
|
+
: args.details;
|
|
49
|
+
const docsPath = args.cause instanceof BaseError
|
|
50
|
+
? args.cause.docsPath || args.docsPath
|
|
51
|
+
: args.docsPath;
|
|
52
|
+
this.message = [
|
|
53
|
+
shortMessage || 'An error occurred.',
|
|
54
|
+
'',
|
|
55
|
+
...(args.metaMessages ? [...args.metaMessages, ''] : []),
|
|
56
|
+
...(docsPath
|
|
57
|
+
? [
|
|
58
|
+
`Docs: https://viem.sh${docsPath}.html${args.docsSlug ? `#${args.docsSlug}` : ''}`,
|
|
59
|
+
]
|
|
60
|
+
: []),
|
|
61
|
+
...(details ? [`Details: ${details}`] : []),
|
|
62
|
+
`Version: ${this.version}`,
|
|
63
|
+
].join('\n');
|
|
58
64
|
if (args.cause)
|
|
59
65
|
this.cause = args.cause;
|
|
60
66
|
this.details = details;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/errors/base.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAiBvC,MAAa,SAAU,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/errors/base.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAiBvC,MAAa,SAAU,SAA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AI,IAAI,CAAC,KAAK;YAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;QACrC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;CACF;AA5CD,8BA4CC"}
|
package/dist/cjs/errors/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EstimateGasExecutionError = exports.
|
|
4
|
-
exports.UrlRequiredError = exports.WaitForTransactionReceiptTimeoutError = exports.TransactionReceiptNotFoundError = exports.TransactionNotFoundError = exports.TransactionExecutionError = exports.InvalidStorageKeySizeError = exports.
|
|
3
|
+
exports.EstimateGasExecutionError = exports.EnsAvatarUriResolutionError = exports.EnsAvatarUnsupportedNamespaceError = exports.EnsAvatarInvalidNftUriError = exports.EnsAvatarInvalidMetadataError = exports.OffsetOutOfBoundsError = exports.InvalidHexValueError = exports.InvalidHexBooleanError = exports.InvalidBytesBooleanError = exports.IntegerOutOfRangeError = exports.DataLengthTooShortError = exports.DataLengthTooLongError = exports.SizeExceedsPaddingSizeError = exports.RawContractError = exports.ContractFunctionZeroDataError = exports.ContractFunctionRevertedError = exports.ContractFunctionExecutionError = exports.CallExecutionError = exports.InvalidChainIdError = exports.ChainNotFoundError = exports.ChainMismatchError = exports.ChainDoesNotSupportContract = exports.BlockNotFoundError = exports.BaseError = exports.InvalidAddressError = exports.AccountNotFoundError = exports.UnsupportedPackedAbiType = exports.InvalidDefinitionTypeError = exports.InvalidArrayError = exports.InvalidAbiEncodingTypeError = exports.InvalidAbiDecodingTypeError = exports.DecodeLogTopicsMismatch = exports.BytesSizeMismatchError = exports.AbiFunctionSignatureNotFoundError = exports.AbiFunctionOutputsNotFoundError = exports.AbiFunctionNotFoundError = exports.AbiEventSignatureNotFoundError = exports.AbiEventSignatureEmptyTopicsError = exports.AbiEventNotFoundError = exports.AbiErrorSignatureNotFoundError = exports.AbiErrorNotFoundError = exports.AbiErrorInputsNotFoundError = exports.AbiEncodingLengthMismatchError = exports.AbiEncodingBytesSizeMismatchError = exports.AbiEncodingArrayLengthMismatchError = exports.AbiDecodingZeroDataError = exports.AbiDecodingDataSizeTooSmallError = exports.AbiDecodingDataSizeInvalidError = exports.AbiConstructorParamsNotFoundError = exports.AbiConstructorNotFoundError = void 0;
|
|
4
|
+
exports.UrlRequiredError = exports.WaitForTransactionReceiptTimeoutError = exports.TransactionReceiptNotFoundError = exports.TransactionNotFoundError = exports.TransactionExecutionError = exports.InvalidStorageKeySizeError = exports.InvalidSerializedTransactionTypeError = exports.InvalidSerializedTransactionError = exports.InvalidSerializableTransactionError = exports.InvalidLegacyVError = exports.FeeConflictError = exports.UserRejectedRequestError = exports.UnsupportedProviderMethodError = exports.UnknownRpcError = exports.UnauthorizedProviderError = exports.TransactionRejectedRpcError = exports.SwitchChainError = exports.RpcError = exports.ResourceUnavailableRpcError = exports.ResourceNotFoundRpcError = exports.ProviderRpcError = exports.ProviderDisconnectedError = exports.ParseRpcError = exports.MethodNotSupportedRpcError = exports.MethodNotFoundRpcError = exports.LimitExceededRpcError = exports.JsonRpcVersionUnsupportedError = exports.InvalidRequestRpcError = exports.InvalidParamsRpcError = exports.InvalidInputRpcError = exports.InternalRpcError = exports.ChainDisconnectedError = exports.WebSocketRequestError = exports.TimeoutError = exports.RpcRequestError = exports.HttpRequestError = exports.UnknownNodeError = exports.TransactionTypeNotSupportedError = exports.TipAboveFeeCapError = exports.NonceTooLowError = exports.NonceTooHighError = exports.NonceMaxValueError = exports.IntrinsicGasTooLowError = exports.IntrinsicGasTooHighError = exports.InsufficientFundsError = exports.FeeCapTooLowError = exports.FeeCapTooHighError = exports.ExecutionRevertedError = exports.FilterTypeNotSupportedError = void 0;
|
|
5
5
|
var abi_js_1 = require("./abi.js");
|
|
6
6
|
Object.defineProperty(exports, "AbiConstructorNotFoundError", { enumerable: true, get: function () { return abi_js_1.AbiConstructorNotFoundError; } });
|
|
7
7
|
Object.defineProperty(exports, "AbiConstructorParamsNotFoundError", { enumerable: true, get: function () { return abi_js_1.AbiConstructorParamsNotFoundError; } });
|
|
@@ -59,8 +59,8 @@ Object.defineProperty(exports, "OffsetOutOfBoundsError", { enumerable: true, get
|
|
|
59
59
|
var ens_js_1 = require("./ens.js");
|
|
60
60
|
Object.defineProperty(exports, "EnsAvatarInvalidMetadataError", { enumerable: true, get: function () { return ens_js_1.EnsAvatarInvalidMetadataError; } });
|
|
61
61
|
Object.defineProperty(exports, "EnsAvatarInvalidNftUriError", { enumerable: true, get: function () { return ens_js_1.EnsAvatarInvalidNftUriError; } });
|
|
62
|
-
Object.defineProperty(exports, "EnsAvatarUriResolutionError", { enumerable: true, get: function () { return ens_js_1.EnsAvatarUriResolutionError; } });
|
|
63
62
|
Object.defineProperty(exports, "EnsAvatarUnsupportedNamespaceError", { enumerable: true, get: function () { return ens_js_1.EnsAvatarUnsupportedNamespaceError; } });
|
|
63
|
+
Object.defineProperty(exports, "EnsAvatarUriResolutionError", { enumerable: true, get: function () { return ens_js_1.EnsAvatarUriResolutionError; } });
|
|
64
64
|
var estimateGas_js_1 = require("./estimateGas.js");
|
|
65
65
|
Object.defineProperty(exports, "EstimateGasExecutionError", { enumerable: true, get: function () { return estimateGas_js_1.EstimateGasExecutionError; } });
|
|
66
66
|
var log_js_1 = require("./log.js");
|
|
@@ -79,34 +79,38 @@ Object.defineProperty(exports, "TipAboveFeeCapError", { enumerable: true, get: f
|
|
|
79
79
|
Object.defineProperty(exports, "TransactionTypeNotSupportedError", { enumerable: true, get: function () { return node_js_1.TransactionTypeNotSupportedError; } });
|
|
80
80
|
Object.defineProperty(exports, "UnknownNodeError", { enumerable: true, get: function () { return node_js_1.UnknownNodeError; } });
|
|
81
81
|
var request_js_1 = require("./request.js");
|
|
82
|
-
Object.defineProperty(exports, "
|
|
83
|
-
Object.defineProperty(exports, "InvalidInputRpcError", { enumerable: true, get: function () { return request_js_1.InvalidInputRpcError; } });
|
|
84
|
-
Object.defineProperty(exports, "InvalidParamsRpcError", { enumerable: true, get: function () { return request_js_1.InvalidParamsRpcError; } });
|
|
85
|
-
Object.defineProperty(exports, "InvalidRequestRpcError", { enumerable: true, get: function () { return request_js_1.InvalidRequestRpcError; } });
|
|
86
|
-
Object.defineProperty(exports, "JsonRpcVersionUnsupportedError", { enumerable: true, get: function () { return request_js_1.JsonRpcVersionUnsupportedError; } });
|
|
87
|
-
Object.defineProperty(exports, "LimitExceededRpcError", { enumerable: true, get: function () { return request_js_1.LimitExceededRpcError; } });
|
|
88
|
-
Object.defineProperty(exports, "MethodNotFoundRpcError", { enumerable: true, get: function () { return request_js_1.MethodNotFoundRpcError; } });
|
|
89
|
-
Object.defineProperty(exports, "MethodNotSupportedRpcError", { enumerable: true, get: function () { return request_js_1.MethodNotSupportedRpcError; } });
|
|
90
|
-
Object.defineProperty(exports, "ParseRpcError", { enumerable: true, get: function () { return request_js_1.ParseRpcError; } });
|
|
91
|
-
Object.defineProperty(exports, "RequestError", { enumerable: true, get: function () { return request_js_1.RequestError; } });
|
|
92
|
-
Object.defineProperty(exports, "ResourceNotFoundRpcError", { enumerable: true, get: function () { return request_js_1.ResourceNotFoundRpcError; } });
|
|
93
|
-
Object.defineProperty(exports, "ResourceUnavailableRpcError", { enumerable: true, get: function () { return request_js_1.ResourceUnavailableRpcError; } });
|
|
82
|
+
Object.defineProperty(exports, "HttpRequestError", { enumerable: true, get: function () { return request_js_1.HttpRequestError; } });
|
|
94
83
|
Object.defineProperty(exports, "RpcRequestError", { enumerable: true, get: function () { return request_js_1.RpcRequestError; } });
|
|
95
|
-
Object.defineProperty(exports, "
|
|
96
|
-
Object.defineProperty(exports, "
|
|
97
|
-
Object.defineProperty(exports, "UnknownRpcError", { enumerable: true, get: function () { return request_js_1.UnknownRpcError; } });
|
|
98
|
-
Object.defineProperty(exports, "UserRejectedRequestError", { enumerable: true, get: function () { return request_js_1.UserRejectedRequestError; } });
|
|
84
|
+
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return request_js_1.TimeoutError; } });
|
|
85
|
+
Object.defineProperty(exports, "WebSocketRequestError", { enumerable: true, get: function () { return request_js_1.WebSocketRequestError; } });
|
|
99
86
|
var rpc_js_1 = require("./rpc.js");
|
|
100
|
-
Object.defineProperty(exports, "
|
|
87
|
+
Object.defineProperty(exports, "ChainDisconnectedError", { enumerable: true, get: function () { return rpc_js_1.ChainDisconnectedError; } });
|
|
88
|
+
Object.defineProperty(exports, "InternalRpcError", { enumerable: true, get: function () { return rpc_js_1.InternalRpcError; } });
|
|
89
|
+
Object.defineProperty(exports, "InvalidInputRpcError", { enumerable: true, get: function () { return rpc_js_1.InvalidInputRpcError; } });
|
|
90
|
+
Object.defineProperty(exports, "InvalidParamsRpcError", { enumerable: true, get: function () { return rpc_js_1.InvalidParamsRpcError; } });
|
|
91
|
+
Object.defineProperty(exports, "InvalidRequestRpcError", { enumerable: true, get: function () { return rpc_js_1.InvalidRequestRpcError; } });
|
|
92
|
+
Object.defineProperty(exports, "JsonRpcVersionUnsupportedError", { enumerable: true, get: function () { return rpc_js_1.JsonRpcVersionUnsupportedError; } });
|
|
93
|
+
Object.defineProperty(exports, "LimitExceededRpcError", { enumerable: true, get: function () { return rpc_js_1.LimitExceededRpcError; } });
|
|
94
|
+
Object.defineProperty(exports, "MethodNotFoundRpcError", { enumerable: true, get: function () { return rpc_js_1.MethodNotFoundRpcError; } });
|
|
95
|
+
Object.defineProperty(exports, "MethodNotSupportedRpcError", { enumerable: true, get: function () { return rpc_js_1.MethodNotSupportedRpcError; } });
|
|
96
|
+
Object.defineProperty(exports, "ParseRpcError", { enumerable: true, get: function () { return rpc_js_1.ParseRpcError; } });
|
|
97
|
+
Object.defineProperty(exports, "ProviderDisconnectedError", { enumerable: true, get: function () { return rpc_js_1.ProviderDisconnectedError; } });
|
|
98
|
+
Object.defineProperty(exports, "ProviderRpcError", { enumerable: true, get: function () { return rpc_js_1.ProviderRpcError; } });
|
|
99
|
+
Object.defineProperty(exports, "ResourceNotFoundRpcError", { enumerable: true, get: function () { return rpc_js_1.ResourceNotFoundRpcError; } });
|
|
100
|
+
Object.defineProperty(exports, "ResourceUnavailableRpcError", { enumerable: true, get: function () { return rpc_js_1.ResourceUnavailableRpcError; } });
|
|
101
101
|
Object.defineProperty(exports, "RpcError", { enumerable: true, get: function () { return rpc_js_1.RpcError; } });
|
|
102
|
-
Object.defineProperty(exports, "
|
|
103
|
-
Object.defineProperty(exports, "
|
|
102
|
+
Object.defineProperty(exports, "SwitchChainError", { enumerable: true, get: function () { return rpc_js_1.SwitchChainError; } });
|
|
103
|
+
Object.defineProperty(exports, "TransactionRejectedRpcError", { enumerable: true, get: function () { return rpc_js_1.TransactionRejectedRpcError; } });
|
|
104
|
+
Object.defineProperty(exports, "UnauthorizedProviderError", { enumerable: true, get: function () { return rpc_js_1.UnauthorizedProviderError; } });
|
|
105
|
+
Object.defineProperty(exports, "UnknownRpcError", { enumerable: true, get: function () { return rpc_js_1.UnknownRpcError; } });
|
|
106
|
+
Object.defineProperty(exports, "UnsupportedProviderMethodError", { enumerable: true, get: function () { return rpc_js_1.UnsupportedProviderMethodError; } });
|
|
107
|
+
Object.defineProperty(exports, "UserRejectedRequestError", { enumerable: true, get: function () { return rpc_js_1.UserRejectedRequestError; } });
|
|
104
108
|
var transaction_js_1 = require("./transaction.js");
|
|
105
109
|
Object.defineProperty(exports, "FeeConflictError", { enumerable: true, get: function () { return transaction_js_1.FeeConflictError; } });
|
|
106
110
|
Object.defineProperty(exports, "InvalidLegacyVError", { enumerable: true, get: function () { return transaction_js_1.InvalidLegacyVError; } });
|
|
111
|
+
Object.defineProperty(exports, "InvalidSerializableTransactionError", { enumerable: true, get: function () { return transaction_js_1.InvalidSerializableTransactionError; } });
|
|
107
112
|
Object.defineProperty(exports, "InvalidSerializedTransactionError", { enumerable: true, get: function () { return transaction_js_1.InvalidSerializedTransactionError; } });
|
|
108
113
|
Object.defineProperty(exports, "InvalidSerializedTransactionTypeError", { enumerable: true, get: function () { return transaction_js_1.InvalidSerializedTransactionTypeError; } });
|
|
109
|
-
Object.defineProperty(exports, "InvalidSerializableTransactionError", { enumerable: true, get: function () { return transaction_js_1.InvalidSerializableTransactionError; } });
|
|
110
114
|
Object.defineProperty(exports, "InvalidStorageKeySizeError", { enumerable: true, get: function () { return transaction_js_1.InvalidStorageKeySizeError; } });
|
|
111
115
|
Object.defineProperty(exports, "TransactionExecutionError", { enumerable: true, get: function () { return transaction_js_1.TransactionExecutionError; } });
|
|
112
116
|
Object.defineProperty(exports, "TransactionNotFoundError", { enumerable: true, get: function () { return transaction_js_1.TransactionNotFoundError; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":";;;;AAAA,mCAyBiB;AAxBf,qHAAA,2BAA2B,OAAA;AAC3B,2HAAA,iCAAiC,OAAA;AACjC,yHAAA,+BAA+B,OAAA;AAC/B,0HAAA,gCAAgC,OAAA;AAChC,kHAAA,wBAAwB,OAAA;AACxB,6HAAA,mCAAmC,OAAA;AACnC,2HAAA,iCAAiC,OAAA;AACjC,wHAAA,8BAA8B,OAAA;AAC9B,qHAAA,2BAA2B,OAAA;AAC3B,+GAAA,qBAAqB,OAAA;AACrB,wHAAA,8BAA8B,OAAA;AAC9B,+GAAA,qBAAqB,OAAA;AACrB,2HAAA,iCAAiC,OAAA;AACjC,wHAAA,8BAA8B,OAAA;AAC9B,kHAAA,wBAAwB,OAAA;AACxB,yHAAA,+BAA+B,OAAA;AAC/B,2HAAA,iCAAiC,OAAA;AACjC,gHAAA,sBAAsB,OAAA;AACtB,iHAAA,uBAAuB,OAAA;AACvB,qHAAA,2BAA2B,OAAA;AAC3B,qHAAA,2BAA2B,OAA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AAChB,qHAAA,mBAAmB,OAAA;AACnB,qIAAA,mCAAmC,OAAA;AACnC,mIAAA,iCAAiC,OAAA;AACjC,uIAAA,qCAAqC,OAAA;AACrC,4HAAA,0BAA0B,OAAA;AAC1B,2HAAA,yBAAyB,OAAA;AACzB,0HAAA,wBAAwB,OAAA;AACxB,iIAAA,+BAA+B,OAAA;AAC/B,uIAAA,qCAAqC,OAAA;AAGvC,+CAAiD;AAAxC,gHAAA,gBAAgB,OAAA"}
|
|
@@ -1,316 +1,107 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TimeoutError = exports.RpcRequestError = exports.WebSocketRequestError = exports.HttpRequestError = void 0;
|
|
4
|
+
const index_js_1 = require("../utils/index.js");
|
|
4
5
|
const base_js_1 = require("./base.js");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
metaMessages:
|
|
6
|
+
const utils_js_1 = require("./utils.js");
|
|
7
|
+
class HttpRequestError extends base_js_1.BaseError {
|
|
8
|
+
constructor({ body, details, headers, status, url, }) {
|
|
9
|
+
super('HTTP request failed.', {
|
|
10
|
+
details,
|
|
11
|
+
metaMessages: [
|
|
12
|
+
status && `Status: ${status}`,
|
|
13
|
+
`URL: ${(0, utils_js_1.getUrl)(url)}`,
|
|
14
|
+
`Request body: ${(0, index_js_1.stringify)(body)}`,
|
|
15
|
+
].filter(Boolean),
|
|
11
16
|
});
|
|
12
|
-
this.name = err.name;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.RequestError = RequestError;
|
|
16
|
-
class RpcRequestError extends RequestError {
|
|
17
|
-
constructor(err, { docsPath, shortMessage }) {
|
|
18
|
-
super(err, { docsPath, shortMessage });
|
|
19
|
-
Object.defineProperty(this, "code", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
configurable: true,
|
|
22
|
-
writable: true,
|
|
23
|
-
value: void 0
|
|
24
|
-
});
|
|
25
|
-
this.code = err.code;
|
|
26
|
-
this.name = err.name;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.RpcRequestError = RpcRequestError;
|
|
30
|
-
class ParseRpcError extends RpcRequestError {
|
|
31
|
-
constructor(err) {
|
|
32
|
-
super(err, {
|
|
33
|
-
shortMessage: 'Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.',
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(this, "name", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
configurable: true,
|
|
38
|
-
writable: true,
|
|
39
|
-
value: 'ParseRpcError'
|
|
40
|
-
});
|
|
41
|
-
Object.defineProperty(this, "code", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
configurable: true,
|
|
44
|
-
writable: true,
|
|
45
|
-
value: -32700
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
exports.ParseRpcError = ParseRpcError;
|
|
50
|
-
class InvalidRequestRpcError extends RpcRequestError {
|
|
51
|
-
constructor(err) {
|
|
52
|
-
super(err, { shortMessage: 'JSON is not a valid request object.' });
|
|
53
|
-
Object.defineProperty(this, "name", {
|
|
54
|
-
enumerable: true,
|
|
55
|
-
configurable: true,
|
|
56
|
-
writable: true,
|
|
57
|
-
value: 'InvalidRequestRpcError'
|
|
58
|
-
});
|
|
59
|
-
Object.defineProperty(this, "code", {
|
|
60
|
-
enumerable: true,
|
|
61
|
-
configurable: true,
|
|
62
|
-
writable: true,
|
|
63
|
-
value: -32600
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.InvalidRequestRpcError = InvalidRequestRpcError;
|
|
68
|
-
class MethodNotFoundRpcError extends RpcRequestError {
|
|
69
|
-
constructor(err) {
|
|
70
|
-
super(err, {
|
|
71
|
-
shortMessage: 'The method does not exist / is not available.',
|
|
72
|
-
});
|
|
73
|
-
Object.defineProperty(this, "name", {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
configurable: true,
|
|
76
|
-
writable: true,
|
|
77
|
-
value: 'MethodNotFoundRpcError'
|
|
78
|
-
});
|
|
79
|
-
Object.defineProperty(this, "code", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
configurable: true,
|
|
82
|
-
writable: true,
|
|
83
|
-
value: -32601
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.MethodNotFoundRpcError = MethodNotFoundRpcError;
|
|
88
|
-
class InvalidParamsRpcError extends RpcRequestError {
|
|
89
|
-
constructor(err) {
|
|
90
|
-
super(err, {
|
|
91
|
-
shortMessage: [
|
|
92
|
-
'Invalid parameters were provided to the RPC method.',
|
|
93
|
-
'Double check you have provided the correct parameters.',
|
|
94
|
-
].join('\n'),
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(this, "name", {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
configurable: true,
|
|
99
|
-
writable: true,
|
|
100
|
-
value: 'InvalidParamsRpcError'
|
|
101
|
-
});
|
|
102
|
-
Object.defineProperty(this, "code", {
|
|
103
|
-
enumerable: true,
|
|
104
|
-
configurable: true,
|
|
105
|
-
writable: true,
|
|
106
|
-
value: -32602
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
exports.InvalidParamsRpcError = InvalidParamsRpcError;
|
|
111
|
-
class InternalRpcError extends RpcRequestError {
|
|
112
|
-
constructor(err) {
|
|
113
|
-
super(err, { shortMessage: 'An internal error was received.' });
|
|
114
|
-
Object.defineProperty(this, "name", {
|
|
115
|
-
enumerable: true,
|
|
116
|
-
configurable: true,
|
|
117
|
-
writable: true,
|
|
118
|
-
value: 'InternalRpcError'
|
|
119
|
-
});
|
|
120
|
-
Object.defineProperty(this, "code", {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
configurable: true,
|
|
123
|
-
writable: true,
|
|
124
|
-
value: -32603
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
exports.InternalRpcError = InternalRpcError;
|
|
129
|
-
class InvalidInputRpcError extends RpcRequestError {
|
|
130
|
-
constructor(err) {
|
|
131
|
-
super(err, {
|
|
132
|
-
shortMessage: [
|
|
133
|
-
'Missing or invalid parameters.',
|
|
134
|
-
'Double check you have provided the correct parameters.',
|
|
135
|
-
].join('\n'),
|
|
136
|
-
});
|
|
137
|
-
Object.defineProperty(this, "name", {
|
|
138
|
-
enumerable: true,
|
|
139
|
-
configurable: true,
|
|
140
|
-
writable: true,
|
|
141
|
-
value: 'InvalidInputRpcError'
|
|
142
|
-
});
|
|
143
|
-
Object.defineProperty(this, "code", {
|
|
144
|
-
enumerable: true,
|
|
145
|
-
configurable: true,
|
|
146
|
-
writable: true,
|
|
147
|
-
value: -32000
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
exports.InvalidInputRpcError = InvalidInputRpcError;
|
|
152
|
-
class ResourceNotFoundRpcError extends RpcRequestError {
|
|
153
|
-
constructor(err) {
|
|
154
|
-
super(err, { shortMessage: 'Requested resource not found.' });
|
|
155
|
-
Object.defineProperty(this, "name", {
|
|
156
|
-
enumerable: true,
|
|
157
|
-
configurable: true,
|
|
158
|
-
writable: true,
|
|
159
|
-
value: 'ResourceNotFoundRpcError'
|
|
160
|
-
});
|
|
161
|
-
Object.defineProperty(this, "code", {
|
|
162
|
-
enumerable: true,
|
|
163
|
-
configurable: true,
|
|
164
|
-
writable: true,
|
|
165
|
-
value: -32001
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
exports.ResourceNotFoundRpcError = ResourceNotFoundRpcError;
|
|
170
|
-
class ResourceUnavailableRpcError extends RpcRequestError {
|
|
171
|
-
constructor(err) {
|
|
172
|
-
super(err, { shortMessage: 'Requested resource not available.' });
|
|
173
|
-
Object.defineProperty(this, "name", {
|
|
174
|
-
enumerable: true,
|
|
175
|
-
configurable: true,
|
|
176
|
-
writable: true,
|
|
177
|
-
value: 'ResourceUnavailableRpcError'
|
|
178
|
-
});
|
|
179
|
-
Object.defineProperty(this, "code", {
|
|
180
|
-
enumerable: true,
|
|
181
|
-
configurable: true,
|
|
182
|
-
writable: true,
|
|
183
|
-
value: -32002
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
exports.ResourceUnavailableRpcError = ResourceUnavailableRpcError;
|
|
188
|
-
class TransactionRejectedRpcError extends RpcRequestError {
|
|
189
|
-
constructor(err) {
|
|
190
|
-
super(err, { shortMessage: 'Transaction creation failed.' });
|
|
191
17
|
Object.defineProperty(this, "name", {
|
|
192
18
|
enumerable: true,
|
|
193
19
|
configurable: true,
|
|
194
20
|
writable: true,
|
|
195
|
-
value: '
|
|
21
|
+
value: 'HttpRequestError'
|
|
196
22
|
});
|
|
197
|
-
Object.defineProperty(this, "
|
|
198
|
-
enumerable: true,
|
|
199
|
-
configurable: true,
|
|
200
|
-
writable: true,
|
|
201
|
-
value: -32003
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
exports.TransactionRejectedRpcError = TransactionRejectedRpcError;
|
|
206
|
-
class MethodNotSupportedRpcError extends RpcRequestError {
|
|
207
|
-
constructor(err) {
|
|
208
|
-
super(err, { shortMessage: 'Method is not implemented.' });
|
|
209
|
-
Object.defineProperty(this, "name", {
|
|
23
|
+
Object.defineProperty(this, "body", {
|
|
210
24
|
enumerable: true,
|
|
211
25
|
configurable: true,
|
|
212
26
|
writable: true,
|
|
213
|
-
value:
|
|
214
|
-
});
|
|
215
|
-
Object.defineProperty(this, "code", {
|
|
216
|
-
enumerable: true,
|
|
217
|
-
configurable: true,
|
|
218
|
-
writable: true,
|
|
219
|
-
value: -32004
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
exports.MethodNotSupportedRpcError = MethodNotSupportedRpcError;
|
|
224
|
-
class LimitExceededRpcError extends RpcRequestError {
|
|
225
|
-
constructor(err) {
|
|
226
|
-
super(err, { shortMessage: 'Request exceeds defined limit.' });
|
|
227
|
-
Object.defineProperty(this, "name", {
|
|
228
|
-
enumerable: true,
|
|
229
|
-
configurable: true,
|
|
230
|
-
writable: true,
|
|
231
|
-
value: 'LimitExceededRpcError'
|
|
27
|
+
value: void 0
|
|
232
28
|
});
|
|
233
|
-
Object.defineProperty(this, "
|
|
29
|
+
Object.defineProperty(this, "headers", {
|
|
234
30
|
enumerable: true,
|
|
235
31
|
configurable: true,
|
|
236
32
|
writable: true,
|
|
237
|
-
value:
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
exports.LimitExceededRpcError = LimitExceededRpcError;
|
|
242
|
-
class JsonRpcVersionUnsupportedError extends RpcRequestError {
|
|
243
|
-
constructor(err) {
|
|
244
|
-
super(err, {
|
|
245
|
-
shortMessage: 'Version of JSON-RPC protocol is not supported.',
|
|
33
|
+
value: void 0
|
|
246
34
|
});
|
|
247
|
-
Object.defineProperty(this, "
|
|
35
|
+
Object.defineProperty(this, "status", {
|
|
248
36
|
enumerable: true,
|
|
249
37
|
configurable: true,
|
|
250
38
|
writable: true,
|
|
251
|
-
value:
|
|
39
|
+
value: void 0
|
|
252
40
|
});
|
|
253
|
-
Object.defineProperty(this, "
|
|
41
|
+
Object.defineProperty(this, "url", {
|
|
254
42
|
enumerable: true,
|
|
255
43
|
configurable: true,
|
|
256
44
|
writable: true,
|
|
257
|
-
value:
|
|
45
|
+
value: void 0
|
|
258
46
|
});
|
|
47
|
+
this.body = body;
|
|
48
|
+
this.headers = headers;
|
|
49
|
+
this.status = status;
|
|
50
|
+
this.url = url;
|
|
259
51
|
}
|
|
260
52
|
}
|
|
261
|
-
exports.
|
|
262
|
-
class
|
|
263
|
-
constructor(
|
|
264
|
-
super(
|
|
265
|
-
|
|
53
|
+
exports.HttpRequestError = HttpRequestError;
|
|
54
|
+
class WebSocketRequestError extends base_js_1.BaseError {
|
|
55
|
+
constructor({ body, details, url, }) {
|
|
56
|
+
super('WebSocket request failed.', {
|
|
57
|
+
details,
|
|
58
|
+
metaMessages: [`URL: ${(0, utils_js_1.getUrl)(url)}`, `Request body: ${(0, index_js_1.stringify)(body)}`],
|
|
266
59
|
});
|
|
267
60
|
Object.defineProperty(this, "name", {
|
|
268
61
|
enumerable: true,
|
|
269
62
|
configurable: true,
|
|
270
63
|
writable: true,
|
|
271
|
-
value: '
|
|
272
|
-
});
|
|
273
|
-
Object.defineProperty(this, "code", {
|
|
274
|
-
enumerable: true,
|
|
275
|
-
configurable: true,
|
|
276
|
-
writable: true,
|
|
277
|
-
value: 4001
|
|
64
|
+
value: 'WebSocketRequestError'
|
|
278
65
|
});
|
|
279
66
|
}
|
|
280
67
|
}
|
|
281
|
-
exports.
|
|
282
|
-
class
|
|
283
|
-
constructor(
|
|
284
|
-
super(
|
|
285
|
-
|
|
68
|
+
exports.WebSocketRequestError = WebSocketRequestError;
|
|
69
|
+
class RpcRequestError extends base_js_1.BaseError {
|
|
70
|
+
constructor({ body, error, url, }) {
|
|
71
|
+
super('RPC Request failed.', {
|
|
72
|
+
cause: error,
|
|
73
|
+
details: error.message,
|
|
74
|
+
metaMessages: [`URL: ${(0, utils_js_1.getUrl)(url)}`, `Request body: ${(0, index_js_1.stringify)(body)}`],
|
|
286
75
|
});
|
|
287
76
|
Object.defineProperty(this, "name", {
|
|
288
77
|
enumerable: true,
|
|
289
78
|
configurable: true,
|
|
290
79
|
writable: true,
|
|
291
|
-
value: '
|
|
80
|
+
value: 'RpcRequestError'
|
|
292
81
|
});
|
|
293
82
|
Object.defineProperty(this, "code", {
|
|
294
83
|
enumerable: true,
|
|
295
84
|
configurable: true,
|
|
296
85
|
writable: true,
|
|
297
|
-
value:
|
|
86
|
+
value: void 0
|
|
298
87
|
});
|
|
88
|
+
this.code = error.code;
|
|
299
89
|
}
|
|
300
90
|
}
|
|
301
|
-
exports.
|
|
302
|
-
class
|
|
303
|
-
constructor(
|
|
304
|
-
super(
|
|
305
|
-
|
|
91
|
+
exports.RpcRequestError = RpcRequestError;
|
|
92
|
+
class TimeoutError extends base_js_1.BaseError {
|
|
93
|
+
constructor({ body, url, }) {
|
|
94
|
+
super('The request took too long to respond.', {
|
|
95
|
+
details: 'The request timed out.',
|
|
96
|
+
metaMessages: [`URL: ${(0, utils_js_1.getUrl)(url)}`, `Request body: ${(0, index_js_1.stringify)(body)}`],
|
|
306
97
|
});
|
|
307
98
|
Object.defineProperty(this, "name", {
|
|
308
99
|
enumerable: true,
|
|
309
100
|
configurable: true,
|
|
310
101
|
writable: true,
|
|
311
|
-
value: '
|
|
102
|
+
value: 'TimeoutError'
|
|
312
103
|
});
|
|
313
104
|
}
|
|
314
105
|
}
|
|
315
|
-
exports.
|
|
106
|
+
exports.TimeoutError = TimeoutError;
|
|
316
107
|
//# sourceMappingURL=request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/errors/request.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/errors/request.ts"],"names":[],"mappings":";;;AAAA,gDAA6C;AAC7C,uCAAqC;AACrC,yCAAmC;AAEnC,MAAa,gBAAiB,SAAQ,mBAAS;IAQ7C,YAAY,EACV,IAAI,EACJ,OAAO,EACP,OAAO,EACP,MAAM,EACN,GAAG,GAOJ;QACC,KAAK,CAAC,sBAAsB,EAAE;YAC5B,OAAO;YACP,YAAY,EAAE;gBACZ,MAAM,IAAI,WAAW,MAAM,EAAE;gBAC7B,QAAQ,IAAA,iBAAM,EAAC,GAAG,CAAC,EAAE;gBACrB,iBAAiB,IAAA,oBAAS,EAAC,IAAI,CAAC,EAAE;aACnC,CAAC,MAAM,CAAC,OAAO,CAAa;SAC9B,CAAC,CAAA;QA3BK;;;;mBAAO,kBAAkB;WAAA;QAElC;;;;;WAAgC;QAChC;;;;;WAAiB;QACjB;;;;;WAAe;QACf;;;;;WAAW;QAuBT,I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