@metamask-previews/eth-snap-keyring 4.3.6-d5a036e → 4.4.0-f9cd26b
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 +13 -1
- package/LICENSE +18 -0
- package/dist/util.js +1 -2
- package/dist/util.js.map +1 -1
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [4.4.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Sanitize redirect URL ([#70](https://github.com/MetaMask/accounts/pull/70))
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Bump `@metamask/*` dependencies and add `@lavamoat/preinstall-always-fail` ([#65](https://github.com/MetaMask/accounts/pull/65)), ([#59](https://github.com/MetaMask/accounts/pull/59)), ([#58](https://github.com/MetaMask/accounts/pull/58))
|
|
19
|
+
- Use TypeScript 5 ([#55](https://github.com/MetaMask/accounts/pull/55))
|
|
20
|
+
|
|
10
21
|
## [4.3.6]
|
|
11
22
|
|
|
12
23
|
### Changed
|
|
@@ -342,7 +353,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
342
353
|
|
|
343
354
|
- Initial release.
|
|
344
355
|
|
|
345
|
-
[Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/eth-snap-keyring@4.
|
|
356
|
+
[Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/eth-snap-keyring@4.4.0...HEAD
|
|
357
|
+
[4.4.0]: https://github.com/MetaMask/accounts/compare/@metamask/eth-snap-keyring@4.3.6...@metamask/eth-snap-keyring@4.4.0
|
|
346
358
|
[4.3.6]: https://github.com/MetaMask/accounts/compare/@metamask/eth-snap-keyring@4.3.5...@metamask/eth-snap-keyring@4.3.6
|
|
347
359
|
[4.3.5]: https://github.com/MetaMask/accounts/compare/@metamask/eth-snap-keyring@4.3.4...@metamask/eth-snap-keyring@4.3.5
|
|
348
360
|
[4.3.4]: https://github.com/MetaMask/accounts/compare/@metamask/eth-snap-keyring@4.3.3...@metamask/eth-snap-keyring@4.3.4
|
package/LICENSE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Copyright ConsenSys Software Inc. 2022. All rights reserved.
|
|
2
|
+
|
|
3
|
+
You acknowledge and agree that ConsenSys Software Inc. (“ConsenSys”) (or ConsenSys’s licensors) own all legal right, title and interest in and to the work, software, application, source code, documentation and any other documents in this repository (collectively, the “Program”), including any intellectual property rights which subsist in the Program (whether those rights happen to be registered or not, and wherever in the world those rights may exist), whether in source code or any other form.
|
|
4
|
+
|
|
5
|
+
Subject to the limited license below, you may not (and you may not permit anyone else to) distribute, publish, copy, modify, merge, combine with another program, create derivative works of, reverse engineer, decompile or otherwise attempt to extract the source code of, the Program or any part thereof, except that you may contribute to this repository.
|
|
6
|
+
|
|
7
|
+
You are granted a non-exclusive, non-transferable, non-sublicensable license to distribute, publish, copy, modify, merge, combine with another program or create derivative works of the Program (such resulting program, collectively, the “Resulting Program”) solely for Non-Commercial Use as long as you:
|
|
8
|
+
1. give prominent notice (“Notice”) with each copy of the Resulting Program that the Program is used in the Resulting Program and that the Program is the copyright of ConsenSys; and
|
|
9
|
+
2. subject the Resulting Program and any distribution, publication, copy, modification, merger therewith, combination with another program or derivative works thereof to the same Notice requirement and Non-Commercial Use restriction set forth herein.
|
|
10
|
+
|
|
11
|
+
“Non-Commercial Use” means each use as described in clauses (1)-(3) below, as reasonably determined by ConsenSys in its sole discretion:
|
|
12
|
+
1. personal use for research, personal study, private entertainment, hobby projects or amateur pursuits, in each case without any anticipated commercial application;
|
|
13
|
+
2. use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization or government institution; or
|
|
14
|
+
3. the number of monthly active users of the Resulting Program across all versions thereof and platforms globally do not exceed 10,000 at any time.
|
|
15
|
+
|
|
16
|
+
You will not use any trade mark, service mark, trade name, logo of ConsenSys or any other company or organization in a way that is likely or intended to cause confusion about the owner or authorized user of such marks, names or logos.
|
|
17
|
+
|
|
18
|
+
If you have any questions, comments or interest in pursuing any other use cases, please reach out to us at communications@metamask.io.
|
package/dist/util.js
CHANGED
|
@@ -80,8 +80,7 @@ exports.equalsIgnoreCase = equalsIgnoreCase;
|
|
|
80
80
|
* @returns The new sanitized redirect URL.
|
|
81
81
|
*/
|
|
82
82
|
function sanitizeUrl(url) {
|
|
83
|
-
//
|
|
84
|
-
// upper-cased letters by their lower-cased counterparts in the "hostname" part.
|
|
83
|
+
// We use a `URL` object to detect any badly formatted URL and to normalize/sanitize them.
|
|
85
84
|
const saferUrl = new URL(url);
|
|
86
85
|
return saferUrl.toString();
|
|
87
86
|
}
|
package/dist/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;AACA,uDAA+C;AAG/C;;;;;;;;;;GAUG;AACH,SAAgB,UAAU,CACxB,KAAc,EACd,MAA4B,EAC5B,OAAgB;IAEhB,IAAA,oBAAM,EAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,KAAK,CAAC;AACf,CAAC;AAPD,gCAOC;AAED;;;;;GAKG;AACH,SAAgB,MAAM,CAAO,KAA8B;IACzD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7B,CAAC;AAFD,wBAEC;AAED;;;;;;;;;GASG;AACH,SAAgB,MAAM,CAA2B,KAAU;IACzD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAS,CAAC;AACnD,CAAC;AAFD,wBAEC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,KAAuB;IAEvB,IAAI,KAAK,KA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CAAC,OAAe;IACxC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC;AAFD,gCAEC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,CAAS,EAAE,CAAS;IACnD,OAAO,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7C,CAAC;AAFD,4CAEC;AAED;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,GAAW;IACrC,0FAA0F;IAC1F,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAC7B,CAAC;AAJD,kCAIC","sourcesContent":["import type { Struct } from '@metamask/superstruct';\nimport { assert } from '@metamask/superstruct';\nimport type { Json } from '@metamask/utils';\n\n/**\n * Assert that a value is valid according to a struct.\n *\n * It is similar to superstruct's mask function, but it does not ignore extra\n * properties.\n *\n * @param value - Value to check.\n * @param struct - Struct to validate the value against.\n * @param message - Error message to throw if the value is not valid.\n * @returns The value if it is valid.\n */\nexport function strictMask<Type, Schema>(\n value: unknown,\n struct: Struct<Type, Schema>,\n message?: string,\n): Type {\n assert(value, struct, message);\n return value;\n}\n\n/**\n * Remove duplicate entries from an array.\n *\n * @param array - Array to remove duplicates from.\n * @returns Array with duplicates removed.\n */\nexport function unique<Type>(array: Type[] | Iterable<Type>): Type[] {\n return [...new Set(array)];\n}\n\n/**\n * Convert a value to a valid JSON object.\n *\n * The function chains JSON.stringify and JSON.parse to ensure that the result\n * is a valid JSON object. In objects, undefined values are removed, and in\n * arrays, they are replaced with null.\n *\n * @param value - Value to convert to JSON.\n * @returns JSON representation of the value.\n */\nexport function toJson<Type extends Json = Json>(value: any): Type {\n return JSON.parse(JSON.stringify(value)) as Type;\n}\n\n/**\n * Asserts that the given value is defined.\n *\n * @param value - Value to check.\n */\nexport function ensureDefined<Type>(\n value: Type | undefined,\n): asserts value is Type {\n if (value === undefined) {\n throw new Error('Argument is undefined');\n }\n}\n\n/**\n * Helper function that throws an error.\n *\n * @param message - Error message to throw.\n */\nexport function throwError(message: string): never {\n throw new Error(message);\n}\n\n/**\n * Compares two strings for equality, ignoring case.\n *\n * @param a - The first string to compare.\n * @param b - The second string to compare.\n * @returns `true` if the strings are equal, ignoring case. `false` otherwise.\n */\nexport function equalsIgnoreCase(a: string, b: string): boolean {\n return a.toLowerCase() === b.toLowerCase();\n}\n\n/**\n * Sanitize a URL.\n *\n * @param url - The URL to sanitize.\n * @returns The new sanitized redirect URL.\n */\nexport function sanitizeUrl(url: string): string {\n // We use a `URL` object to detect any badly formatted URL and to normalize/sanitize them.\n const saferUrl = new URL(url);\n return saferUrl.toString();\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/eth-snap-keyring",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0-f9cd26b",
|
|
4
4
|
"description": "Snaps keyring bridge.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,13 +21,12 @@
|
|
|
21
21
|
"publish:preview": "yarn npm publish --tag preview",
|
|
22
22
|
"test": "jest && jest-it-up",
|
|
23
23
|
"test:clean": "jest --clearCache",
|
|
24
|
-
"test:verbose": "jest --verbose",
|
|
25
24
|
"test:watch": "jest --watch"
|
|
26
25
|
},
|
|
27
26
|
"dependencies": {
|
|
28
27
|
"@ethereumjs/tx": "^4.2.0",
|
|
29
|
-
"@metamask/eth-sig-util": "^
|
|
30
|
-
"@metamask/keyring-api": "
|
|
28
|
+
"@metamask/eth-sig-util": "^8.0.0",
|
|
29
|
+
"@metamask/keyring-api": "9.0.0",
|
|
31
30
|
"@metamask/snaps-controllers": "^9.10.0",
|
|
32
31
|
"@metamask/snaps-sdk": "^6.7.0",
|
|
33
32
|
"@metamask/snaps-utils": "^8.3.0",
|