@metamask/utils 6.1.0 → 6.2.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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [6.2.0]
10
+ ### Added
11
+ - Add address related utils ([#112](https://github.com/MetaMask/utils/pull/112))
12
+ - `isValidHexAddress` has been added to check the validity of an hex address
13
+ - `getChecksumAddress` has been added to calculate the ERC-55 mixed-case checksum of an hex address
14
+ - `isValidChecksumAddress` has been added to check the validity of an ERC-55 mixed-case checksum address
15
+
9
16
  ## [6.1.0]
10
17
  ### Added
11
18
  - Add optional `destroy` method to `Keyring` type ([#108](https://github.com/MetaMask/utils/pull/108))
@@ -158,7 +165,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
158
165
  ### Added
159
166
  - Initial release
160
167
 
161
- [Unreleased]: https://github.com/MetaMask/utils/compare/v6.1.0...HEAD
168
+ [Unreleased]: https://github.com/MetaMask/utils/compare/v6.2.0...HEAD
169
+ [6.2.0]: https://github.com/MetaMask/utils/compare/v6.1.0...v6.2.0
162
170
  [6.1.0]: https://github.com/MetaMask/utils/compare/v6.0.1...v6.1.0
163
171
  [6.0.1]: https://github.com/MetaMask/utils/compare/v6.0.0...v6.0.1
164
172
  [6.0.0]: https://github.com/MetaMask/utils/compare/v5.0.2...v6.0.0
package/dist/hex.d.ts CHANGED
@@ -2,6 +2,8 @@ import { 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>;
5
+ export declare const HexAddressStruct: Struct<`0x${string}`, null>;
6
+ export declare const HexChecksumAddressStruct: Struct<`0x${string}`, null>;
5
7
  /**
6
8
  * Check if a string is a valid hex string.
7
9
  *
@@ -32,6 +34,30 @@ export declare function assertIsHexString(value: unknown): asserts value is stri
32
34
  * @throws If the value is not a valid hex string.
33
35
  */
34
36
  export declare function assertIsStrictHexString(value: unknown): asserts value is Hex;
37
+ /**
38
+ * Validate that the passed prefixed hex string is an all-lowercase
39
+ * hex address, or a valid mixed-case checksum address.
40
+ *
41
+ * @param possibleAddress - Input parameter to check against.
42
+ * @returns Whether or not the input is a valid hex address.
43
+ */
44
+ export declare function isValidHexAddress(possibleAddress: Hex): boolean;
45
+ /**
46
+ * Encode a passed hex string as an ERC-55 mixed-case checksum address.
47
+ *
48
+ * @param address - The hex address to encode.
49
+ * @returns The address encoded according to ERC-55.
50
+ * @see https://eips.ethereum.org/EIPS/eip-55
51
+ */
52
+ export declare function getChecksumAddress(address: Hex): string;
53
+ /**
54
+ * Validate that the passed hex string is a valid ERC-55 mixed-case
55
+ * checksum address.
56
+ *
57
+ * @param possibleChecksum - The hex address to check.
58
+ * @returns True if the address is a checksum address.
59
+ */
60
+ export declare function isValidChecksumAddress(possibleChecksum: Hex): boolean;
35
61
  /**
36
62
  * Add the `0x`-prefix to a hexadecimal string. If the string already has the
37
63
  * prefix, it is returned as-is.
package/dist/hex.js CHANGED
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.remove0x = exports.add0x = exports.assertIsStrictHexString = exports.assertIsHexString = exports.isStrictHexString = exports.isHexString = exports.StrictHexStruct = exports.HexStruct = void 0;
3
+ exports.remove0x = exports.add0x = exports.isValidChecksumAddress = exports.getChecksumAddress = exports.isValidHexAddress = exports.assertIsStrictHexString = exports.assertIsHexString = exports.isStrictHexString = exports.isHexString = exports.HexChecksumAddressStruct = exports.HexAddressStruct = exports.StrictHexStruct = exports.HexStruct = void 0;
4
+ const sha3_1 = require("@noble/hashes/sha3");
4
5
  const superstruct_1 = require("superstruct");
5
6
  const assert_1 = require("./assert");
7
+ const bytes_1 = require("./bytes");
6
8
  exports.HexStruct = (0, superstruct_1.pattern)((0, superstruct_1.string)(), /^(?:0x)?[0-9a-f]+$/iu);
7
9
  exports.StrictHexStruct = (0, superstruct_1.pattern)((0, superstruct_1.string)(), /^0x[0-9a-f]+$/iu);
10
+ exports.HexAddressStruct = (0, superstruct_1.pattern)((0, superstruct_1.string)(), /^0x[0-9a-f]{40}$/u);
11
+ exports.HexChecksumAddressStruct = (0, superstruct_1.pattern)((0, superstruct_1.string)(), /^0x[0-9a-fA-F]{40}$/u);
8
12
  /**
9
13
  * Check if a string is a valid hex string.
10
14
  *
@@ -47,6 +51,55 @@ function assertIsStrictHexString(value) {
47
51
  (0, assert_1.assert)(isStrictHexString(value), 'Value must be a hexadecimal string, starting with "0x".');
48
52
  }
49
53
  exports.assertIsStrictHexString = assertIsStrictHexString;
54
+ /**
55
+ * Validate that the passed prefixed hex string is an all-lowercase
56
+ * hex address, or a valid mixed-case checksum address.
57
+ *
58
+ * @param possibleAddress - Input parameter to check against.
59
+ * @returns Whether or not the input is a valid hex address.
60
+ */
61
+ function isValidHexAddress(possibleAddress) {
62
+ return ((0, superstruct_1.is)(possibleAddress, exports.HexAddressStruct) ||
63
+ isValidChecksumAddress(possibleAddress));
64
+ }
65
+ exports.isValidHexAddress = isValidHexAddress;
66
+ /**
67
+ * Encode a passed hex string as an ERC-55 mixed-case checksum address.
68
+ *
69
+ * @param address - The hex address to encode.
70
+ * @returns The address encoded according to ERC-55.
71
+ * @see https://eips.ethereum.org/EIPS/eip-55
72
+ */
73
+ function getChecksumAddress(address) {
74
+ (0, assert_1.assert)((0, superstruct_1.is)(address, exports.HexChecksumAddressStruct), 'Invalid hex address.');
75
+ const unPrefixed = remove0x(address.toLowerCase());
76
+ const unPrefixedHash = remove0x((0, bytes_1.bytesToHex)((0, sha3_1.keccak_256)(unPrefixed)));
77
+ return `0x${unPrefixed
78
+ .split('')
79
+ .map((character, nibbleIndex) => {
80
+ const hashCharacter = unPrefixedHash[nibbleIndex];
81
+ (0, assert_1.assert)((0, superstruct_1.is)(hashCharacter, (0, superstruct_1.string)()), 'Hash shorter than address.');
82
+ return parseInt(hashCharacter, 16) > 7
83
+ ? character.toUpperCase()
84
+ : character;
85
+ })
86
+ .join('')}`;
87
+ }
88
+ exports.getChecksumAddress = getChecksumAddress;
89
+ /**
90
+ * Validate that the passed hex string is a valid ERC-55 mixed-case
91
+ * checksum address.
92
+ *
93
+ * @param possibleChecksum - The hex address to check.
94
+ * @returns True if the address is a checksum address.
95
+ */
96
+ function isValidChecksumAddress(possibleChecksum) {
97
+ if (!(0, superstruct_1.is)(possibleChecksum, exports.HexChecksumAddressStruct)) {
98
+ return false;
99
+ }
100
+ return getChecksumAddress(possibleChecksum) === possibleChecksum;
101
+ }
102
+ exports.isValidChecksumAddress = isValidChecksumAddress;
50
103
  /**
51
104
  * Add the `0x`-prefix to a hexadecimal string. If the string already has the
52
105
  * prefix, it is returned as-is.
package/dist/hex.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"hex.js","sourceRoot":"","sources":["../src/hex.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;AAE1D,qCAAkC;AAIrB,QAAA,SAAS,GAAG,IAAA,qBAAO,EAAC,IAAA,oBAAM,GAAE,EAAE,sBAAsB,CAAC,CAAC;AACtD,QAAA,eAAe,GAAG,IAAA,qBAAO,EAAC,IAAA,oBAAM,GAAE,EAAE,iBAAiB,CAGjE,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,KAAc;IACxC,OAAO,IAAA,gBAAE,EAAC,KAAK,EAAE,iBAAS,CAAC,CAAC;AAC9B,CAAC;AAFD,kCAEC;AAED;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAC,KAAc;IAC9C,OAAO,IAAA,gBAAE,EAAC,KAAK,EAAE,uBAAe,CAAC,CAAC;AACpC,CAAC;AAFD,8CAEC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,KAAc;IAC9C,IAAA,eAAM,EAAC,WAAW,CAAC,KAAK,CAAC,EAAE,qCAAqC,CAAC,CAAC;AACpE,CAAC;AAFD,8CAEC;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CAAC,KAAc;IACpD,IAAA,eAAM,EACJ,iBAAiB,CAAC,KAAK,CAAC,EACxB,yDAAyD,CAC1D,CAAC;AACJ,CAAC;AALD,0DAKC;AAED;;;;;;GAMG;AACH,SAAgB,KAAK,CAAC,WAAmB;IACvC,IAAI,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QAChC,OAAO,WAAkB,CAAC;KAC3B;IAED,IAAI,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QAChC,OAAO,KAAK,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;KACxC;IAED,OAAO,KAAK,WAAW,EAAE,CAAC;AAC5B,CAAC;AAVD,sBAUC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,WAAmB;IAC1C,IAAI,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QAChE,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KACjC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAND,4BAMC","sourcesContent":["import { is, pattern, string, Struct } from 'superstruct';\n\nimport { assert } from './assert';\n\nexport type Hex = `0x${string}`;\n\nexport const HexStruct = pattern(string(), /^(?:0x)?[0-9a-f]+$/iu);\nexport const StrictHexStruct = pattern(string(), /^0x[0-9a-f]+$/iu) as Struct<\n Hex,\n null\n>;\n\n/**\n * Check if a string is a valid hex string.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid hex string.\n */\nexport function isHexString(value: unknown): value is string {\n return is(value, HexStruct);\n}\n\n/**\n * Strictly check if a string is a valid hex string. A valid hex string must\n * start with the \"0x\"-prefix.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid hex string.\n */\nexport function isStrictHexString(value: unknown): value is Hex {\n return is(value, StrictHexStruct);\n}\n\n/**\n * Assert that a value is a valid hex string.\n *\n * @param value - The value to check.\n * @throws If the value is not a valid hex string.\n */\nexport function assertIsHexString(value: unknown): asserts value is string {\n assert(isHexString(value), 'Value must be a hexadecimal string.');\n}\n\n/**\n * Assert that a value is a valid hex string. A valid hex string must start with\n * the \"0x\"-prefix.\n *\n * @param value - The value to check.\n * @throws If the value is not a valid hex string.\n */\nexport function assertIsStrictHexString(value: unknown): asserts value is Hex {\n assert(\n isStrictHexString(value),\n 'Value must be a hexadecimal string, starting with \"0x\".',\n );\n}\n\n/**\n * Add the `0x`-prefix to a hexadecimal string. If the string already has the\n * prefix, it is returned as-is.\n *\n * @param hexadecimal - The hexadecimal string to add the prefix to.\n * @returns The prefixed hexadecimal string.\n */\nexport function add0x(hexadecimal: string): Hex {\n if (hexadecimal.startsWith('0x')) {\n return hexadecimal as Hex;\n }\n\n if (hexadecimal.startsWith('0X')) {\n return `0x${hexadecimal.substring(2)}`;\n }\n\n return `0x${hexadecimal}`;\n}\n\n/**\n * Remove the `0x`-prefix from a hexadecimal string. If the string doesn't have\n * the prefix, it is returned as-is.\n *\n * @param hexadecimal - The hexadecimal string to remove the prefix from.\n * @returns The un-prefixed hexadecimal string.\n */\nexport function remove0x(hexadecimal: string): string {\n if (hexadecimal.startsWith('0x') || hexadecimal.startsWith('0X')) {\n return hexadecimal.substring(2);\n }\n\n return hexadecimal;\n}\n"]}
1
+ {"version":3,"file":"hex.js","sourceRoot":"","sources":["../src/hex.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAC7D,6CAA0D;AAE1D,qCAAkC;AAClC,mCAAqC;AAIxB,QAAA,SAAS,GAAG,IAAA,qBAAO,EAAC,IAAA,oBAAM,GAAE,EAAE,sBAAsB,CAAC,CAAC;AACtD,QAAA,eAAe,GAAG,IAAA,qBAAO,EAAC,IAAA,oBAAM,GAAE,EAAE,iBAAiB,CAGjE,CAAC;AACW,QAAA,gBAAgB,GAAG,IAAA,qBAAO,EACrC,IAAA,oBAA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OAAO,WAAW,CAAC;AACrB,CAAC;AAND,4BAMC","sourcesContent":["import { keccak_256 as keccak256 } from '@noble/hashes/sha3';\nimport { is, pattern, string, Struct } from 'superstruct';\n\nimport { assert } from './assert';\nimport { bytesToHex } from './bytes';\n\nexport type Hex = `0x${string}`;\n\nexport const HexStruct = pattern(string(), /^(?:0x)?[0-9a-f]+$/iu);\nexport const StrictHexStruct = pattern(string(), /^0x[0-9a-f]+$/iu) as Struct<\n Hex,\n null\n>;\nexport const HexAddressStruct = pattern(\n string(),\n /^0x[0-9a-f]{40}$/u,\n) as Struct<Hex, null>;\nexport const HexChecksumAddressStruct = pattern(\n string(),\n /^0x[0-9a-fA-F]{40}$/u,\n) as Struct<Hex, null>;\n\n/**\n * Check if a string is a valid hex string.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid hex string.\n */\nexport function isHexString(value: unknown): value is string {\n return is(value, HexStruct);\n}\n\n/**\n * Strictly check if a string is a valid hex string. A valid hex string must\n * start with the \"0x\"-prefix.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid hex string.\n */\nexport function isStrictHexString(value: unknown): value is Hex {\n return is(value, StrictHexStruct);\n}\n\n/**\n * Assert that a value is a valid hex string.\n *\n * @param value - The value to check.\n * @throws If the value is not a valid hex string.\n */\nexport function assertIsHexString(value: unknown): asserts value is string {\n assert(isHexString(value), 'Value must be a hexadecimal string.');\n}\n\n/**\n * Assert that a value is a valid hex string. A valid hex string must start with\n * the \"0x\"-prefix.\n *\n * @param value - The value to check.\n * @throws If the value is not a valid hex string.\n */\nexport function assertIsStrictHexString(value: unknown): asserts value is Hex {\n assert(\n isStrictHexString(value),\n 'Value must be a hexadecimal string, starting with \"0x\".',\n );\n}\n\n/**\n * Validate that the passed prefixed hex string is an all-lowercase\n * hex address, or a valid mixed-case checksum address.\n *\n * @param possibleAddress - Input parameter to check against.\n * @returns Whether or not the input is a valid hex address.\n */\nexport function isValidHexAddress(possibleAddress: Hex) {\n return (\n is(possibleAddress, HexAddressStruct) ||\n isValidChecksumAddress(possibleAddress)\n );\n}\n\n/**\n * Encode a passed hex string as an ERC-55 mixed-case checksum address.\n *\n * @param address - The hex address to encode.\n * @returns The address encoded according to ERC-55.\n * @see https://eips.ethereum.org/EIPS/eip-55\n */\nexport function getChecksumAddress(address: Hex) {\n assert(is(address, HexChecksumAddressStruct), 'Invalid hex address.');\n const unPrefixed = remove0x(address.toLowerCase());\n const unPrefixedHash = remove0x(bytesToHex(keccak256(unPrefixed)));\n return `0x${unPrefixed\n .split('')\n .map((character, nibbleIndex) => {\n const hashCharacter = unPrefixedHash[nibbleIndex];\n assert(is(hashCharacter, string()), 'Hash shorter than address.');\n return parseInt(hashCharacter, 16) > 7\n ? character.toUpperCase()\n : character;\n })\n .join('')}`;\n}\n\n/**\n * Validate that the passed hex string is a valid ERC-55 mixed-case\n * checksum address.\n *\n * @param possibleChecksum - The hex address to check.\n * @returns True if the address is a checksum address.\n */\nexport function isValidChecksumAddress(possibleChecksum: Hex) {\n if (!is(possibleChecksum, HexChecksumAddressStruct)) {\n return false;\n }\n\n return getChecksumAddress(possibleChecksum) === possibleChecksum;\n}\n\n/**\n * Add the `0x`-prefix to a hexadecimal string. If the string already has the\n * prefix, it is returned as-is.\n *\n * @param hexadecimal - The hexadecimal string to add the prefix to.\n * @returns The prefixed hexadecimal string.\n */\nexport function add0x(hexadecimal: string): Hex {\n if (hexadecimal.startsWith('0x')) {\n return hexadecimal as Hex;\n }\n\n if (hexadecimal.startsWith('0X')) {\n return `0x${hexadecimal.substring(2)}`;\n }\n\n return `0x${hexadecimal}`;\n}\n\n/**\n * Remove the `0x`-prefix from a hexadecimal string. If the string doesn't have\n * the prefix, it is returned as-is.\n *\n * @param hexadecimal - The hexadecimal string to remove the prefix from.\n * @returns The un-prefixed hexadecimal string.\n */\nexport function remove0x(hexadecimal: string): string {\n if (hexadecimal.startsWith('0x') || hexadecimal.startsWith('0X')) {\n return hexadecimal.substring(2);\n }\n\n return hexadecimal;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/utils",
3
- "version": "6.1.0",
3
+ "version": "6.2.0",
4
4
  "description": "Various JavaScript/TypeScript utilities of wide relevance to the MetaMask codebase",
5
5
  "homepage": "https://github.com/MetaMask/utils#readme",
6
6
  "bugs": {
@@ -38,6 +38,7 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@ethereumjs/tx": "^4.1.2",
41
+ "@noble/hashes": "^1.3.1",
41
42
  "@types/debug": "^4.1.7",
42
43
  "debug": "^4.3.4",
43
44
  "semver": "^7.3.8",