From a88b1c3ceb90710fe0231d851bcda3b3e4c3c677 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Tue, 14 May 2024 16:24:28 +0200 Subject: [PATCH 1/9] Use JSX --- packages/site/src/pages/index.tsx | 2 +- packages/site/src/utils/metamask.ts | 4 + packages/snap/.eslintrc.js | 14 ++ packages/snap/package.json | 6 +- packages/snap/snap.config.ts | 2 +- packages/snap/snap.manifest.json | 2 +- packages/snap/src/{index.ts => index.tsx} | 23 ++- packages/snap/tsconfig.json | 6 +- yarn.lock | 200 ++++++++-------------- 9 files changed, 119 insertions(+), 140 deletions(-) rename packages/snap/src/{index.ts => index.tsx} (61%) diff --git a/packages/site/src/pages/index.tsx b/packages/site/src/pages/index.tsx index a05d4c0a..63b9d8a2 100644 --- a/packages/site/src/pages/index.tsx +++ b/packages/site/src/pages/index.tsx @@ -120,7 +120,7 @@ const Index = () => { Welcome to template-snap - Get started by editing src/index.ts + Get started by editing src/index.tsx {error && ( diff --git a/packages/site/src/utils/metamask.ts b/packages/site/src/utils/metamask.ts index 30b39715..52b42970 100644 --- a/packages/site/src/utils/metamask.ts +++ b/packages/site/src/utils/metamask.ts @@ -61,6 +61,10 @@ export async function getMetaMaskEIP6963Provider() { * @param event.detail - The details of the EIP6963 announceProvider event. */ function onAnnounceProvider({ detail }: EIP6963AnnounceProviderEvent) { + if (!detail) { + return; + } + const { info, provider } = detail; if (info.rdns.includes('io.metamask')) { diff --git a/packages/snap/.eslintrc.js b/packages/snap/.eslintrc.js index 40f0a4f9..cf4ca9c2 100644 --- a/packages/snap/.eslintrc.js +++ b/packages/snap/.eslintrc.js @@ -11,6 +11,20 @@ module.exports = { extends: ['@metamask/eslint-config-nodejs'], }, + { + files: ['**/*.ts', '**/*.tsx'], + extends: ['@metamask/eslint-config-typescript'], + rules: { + // This allows importing the `Text` JSX component. + '@typescript-eslint/no-shadow': [ + 'error', + { + allow: ['Text'], + }, + ], + }, + }, + { files: ['*.test.ts'], rules: { diff --git a/packages/snap/package.json b/packages/snap/package.json index 336cce71..bd76b384 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -27,7 +27,7 @@ "test": "jest" }, "dependencies": { - "@metamask/snaps-sdk": "^4.0.0", + "@metamask/snaps-sdk": "^4.1.0", "buffer": "^6.0.3" }, "devDependencies": { @@ -37,8 +37,8 @@ "@metamask/eslint-config-jest": "^12.1.0", "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", - "@metamask/snaps-cli": "^6.1.0", - "@metamask/snaps-jest": "^7.0.0", + "@metamask/snaps-cli": "^6.2.0", + "@metamask/snaps-jest": "^8.0.0", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^5.42.1", "eslint": "^8.45.0", diff --git a/packages/snap/snap.config.ts b/packages/snap/snap.config.ts index 10773a45..ca8f38bd 100644 --- a/packages/snap/snap.config.ts +++ b/packages/snap/snap.config.ts @@ -3,7 +3,7 @@ import { resolve } from 'path'; const config: SnapConfig = { bundler: 'webpack', - input: resolve(__dirname, 'src/index.ts'), + input: resolve(__dirname, 'src/index.tsx'), server: { port: 8080, }, diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index be4b013e..5840b106 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/template-snap-monorepo.git" }, "source": { - "shasum": "TwVBeJ/PL4uARBEFZmgJukYd3XWyTbilkOPhtdg+GvU=", + "shasum": "2OwZmIrZmVpVvpXkYreocpEeYEkeNjriRdSSjbqycCQ=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/snap/src/index.ts b/packages/snap/src/index.tsx similarity index 61% rename from packages/snap/src/index.ts rename to packages/snap/src/index.tsx index f521836c..250f258e 100644 --- a/packages/snap/src/index.ts +++ b/packages/snap/src/index.tsx @@ -1,5 +1,5 @@ import type { OnRpcRequestHandler } from '@metamask/snaps-sdk'; -import { panel, text } from '@metamask/snaps-sdk'; +import { Box, Text, Bold } from '@metamask/snaps-sdk/jsx'; /** * Handle incoming JSON-RPC requests, sent through `wallet_invokeSnap`. @@ -21,13 +21,20 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ method: 'snap_dialog', params: { type: 'confirmation', - content: panel([ - text(`Hello, **${origin}**!`), - text('This custom confirmation is just for display purposes.'), - text( - 'But you can edit the snap source code to make it do something, if you want to!', - ), - ]), + content: ( + + + Hello, {origin}! + + + This custom confirmation is just for display purposes. + + + But you can edit the snap source code to make it do something, + if you want to! + + + ), }, }); default: diff --git a/packages/snap/tsconfig.json b/packages/snap/tsconfig.json index 67ccdf62..ef0c834a 100644 --- a/packages/snap/tsconfig.json +++ b/packages/snap/tsconfig.json @@ -1,7 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "baseUrl": "./" + "baseUrl": "./", + "jsx": "react-jsx", + "jsxImportSource": "@metamask/snaps-sdk" }, - "include": ["**/*.ts"] + "include": ["**/*.ts", "**/*.tsx"] } diff --git a/yarn.lock b/yarn.lock index 79686dd5..e208e80f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2588,15 +2588,15 @@ __metadata: languageName: node linkType: hard -"@metamask/approval-controller@npm:^6.0.1": - version: 6.0.1 - resolution: "@metamask/approval-controller@npm:6.0.1" +"@metamask/approval-controller@npm:^6.0.2": + version: 6.0.2 + resolution: "@metamask/approval-controller@npm:6.0.2" dependencies: - "@metamask/base-controller": ^5.0.1 + "@metamask/base-controller": ^5.0.2 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 nanoid: ^3.1.31 - checksum: 743a06a11fe10f413631696a5ef74f225092ca5c1bef979b656215eccaffb5ad6eb31fc738d948e4668a62788175de246e692674886c397aa15587dc6667889c + checksum: 662365ec460edc1e3839c2f9f427d44a707350ecca7fa3524d75da3652306b61fc69f7336154142b4a38657c272624232ea40bf218427ba15b11fd89c5a5ae42 languageName: node linkType: hard @@ -2615,13 +2615,13 @@ __metadata: languageName: node linkType: hard -"@metamask/base-controller@npm:^5.0.1": - version: 5.0.1 - resolution: "@metamask/base-controller@npm:5.0.1" +"@metamask/base-controller@npm:^5.0.1, @metamask/base-controller@npm:^5.0.2": + version: 5.0.2 + resolution: "@metamask/base-controller@npm:5.0.2" dependencies: "@metamask/utils": ^8.3.0 immer: ^9.0.6 - checksum: 97ccf900377b06f72db7ee1c167448de80dfec6b02b3aeda715d498974ffffbb5a8cc82f44aabc58f7b6afb693d85f504515cec97bf385efa0377975b4019c7b + checksum: 22c43c3147c7da1c1b87de4d41948e275f8e0adcdb1210a55a62aa497db4fa82399750901729d9dc6285d89e68f18e5bd15095ee4d4c6cfc169035173e69a1d2 languageName: node linkType: hard @@ -2788,18 +2788,6 @@ __metadata: languageName: node linkType: hard -"@metamask/json-rpc-middleware-stream@npm:^6.0.2": - version: 6.0.2 - resolution: "@metamask/json-rpc-middleware-stream@npm:6.0.2" - dependencies: - "@metamask/json-rpc-engine": ^7.3.2 - "@metamask/safe-event-emitter": ^3.0.0 - "@metamask/utils": ^8.3.0 - readable-stream: ^3.6.2 - checksum: e831041b03e9f48f584f4425188f72b58974f95b60429c9fe8b5561da69c6bbfad2f2b2199acdff06ee718967214b65c05604d4f85f3287186619683487f1060 - languageName: node - linkType: hard - "@metamask/json-rpc-middleware-stream@npm:^7.0.1": version: 7.0.1 resolution: "@metamask/json-rpc-middleware-stream@npm:7.0.1" @@ -2888,15 +2876,15 @@ __metadata: languageName: node linkType: hard -"@metamask/providers@npm:^16.0.0": - version: 16.0.0 - resolution: "@metamask/providers@npm:16.0.0" +"@metamask/providers@npm:^16.0.0, @metamask/providers@npm:^16.1.0": + version: 16.1.0 + resolution: "@metamask/providers@npm:16.1.0" dependencies: - "@metamask/json-rpc-engine": ^7.3.2 - "@metamask/json-rpc-middleware-stream": ^6.0.2 + "@metamask/json-rpc-engine": ^8.0.1 + "@metamask/json-rpc-middleware-stream": ^7.0.1 "@metamask/object-multiplex": ^2.0.0 "@metamask/rpc-errors": ^6.2.1 - "@metamask/safe-event-emitter": ^3.0.0 + "@metamask/safe-event-emitter": ^3.1.1 "@metamask/utils": ^8.3.0 detect-browser: ^5.2.0 extension-port-stream: ^3.0.0 @@ -2904,7 +2892,7 @@ __metadata: is-stream: ^2.0.0 readable-stream: ^3.6.2 webextension-polyfill: ^0.10.0 - checksum: cdc06796111edbf01e9aa8498170f7ffa3c68a4c0f66a629e3b0f7d37ee60eb32d83ee12f285c3d974d971c6af16a3fba531fb5733f5fa9412a18e1d3f648539 + checksum: 85e40140f342a38112c3d7cee436751a2be4c575cc4f815ab48a73b549abc2d756bf4a10e4b983e91dbd38076601f992531edb6d8d674aebceae32ef7e299275 languageName: node linkType: hard @@ -2918,7 +2906,7 @@ __metadata: languageName: node linkType: hard -"@metamask/safe-event-emitter@npm:^3.0.0": +"@metamask/safe-event-emitter@npm:^3.0.0, @metamask/safe-event-emitter@npm:^3.1.1": version: 3.1.1 resolution: "@metamask/safe-event-emitter@npm:3.1.1" checksum: e24db4d7c20764bfc5b025065f92518c805f0ffb1da4820078b8cff7dcae964c0f354cf053fcb7ac659de015d5ffdf21aae5e8d44e191ee8faa9066855f22653 @@ -2942,9 +2930,9 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-cli@npm:^6.1.0": - version: 6.1.0 - resolution: "@metamask/snaps-cli@npm:6.1.0" +"@metamask/snaps-cli@npm:^6.2.0": + version: 6.2.0 + resolution: "@metamask/snaps-cli@npm:6.2.0" dependencies: "@babel/core": ^7.23.2 "@babel/plugin-transform-class-properties": ^7.22.5 @@ -2954,8 +2942,8 @@ __metadata: "@babel/plugin-transform-runtime": ^7.13.2 "@babel/preset-env": ^7.23.2 "@babel/preset-typescript": ^7.23.2 - "@metamask/snaps-sdk": ^3.2.0 - "@metamask/snaps-utils": ^7.0.4 + "@metamask/snaps-sdk": ^4.1.0 + "@metamask/snaps-utils": ^7.3.0 "@metamask/snaps-webpack-plugin": ^4.0.1 "@metamask/utils": ^8.3.0 "@swc/core": 1.3.78 @@ -2997,16 +2985,16 @@ __metadata: yargs: ^17.7.1 bin: mm-snap: ./dist/main.js - checksum: 0b8e32e442118d7bc29b566d3f0f8834cc6ec6d73471d5719969f97b102a41c78be3232f92ac0cda8c068c58c83aaba8f10959b60000cdd65d111c0968ecdb8a + checksum: 33f9879e8870e27490bc70ed839fe0d9d38fd21a130d555db04bcf6d7477cdc725e9951cc7d0e7f67afab0601e66a58087058f4c5f033a26677bce39c3821d7e languageName: node linkType: hard -"@metamask/snaps-controllers@npm:^7.0.0": - version: 7.0.1 - resolution: "@metamask/snaps-controllers@npm:7.0.1" +"@metamask/snaps-controllers@npm:^8.1.0": + version: 8.1.1 + resolution: "@metamask/snaps-controllers@npm:8.1.1" dependencies: - "@metamask/approval-controller": ^6.0.1 - "@metamask/base-controller": ^5.0.1 + "@metamask/approval-controller": ^6.0.2 + "@metamask/base-controller": ^5.0.2 "@metamask/json-rpc-engine": ^8.0.1 "@metamask/json-rpc-middleware-stream": ^7.0.1 "@metamask/object-multiplex": ^2.0.0 @@ -3015,13 +3003,14 @@ __metadata: "@metamask/post-message-stream": ^8.0.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/snaps-registry": ^3.1.0 - "@metamask/snaps-rpc-methods": ^8.0.0 - "@metamask/snaps-sdk": ^4.0.0 - "@metamask/snaps-utils": ^7.1.0 + "@metamask/snaps-rpc-methods": ^8.1.0 + "@metamask/snaps-sdk": ^4.1.0 + "@metamask/snaps-utils": ^7.3.0 "@metamask/utils": ^8.3.0 "@xstate/fsm": ^2.0.0 browserify-zlib: ^0.2.0 concat-stream: ^2.0.0 + fast-deep-equal: ^3.1.3 get-npm-tarball-url: ^2.0.3 immer: ^9.0.6 nanoid: ^3.1.31 @@ -3029,51 +3018,51 @@ __metadata: readable-web-to-node-stream: ^3.0.2 tar-stream: ^3.1.7 peerDependencies: - "@metamask/snaps-execution-environments": ^6.0.0 + "@metamask/snaps-execution-environments": ^6.1.0 peerDependenciesMeta: "@metamask/snaps-execution-environments": optional: true - checksum: d8a23ebf81b5a3276cec041588e56b23a7b18cc7d6ea4b7b244aac6db6b9276db0687efc95de02043e8907d4b1ddf5de74b36e4f93b6f8aab121dc22ba5d43a1 + checksum: 6b3d68a48bae8a70f1f59043de6636c2ad5b2d8e427e40c1b124fc7a35a7dccc77031987ee404a8927dd3d53b4c82782abb80e768ef1defad378dbe2fa2b4a13 languageName: node linkType: hard -"@metamask/snaps-execution-environments@npm:^6.0.0": - version: 6.0.0 - resolution: "@metamask/snaps-execution-environments@npm:6.0.0" +"@metamask/snaps-execution-environments@npm:^6.1.0": + version: 6.1.0 + resolution: "@metamask/snaps-execution-environments@npm:6.1.0" dependencies: "@metamask/json-rpc-engine": ^8.0.1 "@metamask/object-multiplex": ^2.0.0 "@metamask/post-message-stream": ^8.0.0 - "@metamask/providers": ^16.0.0 + "@metamask/providers": ^16.1.0 "@metamask/rpc-errors": ^6.2.1 - "@metamask/snaps-sdk": ^4.0.0 - "@metamask/snaps-utils": ^7.1.0 + "@metamask/snaps-sdk": ^4.1.0 + "@metamask/snaps-utils": ^7.3.0 "@metamask/utils": ^8.3.0 nanoid: ^3.1.31 readable-stream: ^3.6.2 superstruct: ^1.0.3 - checksum: 367e8f09843f36a74969ea09ba724ff66cea66ecadbd1306bbd1c43937cf51a22cf342f81a56f8f45abe2a2a914f9316dec3e9a9c64a8bb215957563c963ab51 + checksum: 7e9a3e7fcea6bc411b7af4bf7ccb65878a630671f990d605ef3bf1ab3347bd3674b8769fcf5c075a00f1c9a37375d43a7d2af3b4eccfd62e618299756d1f0f78 languageName: node linkType: hard -"@metamask/snaps-jest@npm:^7.0.0": - version: 7.0.0 - resolution: "@metamask/snaps-jest@npm:7.0.0" +"@metamask/snaps-jest@npm:^8.0.0": + version: 8.0.0 + resolution: "@metamask/snaps-jest@npm:8.0.0" dependencies: "@jest/environment": ^29.5.0 "@jest/expect": ^29.5.0 "@jest/globals": ^29.5.0 - "@metamask/base-controller": ^5.0.1 + "@metamask/base-controller": ^5.0.2 "@metamask/eth-json-rpc-middleware": ^12.1.0 "@metamask/json-rpc-engine": ^8.0.1 "@metamask/json-rpc-middleware-stream": ^7.0.1 "@metamask/key-tree": ^9.0.0 "@metamask/permission-controller": ^9.0.2 - "@metamask/snaps-controllers": ^7.0.0 - "@metamask/snaps-execution-environments": ^6.0.0 - "@metamask/snaps-rpc-methods": ^8.0.0 - "@metamask/snaps-sdk": ^4.0.0 - "@metamask/snaps-utils": ^7.1.0 + "@metamask/snaps-controllers": ^8.1.0 + "@metamask/snaps-execution-environments": ^6.1.0 + "@metamask/snaps-rpc-methods": ^8.1.0 + "@metamask/snaps-sdk": ^4.1.0 + "@metamask/snaps-utils": ^7.3.0 "@metamask/utils": ^8.3.0 "@reduxjs/toolkit": ^1.9.5 express: ^4.18.2 @@ -3083,11 +3072,11 @@ __metadata: redux: ^4.2.1 redux-saga: ^1.2.3 superstruct: ^1.0.3 - checksum: aaf1d6541f3fd34173af454c6213a7934158c17577e6955d29ae89060eda281ab95fe00c4ac9b452e5d810f5e1ab8b0b0649e93c2e0f97780a845b1bb3014724 + checksum: 83cc14e457754ccfc33d6562f29a48588a7fb574c712717c5961e41c38212c1f76049c7204f46b5bfca84a1bd31bf53ac91fa41f8f80d6fa28a768b0c6aeb9d9 languageName: node linkType: hard -"@metamask/snaps-registry@npm:^3.0.1, @metamask/snaps-registry@npm:^3.1.0": +"@metamask/snaps-registry@npm:^3.1.0": version: 3.1.0 resolution: "@metamask/snaps-registry@npm:3.1.0" dependencies: @@ -3099,23 +3088,23 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-rpc-methods@npm:^8.0.0": - version: 8.0.0 - resolution: "@metamask/snaps-rpc-methods@npm:8.0.0" +"@metamask/snaps-rpc-methods@npm:^8.1.0": + version: 8.1.0 + resolution: "@metamask/snaps-rpc-methods@npm:8.1.0" dependencies: "@metamask/key-tree": ^9.0.0 "@metamask/permission-controller": ^9.0.2 "@metamask/rpc-errors": ^6.2.1 - "@metamask/snaps-sdk": ^4.0.0 - "@metamask/snaps-utils": ^7.1.0 + "@metamask/snaps-sdk": ^4.1.0 + "@metamask/snaps-utils": ^7.3.0 "@metamask/utils": ^8.3.0 "@noble/hashes": ^1.3.1 superstruct: ^1.0.3 - checksum: 219e166b9a1b0653db8c679319ee9022244e697575023dcccbab571faf9411bf88e1139049745a4d7949c1e6a4ae621e20a5e5e4c31f8b68e1f146117f0b8150 + checksum: 343da447508c1d5a0757640bb6aa3a7b3979294574ce0600f5a011c2918eb1842ae20c93c0967cf49da622dae99af73f6b243fdfbf65046c5f638dc52d04600d languageName: node linkType: hard -"@metamask/snaps-sdk@npm:^3.0.1, @metamask/snaps-sdk@npm:^3.2.0": +"@metamask/snaps-sdk@npm:^3.0.1": version: 3.2.0 resolution: "@metamask/snaps-sdk@npm:3.2.0" dependencies: @@ -3129,63 +3118,33 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-sdk@npm:^4.0.0": - version: 4.0.0 - resolution: "@metamask/snaps-sdk@npm:4.0.0" +"@metamask/snaps-sdk@npm:^4.1.0": + version: 4.1.0 + resolution: "@metamask/snaps-sdk@npm:4.1.0" dependencies: "@metamask/key-tree": ^9.0.0 - "@metamask/providers": ^16.0.0 + "@metamask/providers": ^16.1.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 fast-xml-parser: ^4.3.4 superstruct: ^1.0.3 - checksum: 01b485b05715f7fff3527b8cac5be180f2443797b05839f615c59ac2c95860b68509c7e7c0eec0d921b04b099f5e7bc99bcb2447373e866649b8bc8f29b738ec - languageName: node - linkType: hard - -"@metamask/snaps-utils@npm:^7.0.1, @metamask/snaps-utils@npm:^7.0.4": - version: 7.0.4 - resolution: "@metamask/snaps-utils@npm:7.0.4" - dependencies: - "@babel/core": ^7.23.2 - "@babel/types": ^7.23.0 - "@metamask/base-controller": ^5.0.1 - "@metamask/key-tree": ^9.0.0 - "@metamask/permission-controller": ^9.0.2 - "@metamask/rpc-errors": ^6.2.1 - "@metamask/slip44": ^3.1.0 - "@metamask/snaps-registry": ^3.0.1 - "@metamask/snaps-sdk": ^3.2.0 - "@metamask/utils": ^8.3.0 - "@noble/hashes": ^1.3.1 - "@scure/base": ^1.1.1 - chalk: ^4.1.2 - cron-parser: ^4.5.0 - fast-deep-equal: ^3.1.3 - fast-json-stable-stringify: ^2.1.0 - marked: ^12.0.1 - rfdc: ^1.3.0 - semver: ^7.5.4 - ses: ^1.1.0 - superstruct: ^1.0.3 - validate-npm-package-name: ^5.0.0 - checksum: b874d686216dd04472a3eb9e541b169e9e37793234838650e05734b9b6a4148ed126857e05e4cb1436482bb9ad0f1d43a2b7498169219c8062f00e4d67e074d3 + checksum: b8056b102c996bbe2e6229af6a6118f21c353a513d15a927c9dd67b48c4ca5b5bcf65d5114d8631e9e2662391a574c80d74845ffa25182dbc8fcb2ff09bf7325 languageName: node linkType: hard -"@metamask/snaps-utils@npm:^7.1.0": - version: 7.1.0 - resolution: "@metamask/snaps-utils@npm:7.1.0" +"@metamask/snaps-utils@npm:^7.0.1, @metamask/snaps-utils@npm:^7.3.0": + version: 7.3.0 + resolution: "@metamask/snaps-utils@npm:7.3.0" dependencies: "@babel/core": ^7.23.2 "@babel/types": ^7.23.0 - "@metamask/base-controller": ^5.0.1 + "@metamask/base-controller": ^5.0.2 "@metamask/key-tree": ^9.0.0 "@metamask/permission-controller": ^9.0.2 "@metamask/rpc-errors": ^6.2.1 "@metamask/slip44": ^3.1.0 "@metamask/snaps-registry": ^3.1.0 - "@metamask/snaps-sdk": ^4.0.0 + "@metamask/snaps-sdk": ^4.1.0 "@metamask/utils": ^8.3.0 "@noble/hashes": ^1.3.1 "@scure/base": ^1.1.1 @@ -3199,7 +3158,7 @@ __metadata: ses: ^1.1.0 superstruct: ^1.0.3 validate-npm-package-name: ^5.0.0 - checksum: ecd081596930d8337b9f054e2612f04bfdab1c4d46fb395a8ad8cb7263d0f5ebb6e7a1988168a46a794ca065fe3537959b68cb7b07a80346ff372be160d68601 + checksum: e58bb4cbcc6c8f17d2bf18995eb75e13af296f3f6c7d97a5681d3d76097450ae49bba9c5ac134e41ae6e01bfb005d0bc4bb1256d421e46b6c56490fa1b9f25ab languageName: node linkType: hard @@ -7588,14 +7547,7 @@ __metadata: languageName: node linkType: hard -"content-type@npm:~1.0.4": - version: 1.0.4 - resolution: "content-type@npm:1.0.4" - checksum: 3d93585fda985d1554eca5ebd251994327608d2e200978fdbfba21c0c679914d5faf266d17027de44b34a72c7b0745b18584ecccaa7e1fdfb6a68ac7114f12e0 - languageName: node - linkType: hard - -"content-type@npm:~1.0.5": +"content-type@npm:~1.0.4, content-type@npm:~1.0.5": version: 1.0.5 resolution: "content-type@npm:1.0.5" checksum: 566271e0a251642254cde0f845f9dd4f9856e52d988f4eb0d0dcffbb7a1f8ec98de7a5215fc628f3bce30fe2fb6fd2bc064b562d721658c59b544e2d34ea2766 @@ -15755,7 +15707,7 @@ __metadata: languageName: node linkType: hard -"raw-body@npm:2.5.1, raw-body@npm:^2.3.0": +"raw-body@npm:2.5.1": version: 2.5.1 resolution: "raw-body@npm:2.5.1" dependencies: @@ -15767,7 +15719,7 @@ __metadata: languageName: node linkType: hard -"raw-body@npm:2.5.2": +"raw-body@npm:2.5.2, raw-body@npm:^2.3.0": version: 2.5.2 resolution: "raw-body@npm:2.5.2" dependencies: @@ -16951,9 +16903,9 @@ __metadata: "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 - "@metamask/snaps-cli": ^6.1.0 - "@metamask/snaps-jest": ^7.0.0 - "@metamask/snaps-sdk": ^4.0.0 + "@metamask/snaps-cli": ^6.2.0 + "@metamask/snaps-jest": ^8.0.0 + "@metamask/snaps-sdk": ^4.1.0 "@typescript-eslint/eslint-plugin": ^5.42.1 "@typescript-eslint/parser": ^5.42.1 buffer: ^6.0.3 From f7cfc5dd21aefbebca713da6ce4ef4963365fbee Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Thu, 16 May 2024 10:04:29 +0200 Subject: [PATCH 2/9] Bump sdk --- packages/snap/package.json | 2 +- yarn.lock | 63 ++++++++++---------------------------- 2 files changed, 18 insertions(+), 47 deletions(-) diff --git a/packages/snap/package.json b/packages/snap/package.json index bd76b384..a0874091 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -27,7 +27,7 @@ "test": "jest" }, "dependencies": { - "@metamask/snaps-sdk": "^4.1.0", + "@metamask/snaps-sdk": "^4.2.0", "buffer": "^6.0.3" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index e208e80f..f2252e3f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1761,7 +1761,7 @@ __metadata: languageName: node linkType: hard -"@ethereumjs/tx@npm:^4.1.2, @ethereumjs/tx@npm:^4.2.0": +"@ethereumjs/tx@npm:^4.2.0": version: 4.2.0 resolution: "@ethereumjs/tx@npm:4.2.0" dependencies: @@ -2800,17 +2800,16 @@ __metadata: languageName: node linkType: hard -"@metamask/key-tree@npm:^9.0.0": - version: 9.0.0 - resolution: "@metamask/key-tree@npm:9.0.0" +"@metamask/key-tree@npm:^9.0.0, @metamask/key-tree@npm:^9.1.0": + version: 9.1.0 + resolution: "@metamask/key-tree@npm:9.1.0" dependencies: - "@metamask/scure-bip39": ^2.1.0 - "@metamask/utils": ^6.0.1 - "@noble/ed25519": ^1.6.0 - "@noble/hashes": ^1.0.0 - "@noble/secp256k1": ^1.5.5 + "@metamask/scure-bip39": ^2.1.1 + "@metamask/utils": ^8.3.0 + "@noble/curves": ^1.2.0 + "@noble/hashes": ^1.3.2 "@scure/base": ^1.0.0 - checksum: 5c81f07351ca59b37570d52edcc80d60424630b2a8403ed7149c3343c264878ac5d3fc0584a61635ea7ddda4a789295ded1247846606dc529d8e2fd42f6fc61a + checksum: 02709493f87c4cf8ebe3b81a47d3239d4d0b15fd73ac877047d0907652ff740d307966392f6f31d2f7871ab84315dddb4310edbf4edb976941a53d4e9ae04404 languageName: node linkType: hard @@ -2913,7 +2912,7 @@ __metadata: languageName: node linkType: hard -"@metamask/scure-bip39@npm:^2.1.0": +"@metamask/scure-bip39@npm:^2.1.1": version: 2.1.1 resolution: "@metamask/scure-bip39@npm:2.1.1" dependencies: @@ -3118,17 +3117,17 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-sdk@npm:^4.1.0": - version: 4.1.0 - resolution: "@metamask/snaps-sdk@npm:4.1.0" +"@metamask/snaps-sdk@npm:^4.1.0, @metamask/snaps-sdk@npm:^4.2.0": + version: 4.2.0 + resolution: "@metamask/snaps-sdk@npm:4.2.0" dependencies: - "@metamask/key-tree": ^9.0.0 + "@metamask/key-tree": ^9.1.0 "@metamask/providers": ^16.1.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 fast-xml-parser: ^4.3.4 superstruct: ^1.0.3 - checksum: b8056b102c996bbe2e6229af6a6118f21c353a513d15a927c9dd67b48c4ca5b5bcf65d5114d8631e9e2662391a574c80d74845ffa25182dbc8fcb2ff09bf7325 + checksum: f9b0e6d7600680183e69d419f5a802208fdc119c7d1226a74076f3b8b8c581850b135392c2f35c391305fc37406973afeb19d8909101580ec16b63fd2f200a8c languageName: node linkType: hard @@ -3174,20 +3173,6 @@ __metadata: languageName: node linkType: hard -"@metamask/utils@npm:^6.0.1": - version: 6.2.0 - resolution: "@metamask/utils@npm:6.2.0" - dependencies: - "@ethereumjs/tx": ^4.1.2 - "@noble/hashes": ^1.3.1 - "@types/debug": ^4.1.7 - debug: ^4.3.4 - semver: ^7.3.8 - superstruct: ^1.0.3 - checksum: 0bc675358ecc09b3bc04da613d73666295d7afa51ff6b8554801585966900b24b8545bd93b8b2e9a17db867ebe421fe884baf3558ec4ca3199fa65504f677c1b - languageName: node - linkType: hard - "@metamask/utils@npm:^8.0.0, @metamask/utils@npm:^8.1.0, @metamask/utils@npm:^8.3.0": version: 8.3.0 resolution: "@metamask/utils@npm:8.3.0" @@ -3284,13 +3269,6 @@ __metadata: languageName: node linkType: hard -"@noble/ed25519@npm:^1.6.0": - version: 1.7.3 - resolution: "@noble/ed25519@npm:1.7.3" - checksum: 45169927d51de513e47bbeebff3a603433c4ac7579e1b8c5034c380a0afedbe85e6959be3d69584a7a5ed6828d638f8f28879003b9bb2fb5f22d8aa2d88fd5fe - languageName: node - linkType: hard - "@noble/hashes@npm:1.3.1": version: 1.3.1 resolution: "@noble/hashes@npm:1.3.1" @@ -3298,20 +3276,13 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.3.3, @noble/hashes@npm:^1.0.0, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.3.2, @noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.1, @noble/hashes@npm:~1.3.2": +"@noble/hashes@npm:1.3.3, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.3.2, @noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.1, @noble/hashes@npm:~1.3.2": version: 1.3.3 resolution: "@noble/hashes@npm:1.3.3" checksum: 8a6496d1c0c64797339bc694ad06cdfaa0f9e56cd0c3f68ae3666cfb153a791a55deb0af9c653c7ed2db64d537aa3e3054629740d2f2338bb1dcb7ab60cd205b languageName: node linkType: hard -"@noble/secp256k1@npm:^1.5.5": - version: 1.7.1 - resolution: "@noble/secp256k1@npm:1.7.1" - checksum: d2301f1f7690368d8409a3152450458f27e54df47e3f917292de3de82c298770890c2de7c967d237eff9c95b70af485389a9695f73eb05a43e2bd562d18b18cb - languageName: node - linkType: hard - "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -16905,7 +16876,7 @@ __metadata: "@metamask/eslint-config-typescript": ^12.1.0 "@metamask/snaps-cli": ^6.2.0 "@metamask/snaps-jest": ^8.0.0 - "@metamask/snaps-sdk": ^4.1.0 + "@metamask/snaps-sdk": ^4.2.0 "@typescript-eslint/eslint-plugin": ^5.42.1 "@typescript-eslint/parser": ^5.42.1 buffer: ^6.0.3 From 60be41a86d68d1cb28dc5872b11d14401d51e9db Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Tue, 2 Jul 2024 10:20:16 +0200 Subject: [PATCH 3/9] Bump snaps deps to latest --- packages/snap/package.json | 6 +- yarn.lock | 356 ++++++++++++++++++++++--------------- 2 files changed, 212 insertions(+), 150 deletions(-) diff --git a/packages/snap/package.json b/packages/snap/package.json index a0874091..b76f4a6a 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -27,7 +27,7 @@ "test": "jest" }, "dependencies": { - "@metamask/snaps-sdk": "^4.2.0", + "@metamask/snaps-sdk": "^6.0.0", "buffer": "^6.0.3" }, "devDependencies": { @@ -37,8 +37,8 @@ "@metamask/eslint-config-jest": "^12.1.0", "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", - "@metamask/snaps-cli": "^6.2.0", - "@metamask/snaps-jest": "^8.0.0", + "@metamask/snaps-cli": "^6.2.1", + "@metamask/snaps-jest": "^8.2.0", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^5.42.1", "eslint": "^8.45.0", diff --git a/yarn.lock b/yarn.lock index f2252e3f..94bf48fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2588,15 +2588,15 @@ __metadata: languageName: node linkType: hard -"@metamask/approval-controller@npm:^6.0.2": - version: 6.0.2 - resolution: "@metamask/approval-controller@npm:6.0.2" +"@metamask/approval-controller@npm:^7.0.0": + version: 7.0.0 + resolution: "@metamask/approval-controller@npm:7.0.0" dependencies: - "@metamask/base-controller": ^5.0.2 + "@metamask/base-controller": ^6.0.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 nanoid: ^3.1.31 - checksum: 662365ec460edc1e3839c2f9f427d44a707350ecca7fa3524d75da3652306b61fc69f7336154142b4a38657c272624232ea40bf218427ba15b11fd89c5a5ae42 + checksum: fa9c08959dbd89563fe8f07d0086703854d1f645ac00fe58eae62cc8a4eb344de7c26744baa9f2c2ad7a10999dd522bcb822692f76f76f1c84189550c6c80cdf languageName: node linkType: hard @@ -2615,30 +2615,30 @@ __metadata: languageName: node linkType: hard -"@metamask/base-controller@npm:^5.0.1, @metamask/base-controller@npm:^5.0.2": - version: 5.0.2 - resolution: "@metamask/base-controller@npm:5.0.2" +"@metamask/base-controller@npm:^6.0.0": + version: 6.0.0 + resolution: "@metamask/base-controller@npm:6.0.0" dependencies: "@metamask/utils": ^8.3.0 immer: ^9.0.6 - checksum: 22c43c3147c7da1c1b87de4d41948e275f8e0adcdb1210a55a62aa497db4fa82399750901729d9dc6285d89e68f18e5bd15095ee4d4c6cfc169035173e69a1d2 + checksum: ff5c4acedc698e2477f1d719f64363d8763b21836dcea4675214c078457cd47dde068aa336b249663f3c7fb3c0f536ce420870811e00ca3a410646740a9f5934 languageName: node linkType: hard -"@metamask/controller-utils@npm:^9.0.1": - version: 9.0.2 - resolution: "@metamask/controller-utils@npm:9.0.2" +"@metamask/controller-utils@npm:^11.0.0": + version: 11.0.0 + resolution: "@metamask/controller-utils@npm:11.0.0" dependencies: "@ethereumjs/util": ^8.1.0 "@metamask/eth-query": ^4.0.0 "@metamask/ethjs-unit": ^0.3.0 "@metamask/utils": ^8.3.0 - "@spruceid/siwe-parser": 1.1.3 + "@spruceid/siwe-parser": 2.1.0 "@types/bn.js": ^5.1.5 bn.js: ^5.2.1 eth-ens-namehash: ^2.0.8 fast-deep-equal: ^3.1.3 - checksum: 06e1e33275aba4a54ee5a99fa2ca614a089f9e0d4369d700694bad0386af2492f0aa9337124db41afb54ffe4c9cb89055f6e05810333436b20be7d7da133aa45 + checksum: ce77d9006c34109d78787d91036b605c2e401f51bae58a60cfd955905ebd63ebe5a007b93861a1fcc51bb7e57b69ec2a6dd6142656c1ee2d87d74e397752dffa languageName: node linkType: hard @@ -2702,31 +2702,44 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-json-rpc-middleware@npm:^12.1.0": - version: 12.1.0 - resolution: "@metamask/eth-json-rpc-middleware@npm:12.1.0" +"@metamask/eth-block-tracker@npm:^9.0.3": + version: 9.0.3 + resolution: "@metamask/eth-block-tracker@npm:9.0.3" dependencies: - "@metamask/eth-json-rpc-provider": ^2.1.0 + "@metamask/eth-json-rpc-provider": ^3.0.2 + "@metamask/safe-event-emitter": ^3.0.0 + "@metamask/utils": ^8.1.0 + json-rpc-random-id: ^1.0.1 + pify: ^5.0.0 + checksum: edd3d59a0416752d90c8e2d8c10c31635dbe3eb323fcb054c401528afe4cbbb6a5a85aedd6ffee4a504d9779656bfab027f2274fd95981c90bf56b6f565dbca2 + languageName: node + linkType: hard + +"@metamask/eth-json-rpc-middleware@npm:^12.1.2": + version: 12.1.2 + resolution: "@metamask/eth-json-rpc-middleware@npm:12.1.2" + dependencies: + "@metamask/eth-block-tracker": ^9.0.3 + "@metamask/eth-json-rpc-provider": ^3.0.2 "@metamask/eth-sig-util": ^7.0.0 - "@metamask/json-rpc-engine": ^7.1.1 + "@metamask/json-rpc-engine": ^8.0.2 "@metamask/rpc-errors": ^6.0.0 "@metamask/utils": ^8.1.0 - eth-block-tracker: ^8.0.0 klona: ^2.0.6 pify: ^5.0.0 safe-stable-stringify: ^2.4.3 - checksum: de4f0afb80575d853901812406e9c58bafd3a1679164b2b9fa60dcfc8841c7e625661b9f1ebe5ef4d0d15b66736a7a5495388de879739689af9a9539daf1fdfa + checksum: 0334fa8e51d73488e42e1cd663e90012f4055c5cd04cb4ff371ecb3552b82cd271f27a88ff0187ad23f195cfbbba467126711c08b20c1124083a706a85524a82 languageName: node linkType: hard -"@metamask/eth-json-rpc-provider@npm:^2.1.0": - version: 2.3.2 - resolution: "@metamask/eth-json-rpc-provider@npm:2.3.2" +"@metamask/eth-json-rpc-provider@npm:^3.0.2": + version: 3.0.2 + resolution: "@metamask/eth-json-rpc-provider@npm:3.0.2" dependencies: - "@metamask/json-rpc-engine": ^7.3.2 + "@metamask/json-rpc-engine": ^8.0.2 "@metamask/safe-event-emitter": ^3.0.0 "@metamask/utils": ^8.3.0 - checksum: e6731271aad3b972d85b9230c26d35a9b88722f3bd3024675ad2f568e634e9fdfef4717ef2892f3cc512d381cf17a4e20dbd5eb808ced765082bea3379ad6ddc + checksum: 0321eaad6fa205a9d3ddcfaf28e63c05291614893cb2e116151185a4acbd6bb6a508d6e556b3cb8bc4d3caef4bf0a638202d9b6bdc127fbcb81715eb2660a809 languageName: node linkType: hard @@ -2766,25 +2779,25 @@ __metadata: languageName: node linkType: hard -"@metamask/json-rpc-engine@npm:^7.1.1, @metamask/json-rpc-engine@npm:^7.3.2": - version: 7.3.3 - resolution: "@metamask/json-rpc-engine@npm:7.3.3" +"@metamask/json-rpc-engine@npm:^8.0.1, @metamask/json-rpc-engine@npm:^8.0.2": + version: 8.0.2 + resolution: "@metamask/json-rpc-engine@npm:8.0.2" dependencies: "@metamask/rpc-errors": ^6.2.1 "@metamask/safe-event-emitter": ^3.0.0 "@metamask/utils": ^8.3.0 - checksum: 7bab8b4d2341a6243ba451bc58283f0a6905b09f7257857859848a51a795444ca6899b1a6908b15f8ed236fb574ab85a630c9cb28d127ab52c4630e496c16006 + checksum: c240d298ad503d93922a94a62cf59f0344b6d6644a523bc8ea3c0f321bea7172b89f2747a5618e2861b2e8152ae5086b76f391a10e4566529faa50b8850c051d languageName: node linkType: hard -"@metamask/json-rpc-engine@npm:^8.0.1": - version: 8.0.1 - resolution: "@metamask/json-rpc-engine@npm:8.0.1" +"@metamask/json-rpc-engine@npm:^9.0.0": + version: 9.0.0 + resolution: "@metamask/json-rpc-engine@npm:9.0.0" dependencies: "@metamask/rpc-errors": ^6.2.1 "@metamask/safe-event-emitter": ^3.0.0 "@metamask/utils": ^8.3.0 - checksum: 32c0abaa7e8d158d36889537a784e8a6f5fa3d541962881e195585ccf91926e11019ed5827168979d948544e7ba1de3ac6f07b5770ffe65173b956a361c817e1 + checksum: b97170b36843145361015dabc5651df1d2c7f28f0756d3c9c05aef6a483098d562a9983cbe0e15f7fd1a66aa26481132b03ccb9061a2c48f0d3249c1f2348e97 languageName: node linkType: hard @@ -2800,16 +2813,28 @@ __metadata: languageName: node linkType: hard -"@metamask/key-tree@npm:^9.0.0, @metamask/key-tree@npm:^9.1.0": - version: 9.1.0 - resolution: "@metamask/key-tree@npm:9.1.0" +"@metamask/json-rpc-middleware-stream@npm:^8.0.0": + version: 8.0.0 + resolution: "@metamask/json-rpc-middleware-stream@npm:8.0.0" + dependencies: + "@metamask/json-rpc-engine": ^9.0.0 + "@metamask/safe-event-emitter": ^3.0.0 + "@metamask/utils": ^8.3.0 + readable-stream: ^3.6.2 + checksum: 4bf809366da41744c841dd50d68cf126e1cccda0d78a812154489faa2b0a56bbd511a7bb4e9ccc7c68f2a9a6437f00561bc9423a5b5596badd511a4ff6244c9e + languageName: node + linkType: hard + +"@metamask/key-tree@npm:^9.0.0, @metamask/key-tree@npm:^9.1.1": + version: 9.1.1 + resolution: "@metamask/key-tree@npm:9.1.1" dependencies: "@metamask/scure-bip39": ^2.1.1 "@metamask/utils": ^8.3.0 "@noble/curves": ^1.2.0 "@noble/hashes": ^1.3.2 "@scure/base": ^1.0.0 - checksum: 02709493f87c4cf8ebe3b81a47d3239d4d0b15fd73ac877047d0907652ff740d307966392f6f31d2f7871ab84315dddb4310edbf4edb976941a53d4e9ae04404 + checksum: 4de5f92e4d9408829552bb569b998613ed940f289613fe86f9a5f0a66e392ec386d70b2365943c216b83c9ff249877fd731f2f791240a622ff186fd047d81f9e languageName: node linkType: hard @@ -2833,13 +2858,13 @@ __metadata: languageName: node linkType: hard -"@metamask/permission-controller@npm:^9.0.2": - version: 9.0.2 - resolution: "@metamask/permission-controller@npm:9.0.2" +"@metamask/permission-controller@npm:^10.0.0": + version: 10.0.0 + resolution: "@metamask/permission-controller@npm:10.0.0" dependencies: - "@metamask/base-controller": ^5.0.1 - "@metamask/controller-utils": ^9.0.1 - "@metamask/json-rpc-engine": ^8.0.1 + "@metamask/base-controller": ^6.0.0 + "@metamask/controller-utils": ^11.0.0 + "@metamask/json-rpc-engine": ^9.0.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 "@types/deep-freeze-strict": ^1.1.0 @@ -2847,35 +2872,35 @@ __metadata: immer: ^9.0.6 nanoid: ^3.1.31 peerDependencies: - "@metamask/approval-controller": ^6.0.0 - checksum: c4c81f04ecebe5db2d5848709b2c8d89ebe90098e4f8dd48392f49826e4666681a78f9b89a85cc597944f85b1bdfdd4fb8411489e7110586edf362ef17b4086e + "@metamask/approval-controller": ^7.0.0 + checksum: 9b05ebac86a5d028388eca35861357561298ea938f3adb5e134566f5d16a9a01cc582cffdc14f3680f103ba770827f108a066bc48fcb13da984a04da0af178f7 languageName: node linkType: hard -"@metamask/phishing-controller@npm:^9.0.1": - version: 9.0.1 - resolution: "@metamask/phishing-controller@npm:9.0.1" +"@metamask/phishing-controller@npm:^10.0.0": + version: 10.0.0 + resolution: "@metamask/phishing-controller@npm:10.0.0" dependencies: - "@metamask/base-controller": ^5.0.1 - "@metamask/controller-utils": ^9.0.1 + "@metamask/base-controller": ^6.0.0 + "@metamask/controller-utils": ^11.0.0 "@types/punycode": ^2.1.0 eth-phishing-detect: ^1.2.0 punycode: ^2.1.1 - checksum: f8770b94d9d4e7f7daa5619d9bf32bc0909b6947dd72172ba76f085ca6e29bafa9d728f57e6ed296355f589ec6d267ee537587a7a70ccc2b2b971604e3ad0c8b + checksum: c9da583e8620dc0bb82e799305cccd1b0f54501c9a5b9321295049d08d16fff3bf4111d4c81c76c5d0f292d4c8e1113b3baef18d011bd09e6c2b2404c3d43557 languageName: node linkType: hard -"@metamask/post-message-stream@npm:^8.0.0": - version: 8.0.0 - resolution: "@metamask/post-message-stream@npm:8.0.0" +"@metamask/post-message-stream@npm:^8.1.0": + version: 8.1.0 + resolution: "@metamask/post-message-stream@npm:8.1.0" dependencies: "@metamask/utils": ^8.1.0 readable-stream: 3.6.2 - checksum: 3016d8d5f8a5954fd146ce06c0b5fd7a9a070b43284e2bad140e179ee259146b666d56e6dbefa0277f56fbb67806970c9de3067c75f0e56886d0752e7c0f5e22 + checksum: 84b5f90ee28d3440520088c01fb64c42a2ed3e761bef4285c8dd72f78c3f634d58ac3314c5ebaedabc92e3db369960e17d61b84719f2d6271cd6d4957f2b6704 languageName: node linkType: hard -"@metamask/providers@npm:^16.0.0, @metamask/providers@npm:^16.1.0": +"@metamask/providers@npm:^16.0.0": version: 16.1.0 resolution: "@metamask/providers@npm:16.1.0" dependencies: @@ -2895,6 +2920,27 @@ __metadata: languageName: node linkType: hard +"@metamask/providers@npm:^17.0.0": + version: 17.1.0 + resolution: "@metamask/providers@npm:17.1.0" + dependencies: + "@metamask/json-rpc-engine": ^9.0.0 + "@metamask/json-rpc-middleware-stream": ^8.0.0 + "@metamask/object-multiplex": ^2.0.0 + "@metamask/rpc-errors": ^6.2.1 + "@metamask/safe-event-emitter": ^3.1.1 + "@metamask/utils": ^8.3.0 + detect-browser: ^5.2.0 + extension-port-stream: ^4.1.0 + fast-deep-equal: ^3.1.3 + is-stream: ^2.0.0 + readable-stream: ^3.6.2 + peerDependencies: + webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0 + checksum: 1378f7e9a5385536e814190f880cd71bbb0a055b8a234012243ba9f54c5eace1d8bb5324732cb46b3046ad22349a698c1ca3c06402e52675b66e55b9b741f820 + languageName: node + linkType: hard + "@metamask/rpc-errors@npm:^6.0.0, @metamask/rpc-errors@npm:^6.2.1": version: 6.2.1 resolution: "@metamask/rpc-errors@npm:6.2.1" @@ -2929,9 +2975,9 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-cli@npm:^6.2.0": - version: 6.2.0 - resolution: "@metamask/snaps-cli@npm:6.2.0" +"@metamask/snaps-cli@npm:^6.2.1": + version: 6.2.1 + resolution: "@metamask/snaps-cli@npm:6.2.1" dependencies: "@babel/core": ^7.23.2 "@babel/plugin-transform-class-properties": ^7.22.5 @@ -2941,8 +2987,8 @@ __metadata: "@babel/plugin-transform-runtime": ^7.13.2 "@babel/preset-env": ^7.23.2 "@babel/preset-typescript": ^7.23.2 - "@metamask/snaps-sdk": ^4.1.0 - "@metamask/snaps-utils": ^7.3.0 + "@metamask/snaps-sdk": ^6.0.0 + "@metamask/snaps-utils": ^7.7.0 "@metamask/snaps-webpack-plugin": ^4.0.1 "@metamask/utils": ^8.3.0 "@swc/core": 1.3.78 @@ -2984,27 +3030,27 @@ __metadata: yargs: ^17.7.1 bin: mm-snap: ./dist/main.js - checksum: 33f9879e8870e27490bc70ed839fe0d9d38fd21a130d555db04bcf6d7477cdc725e9951cc7d0e7f67afab0601e66a58087058f4c5f033a26677bce39c3821d7e + checksum: 02fb576b7670a00ab5eac89859e5ef82978a50a064a308191fcb8e04c653062642829d5d1a0c2f69c224ad38c0d6196d9e0f427f666cbd096cb2dc1a28725e2b languageName: node linkType: hard -"@metamask/snaps-controllers@npm:^8.1.0": - version: 8.1.1 - resolution: "@metamask/snaps-controllers@npm:8.1.1" +"@metamask/snaps-controllers@npm:^9.1.0": + version: 9.2.0 + resolution: "@metamask/snaps-controllers@npm:9.2.0" dependencies: - "@metamask/approval-controller": ^6.0.2 - "@metamask/base-controller": ^5.0.2 - "@metamask/json-rpc-engine": ^8.0.1 - "@metamask/json-rpc-middleware-stream": ^7.0.1 + "@metamask/approval-controller": ^7.0.0 + "@metamask/base-controller": ^6.0.0 + "@metamask/json-rpc-engine": ^9.0.0 + "@metamask/json-rpc-middleware-stream": ^8.0.0 "@metamask/object-multiplex": ^2.0.0 - "@metamask/permission-controller": ^9.0.2 - "@metamask/phishing-controller": ^9.0.1 - "@metamask/post-message-stream": ^8.0.0 + "@metamask/permission-controller": ^10.0.0 + "@metamask/phishing-controller": ^10.0.0 + "@metamask/post-message-stream": ^8.1.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/snaps-registry": ^3.1.0 - "@metamask/snaps-rpc-methods": ^8.1.0 - "@metamask/snaps-sdk": ^4.1.0 - "@metamask/snaps-utils": ^7.3.0 + "@metamask/snaps-rpc-methods": ^9.1.4 + "@metamask/snaps-sdk": ^6.0.0 + "@metamask/snaps-utils": ^7.7.0 "@metamask/utils": ^8.3.0 "@xstate/fsm": ^2.0.0 browserify-zlib: ^0.2.0 @@ -3017,61 +3063,62 @@ __metadata: readable-web-to-node-stream: ^3.0.2 tar-stream: ^3.1.7 peerDependencies: - "@metamask/snaps-execution-environments": ^6.1.0 + "@metamask/snaps-execution-environments": ^6.5.0 peerDependenciesMeta: "@metamask/snaps-execution-environments": optional: true - checksum: 6b3d68a48bae8a70f1f59043de6636c2ad5b2d8e427e40c1b124fc7a35a7dccc77031987ee404a8927dd3d53b4c82782abb80e768ef1defad378dbe2fa2b4a13 + checksum: 8b5c3fbd9dbb6054e07a666cf639bfc7bcd325ddae95ca2dd13f1dc46ed2d22931758c60116980ebc26d907e89fe235dd7003b1a7e8a743b01fcac9ea6cbbc3d languageName: node linkType: hard -"@metamask/snaps-execution-environments@npm:^6.1.0": - version: 6.1.0 - resolution: "@metamask/snaps-execution-environments@npm:6.1.0" +"@metamask/snaps-execution-environments@npm:^6.5.0": + version: 6.5.0 + resolution: "@metamask/snaps-execution-environments@npm:6.5.0" dependencies: - "@metamask/json-rpc-engine": ^8.0.1 + "@metamask/json-rpc-engine": ^9.0.0 "@metamask/object-multiplex": ^2.0.0 - "@metamask/post-message-stream": ^8.0.0 - "@metamask/providers": ^16.1.0 + "@metamask/post-message-stream": ^8.1.0 + "@metamask/providers": ^17.0.0 "@metamask/rpc-errors": ^6.2.1 - "@metamask/snaps-sdk": ^4.1.0 - "@metamask/snaps-utils": ^7.3.0 + "@metamask/snaps-sdk": ^6.0.0 + "@metamask/snaps-utils": ^7.7.0 "@metamask/utils": ^8.3.0 nanoid: ^3.1.31 readable-stream: ^3.6.2 superstruct: ^1.0.3 - checksum: 7e9a3e7fcea6bc411b7af4bf7ccb65878a630671f990d605ef3bf1ab3347bd3674b8769fcf5c075a00f1c9a37375d43a7d2af3b4eccfd62e618299756d1f0f78 + checksum: be55289a38b4d147012af0c23820850186989f7d6b7bd851a32518ed62ecddcea9e03943644a77973818d7af7abdcd002028faac51558249d2efa6cf79fbe12d languageName: node linkType: hard -"@metamask/snaps-jest@npm:^8.0.0": - version: 8.0.0 - resolution: "@metamask/snaps-jest@npm:8.0.0" +"@metamask/snaps-jest@npm:^8.2.0": + version: 8.2.0 + resolution: "@metamask/snaps-jest@npm:8.2.0" dependencies: "@jest/environment": ^29.5.0 "@jest/expect": ^29.5.0 "@jest/globals": ^29.5.0 - "@metamask/base-controller": ^5.0.2 - "@metamask/eth-json-rpc-middleware": ^12.1.0 - "@metamask/json-rpc-engine": ^8.0.1 - "@metamask/json-rpc-middleware-stream": ^7.0.1 - "@metamask/key-tree": ^9.0.0 - "@metamask/permission-controller": ^9.0.2 - "@metamask/snaps-controllers": ^8.1.0 - "@metamask/snaps-execution-environments": ^6.1.0 - "@metamask/snaps-rpc-methods": ^8.1.0 - "@metamask/snaps-sdk": ^4.1.0 - "@metamask/snaps-utils": ^7.3.0 + "@metamask/base-controller": ^6.0.0 + "@metamask/eth-json-rpc-middleware": ^12.1.2 + "@metamask/json-rpc-engine": ^9.0.0 + "@metamask/json-rpc-middleware-stream": ^8.0.0 + "@metamask/key-tree": ^9.1.1 + "@metamask/permission-controller": ^10.0.0 + "@metamask/snaps-controllers": ^9.1.0 + "@metamask/snaps-execution-environments": ^6.5.0 + "@metamask/snaps-rpc-methods": ^9.1.4 + "@metamask/snaps-sdk": ^6.0.0 + "@metamask/snaps-utils": ^7.7.0 "@metamask/utils": ^8.3.0 "@reduxjs/toolkit": ^1.9.5 express: ^4.18.2 jest-environment-node: ^29.5.0 jest-matcher-utils: ^29.5.0 + mime: ^3.0.0 readable-stream: ^3.6.2 redux: ^4.2.1 redux-saga: ^1.2.3 superstruct: ^1.0.3 - checksum: 83cc14e457754ccfc33d6562f29a48588a7fb574c712717c5961e41c38212c1f76049c7204f46b5bfca84a1bd31bf53ac91fa41f8f80d6fa28a768b0c6aeb9d9 + checksum: 616d89156a4151f48867ed66fcdfacd44ddfdc292eed653efb8ebc471a315210dc540830ff0b69e41cebff4d2138a012e7c70d48c768cf0282ce0ec98fb4fe77 languageName: node linkType: hard @@ -3087,19 +3134,19 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-rpc-methods@npm:^8.1.0": - version: 8.1.0 - resolution: "@metamask/snaps-rpc-methods@npm:8.1.0" +"@metamask/snaps-rpc-methods@npm:^9.1.4": + version: 9.1.4 + resolution: "@metamask/snaps-rpc-methods@npm:9.1.4" dependencies: - "@metamask/key-tree": ^9.0.0 - "@metamask/permission-controller": ^9.0.2 + "@metamask/key-tree": ^9.1.1 + "@metamask/permission-controller": ^10.0.0 "@metamask/rpc-errors": ^6.2.1 - "@metamask/snaps-sdk": ^4.1.0 - "@metamask/snaps-utils": ^7.3.0 + "@metamask/snaps-sdk": ^6.0.0 + "@metamask/snaps-utils": ^7.7.0 "@metamask/utils": ^8.3.0 "@noble/hashes": ^1.3.1 superstruct: ^1.0.3 - checksum: 343da447508c1d5a0757640bb6aa3a7b3979294574ce0600f5a011c2918eb1842ae20c93c0967cf49da622dae99af73f6b243fdfbf65046c5f638dc52d04600d + checksum: f32775c53afb83f6f6907e72bec412ba21a8535c50910d2e2fac7efa68bac7d62dd162ca0329297287b4f8f507f9fda2dcc4396966931ce8e9331d5fddbfc343 languageName: node linkType: hard @@ -3117,33 +3164,32 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-sdk@npm:^4.1.0, @metamask/snaps-sdk@npm:^4.2.0": - version: 4.2.0 - resolution: "@metamask/snaps-sdk@npm:4.2.0" +"@metamask/snaps-sdk@npm:^6.0.0": + version: 6.0.0 + resolution: "@metamask/snaps-sdk@npm:6.0.0" dependencies: - "@metamask/key-tree": ^9.1.0 - "@metamask/providers": ^16.1.0 + "@metamask/key-tree": ^9.1.1 + "@metamask/providers": ^17.0.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 - fast-xml-parser: ^4.3.4 superstruct: ^1.0.3 - checksum: f9b0e6d7600680183e69d419f5a802208fdc119c7d1226a74076f3b8b8c581850b135392c2f35c391305fc37406973afeb19d8909101580ec16b63fd2f200a8c + checksum: 0a3b7a034028a7583b4e1a5414a67470b2ed70cc411fc4877a79f95803c64d99eafb785cbffaf827c3f3138a065e439480b9628456a8a5fa8d39c9c8dd9bd5db languageName: node linkType: hard -"@metamask/snaps-utils@npm:^7.0.1, @metamask/snaps-utils@npm:^7.3.0": - version: 7.3.0 - resolution: "@metamask/snaps-utils@npm:7.3.0" +"@metamask/snaps-utils@npm:^7.0.1, @metamask/snaps-utils@npm:^7.7.0": + version: 7.7.0 + resolution: "@metamask/snaps-utils@npm:7.7.0" dependencies: "@babel/core": ^7.23.2 "@babel/types": ^7.23.0 - "@metamask/base-controller": ^5.0.2 - "@metamask/key-tree": ^9.0.0 - "@metamask/permission-controller": ^9.0.2 + "@metamask/base-controller": ^6.0.0 + "@metamask/key-tree": ^9.1.1 + "@metamask/permission-controller": ^10.0.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/slip44": ^3.1.0 "@metamask/snaps-registry": ^3.1.0 - "@metamask/snaps-sdk": ^4.1.0 + "@metamask/snaps-sdk": ^6.0.0 "@metamask/utils": ^8.3.0 "@noble/hashes": ^1.3.1 "@scure/base": ^1.1.1 @@ -3151,13 +3197,14 @@ __metadata: cron-parser: ^4.5.0 fast-deep-equal: ^3.1.3 fast-json-stable-stringify: ^2.1.0 + fast-xml-parser: ^4.3.4 marked: ^12.0.1 rfdc: ^1.3.0 semver: ^7.5.4 ses: ^1.1.0 superstruct: ^1.0.3 validate-npm-package-name: ^5.0.0 - checksum: e58bb4cbcc6c8f17d2bf18995eb75e13af296f3f6c7d97a5681d3d76097450ae49bba9c5ac134e41ae6e01bfb005d0bc4bb1256d421e46b6c56490fa1b9f25ab + checksum: e801f4ce39c05e7d328e13968174f6d61dd388404218f8cafa43cccd0b54cfe46473d82e03ec1654a0db28a9a46238380bab45d67edf12d81392393246127c71 languageName: node linkType: hard @@ -3276,13 +3323,20 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.3.3, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.3.2, @noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.1, @noble/hashes@npm:~1.3.2": +"@noble/hashes@npm:1.3.3, @noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.1, @noble/hashes@npm:~1.3.2": version: 1.3.3 resolution: "@noble/hashes@npm:1.3.3" checksum: 8a6496d1c0c64797339bc694ad06cdfaa0f9e56cd0c3f68ae3666cfb153a791a55deb0af9c653c7ed2db64d537aa3e3054629740d2f2338bb1dcb7ab60cd205b languageName: node linkType: hard +"@noble/hashes@npm:^1.1.2, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.3.2": + version: 1.4.0 + resolution: "@noble/hashes@npm:1.4.0" + checksum: 8ba816ae26c90764b8c42493eea383716396096c5f7ba6bea559993194f49d80a73c081f315f4c367e51bd2d5891700bcdfa816b421d24ab45b41cb03e4f3342 + languageName: node + linkType: hard + "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -4133,12 +4187,15 @@ __metadata: languageName: node linkType: hard -"@spruceid/siwe-parser@npm:1.1.3": - version: 1.1.3 - resolution: "@spruceid/siwe-parser@npm:1.1.3" +"@spruceid/siwe-parser@npm:2.1.0": + version: 2.1.0 + resolution: "@spruceid/siwe-parser@npm:2.1.0" dependencies: + "@noble/hashes": ^1.1.2 apg-js: ^4.1.1 - checksum: 708786ba2f10987c45c1fd8a6243ba6572ee7f320531616d71ff66044828bc24af66f5537ce09c9272bdae93fcc35b566a7804fe7997284f2ee5445a36e6add2 + uri-js: ^4.4.1 + valid-url: ^1.0.9 + checksum: 99365956bd5e35127568e7ee69246cfc79cc26d83f6fbc5e3a9ed6f0693f7da6f2ee67cf8b93b65761da3c3ce8cc156858bab85e24b2eadd49ec8ae07cb8826e languageName: node linkType: hard @@ -9468,19 +9525,6 @@ __metadata: languageName: node linkType: hard -"eth-block-tracker@npm:^8.0.0": - version: 8.1.0 - resolution: "eth-block-tracker@npm:8.1.0" - dependencies: - "@metamask/eth-json-rpc-provider": ^2.1.0 - "@metamask/safe-event-emitter": ^3.0.0 - "@metamask/utils": ^8.1.0 - json-rpc-random-id: ^1.0.1 - pify: ^5.0.0 - checksum: a7e1e8462995d2924a2daa3224539c120df6c07a26d68522f4338ca23189d4195545e6251b8e64f79dc99a685a8124efd496e25f7ee201dc273d92e3d9e90aad - languageName: node - linkType: hard - "eth-ens-namehash@npm:^2.0.8": version: 2.0.8 resolution: "eth-ens-namehash@npm:2.0.8" @@ -9691,6 +9735,17 @@ __metadata: languageName: node linkType: hard +"extension-port-stream@npm:^4.1.0": + version: 4.2.0 + resolution: "extension-port-stream@npm:4.2.0" + dependencies: + readable-stream: ^3.6.2 || ^4.4.2 + peerDependencies: + webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0 + checksum: 85559c82e3f3aa21462e234b30b7d53872708893664cd03f2f848af556cf0730cf2243b089efc9d40bbe9a4f73bd8fd19684db5a985329b0c4402b4f2fe26358 + languageName: node + linkType: hard + "external-editor@npm:^3.0.3": version: 3.1.0 resolution: "external-editor@npm:3.1.0" @@ -16874,9 +16929,9 @@ __metadata: "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 - "@metamask/snaps-cli": ^6.2.0 - "@metamask/snaps-jest": ^8.0.0 - "@metamask/snaps-sdk": ^4.2.0 + "@metamask/snaps-cli": ^6.2.1 + "@metamask/snaps-jest": ^8.2.0 + "@metamask/snaps-sdk": ^6.0.0 "@typescript-eslint/eslint-plugin": ^5.42.1 "@typescript-eslint/parser": ^5.42.1 buffer: ^6.0.3 @@ -18325,7 +18380,7 @@ __metadata: languageName: node linkType: hard -"uri-js@npm:^4.2.2": +"uri-js@npm:^4.2.2, uri-js@npm:^4.4.1": version: 4.4.1 resolution: "uri-js@npm:4.4.1" dependencies: @@ -18438,6 +18493,13 @@ __metadata: languageName: node linkType: hard +"valid-url@npm:^1.0.9": + version: 1.0.9 + resolution: "valid-url@npm:1.0.9" + checksum: 3ecb030559404441c2cf104cbabab8770efb0f36d117db03d1081052ef133015a68806148ce954bb4dd0b5c42c14b709a88783c93d66b0916cb67ba771c98702 + languageName: node + linkType: hard + "validate-npm-package-name@npm:^5.0.0": version: 5.0.0 resolution: "validate-npm-package-name@npm:5.0.0" From ba2d6ca655f2876160038427eaf9db983f055304 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Tue, 2 Jul 2024 10:24:55 +0200 Subject: [PATCH 4/9] Update manifest --- packages/snap/snap.manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index 5840b106..10591bd1 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/template-snap-monorepo.git" }, "source": { - "shasum": "2OwZmIrZmVpVvpXkYreocpEeYEkeNjriRdSSjbqycCQ=", + "shasum": "2Kmv864c0r0L3Dwo/8NSIS9PzyJLn448tatus5qqVMs=", "location": { "npm": { "filePath": "dist/bundle.js", From 3a45950377a0fdd0cfab1bae1da3a018e9b3e35a Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Tue, 2 Jul 2024 10:27:58 +0200 Subject: [PATCH 5/9] Convert test to JSX --- .../src/{index.test.ts => index.test.tsx} | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) rename packages/snap/src/{index.test.ts => index.test.tsx} (70%) diff --git a/packages/snap/src/index.test.ts b/packages/snap/src/index.test.tsx similarity index 70% rename from packages/snap/src/index.test.ts rename to packages/snap/src/index.test.tsx index d7ba314a..eb0d1364 100644 --- a/packages/snap/src/index.test.ts +++ b/packages/snap/src/index.test.tsx @@ -1,6 +1,6 @@ import { expect } from '@jest/globals'; import { installSnap } from '@metamask/snaps-jest'; -import { panel, text } from '@metamask/snaps-sdk'; +import { Box, Text, Bold } from '@metamask/snaps-sdk/jsx'; describe('onRpcRequest', () => { describe('hello', () => { @@ -16,13 +16,18 @@ describe('onRpcRequest', () => { const ui = await response.getInterface(); expect(ui.type).toBe('confirmation'); expect(ui).toRender( - panel([ - text(`Hello, **${origin}**!`), - text('This custom confirmation is just for display purposes.'), - text( - 'But you can edit the snap source code to make it do something, if you want to!', - ), - ]), + + + Hello, {origin}! + + + This custom confirmation is just for display purposes. + + + But you can edit the snap source code to make it do something, + if you want to! + + ); await ui.ok(); From 0903baa34c3a0e68fc7bb293f2ed7d9e4e66f286 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Tue, 2 Jul 2024 10:28:45 +0200 Subject: [PATCH 6/9] Fix lint --- packages/snap/src/index.test.tsx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/snap/src/index.test.tsx b/packages/snap/src/index.test.tsx index eb0d1364..ebb744fd 100644 --- a/packages/snap/src/index.test.tsx +++ b/packages/snap/src/index.test.tsx @@ -17,17 +17,15 @@ describe('onRpcRequest', () => { expect(ui.type).toBe('confirmation'); expect(ui).toRender( - - Hello, {origin}! - - - This custom confirmation is just for display purposes. - - - But you can edit the snap source code to make it do something, - if you want to! - - + + Hello, {origin}! + + This custom confirmation is just for display purposes. + + But you can edit the snap source code to make it do something, if + you want to! + + , ); await ui.ok(); From 889275626cf4b081154330aaaebdf4b7307bfb6e Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Wed, 31 Jul 2024 10:00:35 +0200 Subject: [PATCH 7/9] Bump SDK again --- packages/snap/package.json | 2 +- yarn.lock | 113 ++++++++++++++++++++++++------------- 2 files changed, 74 insertions(+), 41 deletions(-) diff --git a/packages/snap/package.json b/packages/snap/package.json index b76f4a6a..aa818de6 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -27,7 +27,7 @@ "test": "jest" }, "dependencies": { - "@metamask/snaps-sdk": "^6.0.0", + "@metamask/snaps-sdk": "^6.1.1", "buffer": "^6.0.3" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 94bf48fb..718d8efe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2790,14 +2790,14 @@ __metadata: languageName: node linkType: hard -"@metamask/json-rpc-engine@npm:^9.0.0": - version: 9.0.0 - resolution: "@metamask/json-rpc-engine@npm:9.0.0" +"@metamask/json-rpc-engine@npm:^9.0.0, @metamask/json-rpc-engine@npm:^9.0.1, @metamask/json-rpc-engine@npm:^9.0.2": + version: 9.0.2 + resolution: "@metamask/json-rpc-engine@npm:9.0.2" dependencies: - "@metamask/rpc-errors": ^6.2.1 + "@metamask/rpc-errors": ^6.3.1 "@metamask/safe-event-emitter": ^3.0.0 - "@metamask/utils": ^8.3.0 - checksum: b97170b36843145361015dabc5651df1d2c7f28f0756d3c9c05aef6a483098d562a9983cbe0e15f7fd1a66aa26481132b03ccb9061a2c48f0d3249c1f2348e97 + "@metamask/utils": ^9.1.0 + checksum: 4c852c9f30d05706ee497a2aca3ef6df12aabcff4a71a7426a27d95829f20cf2ff45c774eb9d95224bf16c9555a8cd7e44dccaea1bd44eda4dc43bf298885272 languageName: node linkType: hard @@ -2813,28 +2813,28 @@ __metadata: languageName: node linkType: hard -"@metamask/json-rpc-middleware-stream@npm:^8.0.0": - version: 8.0.0 - resolution: "@metamask/json-rpc-middleware-stream@npm:8.0.0" +"@metamask/json-rpc-middleware-stream@npm:^8.0.0, @metamask/json-rpc-middleware-stream@npm:^8.0.1": + version: 8.0.2 + resolution: "@metamask/json-rpc-middleware-stream@npm:8.0.2" dependencies: - "@metamask/json-rpc-engine": ^9.0.0 + "@metamask/json-rpc-engine": ^9.0.2 "@metamask/safe-event-emitter": ^3.0.0 - "@metamask/utils": ^8.3.0 + "@metamask/utils": ^9.1.0 readable-stream: ^3.6.2 - checksum: 4bf809366da41744c841dd50d68cf126e1cccda0d78a812154489faa2b0a56bbd511a7bb4e9ccc7c68f2a9a6437f00561bc9423a5b5596badd511a4ff6244c9e + checksum: 0aa44b98e5832c158594e5b616d351c7c8da8f7bc8de0a14f91a043b92fd81f1a63eecac9b11f7ef4729f54d2f1ad1ae5b82db6188368cefac1ca31011b84730 languageName: node linkType: hard -"@metamask/key-tree@npm:^9.0.0, @metamask/key-tree@npm:^9.1.1": - version: 9.1.1 - resolution: "@metamask/key-tree@npm:9.1.1" +"@metamask/key-tree@npm:^9.0.0, @metamask/key-tree@npm:^9.1.1, @metamask/key-tree@npm:^9.1.2": + version: 9.1.2 + resolution: "@metamask/key-tree@npm:9.1.2" dependencies: "@metamask/scure-bip39": ^2.1.1 - "@metamask/utils": ^8.3.0 + "@metamask/utils": ^9.0.0 "@noble/curves": ^1.2.0 "@noble/hashes": ^1.3.2 "@scure/base": ^1.0.0 - checksum: 4de5f92e4d9408829552bb569b998613ed940f289613fe86f9a5f0a66e392ec386d70b2365943c216b83c9ff249877fd731f2f791240a622ff186fd047d81f9e + checksum: eb60bdbfa1806c2f248bf2602cd242e21b0fbe8bbb00ec97c3891739956a81e26c0dae125282a6207dbbe0643e727ff3574067b48210a0b01f12aae7b3159b77 languageName: node linkType: hard @@ -2920,16 +2920,16 @@ __metadata: languageName: node linkType: hard -"@metamask/providers@npm:^17.0.0": - version: 17.1.0 - resolution: "@metamask/providers@npm:17.1.0" +"@metamask/providers@npm:^17.0.0, @metamask/providers@npm:^17.1.2": + version: 17.1.2 + resolution: "@metamask/providers@npm:17.1.2" dependencies: - "@metamask/json-rpc-engine": ^9.0.0 - "@metamask/json-rpc-middleware-stream": ^8.0.0 + "@metamask/json-rpc-engine": ^9.0.1 + "@metamask/json-rpc-middleware-stream": ^8.0.1 "@metamask/object-multiplex": ^2.0.0 - "@metamask/rpc-errors": ^6.2.1 + "@metamask/rpc-errors": ^6.3.1 "@metamask/safe-event-emitter": ^3.1.1 - "@metamask/utils": ^8.3.0 + "@metamask/utils": ^9.0.0 detect-browser: ^5.2.0 extension-port-stream: ^4.1.0 fast-deep-equal: ^3.1.3 @@ -2937,17 +2937,17 @@ __metadata: readable-stream: ^3.6.2 peerDependencies: webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0 - checksum: 1378f7e9a5385536e814190f880cd71bbb0a055b8a234012243ba9f54c5eace1d8bb5324732cb46b3046ad22349a698c1ca3c06402e52675b66e55b9b741f820 + checksum: 4cfe612649120049abd5d496e02facd86d0851c10e810a3e1289629857da027d77524e6cb8706d38b993bc5fd696bce6f1d33c93bb7d15169b6422e063f205ea languageName: node linkType: hard -"@metamask/rpc-errors@npm:^6.0.0, @metamask/rpc-errors@npm:^6.2.1": - version: 6.2.1 - resolution: "@metamask/rpc-errors@npm:6.2.1" +"@metamask/rpc-errors@npm:^6.0.0, @metamask/rpc-errors@npm:^6.2.1, @metamask/rpc-errors@npm:^6.3.1": + version: 6.3.1 + resolution: "@metamask/rpc-errors@npm:6.3.1" dependencies: - "@metamask/utils": ^8.3.0 + "@metamask/utils": ^9.0.0 fast-safe-stringify: ^2.0.6 - checksum: a9223c3cb9ab05734ea0dda990597f90a7cdb143efa0c026b1a970f2094fe5fa3c341ed39b1e7623be13a96b98fb2c697ef51a2e2b87d8f048114841d35ee0a9 + checksum: 8761f5c0161cb3b342abd3ccccbd7b792f36a987e1f22c3f89b1bd29f72a2e35a2c91b58164fdd9dc3e5b67157500dcbdb5d04245117c14310c34cf42f7b8463 languageName: node linkType: hard @@ -3164,16 +3164,16 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-sdk@npm:^6.0.0": - version: 6.0.0 - resolution: "@metamask/snaps-sdk@npm:6.0.0" +"@metamask/snaps-sdk@npm:^6.0.0, @metamask/snaps-sdk@npm:^6.1.1": + version: 6.1.1 + resolution: "@metamask/snaps-sdk@npm:6.1.1" dependencies: - "@metamask/key-tree": ^9.1.1 - "@metamask/providers": ^17.0.0 - "@metamask/rpc-errors": ^6.2.1 - "@metamask/utils": ^8.3.0 - superstruct: ^1.0.3 - checksum: 0a3b7a034028a7583b4e1a5414a67470b2ed70cc411fc4877a79f95803c64d99eafb785cbffaf827c3f3138a065e439480b9628456a8a5fa8d39c9c8dd9bd5db + "@metamask/key-tree": ^9.1.2 + "@metamask/providers": ^17.1.2 + "@metamask/rpc-errors": ^6.3.1 + "@metamask/superstruct": ^3.1.0 + "@metamask/utils": ^9.1.0 + checksum: 24e5468e46cf597e21140f3877e27e06705e1f8976794a0e9fa56af43c2869f506218d309699cb80607fea78a193453bf36a5a45ae056b508909fdd77d82e8d8 languageName: node linkType: hard @@ -3220,6 +3220,13 @@ __metadata: languageName: node linkType: hard +"@metamask/superstruct@npm:^3.1.0": + version: 3.1.0 + resolution: "@metamask/superstruct@npm:3.1.0" + checksum: 00e4d0c0aae8b25ccc1885c1db0bb4ed1590010570140c255e4deee3bf8a10c859c8fce5e475b4ae09c8a56316207af87585b91f7f5a5c028d668ccd111f19e3 + languageName: node + linkType: hard + "@metamask/utils@npm:^8.0.0, @metamask/utils@npm:^8.1.0, @metamask/utils@npm:^8.3.0": version: 8.3.0 resolution: "@metamask/utils@npm:8.3.0" @@ -3236,6 +3243,23 @@ __metadata: languageName: node linkType: hard +"@metamask/utils@npm:^9.0.0, @metamask/utils@npm:^9.1.0": + version: 9.1.0 + resolution: "@metamask/utils@npm:9.1.0" + dependencies: + "@ethereumjs/tx": ^4.2.0 + "@metamask/superstruct": ^3.1.0 + "@noble/hashes": ^1.3.1 + "@scure/base": ^1.1.3 + "@types/debug": ^4.1.7 + debug: ^4.3.4 + pony-cause: ^2.1.10 + semver: ^7.5.4 + uuid: ^9.0.1 + checksum: 01f2c71a8f06158d5335bfe96bfd2f3aa39ec6b2323c5d0ff1d3136071a3e8ff7c1804d640ba1d4e07f96f3e68a95ff7729ddfcd34b373e5fefd86d6ef12d034 + languageName: node + linkType: hard + "@mischnic/json-sourcemap@npm:^0.1.0": version: 0.1.0 resolution: "@mischnic/json-sourcemap@npm:0.1.0" @@ -16931,7 +16955,7 @@ __metadata: "@metamask/eslint-config-typescript": ^12.1.0 "@metamask/snaps-cli": ^6.2.1 "@metamask/snaps-jest": ^8.2.0 - "@metamask/snaps-sdk": ^6.0.0 + "@metamask/snaps-sdk": ^6.1.1 "@typescript-eslint/eslint-plugin": ^5.42.1 "@typescript-eslint/parser": ^5.42.1 buffer: ^6.0.3 @@ -18475,6 +18499,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:^9.0.1": + version: 9.0.1 + resolution: "uuid@npm:9.0.1" + bin: + uuid: dist/bin/uuid + checksum: 39931f6da74e307f51c0fb463dc2462807531dc80760a9bff1e35af4316131b4fc3203d16da60ae33f07fdca5b56f3f1dd662da0c99fea9aaeab2004780cc5f4 + languageName: node + linkType: hard + "v8-compile-cache@npm:^2.0.3": version: 2.3.0 resolution: "v8-compile-cache@npm:2.3.0" From 6d8a1da0d2c08ef294756410da919d2babdf9e34 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Wed, 31 Jul 2024 10:05:45 +0200 Subject: [PATCH 8/9] Fix eslint config --- packages/snap/.eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/snap/.eslintrc.js b/packages/snap/.eslintrc.js index cf4ca9c2..922f7054 100644 --- a/packages/snap/.eslintrc.js +++ b/packages/snap/.eslintrc.js @@ -26,7 +26,7 @@ module.exports = { }, { - files: ['*.test.ts'], + files: ['*.test.ts', '*.test.tsx'], rules: { '@typescript-eslint/unbound-method': 'off', }, From df9a7a516c64aef2a7433812985e8dc6cab4df27 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Wed, 31 Jul 2024 10:06:11 +0200 Subject: [PATCH 9/9] Update checksum --- packages/snap/snap.manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index 10591bd1..d8c7fcc3 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/template-snap-monorepo.git" }, "source": { - "shasum": "2Kmv864c0r0L3Dwo/8NSIS9PzyJLn448tatus5qqVMs=", + "shasum": "ufQns74hTklAsDcCm5Yd3qVw4iMs82eARCnn6IARlYE=", "location": { "npm": { "filePath": "dist/bundle.js",