Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
@metamask/snaps-rpc-methods -> @metamask/snaps-sdk
Browse files Browse the repository at this point in the history
- 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`.
  • Loading branch information
mcmire committed Nov 20, 2023
1 parent 06ee7ad commit fc48169
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/snap-utils.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<string, Json>,
): Promise<void> {
Expand Down
16 changes: 15 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit fc48169

Please sign in to comment.