Socket
Socket
Sign inDemoInstall

@metamask/snaps-registry

Package Overview
Dependencies
Maintainers
12
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/snaps-registry - npm Package Compare versions

Comparing version 2.1.1 to 3.0.0

11

CHANGELOG.md

@@ -9,2 +9,10 @@ # Changelog

## [3.0.0]
### Changed
- **BREAKING:** Bump minimum Node.js version to `^18.16.0` ([#302](https://github.com/MetaMask/snaps-registry/pull/302))
- **BREAKING:** Use `noble-hashes` and `noble-curves` ([#315](https://github.com/MetaMask/snaps-registry/pull/315))
- This is breaking as the exported `verify` function is no longer asynchronous.
- This also improves compatibility with React Native.
- Add more metadata fields ([#316](https://github.com/MetaMask/snaps-registry/pull/316))
## [2.1.1]

@@ -51,3 +59,4 @@ ### Fixed

[Unreleased]: https://github.com/MetaMask/snaps-registry/compare/v2.1.1...HEAD
[Unreleased]: https://github.com/MetaMask/snaps-registry/compare/v3.0.0...HEAD
[3.0.0]: https://github.com/MetaMask/snaps-registry/compare/v2.1.1...v3.0.0
[2.1.1]: https://github.com/MetaMask/snaps-registry/compare/v2.1.0...v2.1.1

@@ -54,0 +63,0 @@ [2.1.0]: https://github.com/MetaMask/snaps-registry/compare/v2.0.0...v2.1.0

21

dist/index.d.ts

@@ -46,3 +46,3 @@ import type { Infer } from 'superstruct';

}[] | undefined;
category?: "notifications" | "interoperability" | "transaction insights" | undefined;
category?: "notifications" | "interoperability" | "transaction insights" | "account management" | undefined;
tags?: string[] | undefined;

@@ -55,2 +55,4 @@ support?: {

sourceCode?: string | undefined;
privateCode?: boolean | undefined;
privacyPolicy?: string | undefined;
};

@@ -78,3 +80,3 @@ versions: Record<import("@metamask/utils").SemVerVersion, {

}[] | undefined;
category?: "notifications" | "interoperability" | "transaction insights" | undefined;
category?: "notifications" | "interoperability" | "transaction insights" | "account management" | undefined;
tags?: string[] | undefined;

@@ -87,2 +89,4 @@ support?: {

sourceCode?: string | undefined;
privateCode?: boolean | undefined;
privacyPolicy?: string | undefined;
}, {

@@ -114,6 +118,7 @@ name: import("superstruct").Struct<string, null>;

}>>;
category: import("superstruct").Struct<"notifications" | "interoperability" | "transaction insights" | undefined, {
category: import("superstruct").Struct<"notifications" | "interoperability" | "transaction insights" | "account management" | undefined, {
notifications: "notifications";
interoperability: "interoperability";
"transaction insights": "transaction insights";
"account management": "account management";
}>;

@@ -132,2 +137,4 @@ tags: import("superstruct").Struct<string[] | undefined, import("superstruct").Struct<string, null>>;

hidden: import("superstruct").Struct<boolean | undefined, null>;
privateCode: import("superstruct").Struct<boolean | undefined, null>;
privacyPolicy: import("superstruct").Struct<string | undefined, null>;
}>;

@@ -180,3 +187,3 @@ versions: import("superstruct").Struct<Record<import("@metamask/utils").SemVerVersion, {

}[] | undefined;
category?: "notifications" | "interoperability" | "transaction insights" | undefined;
category?: "notifications" | "interoperability" | "transaction insights" | "account management" | undefined;
tags?: string[] | undefined;

@@ -189,2 +196,4 @@ support?: {

sourceCode?: string | undefined;
privateCode?: boolean | undefined;
privacyPolicy?: string | undefined;
};

@@ -228,3 +237,3 @@ versions: Record<import("@metamask/utils").SemVerVersion, {

}[] | undefined;
category?: "notifications" | "interoperability" | "transaction insights" | undefined;
category?: "notifications" | "interoperability" | "transaction insights" | "account management" | undefined;
tags?: string[] | undefined;

@@ -237,2 +246,4 @@ support?: {

sourceCode?: string | undefined;
privateCode?: boolean | undefined;
privacyPolicy?: string | undefined;
};

@@ -239,0 +250,0 @@ versions: Record<import("@metamask/utils").SemVerVersion, {

@@ -49,3 +49,8 @@ "use strict";

audits: (0, superstruct_1.optional)((0, superstruct_1.array)(exports.AuditStruct)),
category: (0, superstruct_1.optional)((0, superstruct_1.enums)(['interoperability', 'notifications', 'transaction insights'])),
category: (0, superstruct_1.optional)((0, superstruct_1.enums)([
'interoperability',
'notifications',
'transaction insights',
'account management',
])),
tags: (0, superstruct_1.optional)((0, superstruct_1.array)((0, superstruct_1.string)())),

@@ -55,2 +60,4 @@ support: (0, superstruct_1.optional)(exports.SupportStruct),

hidden: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
privateCode: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
privacyPolicy: (0, superstruct_1.optional)((0, superstruct_1.string)()),
}),

@@ -57,0 +64,0 @@ versions: (0, superstruct_1.record)(utils_1.VersionStruct, VerifiedSnapVersionStruct),

@@ -28,3 +28,3 @@ import type { Hex } from '@metamask/utils';

*/
export declare function verify({ registry, signature, publicKey, }: VerifyArgs): Promise<boolean>;
export declare function verify({ registry, signature, publicKey, }: VerifyArgs): boolean;
export {};

@@ -5,3 +5,4 @@ "use strict";

const utils_1 = require("@metamask/utils");
const secp256k1_1 = require("@noble/secp256k1");
const secp256k1_1 = require("@noble/curves/secp256k1");
const sha256_1 = require("@noble/hashes/sha256");
const superstruct_1 = require("superstruct");

@@ -23,8 +24,8 @@ exports.SignatureStruct = (0, superstruct_1.object)({

*/
async function verify({ registry, signature, publicKey, }) {
function verify({ registry, signature, publicKey, }) {
(0, utils_1.assertStruct)(signature, exports.SignatureStruct, 'Invalid signature object');
const publicKeyBytes = (0, utils_1.hexToBytes)(publicKey);
return (0, secp256k1_1.verify)(secp256k1_1.Signature.fromHex((0, utils_1.remove0x)(signature.signature)), await secp256k1_1.utils.sha256((0, utils_1.stringToBytes)(registry)), publicKeyBytes);
return secp256k1_1.secp256k1.verify((0, utils_1.remove0x)(signature.signature), (0, sha256_1.sha256)((0, utils_1.stringToBytes)(registry)), publicKeyBytes);
}
exports.verify = verify;
//# sourceMappingURL=verify.js.map
{
"name": "@metamask/snaps-registry",
"version": "2.1.1",
"version": "3.0.0",
"description": "A registry containing metadata about verified and blocked Snaps.",

@@ -33,3 +33,4 @@ "repository": {

"@metamask/utils": "^8.1.0",
"@noble/secp256k1": "^1.7.1",
"@noble/curves": "^1.2.0",
"@noble/hashes": "^1.3.2",
"superstruct": "^1.0.3"

@@ -45,5 +46,4 @@ },

"@metamask/snaps-controllers": "^3.4.0",
"@metamask/snaps-utils": "^4.0.0",
"@metamask/snaps-utils": "^5.0.0",
"@noble/curves": "^1.2.0",
"@noble/hashes": "^1.3.2",
"@types/jest": "^28.1.6",

@@ -75,3 +75,3 @@ "@types/node": "^17.0.23",

"engines": {
"node": ">=14.0.0"
"node": "^18.16 || >=20"
},

@@ -78,0 +78,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc