diff --git a/packages/examples/packages/transaction-details-insights/.depcheckrc.json b/packages/examples/packages/transaction-details-insights/.depcheckrc.json new file mode 100644 index 0000000000..c437c59cd2 --- /dev/null +++ b/packages/examples/packages/transaction-details-insights/.depcheckrc.json @@ -0,0 +1,18 @@ +{ + "ignore-patterns": ["dist", "coverage"], + "ignores": [ + "@lavamoat/allow-scripts", + "@lavamoat/preinstall-always-fail", + "@metamask/auto-changelog", + "@metamask/eslint-*", + "@types/*", + "@typescript-eslint/*", + "eslint-config-*", + "eslint-plugin-*", + "jest-silent-reporter", + "prettier-plugin-packagejson", + "ts-node", + "typedoc", + "typescript" + ] +} diff --git a/packages/examples/packages/transaction-details-insights/CHANGELOG.md b/packages/examples/packages/transaction-details-insights/CHANGELOG.md new file mode 100644 index 0000000000..6538feeaff --- /dev/null +++ b/packages/examples/packages/transaction-details-insights/CHANGELOG.md @@ -0,0 +1,105 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [2.2.3] + +### Fixed + +- Bump MetaMask dependencies + +## [2.2.2] + +### Fixed + +- Fix address validation in row component ([#2257](https://github.com/MetaMask/snaps/pull/2257)) + +## [2.2.1] + +### Changed + +- Remove snap icon ([#2189](https://github.com/MetaMask/snaps/pull/2189)) + +## [2.2.0] + +### Added + +- Use new `row` and `address` component ([#1968](https://github.com/MetaMask/snaps/pull/1968)) + +## [2.1.0] + +### Changed + +- Use `@metamask/snaps-sdk` package ([#1930](https://github.com/MetaMask/snaps/pull/1930), + [#1946](https://github.com/MetaMask/snaps/pull/1946), [#1950](https://github.com/MetaMask/snaps/pull/1950), + [#1949](https://github.com/MetaMask/snaps/pull/1949), [#1954](https://github.com/MetaMask/snaps/pull/1954)) + - This package replaces the `@metamask/snaps-types` and + - `@metamask/snaps-ui` packages, and is much more lightweight. + +## [2.0.2] + +### Changed + +- Update example insight snap to support transaction insights v2 ([#1911](https://github.com/MetaMask/snaps/pull/1911)) + +## [2.0.1] + +### Changed + +- Update multiple MetaMask dependencies ([#1841](https://github.com/MetaMask/snaps/pull/1841)) + +## [2.0.0] + +### Changed + +- **BREAKING:** Bump minimum Node.js version to `^18.16.0` ([#1741](https://github.com/MetaMask/snaps/pull/1741)) + +## [1.0.0] + +### Changed + +- Initial stable release from main branch ([#1757](https://github.com/MetaMask/snaps/pull/1757)) + +## [0.38.1-flask.1] + +### Changed + +- Use `polyfills` option for specifying Node.js polyfills ([#1650](https://github.com/MetaMask/snaps/pull/1650)) + +### Fixed + +- Remove unused dependencies ([#1680](https://github.com/MetaMask/snaps/pull/1680)) + +## [0.38.0-flask.1] + +### Changed + +- Update example to the new configuration format ([#1632](https://github.com/MetaMask/snaps/pull/1632)) + - The example now uses Webpack instead of Browserify. + +## [0.37.2-flask.1] + +### Changed + +- Release package independently ([#1600](https://github.com/MetaMask/snaps/pull/1600)) + - The version of the package no longer needs to match the version of all other + MetaMask Snaps packages. + +[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/insights-example-snap@2.2.3...HEAD +[2.2.3]: https://github.com/MetaMask/snaps/compare/@metamask/insights-example-snap@2.2.2...@metamask/insights-example-snap@2.2.3 +[2.2.2]: https://github.com/MetaMask/snaps/compare/@metamask/insights-example-snap@2.2.1...@metamask/insights-example-snap@2.2.2 +[2.2.1]: https://github.com/MetaMask/snaps/compare/@metamask/insights-example-snap@2.2.0...@metamask/insights-example-snap@2.2.1 +[2.2.0]: https://github.com/MetaMask/snaps/compare/@metamask/insights-example-snap@2.1.0...@metamask/insights-example-snap@2.2.0 +[2.1.0]: https://github.com/MetaMask/snaps/compare/@metamask/insights-example-snap@2.0.2...@metamask/insights-example-snap@2.1.0 +[2.0.2]: https://github.com/MetaMask/snaps/compare/@metamask/insights-example-snap@2.0.1...@metamask/insights-example-snap@2.0.2 +[2.0.1]: https://github.com/MetaMask/snaps/compare/@metamask/insights-example-snap@2.0.0...@metamask/insights-example-snap@2.0.1 +[2.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/insights-example-snap@1.0.0...@metamask/insights-example-snap@2.0.0 +[1.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/insights-example-snap@0.38.1-flask.1...@metamask/insights-example-snap@1.0.0 +[0.38.1-flask.1]: https://github.com/MetaMask/snaps/compare/@metamask/insights-example-snap@0.38.0-flask.1...@metamask/insights-example-snap@0.38.1-flask.1 +[0.38.0-flask.1]: https://github.com/MetaMask/snaps/compare/@metamask/insights-example-snap@0.37.2-flask.1...@metamask/insights-example-snap@0.38.0-flask.1 +[0.37.2-flask.1]: https://github.com/MetaMask/snaps/releases/tag/@metamask/insights-example-snap@0.37.2-flask.1 diff --git a/packages/examples/packages/transaction-details-insights/LICENSE.APACHE2 b/packages/examples/packages/transaction-details-insights/LICENSE.APACHE2 new file mode 100644 index 0000000000..bf37d0e612 --- /dev/null +++ b/packages/examples/packages/transaction-details-insights/LICENSE.APACHE2 @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 ConsenSys Software Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/examples/packages/transaction-details-insights/LICENSE.MIT0 b/packages/examples/packages/transaction-details-insights/LICENSE.MIT0 new file mode 100644 index 0000000000..913c577462 --- /dev/null +++ b/packages/examples/packages/transaction-details-insights/LICENSE.MIT0 @@ -0,0 +1,16 @@ +MIT No Attribution + +Copyright 2023 ConsenSys Software Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/examples/packages/transaction-details-insights/README.md b/packages/examples/packages/transaction-details-insights/README.md new file mode 100644 index 0000000000..bbf2c486b0 --- /dev/null +++ b/packages/examples/packages/transaction-details-insights/README.md @@ -0,0 +1,49 @@ +# `@metamask/transaction-details-insights-example-snap` + +This snap demonstrates how to use the `endowment:transaction-details-insight` permission +to provide historical transaction insights to the user. This snap uses the `onTransactionDetails` +handler to provide insights for *past* user transactions. + +Activity item insights are displayed in the transaction details modal, and +can show any [Snaps-based UI](../../../snaps-sdk) components. + +## Snap manifest + +> **Note**: Using `onTransactionDetails` requires the `endowment:transaction-details-insight` +> permissions. Refer to [the documentation](https://docs.metamask.io/snaps/reference/permissions) +> for more information. + +Along with other permissions, the manifest of this snap includes the +`endowment:transaction-details-insight` permission: + +```json +{ + "initialPermissions": { + "endowment:transaction-details-insight": {} + } +} +``` + +By default, the `onTransactionDetails` does not receive the transaction origin. If you +want to receive the origin, you can add the `allowTransactionDetailsOrigin` property to +the permission definition: + +```json +{ + "initialPermissions": { + "endowment:transaction-details-insight": { + "allowTransactionDetailsOrigin": true + } + } +} +``` + +## Snap usage + +This snap exposes an `onTransactionDetails` handler, which is called when a transaction details modal is opened by a user. The handler receives the transaction details and the +transaction origin (if the `allowTransactionDetailsOrigin` property is set to `true`). + +The snap simply takes the details about the transaction and displays them. In practice a real Snap may want use transaction details to fetch insights from a remote server and display them to the user. + +For more information, you can refer to +[the end-to-end tests](./src/index.test.ts). diff --git a/packages/examples/packages/transaction-details-insights/jest.config.js b/packages/examples/packages/transaction-details-insights/jest.config.js new file mode 100644 index 0000000000..f473a91b83 --- /dev/null +++ b/packages/examples/packages/transaction-details-insights/jest.config.js @@ -0,0 +1,36 @@ +const deepmerge = require('deepmerge'); + +const baseConfig = require('../../../../jest.config.base'); + +module.exports = deepmerge(baseConfig, { + preset: '@metamask/snaps-jest', + + // Since `@metamask/snaps-jest` runs in the browser, we can't collect + // coverage information. + collectCoverage: false, + + // This is required for the tests to run inside the `MetaMask/snaps` + // repository. You don't need this in your own project. + moduleNameMapper: { + '^@metamask/(.+)/production/jsx-runtime': [ + '/../../../$1/src/jsx/production/jsx-runtime', + '/../../../../node_modules/@metamask/$1/jsx/production/jsx-runtime', + '/node_modules/@metamask/$1/jsx/production/jsx-runtime', + ], + '^@metamask/(.+)/jsx': [ + '/../../../$1/src/jsx', + '/../../../../node_modules/@metamask/$1/jsx', + '/node_modules/@metamask/$1/jsx', + ], + '^@metamask/(.+)/node$': [ + '/../../../$1/src/node', + '/../../../../node_modules/@metamask/$1/node', + '/node_modules/@metamask/$1/node', + ], + '^@metamask/(.+)$': [ + '/../../../$1/src', + '/../../../../node_modules/@metamask/$1', + '/node_modules/@metamask/$1', + ], + }, +}); diff --git a/packages/examples/packages/transaction-details-insights/package.json b/packages/examples/packages/transaction-details-insights/package.json new file mode 100644 index 0000000000..d4c3b91f68 --- /dev/null +++ b/packages/examples/packages/transaction-details-insights/package.json @@ -0,0 +1,74 @@ +{ + "name": "@metamask/transaction-details-insights-example-snap", + "version": "2.2.3", + "description": "MetaMask example snap demonstrating the use of the Transaction Details Insights API", + "keywords": [ + "MetaMask", + "Snaps", + "Ethereum" + ], + "homepage": "https://github.com/MetaMask/snaps/tree/main/packages/examples/packages/transaction-details-insights#readme", + "bugs": { + "url": "https://github.com/MetaMask/snaps/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/MetaMask/snaps.git" + }, + "license": "(MIT-0 OR Apache-2.0)", + "sideEffects": false, + "main": "./dist/bundle.js", + "files": [ + "dist", + "snap.manifest.json" + ], + "scripts": { + "build": "mm-snap build", + "build:clean": "yarn clean && yarn build", + "changelog:update": "../../../../scripts/update-changelog.sh @metamask/insights-example-snap", + "changelog:validate": "../../../../scripts/validate-changelog.sh @metamask/insights-example-snap", + "clean": "rimraf \"dist\"", + "lint": "yarn lint:eslint && yarn lint:misc --check && yarn changelog:validate && yarn lint:dependencies", + "lint:ci": "yarn lint", + "lint:dependencies": "depcheck", + "lint:eslint": "eslint . --cache", + "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", + "lint:misc": "prettier --no-error-on-unmatched-pattern --log-level warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore", + "publish:preview": "yarn npm publish --tag preview", + "since-latest-release": "../../../../scripts/since-latest-release.sh", + "start": "mm-snap watch", + "test": "jest --reporters=jest-silent-reporter", + "test:clean": "jest --clearCache", + "test:verbose": "jest --verbose", + "test:watch": "jest --watch" + }, + "dependencies": { + "@metamask/snaps-sdk": "workspace:^", + "@metamask/utils": "^11.4.2" + }, + "devDependencies": { + "@jest/globals": "^29.5.0", + "@lavamoat/allow-scripts": "^3.3.4", + "@metamask/auto-changelog": "^5.0.2", + "@metamask/snaps-cli": "workspace:^", + "@metamask/snaps-jest": "workspace:^", + "@swc/core": "1.11.31", + "@swc/jest": "^0.2.38", + "@types/node": "18.14.2", + "deepmerge": "^4.2.2", + "depcheck": "^1.4.7", + "eslint": "^9.11.0", + "jest": "^29.0.2", + "jest-silent-reporter": "^0.6.0", + "prettier": "^3.3.3", + "ts-node": "^10.9.1", + "typescript": "~5.3.3" + }, + "engines": { + "node": "^20 || >=22" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + } +} diff --git a/packages/examples/packages/transaction-details-insights/snap.config.ts b/packages/examples/packages/transaction-details-insights/snap.config.ts new file mode 100644 index 0000000000..8a61578f96 --- /dev/null +++ b/packages/examples/packages/transaction-details-insights/snap.config.ts @@ -0,0 +1,16 @@ +import type { SnapConfig } from '@metamask/snaps-cli'; + +const config: SnapConfig = { + input: './src/index.ts', + server: { + port: 8018, + }, + typescript: { + enabled: true, + }, + stats: { + buffer: false, + }, +}; + +export default config; diff --git a/packages/examples/packages/transaction-details-insights/snap.manifest.json b/packages/examples/packages/transaction-details-insights/snap.manifest.json new file mode 100644 index 0000000000..a082bcca31 --- /dev/null +++ b/packages/examples/packages/transaction-details-insights/snap.manifest.json @@ -0,0 +1,26 @@ +{ + "version": "2.2.3", + "description": "MetaMask example snap demonstrating the use of the View Transaction Details Insights API.", + "proposedName": "Insights Example Snap", + "repository": { + "type": "git", + "url": "https://github.com/MetaMask/snaps.git" + }, + "source": { + "shasum": "ipcyhQ+XfczweWeRiLVEZ3XD2Azji4ymGZYVNvK7qgs=", + "location": { + "npm": { + "filePath": "dist/bundle.js", + "packageName": "@metamask/transaction-details-insights-example-snap", + "registry": "https://registry.npmjs.org/" + } + } + }, + "initialPermissions": { + "endowment:transaction-details": { + "allowTransactionDetailsOrigin": true + } + }, + "platformVersion": "9.1.0", + "manifestVersion": "0.1" +} diff --git a/packages/examples/packages/transaction-details-insights/src/index.test.ts b/packages/examples/packages/transaction-details-insights/src/index.test.ts new file mode 100644 index 0000000000..cb26ae56d2 --- /dev/null +++ b/packages/examples/packages/transaction-details-insights/src/index.test.ts @@ -0,0 +1,114 @@ +import { expect } from '@jest/globals'; +import { installSnap } from '@metamask/snaps-jest'; +import { panel, text, row, address } from '@metamask/snaps-sdk'; + +describe('onTransaction', () => { + const FROM_ADDRESS = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045'; + const TO_ADDRESS = '0x4bbeeb066ed09b7aed07bf39eee0460dfa261520'; + + it('returns transaction insights for an ERC-20 transaction', async () => { + const { onTransaction } = await installSnap(); + + const response = await onTransaction({ + from: FROM_ADDRESS, + to: TO_ADDRESS, + // This is not a valid ERC-20 transfer as all the values are zero, but it + // is enough to test the `onTransaction` handler. + data: '0xa9059cbb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + }); + + const screen = response.getInterface(); + + expect(screen).toRender( + panel([ + row('From', address(FROM_ADDRESS)), + row('To', address(TO_ADDRESS)), + row('Transaction type', text('ERC-20')), + ]), + ); + }); + + it('returns transaction insights for an ERC-721 transaction', async () => { + const { onTransaction } = await installSnap(); + + const response = await onTransaction({ + from: FROM_ADDRESS, + to: TO_ADDRESS, + // This is not a valid ERC-721 transfer as all the values are zero, but it + // is enough to test the `onTransaction` handler. + data: '0x23b872dd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + }); + + const screen = response.getInterface(); + + expect(screen).toRender( + panel([ + row('From', address(FROM_ADDRESS)), + row('To', address(TO_ADDRESS)), + row('Transaction type', text('ERC-721')), + ]), + ); + }); + + it('returns transaction insights for an ERC-1155 transaction', async () => { + const { onTransaction } = await installSnap(); + + const response = await onTransaction({ + from: FROM_ADDRESS, + to: TO_ADDRESS, + // This is not a valid ERC-1155 transfer as all the values are zero, but + // it is enough to test the `onTransaction` handler. + data: '0xf242432a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + }); + + const screen = response.getInterface(); + + expect(screen).toRender( + panel([ + row('From', address(FROM_ADDRESS)), + row('To', address(TO_ADDRESS)), + row('Transaction type', text('ERC-1155')), + ]), + ); + }); + + it('returns transaction insights for an unknown transaction', async () => { + const { onTransaction } = await installSnap(); + + const response = await onTransaction({ + from: FROM_ADDRESS, + to: TO_ADDRESS, + data: '0xabcdef1200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + }); + + const screen = response.getInterface(); + + expect(screen).toRender( + panel([ + row('From', address(FROM_ADDRESS)), + row('To', address(TO_ADDRESS)), + row('Transaction type', text('Unknown')), + ]), + ); + }); + + it('returns transaction insights for a transaction with no data', async () => { + const { onTransaction } = await installSnap(); + + const response = await onTransaction({ + from: FROM_ADDRESS, + to: TO_ADDRESS, + data: '0x', + }); + + const screen = response.getInterface(); + + expect(screen).toRender( + panel([ + row('From', address(FROM_ADDRESS)), + row('To', address(TO_ADDRESS)), + row('Transaction type', text('Unknown')), + ]), + ); + }); +}); diff --git a/packages/examples/packages/transaction-details-insights/src/index.ts b/packages/examples/packages/transaction-details-insights/src/index.ts new file mode 100644 index 0000000000..f4883453ee --- /dev/null +++ b/packages/examples/packages/transaction-details-insights/src/index.ts @@ -0,0 +1,48 @@ +import type { OnTransactionDetailsHandler } from '@metamask/snaps-sdk'; +import { SeverityLevel, panel, text, row, address } from '@metamask/snaps-sdk'; + +/** + * This event is called when a user clicks on a transaction to bring up the + * transaction details modal + * + * The `onTransactionDetails` handler returns a Snaps UI component, which is displayed + * in the transaction details insights panel (transaction details modal). + * + * @param args - The request parameters. + * @param args.transactionMeta - The transaction object. This contains the + * transaction parameters, such as the `from`, `to`, `value`, and `data` fields. + * @param args.origin - The origin of the transaction. A URL is the transaction originated + * from a website or, for example, 'Metamask' if the transaction was initiated by the user. + * @param args.chainId - The chain ID of the transaction. + * @param args.selectedAddress - The address of the account that initiated the transaction. + * @param args.selectedAccount - The account object of the account that initiated the transaction. + * @returns The transaction details insights. + */ + +export const onTransactionDetails: OnTransactionDetailsHandler = async ({ + transactionMeta, + origin, + chainId, + selectedAddress, + selectedAccount, +}) => { + const { txParams } = transactionMeta; + const { from, to }: { from: string; to: string } = txParams as { + from: string; + to: string; + }; + + // this is a good place to do an async HTTP request to fetch insights from a remote server + + return { + content: panel([ + row('From', address(from as `0x${string}`)), + row('To', to ? address(to as `0x${string}`) : text('None')), + row('Origin', text(origin)), + row('Chain ID', text(chainId)), + row('Selected Account', text(selectedAccount)), + row('Our address', text(selectedAddress)), + ]), + severity: SeverityLevel.Critical, + }; +}; diff --git a/packages/examples/packages/transaction-details-insights/tsconfig.json b/packages/examples/packages/transaction-details-insights/tsconfig.json new file mode 100644 index 0000000000..17a40a6a74 --- /dev/null +++ b/packages/examples/packages/transaction-details-insights/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "composite": false, + "baseUrl": "./" + }, + "include": ["src", "snap.config.ts"] +} diff --git a/packages/snaps-cli/package.json b/packages/snaps-cli/package.json index 870cdf0065..f888ee184d 100644 --- a/packages/snaps-cli/package.json +++ b/packages/snaps-cli/package.json @@ -64,11 +64,11 @@ "test:watch": "jest --watch" }, "dependencies": { - "@metamask/snaps-rpc-methods": "workspace:^", - "@metamask/snaps-sandbox": "workspace:^", - "@metamask/snaps-sdk": "workspace:^", - "@metamask/snaps-utils": "workspace:^", - "@metamask/snaps-webpack-plugin": "workspace:^", + "@metamask/snaps-rpc-methods": "file:../snaps-rpc-methods", + "@metamask/snaps-sandbox": "file:../snaps-sandbox", + "@metamask/snaps-sdk": "file:../snaps-sdk", + "@metamask/snaps-utils": "file:../snaps-utils", + "@metamask/snaps-webpack-plugin": "file:../snaps-webpack-plugin", "@metamask/superstruct": "^3.2.1", "@metamask/utils": "^11.4.2", "@swc/core": "1.11.31", diff --git a/packages/snaps-controllers/package.json b/packages/snaps-controllers/package.json index e5b77e5e67..59e0cbdd77 100644 --- a/packages/snaps-controllers/package.json +++ b/packages/snaps-controllers/package.json @@ -90,9 +90,9 @@ "@metamask/post-message-stream": "^10.0.0", "@metamask/rpc-errors": "^7.0.3", "@metamask/snaps-registry": "^3.2.3", - "@metamask/snaps-rpc-methods": "workspace:^", - "@metamask/snaps-sdk": "workspace:^", - "@metamask/snaps-utils": "workspace:^", + "@metamask/snaps-rpc-methods": "file:../snaps-rpc-methods", + "@metamask/snaps-sdk": "file:../snaps-sdk", + "@metamask/snaps-utils": "file:../snaps-utils", "@metamask/utils": "^11.4.2", "@xstate/fsm": "^2.0.0", "async-mutex": "^0.5.0", @@ -145,7 +145,7 @@ "vitest": "^3.1.1" }, "peerDependencies": { - "@metamask/snaps-execution-environments": "workspace:^" + "@metamask/snaps-execution-environments": "*" }, "peerDependenciesMeta": { "@metamask/snaps-execution-environments": { diff --git a/packages/snaps-controllers/src/insights/SnapInsightsController.ts b/packages/snaps-controllers/src/insights/SnapInsightsController.ts index f1a22a2acd..3eda7171fd 100644 --- a/packages/snaps-controllers/src/insights/SnapInsightsController.ts +++ b/packages/snaps-controllers/src/insights/SnapInsightsController.ts @@ -10,12 +10,13 @@ import type { ValidPermission, } from '@metamask/permission-controller'; import { + getTransactionDetailsOriginCaveat, getSignatureOriginCaveat, getTransactionOriginCaveat, SnapEndowments, } from '@metamask/snaps-rpc-methods'; import type { Json, SnapId } from '@metamask/snaps-sdk'; -import { HandlerType } from '@metamask/snaps-utils'; +import { HandlerType, InternalAccount } from '@metamask/snaps-utils'; import { hasProperty, hexToBigInt } from '@metamask/utils'; import type { DeleteInterface } from '../interface'; @@ -24,6 +25,7 @@ import { getRunnableSnaps } from '../snaps'; import type { TransactionControllerUnapprovedTransactionAddedEvent, TransactionMeta, + TransactionControllerTransactionDetailsViewedEvent, SignatureStateChange, SignatureControllerState, StateSignature, @@ -56,6 +58,7 @@ export type SnapInsightControllerEvents = SnapInsightControllerStateChangeEvent; export type SnapInsightsControllerAllowedEvents = | TransactionControllerUnapprovedTransactionAddedEvent | TransactionControllerTransactionStatusUpdatedEvent + | TransactionControllerTransactionDetailsViewedEvent | SignatureStateChange; export type SnapInsightsControllerMessenger = RestrictedMessenger< @@ -120,6 +123,11 @@ export class SnapInsightsController extends BaseController< 'SignatureController:stateChange', this.#handleSignatureStateChange.bind(this), ); + + this.messagingSystem.subscribe( + 'TransactionController:transactionDetailsViewed', + this.#handleTransactionDetails.bind(this), + ); } /** @@ -159,6 +167,57 @@ export class SnapInsightsController extends BaseController< }, []); } + #handleTransactionDetails({ + transactionMeta, + selectedAddress, + selectedAccount, + }: { + transactionMeta: TransactionMeta; + selectedAddress: string; + selectedAccount: InternalAccount; + }) { + const { id, chainId, origin } = transactionMeta; + // This assumes that the transactions are EVM-compatible for now. + const caipChainId = `eip155:${hexToBigInt(chainId).toString(10)}`; + + const snaps = this.#getSnapsWithPermission( + SnapEndowments.TransactionDetailsInsight, + ); + + snaps.forEach(({ snapId, permission }) => { + this.update((state) => { + state.insights[id] ??= {}; + state.insights[id][snapId] = { snapId, loading: true }; + }); + + // Check if snap has transactionOrigin caveat + const hasTransactionDetailsOriginCaveat = + getTransactionDetailsOriginCaveat(permission); + const transactionDetailsOrigin = + hasTransactionDetailsOriginCaveat && origin ? origin : null; + + this.#handleSnapRequest({ + snapId, + handler: HandlerType.OnTransactionDetails, + params: { + transactionMeta, + chainId: caipChainId, + origin: transactionDetailsOrigin, + selectedAddress, + selectedAccount, + }, + }) + .then((response) => + this.#handleSnapResponse({ + id, + snapId, + response: response as Record, + }), + ) + .catch((error) => this.#handleSnapResponse({ id, snapId, error })); + }); + } + /** * Handle a newly added unapproved transaction. * This function fetches insights from all available Snaps @@ -356,7 +415,10 @@ export class SnapInsightsController extends BaseController< params, }: { snapId: SnapId; - handler: HandlerType.OnTransaction | HandlerType.OnSignature; + handler: + | HandlerType.OnTransaction + | HandlerType.OnSignature + | HandlerType.OnTransactionDetails; params: Record; }) { return this.messagingSystem.call('SnapController:handleRequest', { diff --git a/packages/snaps-controllers/src/snaps/SnapController.ts b/packages/snaps-controllers/src/snaps/SnapController.ts index 30fe2484bb..a20f283b6c 100644 --- a/packages/snaps-controllers/src/snaps/SnapController.ts +++ b/packages/snaps-controllers/src/snaps/SnapController.ts @@ -91,6 +91,7 @@ import { logError, normalizeRelative, OnTransactionResponseStruct, + OnTransactionDetailsResponseStruct, OnSignatureResponseStruct, resolveVersionRange, SnapCaveatType, @@ -3776,6 +3777,7 @@ export class SnapController extends BaseController< switch (handlerType) { case HandlerType.OnTransaction: case HandlerType.OnSignature: + case HandlerType.OnTransactionDetails: case HandlerType.OnHomePage: case HandlerType.OnSettingsPage: { // Since this type has been asserted earlier we can cast @@ -4000,6 +4002,14 @@ export class SnapController extends BaseController< break; } + case HandlerType.OnTransactionDetails: { + assertStruct(result, OnTransactionDetailsResponseStruct); + if (result && hasProperty(result, 'id')) { + this.#assertInterfaceExists(snapId, result.id as string); + } + + break; + } case HandlerType.OnHomePage: { assertStruct(result, OnHomePageResponseStruct); diff --git a/packages/snaps-controllers/src/snaps/constants.ts b/packages/snaps-controllers/src/snaps/constants.ts index 412b7811c3..26a6eed02a 100644 --- a/packages/snaps-controllers/src/snaps/constants.ts +++ b/packages/snaps-controllers/src/snaps/constants.ts @@ -12,6 +12,7 @@ export const ALLOWED_PERMISSIONS = Object.freeze([ SnapEndowments.LifecycleHooks, SnapEndowments.EthereumProvider, SnapEndowments.TransactionInsight, + SnapEndowments.TransactionDetailsInsight, SnapEndowments.SignatureInsight, ]); @@ -35,6 +36,7 @@ export const CLIENT_ONLY_HANDLERS = Object.freeze([ HandlerType.OnClientRequest, HandlerType.OnSignature, HandlerType.OnTransaction, + HandlerType.OnTransactionDetails, HandlerType.OnCronjob, HandlerType.OnNameLookup, HandlerType.OnHomePage, diff --git a/packages/snaps-controllers/src/test-utils/controller.ts b/packages/snaps-controllers/src/test-utils/controller.ts index df8aee00f5..356f6518f7 100644 --- a/packages/snaps-controllers/src/test-utils/controller.ts +++ b/packages/snaps-controllers/src/test-utils/controller.ts @@ -287,6 +287,18 @@ export const MOCK_INSIGHTS_PERMISSIONS: Record = { invoker: MOCK_SNAP_ID, parentCapability: SnapEndowments.SignatureInsight, }, + [SnapEndowments.TransactionDetailsInsight]: { + caveats: [ + { + type: SnapCaveatType.TransactionDetailsOrigin, + value: true, + }, + ], + date: 1664187844588, + id: 'izn0WGUO8cvq_jqvLQuQP', + invoker: MOCK_SNAP_ID, + parentCapability: SnapEndowments.TransactionDetailsInsight, + }, }; export const MOCK_INSIGHTS_PERMISSIONS_NO_ORIGINS: Record< @@ -305,6 +317,18 @@ export const MOCK_INSIGHTS_PERMISSIONS_NO_ORIGINS: Record< invoker: MOCK_SNAP_ID, parentCapability: SnapEndowments.TransactionInsight, }, + [SnapEndowments.TransactionDetailsInsight]: { + caveats: [ + { + type: SnapCaveatType.TransactionDetailsOrigin, + value: false, + }, + ], + date: 1664187844588, + id: 'izn0WGUO8cvq_jqvLQuQP', + invoker: MOCK_SNAP_ID, + parentCapability: SnapEndowments.TransactionDetailsInsight, + }, [SnapEndowments.SignatureInsight]: { caveats: [ { @@ -895,6 +919,7 @@ export const getRestrictedSnapInsightsControllerMessenger = ( >({ name: 'SnapInsightsController', allowedEvents: [ + 'TransactionController:transactionDetailsViewed', 'TransactionController:unapprovedTransactionAdded', 'TransactionController:transactionStatusUpdated', 'SignatureController:stateChange', diff --git a/packages/snaps-controllers/src/types/controllers.ts b/packages/snaps-controllers/src/types/controllers.ts index 1d24aab183..d1c4fa2200 100644 --- a/packages/snaps-controllers/src/types/controllers.ts +++ b/packages/snaps-controllers/src/types/controllers.ts @@ -1,4 +1,5 @@ import type { ControllerStateChangeEvent } from '@metamask/base-controller'; +import { InternalAccount } from '@metamask/snaps-utils'; import type { Hex, Json } from '@metamask/utils'; // Partial types that should overlap with types from controllers. @@ -135,6 +136,17 @@ export type TransactionControllerTransactionStatusUpdatedEvent = { ]; }; +export type TransactionControllerTransactionDetailsViewedEvent = { + type: `TransactionController:transactionDetailsViewed`; + payload: [ + { + transactionMeta: TransactionMeta; + selectedAddress: string; + selectedAccount: InternalAccount; + }, + ]; +}; + export type StateSignatureParams = { from: string; origin?: string; diff --git a/packages/snaps-controllers/src/utils.test.ts b/packages/snaps-controllers/src/utils.test.ts index cc0a320bc9..97f5ee3dbf 100644 --- a/packages/snaps-controllers/src/utils.test.ts +++ b/packages/snaps-controllers/src/utils.test.ts @@ -233,6 +233,7 @@ describe('TRACKABLE_HANDLERS', () => { HandlerType.OnRpcRequest, HandlerType.OnSignature, HandlerType.OnTransaction, + HandlerType.OnTransactionDetails, HandlerType.OnUpdate, ]); }); diff --git a/packages/snaps-controllers/src/utils.ts b/packages/snaps-controllers/src/utils.ts index 1016d43845..4ad632f863 100644 --- a/packages/snaps-controllers/src/utils.ts +++ b/packages/snaps-controllers/src/utils.ts @@ -387,6 +387,7 @@ export const TRACKABLE_HANDLERS = Object.freeze([ HandlerType.OnRpcRequest, HandlerType.OnSignature, HandlerType.OnTransaction, + HandlerType.OnTransactionDetails, HandlerType.OnUpdate, ] as const); diff --git a/packages/snaps-execution-environments/package.json b/packages/snaps-execution-environments/package.json index 1236759a52..5a9dfdc8ba 100644 --- a/packages/snaps-execution-environments/package.json +++ b/packages/snaps-execution-environments/package.json @@ -71,8 +71,8 @@ "@metamask/post-message-stream": "^10.0.0", "@metamask/providers": "^22.1.0", "@metamask/rpc-errors": "^7.0.3", - "@metamask/snaps-sdk": "workspace:^", - "@metamask/snaps-utils": "workspace:^", + "@metamask/snaps-sdk": "file:../snaps-sdk", + "@metamask/snaps-utils": "file:../snaps-utils", "@metamask/superstruct": "^3.2.1", "@metamask/utils": "^11.4.2", "readable-stream": "^3.6.2" diff --git a/packages/snaps-execution-environments/src/common/commands.test.ts b/packages/snaps-execution-environments/src/common/commands.test.ts index 9b5b71f704..585f308cda 100644 --- a/packages/snaps-execution-environments/src/common/commands.test.ts +++ b/packages/snaps-execution-environments/src/common/commands.test.ts @@ -19,6 +19,17 @@ describe('getHandlerArguments', () => { ).toThrow('Invalid request params'); }); + it('validates the request params for the OnTransactionDetails handler', () => { + expect(() => + getHandlerArguments(MOCK_ORIGIN, HandlerType.OnTransactionDetails, { + id: 1, + jsonrpc: '2.0', + method: 'foo', + params: {}, + }), + ).toThrow('Invalid request params'); + }); + it('validates the request params for the OnSignature handler', () => { expect(() => getHandlerArguments(MOCK_ORIGIN, HandlerType.OnSignature, { diff --git a/packages/snaps-execution-environments/src/common/commands.ts b/packages/snaps-execution-environments/src/common/commands.ts index 31b9640d7c..5b79560cc1 100644 --- a/packages/snaps-execution-environments/src/common/commands.ts +++ b/packages/snaps-execution-environments/src/common/commands.ts @@ -21,6 +21,7 @@ import { assertIsOnAssetHistoricalPriceRequestArguments, assertIsOnWebSocketEventArguments, assertIsOnAssetsMarketDataRequestArguments, + assertIsOnTransactionDetailsRequestArguments, } from './validation'; export type CommandMethodsMapping = { @@ -56,6 +57,20 @@ export function getHandlerArguments( transactionOrigin, }; } + + case HandlerType.OnTransactionDetails: { + assertIsOnTransactionDetailsRequestArguments(request.params); + const { transactionMeta, chainId, selectedAddress, selectedAccount } = + request.params; + return { + transactionMeta, + origin, + chainId, + selectedAddress, + selectedAccount, + }; + } + case HandlerType.OnSignature: { assertIsOnSignatureRequestArguments(request.params); diff --git a/packages/snaps-execution-environments/src/common/validation.test.ts b/packages/snaps-execution-environments/src/common/validation.test.ts index 476106533c..5a9b042068 100644 --- a/packages/snaps-execution-environments/src/common/validation.test.ts +++ b/packages/snaps-execution-environments/src/common/validation.test.ts @@ -9,6 +9,7 @@ import { assertIsOnProtocolRequestArguments, assertIsOnSignatureRequestArguments, assertIsOnTransactionRequestArguments, + assertIsOnTransactionDetailsRequestArguments, assertIsOnUserInputRequestArguments, isEndowment, isEndowmentsArray, @@ -89,6 +90,86 @@ describe('assertIsOnTransactionRequestArguments', () => { ); }); +describe('assertIsOnTransactionDetailsRequestArguments', () => { + it.each([ + { + transactionMeta: { foo: 'bar' }, + selectedAddress: '0xsomeAddress', + selectedAccount: { baz: 'bar' }, + chainId: 'eip155:1', + origin: 'https://some.origin', + }, + { + transactionMeta: { foo: 'bar' }, + selectedAddress: '0xsomeAddress', + selectedAccount: { baz: 'bar' }, + chainId: 'bip122:000000000019d6689c085ae165831e93', + origin: 'https://some.origin', + }, + { + transactionMeta: { bar: 'baz' }, + selectedAddress: '0xsomeAddress', + selectedAccount: { baz: 'bar' }, + chainId: 'eip155:84532', + origin: 'https://some.origin', + }, + ])('does not throw for a valid transaction params object', (args) => { + expect(() => + assertIsOnTransactionDetailsRequestArguments(args), + ).not.toThrow(); + }); + + it.each([ + true, + false, + null, + undefined, + 0, + 1, + '', + 'foo', + [], + {}, + { + // missing origin + transaction: { foo: 'bar' }, + chainId: 'eip155:84532', + selectedAddress: '0xsomeAddress', + selectedAccount: { baz: 'bar' }, + }, + { + origin: null, + transaction: 'falseTransaction', + chainId: 'eip155:84532', + selectedAddress: '0xsomeAddress', + selectedAccount: { baz: 'bar' }, + }, + + { + origin: null, + transaction: { foo: 'bar' }, + chainId: 1, + selectedAddress: ['0xsomeAddress'], + selectedAccount: { baz: 'bar' }, + }, + + { + origin: null, + transaction: { foo: 'bar' }, + chainId: 'eip155:84532', + selectedAddress: '0xsomeAddress', + selectedAccount: null, + }, + ])( + 'throws if the value is not a valid transaction params object', + (value) => { + expect(() => + assertIsOnTransactionDetailsRequestArguments(value as any), + ).toThrow('Invalid request params:'); + }, + ); +}); + describe('assertIsOnSignatureRequestArguments', () => { const FROM_ADDRESS = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045'; it.each([ diff --git a/packages/snaps-execution-environments/src/common/validation.ts b/packages/snaps-execution-environments/src/common/validation.ts index b23b8d4b90..362d36d68c 100644 --- a/packages/snaps-execution-environments/src/common/validation.ts +++ b/packages/snaps-execution-environments/src/common/validation.ts @@ -171,6 +171,32 @@ export function assertIsOnTransactionRequestArguments( assertRequestArguments(value, OnTransactionRequestArgumentsStruct); } +export const OnTransactionDetailsRequestArgumentsStruct = object({ + transactionMeta: record(string(), JsonStruct), + origin: nullable(string()), + chainId: CaipChainIdStruct, + selectedAddress: string(), + selectedAccount: record(string(), JsonStruct), +}); + +export type OnTransactionDetailsRequestArguments = Infer< + typeof OnTransactionDetailsRequestArgumentsStruct +>; + +/** + * Asserts that the given value is a valid {@link OnTransactionDetailsRequestArguments} + * object. + * + * @param value - The value to validate. + * @throws If the value is not a valid {@link OnTransactionDetailsRequestArguments} + * object. + */ +export function assertIsOnTransactionDetailsRequestArguments( + value: unknown, +): asserts value is OnTransactionDetailsRequestArguments { + assertRequestArguments(value, OnTransactionDetailsRequestArgumentsStruct); +} + export const OnSignatureRequestArgumentsStruct = object({ signature: record(string(), JsonStruct), signatureOrigin: nullable(string()), diff --git a/packages/snaps-rpc-methods/package.json b/packages/snaps-rpc-methods/package.json index 4b835eddfa..9c2dfd36a8 100644 --- a/packages/snaps-rpc-methods/package.json +++ b/packages/snaps-rpc-methods/package.json @@ -58,8 +58,8 @@ "@metamask/key-tree": "^10.1.1", "@metamask/permission-controller": "^11.0.6", "@metamask/rpc-errors": "^7.0.3", - "@metamask/snaps-sdk": "workspace:^", - "@metamask/snaps-utils": "workspace:^", + "@metamask/snaps-sdk": "file:../snaps-sdk", + "@metamask/snaps-utils": "file:../snaps-utils", "@metamask/superstruct": "^3.2.1", "@metamask/utils": "^11.4.2", "@noble/hashes": "^1.7.1" diff --git a/packages/snaps-rpc-methods/src/endowments/enum.ts b/packages/snaps-rpc-methods/src/endowments/enum.ts index e3f24b4de5..76aa0cd100 100644 --- a/packages/snaps-rpc-methods/src/endowments/enum.ts +++ b/packages/snaps-rpc-methods/src/endowments/enum.ts @@ -2,6 +2,7 @@ export enum SnapEndowments { NetworkAccess = 'endowment:network-access', SignatureInsight = 'endowment:signature-insight', TransactionInsight = 'endowment:transaction-insight', + TransactionDetailsInsight = 'endowment:transaction-details-insight', Cronjob = 'endowment:cronjob', EthereumProvider = 'endowment:ethereum-provider', Rpc = 'endowment:rpc', diff --git a/packages/snaps-rpc-methods/src/endowments/index.ts b/packages/snaps-rpc-methods/src/endowments/index.ts index 843a8b5db2..6d47c444f6 100644 --- a/packages/snaps-rpc-methods/src/endowments/index.ts +++ b/packages/snaps-rpc-methods/src/endowments/index.ts @@ -2,6 +2,11 @@ import type { PermissionConstraint } from '@metamask/permission-controller'; import { HandlerType } from '@metamask/snaps-utils'; import type { Json } from '@metamask/utils'; +import { + transactionDetailsInsightCaveatSpecifications, + transactionDetailsInsightEndowmentBuilder, + getTransactionDetailsInsightCaveatMapper, +} from './transaction-details-insight'; import { assetsEndowmentBuilder, getAssetsCaveatMapper } from './assets'; import { createMaxRequestTimeMapper, @@ -54,6 +59,8 @@ export const endowmentPermissionBuilders = { [networkAccessEndowmentBuilder.targetName]: networkAccessEndowmentBuilder, [transactionInsightEndowmentBuilder.targetName]: transactionInsightEndowmentBuilder, + [transactionDetailsInsightEndowmentBuilder.targetName]: + transactionDetailsInsightEndowmentBuilder, [cronjobEndowmentBuilder.targetName]: cronjobEndowmentBuilder, [ethereumProviderEndowmentBuilder.targetName]: ethereumProviderEndowmentBuilder, @@ -73,6 +80,7 @@ export const endowmentPermissionBuilders = { export const endowmentCaveatSpecifications = { ...cronjobCaveatSpecifications, ...transactionInsightCaveatSpecifications, + ...transactionDetailsInsightCaveatSpecifications, ...rpcCaveatSpecifications, ...nameLookupCaveatSpecifications, ...keyringCaveatSpecifications, @@ -91,6 +99,8 @@ export const endowmentCaveatMappers: Record< [transactionInsightEndowmentBuilder.targetName]: createMaxRequestTimeMapper( getTransactionInsightCaveatMapper, ), + [transactionDetailsInsightEndowmentBuilder.targetName]: + createMaxRequestTimeMapper(getTransactionDetailsInsightCaveatMapper), [rpcEndowmentBuilder.targetName]: createMaxRequestTimeMapper(getRpcCaveatMapper), [nameLookupEndowmentBuilder.targetName]: createMaxRequestTimeMapper( @@ -117,6 +127,8 @@ export const endowmentCaveatMappers: Record< export const handlerEndowments: Record = { [HandlerType.OnRpcRequest]: rpcEndowmentBuilder.targetName, [HandlerType.OnTransaction]: transactionInsightEndowmentBuilder.targetName, + [HandlerType.OnTransactionDetails]: + transactionDetailsInsightEndowmentBuilder.targetName, [HandlerType.OnCronjob]: cronjobEndowmentBuilder.targetName, [HandlerType.OnNameLookup]: nameLookupEndowmentBuilder.targetName, [HandlerType.OnInstall]: lifecycleHooksEndowmentBuilder.targetName, @@ -140,6 +152,7 @@ export * from './enum'; export { getRpcCaveatOrigins } from './rpc'; export { getSignatureOriginCaveat } from './signature-insight'; export { getTransactionOriginCaveat } from './transaction-insight'; +export { getTransactionDetailsOriginCaveat } from './transaction-details-insight'; export { getChainIdsCaveat, getLookupMatchersCaveat } from './name-lookup'; export { getKeyringCaveatOrigins } from './keyring'; export { getMaxRequestTimeCaveat } from './caveats'; diff --git a/packages/snaps-rpc-methods/src/endowments/transaction-details-insight.test.ts b/packages/snaps-rpc-methods/src/endowments/transaction-details-insight.test.ts new file mode 100644 index 0000000000..1a788b7577 --- /dev/null +++ b/packages/snaps-rpc-methods/src/endowments/transaction-details-insight.test.ts @@ -0,0 +1,186 @@ +import type { PermissionConstraint } from '@metamask/permission-controller'; +import { PermissionType, SubjectType } from '@metamask/permission-controller'; +import { SnapCaveatType } from '@metamask/snaps-utils'; + +import { getTransactionDetailsOriginCaveat, SnapEndowments } from '.'; +import { + transactionDetailsInsightEndowmentBuilder, + transactionDetailsInsightCaveatSpecifications, + getTransactionDetailsInsightCaveatMapper, +} from './transaction-details-insight'; + +describe('endowment:transaction-details-insight-insight', () => { + const specification = + transactionDetailsInsightEndowmentBuilder.specificationBuilder({}); + it('builds the expected permission specification', () => { + expect(specification).toStrictEqual({ + permissionType: PermissionType.Endowment, + targetName: SnapEndowments.TransactionDetailsInsight, + allowedCaveats: [ + SnapCaveatType.TransactionDetailsOrigin, + SnapCaveatType.MaxRequestTime, + ], + endowmentGetter: expect.any(Function), + validator: expect.any(Function), + subjectTypes: [SubjectType.Snap], + }); + + expect(specification.endowmentGetter()).toBeNull(); + }); + + describe('validator', () => { + it('allows no caveats', () => { + expect(() => + // @ts-expect-error Missing required permission types. + specification.validator({}), + ).not.toThrow(); + }); + + it('throws if the caveat is not a single "transactionDetailsOrigin"', () => { + expect(() => + // @ts-expect-error Missing other required permission types. + specification.validator({ + caveats: [{ type: 'foo', value: 'bar' }], + }), + ).toThrow( + 'Expected the following caveats: "transactionDetailsOrigin", "maxRequestTime", received "foo".', + ); + + expect(() => + // @ts-expect-error Missing other required permission types. + specification.validator({ + caveats: [ + { type: 'transactionDetailsOrigin', value: [] }, + { type: 'transactionDetailsOrigin', value: [] }, + ], + }), + ).toThrow('Duplicate caveats are not allowed.'); + }); + }); +}); + +describe('getTransactionDetailsOriginCaveat', () => { + it('returns the value from a transaction details insight permission', () => { + const permission: PermissionConstraint = { + date: 0, + parentCapability: 'foo', + invoker: 'bar', + id: 'baz', + caveats: [ + { + type: SnapCaveatType.TransactionDetailsOrigin, + value: true, + }, + ], + }; + + expect(getTransactionDetailsOriginCaveat(permission)).toBe(true); + }); + + it('returns null if the input is undefined', () => { + expect(getTransactionDetailsOriginCaveat(undefined)).toBeNull(); + }); + + it('returns null if the permission does not have caveats', () => { + const permission: PermissionConstraint = { + date: 0, + parentCapability: 'foo', + invoker: 'bar', + id: 'baz', + caveats: null, + }; + + expect(getTransactionDetailsOriginCaveat(permission)).toBeNull(); + }); + + it('throws if the permission does not have exactly one caveat', () => { + const permission: PermissionConstraint = { + date: 0, + parentCapability: 'foo', + invoker: 'bar', + id: 'baz', + caveats: [ + { + type: SnapCaveatType.TransactionDetailsOrigin, + value: true, + }, + { + type: SnapCaveatType.TransactionDetailsOrigin, + value: true, + }, + ], + }; + + expect(() => getTransactionDetailsOriginCaveat(permission)).toThrow( + 'Assertion failed', + ); + }); + + it('throws if the first caveat is not a "transactionDetailsOrigin" caveat', () => { + const permission: PermissionConstraint = { + date: 0, + parentCapability: 'foo', + invoker: 'bar', + id: 'baz', + caveats: [ + { + type: SnapCaveatType.PermittedCoinTypes, + value: 'foo', + }, + ], + }; + + expect(() => getTransactionDetailsOriginCaveat(permission)).toThrow( + 'Assertion failed', + ); + }); +}); + +describe('getTransactionDetailsInsightCaveatMapper', () => { + it('maps input to a caveat', () => { + expect( + getTransactionDetailsInsightCaveatMapper({ + allowTransactionDetailsOrigin: true, + }), + ).toStrictEqual({ + caveats: [ + { + type: 'transactionDetailsOrigin', + value: true, + }, + ], + }); + }); + + it('does not include caveat if input is empty object', () => { + expect(getTransactionDetailsInsightCaveatMapper({})).toStrictEqual({ + caveats: null, + }); + }); +}); + +describe('transactionDetailsInsightCaveatSpecifications', () => { + describe('validator', () => { + it('throws if the caveat values are invalid', () => { + expect(() => + transactionDetailsInsightCaveatSpecifications[ + SnapCaveatType.TransactionDetailsOrigin + ].validator?.( + // @ts-expect-error Missing value type. + { + type: SnapCaveatType.TransactionDetailsOrigin, + }, + ), + ).toThrow('Expected a plain object.'); + + expect(() => + transactionDetailsInsightCaveatSpecifications[ + SnapCaveatType.TransactionDetailsOrigin + ].validator?.({ + type: SnapCaveatType.TransactionDetailsOrigin, + value: undefined, + }), + ).toThrow('Expected caveat value to have type "boolean"'); + }); + }); +}); diff --git a/packages/snaps-rpc-methods/src/endowments/transaction-details-insight.ts b/packages/snaps-rpc-methods/src/endowments/transaction-details-insight.ts new file mode 100644 index 0000000000..c19f0ff019 --- /dev/null +++ b/packages/snaps-rpc-methods/src/endowments/transaction-details-insight.ts @@ -0,0 +1,150 @@ +import type { + PermissionSpecificationBuilder, + EndowmentGetterParams, + ValidPermissionSpecification, + PermissionValidatorConstraint, + PermissionConstraint, + CaveatSpecificationConstraint, + Caveat, +} from '@metamask/permission-controller'; +import { PermissionType, SubjectType } from '@metamask/permission-controller'; +import { rpcErrors } from '@metamask/rpc-errors'; +import { SnapCaveatType } from '@metamask/snaps-utils'; +import type { Json, NonEmptyArray } from '@metamask/utils'; +import { assert, hasProperty, isObject, isPlainObject } from '@metamask/utils'; + +import { createGenericPermissionValidator } from './caveats'; +import { SnapEndowments } from './enum'; + +const permissionName = SnapEndowments.TransactionDetailsInsight; + +type TransactionDetailsInsightEndowmentSpecification = + ValidPermissionSpecification<{ + permissionType: PermissionType.Endowment; + targetName: typeof permissionName; + endowmentGetter: (_options?: EndowmentGetterParams) => null; + allowedCaveats: Readonly> | null; + validator: PermissionValidatorConstraint; + }>; + +/** + * `endowment:transaction-details-insight` returns nothing; it is intended to be used as a flag + * by the extension to detect whether the snap has the capability to show information on the transaction confirmation screen. + * + * @param _builderOptions - Optional specification builder options. + * @returns The specification for the transaction-insight endowment. + */ +const specificationBuilder: PermissionSpecificationBuilder< + PermissionType.Endowment, + any, + TransactionDetailsInsightEndowmentSpecification +> = (_builderOptions?: unknown) => { + return { + permissionType: PermissionType.Endowment, + targetName: permissionName, + allowedCaveats: [ + SnapCaveatType.MaxRequestTime, + SnapCaveatType.TransactionDetailsOrigin, + ], + endowmentGetter: (_getterOptions?: EndowmentGetterParams) => null, + validator: createGenericPermissionValidator([ + { type: SnapCaveatType.TransactionDetailsOrigin, optional: true }, + { type: SnapCaveatType.MaxRequestTime, optional: true }, + ]), + subjectTypes: [SubjectType.Snap], + }; +}; + +export const transactionDetailsInsightEndowmentBuilder = Object.freeze({ + targetName: permissionName, + specificationBuilder, +} as const); + +/** + * Validates the type of the caveat value. + * + * @param caveat - The caveat to validate. + * @throws If the caveat value is invalid. + */ +function validateCaveat(caveat: Caveat): void { + if (!hasProperty(caveat, 'value') || !isPlainObject(caveat)) { + throw rpcErrors.invalidParams({ + message: 'Expected a plain object.', + }); + } + + const { value } = caveat; + + assert( + typeof value === 'boolean', + 'Expected caveat value to have type "boolean"', + ); +} + +/** + * Map a raw value from the `initialPermissions` to a caveat specification. + * Note that this function does not do any validation, that's handled by the + * PermissionsController when the permission is requested. + * + * @param value - The raw value from the `initialPermissions`. + * @returns The caveat specification. + */ +export function getTransactionDetailsInsightCaveatMapper( + value: Json, +): Pick { + if ( + !value || + !isObject(value) || + (isObject(value) && Object.keys(value).length === 0) + ) { + return { caveats: null }; + } + return { + caveats: [ + { + type: SnapCaveatType.TransactionDetailsOrigin, + value: + hasProperty(value, 'allowTransactionDetailsOrigin') && + (value.allowTransactionDetailsOrigin as boolean), + }, + ], + }; +} + +/** + * Getter function to get the transaction details origin caveat from a permission. + * + * This does basic validation of the caveat, but does not validate the type or + * value of the namespaces object itself, as this is handled by the + * `PermissionsController` when the permission is requested. + * + * @param permission - The permission to get the transaction origin caveat from. + * @returns The transaction origin, or `null` if the permission does not have a + * transaction origin caveat. + */ +export function getTransactionDetailsOriginCaveat( + permission?: PermissionConstraint, +): boolean | null { + if (!permission?.caveats) { + return null; + } + + assert(permission.caveats.length === 1); + assert( + permission.caveats[0].type === SnapCaveatType.TransactionDetailsOrigin, + ); + + const caveat = permission.caveats[0] as Caveat; + + return caveat.value ?? null; +} + +export const transactionDetailsInsightCaveatSpecifications: Record< + SnapCaveatType.TransactionDetailsOrigin, + CaveatSpecificationConstraint +> = { + [SnapCaveatType.TransactionDetailsOrigin]: Object.freeze({ + type: SnapCaveatType.TransactionDetailsOrigin, + validator: (caveat: Caveat) => validateCaveat(caveat), + }), +}; diff --git a/packages/snaps-sdk/src/types/handlers/index.ts b/packages/snaps-sdk/src/types/handlers/index.ts index 74eff8227f..8c073c96bb 100644 --- a/packages/snaps-sdk/src/types/handlers/index.ts +++ b/packages/snaps-sdk/src/types/handlers/index.ts @@ -15,3 +15,4 @@ export type * from './signature'; export * from './user-input'; export type * from './settings-page'; export type * from './web-socket-event'; +export type * from './transaction-details'; diff --git a/packages/snaps-sdk/src/types/handlers/transaction-details.ts b/packages/snaps-sdk/src/types/handlers/transaction-details.ts new file mode 100644 index 0000000000..05594bc496 --- /dev/null +++ b/packages/snaps-sdk/src/types/handlers/transaction-details.ts @@ -0,0 +1,91 @@ +import type { ComponentOrElement } from '..'; + +/** + * This event is called when a user clicks on a transaction to bring up the + * transaction details modal + * + * The `onTransactionDetails` handler returns a Snaps UI component, which is displayed + * in the transaction details insights panel (transaction details modal). + * + * @param params - The request parameters. + * @param params.transactionMeta - The transaction object. This contains the + * transaction parameters, such as the `from`, `to`, `value`, and `data` fields. + * @param params.origin - The origin of the transaction. A URL is the transaction originated + * from a website or, for example, 'Metamask' if the transaction was initiated by the user. + * @param params.chainId - The chain ID of the transaction. + * @param params.selectedAddress - The address of the account that initiated the transaction. + * @param params.selectedAccount - The account object of the account that initiated the transaction. + * @returns The transaction details insights. + */ +export type OnTransactionDetailsHandler = ( + params: OnTransactionDetailsParams, +) => Promise; + +export type OnTransactionDetailsParams = { + /** + * The transaction details data. + */ + transactionMeta: { + /** Unique transaction identifier */ + id: string; + /** Transaction hash */ + hash: string; + /** Transaction type */ + type: string; + /** Transaction timestamp */ + timestamp: number; + /** Transaction value (optional) */ + value?: string; + /** From address (optional) */ + from?: string; + /** To address (optional) */ + to?: string; + /** Additional transaction properties */ + [key: string]: unknown; + }; + + /** + * The chain ID of the network. + */ + chainId: string; + + /** + * The origin of the activity view request. + */ + origin?: string; + + /** + * The selected address of the user. + */ + selectedAddress: string; + + /** + * The selected account of the user. + */ + selectedAccount: any; +}; + +/** + * The response from a Snap's `onTransactionDetails` handler. + * + * @property id - A unique identifier for the insight interface. + * @property severity - The severity level of the insight. Currently only one + * level is supported: `critical`. + * @property content - Optional content to display in the transaction details view. + */ +export type OnTransactionDetailsResponse = { + /** + * A unique identifier for the insight interface. + */ + id?: string; + + /** + * The severity level of the insight. + */ + severity?: 'critical' | 'warning' | 'info'; + + /** + * Optional content to display. + */ + content?: ComponentOrElement; +}; diff --git a/packages/snaps-sdk/src/types/permissions.ts b/packages/snaps-sdk/src/types/permissions.ts index 1427b6bce3..33c012fda7 100644 --- a/packages/snaps-sdk/src/types/permissions.ts +++ b/packages/snaps-sdk/src/types/permissions.ts @@ -81,6 +81,10 @@ export type InitialPermissions = Partial<{ allowTransactionOrigin?: boolean; maxRequestTime?: number; }; + 'endowment:transaction-details-insight': { + allowTransactionDetailsOrigin?: boolean; + maxRequestTime?: number; + }; 'endowment:webassembly': EmptyObject; /* eslint-disable @typescript-eslint/naming-convention */ diff --git a/packages/snaps-utils/package.json b/packages/snaps-utils/package.json index 45455ca083..fbabc6a4ee 100644 --- a/packages/snaps-utils/package.json +++ b/packages/snaps-utils/package.json @@ -86,7 +86,7 @@ "@metamask/rpc-errors": "^7.0.3", "@metamask/slip44": "^4.2.0", "@metamask/snaps-registry": "^3.2.3", - "@metamask/snaps-sdk": "workspace:^", + "@metamask/snaps-sdk": "file:../snaps-sdk", "@metamask/superstruct": "^3.2.1", "@metamask/utils": "^11.4.2", "@noble/hashes": "^1.7.1", diff --git a/packages/snaps-utils/src/caveats.ts b/packages/snaps-utils/src/caveats.ts index 8272be9bc8..fabe7781a5 100644 --- a/packages/snaps-utils/src/caveats.ts +++ b/packages/snaps-utils/src/caveats.ts @@ -19,6 +19,11 @@ export enum SnapCaveatType { */ TransactionOrigin = 'transactionOrigin', + /** + * Caveat specifying access to the transaction details origin, used by `endowment:transaction-details-insight`. + */ + TransactionDetailsOrigin = 'transactionDetailsOrigin', + /** * Caveat specifying access to the signature origin, used by `endowment:signature-insight`. */ diff --git a/packages/snaps-utils/src/handlers/exports.ts b/packages/snaps-utils/src/handlers/exports.ts index f817f2436e..8ef6a0ab4f 100644 --- a/packages/snaps-utils/src/handlers/exports.ts +++ b/packages/snaps-utils/src/handlers/exports.ts @@ -13,6 +13,7 @@ import type { OnRpcRequestHandler, OnSettingsPageHandler, OnSignatureHandler, + OnTransactionDetailsHandler, OnStartHandler, OnTransactionHandler, OnUpdateHandler, @@ -37,6 +38,15 @@ export const SNAP_EXPORTS = { return typeof snapExport === 'function'; }, }, + [HandlerType.OnTransactionDetails]: { + type: HandlerType.OnTransactionDetails, + required: true, + validator: ( + snapExport: unknown, + ): snapExport is OnTransactionDetailsHandler => { + return typeof snapExport === 'function'; + }, + }, [HandlerType.OnCronjob]: { type: HandlerType.OnCronjob, required: true, diff --git a/packages/snaps-utils/src/handlers/index.ts b/packages/snaps-utils/src/handlers/index.ts index 638126f14f..e7f90b3dab 100644 --- a/packages/snaps-utils/src/handlers/index.ts +++ b/packages/snaps-utils/src/handlers/index.ts @@ -1,3 +1,4 @@ +export * from './transaction-details'; export * from './asset-historical-price'; export * from './assets-conversion'; export * from './assets-market-data'; diff --git a/packages/snaps-utils/src/handlers/transaction-details.ts b/packages/snaps-utils/src/handlers/transaction-details.ts new file mode 100644 index 0000000000..bca6f3546d --- /dev/null +++ b/packages/snaps-utils/src/handlers/transaction-details.ts @@ -0,0 +1,35 @@ +import { ComponentOrElementStruct, SeverityLevel } from '@metamask/snaps-sdk'; +import { + literal, + object, + optional, + string, + assign, + nullable, +} from '@metamask/superstruct'; + +export const OnTransactionDetailsSeverityResponseStruct = object({ + severity: optional(literal(SeverityLevel.Critical)), +}); + +export const OnTransactionDetailsResponseWithIdStruct = assign( + OnTransactionDetailsSeverityResponseStruct, + object({ + id: string(), + }), +); + +export const OnTransactionDetailsResponseWithContentStruct = assign( + OnTransactionDetailsSeverityResponseStruct, + object({ + content: ComponentOrElementStruct, + }), +); + +export const OnTransactionDetailsResponseStruct = nullable( + object({ + id: optional(string()), + severity: optional(literal(SeverityLevel.Critical)), + content: optional(ComponentOrElementStruct), + }), +); diff --git a/packages/snaps-utils/src/handlers/types.ts b/packages/snaps-utils/src/handlers/types.ts index d6690ac0f8..6a469bad31 100644 --- a/packages/snaps-utils/src/handlers/types.ts +++ b/packages/snaps-utils/src/handlers/types.ts @@ -32,6 +32,7 @@ export enum HandlerType { OnRpcRequest = 'onRpcRequest', OnSignature = 'onSignature', OnTransaction = 'onTransaction', + OnTransactionDetails = 'onTransactionDetails', OnCronjob = 'onCronjob', OnInstall = 'onInstall', OnUpdate = 'onUpdate', diff --git a/packages/snaps-utils/src/manifest/validation.ts b/packages/snaps-utils/src/manifest/validation.ts index 2df4e9ce5c..0601007020 100644 --- a/packages/snaps-utils/src/manifest/validation.ts +++ b/packages/snaps-utils/src/manifest/validation.ts @@ -243,6 +243,14 @@ export const PermissionsStruct: Describe = type({ }), ), ), + 'endowment:transaction-details-insight': optional( + mergeStructs( + HandlerCaveatsStruct, + object({ + allowTransactionDetailsOrigin: optional(boolean()), + }), + ), + ), 'endowment:webassembly': optional(EmptyObjectStruct), snap_dialog: optional(EmptyObjectStruct), snap_manageState: optional(EmptyObjectStruct), diff --git a/packages/snaps-webpack-plugin/package.json b/packages/snaps-webpack-plugin/package.json index 9919bb15af..444816e824 100644 --- a/packages/snaps-webpack-plugin/package.json +++ b/packages/snaps-webpack-plugin/package.json @@ -57,9 +57,9 @@ "test:watch": "jest --watch" }, "dependencies": { - "@metamask/snaps-rpc-methods": "workspace:^", - "@metamask/snaps-sdk": "workspace:^", - "@metamask/snaps-utils": "workspace:^", + "@metamask/snaps-rpc-methods": "file:../snaps-rpc-methods", + "@metamask/snaps-sdk": "file:../snaps-sdk", + "@metamask/snaps-utils": "file:../snaps-utils", "@metamask/utils": "^11.4.2", "chalk": "^4.1.2", "webpack-sources": "^3.2.3" diff --git a/yarn.lock b/yarn.lock index 298783dd54..8d05ac9256 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4151,11 +4151,11 @@ __metadata: dependencies: "@lavamoat/allow-scripts": "npm:^3.3.4" "@metamask/auto-changelog": "npm:^5.0.2" - "@metamask/snaps-rpc-methods": "workspace:^" - "@metamask/snaps-sandbox": "workspace:^" - "@metamask/snaps-sdk": "workspace:^" - "@metamask/snaps-utils": "workspace:^" - "@metamask/snaps-webpack-plugin": "workspace:^" + "@metamask/snaps-rpc-methods": "file:../snaps-rpc-methods" + "@metamask/snaps-sandbox": "file:../snaps-sandbox" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/snaps-utils": "file:../snaps-utils" + "@metamask/snaps-webpack-plugin": "file:../snaps-webpack-plugin" "@metamask/superstruct": "npm:^3.2.1" "@metamask/utils": "npm:^11.4.2" "@swc/core": "npm:1.11.31" @@ -4236,9 +4236,9 @@ __metadata: "@metamask/post-message-stream": "npm:^10.0.0" "@metamask/rpc-errors": "npm:^7.0.3" "@metamask/snaps-registry": "npm:^3.2.3" - "@metamask/snaps-rpc-methods": "workspace:^" - "@metamask/snaps-sdk": "workspace:^" - "@metamask/snaps-utils": "workspace:^" + "@metamask/snaps-rpc-methods": "file:../snaps-rpc-methods" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/snaps-utils": "file:../snaps-utils" "@metamask/template-snap": "npm:^0.7.0" "@metamask/utils": "npm:^11.4.2" "@noble/hashes": "npm:^1.7.1" @@ -4285,7 +4285,7 @@ __metadata: vite-tsconfig-paths: "npm:^4.0.5" vitest: "npm:^3.1.1" peerDependencies: - "@metamask/snaps-execution-environments": "workspace:^" + "@metamask/snaps-execution-environments": "*" peerDependenciesMeta: "@metamask/snaps-execution-environments": optional: true @@ -4307,8 +4307,8 @@ __metadata: "@metamask/post-message-stream": "npm:^10.0.0" "@metamask/providers": "npm:^22.1.0" "@metamask/rpc-errors": "npm:^7.0.3" - "@metamask/snaps-sdk": "workspace:^" - "@metamask/snaps-utils": "workspace:^" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/snaps-utils": "file:../snaps-utils" "@metamask/superstruct": "npm:^3.2.1" "@metamask/utils": "npm:^11.4.2" "@swc/core": "npm:1.11.31" @@ -4421,6 +4421,70 @@ __metadata: languageName: unknown linkType: soft +"@metamask/snaps-rpc-methods@file:../snaps-rpc-methods::locator=%40metamask%2Fsnaps-cli%40workspace%3Apackages%2Fsnaps-cli": + version: 13.3.0 + resolution: "@metamask/snaps-rpc-methods@file:../snaps-rpc-methods#../snaps-rpc-methods::hash=81db32&locator=%40metamask%2Fsnaps-cli%40workspace%3Apackages%2Fsnaps-cli" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/snaps-utils": "file:../snaps-utils" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + checksum: 10/015b19bbd697210daf8dedcdba1ba5f21384f803ba6a2722f1fcdcd1d769a8a687c31f0c2c0b4e3ffcab8fa0d85076ab6041e18b311e661585b3b9cc4629a3a7 + languageName: node + linkType: hard + +"@metamask/snaps-rpc-methods@file:../snaps-rpc-methods::locator=%40metamask%2Fsnaps-controllers%40workspace%3Apackages%2Fsnaps-controllers": + version: 13.3.0 + resolution: "@metamask/snaps-rpc-methods@file:../snaps-rpc-methods#../snaps-rpc-methods::hash=81db32&locator=%40metamask%2Fsnaps-controllers%40workspace%3Apackages%2Fsnaps-controllers" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/snaps-utils": "file:../snaps-utils" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + checksum: 10/015b19bbd697210daf8dedcdba1ba5f21384f803ba6a2722f1fcdcd1d769a8a687c31f0c2c0b4e3ffcab8fa0d85076ab6041e18b311e661585b3b9cc4629a3a7 + languageName: node + linkType: hard + +"@metamask/snaps-rpc-methods@file:../snaps-rpc-methods::locator=%40metamask%2Fsnaps-webpack-plugin%40file%3A..%2Fsnaps-webpack-plugin%23..%2Fsnaps-webpack-plugin%3A%3Ahash%3D6d5d29%26locator%3D%2540metamask%252Fsnaps-cli%2540workspace%253Apackages%252Fsnaps-cli": + version: 13.3.0 + resolution: "@metamask/snaps-rpc-methods@file:../snaps-rpc-methods#../snaps-rpc-methods::hash=81db32&locator=%40metamask%2Fsnaps-webpack-plugin%40file%3A..%2Fsnaps-webpack-plugin%23..%2Fsnaps-webpack-plugin%3A%3Ahash%3D6d5d29%26locator%3D%2540metamask%252Fsnaps-cli%2540workspace%253Apackages%252Fsnaps-cli" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/snaps-utils": "file:../snaps-utils" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + checksum: 10/015b19bbd697210daf8dedcdba1ba5f21384f803ba6a2722f1fcdcd1d769a8a687c31f0c2c0b4e3ffcab8fa0d85076ab6041e18b311e661585b3b9cc4629a3a7 + languageName: node + linkType: hard + +"@metamask/snaps-rpc-methods@file:../snaps-rpc-methods::locator=%40metamask%2Fsnaps-webpack-plugin%40workspace%3Apackages%2Fsnaps-webpack-plugin": + version: 13.3.0 + resolution: "@metamask/snaps-rpc-methods@file:../snaps-rpc-methods#../snaps-rpc-methods::hash=81db32&locator=%40metamask%2Fsnaps-webpack-plugin%40workspace%3Apackages%2Fsnaps-webpack-plugin" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/snaps-utils": "file:../snaps-utils" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + checksum: 10/015b19bbd697210daf8dedcdba1ba5f21384f803ba6a2722f1fcdcd1d769a8a687c31f0c2c0b4e3ffcab8fa0d85076ab6041e18b311e661585b3b9cc4629a3a7 + languageName: node + linkType: hard + "@metamask/snaps-rpc-methods@workspace:^, @metamask/snaps-rpc-methods@workspace:packages/snaps-rpc-methods": version: 0.0.0-use.local resolution: "@metamask/snaps-rpc-methods@workspace:packages/snaps-rpc-methods" @@ -4431,8 +4495,8 @@ __metadata: "@metamask/key-tree": "npm:^10.1.1" "@metamask/permission-controller": "npm:^11.0.6" "@metamask/rpc-errors": "npm:^7.0.3" - "@metamask/snaps-sdk": "workspace:^" - "@metamask/snaps-utils": "workspace:^" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/snaps-utils": "file:../snaps-utils" "@metamask/superstruct": "npm:^3.2.1" "@metamask/utils": "npm:^11.4.2" "@noble/hashes": "npm:^1.7.1" @@ -4451,7 +4515,14 @@ __metadata: languageName: unknown linkType: soft -"@metamask/snaps-sandbox@workspace:^, @metamask/snaps-sandbox@workspace:packages/snaps-sandbox": +"@metamask/snaps-sandbox@file:../snaps-sandbox::locator=%40metamask%2Fsnaps-cli%40workspace%3Apackages%2Fsnaps-cli": + version: 1.0.0 + resolution: "@metamask/snaps-sandbox@file:../snaps-sandbox#../snaps-sandbox::hash=2fb77b&locator=%40metamask%2Fsnaps-cli%40workspace%3Apackages%2Fsnaps-cli" + checksum: 10/95bd3b8988b64a52942615fae6715f576ea505a927c4a4751e07c42acde7cf01cf663d54e54d344d5994cfb5347470fc47eea2aac4be786e0c13ca596f3f014a + languageName: node + linkType: hard + +"@metamask/snaps-sandbox@workspace:packages/snaps-sandbox": version: 0.0.0-use.local resolution: "@metamask/snaps-sandbox@workspace:packages/snaps-sandbox" dependencies: @@ -4484,200 +4555,807 @@ __metadata: languageName: unknown linkType: soft -"@metamask/snaps-sdk@workspace:^, @metamask/snaps-sdk@workspace:packages/snaps-sdk": - version: 0.0.0-use.local - resolution: "@metamask/snaps-sdk@workspace:packages/snaps-sdk" +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-cli%40workspace%3Apackages%2Fsnaps-cli": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-cli%40workspace%3Apackages%2Fsnaps-cli" dependencies: - "@lavamoat/allow-scripts": "npm:^3.3.4" - "@metamask/auto-changelog": "npm:^5.0.2" "@metamask/key-tree": "npm:^10.1.1" "@metamask/providers": "npm:^22.1.0" "@metamask/rpc-errors": "npm:^7.0.3" "@metamask/superstruct": "npm:^3.2.1" "@metamask/utils": "npm:^11.4.2" - "@ts-bridge/cli": "npm:^0.6.1" - "@types/jest": "npm:^27.5.1" - deepmerge: "npm:^4.2.2" - depcheck: "npm:^1.4.7" - eslint: "npm:^9.11.0" - expect-type: "npm:^0.17.3" - jest: "npm:^29.0.2" - jest-fetch-mock: "npm:^3.0.3" - jest-it-up: "npm:^2.0.0" - jest-silent-reporter: "npm:^0.6.0" - prettier: "npm:^3.3.3" - ts-jest: "npm:^29.1.1" - typescript: "npm:~5.3.3" - languageName: unknown - linkType: soft + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard -"@metamask/snaps-simulation@workspace:^, @metamask/snaps-simulation@workspace:packages/snaps-simulation": - version: 0.0.0-use.local - resolution: "@metamask/snaps-simulation@workspace:packages/snaps-simulation" +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-controllers%40workspace%3Apackages%2Fsnaps-controllers": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-controllers%40workspace%3Apackages%2Fsnaps-controllers" dependencies: - "@lavamoat/allow-scripts": "npm:^3.3.4" - "@metamask/auto-changelog": "npm:^5.0.2" - "@metamask/base-controller": "npm:^8.0.1" - "@metamask/eth-json-rpc-middleware": "npm:^17.0.1" - "@metamask/json-rpc-engine": "npm:^10.0.2" - "@metamask/json-rpc-middleware-stream": "npm:^8.0.7" "@metamask/key-tree": "npm:^10.1.1" - "@metamask/permission-controller": "npm:^11.0.6" - "@metamask/phishing-controller": "npm:^12.6.0" - "@metamask/snaps-controllers": "workspace:^" - "@metamask/snaps-execution-environments": "workspace:^" - "@metamask/snaps-rpc-methods": "workspace:^" - "@metamask/snaps-sdk": "workspace:^" - "@metamask/snaps-utils": "workspace:^" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" "@metamask/superstruct": "npm:^3.2.1" "@metamask/utils": "npm:^11.4.2" - "@reduxjs/toolkit": "npm:^1.9.5" - "@ts-bridge/cli": "npm:^0.6.1" - "@types/express": "npm:^5.0.1" - "@types/jest": "npm:^27.5.1" - "@types/mime": "npm:^3.0.0" - "@types/readable-stream": "npm:^4.0.15" - deepmerge: "npm:^4.2.2" - depcheck: "npm:^1.4.7" - eslint: "npm:^9.11.0" - express: "npm:^5.1.0" - fast-deep-equal: "npm:^3.1.3" - jest: "npm:^29.0.2" - jest-it-up: "npm:^2.0.0" - jest-silent-reporter: "npm:^0.6.0" - mime: "npm:^3.0.0" - prettier: "npm:^3.3.3" - readable-stream: "npm:^3.6.2" - redux-saga: "npm:^1.2.3" - ts-jest: "npm:^29.1.1" - typescript: "npm:~5.3.3" - languageName: unknown - linkType: soft + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard -"@metamask/snaps-utils@workspace:^, @metamask/snaps-utils@workspace:packages/snaps-utils": - version: 0.0.0-use.local - resolution: "@metamask/snaps-utils@workspace:packages/snaps-utils" +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-execution-environments%40workspace%3Apackages%2Fsnaps-execution-environments": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-execution-environments%40workspace%3Apackages%2Fsnaps-execution-environments" dependencies: - "@babel/core": "npm:^7.23.2" - "@babel/types": "npm:^7.23.0" - "@lavamoat/allow-scripts": "npm:^3.3.4" - "@metamask/auto-changelog": "npm:^5.0.2" - "@metamask/base-controller": "npm:^8.0.1" "@metamask/key-tree": "npm:^10.1.1" - "@metamask/permission-controller": "npm:^11.0.6" - "@metamask/post-message-stream": "npm:^10.0.0" + "@metamask/providers": "npm:^22.1.0" "@metamask/rpc-errors": "npm:^7.0.3" - "@metamask/slip44": "npm:^4.2.0" - "@metamask/snaps-registry": "npm:^3.2.3" - "@metamask/snaps-sdk": "workspace:^" "@metamask/superstruct": "npm:^3.2.1" "@metamask/utils": "npm:^11.4.2" - "@noble/hashes": "npm:^1.7.1" - "@scure/base": "npm:^1.1.1" - "@swc/core": "npm:1.11.31" - "@swc/jest": "npm:^0.2.38" - "@testing-library/dom": "npm:^10.4.0" - "@ts-bridge/cli": "npm:^0.6.1" - "@types/jest": "npm:^27.5.1" - "@types/luxon": "npm:^3" - "@types/node": "npm:18.14.2" - "@types/semver": "npm:^7.5.0" - "@types/validate-npm-package-name": "npm:^4.0.0" - "@vitest/browser": "npm:^3.1.1" - "@vitest/coverage-istanbul": "npm:3.1.1" - chalk: "npm:^4.1.2" - cron-parser: "npm:^4.5.0" - deepmerge: "npm:^4.2.2" - depcheck: "npm:^1.4.7" - eslint: "npm:^9.11.0" - fast-deep-equal: "npm:^3.1.3" - fast-json-stable-stringify: "npm:^2.1.0" - fast-xml-parser: "npm:^4.4.1" - jest: "npm:^29.0.2" - jest-fetch-mock: "npm:^3.0.3" - jest-silent-reporter: "npm:^0.6.0" - luxon: "npm:^3.5.0" - marked: "npm:^12.0.1" - memfs: "npm:^3.4.13" - prettier: "npm:^3.3.3" - rfdc: "npm:^1.3.0" - rimraf: "npm:^4.1.2" - semver: "npm:^7.5.4" - ses: "npm:^1.13.1" - tsx: "npm:^4.20.3" - typescript: "npm:~5.3.3" - validate-npm-package-name: "npm:^5.0.0" - vite: "npm:^6.2.7" - vite-plugin-node-polyfills: "npm:^0.23.0" - vite-tsconfig-paths: "npm:^4.0.5" - vitest: "npm:^3.1.1" - languageName: unknown - linkType: soft + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard -"@metamask/snaps-webpack-plugin@workspace:^, @metamask/snaps-webpack-plugin@workspace:packages/snaps-webpack-plugin": - version: 0.0.0-use.local - resolution: "@metamask/snaps-webpack-plugin@workspace:packages/snaps-webpack-plugin" +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-cli%2540workspace%253Apackages%252Fsnaps-cli": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-cli%2540workspace%253Apackages%252Fsnaps-cli" dependencies: - "@lavamoat/allow-scripts": "npm:^3.3.4" - "@metamask/auto-changelog": "npm:^5.0.2" - "@metamask/snaps-rpc-methods": "workspace:^" - "@metamask/snaps-sdk": "workspace:^" - "@metamask/snaps-utils": "workspace:^" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" "@metamask/utils": "npm:^11.4.2" - "@swc/core": "npm:1.11.31" - "@swc/jest": "npm:^0.2.38" - "@ts-bridge/cli": "npm:^0.6.1" - "@types/jest": "npm:^27.5.1" - "@types/webpack-sources": "npm:^3.2.0" - chalk: "npm:^4.1.2" - deepmerge: "npm:^4.2.2" - depcheck: "npm:^1.4.7" - eslint: "npm:^9.11.0" - jest: "npm:^29.0.2" - jest-it-up: "npm:^2.0.0" - jest-silent-reporter: "npm:^0.6.0" - memfs: "npm:^3.4.13" - prettier: "npm:^3.3.3" - typescript: "npm:~5.3.3" - webpack: "npm:^5.97.1" - webpack-sources: "npm:^3.2.3" - languageName: unknown - linkType: soft + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard -"@metamask/superstruct@npm:^3.1.0, @metamask/superstruct@npm:^3.2.1": - version: 3.2.1 - resolution: "@metamask/superstruct@npm:3.2.1" - checksum: 10/9e29380f2cf8b129283ccb2b568296d92682b705109ba62dbd7739ffd6a1982fe38c7228cdcf3cbee94dbcdd5fcc1c846ab9d1dd3582167154f914422fcff547 +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-controllers%2540workspace%253Apackages%252Fsnaps-controllers": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-controllers%2540workspace%253Apackages%252Fsnaps-controllers" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 languageName: node linkType: hard -"@metamask/template-snap@npm:^0.7.0": - version: 0.7.0 - resolution: "@metamask/template-snap@npm:0.7.0" - checksum: 10/70f11ec66945be906c22ea9f66e39624e5f7b7ae6b1e913bf2067e3278ed71ebe63953bb89146dcf7add21fc0815b895076c82d8a2af396029f06d2381eeacf9 +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-webpack-plugin%2540file%253A..%252Fsnaps-webpack-plugin%2523..%252Fsnaps-webpack-plugin%253A%253Ahash%253D6d5d29%2526locator%253D%252540metamask%25252Fsnaps-cli%252540workspace%25253Apackages%25252Fsnaps-cli": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-webpack-plugin%2540file%253A..%252Fsnaps-webpack-plugin%2523..%252Fsnaps-webpack-plugin%253A%253Ahash%253D6d5d29%2526locator%253D%252540metamask%25252Fsnaps-cli%252540workspace%25253Apackages%25252Fsnaps-cli" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 languageName: node linkType: hard -"@metamask/test-snaps@workspace:packages/test-snaps": - version: 0.0.0-use.local - resolution: "@metamask/test-snaps@workspace:packages/test-snaps" +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-webpack-plugin%2540workspace%253Apackages%252Fsnaps-webpack-plugin": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-webpack-plugin%2540workspace%253Apackages%252Fsnaps-webpack-plugin" dependencies: - "@metamask/auto-changelog": "npm:^5.0.2" - "@metamask/background-events-example-snap": "workspace:^" - "@metamask/bip32-example-snap": "workspace:^" - "@metamask/bip44-example-snap": "workspace:^" - "@metamask/client-status-example-snap": "workspace:^" - "@metamask/cronjob-duration-example-snap": "workspace:^" - "@metamask/cronjob-example-snap": "workspace:^" - "@metamask/dialog-example-snap": "workspace:^" - "@metamask/error-example-snap": "workspace:^" - "@metamask/ethereum-provider-example-snap": "workspace:^" - "@metamask/ethers-js-example-snap": "workspace:^" - "@metamask/file-upload-example-snap": "workspace:^" - "@metamask/get-entropy-example-snap": "workspace:^" - "@metamask/get-file-example-snap": "workspace:^" - "@metamask/home-page-example-snap": "workspace:^" - "@metamask/images-example-snap": "workspace:^" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-rpc-methods%40workspace%3Apackages%2Fsnaps-rpc-methods": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-rpc-methods%40workspace%3Apackages%2Fsnaps-rpc-methods" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-cli%2540workspace%253Apackages%252Fsnaps-cli": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-cli%2540workspace%253Apackages%252Fsnaps-cli" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-controllers%2540workspace%253Apackages%252Fsnaps-controllers": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-controllers%2540workspace%253Apackages%252Fsnaps-controllers" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-execution-environments%2540workspace%253Apackages%252Fsnaps-execution-environments": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-execution-environments%2540workspace%253Apackages%252Fsnaps-execution-environments" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-rpc-methods%2540file%253A..%252Fsnaps-rpc-methods%2523..%252Fsnaps-rpc-methods%253A%253Ahash%253D81db32%2526locator%253D%252540metamask%25252Fsnaps-cli%252540workspace%25253Apackages%25252Fsnaps-cli": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-rpc-methods%2540file%253A..%252Fsnaps-rpc-methods%2523..%252Fsnaps-rpc-methods%253A%253Ahash%253D81db32%2526locator%253D%252540metamask%25252Fsnaps-cli%252540workspace%25253Apackages%25252Fsnaps-cli" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-rpc-methods%2540file%253A..%252Fsnaps-rpc-methods%2523..%252Fsnaps-rpc-methods%253A%253Ahash%253D81db32%2526locator%253D%252540metamask%25252Fsnaps-controllers%252540workspace%25253Apackages%25252Fsnaps-controllers": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-rpc-methods%2540file%253A..%252Fsnaps-rpc-methods%2523..%252Fsnaps-rpc-methods%253A%253Ahash%253D81db32%2526locator%253D%252540metamask%25252Fsnaps-controllers%252540workspace%25253Apackages%25252Fsnaps-controllers" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-rpc-methods%2540file%253A..%252Fsnaps-rpc-methods%2523..%252Fsnaps-rpc-methods%253A%253Ahash%253D81db32%2526locator%253D%252540metamask%25252Fsnaps-webpack-plugin%252540file%25253A..%25252Fsnaps-webpack-plugin%252523..%25252Fsnaps-webpack-plugin%25253A%25253Ahash%25253D6d5d29%252526locator%25253D%25252540metamask%2525252Fsnaps-cli%25252540workspace%2525253Apackages%2525252Fsnaps-cli": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-rpc-methods%2540file%253A..%252Fsnaps-rpc-methods%2523..%252Fsnaps-rpc-methods%253A%253Ahash%253D81db32%2526locator%253D%252540metamask%25252Fsnaps-webpack-plugin%252540file%25253A..%25252Fsnaps-webpack-plugin%252523..%25252Fsnaps-webpack-plugin%25253A%25253Ahash%25253D6d5d29%252526locator%25253D%25252540metamask%2525252Fsnaps-cli%25252540workspace%2525253Apackages%2525252Fsnaps-cli" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-rpc-methods%2540file%253A..%252Fsnaps-rpc-methods%2523..%252Fsnaps-rpc-methods%253A%253Ahash%253D81db32%2526locator%253D%252540metamask%25252Fsnaps-webpack-plugin%252540workspace%25253Apackages%25252Fsnaps-webpack-plugin": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-rpc-methods%2540file%253A..%252Fsnaps-rpc-methods%2523..%252Fsnaps-rpc-methods%253A%253Ahash%253D81db32%2526locator%253D%252540metamask%25252Fsnaps-webpack-plugin%252540workspace%25253Apackages%25252Fsnaps-webpack-plugin" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-rpc-methods%2540workspace%253Apackages%252Fsnaps-rpc-methods": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-rpc-methods%2540workspace%253Apackages%252Fsnaps-rpc-methods" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-webpack-plugin%2540file%253A..%252Fsnaps-webpack-plugin%2523..%252Fsnaps-webpack-plugin%253A%253Ahash%253D6d5d29%2526locator%253D%252540metamask%25252Fsnaps-cli%252540workspace%25253Apackages%25252Fsnaps-cli": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-webpack-plugin%2540file%253A..%252Fsnaps-webpack-plugin%2523..%252Fsnaps-webpack-plugin%253A%253Ahash%253D6d5d29%2526locator%253D%252540metamask%25252Fsnaps-cli%252540workspace%25253Apackages%25252Fsnaps-cli" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-webpack-plugin%2540workspace%253Apackages%252Fsnaps-webpack-plugin": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-utils%40file%3A..%2Fsnaps-utils%23..%2Fsnaps-utils%3A%3Ahash%3D8f965c%26locator%3D%2540metamask%252Fsnaps-webpack-plugin%2540workspace%253Apackages%252Fsnaps-webpack-plugin" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-utils%40workspace%3Apackages%2Fsnaps-utils": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-utils%40workspace%3Apackages%2Fsnaps-utils" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-webpack-plugin%40file%3A..%2Fsnaps-webpack-plugin%23..%2Fsnaps-webpack-plugin%3A%3Ahash%3D6d5d29%26locator%3D%2540metamask%252Fsnaps-cli%2540workspace%253Apackages%252Fsnaps-cli": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-webpack-plugin%40file%3A..%2Fsnaps-webpack-plugin%23..%2Fsnaps-webpack-plugin%3A%3Ahash%3D6d5d29%26locator%3D%2540metamask%252Fsnaps-cli%2540workspace%253Apackages%252Fsnaps-cli" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@file:../snaps-sdk::locator=%40metamask%2Fsnaps-webpack-plugin%40workspace%3Apackages%2Fsnaps-webpack-plugin": + version: 9.1.0 + resolution: "@metamask/snaps-sdk@file:../snaps-sdk#../snaps-sdk::hash=5c73f1&locator=%40metamask%2Fsnaps-webpack-plugin%40workspace%3Apackages%2Fsnaps-webpack-plugin" + dependencies: + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + checksum: 10/61d9604922a7b15ef5606e0f32498f1c4bb6e0fd6c29730c73baffb42ac2dccc6ee17e007099f9cb0232021efab7f2b8b4e802750b050925f3926f0244d23929 + languageName: node + linkType: hard + +"@metamask/snaps-sdk@workspace:^, @metamask/snaps-sdk@workspace:packages/snaps-sdk": + version: 0.0.0-use.local + resolution: "@metamask/snaps-sdk@workspace:packages/snaps-sdk" + dependencies: + "@lavamoat/allow-scripts": "npm:^3.3.4" + "@metamask/auto-changelog": "npm:^5.0.2" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/providers": "npm:^22.1.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@ts-bridge/cli": "npm:^0.6.1" + "@types/jest": "npm:^27.5.1" + deepmerge: "npm:^4.2.2" + depcheck: "npm:^1.4.7" + eslint: "npm:^9.11.0" + expect-type: "npm:^0.17.3" + jest: "npm:^29.0.2" + jest-fetch-mock: "npm:^3.0.3" + jest-it-up: "npm:^2.0.0" + jest-silent-reporter: "npm:^0.6.0" + prettier: "npm:^3.3.3" + ts-jest: "npm:^29.1.1" + typescript: "npm:~5.3.3" + languageName: unknown + linkType: soft + +"@metamask/snaps-simulation@workspace:^, @metamask/snaps-simulation@workspace:packages/snaps-simulation": + version: 0.0.0-use.local + resolution: "@metamask/snaps-simulation@workspace:packages/snaps-simulation" + dependencies: + "@lavamoat/allow-scripts": "npm:^3.3.4" + "@metamask/auto-changelog": "npm:^5.0.2" + "@metamask/base-controller": "npm:^8.0.1" + "@metamask/eth-json-rpc-middleware": "npm:^17.0.1" + "@metamask/json-rpc-engine": "npm:^10.0.2" + "@metamask/json-rpc-middleware-stream": "npm:^8.0.7" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/phishing-controller": "npm:^12.6.0" + "@metamask/snaps-controllers": "workspace:^" + "@metamask/snaps-execution-environments": "workspace:^" + "@metamask/snaps-rpc-methods": "workspace:^" + "@metamask/snaps-sdk": "workspace:^" + "@metamask/snaps-utils": "workspace:^" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@reduxjs/toolkit": "npm:^1.9.5" + "@ts-bridge/cli": "npm:^0.6.1" + "@types/express": "npm:^5.0.1" + "@types/jest": "npm:^27.5.1" + "@types/mime": "npm:^3.0.0" + "@types/readable-stream": "npm:^4.0.15" + deepmerge: "npm:^4.2.2" + depcheck: "npm:^1.4.7" + eslint: "npm:^9.11.0" + express: "npm:^5.1.0" + fast-deep-equal: "npm:^3.1.3" + jest: "npm:^29.0.2" + jest-it-up: "npm:^2.0.0" + jest-silent-reporter: "npm:^0.6.0" + mime: "npm:^3.0.0" + prettier: "npm:^3.3.3" + readable-stream: "npm:^3.6.2" + redux-saga: "npm:^1.2.3" + ts-jest: "npm:^29.1.1" + typescript: "npm:~5.3.3" + languageName: unknown + linkType: soft + +"@metamask/snaps-utils@file:../snaps-utils::locator=%40metamask%2Fsnaps-cli%40workspace%3Apackages%2Fsnaps-cli": + version: 11.0.0 + resolution: "@metamask/snaps-utils@file:../snaps-utils#../snaps-utils::hash=8f965c&locator=%40metamask%2Fsnaps-cli%40workspace%3Apackages%2Fsnaps-cli" + dependencies: + "@babel/core": "npm:^7.23.2" + "@babel/types": "npm:^7.23.0" + "@metamask/base-controller": "npm:^8.0.1" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/slip44": "npm:^4.2.0" + "@metamask/snaps-registry": "npm:^3.2.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + "@scure/base": "npm:^1.1.1" + chalk: "npm:^4.1.2" + cron-parser: "npm:^4.5.0" + fast-deep-equal: "npm:^3.1.3" + fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.4.1" + luxon: "npm:^3.5.0" + marked: "npm:^12.0.1" + rfdc: "npm:^1.3.0" + semver: "npm:^7.5.4" + ses: "npm:^1.13.1" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/7e9355dba4fcaab9ef4b720effea01d842e71801fbdca844016b6427beee728a0bcbd140265da0121d40b3d038530d1e9264ee94edff3a9ca7a5393a2f8e60fa + languageName: node + linkType: hard + +"@metamask/snaps-utils@file:../snaps-utils::locator=%40metamask%2Fsnaps-controllers%40workspace%3Apackages%2Fsnaps-controllers": + version: 11.0.0 + resolution: "@metamask/snaps-utils@file:../snaps-utils#../snaps-utils::hash=8f965c&locator=%40metamask%2Fsnaps-controllers%40workspace%3Apackages%2Fsnaps-controllers" + dependencies: + "@babel/core": "npm:^7.23.2" + "@babel/types": "npm:^7.23.0" + "@metamask/base-controller": "npm:^8.0.1" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/slip44": "npm:^4.2.0" + "@metamask/snaps-registry": "npm:^3.2.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + "@scure/base": "npm:^1.1.1" + chalk: "npm:^4.1.2" + cron-parser: "npm:^4.5.0" + fast-deep-equal: "npm:^3.1.3" + fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.4.1" + luxon: "npm:^3.5.0" + marked: "npm:^12.0.1" + rfdc: "npm:^1.3.0" + semver: "npm:^7.5.4" + ses: "npm:^1.13.1" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/7e9355dba4fcaab9ef4b720effea01d842e71801fbdca844016b6427beee728a0bcbd140265da0121d40b3d038530d1e9264ee94edff3a9ca7a5393a2f8e60fa + languageName: node + linkType: hard + +"@metamask/snaps-utils@file:../snaps-utils::locator=%40metamask%2Fsnaps-execution-environments%40workspace%3Apackages%2Fsnaps-execution-environments": + version: 11.0.0 + resolution: "@metamask/snaps-utils@file:../snaps-utils#../snaps-utils::hash=8f965c&locator=%40metamask%2Fsnaps-execution-environments%40workspace%3Apackages%2Fsnaps-execution-environments" + dependencies: + "@babel/core": "npm:^7.23.2" + "@babel/types": "npm:^7.23.0" + "@metamask/base-controller": "npm:^8.0.1" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/slip44": "npm:^4.2.0" + "@metamask/snaps-registry": "npm:^3.2.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + "@scure/base": "npm:^1.1.1" + chalk: "npm:^4.1.2" + cron-parser: "npm:^4.5.0" + fast-deep-equal: "npm:^3.1.3" + fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.4.1" + luxon: "npm:^3.5.0" + marked: "npm:^12.0.1" + rfdc: "npm:^1.3.0" + semver: "npm:^7.5.4" + ses: "npm:^1.13.1" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/7e9355dba4fcaab9ef4b720effea01d842e71801fbdca844016b6427beee728a0bcbd140265da0121d40b3d038530d1e9264ee94edff3a9ca7a5393a2f8e60fa + languageName: node + linkType: hard + +"@metamask/snaps-utils@file:../snaps-utils::locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-cli%2540workspace%253Apackages%252Fsnaps-cli": + version: 11.0.0 + resolution: "@metamask/snaps-utils@file:../snaps-utils#../snaps-utils::hash=8f965c&locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-cli%2540workspace%253Apackages%252Fsnaps-cli" + dependencies: + "@babel/core": "npm:^7.23.2" + "@babel/types": "npm:^7.23.0" + "@metamask/base-controller": "npm:^8.0.1" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/slip44": "npm:^4.2.0" + "@metamask/snaps-registry": "npm:^3.2.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + "@scure/base": "npm:^1.1.1" + chalk: "npm:^4.1.2" + cron-parser: "npm:^4.5.0" + fast-deep-equal: "npm:^3.1.3" + fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.4.1" + luxon: "npm:^3.5.0" + marked: "npm:^12.0.1" + rfdc: "npm:^1.3.0" + semver: "npm:^7.5.4" + ses: "npm:^1.13.1" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/7e9355dba4fcaab9ef4b720effea01d842e71801fbdca844016b6427beee728a0bcbd140265da0121d40b3d038530d1e9264ee94edff3a9ca7a5393a2f8e60fa + languageName: node + linkType: hard + +"@metamask/snaps-utils@file:../snaps-utils::locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-controllers%2540workspace%253Apackages%252Fsnaps-controllers": + version: 11.0.0 + resolution: "@metamask/snaps-utils@file:../snaps-utils#../snaps-utils::hash=8f965c&locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-controllers%2540workspace%253Apackages%252Fsnaps-controllers" + dependencies: + "@babel/core": "npm:^7.23.2" + "@babel/types": "npm:^7.23.0" + "@metamask/base-controller": "npm:^8.0.1" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/slip44": "npm:^4.2.0" + "@metamask/snaps-registry": "npm:^3.2.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + "@scure/base": "npm:^1.1.1" + chalk: "npm:^4.1.2" + cron-parser: "npm:^4.5.0" + fast-deep-equal: "npm:^3.1.3" + fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.4.1" + luxon: "npm:^3.5.0" + marked: "npm:^12.0.1" + rfdc: "npm:^1.3.0" + semver: "npm:^7.5.4" + ses: "npm:^1.13.1" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/7e9355dba4fcaab9ef4b720effea01d842e71801fbdca844016b6427beee728a0bcbd140265da0121d40b3d038530d1e9264ee94edff3a9ca7a5393a2f8e60fa + languageName: node + linkType: hard + +"@metamask/snaps-utils@file:../snaps-utils::locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-webpack-plugin%2540file%253A..%252Fsnaps-webpack-plugin%2523..%252Fsnaps-webpack-plugin%253A%253Ahash%253D6d5d29%2526locator%253D%252540metamask%25252Fsnaps-cli%252540workspace%25253Apackages%25252Fsnaps-cli": + version: 11.0.0 + resolution: "@metamask/snaps-utils@file:../snaps-utils#../snaps-utils::hash=8f965c&locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-webpack-plugin%2540file%253A..%252Fsnaps-webpack-plugin%2523..%252Fsnaps-webpack-plugin%253A%253Ahash%253D6d5d29%2526locator%253D%252540metamask%25252Fsnaps-cli%252540workspace%25253Apackages%25252Fsnaps-cli" + dependencies: + "@babel/core": "npm:^7.23.2" + "@babel/types": "npm:^7.23.0" + "@metamask/base-controller": "npm:^8.0.1" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/slip44": "npm:^4.2.0" + "@metamask/snaps-registry": "npm:^3.2.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + "@scure/base": "npm:^1.1.1" + chalk: "npm:^4.1.2" + cron-parser: "npm:^4.5.0" + fast-deep-equal: "npm:^3.1.3" + fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.4.1" + luxon: "npm:^3.5.0" + marked: "npm:^12.0.1" + rfdc: "npm:^1.3.0" + semver: "npm:^7.5.4" + ses: "npm:^1.13.1" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/7e9355dba4fcaab9ef4b720effea01d842e71801fbdca844016b6427beee728a0bcbd140265da0121d40b3d038530d1e9264ee94edff3a9ca7a5393a2f8e60fa + languageName: node + linkType: hard + +"@metamask/snaps-utils@file:../snaps-utils::locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-webpack-plugin%2540workspace%253Apackages%252Fsnaps-webpack-plugin": + version: 11.0.0 + resolution: "@metamask/snaps-utils@file:../snaps-utils#../snaps-utils::hash=8f965c&locator=%40metamask%2Fsnaps-rpc-methods%40file%3A..%2Fsnaps-rpc-methods%23..%2Fsnaps-rpc-methods%3A%3Ahash%3D81db32%26locator%3D%2540metamask%252Fsnaps-webpack-plugin%2540workspace%253Apackages%252Fsnaps-webpack-plugin" + dependencies: + "@babel/core": "npm:^7.23.2" + "@babel/types": "npm:^7.23.0" + "@metamask/base-controller": "npm:^8.0.1" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/slip44": "npm:^4.2.0" + "@metamask/snaps-registry": "npm:^3.2.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + "@scure/base": "npm:^1.1.1" + chalk: "npm:^4.1.2" + cron-parser: "npm:^4.5.0" + fast-deep-equal: "npm:^3.1.3" + fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.4.1" + luxon: "npm:^3.5.0" + marked: "npm:^12.0.1" + rfdc: "npm:^1.3.0" + semver: "npm:^7.5.4" + ses: "npm:^1.13.1" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/7e9355dba4fcaab9ef4b720effea01d842e71801fbdca844016b6427beee728a0bcbd140265da0121d40b3d038530d1e9264ee94edff3a9ca7a5393a2f8e60fa + languageName: node + linkType: hard + +"@metamask/snaps-utils@file:../snaps-utils::locator=%40metamask%2Fsnaps-rpc-methods%40workspace%3Apackages%2Fsnaps-rpc-methods": + version: 11.0.0 + resolution: "@metamask/snaps-utils@file:../snaps-utils#../snaps-utils::hash=8f965c&locator=%40metamask%2Fsnaps-rpc-methods%40workspace%3Apackages%2Fsnaps-rpc-methods" + dependencies: + "@babel/core": "npm:^7.23.2" + "@babel/types": "npm:^7.23.0" + "@metamask/base-controller": "npm:^8.0.1" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/slip44": "npm:^4.2.0" + "@metamask/snaps-registry": "npm:^3.2.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + "@scure/base": "npm:^1.1.1" + chalk: "npm:^4.1.2" + cron-parser: "npm:^4.5.0" + fast-deep-equal: "npm:^3.1.3" + fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.4.1" + luxon: "npm:^3.5.0" + marked: "npm:^12.0.1" + rfdc: "npm:^1.3.0" + semver: "npm:^7.5.4" + ses: "npm:^1.13.1" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/7e9355dba4fcaab9ef4b720effea01d842e71801fbdca844016b6427beee728a0bcbd140265da0121d40b3d038530d1e9264ee94edff3a9ca7a5393a2f8e60fa + languageName: node + linkType: hard + +"@metamask/snaps-utils@file:../snaps-utils::locator=%40metamask%2Fsnaps-webpack-plugin%40file%3A..%2Fsnaps-webpack-plugin%23..%2Fsnaps-webpack-plugin%3A%3Ahash%3D6d5d29%26locator%3D%2540metamask%252Fsnaps-cli%2540workspace%253Apackages%252Fsnaps-cli": + version: 11.0.0 + resolution: "@metamask/snaps-utils@file:../snaps-utils#../snaps-utils::hash=8f965c&locator=%40metamask%2Fsnaps-webpack-plugin%40file%3A..%2Fsnaps-webpack-plugin%23..%2Fsnaps-webpack-plugin%3A%3Ahash%3D6d5d29%26locator%3D%2540metamask%252Fsnaps-cli%2540workspace%253Apackages%252Fsnaps-cli" + dependencies: + "@babel/core": "npm:^7.23.2" + "@babel/types": "npm:^7.23.0" + "@metamask/base-controller": "npm:^8.0.1" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/slip44": "npm:^4.2.0" + "@metamask/snaps-registry": "npm:^3.2.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + "@scure/base": "npm:^1.1.1" + chalk: "npm:^4.1.2" + cron-parser: "npm:^4.5.0" + fast-deep-equal: "npm:^3.1.3" + fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.4.1" + luxon: "npm:^3.5.0" + marked: "npm:^12.0.1" + rfdc: "npm:^1.3.0" + semver: "npm:^7.5.4" + ses: "npm:^1.13.1" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/7e9355dba4fcaab9ef4b720effea01d842e71801fbdca844016b6427beee728a0bcbd140265da0121d40b3d038530d1e9264ee94edff3a9ca7a5393a2f8e60fa + languageName: node + linkType: hard + +"@metamask/snaps-utils@file:../snaps-utils::locator=%40metamask%2Fsnaps-webpack-plugin%40workspace%3Apackages%2Fsnaps-webpack-plugin": + version: 11.0.0 + resolution: "@metamask/snaps-utils@file:../snaps-utils#../snaps-utils::hash=8f965c&locator=%40metamask%2Fsnaps-webpack-plugin%40workspace%3Apackages%2Fsnaps-webpack-plugin" + dependencies: + "@babel/core": "npm:^7.23.2" + "@babel/types": "npm:^7.23.0" + "@metamask/base-controller": "npm:^8.0.1" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/slip44": "npm:^4.2.0" + "@metamask/snaps-registry": "npm:^3.2.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + "@scure/base": "npm:^1.1.1" + chalk: "npm:^4.1.2" + cron-parser: "npm:^4.5.0" + fast-deep-equal: "npm:^3.1.3" + fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.4.1" + luxon: "npm:^3.5.0" + marked: "npm:^12.0.1" + rfdc: "npm:^1.3.0" + semver: "npm:^7.5.4" + ses: "npm:^1.13.1" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/7e9355dba4fcaab9ef4b720effea01d842e71801fbdca844016b6427beee728a0bcbd140265da0121d40b3d038530d1e9264ee94edff3a9ca7a5393a2f8e60fa + languageName: node + linkType: hard + +"@metamask/snaps-utils@workspace:^, @metamask/snaps-utils@workspace:packages/snaps-utils": + version: 0.0.0-use.local + resolution: "@metamask/snaps-utils@workspace:packages/snaps-utils" + dependencies: + "@babel/core": "npm:^7.23.2" + "@babel/types": "npm:^7.23.0" + "@lavamoat/allow-scripts": "npm:^3.3.4" + "@metamask/auto-changelog": "npm:^5.0.2" + "@metamask/base-controller": "npm:^8.0.1" + "@metamask/key-tree": "npm:^10.1.1" + "@metamask/permission-controller": "npm:^11.0.6" + "@metamask/post-message-stream": "npm:^10.0.0" + "@metamask/rpc-errors": "npm:^7.0.3" + "@metamask/slip44": "npm:^4.2.0" + "@metamask/snaps-registry": "npm:^3.2.3" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/superstruct": "npm:^3.2.1" + "@metamask/utils": "npm:^11.4.2" + "@noble/hashes": "npm:^1.7.1" + "@scure/base": "npm:^1.1.1" + "@swc/core": "npm:1.11.31" + "@swc/jest": "npm:^0.2.38" + "@testing-library/dom": "npm:^10.4.0" + "@ts-bridge/cli": "npm:^0.6.1" + "@types/jest": "npm:^27.5.1" + "@types/luxon": "npm:^3" + "@types/node": "npm:18.14.2" + "@types/semver": "npm:^7.5.0" + "@types/validate-npm-package-name": "npm:^4.0.0" + "@vitest/browser": "npm:^3.1.1" + "@vitest/coverage-istanbul": "npm:3.1.1" + chalk: "npm:^4.1.2" + cron-parser: "npm:^4.5.0" + deepmerge: "npm:^4.2.2" + depcheck: "npm:^1.4.7" + eslint: "npm:^9.11.0" + fast-deep-equal: "npm:^3.1.3" + fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.4.1" + jest: "npm:^29.0.2" + jest-fetch-mock: "npm:^3.0.3" + jest-silent-reporter: "npm:^0.6.0" + luxon: "npm:^3.5.0" + marked: "npm:^12.0.1" + memfs: "npm:^3.4.13" + prettier: "npm:^3.3.3" + rfdc: "npm:^1.3.0" + rimraf: "npm:^4.1.2" + semver: "npm:^7.5.4" + ses: "npm:^1.13.1" + tsx: "npm:^4.20.3" + typescript: "npm:~5.3.3" + validate-npm-package-name: "npm:^5.0.0" + vite: "npm:^6.2.7" + vite-plugin-node-polyfills: "npm:^0.23.0" + vite-tsconfig-paths: "npm:^4.0.5" + vitest: "npm:^3.1.1" + languageName: unknown + linkType: soft + +"@metamask/snaps-webpack-plugin@file:../snaps-webpack-plugin::locator=%40metamask%2Fsnaps-cli%40workspace%3Apackages%2Fsnaps-cli": + version: 5.0.0 + resolution: "@metamask/snaps-webpack-plugin@file:../snaps-webpack-plugin#../snaps-webpack-plugin::hash=6d5d29&locator=%40metamask%2Fsnaps-cli%40workspace%3Apackages%2Fsnaps-cli" + dependencies: + "@metamask/snaps-rpc-methods": "file:../snaps-rpc-methods" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/snaps-utils": "file:../snaps-utils" + "@metamask/utils": "npm:^11.4.2" + chalk: "npm:^4.1.2" + webpack-sources: "npm:^3.2.3" + checksum: 10/ceb364c344512a2614048bced9f10c555cab6c803726f25835d635487793e0881e4c032321ce9bc55057c1dbdddd9aa0ca6031930c7e646d20d99b4812eae882 + languageName: node + linkType: hard + +"@metamask/snaps-webpack-plugin@workspace:^, @metamask/snaps-webpack-plugin@workspace:packages/snaps-webpack-plugin": + version: 0.0.0-use.local + resolution: "@metamask/snaps-webpack-plugin@workspace:packages/snaps-webpack-plugin" + dependencies: + "@lavamoat/allow-scripts": "npm:^3.3.4" + "@metamask/auto-changelog": "npm:^5.0.2" + "@metamask/snaps-rpc-methods": "file:../snaps-rpc-methods" + "@metamask/snaps-sdk": "file:../snaps-sdk" + "@metamask/snaps-utils": "file:../snaps-utils" + "@metamask/utils": "npm:^11.4.2" + "@swc/core": "npm:1.11.31" + "@swc/jest": "npm:^0.2.38" + "@ts-bridge/cli": "npm:^0.6.1" + "@types/jest": "npm:^27.5.1" + "@types/webpack-sources": "npm:^3.2.0" + chalk: "npm:^4.1.2" + deepmerge: "npm:^4.2.2" + depcheck: "npm:^1.4.7" + eslint: "npm:^9.11.0" + jest: "npm:^29.0.2" + jest-it-up: "npm:^2.0.0" + jest-silent-reporter: "npm:^0.6.0" + memfs: "npm:^3.4.13" + prettier: "npm:^3.3.3" + typescript: "npm:~5.3.3" + webpack: "npm:^5.97.1" + webpack-sources: "npm:^3.2.3" + languageName: unknown + linkType: soft + +"@metamask/superstruct@npm:^3.1.0, @metamask/superstruct@npm:^3.2.1": + version: 3.2.1 + resolution: "@metamask/superstruct@npm:3.2.1" + checksum: 10/9e29380f2cf8b129283ccb2b568296d92682b705109ba62dbd7739ffd6a1982fe38c7228cdcf3cbee94dbcdd5fcc1c846ab9d1dd3582167154f914422fcff547 + languageName: node + linkType: hard + +"@metamask/template-snap@npm:^0.7.0": + version: 0.7.0 + resolution: "@metamask/template-snap@npm:0.7.0" + checksum: 10/70f11ec66945be906c22ea9f66e39624e5f7b7ae6b1e913bf2067e3278ed71ebe63953bb89146dcf7add21fc0815b895076c82d8a2af396029f06d2381eeacf9 + languageName: node + linkType: hard + +"@metamask/test-snaps@workspace:packages/test-snaps": + version: 0.0.0-use.local + resolution: "@metamask/test-snaps@workspace:packages/test-snaps" + dependencies: + "@metamask/auto-changelog": "npm:^5.0.2" + "@metamask/background-events-example-snap": "workspace:^" + "@metamask/bip32-example-snap": "workspace:^" + "@metamask/bip44-example-snap": "workspace:^" + "@metamask/client-status-example-snap": "workspace:^" + "@metamask/cronjob-duration-example-snap": "workspace:^" + "@metamask/cronjob-example-snap": "workspace:^" + "@metamask/dialog-example-snap": "workspace:^" + "@metamask/error-example-snap": "workspace:^" + "@metamask/ethereum-provider-example-snap": "workspace:^" + "@metamask/ethers-js-example-snap": "workspace:^" + "@metamask/file-upload-example-snap": "workspace:^" + "@metamask/get-entropy-example-snap": "workspace:^" + "@metamask/get-file-example-snap": "workspace:^" + "@metamask/home-page-example-snap": "workspace:^" + "@metamask/images-example-snap": "workspace:^" "@metamask/insights-example-snap": "workspace:^" "@metamask/interactive-ui-example-snap": "workspace:^" "@metamask/json-rpc-example-snap": "workspace:^" @@ -4738,6 +5416,31 @@ __metadata: languageName: unknown linkType: soft +"@metamask/transaction-details-insights-example-snap@workspace:packages/examples/packages/transaction-details-insights": + version: 0.0.0-use.local + resolution: "@metamask/transaction-details-insights-example-snap@workspace:packages/examples/packages/transaction-details-insights" + dependencies: + "@jest/globals": "npm:^29.5.0" + "@lavamoat/allow-scripts": "npm:^3.3.4" + "@metamask/auto-changelog": "npm:^5.0.2" + "@metamask/snaps-cli": "workspace:^" + "@metamask/snaps-jest": "workspace:^" + "@metamask/snaps-sdk": "workspace:^" + "@metamask/utils": "npm:^11.4.2" + "@swc/core": "npm:1.11.31" + "@swc/jest": "npm:^0.2.38" + "@types/node": "npm:18.14.2" + deepmerge: "npm:^4.2.2" + depcheck: "npm:^1.4.7" + eslint: "npm:^9.11.0" + jest: "npm:^29.0.2" + jest-silent-reporter: "npm:^0.6.0" + prettier: "npm:^3.3.3" + ts-node: "npm:^10.9.1" + typescript: "npm:~5.3.3" + languageName: unknown + linkType: soft + "@metamask/utils@npm:^11.0.1, @metamask/utils@npm:^11.1.0, @metamask/utils@npm:^11.2.0, @metamask/utils@npm:^11.4.0, @metamask/utils@npm:^11.4.2": version: 11.4.2 resolution: "@metamask/utils@npm:11.4.2"