@metamask/utils 8.2.0 → 8.2.1
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/CHANGELOG.md +6 -1
- package/dist/assert.js +3 -3
- package/dist/assert.mjs +2 -2
- package/dist/base64.js +4 -4
- package/dist/base64.mjs +3 -3
- package/dist/bytes.js +4 -4
- package/dist/bytes.mjs +3 -3
- package/dist/checksum.js +5 -5
- package/dist/checksum.mjs +4 -4
- package/dist/{chunk-ZRNIY7OW.js → chunk-4D6XQBHA.js} +4 -4
- package/dist/{chunk-VL5DYXC5.mjs → chunk-52OU772R.mjs} +2 -2
- package/dist/{chunk-65KBH4FZ.mjs → chunk-6C35XQOF.mjs} +2 -2
- package/dist/{chunk-WRBN6DWM.js → chunk-6NZW4WK4.js} +3 -3
- package/dist/{chunk-VBYRLAP6.js → chunk-6ZDHSOUV.js} +3 -3
- package/dist/{chunk-CSDMTDND.mjs → chunk-74DGVJVE.mjs} +2 -2
- package/dist/{chunk-WQDTPIQK.js → chunk-BFQDMI3M.js} +12 -12
- package/dist/{chunk-JCYFTGED.js → chunk-DHVKFDHQ.js} +9 -9
- package/dist/{chunk-XYYGZF5Y.js → chunk-E4C7EW4R.js} +3 -3
- package/dist/{chunk-N53OILN6.mjs → chunk-GZS3IQBZ.mjs} +2 -2
- package/dist/{chunk-DMPG3H3G.js → chunk-IZC266HS.js} +7 -13
- package/dist/chunk-IZC266HS.js.map +1 -0
- package/dist/{chunk-HLDWS2JR.mjs → chunk-NQMRFZHB.mjs} +2 -2
- package/dist/{chunk-2CY4F77D.mjs → chunk-O3EIM33O.mjs} +3 -3
- package/dist/{chunk-5WQRFJVQ.js → chunk-OLLG4H35.js} +11 -11
- package/dist/{chunk-YQJBIHC7.js → chunk-QEPVHEP7.js} +20 -20
- package/dist/{chunk-G66TREC6.mjs → chunk-ROQSKDP5.mjs} +2 -2
- package/dist/{chunk-VSEW3V2L.mjs → chunk-S3UHBN2Z.mjs} +3 -3
- package/dist/{chunk-BKR45GQY.mjs → chunk-VA2DRBDE.mjs} +2 -2
- package/dist/chunk-VFXTVNXN.js +44 -0
- package/dist/{chunk-7S5AWFX7.mjs → chunk-XYGUOY6N.mjs} +7 -13
- package/dist/{chunk-7S5AWFX7.mjs.map → chunk-XYGUOY6N.mjs.map} +1 -1
- package/dist/coercers.js +5 -5
- package/dist/coercers.mjs +4 -4
- package/dist/errors.js +2 -2
- package/dist/errors.mjs +1 -1
- package/dist/fs.js +3 -3
- package/dist/fs.mjs +2 -2
- package/dist/hex.js +4 -4
- package/dist/hex.mjs +3 -3
- package/dist/index.js +10 -10
- package/dist/index.mjs +9 -9
- package/dist/json.js +4 -4
- package/dist/json.mjs +3 -3
- package/dist/node.js +11 -11
- package/dist/node.mjs +10 -10
- package/dist/number.js +5 -5
- package/dist/number.mjs +4 -4
- package/dist/versions.js +4 -4
- package/dist/versions.mjs +3 -3
- package/package.json +2 -2
- package/dist/chunk-4JNG5UTO.js +0 -44
- package/dist/chunk-DMPG3H3G.js.map +0 -1
- /package/dist/{chunk-ZRNIY7OW.js.map → chunk-4D6XQBHA.js.map} +0 -0
- /package/dist/{chunk-VL5DYXC5.mjs.map → chunk-52OU772R.mjs.map} +0 -0
- /package/dist/{chunk-65KBH4FZ.mjs.map → chunk-6C35XQOF.mjs.map} +0 -0
- /package/dist/{chunk-WRBN6DWM.js.map → chunk-6NZW4WK4.js.map} +0 -0
- /package/dist/{chunk-VBYRLAP6.js.map → chunk-6ZDHSOUV.js.map} +0 -0
- /package/dist/{chunk-CSDMTDND.mjs.map → chunk-74DGVJVE.mjs.map} +0 -0
- /package/dist/{chunk-WQDTPIQK.js.map → chunk-BFQDMI3M.js.map} +0 -0
- /package/dist/{chunk-JCYFTGED.js.map → chunk-DHVKFDHQ.js.map} +0 -0
- /package/dist/{chunk-XYYGZF5Y.js.map → chunk-E4C7EW4R.js.map} +0 -0
- /package/dist/{chunk-N53OILN6.mjs.map → chunk-GZS3IQBZ.mjs.map} +0 -0
- /package/dist/{chunk-HLDWS2JR.mjs.map → chunk-NQMRFZHB.mjs.map} +0 -0
- /package/dist/{chunk-2CY4F77D.mjs.map → chunk-O3EIM33O.mjs.map} +0 -0
- /package/dist/{chunk-5WQRFJVQ.js.map → chunk-OLLG4H35.js.map} +0 -0
- /package/dist/{chunk-YQJBIHC7.js.map → chunk-QEPVHEP7.js.map} +0 -0
- /package/dist/{chunk-G66TREC6.mjs.map → chunk-ROQSKDP5.mjs.map} +0 -0
- /package/dist/{chunk-VSEW3V2L.mjs.map → chunk-S3UHBN2Z.mjs.map} +0 -0
- /package/dist/{chunk-BKR45GQY.mjs.map → chunk-VA2DRBDE.mjs.map} +0 -0
- /package/dist/{chunk-4JNG5UTO.js.map → chunk-VFXTVNXN.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk6ZDHSOUVjs = require('./chunk-6ZDHSOUV.js');
|
|
4
4
|
|
|
5
5
|
// src/hex.ts
|
|
6
6
|
var _sha3 = require('@noble/hashes/sha3');
|
|
@@ -27,7 +27,7 @@ function isBytes(value) {
|
|
|
27
27
|
return value instanceof Uint8Array;
|
|
28
28
|
}
|
|
29
29
|
function assertIsBytes(value) {
|
|
30
|
-
|
|
30
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, isBytes(value), "Value must be a Uint8Array.");
|
|
31
31
|
}
|
|
32
32
|
function bytesToHex(bytes) {
|
|
33
33
|
assertIsBytes(bytes);
|
|
@@ -57,7 +57,7 @@ function bytesToSignedBigInt(bytes) {
|
|
|
57
57
|
function bytesToNumber(bytes) {
|
|
58
58
|
assertIsBytes(bytes);
|
|
59
59
|
const bigint = bytesToBigInt(bytes);
|
|
60
|
-
|
|
60
|
+
_chunk6ZDHSOUVjs.assert.call(void 0,
|
|
61
61
|
bigint <= BigInt(Number.MAX_SAFE_INTEGER),
|
|
62
62
|
"Number is not a safe integer. Use `bytesToBigInt` instead."
|
|
63
63
|
);
|
|
@@ -89,21 +89,21 @@ function hexToBytes(value) {
|
|
|
89
89
|
return bytes;
|
|
90
90
|
}
|
|
91
91
|
function bigIntToBytes(value) {
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, typeof value === "bigint", "Value must be a bigint.");
|
|
93
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, value >= BigInt(0), "Value must be a non-negative bigint.");
|
|
94
94
|
const hexadecimal = value.toString(16);
|
|
95
95
|
return hexToBytes(hexadecimal);
|
|
96
96
|
}
|
|
97
97
|
function bigIntFits(value, bytes) {
|
|
98
|
-
|
|
98
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, bytes > 0);
|
|
99
99
|
const mask = value >> BigInt(31);
|
|
100
100
|
return !((~value & mask) + (value & ~mask) >> BigInt(bytes * 8 + ~0));
|
|
101
101
|
}
|
|
102
102
|
function signedBigIntToBytes(value, byteLength) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, typeof value === "bigint", "Value must be a bigint.");
|
|
104
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, typeof byteLength === "number", "Byte length must be a number.");
|
|
105
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, byteLength > 0, "Byte length must be greater than 0.");
|
|
106
|
+
_chunk6ZDHSOUVjs.assert.call(void 0,
|
|
107
107
|
bigIntFits(value, byteLength),
|
|
108
108
|
"Byte length is too small to represent the given value."
|
|
109
109
|
);
|
|
@@ -116,9 +116,9 @@ function signedBigIntToBytes(value, byteLength) {
|
|
|
116
116
|
return bytes.reverse();
|
|
117
117
|
}
|
|
118
118
|
function numberToBytes(value) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, typeof value === "number", "Value must be a number.");
|
|
120
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, value >= 0, "Value must be a non-negative number.");
|
|
121
|
+
_chunk6ZDHSOUVjs.assert.call(void 0,
|
|
122
122
|
Number.isSafeInteger(value),
|
|
123
123
|
"Value is not a safe integer. Use `bigIntToBytes` instead."
|
|
124
124
|
);
|
|
@@ -126,11 +126,11 @@ function numberToBytes(value) {
|
|
|
126
126
|
return hexToBytes(hexadecimal);
|
|
127
127
|
}
|
|
128
128
|
function stringToBytes(value) {
|
|
129
|
-
|
|
129
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, typeof value === "string", "Value must be a string.");
|
|
130
130
|
return new TextEncoder().encode(value);
|
|
131
131
|
}
|
|
132
132
|
function base64ToBytes(value) {
|
|
133
|
-
|
|
133
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, typeof value === "string", "Value must be a string.");
|
|
134
134
|
return _base.base64.decode(value);
|
|
135
135
|
}
|
|
136
136
|
function valueToBytes(value) {
|
|
@@ -195,10 +195,10 @@ function isStrictHexString(value) {
|
|
|
195
195
|
return _superstruct.is.call(void 0, value, StrictHexStruct);
|
|
196
196
|
}
|
|
197
197
|
function assertIsHexString(value) {
|
|
198
|
-
|
|
198
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, isHexString(value), "Value must be a hexadecimal string.");
|
|
199
199
|
}
|
|
200
200
|
function assertIsStrictHexString(value) {
|
|
201
|
-
|
|
201
|
+
_chunk6ZDHSOUVjs.assert.call(void 0,
|
|
202
202
|
isStrictHexString(value),
|
|
203
203
|
'Value must be a hexadecimal string, starting with "0x".'
|
|
204
204
|
);
|
|
@@ -207,12 +207,12 @@ function isValidHexAddress(possibleAddress) {
|
|
|
207
207
|
return _superstruct.is.call(void 0, possibleAddress, HexAddressStruct) || isValidChecksumAddress(possibleAddress);
|
|
208
208
|
}
|
|
209
209
|
function getChecksumAddress(address) {
|
|
210
|
-
|
|
210
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, _superstruct.is.call(void 0, address, HexChecksumAddressStruct), "Invalid hex address.");
|
|
211
211
|
const unPrefixed = remove0x(address.toLowerCase());
|
|
212
212
|
const unPrefixedHash = remove0x(bytesToHex(_sha3.keccak_256.call(void 0, unPrefixed)));
|
|
213
213
|
return `0x${unPrefixed.split("").map((character, nibbleIndex) => {
|
|
214
214
|
const hashCharacter = unPrefixedHash[nibbleIndex];
|
|
215
|
-
|
|
215
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, _superstruct.is.call(void 0, hashCharacter, _superstruct.string.call(void 0, )), "Hash shorter than address.");
|
|
216
216
|
return parseInt(hashCharacter, 16) > 7 ? character.toUpperCase() : character;
|
|
217
217
|
}).join("")}`;
|
|
218
218
|
}
|
|
@@ -270,4 +270,4 @@ function remove0x(hexadecimal) {
|
|
|
270
270
|
|
|
271
271
|
|
|
272
272
|
exports.HexStruct = HexStruct; exports.StrictHexStruct = StrictHexStruct; exports.HexAddressStruct = HexAddressStruct; exports.HexChecksumAddressStruct = HexChecksumAddressStruct; exports.isHexString = isHexString; exports.isStrictHexString = isStrictHexString; exports.assertIsHexString = assertIsHexString; exports.assertIsStrictHexString = assertIsStrictHexString; exports.isValidHexAddress = isValidHexAddress; exports.getChecksumAddress = getChecksumAddress; exports.isValidChecksumAddress = isValidChecksumAddress; exports.add0x = add0x; exports.remove0x = remove0x; exports.isBytes = isBytes; exports.assertIsBytes = assertIsBytes; exports.bytesToHex = bytesToHex; exports.bytesToBigInt = bytesToBigInt; exports.bytesToSignedBigInt = bytesToSignedBigInt; exports.bytesToNumber = bytesToNumber; exports.bytesToString = bytesToString; exports.bytesToBase64 = bytesToBase64; exports.hexToBytes = hexToBytes; exports.bigIntToBytes = bigIntToBytes; exports.signedBigIntToBytes = signedBigIntToBytes; exports.numberToBytes = numberToBytes; exports.stringToBytes = stringToBytes; exports.base64ToBytes = base64ToBytes; exports.valueToBytes = valueToBytes; exports.concatBytes = concatBytes; exports.createDataView = createDataView;
|
|
273
|
-
//# sourceMappingURL=chunk-
|
|
273
|
+
//# sourceMappingURL=chunk-QEPVHEP7.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertStruct
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-74DGVJVE.mjs";
|
|
4
4
|
|
|
5
5
|
// src/versions.ts
|
|
6
6
|
import {
|
|
@@ -66,4 +66,4 @@ export {
|
|
|
66
66
|
gtRange,
|
|
67
67
|
satisfiesVersionRange
|
|
68
68
|
};
|
|
69
|
-
//# sourceMappingURL=chunk-
|
|
69
|
+
//# sourceMappingURL=chunk-ROQSKDP5.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
add0x,
|
|
3
3
|
assertIsHexString
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VA2DRBDE.mjs";
|
|
5
5
|
import {
|
|
6
6
|
assert
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-74DGVJVE.mjs";
|
|
8
8
|
|
|
9
9
|
// src/number.ts
|
|
10
10
|
var numberToHex = (value) => {
|
|
@@ -41,4 +41,4 @@ export {
|
|
|
41
41
|
hexToNumber,
|
|
42
42
|
hexToBigInt
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
44
|
+
//# sourceMappingURL=chunk-S3UHBN2Z.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assert
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-74DGVJVE.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hex.ts
|
|
6
6
|
import { keccak_256 as keccak256 } from "@noble/hashes/sha3";
|
|
@@ -270,4 +270,4 @@ export {
|
|
|
270
270
|
concatBytes,
|
|
271
271
|
createDataView
|
|
272
272
|
};
|
|
273
|
-
//# sourceMappingURL=chunk-
|
|
273
|
+
//# sourceMappingURL=chunk-VA2DRBDE.mjs.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkQEPVHEP7js = require('./chunk-QEPVHEP7.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunk6ZDHSOUVjs = require('./chunk-6ZDHSOUV.js');
|
|
8
|
+
|
|
9
|
+
// src/number.ts
|
|
10
|
+
var numberToHex = (value) => {
|
|
11
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, typeof value === "number", "Value must be a number.");
|
|
12
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, value >= 0, "Value must be a non-negative number.");
|
|
13
|
+
_chunk6ZDHSOUVjs.assert.call(void 0,
|
|
14
|
+
Number.isSafeInteger(value),
|
|
15
|
+
"Value is not a safe integer. Use `bigIntToHex` instead."
|
|
16
|
+
);
|
|
17
|
+
return _chunkQEPVHEP7js.add0x.call(void 0, value.toString(16));
|
|
18
|
+
};
|
|
19
|
+
var bigIntToHex = (value) => {
|
|
20
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, typeof value === "bigint", "Value must be a bigint.");
|
|
21
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, value >= 0, "Value must be a non-negative bigint.");
|
|
22
|
+
return _chunkQEPVHEP7js.add0x.call(void 0, value.toString(16));
|
|
23
|
+
};
|
|
24
|
+
var hexToNumber = (value) => {
|
|
25
|
+
_chunkQEPVHEP7js.assertIsHexString.call(void 0, value);
|
|
26
|
+
const numberValue = parseInt(value, 16);
|
|
27
|
+
_chunk6ZDHSOUVjs.assert.call(void 0,
|
|
28
|
+
Number.isSafeInteger(numberValue),
|
|
29
|
+
"Value is not a safe integer. Use `hexToBigInt` instead."
|
|
30
|
+
);
|
|
31
|
+
return numberValue;
|
|
32
|
+
};
|
|
33
|
+
var hexToBigInt = (value) => {
|
|
34
|
+
_chunkQEPVHEP7js.assertIsHexString.call(void 0, value);
|
|
35
|
+
return BigInt(_chunkQEPVHEP7js.add0x.call(void 0, value));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
exports.numberToHex = numberToHex; exports.bigIntToHex = bigIntToHex; exports.hexToNumber = hexToNumber; exports.hexToBigInt = hexToBigInt;
|
|
44
|
+
//# sourceMappingURL=chunk-VFXTVNXN.js.map
|
|
@@ -28,18 +28,12 @@ function getErrorMessage(error) {
|
|
|
28
28
|
}
|
|
29
29
|
function wrapError(originalError, message) {
|
|
30
30
|
if (isError(originalError)) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// but `tsc` does. I'm not sure why, but we disable this in the
|
|
38
|
-
// meantime.
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
new Error(message, { cause: originalError })
|
|
42
|
-
) : new ErrorWithCause(message, { cause: originalError });
|
|
31
|
+
let error;
|
|
32
|
+
if (Error.length === 2) {
|
|
33
|
+
error = new Error(message, { cause: originalError });
|
|
34
|
+
} else {
|
|
35
|
+
error = new ErrorWithCause(message, { cause: originalError });
|
|
36
|
+
}
|
|
43
37
|
if (isErrorWithCode(originalError)) {
|
|
44
38
|
error.code = originalError.code;
|
|
45
39
|
}
|
|
@@ -58,4 +52,4 @@ export {
|
|
|
58
52
|
getErrorMessage,
|
|
59
53
|
wrapError
|
|
60
54
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
55
|
+
//# sourceMappingURL=chunk-XYGUOY6N.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import { ErrorWithCause } from 'pony-cause';\n\nimport { isNullOrUndefined, isObject } from './misc';\n\n/**\n * Type guard for determining whether the given value is an instance of Error.\n * For errors generated via `fs.promises`, `error instanceof Error` won't work,\n * so we have to come up with another way of testing.\n *\n * @param error - The object to check.\n * @returns A boolean.\n */\nfunction isError(error: unknown): error is Error {\n return (\n error instanceof Error ||\n (isObject(error) && error.constructor.name === 'Error')\n );\n}\n\n/**\n * Type guard for determining whether the given value is an error object with a\n * `code` property such as the type of error that Node throws for filesystem\n * operations, etc.\n *\n * @param error - The object to check.\n * @returns A boolean.\n */\nexport function isErrorWithCode(error: unknown): error is { code: string } {\n return typeof error === 'object' && error !== null && 'code' in error;\n}\n\n/**\n * Type guard for determining whether the given value is an error object with a\n * `message` property, such as an instance of Error.\n *\n * @param error - The object to check.\n * @returns A boolean.\n */\nexport function isErrorWithMessage(\n error: unknown,\n): error is { message: string } {\n return typeof error === 'object' && error !== null && 'message' in error;\n}\n\n/**\n * Type guard for determining whether the given value is an error object with a\n * `stack` property, such as an instance of Error.\n *\n * @param error - The object to check.\n * @returns A boolean.\n */\nexport function isErrorWithStack(error: unknown): error is { stack: string } {\n return typeof error === 'object' && error !== null && 'stack' in error;\n}\n\n/**\n * Attempts to obtain the message from a possible error object, defaulting to an\n * empty string if it is impossible to do so.\n *\n * @param error - The possible error to get the message from.\n * @returns The message if `error` is an object with a `message` property;\n * the string version of `error` if it is not `undefined` or `null`; otherwise\n * an empty string.\n */\nexport function getErrorMessage(error: unknown): string {\n if (isErrorWithMessage(error) && typeof error.message === 'string') {\n return error.message;\n }\n\n if (isNullOrUndefined(error)) {\n return '';\n }\n\n return String(error);\n}\n\n/**\n * Builds a new error object, linking it to the original error via the `cause`\n * property if it is an Error.\n *\n * This function is useful to reframe error messages in general, but is\n * _critical_ when interacting with any of Node's filesystem functions as\n * provided via `fs.promises`, because these do not produce stack traces in the\n * case of an I/O error (see <https://github.com/nodejs/node/issues/30944>).\n *\n * @param originalError - The error to be wrapped (something throwable).\n * @param message - The desired message of the new error.\n * @returns A new error object.\n */\nexport function wrapError<Throwable>(\n originalError: Throwable,\n message: string,\n): Error & { code?: string } {\n if (isError(originalError)) {\n
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import { ErrorWithCause } from 'pony-cause';\n\nimport { isNullOrUndefined, isObject } from './misc';\n\n/**\n * Type guard for determining whether the given value is an instance of Error.\n * For errors generated via `fs.promises`, `error instanceof Error` won't work,\n * so we have to come up with another way of testing.\n *\n * @param error - The object to check.\n * @returns A boolean.\n */\nfunction isError(error: unknown): error is Error {\n return (\n error instanceof Error ||\n (isObject(error) && error.constructor.name === 'Error')\n );\n}\n\n/**\n * Type guard for determining whether the given value is an error object with a\n * `code` property such as the type of error that Node throws for filesystem\n * operations, etc.\n *\n * @param error - The object to check.\n * @returns A boolean.\n */\nexport function isErrorWithCode(error: unknown): error is { code: string } {\n return typeof error === 'object' && error !== null && 'code' in error;\n}\n\n/**\n * Type guard for determining whether the given value is an error object with a\n * `message` property, such as an instance of Error.\n *\n * @param error - The object to check.\n * @returns A boolean.\n */\nexport function isErrorWithMessage(\n error: unknown,\n): error is { message: string } {\n return typeof error === 'object' && error !== null && 'message' in error;\n}\n\n/**\n * Type guard for determining whether the given value is an error object with a\n * `stack` property, such as an instance of Error.\n *\n * @param error - The object to check.\n * @returns A boolean.\n */\nexport function isErrorWithStack(error: unknown): error is { stack: string } {\n return typeof error === 'object' && error !== null && 'stack' in error;\n}\n\n/**\n * Attempts to obtain the message from a possible error object, defaulting to an\n * empty string if it is impossible to do so.\n *\n * @param error - The possible error to get the message from.\n * @returns The message if `error` is an object with a `message` property;\n * the string version of `error` if it is not `undefined` or `null`; otherwise\n * an empty string.\n */\nexport function getErrorMessage(error: unknown): string {\n if (isErrorWithMessage(error) && typeof error.message === 'string') {\n return error.message;\n }\n\n if (isNullOrUndefined(error)) {\n return '';\n }\n\n return String(error);\n}\n\n/**\n * Builds a new error object, linking it to the original error via the `cause`\n * property if it is an Error.\n *\n * This function is useful to reframe error messages in general, but is\n * _critical_ when interacting with any of Node's filesystem functions as\n * provided via `fs.promises`, because these do not produce stack traces in the\n * case of an I/O error (see <https://github.com/nodejs/node/issues/30944>).\n *\n * @param originalError - The error to be wrapped (something throwable).\n * @param message - The desired message of the new error.\n * @returns A new error object.\n */\nexport function wrapError<Throwable>(\n originalError: Throwable,\n message: string,\n): Error & { code?: string } {\n if (isError(originalError)) {\n let error: Error & { code?: string };\n if (Error.length === 2) {\n // for some reason `tsserver` is not complaining that the\n // Error constructor doesn't support a second argument in the editor,\n // but `tsc` does. Error causes are not supported by our current tsc target (ES2020, we need ES2022 to make this work)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n error = new Error(message, { cause: originalError });\n } else {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n error = new ErrorWithCause(message, { cause: originalError });\n }\n\n if (isErrorWithCode(originalError)) {\n error.code = originalError.code;\n }\n\n return error;\n }\n\n if (message.length > 0) {\n return new Error(`${String(originalError)}: ${message}`);\n }\n\n return new Error(String(originalError));\n}\n"],"mappings":";;;;;;AAAA,SAAS,sBAAsB;AAY/B,SAAS,QAAQ,OAAgC;AAC/C,SACE,iBAAiB,SAChB,SAAS,KAAK,KAAK,MAAM,YAAY,SAAS;AAEnD;AAUO,SAAS,gBAAgB,OAA2C;AACzE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AAClE;AASO,SAAS,mBACd,OAC8B;AAC9B,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa;AACrE;AASO,SAAS,iBAAiB,OAA4C;AAC3E,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,WAAW;AACnE;AAWO,SAAS,gBAAgB,OAAwB;AACtD,MAAI,mBAAmB,KAAK,KAAK,OAAO,MAAM,YAAY,UAAU;AAClE,WAAO,MAAM;AAAA,EACf;AAEA,MAAI,kBAAkB,KAAK,GAAG;AAC5B,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,KAAK;AACrB;AAeO,SAAS,UACd,eACA,SAC2B;AAC3B,MAAI,QAAQ,aAAa,GAAG;AAC1B,QAAI;AACJ,QAAI,MAAM,WAAW,GAAG;AAMtB,cAAQ,IAAI,MAAM,SAAS,EAAE,OAAO,cAAc,CAAC;AAAA,IACrD,OAAO;AAGL,cAAQ,IAAI,eAAe,SAAS,EAAE,OAAO,cAAc,CAAC;AAAA,IAC9D;AAEA,QAAI,gBAAgB,aAAa,GAAG;AAClC,YAAM,OAAO,cAAc;AAAA,IAC7B;AAEA,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,SAAS,GAAG;AACtB,WAAO,IAAI,MAAM,GAAG,OAAO,aAAa,CAAC,KAAK,OAAO,EAAE;AAAA,EACzD;AAEA,SAAO,IAAI,MAAM,OAAO,aAAa,CAAC;AACxC;","names":[]}
|
package/dist/coercers.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
6
|
+
var _chunkDHVKFDHQjs = require('./chunk-DHVKFDHQ.js');
|
|
7
|
+
require('./chunk-QEPVHEP7.js');
|
|
8
|
+
require('./chunk-6ZDHSOUV.js');
|
|
9
|
+
require('./chunk-IZC266HS.js');
|
|
10
10
|
require('./chunk-QVEKZRZ2.js');
|
|
11
11
|
require('./chunk-3W5G4CYI.js');
|
|
12
12
|
|
|
@@ -14,5 +14,5 @@ require('./chunk-3W5G4CYI.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.createBigInt =
|
|
17
|
+
exports.createBigInt = _chunkDHVKFDHQjs.createBigInt; exports.createBytes = _chunkDHVKFDHQjs.createBytes; exports.createHex = _chunkDHVKFDHQjs.createHex; exports.createNumber = _chunkDHVKFDHQjs.createNumber;
|
|
18
18
|
//# sourceMappingURL=coercers.js.map
|
package/dist/coercers.mjs
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
createBytes,
|
|
4
4
|
createHex,
|
|
5
5
|
createNumber
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-O3EIM33O.mjs";
|
|
7
|
+
import "./chunk-VA2DRBDE.mjs";
|
|
8
|
+
import "./chunk-74DGVJVE.mjs";
|
|
9
|
+
import "./chunk-XYGUOY6N.mjs";
|
|
10
10
|
import "./chunk-H4YFDLB7.mjs";
|
|
11
11
|
import "./chunk-X66SUIEF.mjs";
|
|
12
12
|
export {
|
package/dist/errors.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkIZC266HSjs = require('./chunk-IZC266HS.js');
|
|
8
8
|
require('./chunk-QVEKZRZ2.js');
|
|
9
9
|
require('./chunk-3W5G4CYI.js');
|
|
10
10
|
|
|
@@ -13,5 +13,5 @@ require('./chunk-3W5G4CYI.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.getErrorMessage =
|
|
16
|
+
exports.getErrorMessage = _chunkIZC266HSjs.getErrorMessage; exports.isErrorWithCode = _chunkIZC266HSjs.isErrorWithCode; exports.isErrorWithMessage = _chunkIZC266HSjs.isErrorWithMessage; exports.isErrorWithStack = _chunkIZC266HSjs.isErrorWithStack; exports.wrapError = _chunkIZC266HSjs.wrapError;
|
|
17
17
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.mjs
CHANGED
package/dist/fs.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('./chunk-
|
|
11
|
+
var _chunkBFQDMI3Mjs = require('./chunk-BFQDMI3M.js');
|
|
12
|
+
require('./chunk-IZC266HS.js');
|
|
13
13
|
require('./chunk-QVEKZRZ2.js');
|
|
14
14
|
require('./chunk-3W5G4CYI.js');
|
|
15
15
|
|
|
@@ -22,5 +22,5 @@ require('./chunk-3W5G4CYI.js');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
exports.createSandbox =
|
|
25
|
+
exports.createSandbox = _chunkBFQDMI3Mjs.createSandbox; exports.directoryExists = _chunkBFQDMI3Mjs.directoryExists; exports.ensureDirectoryStructureExists = _chunkBFQDMI3Mjs.ensureDirectoryStructureExists; exports.fileExists = _chunkBFQDMI3Mjs.fileExists; exports.forceRemove = _chunkBFQDMI3Mjs.forceRemove; exports.readFile = _chunkBFQDMI3Mjs.readFile; exports.readJsonFile = _chunkBFQDMI3Mjs.readJsonFile; exports.writeFile = _chunkBFQDMI3Mjs.writeFile; exports.writeJsonFile = _chunkBFQDMI3Mjs.writeJsonFile;
|
|
26
26
|
//# sourceMappingURL=fs.js.map
|
package/dist/fs.mjs
CHANGED
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
readJsonFile,
|
|
9
9
|
writeFile,
|
|
10
10
|
writeJsonFile
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-52OU772R.mjs";
|
|
12
|
+
import "./chunk-XYGUOY6N.mjs";
|
|
13
13
|
import "./chunk-H4YFDLB7.mjs";
|
|
14
14
|
import "./chunk-X66SUIEF.mjs";
|
|
15
15
|
export {
|
package/dist/hex.js
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
16
|
-
require('./chunk-
|
|
17
|
-
require('./chunk-
|
|
15
|
+
var _chunkQEPVHEP7js = require('./chunk-QEPVHEP7.js');
|
|
16
|
+
require('./chunk-6ZDHSOUV.js');
|
|
17
|
+
require('./chunk-IZC266HS.js');
|
|
18
18
|
require('./chunk-QVEKZRZ2.js');
|
|
19
19
|
require('./chunk-3W5G4CYI.js');
|
|
20
20
|
|
|
@@ -31,5 +31,5 @@ require('./chunk-3W5G4CYI.js');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
exports.HexAddressStruct =
|
|
34
|
+
exports.HexAddressStruct = _chunkQEPVHEP7js.HexAddressStruct; exports.HexChecksumAddressStruct = _chunkQEPVHEP7js.HexChecksumAddressStruct; exports.HexStruct = _chunkQEPVHEP7js.HexStruct; exports.StrictHexStruct = _chunkQEPVHEP7js.StrictHexStruct; exports.add0x = _chunkQEPVHEP7js.add0x; exports.assertIsHexString = _chunkQEPVHEP7js.assertIsHexString; exports.assertIsStrictHexString = _chunkQEPVHEP7js.assertIsStrictHexString; exports.getChecksumAddress = _chunkQEPVHEP7js.getChecksumAddress; exports.isHexString = _chunkQEPVHEP7js.isHexString; exports.isStrictHexString = _chunkQEPVHEP7js.isStrictHexString; exports.isValidChecksumAddress = _chunkQEPVHEP7js.isValidChecksumAddress; exports.isValidHexAddress = _chunkQEPVHEP7js.isValidHexAddress; exports.remove0x = _chunkQEPVHEP7js.remove0x;
|
|
35
35
|
//# sourceMappingURL=hex.js.map
|
package/dist/hex.mjs
CHANGED
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
isValidChecksumAddress,
|
|
13
13
|
isValidHexAddress,
|
|
14
14
|
remove0x
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-VA2DRBDE.mjs";
|
|
16
|
+
import "./chunk-74DGVJVE.mjs";
|
|
17
|
+
import "./chunk-XYGUOY6N.mjs";
|
|
18
18
|
import "./chunk-H4YFDLB7.mjs";
|
|
19
19
|
import "./chunk-X66SUIEF.mjs";
|
|
20
20
|
export {
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkVFXTVNXNjs = require('./chunk-VFXTVNXN.js');
|
|
8
8
|
require('./chunk-LC2CRSWD.js');
|
|
9
9
|
|
|
10
10
|
|
|
@@ -22,7 +22,7 @@ require('./chunk-UOTVU7OQ.js');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunk4D6XQBHAjs = require('./chunk-4D6XQBHA.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
@@ -57,7 +57,7 @@ var _chunkZRNIY7OWjs = require('./chunk-ZRNIY7OW.js');
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
var
|
|
60
|
+
var _chunkOLLG4H35js = require('./chunk-OLLG4H35.js');
|
|
61
61
|
require('./chunk-RKRGAFXY.js');
|
|
62
62
|
|
|
63
63
|
|
|
@@ -84,16 +84,16 @@ var _chunk2LBGT4GHjs = require('./chunk-2LBGT4GH.js');
|
|
|
84
84
|
var _chunkU7ZUGCE7js = require('./chunk-U7ZUGCE7.js');
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
var
|
|
87
|
+
var _chunkE4C7EW4Rjs = require('./chunk-E4C7EW4R.js');
|
|
88
88
|
|
|
89
89
|
|
|
90
|
-
var
|
|
90
|
+
var _chunk6NZW4WK4js = require('./chunk-6NZW4WK4.js');
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
var
|
|
96
|
+
var _chunkDHVKFDHQjs = require('./chunk-DHVKFDHQ.js');
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
|
|
@@ -125,20 +125,20 @@ var _chunkJCYFTGEDjs = require('./chunk-JCYFTGED.js');
|
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
|
|
128
|
-
var
|
|
128
|
+
var _chunkQEPVHEP7js = require('./chunk-QEPVHEP7.js');
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
|
|
134
|
-
var
|
|
134
|
+
var _chunk6ZDHSOUVjs = require('./chunk-6ZDHSOUV.js');
|
|
135
135
|
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
|
|
141
|
-
var
|
|
141
|
+
var _chunkIZC266HSjs = require('./chunk-IZC266HS.js');
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
|
|
@@ -285,5 +285,5 @@ require('./chunk-EQMZL4XU.js');
|
|
|
285
285
|
|
|
286
286
|
|
|
287
287
|
|
|
288
|
-
exports.AssertionError =
|
|
288
|
+
exports.AssertionError = _chunk6ZDHSOUVjs.AssertionError; exports.CAIP_ACCOUNT_ADDRESS_REGEX = _chunkU7ZUGCE7js.CAIP_ACCOUNT_ADDRESS_REGEX; exports.CAIP_ACCOUNT_ID_REGEX = _chunkU7ZUGCE7js.CAIP_ACCOUNT_ID_REGEX; exports.CAIP_CHAIN_ID_REGEX = _chunkU7ZUGCE7js.CAIP_CHAIN_ID_REGEX; exports.CAIP_NAMESPACE_REGEX = _chunkU7ZUGCE7js.CAIP_NAMESPACE_REGEX; exports.CAIP_REFERENCE_REGEX = _chunkU7ZUGCE7js.CAIP_REFERENCE_REGEX; exports.CaipAccountAddressStruct = _chunkU7ZUGCE7js.CaipAccountAddressStruct; exports.CaipAccountIdStruct = _chunkU7ZUGCE7js.CaipAccountIdStruct; exports.CaipChainIdStruct = _chunkU7ZUGCE7js.CaipChainIdStruct; exports.CaipNamespaceStruct = _chunkU7ZUGCE7js.CaipNamespaceStruct; exports.CaipReferenceStruct = _chunkU7ZUGCE7js.CaipReferenceStruct; exports.ChecksumStruct = _chunkE4C7EW4Rjs.ChecksumStruct; exports.Duration = _chunk4RMX5YWEjs.Duration; exports.ESCAPE_CHARACTERS_REGEXP = _chunkQVEKZRZ2js.ESCAPE_CHARACTERS_REGEXP; exports.FrozenMap = _chunkZ2RGWDD7js.FrozenMap; exports.FrozenSet = _chunkZ2RGWDD7js.FrozenSet; exports.HexAddressStruct = _chunkQEPVHEP7js.HexAddressStruct; exports.HexChecksumAddressStruct = _chunkQEPVHEP7js.HexChecksumAddressStruct; exports.HexStruct = _chunkQEPVHEP7js.HexStruct; exports.JsonRpcErrorStruct = _chunkOLLG4H35js.JsonRpcErrorStruct; exports.JsonRpcFailureStruct = _chunkOLLG4H35js.JsonRpcFailureStruct; exports.JsonRpcIdStruct = _chunkOLLG4H35js.JsonRpcIdStruct; exports.JsonRpcNotificationStruct = _chunkOLLG4H35js.JsonRpcNotificationStruct; exports.JsonRpcParamsStruct = _chunkOLLG4H35js.JsonRpcParamsStruct; exports.JsonRpcRequestStruct = _chunkOLLG4H35js.JsonRpcRequestStruct; exports.JsonRpcResponseStruct = _chunkOLLG4H35js.JsonRpcResponseStruct; exports.JsonRpcSuccessStruct = _chunkOLLG4H35js.JsonRpcSuccessStruct; exports.JsonRpcVersionStruct = _chunkOLLG4H35js.JsonRpcVersionStruct; exports.JsonSize = _chunkQVEKZRZ2js.JsonSize; exports.JsonStruct = _chunkOLLG4H35js.JsonStruct; exports.PendingJsonRpcResponseStruct = _chunkOLLG4H35js.PendingJsonRpcResponseStruct; exports.StrictHexStruct = _chunkQEPVHEP7js.StrictHexStruct; exports.UnsafeJsonStruct = _chunkOLLG4H35js.UnsafeJsonStruct; exports.VersionRangeStruct = _chunk4D6XQBHAjs.VersionRangeStruct; exports.VersionStruct = _chunk4D6XQBHAjs.VersionStruct; exports.add0x = _chunkQEPVHEP7js.add0x; exports.assert = _chunk6ZDHSOUVjs.assert; exports.assertExhaustive = _chunk6ZDHSOUVjs.assertExhaustive; exports.assertIsBytes = _chunkQEPVHEP7js.assertIsBytes; exports.assertIsHexString = _chunkQEPVHEP7js.assertIsHexString; exports.assertIsJsonRpcError = _chunkOLLG4H35js.assertIsJsonRpcError; exports.assertIsJsonRpcFailure = _chunkOLLG4H35js.assertIsJsonRpcFailure; exports.assertIsJsonRpcNotification = _chunkOLLG4H35js.assertIsJsonRpcNotification; exports.assertIsJsonRpcRequest = _chunkOLLG4H35js.assertIsJsonRpcRequest; exports.assertIsJsonRpcResponse = _chunkOLLG4H35js.assertIsJsonRpcResponse; exports.assertIsJsonRpcSuccess = _chunkOLLG4H35js.assertIsJsonRpcSuccess; exports.assertIsPendingJsonRpcResponse = _chunkOLLG4H35js.assertIsPendingJsonRpcResponse; exports.assertIsSemVerRange = _chunk4D6XQBHAjs.assertIsSemVerRange; exports.assertIsSemVerVersion = _chunk4D6XQBHAjs.assertIsSemVerVersion; exports.assertIsStrictHexString = _chunkQEPVHEP7js.assertIsStrictHexString; exports.assertStruct = _chunk6ZDHSOUVjs.assertStruct; exports.base64 = _chunk6NZW4WK4js.base64; exports.base64ToBytes = _chunkQEPVHEP7js.base64ToBytes; exports.bigIntToBytes = _chunkQEPVHEP7js.bigIntToBytes; exports.bigIntToHex = _chunkVFXTVNXNjs.bigIntToHex; exports.bytesToBase64 = _chunkQEPVHEP7js.bytesToBase64; exports.bytesToBigInt = _chunkQEPVHEP7js.bytesToBigInt; exports.bytesToHex = _chunkQEPVHEP7js.bytesToHex; exports.bytesToNumber = _chunkQEPVHEP7js.bytesToNumber; exports.bytesToSignedBigInt = _chunkQEPVHEP7js.bytesToSignedBigInt; exports.bytesToString = _chunkQEPVHEP7js.bytesToString; exports.calculateNumberSize = _chunkQVEKZRZ2js.calculateNumberSize; exports.calculateStringSize = _chunkQVEKZRZ2js.calculateStringSize; exports.concatBytes = _chunkQEPVHEP7js.concatBytes; exports.createBigInt = _chunkDHVKFDHQjs.createBigInt; exports.createBytes = _chunkDHVKFDHQjs.createBytes; exports.createDataView = _chunkQEPVHEP7js.createDataView; exports.createHex = _chunkDHVKFDHQjs.createHex; exports.createModuleLogger = _chunk2LBGT4GHjs.createModuleLogger; exports.createNumber = _chunkDHVKFDHQjs.createNumber; exports.createProjectLogger = _chunk2LBGT4GHjs.createProjectLogger; exports.exactOptional = _chunkOLLG4H35js.exactOptional; exports.getChecksumAddress = _chunkQEPVHEP7js.getChecksumAddress; exports.getErrorMessage = _chunkIZC266HSjs.getErrorMessage; exports.getJsonRpcIdValidator = _chunkOLLG4H35js.getJsonRpcIdValidator; exports.getJsonSize = _chunkOLLG4H35js.getJsonSize; exports.getKnownPropertyNames = _chunkQVEKZRZ2js.getKnownPropertyNames; exports.getSafeJson = _chunkOLLG4H35js.getSafeJson; exports.gtRange = _chunk4D6XQBHAjs.gtRange; exports.gtVersion = _chunk4D6XQBHAjs.gtVersion; exports.hasProperty = _chunkQVEKZRZ2js.hasProperty; exports.hexToBigInt = _chunkVFXTVNXNjs.hexToBigInt; exports.hexToBytes = _chunkQEPVHEP7js.hexToBytes; exports.hexToNumber = _chunkVFXTVNXNjs.hexToNumber; exports.inMilliseconds = _chunk4RMX5YWEjs.inMilliseconds; exports.isASCII = _chunkQVEKZRZ2js.isASCII; exports.isBytes = _chunkQEPVHEP7js.isBytes; exports.isCaipAccountAddress = _chunkU7ZUGCE7js.isCaipAccountAddress; exports.isCaipAccountId = _chunkU7ZUGCE7js.isCaipAccountId; exports.isCaipChainId = _chunkU7ZUGCE7js.isCaipChainId; exports.isCaipNamespace = _chunkU7ZUGCE7js.isCaipNamespace; exports.isCaipReference = _chunkU7ZUGCE7js.isCaipReference; exports.isErrorWithCode = _chunkIZC266HSjs.isErrorWithCode; exports.isErrorWithMessage = _chunkIZC266HSjs.isErrorWithMessage; exports.isErrorWithStack = _chunkIZC266HSjs.isErrorWithStack; exports.isHexString = _chunkQEPVHEP7js.isHexString; exports.isJsonRpcError = _chunkOLLG4H35js.isJsonRpcError; exports.isJsonRpcFailure = _chunkOLLG4H35js.isJsonRpcFailure; exports.isJsonRpcNotification = _chunkOLLG4H35js.isJsonRpcNotification; exports.isJsonRpcRequest = _chunkOLLG4H35js.isJsonRpcRequest; exports.isJsonRpcResponse = _chunkOLLG4H35js.isJsonRpcResponse; exports.isJsonRpcSuccess = _chunkOLLG4H35js.isJsonRpcSuccess; exports.isNonEmptyArray = _chunkQVEKZRZ2js.isNonEmptyArray; exports.isNullOrUndefined = _chunkQVEKZRZ2js.isNullOrUndefined; exports.isObject = _chunkQVEKZRZ2js.isObject; exports.isPendingJsonRpcResponse = _chunkOLLG4H35js.isPendingJsonRpcResponse; exports.isPlainObject = _chunkQVEKZRZ2js.isPlainObject; exports.isStrictHexString = _chunkQEPVHEP7js.isStrictHexString; exports.isValidChecksumAddress = _chunkQEPVHEP7js.isValidChecksumAddress; exports.isValidHexAddress = _chunkQEPVHEP7js.isValidHexAddress; exports.isValidJson = _chunkOLLG4H35js.isValidJson; exports.isValidSemVerRange = _chunk4D6XQBHAjs.isValidSemVerRange; exports.isValidSemVerVersion = _chunk4D6XQBHAjs.isValidSemVerVersion; exports.jsonrpc2 = _chunkOLLG4H35js.jsonrpc2; exports.numberToBytes = _chunkQEPVHEP7js.numberToBytes; exports.numberToHex = _chunkVFXTVNXNjs.numberToHex; exports.object = _chunkOLLG4H35js.object; exports.parseCaipAccountId = _chunkU7ZUGCE7js.parseCaipAccountId; exports.parseCaipChainId = _chunkU7ZUGCE7js.parseCaipChainId; exports.remove0x = _chunkQEPVHEP7js.remove0x; exports.satisfiesVersionRange = _chunk4D6XQBHAjs.satisfiesVersionRange; exports.signedBigIntToBytes = _chunkQEPVHEP7js.signedBigIntToBytes; exports.stringToBytes = _chunkQEPVHEP7js.stringToBytes; exports.timeSince = _chunk4RMX5YWEjs.timeSince; exports.valueToBytes = _chunkQEPVHEP7js.valueToBytes; exports.wrapError = _chunkIZC266HSjs.wrapError;
|
|
289
289
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
hexToBigInt,
|
|
5
5
|
hexToNumber,
|
|
6
6
|
numberToHex
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-S3UHBN2Z.mjs";
|
|
8
8
|
import "./chunk-AY6FDCBT.mjs";
|
|
9
9
|
import {
|
|
10
10
|
Duration,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
isValidSemVerRange,
|
|
23
23
|
isValidSemVerVersion,
|
|
24
24
|
satisfiesVersionRange
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ROQSKDP5.mjs";
|
|
26
26
|
import {
|
|
27
27
|
JsonRpcErrorStruct,
|
|
28
28
|
JsonRpcFailureStruct,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
isValidJson,
|
|
58
58
|
jsonrpc2,
|
|
59
59
|
object
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-6C35XQOF.mjs";
|
|
61
61
|
import "./chunk-I575FZFH.mjs";
|
|
62
62
|
import {
|
|
63
63
|
createModuleLogger,
|
|
@@ -84,16 +84,16 @@ import {
|
|
|
84
84
|
} from "./chunk-TGOMTREC.mjs";
|
|
85
85
|
import {
|
|
86
86
|
ChecksumStruct
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-GZS3IQBZ.mjs";
|
|
88
88
|
import {
|
|
89
89
|
base64
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-NQMRFZHB.mjs";
|
|
91
91
|
import {
|
|
92
92
|
createBigInt,
|
|
93
93
|
createBytes,
|
|
94
94
|
createHex,
|
|
95
95
|
createNumber
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-O3EIM33O.mjs";
|
|
97
97
|
import {
|
|
98
98
|
HexAddressStruct,
|
|
99
99
|
HexChecksumAddressStruct,
|
|
@@ -125,20 +125,20 @@ import {
|
|
|
125
125
|
signedBigIntToBytes,
|
|
126
126
|
stringToBytes,
|
|
127
127
|
valueToBytes
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-VA2DRBDE.mjs";
|
|
129
129
|
import {
|
|
130
130
|
AssertionError,
|
|
131
131
|
assert,
|
|
132
132
|
assertExhaustive,
|
|
133
133
|
assertStruct
|
|
134
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-74DGVJVE.mjs";
|
|
135
135
|
import {
|
|
136
136
|
getErrorMessage,
|
|
137
137
|
isErrorWithCode,
|
|
138
138
|
isErrorWithMessage,
|
|
139
139
|
isErrorWithStack,
|
|
140
140
|
wrapError
|
|
141
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-XYGUOY6N.mjs";
|
|
142
142
|
import {
|
|
143
143
|
ESCAPE_CHARACTERS_REGEXP,
|
|
144
144
|
JsonSize,
|
package/dist/json.js
CHANGED
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
36
|
-
require('./chunk-
|
|
37
|
-
require('./chunk-
|
|
35
|
+
var _chunkOLLG4H35js = require('./chunk-OLLG4H35.js');
|
|
36
|
+
require('./chunk-6ZDHSOUV.js');
|
|
37
|
+
require('./chunk-IZC266HS.js');
|
|
38
38
|
require('./chunk-QVEKZRZ2.js');
|
|
39
39
|
require('./chunk-3W5G4CYI.js');
|
|
40
40
|
|
|
@@ -71,5 +71,5 @@ require('./chunk-3W5G4CYI.js');
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
exports.JsonRpcErrorStruct =
|
|
74
|
+
exports.JsonRpcErrorStruct = _chunkOLLG4H35js.JsonRpcErrorStruct; exports.JsonRpcFailureStruct = _chunkOLLG4H35js.JsonRpcFailureStruct; exports.JsonRpcIdStruct = _chunkOLLG4H35js.JsonRpcIdStruct; exports.JsonRpcNotificationStruct = _chunkOLLG4H35js.JsonRpcNotificationStruct; exports.JsonRpcParamsStruct = _chunkOLLG4H35js.JsonRpcParamsStruct; exports.JsonRpcRequestStruct = _chunkOLLG4H35js.JsonRpcRequestStruct; exports.JsonRpcResponseStruct = _chunkOLLG4H35js.JsonRpcResponseStruct; exports.JsonRpcSuccessStruct = _chunkOLLG4H35js.JsonRpcSuccessStruct; exports.JsonRpcVersionStruct = _chunkOLLG4H35js.JsonRpcVersionStruct; exports.JsonStruct = _chunkOLLG4H35js.JsonStruct; exports.PendingJsonRpcResponseStruct = _chunkOLLG4H35js.PendingJsonRpcResponseStruct; exports.UnsafeJsonStruct = _chunkOLLG4H35js.UnsafeJsonStruct; exports.assertIsJsonRpcError = _chunkOLLG4H35js.assertIsJsonRpcError; exports.assertIsJsonRpcFailure = _chunkOLLG4H35js.assertIsJsonRpcFailure; exports.assertIsJsonRpcNotification = _chunkOLLG4H35js.assertIsJsonRpcNotification; exports.assertIsJsonRpcRequest = _chunkOLLG4H35js.assertIsJsonRpcRequest; exports.assertIsJsonRpcResponse = _chunkOLLG4H35js.assertIsJsonRpcResponse; exports.assertIsJsonRpcSuccess = _chunkOLLG4H35js.assertIsJsonRpcSuccess; exports.assertIsPendingJsonRpcResponse = _chunkOLLG4H35js.assertIsPendingJsonRpcResponse; exports.exactOptional = _chunkOLLG4H35js.exactOptional; exports.getJsonRpcIdValidator = _chunkOLLG4H35js.getJsonRpcIdValidator; exports.getJsonSize = _chunkOLLG4H35js.getJsonSize; exports.getSafeJson = _chunkOLLG4H35js.getSafeJson; exports.isJsonRpcError = _chunkOLLG4H35js.isJsonRpcError; exports.isJsonRpcFailure = _chunkOLLG4H35js.isJsonRpcFailure; exports.isJsonRpcNotification = _chunkOLLG4H35js.isJsonRpcNotification; exports.isJsonRpcRequest = _chunkOLLG4H35js.isJsonRpcRequest; exports.isJsonRpcResponse = _chunkOLLG4H35js.isJsonRpcResponse; exports.isJsonRpcSuccess = _chunkOLLG4H35js.isJsonRpcSuccess; exports.isPendingJsonRpcResponse = _chunkOLLG4H35js.isPendingJsonRpcResponse; exports.isValidJson = _chunkOLLG4H35js.isValidJson; exports.jsonrpc2 = _chunkOLLG4H35js.jsonrpc2; exports.object = _chunkOLLG4H35js.object;
|
|
75
75
|
//# sourceMappingURL=json.js.map
|
package/dist/json.mjs
CHANGED
|
@@ -32,9 +32,9 @@ import {
|
|
|
32
32
|
isValidJson,
|
|
33
33
|
jsonrpc2,
|
|
34
34
|
object
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-6C35XQOF.mjs";
|
|
36
|
+
import "./chunk-74DGVJVE.mjs";
|
|
37
|
+
import "./chunk-XYGUOY6N.mjs";
|
|
38
38
|
import "./chunk-H4YFDLB7.mjs";
|
|
39
39
|
import "./chunk-X66SUIEF.mjs";
|
|
40
40
|
export {
|