@metamask/utils 6.2.0 → 7.1.0

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.
Files changed (178) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/cjs/assert.js +116 -0
  3. package/dist/cjs/assert.js.map +1 -0
  4. package/dist/cjs/base64.js +32 -0
  5. package/dist/cjs/base64.js.map +1 -0
  6. package/dist/cjs/bytes.js +255 -0
  7. package/dist/cjs/bytes.js.map +1 -0
  8. package/dist/cjs/caip-types.js +115 -0
  9. package/dist/cjs/caip-types.js.map +1 -0
  10. package/dist/cjs/checksum.js +17 -0
  11. package/dist/cjs/checksum.js.map +1 -0
  12. package/dist/cjs/coercers.js +96 -0
  13. package/dist/cjs/coercers.js.map +1 -0
  14. package/dist/cjs/collections.js +157 -0
  15. package/dist/cjs/collections.js.map +1 -0
  16. package/dist/cjs/encryption-types.js +6 -0
  17. package/dist/cjs/encryption-types.js.map +1 -0
  18. package/dist/cjs/hex.js +107 -0
  19. package/dist/cjs/hex.js.map +1 -0
  20. package/dist/cjs/index.js +37 -0
  21. package/dist/cjs/index.js.map +1 -0
  22. package/dist/cjs/json.js +263 -0
  23. package/dist/cjs/json.js.map +1 -0
  24. package/dist/cjs/keyring.js +6 -0
  25. package/dist/cjs/keyring.js.map +1 -0
  26. package/dist/cjs/logging.js +33 -0
  27. package/dist/cjs/logging.js.map +1 -0
  28. package/dist/cjs/misc.js +111 -0
  29. package/dist/cjs/misc.js.map +1 -0
  30. package/dist/cjs/number.js +52 -0
  31. package/dist/cjs/number.js.map +1 -0
  32. package/dist/cjs/opaque.js +8 -0
  33. package/dist/cjs/opaque.js.map +1 -0
  34. package/dist/cjs/time.js +63 -0
  35. package/dist/cjs/time.js.map +1 -0
  36. package/dist/cjs/transaction-types.js +6 -0
  37. package/dist/cjs/transaction-types.js.map +1 -0
  38. package/dist/cjs/versions.js +79 -0
  39. package/dist/cjs/versions.js.map +1 -0
  40. package/dist/{assert.js → esm/assert.js} +30 -35
  41. package/dist/esm/assert.js.map +1 -0
  42. package/dist/{base64.js → esm/base64.js} +10 -16
  43. package/dist/esm/base64.js.map +1 -0
  44. package/dist/{bytes.js → esm/bytes.js} +50 -93
  45. package/dist/esm/bytes.js.map +1 -0
  46. package/dist/esm/caip-types.js +99 -0
  47. package/dist/esm/caip-types.js.map +1 -0
  48. package/dist/esm/checksum.js +7 -0
  49. package/dist/esm/checksum.js.map +1 -0
  50. package/dist/{coercers.js → esm/coercers.js} +43 -52
  51. package/dist/esm/coercers.js.map +1 -0
  52. package/dist/esm/collections.js +140 -0
  53. package/dist/esm/collections.js.map +1 -0
  54. package/dist/esm/encryption-types.js +3 -0
  55. package/dist/esm/encryption-types.js.map +1 -0
  56. package/dist/esm/hex.js +108 -0
  57. package/dist/esm/hex.js.map +1 -0
  58. package/dist/{index.d.ts → esm/index.js} +3 -0
  59. package/dist/esm/index.js.map +1 -0
  60. package/dist/esm/json.js +301 -0
  61. package/dist/esm/json.js.map +1 -0
  62. package/dist/esm/keyring.js +3 -0
  63. package/dist/esm/keyring.js.map +1 -0
  64. package/dist/{logging.js → esm/logging.js} +5 -14
  65. package/dist/esm/logging.js.map +1 -0
  66. package/dist/{misc.js → esm/misc.js} +37 -42
  67. package/dist/esm/misc.js.map +1 -0
  68. package/dist/{number.js → esm/number.js} +18 -28
  69. package/dist/esm/number.js.map +1 -0
  70. package/dist/esm/opaque.js +5 -0
  71. package/dist/esm/opaque.js.map +1 -0
  72. package/dist/esm/package.json +1 -0
  73. package/dist/esm/time.js +53 -0
  74. package/dist/esm/time.js.map +1 -0
  75. package/dist/esm/transaction-types.js +3 -0
  76. package/dist/esm/transaction-types.js.map +1 -0
  77. package/dist/esm/versions.js +78 -0
  78. package/dist/esm/versions.js.map +1 -0
  79. package/dist/{assert.d.ts → types/assert.d.ts} +3 -2
  80. package/dist/types/assert.d.ts.map +1 -0
  81. package/dist/{base64.d.ts → types/base64.d.ts} +3 -2
  82. package/dist/types/base64.d.ts.map +1 -0
  83. package/dist/{bytes.d.ts → types/bytes.d.ts} +2 -1
  84. package/dist/types/bytes.d.ts.map +1 -0
  85. package/dist/types/caip-types.d.ts +93 -0
  86. package/dist/types/caip-types.d.ts.map +1 -0
  87. package/dist/types/caip-types.test-d.d.ts +2 -0
  88. package/dist/types/caip-types.test-d.d.ts.map +1 -0
  89. package/dist/{checksum.d.ts → types/checksum.d.ts} +1 -0
  90. package/dist/types/checksum.d.ts.map +1 -0
  91. package/dist/{coercers.d.ts → types/coercers.d.ts} +3 -2
  92. package/dist/types/coercers.d.ts.map +1 -0
  93. package/dist/{collections.d.ts → types/collections.d.ts} +1 -0
  94. package/dist/types/collections.d.ts.map +1 -0
  95. package/dist/{encryption-types.d.ts → types/encryption-types.d.ts} +1 -0
  96. package/dist/types/encryption-types.d.ts.map +1 -0
  97. package/dist/{hex.d.ts → types/hex.d.ts} +2 -1
  98. package/dist/types/hex.d.ts.map +1 -0
  99. package/dist/types/hex.test-d.d.ts +2 -0
  100. package/dist/types/hex.test-d.d.ts.map +1 -0
  101. package/dist/types/index.d.ts +19 -0
  102. package/dist/types/index.d.ts.map +1 -0
  103. package/dist/{json.d.ts → types/json.d.ts} +3 -2
  104. package/dist/types/json.d.ts.map +1 -0
  105. package/dist/types/json.test-d.d.ts +2 -0
  106. package/dist/types/json.test-d.d.ts.map +1 -0
  107. package/dist/{keyring.d.ts → types/keyring.d.ts} +3 -2
  108. package/dist/types/keyring.d.ts.map +1 -0
  109. package/dist/{logging.d.ts → types/logging.d.ts} +2 -1
  110. package/dist/types/logging.d.ts.map +1 -0
  111. package/dist/{misc.d.ts → types/misc.d.ts} +13 -0
  112. package/dist/types/misc.d.ts.map +1 -0
  113. package/dist/types/misc.test-d.d.ts +2 -0
  114. package/dist/types/misc.test-d.d.ts.map +1 -0
  115. package/dist/{number.d.ts → types/number.d.ts} +1 -0
  116. package/dist/types/number.d.ts.map +1 -0
  117. package/dist/{opaque.d.ts → types/opaque.d.ts} +1 -0
  118. package/dist/types/opaque.d.ts.map +1 -0
  119. package/dist/{time.d.ts → types/time.d.ts} +1 -0
  120. package/dist/types/time.d.ts.map +1 -0
  121. package/dist/{transaction-types.d.ts → types/transaction-types.d.ts} +3 -2
  122. package/dist/types/transaction-types.d.ts.map +1 -0
  123. package/dist/{versions.d.ts → types/versions.d.ts} +3 -2
  124. package/dist/types/versions.d.ts.map +1 -0
  125. package/package.json +40 -20
  126. package/dist/__fixtures__/bytes.d.ts +0 -25
  127. package/dist/__fixtures__/bytes.js +0 -234
  128. package/dist/__fixtures__/bytes.js.map +0 -1
  129. package/dist/__fixtures__/coercions.d.ts +0 -5
  130. package/dist/__fixtures__/coercions.js +0 -22
  131. package/dist/__fixtures__/coercions.js.map +0 -1
  132. package/dist/__fixtures__/index.d.ts +0 -4
  133. package/dist/__fixtures__/index.js +0 -21
  134. package/dist/__fixtures__/index.js.map +0 -1
  135. package/dist/__fixtures__/json.d.ts +0 -1226
  136. package/dist/__fixtures__/json.js +0 -1491
  137. package/dist/__fixtures__/json.js.map +0 -1
  138. package/dist/__fixtures__/numbers.d.ts +0 -5
  139. package/dist/__fixtures__/numbers.js +0 -56
  140. package/dist/__fixtures__/numbers.js.map +0 -1
  141. package/dist/assert.js.map +0 -1
  142. package/dist/base64.js.map +0 -1
  143. package/dist/bytes.js.map +0 -1
  144. package/dist/checksum.js +0 -7
  145. package/dist/checksum.js.map +0 -1
  146. package/dist/coercers.js.map +0 -1
  147. package/dist/collections.js +0 -109
  148. package/dist/collections.js.map +0 -1
  149. package/dist/encryption-types.js +0 -3
  150. package/dist/encryption-types.js.map +0 -1
  151. package/dist/hex.js +0 -134
  152. package/dist/hex.js.map +0 -1
  153. package/dist/hex.test-d.d.ts +0 -1
  154. package/dist/hex.test-d.js +0 -16
  155. package/dist/hex.test-d.js.map +0 -1
  156. package/dist/index.js +0 -34
  157. package/dist/index.js.map +0 -1
  158. package/dist/json.js +0 -346
  159. package/dist/json.js.map +0 -1
  160. package/dist/json.test-d.d.ts +0 -1
  161. package/dist/json.test-d.js +0 -62
  162. package/dist/json.test-d.js.map +0 -1
  163. package/dist/keyring.js +0 -3
  164. package/dist/keyring.js.map +0 -1
  165. package/dist/logging.js.map +0 -1
  166. package/dist/misc.js.map +0 -1
  167. package/dist/misc.test-d.d.ts +0 -1
  168. package/dist/misc.test-d.js +0 -97
  169. package/dist/misc.test-d.js.map +0 -1
  170. package/dist/number.js.map +0 -1
  171. package/dist/opaque.js +0 -3
  172. package/dist/opaque.js.map +0 -1
  173. package/dist/time.js +0 -67
  174. package/dist/time.js.map +0 -1
  175. package/dist/transaction-types.js +0 -3
  176. package/dist/transaction-types.js.map +0 -1
  177. package/dist/versions.js +0 -95
  178. package/dist/versions.js.map +0 -1
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hexToBigInt = exports.hexToNumber = exports.bigIntToHex = exports.numberToHex = void 0;
4
- const assert_1 = require("./assert");
5
- const hex_1 = require("./hex");
1
+ import { assert } from './assert';
2
+ import { add0x, assertIsHexString } from './hex';
6
3
  /**
7
4
  * Convert a number to a hexadecimal string. This verifies that the number is a
8
5
  * non-negative safe integer.
@@ -19,14 +16,12 @@ const hex_1 = require("./hex");
19
16
  * @param value - The number to convert to a hexadecimal string.
20
17
  * @returns The hexadecimal string, with the "0x"-prefix.
21
18
  * @throws If the number is not a non-negative safe integer.
22
- */
23
- const numberToHex = (value) => {
24
- (0, assert_1.assert)(typeof value === 'number', 'Value must be a number.');
25
- (0, assert_1.assert)(value >= 0, 'Value must be a non-negative number.');
26
- (0, assert_1.assert)(Number.isSafeInteger(value), 'Value is not a safe integer. Use `bigIntToHex` instead.');
27
- return (0, hex_1.add0x)(value.toString(16));
19
+ */ export const numberToHex = (value)=>{
20
+ assert(typeof value === 'number', 'Value must be a number.');
21
+ assert(value >= 0, 'Value must be a non-negative number.');
22
+ assert(Number.isSafeInteger(value), 'Value is not a safe integer. Use `bigIntToHex` instead.');
23
+ return add0x(value.toString(16));
28
24
  };
29
- exports.numberToHex = numberToHex;
30
25
  /**
31
26
  * Convert a `bigint` to a hexadecimal string. This verifies that the `bigint`
32
27
  * is a non-negative integer.
@@ -42,13 +37,11 @@ exports.numberToHex = numberToHex;
42
37
  * @param value - The `bigint` to convert to a hexadecimal string.
43
38
  * @returns The hexadecimal string, with the "0x"-prefix.
44
39
  * @throws If the `bigint` is not a non-negative integer.
45
- */
46
- const bigIntToHex = (value) => {
47
- (0, assert_1.assert)(typeof value === 'bigint', 'Value must be a bigint.');
48
- (0, assert_1.assert)(value >= 0, 'Value must be a non-negative bigint.');
49
- return (0, hex_1.add0x)(value.toString(16));
40
+ */ export const bigIntToHex = (value)=>{
41
+ assert(typeof value === 'bigint', 'Value must be a bigint.');
42
+ assert(value >= 0, 'Value must be a non-negative bigint.');
43
+ return add0x(value.toString(16));
50
44
  };
51
- exports.bigIntToHex = bigIntToHex;
52
45
  /**
53
46
  * Convert a hexadecimal string to a number. This verifies that the string is a
54
47
  * valid hex string, and that the resulting number is a safe integer. Both
@@ -67,16 +60,14 @@ exports.bigIntToHex = bigIntToHex;
67
60
  * @returns The number.
68
61
  * @throws If the value is not a valid hexadecimal string, or if the resulting
69
62
  * number is not a safe integer.
70
- */
71
- const hexToNumber = (value) => {
72
- (0, hex_1.assertIsHexString)(value);
63
+ */ export const hexToNumber = (value)=>{
64
+ assertIsHexString(value);
73
65
  // `parseInt` accepts values without the "0x"-prefix, whereas `Number` does
74
66
  // not. Using this is slightly faster than `Number(add0x(value))`.
75
67
  const numberValue = parseInt(value, 16);
76
- (0, assert_1.assert)(Number.isSafeInteger(numberValue), 'Value is not a safe integer. Use `hexToBigInt` instead.');
68
+ assert(Number.isSafeInteger(numberValue), 'Value is not a safe integer. Use `hexToBigInt` instead.');
77
69
  return numberValue;
78
70
  };
79
- exports.hexToNumber = hexToNumber;
80
71
  /**
81
72
  * Convert a hexadecimal string to a `bigint`. This verifies that the string is
82
73
  * a valid hex string. Both "0x"-prefixed and unprefixed strings are supported.
@@ -92,11 +83,10 @@ exports.hexToNumber = hexToNumber;
92
83
  * @param value - The hexadecimal string to convert to a `bigint`.
93
84
  * @returns The `bigint`.
94
85
  * @throws If the value is not a valid hexadecimal string.
95
- */
96
- const hexToBigInt = (value) => {
97
- (0, hex_1.assertIsHexString)(value);
86
+ */ export const hexToBigInt = (value)=>{
87
+ assertIsHexString(value);
98
88
  // The `BigInt` constructor requires the "0x"-prefix to parse a hex string.
99
- return BigInt((0, hex_1.add0x)(value));
89
+ return BigInt(add0x(value));
100
90
  };
101
- exports.hexToBigInt = hexToBigInt;
91
+
102
92
  //# sourceMappingURL=number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/number.ts"],"sourcesContent":["import { assert } from './assert';\nimport { add0x, assertIsHexString } from './hex';\n\n/**\n * Convert a number to a hexadecimal string. This verifies that the number is a\n * non-negative safe integer.\n *\n * To convert a `bigint` to a hexadecimal string instead, use\n * {@link bigIntToHex}.\n *\n * @example\n * ```typescript\n * numberToHex(0); // '0x0'\n * numberToHex(1); // '0x1'\n * numberToHex(16); // '0x10'\n * ```\n * @param value - The number to convert to a hexadecimal string.\n * @returns The hexadecimal string, with the \"0x\"-prefix.\n * @throws If the number is not a non-negative safe integer.\n */\nexport const numberToHex = (value: number): string => {\n assert(typeof value === 'number', 'Value must be a number.');\n assert(value >= 0, 'Value must be a non-negative number.');\n assert(\n Number.isSafeInteger(value),\n 'Value is not a safe integer. Use `bigIntToHex` instead.',\n );\n\n return add0x(value.toString(16));\n};\n\n/**\n * Convert a `bigint` to a hexadecimal string. This verifies that the `bigint`\n * is a non-negative integer.\n *\n * To convert a number to a hexadecimal string instead, use {@link numberToHex}.\n *\n * @example\n * ```typescript\n * bigIntToHex(0n); // '0x0'\n * bigIntToHex(1n); // '0x1'\n * bigIntToHex(16n); // '0x10'\n * ```\n * @param value - The `bigint` to convert to a hexadecimal string.\n * @returns The hexadecimal string, with the \"0x\"-prefix.\n * @throws If the `bigint` is not a non-negative integer.\n */\nexport const bigIntToHex = (value: bigint): string => {\n assert(typeof value === 'bigint', 'Value must be a bigint.');\n assert(value >= 0, 'Value must be a non-negative bigint.');\n\n return add0x(value.toString(16));\n};\n\n/**\n * Convert a hexadecimal string to a number. This verifies that the string is a\n * valid hex string, and that the resulting number is a safe integer. Both\n * \"0x\"-prefixed and unprefixed strings are supported.\n *\n * To convert a hexadecimal string to a `bigint` instead, use\n * {@link hexToBigInt}.\n *\n * @example\n * ```typescript\n * hexToNumber('0x0'); // 0\n * hexToNumber('0x1'); // 1\n * hexToNumber('0x10'); // 16\n * ```\n * @param value - The hexadecimal string to convert to a number.\n * @returns The number.\n * @throws If the value is not a valid hexadecimal string, or if the resulting\n * number is not a safe integer.\n */\nexport const hexToNumber = (value: string): number => {\n assertIsHexString(value);\n\n // `parseInt` accepts values without the \"0x\"-prefix, whereas `Number` does\n // not. Using this is slightly faster than `Number(add0x(value))`.\n const numberValue = parseInt(value, 16);\n\n assert(\n Number.isSafeInteger(numberValue),\n 'Value is not a safe integer. Use `hexToBigInt` instead.',\n );\n\n return numberValue;\n};\n\n/**\n * Convert a hexadecimal string to a `bigint`. This verifies that the string is\n * a valid hex string. Both \"0x\"-prefixed and unprefixed strings are supported.\n *\n * To convert a hexadecimal string to a number instead, use {@link hexToNumber}.\n *\n * @example\n * ```typescript\n * hexToBigInt('0x0'); // 0n\n * hexToBigInt('0x1'); // 1n\n * hexToBigInt('0x10'); // 16n\n * ```\n * @param value - The hexadecimal string to convert to a `bigint`.\n * @returns The `bigint`.\n * @throws If the value is not a valid hexadecimal string.\n */\nexport const hexToBigInt = (value: string): bigint => {\n assertIsHexString(value);\n\n // The `BigInt` constructor requires the \"0x\"-prefix to parse a hex string.\n return BigInt(add0x(value));\n};\n"],"names":["assert","add0x","assertIsHexString","numberToHex","value","Number","isSafeInteger","toString","bigIntToHex","hexToNumber","numberValue","parseInt","hexToBigInt","BigInt"],"mappings":"AAAA,SAASA,MAAM,QAAQ,WAAW;AAClC,SAASC,KAAK,EAAEC,iBAAiB,QAAQ,QAAQ;AAEjD;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,MAAMC,cAAc,CAACC;IAC1BJ,OAAO,OAAOI,UAAU,UAAU;IAClCJ,OAAOI,SAAS,GAAG;IACnBJ,OACEK,OAAOC,aAAa,CAACF,QACrB;IAGF,OAAOH,MAAMG,MAAMG,QAAQ,CAAC;AAC9B,EAAE;AAEF;;;;;;;;;;;;;;;CAeC,GACD,OAAO,MAAMC,cAAc,CAACJ;IAC1BJ,OAAO,OAAOI,UAAU,UAAU;IAClCJ,OAAOI,SAAS,GAAG;IAEnB,OAAOH,MAAMG,MAAMG,QAAQ,CAAC;AAC9B,EAAE;AAEF;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,MAAME,cAAc,CAACL;IAC1BF,kBAAkBE;IAElB,2EAA2E;IAC3E,kEAAkE;IAClE,MAAMM,cAAcC,SAASP,OAAO;IAEpCJ,OACEK,OAAOC,aAAa,CAACI,cACrB;IAGF,OAAOA;AACT,EAAE;AAEF;;;;;;;;;;;;;;;CAeC,GACD,OAAO,MAAME,cAAc,CAACR;IAC1BF,kBAAkBE;IAElB,2EAA2E;IAC3E,OAAOS,OAAOZ,MAAMG;AACtB,EAAE"}
@@ -0,0 +1,5 @@
1
+ // We use a symbol property name instead of { _type: Brand }, because that would show up in IDE suggestions,
2
+ // while internal symbols do not.
3
+ export { };
4
+
5
+ //# sourceMappingURL=opaque.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/opaque.ts"],"sourcesContent":["// We use a symbol property name instead of { _type: Brand }, because that would show up in IDE suggestions,\n// while internal symbols do not.\ndeclare const brand: unique symbol;\nexport type Opaque<Base, Brand extends symbol> = Base & { [brand]: Brand };\n"],"names":[],"mappings":"AAAA,4GAA4G;AAC5G,iCAAiC;AACjC,WAC2E"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Common duration constants, in milliseconds.
3
+ */ export var Duration;
4
+ (function(Duration) {
5
+ Duration[Duration[/**
6
+ * A millisecond.
7
+ */ "Millisecond"] = 1] = "Millisecond";
8
+ Duration[Duration[/**
9
+ * A second, in milliseconds.
10
+ */ "Second"] = 1000] = "Second";
11
+ Duration[Duration[/**
12
+ * A minute, in milliseconds.
13
+ */ "Minute"] = 60000] = "Minute";
14
+ Duration[Duration[/**
15
+ * An hour, in milliseconds.
16
+ */ "Hour"] = 3600000] = "Hour";
17
+ Duration[Duration[/**
18
+ * A day, in milliseconds.
19
+ */ "Day"] = 86400000] = "Day";
20
+ Duration[Duration[/**
21
+ * A week, in milliseconds.
22
+ */ "Week"] = 604800000] = "Week";
23
+ Duration[Duration[/**
24
+ * A year, in milliseconds.
25
+ */ "Year"] = 31536000000] = "Year";
26
+ })(Duration || (Duration = {}));
27
+ const isNonNegativeInteger = (number)=>Number.isInteger(number) && number >= 0;
28
+ const assertIsNonNegativeInteger = (number, name)=>{
29
+ if (!isNonNegativeInteger(number)) {
30
+ throw new Error(`"${name}" must be a non-negative integer. Received: "${number}".`);
31
+ }
32
+ };
33
+ /**
34
+ * Calculates the millisecond value of the specified number of units of time.
35
+ *
36
+ * @param count - The number of units of time.
37
+ * @param duration - The unit of time to count.
38
+ * @returns The count multiplied by the specified duration.
39
+ */ export function inMilliseconds(count, duration) {
40
+ assertIsNonNegativeInteger(count, 'count');
41
+ return count * duration;
42
+ }
43
+ /**
44
+ * Gets the milliseconds since a particular Unix epoch timestamp.
45
+ *
46
+ * @param timestamp - A Unix millisecond timestamp.
47
+ * @returns The number of milliseconds elapsed since the specified timestamp.
48
+ */ export function timeSince(timestamp) {
49
+ assertIsNonNegativeInteger(timestamp, 'timestamp');
50
+ return Date.now() - timestamp;
51
+ }
52
+
53
+ //# sourceMappingURL=time.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/time.ts"],"sourcesContent":["/**\n * Common duration constants, in milliseconds.\n */\nexport enum Duration {\n /**\n * A millisecond.\n */\n Millisecond = 1,\n\n /**\n * A second, in milliseconds.\n */\n Second = 1000, // Millisecond * 1000\n\n /**\n * A minute, in milliseconds.\n */\n Minute = 60_000, // Second * 60\n\n /**\n * An hour, in milliseconds.\n */\n Hour = 3_600_000, // Minute * 60\n\n /**\n * A day, in milliseconds.\n */\n Day = 86_400_000, // Hour * 24\n\n /**\n * A week, in milliseconds.\n */\n Week = 604_800_000, // Day * 7\n\n /**\n * A year, in milliseconds.\n */\n Year = 31_536_000_000, // Day * 365\n}\n\nconst isNonNegativeInteger = (number: number) =>\n Number.isInteger(number) && number >= 0;\n\nconst assertIsNonNegativeInteger = (number: number, name: string) => {\n if (!isNonNegativeInteger(number)) {\n throw new Error(\n `\"${name}\" must be a non-negative integer. Received: \"${number}\".`,\n );\n }\n};\n\n/**\n * Calculates the millisecond value of the specified number of units of time.\n *\n * @param count - The number of units of time.\n * @param duration - The unit of time to count.\n * @returns The count multiplied by the specified duration.\n */\nexport function inMilliseconds(count: number, duration: Duration): number {\n assertIsNonNegativeInteger(count, 'count');\n return count * duration;\n}\n\n/**\n * Gets the milliseconds since a particular Unix epoch timestamp.\n *\n * @param timestamp - A Unix millisecond timestamp.\n * @returns The number of milliseconds elapsed since the specified timestamp.\n */\nexport function timeSince(timestamp: number): number {\n assertIsNonNegativeInteger(timestamp, 'timestamp');\n return Date.now() - timestamp;\n}\n"],"names":["Duration","Millisecond","Second","Minute","Hour","Day","Week","Year","isNonNegativeInteger","number","Number","isInteger","assertIsNonNegativeInteger","name","Error","inMilliseconds","count","duration","timeSince","timestamp","Date","now"],"mappings":"AAAA;;CAEC,cACM;UAAKA,QAAQ;IAARA,SAAAA,SACV;;GAEC,GACDC,iBAAc,KAAdA;IAJUD,SAAAA,SAMV;;GAEC,GACDE,YAAS,QAATA;IATUF,SAAAA,SAWV;;GAEC,GACDG,YAAS,SAATA;IAdUH,SAAAA,SAgBV;;GAEC,GACDI,UAAO,WAAPA;IAnBUJ,SAAAA,SAqBV;;GAEC,GACDK,SAAM,YAANA;IAxBUL,SAAAA,SA0BV;;GAEC,GACDM,UAAO,aAAPA;IA7BUN,SAAAA,SA+BV;;GAEC,GACDO,UAAO,eAAPA;GAlCUP,aAAAA;AAqCZ,MAAMQ,uBAAuB,CAACC,SAC5BC,OAAOC,SAAS,CAACF,WAAWA,UAAU;AAExC,MAAMG,6BAA6B,CAACH,QAAgBI;IAClD,IAAI,CAACL,qBAAqBC,SAAS;QACjC,MAAM,IAAIK,MACR,CAAC,CAAC,EAAED,KAAK,6CAA6C,EAAEJ,OAAO,EAAE,CAAC;IAEtE;AACF;AAEA;;;;;;CAMC,GACD,OAAO,SAASM,eAAeC,KAAa,EAAEC,QAAkB;IAC9DL,2BAA2BI,OAAO;IAClC,OAAOA,QAAQC;AACjB;AAEA;;;;;CAKC,GACD,OAAO,SAASC,UAAUC,SAAiB;IACzCP,2BAA2BO,WAAW;IACtC,OAAOC,KAAKC,GAAG,KAAKF;AACtB"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=transaction-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/transaction-types.ts"],"sourcesContent":["import type { Bytes } from './bytes';\nimport type { Hex } from './hex';\n\nexport type Transaction =\n | LegacyTransaction\n | EIP2930Transaction\n | EIP1559Transaction;\n\nexport type SignedTransaction = Transaction & Signature;\n\nexport type Signature = {\n /**\n * EC signature parameter\n * 32 bytes long sequence.\n */\n r: Bytes;\n\n /**\n * EC signature parameter\n * Signature proof.\n * 32 bytes long sequence\n */\n s: Bytes;\n\n /**\n * Recovery identifier. It can be either 0x1b or 0x1c\n * 1 byte long sequence\n */\n yParity: Bytes;\n};\n\n/**\n * Base Ethereum Transaction\n */\nexport type BaseTransaction = {\n /**\n * Sequentially incrementing counter which indicates the transaction\n * number from the account\n */\n nonce: Bytes;\n\n /**\n * The address of the sender, that will be signing the transaction\n */\n from: Hex | Uint8Array;\n\n /**\n * The receiving address.\n * If an externally-owned account, the transaction will transfer value.\n * If a contract account, the transaction will execute the contract code.\n */\n to: Hex | Uint8Array;\n\n /**\n * The amount of Ether sent.\n */\n value: Bytes;\n\n /**\n * Maximum amount of gas units that this transaction can consume.\n */\n gasLimit: Bytes;\n\n /**\n * Arbitrary data.\n */\n data?: Bytes;\n};\n\n/**\n * Typed Ethereum Transaction\n */\nexport type TypedTransaction = BaseTransaction & {\n /**\n * Transaction type.\n */\n type: number;\n};\n\n/**\n * Ethereum Legacy Transaction\n * Reference: https://ethereum.org/en/developers/docs/transactions/\n */\nexport type LegacyTransaction = BaseTransaction & {\n /**\n * Transaction's gas price.\n */\n gasPrice: Bytes | null;\n};\n\n/**\n * EIP-2930 Transaction: Optional Access Lists\n * Reference: https://eips.ethereum.org/EIPS/eip-2930\n */\nexport type EIP2930Transaction = TypedTransaction & {\n /**\n * Transaction type.\n */\n type: 1;\n\n /**\n * Transaction chain ID\n */\n chainId: Bytes;\n\n /**\n * List of addresses and storage keys that the transaction plans to access\n */\n accessList:\n | { address: Hex; storageKeys: Hex[] }[]\n | { address: Uint8Array; storageKeys: Uint8Array[] }[];\n};\n\n/**\n * EIP-1559 Transaction: Fee market change for ETH 1.0 chain (Type-2)\n *\n * Reference: https://eips.ethereum.org/EIPS/eip-1559\n */\nexport type EIP1559Transaction = TypedTransaction & {\n /**\n * Transaction type.\n */\n type: 2;\n\n /**\n * Maximum fee to give to the miner\n */\n maxPriorityFeePerGas: Bytes;\n\n /**\n * Maximum total fee\n */\n maxFeePerGas: Bytes;\n};\n"],"names":[],"mappings":"AAAA,WAqIE"}
@@ -0,0 +1,78 @@
1
+ import { gt as gtSemver, gtr as gtrSemver, satisfies as satisfiesSemver, valid as validSemVerVersion, validRange as validSemVerRange } from 'semver';
2
+ import { is, refine, string } from 'superstruct';
3
+ import { assertStruct } from './assert';
4
+ /**
5
+ * A struct for validating a version string.
6
+ */ export const VersionStruct = refine(string(), 'Version', (value)=>{
7
+ if (validSemVerVersion(value) === null) {
8
+ return `Expected SemVer version, got "${value}"`;
9
+ }
10
+ return true;
11
+ });
12
+ export const VersionRangeStruct = refine(string(), 'Version range', (value)=>{
13
+ if (validSemVerRange(value) === null) {
14
+ return `Expected SemVer range, got "${value}"`;
15
+ }
16
+ return true;
17
+ });
18
+ /**
19
+ * Checks whether a SemVer version is valid.
20
+ *
21
+ * @param version - A potential version.
22
+ * @returns `true` if the version is valid, and `false` otherwise.
23
+ */ export function isValidSemVerVersion(version) {
24
+ return is(version, VersionStruct);
25
+ }
26
+ /**
27
+ * Checks whether a SemVer version range is valid.
28
+ *
29
+ * @param versionRange - A potential version range.
30
+ * @returns `true` if the version range is valid, and `false` otherwise.
31
+ */ export function isValidSemVerRange(versionRange) {
32
+ return is(versionRange, VersionRangeStruct);
33
+ }
34
+ /**
35
+ * Asserts that a value is a valid concrete SemVer version.
36
+ *
37
+ * @param version - A potential SemVer concrete version.
38
+ */ export function assertIsSemVerVersion(version) {
39
+ assertStruct(version, VersionStruct);
40
+ }
41
+ /**
42
+ * Asserts that a value is a valid SemVer range.
43
+ *
44
+ * @param range - A potential SemVer range.
45
+ */ export function assertIsSemVerRange(range) {
46
+ assertStruct(range, VersionRangeStruct);
47
+ }
48
+ /**
49
+ * Checks whether a SemVer version is greater than another.
50
+ *
51
+ * @param version1 - The left-hand version.
52
+ * @param version2 - The right-hand version.
53
+ * @returns `version1 > version2`.
54
+ */ export function gtVersion(version1, version2) {
55
+ return gtSemver(version1, version2);
56
+ }
57
+ /**
58
+ * Checks whether a SemVer version is greater than all possibilities in a range.
59
+ *
60
+ * @param version - A SemvVer version.
61
+ * @param range - The range to check against.
62
+ * @returns `version > range`.
63
+ */ export function gtRange(version, range) {
64
+ return gtrSemver(version, range);
65
+ }
66
+ /**
67
+ * Returns whether a SemVer version satisfies a SemVer range.
68
+ *
69
+ * @param version - The SemVer version to check.
70
+ * @param versionRange - The SemVer version range to check against.
71
+ * @returns Whether the version satisfied the version range.
72
+ */ export function satisfiesVersionRange(version, versionRange) {
73
+ return satisfiesSemver(version, versionRange, {
74
+ includePrerelease: true
75
+ });
76
+ }
77
+
78
+ //# sourceMappingURL=versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/versions.ts"],"sourcesContent":["import {\n gt as gtSemver,\n gtr as gtrSemver,\n satisfies as satisfiesSemver,\n valid as validSemVerVersion,\n validRange as validSemVerRange,\n} from 'semver';\nimport type { Struct } from 'superstruct';\nimport { is, refine, string } from 'superstruct';\n\nimport { assertStruct } from './assert';\nimport type { Opaque } from './opaque';\n\n/**\n * {@link https://codemix.com/opaque-types-in-javascript/ Opaque} type for SemVer ranges.\n *\n * @example Use {@link assertIsSemVerRange} and {@link isValidSemVerRange} to cast to proper type.\n * ```typescript\n * const unsafeRange: string = dataFromUser();\n * assertIsSemVerRange(unsafeRange);\n * unsafeRange\n * // ^? SemVerRange\n * ```\n * @example If you know what you're doing and want to side-step type safety, casting from a string works correctly.\n * ```typescript\n * const unsafeRange: string = dataFromUser();\n * unsafeRange as SemVerRange;\n * // ^? SemVerRange\n * ```\n * @see {@link assertIsSemVerRange}\n * @see {@link isValidSemVerRange}\n */\nexport type SemVerRange = Opaque<string, typeof semVerRange>;\ndeclare const semVerRange: unique symbol;\n\n/**\n * {@link https://codemix.com/opaque-types-in-javascript/ Opaque} type for singular SemVer version.\n *\n * @example Use {@link assertIsSemVerVersion} and {@link isValidSemVerVersion} to cast to proper type.\n * ```typescript\n * const unsafeVersion: string = dataFromUser();\n * assertIsSemVerVersion(unsafeRange);\n * unsafeVersion\n * // ^? SemVerVersion\n * ```\n * @example If you know what you're doing and want to side-step type safety, casting from a string works correctly.\n * ```typescript\n * const unsafeVersion: string = dataFromUser();\n * unsafeRange as SemVerVersion;\n * // ^? SemVerVersion\n * ```\n * @see {@link assertIsSemVerVersion}\n * @see {@link isValidSemVerVersion}\n */\nexport type SemVerVersion = Opaque<string, typeof semVerVersion>;\ndeclare const semVerVersion: unique symbol;\n\n/**\n * A struct for validating a version string.\n */\nexport const VersionStruct = refine<SemVerVersion, null>(\n string() as unknown as Struct<SemVerVersion, null>,\n 'Version',\n (value) => {\n if (validSemVerVersion(value) === null) {\n return `Expected SemVer version, got \"${value}\"`;\n }\n return true;\n },\n);\n\nexport const VersionRangeStruct = refine<SemVerRange, null>(\n string() as unknown as Struct<SemVerRange, null>,\n 'Version range',\n (value) => {\n if (validSemVerRange(value) === null) {\n return `Expected SemVer range, got \"${value}\"`;\n }\n return true;\n },\n);\n\n/**\n * Checks whether a SemVer version is valid.\n *\n * @param version - A potential version.\n * @returns `true` if the version is valid, and `false` otherwise.\n */\nexport function isValidSemVerVersion(\n version: unknown,\n): version is SemVerVersion {\n return is(version, VersionStruct);\n}\n\n/**\n * Checks whether a SemVer version range is valid.\n *\n * @param versionRange - A potential version range.\n * @returns `true` if the version range is valid, and `false` otherwise.\n */\nexport function isValidSemVerRange(\n versionRange: unknown,\n): versionRange is SemVerRange {\n return is(versionRange, VersionRangeStruct);\n}\n\n/**\n * Asserts that a value is a valid concrete SemVer version.\n *\n * @param version - A potential SemVer concrete version.\n */\nexport function assertIsSemVerVersion(\n version: unknown,\n): asserts version is SemVerVersion {\n assertStruct(version, VersionStruct);\n}\n\n/**\n * Asserts that a value is a valid SemVer range.\n *\n * @param range - A potential SemVer range.\n */\nexport function assertIsSemVerRange(\n range: unknown,\n): asserts range is SemVerRange {\n assertStruct(range, VersionRangeStruct);\n}\n\n/**\n * Checks whether a SemVer version is greater than another.\n *\n * @param version1 - The left-hand version.\n * @param version2 - The right-hand version.\n * @returns `version1 > version2`.\n */\nexport function gtVersion(\n version1: SemVerVersion,\n version2: SemVerVersion,\n): boolean {\n return gtSemver(version1, version2);\n}\n\n/**\n * Checks whether a SemVer version is greater than all possibilities in a range.\n *\n * @param version - A SemvVer version.\n * @param range - The range to check against.\n * @returns `version > range`.\n */\nexport function gtRange(version: SemVerVersion, range: SemVerRange): boolean {\n return gtrSemver(version, range);\n}\n\n/**\n * Returns whether a SemVer version satisfies a SemVer range.\n *\n * @param version - The SemVer version to check.\n * @param versionRange - The SemVer version range to check against.\n * @returns Whether the version satisfied the version range.\n */\nexport function satisfiesVersionRange(\n version: SemVerVersion,\n versionRange: SemVerRange,\n): boolean {\n return satisfiesSemver(version, versionRange, {\n includePrerelease: true,\n });\n}\n"],"names":["gt","gtSemver","gtr","gtrSemver","satisfies","satisfiesSemver","valid","validSemVerVersion","validRange","validSemVerRange","is","refine","string","assertStruct","VersionStruct","value","VersionRangeStruct","isValidSemVerVersion","version","isValidSemVerRange","versionRange","assertIsSemVerVersion","assertIsSemVerRange","range","gtVersion","version1","version2","gtRange","satisfiesVersionRange","includePrerelease"],"mappings":"AAAA,SACEA,MAAMC,QAAQ,EACdC,OAAOC,SAAS,EAChBC,aAAaC,eAAe,EAC5BC,SAASC,kBAAkB,EAC3BC,cAAcC,gBAAgB,QACzB,SAAS;AAEhB,SAASC,EAAE,EAAEC,MAAM,EAAEC,MAAM,QAAQ,cAAc;AAEjD,SAASC,YAAY,QAAQ,WAAW;AA+CxC;;CAEC,GACD,OAAO,MAAMC,gBAAgBH,OAC3BC,UACA,WACA,CAACG;IACC,IAAIR,mBAAmBQ,WAAW,MAAM;QACtC,OAAO,CAAC,8BAA8B,EAAEA,MAAM,CAAC,CAAC;IAClD;IACA,OAAO;AACT,GACA;AAEF,OAAO,MAAMC,qBAAqBL,OAChCC,UACA,iBACA,CAACG;IACC,IAAIN,iBAAiBM,WAAW,MAAM;QACpC,OAAO,CAAC,4BAA4B,EAAEA,MAAM,CAAC,CAAC;IAChD;IACA,OAAO;AACT,GACA;AAEF;;;;;CAKC,GACD,OAAO,SAASE,qBACdC,OAAgB;IAEhB,OAAOR,GAAGQ,SAASJ;AACrB;AAEA;;;;;CAKC,GACD,OAAO,SAASK,mBACdC,YAAqB;IAErB,OAAOV,GAAGU,cAAcJ;AAC1B;AAEA;;;;CAIC,GACD,OAAO,SAASK,sBACdH,OAAgB;IAEhBL,aAAaK,SAASJ;AACxB;AAEA;;;;CAIC,GACD,OAAO,SAASQ,oBACdC,KAAc;IAEdV,aAAaU,OAAOP;AACtB;AAEA;;;;;;CAMC,GACD,OAAO,SAASQ,UACdC,QAAuB,EACvBC,QAAuB;IAEvB,OAAOzB,SAASwB,UAAUC;AAC5B;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,QAAQT,OAAsB,EAAEK,KAAkB;IAChE,OAAOpB,UAAUe,SAASK;AAC5B;AAEA;;;;;;CAMC,GACD,OAAO,SAASK,sBACdV,OAAsB,EACtBE,YAAyB;IAEzB,OAAOf,gBAAgBa,SAASE,cAAc;QAC5CS,mBAAmB;IACrB;AACF"}
@@ -1,4 +1,4 @@
1
- import { Struct } from 'superstruct';
1
+ import type { Struct } from 'superstruct';
2
2
  export declare type AssertionErrorConstructor = (new (args: {
3
3
  message: string;
4
4
  }) => Error) | ((args: {
@@ -37,7 +37,7 @@ export declare function assert(value: any, message?: string | Error, ErrorWrappe
37
37
  * Defaults to {@link AssertionError}.
38
38
  * @throws If the value is not valid.
39
39
  */
40
- export declare function assertStruct<T, S>(value: unknown, struct: Struct<T, S>, errorPrefix?: string, ErrorWrapper?: AssertionErrorConstructor): asserts value is T;
40
+ export declare function assertStruct<Type, Schema>(value: unknown, struct: Struct<Type, Schema>, errorPrefix?: string, ErrorWrapper?: AssertionErrorConstructor): asserts value is Type;
41
41
  /**
42
42
  * Use in the default case of a switch that you want to be fully exhaustive.
43
43
  * Using this function forces the compiler to enforce exhaustivity during
@@ -58,3 +58,4 @@ export declare function assertStruct<T, S>(value: unknown, struct: Struct<T, S>,
58
58
  * @param _object - The object on which the switch is being operated.
59
59
  */
60
60
  export declare function assertExhaustive(_object: never): never;
61
+ //# sourceMappingURL=assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/assert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C,oBAAY,yBAAyB,GACjC,CAAC,KAAK,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,KAAK,KAAK,CAAC,GAC1C,CAAC,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,KAAK,KAAK,CAAC,CAAC;AAiE3C;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,mBAAmB;gBAEpB,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;CAGzC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CACpB,KAAK,EAAE,GAAG,EACV,OAAO,GAAE,MAAM,GAAG,KAA2B,EAE7C,YAAY,GAAE,yBAA0C,GACvD,OAAO,CAAC,KAAK,CAQf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EACvC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,EAC5B,WAAW,SAAqB,EAEhC,YAAY,GAAE,yBAA0C,GACvD,OAAO,CAAC,KAAK,IAAI,IAAI,CAMvB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,KAAK,GAAG,KAAK,CAItD"}
@@ -1,4 +1,4 @@
1
- import { Struct } from 'superstruct';
1
+ import type { Struct } from 'superstruct';
2
2
  export declare type Base64Options = {
3
3
  /**
4
4
  * Is the `=` padding at the end required or not.
@@ -21,4 +21,5 @@ export declare type Base64Options = {
21
21
  * @param options - Optional options to specialize base64 validation. See {@link Base64Options} documentation.
22
22
  * @returns A superstruct validating base64.
23
23
  */
24
- export declare const base64: <T extends string, S>(struct: Struct<T, S>, options?: Base64Options) => Struct<T, S>;
24
+ export declare const base64: <Type extends string, Schema>(struct: Struct<Type, Schema>, options?: Base64Options) => Struct<Type, Schema>;
25
+ //# sourceMappingURL=base64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src/base64.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAK1C,oBAAY,aAAa,GAAG;IAC1B;;;;OAIG;IAEH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;CACvC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,wEAER,aAAa,yBA2BvB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Hex } from './hex';
1
+ import type { Hex } from './hex';
2
2
  export declare type Bytes = bigint | number | string | Uint8Array;
3
3
  /**
4
4
  * Check if a value is a `Uint8Array`.
@@ -166,3 +166,4 @@ export declare function concatBytes(values: Bytes[]): Uint8Array;
166
166
  * @returns The {@link DataView}.
167
167
  */
168
168
  export declare function createDataView(bytes: Uint8Array): DataView;
169
+ //# sourceMappingURL=bytes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../src/bytes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAUjC,oBAAY,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AAwC1D;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,UAAU,CAEzE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAgBjD;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAKvD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAU7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAWvD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAIvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAoCpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAMvD;AAkBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,UAAU,CAqBZ;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAUvD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAIvD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,CAsBrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAqBvD;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,CAe1D"}
@@ -0,0 +1,93 @@
1
+ import type { Infer } from 'superstruct';
2
+ export declare const CAIP_CHAIN_ID_REGEX: RegExp;
3
+ export declare const CAIP_NAMESPACE_REGEX: RegExp;
4
+ export declare const CAIP_REFERENCE_REGEX: RegExp;
5
+ export declare const CAIP_ACCOUNT_ID_REGEX: RegExp;
6
+ export declare const CAIP_ACCOUNT_ADDRESS_REGEX: RegExp;
7
+ /**
8
+ * A CAIP-2 chain ID, i.e., a human-readable namespace and reference.
9
+ */
10
+ export declare const CaipChainIdStruct: import("superstruct").Struct<string, null>;
11
+ export declare type CaipChainId = `${string}:${string}`;
12
+ /**
13
+ * A CAIP-2 namespace, i.e., the first part of a CAIP chain ID.
14
+ */
15
+ export declare const CaipNamespaceStruct: import("superstruct").Struct<string, null>;
16
+ export declare type CaipNamespace = Infer<typeof CaipNamespaceStruct>;
17
+ /**
18
+ * A CAIP-2 reference, i.e., the second part of a CAIP chain ID.
19
+ */
20
+ export declare const CaipReferenceStruct: import("superstruct").Struct<string, null>;
21
+ export declare type CaipReference = Infer<typeof CaipReferenceStruct>;
22
+ /**
23
+ * A CAIP-10 account ID, i.e., a human-readable namespace, reference, and account address.
24
+ */
25
+ export declare const CaipAccountIdStruct: import("superstruct").Struct<string, null>;
26
+ export declare type CaipAccountId = `${string}:${string}:${string}`;
27
+ /**
28
+ * A CAIP-10 account address, i.e., the third part of the CAIP account ID.
29
+ */
30
+ export declare const CaipAccountAddressStruct: import("superstruct").Struct<string, null>;
31
+ export declare type CaipAccountAddress = Infer<typeof CaipAccountAddressStruct>;
32
+ /**
33
+ * Check if the given value is a {@link CaipChainId}.
34
+ *
35
+ * @param value - The value to check.
36
+ * @returns Whether the value is a {@link CaipChainId}.
37
+ */
38
+ export declare function isCaipChainId(value: unknown): value is CaipChainId;
39
+ /**
40
+ * Check if the given value is a {@link CaipNamespace}.
41
+ *
42
+ * @param value - The value to check.
43
+ * @returns Whether the value is a {@link CaipNamespace}.
44
+ */
45
+ export declare function isCaipNamespace(value: unknown): value is CaipNamespace;
46
+ /**
47
+ * Check if the given value is a {@link CaipReference}.
48
+ *
49
+ * @param value - The value to check.
50
+ * @returns Whether the value is a {@link CaipReference}.
51
+ */
52
+ export declare function isCaipReference(value: unknown): value is CaipReference;
53
+ /**
54
+ * Check if the given value is a {@link CaipAccountId}.
55
+ *
56
+ * @param value - The value to check.
57
+ * @returns Whether the value is a {@link CaipAccountId}.
58
+ */
59
+ export declare function isCaipAccountId(value: unknown): value is CaipAccountId;
60
+ /**
61
+ * Check if a value is a {@link CaipAccountAddress}.
62
+ *
63
+ * @param value - The value to validate.
64
+ * @returns True if the value is a valid {@link CaipAccountAddress}.
65
+ */
66
+ export declare function isCaipAccountAddress(value: unknown): value is CaipAccountAddress;
67
+ /**
68
+ * Parse a CAIP-2 chain ID to an object containing the namespace and reference.
69
+ * This validates the CAIP-2 chain ID before parsing it.
70
+ *
71
+ * @param caipChainId - The CAIP-2 chain ID to validate and parse.
72
+ * @returns The parsed CAIP-2 chain ID.
73
+ */
74
+ export declare function parseCaipChainId(caipChainId: CaipChainId): {
75
+ namespace: CaipNamespace;
76
+ reference: CaipReference;
77
+ };
78
+ /**
79
+ * Parse an CAIP-10 account ID to an object containing the chain ID, parsed chain ID, and account address.
80
+ * This validates the CAIP-10 account ID before parsing it.
81
+ *
82
+ * @param caipAccountId - The CAIP-10 account ID to validate and parse.
83
+ * @returns The parsed CAIP-10 account ID.
84
+ */
85
+ export declare function parseCaipAccountId(caipAccountId: CaipAccountId): {
86
+ address: CaipAccountAddress;
87
+ chainId: CaipChainId;
88
+ chain: {
89
+ namespace: CaipNamespace;
90
+ reference: CaipReference;
91
+ };
92
+ };
93
+ //# sourceMappingURL=caip-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caip-types.d.ts","sourceRoot":"","sources":["../../src/caip-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,eAAO,MAAM,mBAAmB,QACqC,CAAC;AAEtE,eAAO,MAAM,oBAAoB,QAAsB,CAAC;AAExD,eAAO,MAAM,oBAAoB,QAA2B,CAAC;AAE7D,eAAO,MAAM,qBAAqB,QACwF,CAAC;AAE3H,eAAO,MAAM,0BAA0B,QAA6B,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,iBAAiB,4CAAyC,CAAC;AACxE,oBAAY,WAAW,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAEhD;;GAEG;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EAAE,aAAa,CAAC;QAAC,SAAS,EAAE,aAAa,CAAA;KAAE,CAAC;CAC/D,CAcA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=caip-types.test-d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caip-types.test-d.d.ts","sourceRoot":"","sources":["../../src/caip-types.test-d.ts"],"names":[],"mappings":""}
@@ -1 +1,2 @@
1
1
  export declare const ChecksumStruct: import("superstruct").Struct<string, null>;
2
+ //# sourceMappingURL=checksum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checksum.d.ts","sourceRoot":"","sources":["../../src/checksum.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,4CAI1B,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Infer } from 'superstruct';
2
- import { Hex } from './hex';
1
+ import type { Infer } from 'superstruct';
2
+ import type { Hex } from './hex';
3
3
  declare const NumberLikeStruct: import("superstruct").Struct<string | number | bigint, null>;
4
4
  declare const BytesLikeStruct: import("superstruct").Struct<Uint8Array | `0x${string}`, null>;
5
5
  export declare type NumberLike = Infer<typeof NumberLikeStruct>;
@@ -94,3 +94,4 @@ export declare function createBytes(value: BytesLike): Uint8Array;
94
94
  */
95
95
  export declare function createHex(value: BytesLike): Hex;
96
96
  export {};
97
+ //# sourceMappingURL=coercers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coercers.d.ts","sourceRoot":"","sources":["../../src/coercers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAczC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,QAAA,MAAM,gBAAgB,8DAAyD,CAAC;AAIhF,QAAA,MAAM,eAAe,gEAAiD,CAAC;AASvE,oBAAY,UAAU,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACxD,oBAAY,SAAS,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAkBtD;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAetD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CAiBxD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAoB/C"}
@@ -36,3 +36,4 @@ declare class FrozenSet<Value> implements ReadonlySet<Value> {
36
36
  toString(): string;
37
37
  }
38
38
  export { FrozenMap, FrozenSet };
39
+ //# sourceMappingURL=collections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/collections.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAM,SAAS,CAAC,GAAG,EAAE,KAAK,CAAE,YAAW,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC;;IAG5D,IAAW,IAAI,WAEd;IAEM,CAAC,MAAM,CAAC,QAAQ,CAAC;gBAIZ,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,IAAI;IAKxD,OAAO;IAIP,OAAO,CACZ,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,EACvD,OAAO,CAAC,EAAE,GAAG,GACZ,IAAI;IAQA,GAAG,CAAC,GAAG,EAAE,GAAG;IAIZ,GAAG,CAAC,GAAG,EAAE,GAAG;IAIZ,IAAI;IAIJ,MAAM;IAIN,QAAQ,IAAI,MAAM;CAS1B;AAED;;;;;GAKG;AACH,cAAM,SAAS,CAAC,KAAK,CAAE,YAAW,WAAW,CAAC,KAAK,CAAC;;IAGlD,IAAW,IAAI,WAEd;IAEM,CAAC,MAAM,CAAC,QAAQ,CAAC;gBAIZ,MAAM,CAAC,EAAE,SAAS,KAAK,EAAE,GAAG,IAAI;IAKrC,OAAO;IAIP,OAAO,CACZ,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,EAC5D,OAAO,CAAC,EAAE,GAAG,GACZ,IAAI;IAQA,GAAG,CAAC,KAAK,EAAE,KAAK;IAIhB,IAAI;IAIJ,MAAM;IAIN,QAAQ,IAAI,MAAM;CAO1B;AAQD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC"}
@@ -4,3 +4,4 @@ export declare type Eip1024EncryptedData = {
4
4
  ephemPublicKey: string;
5
5
  ciphertext: string;
6
6
  };
7
+ //# sourceMappingURL=encryption-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryption-types.d.ts","sourceRoot":"","sources":["../../src/encryption-types.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Struct } from 'superstruct';
1
+ import type { Struct } from 'superstruct';
2
2
  export declare type Hex = `0x${string}`;
3
3
  export declare const HexStruct: Struct<string, null>;
4
4
  export declare const StrictHexStruct: Struct<`0x${string}`, null>;
@@ -74,3 +74,4 @@ export declare function add0x(hexadecimal: string): Hex;
74
74
  * @returns The un-prefixed hexadecimal string.
75
75
  */
76
76
  export declare function remove0x(hexadecimal: string): string;
77
+ //# sourceMappingURL=hex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../src/hex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAM1C,oBAAY,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAEhC,eAAO,MAAM,SAAS,sBAA4C,CAAC;AACnE,eAAO,MAAM,eAAe,6BAG3B,CAAC;AACF,eAAO,MAAM,gBAAgB,6BAGP,CAAC;AACvB,eAAO,MAAM,wBAAwB,6BAGf,CAAC;AAEvB;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,GAAG,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAEzE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,GAAG,CAK5E;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,GAAG,WAKrD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,GAAG,UAc9C;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,GAAG,WAM3D;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAU9C;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAMpD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=hex.test-d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hex.test-d.d.ts","sourceRoot":"","sources":["../../src/hex.test-d.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ export * from './assert';
2
+ export * from './base64';
3
+ export * from './bytes';
4
+ export * from './caip-types';
5
+ export * from './checksum';
6
+ export * from './coercers';
7
+ export * from './collections';
8
+ export * from './encryption-types';
9
+ export * from './hex';
10
+ export * from './json';
11
+ export * from './keyring';
12
+ export * from './logging';
13
+ export * from './misc';
14
+ export * from './number';
15
+ export * from './opaque';
16
+ export * from './time';
17
+ export * from './transaction-types';
18
+ export * from './versions';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Infer, Struct } from 'superstruct';
2
- import { AssertionErrorConstructor } from './assert';
1
+ import type { Infer, Struct } from 'superstruct';
2
+ import type { AssertionErrorConstructor } from './assert';
3
3
  /**
4
4
  * Any JSON-compatible value.
5
5
  */
@@ -345,3 +345,4 @@ declare type JsonRpcValidatorOptions = {
345
345
  */
346
346
  export declare function getJsonRpcIdValidator(options?: JsonRpcValidatorOptions): (id: unknown) => id is string | number | null;
347
347
  export {};
348
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/json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
+ //# sourceMappingURL=json.test-d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.test-d.d.ts","sourceRoot":"","sources":["../../src/json.test-d.ts"],"names":[],"mappings":""}
@@ -1,7 +1,7 @@
1
1
  import type { TypedTransaction, TxData } from '@ethereumjs/tx';
2
2
  import type { Eip1024EncryptedData } from './encryption-types';
3
- import { Hex } from './hex';
4
- import { Json } from './json';
3
+ import type { Hex } from './hex';
4
+ import type { Json } from './json';
5
5
  /**
6
6
  * A Keyring class.
7
7
  *
@@ -221,3 +221,4 @@ export declare type Keyring<State extends Json> = {
221
221
  */
222
222
  destroy?(): Promise<void>;
223
223
  };
224
+ //# sourceMappingURL=keyring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyring.d.ts","sourceRoot":"","sources":["../../src/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC;;;;;;GAMG;AACH,oBAAY,YAAY,CAAC,KAAK,SAAS,IAAI,IAAI;IAC7C;;;;;;;OAOG;IACH,KAAK,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAExD;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,oBAAY,OAAO,CAAC,KAAK,SAAS,IAAI,IAAI;IACxC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAE9B;;;;;OAKG;IACH,WAAW,C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E,OAAO,CAAC,GACvD,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,aAAa,CAAC,CACZ,OAAO,EAAE,GAAG,EACZ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB;;;;;;;;;;;;OAYG;IACH,sBAAsB,CAAC,CACrB,OAAO,EAAE,GAAG,EACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB;;;;;;;;;OASG;IACH,cAAc,CAAC,CACb,OAAO,EAAE,GAAG,EACZ,aAAa,EAAE,oBAAoB,GAClC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB;;;OAGG;IACH,sBAAsB,CAAC,IAAI,IAAI,CAAC;IAEhC;;OAEG;IACH,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Debugger } from 'debug';
1
+ import type { Debugger } from 'debug';
2
2
  /**
3
3
  * Creates a logger via the `debug` library whose log messages will be tagged
4
4
  * using the name of your project. By default, such messages will be
@@ -27,3 +27,4 @@ export declare function createProjectLogger(projectName: string): Debugger;
27
27
  * @returns An instance of `debug`.
28
28
  */
29
29
  export declare function createModuleLogger(projectLogger: Debugger, moduleName: string): Debugger;
30
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/logging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAKtC;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAEjE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,QAAQ,EACvB,UAAU,EAAE,MAAM,GACjB,QAAQ,CAEV"}