From fc48169314fa482d18c1d3e77470aeaeac1f9154 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Mon, 20 Nov 2023 12:51:24 -0700 Subject: [PATCH] @metamask/snaps-rpc-methods -> @metamask/snaps-sdk - The version of `@metamask/snaps-rpc-methods` that this package uses relies on `@metamask/snaps-ui`, which has recently been deprecated. The deprecation causes the dependencies audit on the extension to fail. - Global objects have been moved out of `@metamask/snaps-rpc-methods` to `@metamask/snaps-sdk`. Specifically, `SnapsGlobalObject` was renamed to `SnapsProvider`. Given these changes, this commit replaces `@metamask/snaps-rpc-methods` with `@metamask/snaps-sdk` and uses `SnapsGlobalObject` instead of `SnapsProvider`. --- package.json | 2 +- src/snap-utils.ts | 4 ++-- yarn.lock | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 91e3fd348..cdf47c285 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "dependencies": { "@metamask/providers": "^13.0.0", "@metamask/snaps-controllers": "^3.1.0", - "@metamask/snaps-rpc-methods": "^3.1.0", + "@metamask/snaps-sdk": "^1.1.0", "@metamask/snaps-utils": "^3.0.0", "@metamask/utils": "^8.1.0", "@types/uuid": "^9.0.1", diff --git a/src/snap-utils.ts b/src/snap-utils.ts index 797d239a9..c77d0cc97 100644 --- a/src/snap-utils.ts +++ b/src/snap-utils.ts @@ -1,4 +1,4 @@ -import type { SnapsGlobalObject } from '@metamask/snaps-rpc-methods'; +import type { SnapsProvider } from '@metamask/snaps-sdk'; import type { Json } from '@metamask/utils'; import type { KeyringEvent } from './events'; @@ -11,7 +11,7 @@ import type { KeyringEvent } from './events'; * @param data - The event data. */ export async function emitSnapKeyringEvent( - snap: SnapsGlobalObject, + snap: SnapsProvider, event: KeyringEvent, data: Record, ): Promise { diff --git a/yarn.lock b/yarn.lock index b2f6b7391..d125845e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1104,7 +1104,7 @@ __metadata: "@metamask/eslint-config-typescript": ^12.1.0 "@metamask/providers": ^13.0.0 "@metamask/snaps-controllers": ^3.1.0 - "@metamask/snaps-rpc-methods": ^3.1.0 + "@metamask/snaps-sdk": ^1.1.0 "@metamask/snaps-utils": ^3.0.0 "@metamask/utils": ^8.1.0 "@types/jest": ^28.1.6 @@ -1283,6 +1283,20 @@ __metadata: languageName: node linkType: hard +"@metamask/snaps-sdk@npm:^1.1.0": + version: 1.1.0 + resolution: "@metamask/snaps-sdk@npm:1.1.0" + dependencies: + "@metamask/key-tree": ^9.0.0 + "@metamask/providers": ^13.0.0 + "@metamask/rpc-errors": ^6.1.0 + "@metamask/utils": ^8.1.0 + is-svg: ^4.4.0 + superstruct: ^1.0.3 + checksum: bd4dd25959bab214c3f9c0235e3b94740f900ced64b0ca09afbdedff8d927ff127b8d009fed285359be1c057eb57dd27aa824a6b331026baae7c674bee75c6e2 + languageName: node + linkType: hard + "@metamask/snaps-ui@npm:^3.1.0": version: 3.1.0 resolution: "@metamask/snaps-ui@npm:3.1.0"