From 33a9c94c94de90f6038571c1de0fea6ee7dac9af Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Fri, 6 Sep 2024 18:08:44 +0200 Subject: [PATCH 01/31] feat(keyring-utils): add new package @metamask/keyring-utils --- .eslintrc.js | 10 + packages/keyring-api/package.json | 10 +- packages/keyring-api/src/JsonRpcRequest.ts | 2 +- packages/keyring-api/src/KeyringClient.ts | 2 +- packages/keyring-api/src/api/account.ts | 4 +- packages/keyring-api/src/api/balance.ts | 4 +- packages/keyring-api/src/api/caip.ts | 3 +- packages/keyring-api/src/api/request.ts | 4 +- packages/keyring-api/src/api/response.ts | 3 +- packages/keyring-api/src/btc/types.ts | 2 +- packages/keyring-api/src/eth/erc4337/types.ts | 3 +- packages/keyring-api/src/eth/types.test.ts | 2 +- packages/keyring-api/src/eth/types.ts | 2 +- packages/keyring-api/src/index.ts | 1 - packages/keyring-api/src/internal/api.ts | 5 +- packages/keyring-api/src/internal/events.ts | 3 +- packages/keyring-api/src/internal/types.ts | 2 +- packages/keyring-api/src/sol/types.ts | 2 +- packages/keyring-api/tsconfig.build.json | 1 + packages/keyring-utils/CHANGELOG.md | 10 + packages/keyring-utils/README.md | 15 + packages/keyring-utils/jest.config.js | 28 + packages/keyring-utils/package.json | 88 ++ .../src/utils => keyring-utils/src}/index.ts | 1 + .../src/superstruct.test-d.ts | 0 .../src/superstruct.test.ts | 0 .../src/superstruct.ts | 0 .../utils => keyring-utils/src}/types.test.ts | 0 .../src/utils => keyring-utils/src}/types.ts | 2 +- .../src}/typing.test-d.ts | 0 .../src}/typing.test.ts | 0 .../src/utils => keyring-utils/src}/typing.ts | 0 packages/keyring-utils/tsconfig.build.json | 13 + packages/keyring-utils/tsconfig.json | 8 + packages/keyring-utils/typedoc.json | 6 + tsconfig.json | 1 + yarn.lock | 1063 ++++++++++++++++- 37 files changed, 1251 insertions(+), 49 deletions(-) create mode 100644 packages/keyring-utils/CHANGELOG.md create mode 100644 packages/keyring-utils/README.md create mode 100644 packages/keyring-utils/jest.config.js create mode 100644 packages/keyring-utils/package.json rename packages/{keyring-api/src/utils => keyring-utils/src}/index.ts (62%) rename packages/{keyring-api => keyring-utils}/src/superstruct.test-d.ts (100%) rename packages/{keyring-api => keyring-utils}/src/superstruct.test.ts (100%) rename packages/{keyring-api => keyring-utils}/src/superstruct.ts (100%) rename packages/{keyring-api/src/utils => keyring-utils/src}/types.test.ts (100%) rename packages/{keyring-api/src/utils => keyring-utils/src}/types.ts (94%) rename packages/{keyring-api/src/utils => keyring-utils/src}/typing.test-d.ts (100%) rename packages/{keyring-api/src/utils => keyring-utils/src}/typing.test.ts (100%) rename packages/{keyring-api/src/utils => keyring-utils/src}/typing.ts (100%) create mode 100644 packages/keyring-utils/tsconfig.build.json create mode 100644 packages/keyring-utils/tsconfig.json create mode 100644 packages/keyring-utils/typedoc.json diff --git a/.eslintrc.js b/.eslintrc.js index c378adac..9f8f213f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -66,6 +66,16 @@ module.exports = { '@typescript-eslint/naming-convention': 'warn', }, }, + // @metamask/keyring-utils + { + files: ['packages/keyring-utils/src/**/*.ts'], + extends: ['@metamask/eslint-config-typescript'], + parserOptions, + rules: { + // TODO: re-lint everything once the migration is done + '@typescript-eslint/no-explicit-any': 'off', + }, + }, // @metamask/keyring-api { files: ['packages/keyring-api/src/**/*.ts'], diff --git a/packages/keyring-api/package.json b/packages/keyring-api/package.json index 50b38919..65b495ea 100644 --- a/packages/keyring-api/package.json +++ b/packages/keyring-api/package.json @@ -46,18 +46,17 @@ "test:watch": "jest --watch" }, "dependencies": { - "@metamask/snaps-sdk": "^6.7.0", + "@metamask/keyring-utils": "workspace:^", "@metamask/superstruct": "^3.1.0", "@metamask/utils": "^9.2.1", - "@types/uuid": "^9.0.8", "bech32": "^2.0.0", - "uuid": "^9.0.1", - "webextension-polyfill": "^0.12.0" + "uuid": "^9.0.1" }, "devDependencies": { "@lavamoat/allow-scripts": "^3.2.1", "@lavamoat/preinstall-always-fail": "^2.1.0", "@metamask/auto-changelog": "^3.4.4", + "@metamask/keyring-utils": "workspace:^", "@metamask/providers": "^18.1.0", "@ts-bridge/cli": "^0.6.0", "@types/jest": "^29.5.12", @@ -73,9 +72,6 @@ "typedoc": "^0.25.13", "typescript": "~5.6.3" }, - "peerDependencies": { - "@metamask/providers": "^18.1.0" - }, "engines": { "node": "^18.18 || >=20" }, diff --git a/packages/keyring-api/src/JsonRpcRequest.ts b/packages/keyring-api/src/JsonRpcRequest.ts index 16f80c81..b9ce8403 100644 --- a/packages/keyring-api/src/JsonRpcRequest.ts +++ b/packages/keyring-api/src/JsonRpcRequest.ts @@ -9,7 +9,7 @@ import { import type { Infer } from '@metamask/superstruct'; import { JsonStruct } from '@metamask/utils'; -import { exactOptional, object } from './superstruct'; +import { exactOptional, object } from '@metamask/keyring-utils'; export const JsonRpcRequestStruct = object({ jsonrpc: literal('2.0'), diff --git a/packages/keyring-api/src/KeyringClient.ts b/packages/keyring-api/src/KeyringClient.ts index 6de1d432..4c570572 100644 --- a/packages/keyring-api/src/KeyringClient.ts +++ b/packages/keyring-api/src/KeyringClient.ts @@ -28,7 +28,7 @@ import { } from './internal/api'; import { KeyringRpcMethod } from './internal/rpc'; import type { JsonRpcRequest } from './JsonRpcRequest'; -import { strictMask } from './superstruct'; +import { strictMask } from '@metamask/keyring-utils'; export type Sender = { send(request: JsonRpcRequest): Promise; diff --git a/packages/keyring-api/src/api/account.ts b/packages/keyring-api/src/api/account.ts index 68a48524..52f465e9 100644 --- a/packages/keyring-api/src/api/account.ts +++ b/packages/keyring-api/src/api/account.ts @@ -1,10 +1,8 @@ +import { object, UuidStruct } from '@metamask/keyring-utils'; import type { Infer } from '@metamask/superstruct'; import { array, enums, record, string } from '@metamask/superstruct'; import { JsonStruct } from '@metamask/utils'; -import { object } from '../superstruct'; -import { UuidStruct } from '../utils'; - /** * Supported Ethereum account types. */ diff --git a/packages/keyring-api/src/api/balance.ts b/packages/keyring-api/src/api/balance.ts index 609108e8..32b7573f 100644 --- a/packages/keyring-api/src/api/balance.ts +++ b/packages/keyring-api/src/api/balance.ts @@ -1,9 +1,7 @@ +import { object, StringNumberStruct } from '@metamask/keyring-utils'; import type { Infer } from '@metamask/superstruct'; import { string } from '@metamask/superstruct'; -import { object } from '../superstruct'; -import { StringNumberStruct } from '../utils'; - export const BalanceStruct = object({ amount: StringNumberStruct, unit: string(), diff --git a/packages/keyring-api/src/api/caip.ts b/packages/keyring-api/src/api/caip.ts index 2008200d..dd41a8b8 100644 --- a/packages/keyring-api/src/api/caip.ts +++ b/packages/keyring-api/src/api/caip.ts @@ -1,7 +1,6 @@ +import { definePattern } from '@metamask/keyring-utils'; import { is, type Infer } from '@metamask/superstruct'; -import { definePattern } from '../superstruct'; - const CAIP_ASSET_TYPE_REGEX = /^(?(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32}))\/(?[-a-z0-9]{3,8}):(?[-.%a-zA-Z0-9]{1,128})$/u; diff --git a/packages/keyring-api/src/api/request.ts b/packages/keyring-api/src/api/request.ts index db2609af..3b3c4c72 100644 --- a/packages/keyring-api/src/api/request.ts +++ b/packages/keyring-api/src/api/request.ts @@ -1,10 +1,8 @@ +import { exactOptional, object, UuidStruct } from '@metamask/keyring-utils'; import type { Infer } from '@metamask/superstruct'; import { array, record, string, union } from '@metamask/superstruct'; import { JsonStruct } from '@metamask/utils'; -import { exactOptional, object } from '../superstruct'; -import { UuidStruct } from '../utils'; - export const KeyringRequestStruct = object({ /** * Keyring request ID (UUIDv4). diff --git a/packages/keyring-api/src/api/response.ts b/packages/keyring-api/src/api/response.ts index dbe2e0b4..154dd815 100644 --- a/packages/keyring-api/src/api/response.ts +++ b/packages/keyring-api/src/api/response.ts @@ -1,9 +1,8 @@ +import { exactOptional, object } from '@metamask/keyring-utils'; import type { Infer } from '@metamask/superstruct'; import { literal, string, union } from '@metamask/superstruct'; import { JsonStruct } from '@metamask/utils'; -import { exactOptional, object } from '../superstruct'; - export const KeyringResponseStruct = union([ object({ /** diff --git a/packages/keyring-api/src/btc/types.ts b/packages/keyring-api/src/btc/types.ts index 44c213cb..c5dd9b14 100644 --- a/packages/keyring-api/src/btc/types.ts +++ b/packages/keyring-api/src/btc/types.ts @@ -3,7 +3,7 @@ import { string, array, enums, refine, literal } from '@metamask/superstruct'; import { bech32 } from 'bech32'; import { KeyringAccountStruct, BtcAccountType } from '../api'; -import { object } from '../superstruct'; +import { object } from '@metamask/keyring-utils'; export const BtcP2wpkhAddressStruct = refine( string(), diff --git a/packages/keyring-api/src/eth/erc4337/types.ts b/packages/keyring-api/src/eth/erc4337/types.ts index ba92a384..df373d89 100644 --- a/packages/keyring-api/src/eth/erc4337/types.ts +++ b/packages/keyring-api/src/eth/erc4337/types.ts @@ -1,7 +1,6 @@ import { type Infer } from '@metamask/superstruct'; -import { exactOptional, object } from '../../superstruct'; -import { UrlStruct } from '../../utils'; +import { exactOptional, object, UrlStruct } from '@metamask/keyring-utils'; import { EthAddressStruct, EthBytesStruct, EthUint256Struct } from '../types'; /** diff --git a/packages/keyring-api/src/eth/types.test.ts b/packages/keyring-api/src/eth/types.test.ts index 5afc8012..8624052a 100644 --- a/packages/keyring-api/src/eth/types.test.ts +++ b/packages/keyring-api/src/eth/types.test.ts @@ -1,4 +1,4 @@ -import { UrlStruct } from '../utils'; +import { UrlStruct } from '@metamask/keyring-utils'; describe('types', () => { it('is a valid BundlerUrl', () => { diff --git a/packages/keyring-api/src/eth/types.ts b/packages/keyring-api/src/eth/types.ts index 2d28926b..2b702bb4 100644 --- a/packages/keyring-api/src/eth/types.ts +++ b/packages/keyring-api/src/eth/types.ts @@ -2,7 +2,7 @@ import type { Infer } from '@metamask/superstruct'; import { array, enums, literal } from '@metamask/superstruct'; import { EthAccountType, KeyringAccountStruct } from '../api'; -import { object, definePattern } from '../superstruct'; +import { object, definePattern } from '@metamask/keyring-utils'; export const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu); diff --git a/packages/keyring-api/src/index.ts b/packages/keyring-api/src/index.ts index f81807db..aead8e1d 100644 --- a/packages/keyring-api/src/index.ts +++ b/packages/keyring-api/src/index.ts @@ -10,4 +10,3 @@ export * from './KeyringClient'; export * from './KeyringSnapRpcClient'; export * from './rpc-handler'; export * from './snap-utils'; -export * from './superstruct'; diff --git a/packages/keyring-api/src/internal/api.ts b/packages/keyring-api/src/internal/api.ts index 341ca8f2..dbacdf64 100644 --- a/packages/keyring-api/src/internal/api.ts +++ b/packages/keyring-api/src/internal/api.ts @@ -9,7 +9,6 @@ import { } from '@metamask/superstruct'; import { JsonStruct } from '@metamask/utils'; -import { KeyringRpcMethod } from './rpc'; import { BalanceStruct, CaipAssetTypeStruct, @@ -18,8 +17,8 @@ import { KeyringRequestStruct, KeyringResponseStruct, } from '../api'; -import { object } from '../superstruct'; -import { UuidStruct } from '../utils'; +import { object, UuidStruct } from '@metamask/keyring-utils'; +import { KeyringRpcMethod } from './rpc'; const CommonHeader = { jsonrpc: literal('2.0'), diff --git a/packages/keyring-api/src/internal/events.ts b/packages/keyring-api/src/internal/events.ts index 9047ae26..fc014b5d 100644 --- a/packages/keyring-api/src/internal/events.ts +++ b/packages/keyring-api/src/internal/events.ts @@ -3,8 +3,7 @@ import { JsonStruct } from '@metamask/utils'; import { KeyringAccountStruct } from '../api'; import { KeyringEvent } from '../events'; -import { exactOptional, object } from '../superstruct'; -import { UuidStruct } from '../utils'; +import { exactOptional, object, UuidStruct } from '@metamask/keyring-utils'; export const AccountCreatedEventStruct = object({ method: literal(`${KeyringEvent.AccountCreated}`), diff --git a/packages/keyring-api/src/internal/types.ts b/packages/keyring-api/src/internal/types.ts index 401cc649..1b322981 100644 --- a/packages/keyring-api/src/internal/types.ts +++ b/packages/keyring-api/src/internal/types.ts @@ -10,7 +10,7 @@ import { import { BtcP2wpkhAccountStruct } from '../btc/types'; import { EthEoaAccountStruct, EthErc4337AccountStruct } from '../eth/types'; import { SolDataAccountStruct } from '../sol/types'; -import { exactOptional, object } from '../superstruct'; +import { exactOptional, object } from '@metamask/keyring-utils'; export type InternalAccountType = | EthAccountType diff --git a/packages/keyring-api/src/sol/types.ts b/packages/keyring-api/src/sol/types.ts index d01d9415..cef6504c 100644 --- a/packages/keyring-api/src/sol/types.ts +++ b/packages/keyring-api/src/sol/types.ts @@ -2,7 +2,7 @@ import type { Infer } from '@metamask/superstruct'; import { array, enums, literal } from '@metamask/superstruct'; import { KeyringAccountStruct, SolAccountType } from '../api'; -import { object, definePattern } from '../superstruct'; +import { object, definePattern } from '@metamask/keyring-utils'; /** * Solana addresses are represented in the format of a 256-bit ed25519 public key and diff --git a/packages/keyring-api/tsconfig.build.json b/packages/keyring-api/tsconfig.build.json index 054c9a64..22a03957 100644 --- a/packages/keyring-api/tsconfig.build.json +++ b/packages/keyring-api/tsconfig.build.json @@ -8,6 +8,7 @@ // checking for all *.d.ts files "skipLibCheck": true }, + "references": [{ "path": "../keyring-utils/tsconfig.build.json" }], "include": ["./src/**/*.ts"], "exclude": ["./src/**/*.test.ts", "./src/**/*.test-d.ts"] } diff --git a/packages/keyring-utils/CHANGELOG.md b/packages/keyring-utils/CHANGELOG.md new file mode 100644 index 00000000..f4eb4815 --- /dev/null +++ b/packages/keyring-utils/CHANGELOG.md @@ -0,0 +1,10 @@ +# 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] + +[Unreleased]: https://github.com/MetaMask/accounts/ diff --git a/packages/keyring-utils/README.md b/packages/keyring-utils/README.md new file mode 100644 index 00000000..210958b3 --- /dev/null +++ b/packages/keyring-utils/README.md @@ -0,0 +1,15 @@ +# MetaMask Keyring utils + +Various JavaScript/TypeScript utilities required by Keyrings. + +## Installation + +`yarn add @metamask/keyring-utils` + +or + +`npm install @metamask/keyring-utils` + +## Contributing + +This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/accounts#readme). diff --git a/packages/keyring-utils/jest.config.js b/packages/keyring-utils/jest.config.js new file mode 100644 index 00000000..d6e04ca7 --- /dev/null +++ b/packages/keyring-utils/jest.config.js @@ -0,0 +1,28 @@ +/* + * For a detailed explanation regarding each configuration property and type check, visit: + * https://jestjs.io/docs/configuration + */ + +const merge = require('deepmerge'); +const path = require('path'); + +const baseConfig = require('../../jest.config.packages'); + +const displayName = path.basename(__dirname); + +module.exports = merge(baseConfig, { + // The display name when running multiple projects + displayName, + + coveragePathIgnorePatterns: ['./src/tests'], + + // An object that configures minimum threshold enforcement for coverage results + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, +}); diff --git a/packages/keyring-utils/package.json b/packages/keyring-utils/package.json new file mode 100644 index 00000000..bbaf745f --- /dev/null +++ b/packages/keyring-utils/package.json @@ -0,0 +1,88 @@ +{ + "name": "@metamask/keyring-utils", + "version": "0.0.1", + "description": "MetaMask Keyring utils", + "keywords": [ + "metamask", + "keyring" + ], + "homepage": "https://github.com/MetaMask/accounts/tree/main/packages/keyring-utils#readme", + "bugs": { + "url": "https://github.com/MetaMask/accounts/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/MetaMask/accounts.git" + }, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist/" + ], + "scripts": { + "build": "tsc --build tsconfig.build.json", + "build:clean": "rimraf dist && yarn build", + "build:docs": "typedoc", + "build:force": "tsc --build tsconfig.build.json --force", + "changelog:update": "../../scripts/update-changelog.sh @metamask/keyring-utils", + "changelog:validate": "../../scripts/validate-changelog.sh @metamask/keyring-utils", + "publish:preview": "yarn npm publish --tag preview", + "test": "yarn test:source && yarn test:types", + "test:clean": "jest --clearCache", + "test:source": "jest && jest-it-up", + "test:types": "tsd", + "test:verbose": "jest --verbose", + "test:watch": "jest --watch" + }, + "dependencies": { + "@metamask/superstruct": "^3.1.0", + "@metamask/utils": "^9.2.1", + "@types/uuid": "^9.0.8", + "deepmerge": "^4.2.2", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@lavamoat/allow-scripts": "^3.2.1", + "@lavamoat/preinstall-always-fail": "^2.1.0", + "@metamask/auto-changelog": "^3.4.4", + "@ts-bridge/cli": "^0.6.0", + "@types/jest": "^29.5.12", + "@types/node": "^20.12.12", + "depcheck": "^1.4.7", + "jest": "^29.5.0", + "jest-it-up": "^3.1.0", + "rimraf": "^5.0.7", + "ts-jest": "^29.0.5", + "ts-node": "^10.9.2", + "tsd": "^0.31.0", + "typedoc": "^0.25.13", + "typescript": "~5.6.3" + }, + "engines": { + "node": "^18.18 || >=20" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "lavamoat": { + "allowScripts": { + "@lavamoat/preinstall-always-fail": false + } + }, + "tsd": { + "directory": "src" + } +} diff --git a/packages/keyring-api/src/utils/index.ts b/packages/keyring-utils/src/index.ts similarity index 62% rename from packages/keyring-api/src/utils/index.ts rename to packages/keyring-utils/src/index.ts index 8043a4ee..e1bc4c61 100644 --- a/packages/keyring-api/src/utils/index.ts +++ b/packages/keyring-utils/src/index.ts @@ -1,2 +1,3 @@ export * from './types'; export * from './typing'; +export * from './superstruct'; diff --git a/packages/keyring-api/src/superstruct.test-d.ts b/packages/keyring-utils/src/superstruct.test-d.ts similarity index 100% rename from packages/keyring-api/src/superstruct.test-d.ts rename to packages/keyring-utils/src/superstruct.test-d.ts diff --git a/packages/keyring-api/src/superstruct.test.ts b/packages/keyring-utils/src/superstruct.test.ts similarity index 100% rename from packages/keyring-api/src/superstruct.test.ts rename to packages/keyring-utils/src/superstruct.test.ts diff --git a/packages/keyring-api/src/superstruct.ts b/packages/keyring-utils/src/superstruct.ts similarity index 100% rename from packages/keyring-api/src/superstruct.ts rename to packages/keyring-utils/src/superstruct.ts diff --git a/packages/keyring-api/src/utils/types.test.ts b/packages/keyring-utils/src/types.test.ts similarity index 100% rename from packages/keyring-api/src/utils/types.test.ts rename to packages/keyring-utils/src/types.test.ts diff --git a/packages/keyring-api/src/utils/types.ts b/packages/keyring-utils/src/types.ts similarity index 94% rename from packages/keyring-api/src/utils/types.ts rename to packages/keyring-utils/src/types.ts index 02821e14..56ce5690 100644 --- a/packages/keyring-api/src/utils/types.ts +++ b/packages/keyring-utils/src/types.ts @@ -1,6 +1,6 @@ import { define, type Infer } from '@metamask/superstruct'; -import { definePattern } from '../superstruct'; +import { definePattern } from './superstruct'; /** * UUIDv4 struct. diff --git a/packages/keyring-api/src/utils/typing.test-d.ts b/packages/keyring-utils/src/typing.test-d.ts similarity index 100% rename from packages/keyring-api/src/utils/typing.test-d.ts rename to packages/keyring-utils/src/typing.test-d.ts diff --git a/packages/keyring-api/src/utils/typing.test.ts b/packages/keyring-utils/src/typing.test.ts similarity index 100% rename from packages/keyring-api/src/utils/typing.test.ts rename to packages/keyring-utils/src/typing.test.ts diff --git a/packages/keyring-api/src/utils/typing.ts b/packages/keyring-utils/src/typing.ts similarity index 100% rename from packages/keyring-api/src/utils/typing.ts rename to packages/keyring-utils/src/typing.ts diff --git a/packages/keyring-utils/tsconfig.build.json b/packages/keyring-utils/tsconfig.build.json new file mode 100644 index 00000000..054c9a64 --- /dev/null +++ b/packages/keyring-utils/tsconfig.build.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.packages.build.json", + "compilerOptions": { + "baseUrl": "./", + "outDir": "dist", + "rootDir": "src", + // FIXME: We should investigate how to get rid of this flag, as this will turn off type + // checking for all *.d.ts files + "skipLibCheck": true + }, + "include": ["./src/**/*.ts"], + "exclude": ["./src/**/*.test.ts", "./src/**/*.test-d.ts"] +} diff --git a/packages/keyring-utils/tsconfig.json b/packages/keyring-utils/tsconfig.json new file mode 100644 index 00000000..bba26c34 --- /dev/null +++ b/packages/keyring-utils/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.packages.json", + "compilerOptions": { + "baseUrl": "./" + }, + "include": ["./src"], + "exclude": ["./dist/**/*"] +} diff --git a/packages/keyring-utils/typedoc.json b/packages/keyring-utils/typedoc.json new file mode 100644 index 00000000..b527b625 --- /dev/null +++ b/packages/keyring-utils/typedoc.json @@ -0,0 +1,6 @@ +{ + "entryPoints": ["./src/index.ts"], + "excludePrivate": true, + "hideGenerator": true, + "out": "docs" +} diff --git a/tsconfig.json b/tsconfig.json index 33078b77..83f81d4a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,7 @@ { "path": "./packages/keyring-eth-simple" }, { "path": "./packages/keyring-eth-trezor" }, { "path": "./packages/keyring-snap-bridge" } + { "path": "./packages/keyring-utils" } ], "files": [], "include": [] diff --git a/yarn.lock b/yarn.lock index 768887a2..ceb86b0c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,6 +32,17 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.25.9": + version: 7.26.2 + resolution: "@babel/code-frame@npm:7.26.2" + dependencies: + "@babel/helper-validator-identifier": "npm:^7.25.9" + js-tokens: "npm:^4.0.0" + picocolors: "npm:^1.0.0" + checksum: 10/db2c2122af79d31ca916755331bb4bac96feb2b334cdaca5097a6b467fdd41963b89b14b6836a14f083de7ff887fc78fa1b3c10b14e743d33e12dbfe5ee3d223 + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.25.2": version: 7.25.4 resolution: "@babel/compat-data@npm:7.25.4" @@ -74,6 +85,19 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.25.9": + version: 7.26.2 + resolution: "@babel/generator@npm:7.26.2" + dependencies: + "@babel/parser": "npm:^7.26.2" + "@babel/types": "npm:^7.26.0" + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.25" + jsesc: "npm:^3.0.2" + checksum: 10/71ace82b5b07a554846a003624bfab93275ccf73cdb9f1a37a4c1094bf9dc94bb677c67e8b8c939dbd6c5f0eda2e8f268aa2b0d9c3b9511072565660e717e045 + languageName: node + linkType: hard + "@babel/helper-annotate-as-pure@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-annotate-as-pure@npm:7.24.7" @@ -203,6 +227,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-string-parser@npm:7.25.9" + checksum: 10/c28656c52bd48e8c1d9f3e8e68ecafd09d949c57755b0d353739eb4eae7ba4f7e67e92e4036f1cd43378cc1397a2c943ed7bcaf5949b04ab48607def0258b775 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-validator-identifier@npm:7.24.7" @@ -210,6 +241,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-validator-identifier@npm:7.25.9" + checksum: 10/3f9b649be0c2fd457fa1957b694b4e69532a668866b8a0d81eabfa34ba16dbf3107b39e0e7144c55c3c652bf773ec816af8df4a61273a2bb4eb3145ca9cf478e + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.24.7, @babel/helper-validator-option@npm:^7.24.8": version: 7.24.8 resolution: "@babel/helper-validator-option@npm:7.24.8" @@ -250,6 +288,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.2": + version: 7.26.2 + resolution: "@babel/parser@npm:7.26.2" + dependencies: + "@babel/types": "npm:^7.26.0" + bin: + parser: ./bin/babel-parser.js + checksum: 10/8baee43752a3678ad9f9e360ec845065eeee806f1fdc8e0f348a8a0e13eef0959dabed4a197c978896c493ea205c804d0a1187cc52e4a1ba017c7935bab4983d + languageName: node + linkType: hard + "@babel/plugin-syntax-async-generators@npm:^7.8.4": version: 7.8.4 resolution: "@babel/plugin-syntax-async-generators@npm:7.8.4" @@ -467,6 +516,17 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/template@npm:7.25.9" + dependencies: + "@babel/code-frame": "npm:^7.25.9" + "@babel/parser": "npm:^7.25.9" + "@babel/types": "npm:^7.25.9" + checksum: 10/e861180881507210150c1335ad94aff80fd9e9be6202e1efa752059c93224e2d5310186ddcdd4c0f0b0fc658ce48cb47823f15142b5c00c8456dde54f5de80b2 + languageName: node + linkType: hard + "@babel/traverse@npm:^7.23.2, @babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.24.8, @babel/traverse@npm:^7.25.0, @babel/traverse@npm:^7.25.2, @babel/traverse@npm:^7.25.4": version: 7.25.4 resolution: "@babel/traverse@npm:7.25.4" @@ -482,6 +542,21 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.7.2": + version: 7.25.9 + resolution: "@babel/traverse@npm:7.25.9" + dependencies: + "@babel/code-frame": "npm:^7.25.9" + "@babel/generator": "npm:^7.25.9" + "@babel/parser": "npm:^7.25.9" + "@babel/template": "npm:^7.25.9" + "@babel/types": "npm:^7.25.9" + debug: "npm:^4.3.1" + globals: "npm:^11.1.0" + checksum: 10/7431614d76d4a053e429208db82f2846a415833f3d9eb2e11ef72eeb3c64dfd71f4a4d983de1a4a047b36165a1f5a64de8ca2a417534cc472005c740ffcb9c6a + languageName: node + linkType: hard + "@babel/types@npm:^7.0.0, @babel/types@npm:^7.23.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.24.8, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.25.4, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3": version: 7.25.4 resolution: "@babel/types@npm:7.25.4" @@ -493,6 +568,16 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0": + version: 7.26.0 + resolution: "@babel/types@npm:7.26.0" + dependencies: + "@babel/helper-string-parser": "npm:^7.25.9" + "@babel/helper-validator-identifier": "npm:^7.25.9" + checksum: 10/40780741ecec886ed9edae234b5eb4976968cc70d72b4e5a40d55f83ff2cc457de20f9b0f4fe9d858350e43dab0ea496e7ef62e2b2f08df699481a76df02cd6e + languageName: node + linkType: hard + "@bcoe/v8-coverage@npm:^0.2.3": version: 0.2.3 resolution: "@bcoe/v8-coverage@npm:0.2.3" @@ -1154,6 +1239,20 @@ __metadata: languageName: node linkType: hard +"@jest/console@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/console@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + chalk: "npm:^4.0.0" + jest-message-util: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + slash: "npm:^3.0.0" + checksum: 10/82153eb24e61bd442bff350a7537d598e7c49097aabd9545b340582dcf1f17e5749baa342a67e564816a3a6ce746038b618ed9f66702140264bfa1e1d5cc9e5e + languageName: node + linkType: hard + "@jest/console@npm:^29.7.0": version: 29.7.0 resolution: "@jest/console@npm:29.7.0" @@ -1168,6 +1267,48 @@ __metadata: languageName: node linkType: hard +"@jest/core@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/core@npm:28.1.3" + dependencies: + "@jest/console": "npm:^28.1.3" + "@jest/reporters": "npm:^28.1.3" + "@jest/test-result": "npm:^28.1.3" + "@jest/transform": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + ansi-escapes: "npm:^4.2.1" + chalk: "npm:^4.0.0" + ci-info: "npm:^3.2.0" + exit: "npm:^0.1.2" + graceful-fs: "npm:^4.2.9" + jest-changed-files: "npm:^28.1.3" + jest-config: "npm:^28.1.3" + jest-haste-map: "npm:^28.1.3" + jest-message-util: "npm:^28.1.3" + jest-regex-util: "npm:^28.0.2" + jest-resolve: "npm:^28.1.3" + jest-resolve-dependencies: "npm:^28.1.3" + jest-runner: "npm:^28.1.3" + jest-runtime: "npm:^28.1.3" + jest-snapshot: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + jest-validate: "npm:^28.1.3" + jest-watcher: "npm:^28.1.3" + micromatch: "npm:^4.0.4" + pretty-format: "npm:^28.1.3" + rimraf: "npm:^3.0.0" + slash: "npm:^3.0.0" + strip-ansi: "npm:^6.0.0" + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + checksum: 10/72b56c7591dd1ec325c40e9f60f8111e17d4a09c918b7e5882de58ed1c656d6d34f085dfbdb49f65e6ac95b49919976c7b07821663cbcccd7f3a55c29db542b9 + languageName: node + linkType: hard + "@jest/core@npm:^29.7.0": version: 29.7.0 resolution: "@jest/core@npm:29.7.0" @@ -1209,6 +1350,18 @@ __metadata: languageName: node linkType: hard +"@jest/environment@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/environment@npm:28.1.3" + dependencies: + "@jest/fake-timers": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + jest-mock: "npm:^28.1.3" + checksum: 10/63a8efd099f8d5cd70398c7608d45fc91a5796b14d8f9f8c7fdb3a529e42004e3b60cf0c6e117cc88305d18ab7bb453f803a737e09293e9027a1e76ce835da57 + languageName: node + linkType: hard + "@jest/environment@npm:^29.7.0": version: 29.7.0 resolution: "@jest/environment@npm:29.7.0" @@ -1221,6 +1374,15 @@ __metadata: languageName: node linkType: hard +"@jest/expect-utils@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/expect-utils@npm:28.1.3" + dependencies: + jest-get-type: "npm:^28.0.2" + checksum: 10/f48e4c5b267438a565b6e4c00a06f2bd566dc65d8bb6114d57276ec1fa4f4cded548371e45caffe37c58e5cf3716dbec715c10cfacdae35c4c04b755d83fac96 + languageName: node + linkType: hard + "@jest/expect-utils@npm:^29.7.0": version: 29.7.0 resolution: "@jest/expect-utils@npm:29.7.0" @@ -1230,6 +1392,16 @@ __metadata: languageName: node linkType: hard +"@jest/expect@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/expect@npm:28.1.3" + dependencies: + expect: "npm:^28.1.3" + jest-snapshot: "npm:^28.1.3" + checksum: 10/31ea089e83a4c24f850043a97dfd777a352dd28a936819785f3d0de6e0bd537bfbfa8fd2df081db1adc68a6a55699e7d4ab3990d6a54e41753d86e5d2b66df2f + languageName: node + linkType: hard + "@jest/expect@npm:^29.7.0": version: 29.7.0 resolution: "@jest/expect@npm:29.7.0" @@ -1240,6 +1412,20 @@ __metadata: languageName: node linkType: hard +"@jest/fake-timers@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/fake-timers@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + "@sinonjs/fake-timers": "npm:^9.1.2" + "@types/node": "npm:*" + jest-message-util: "npm:^28.1.3" + jest-mock: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + checksum: 10/4002208f6637adc374175c97e845a19783f58874e9503fb956b801061ba1869a218964cf4631e1ac348e06e1667e982ceb94734db63ccfafdf37508f6b59be17 + languageName: node + linkType: hard + "@jest/fake-timers@npm:^29.7.0": version: 29.7.0 resolution: "@jest/fake-timers@npm:29.7.0" @@ -1254,6 +1440,17 @@ __metadata: languageName: node linkType: hard +"@jest/globals@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/globals@npm:28.1.3" + dependencies: + "@jest/environment": "npm:^28.1.3" + "@jest/expect": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + checksum: 10/3504bb23de629d466c6f2b6b75d2e1c1b10caccbbcfb7eaa82d22cc37711c8e364c243929581184846605c023b475ea6c42c2e3ea5994429a988d8d527af32cd + languageName: node + linkType: hard + "@jest/globals@npm:^29.7.0": version: 29.7.0 resolution: "@jest/globals@npm:29.7.0" @@ -1266,6 +1463,44 @@ __metadata: languageName: node linkType: hard +"@jest/reporters@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/reporters@npm:28.1.3" + dependencies: + "@bcoe/v8-coverage": "npm:^0.2.3" + "@jest/console": "npm:^28.1.3" + "@jest/test-result": "npm:^28.1.3" + "@jest/transform": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@jridgewell/trace-mapping": "npm:^0.3.13" + "@types/node": "npm:*" + chalk: "npm:^4.0.0" + collect-v8-coverage: "npm:^1.0.0" + exit: "npm:^0.1.2" + glob: "npm:^7.1.3" + graceful-fs: "npm:^4.2.9" + istanbul-lib-coverage: "npm:^3.0.0" + istanbul-lib-instrument: "npm:^5.1.0" + istanbul-lib-report: "npm:^3.0.0" + istanbul-lib-source-maps: "npm:^4.0.0" + istanbul-reports: "npm:^3.1.3" + jest-message-util: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + jest-worker: "npm:^28.1.3" + slash: "npm:^3.0.0" + string-length: "npm:^4.0.1" + strip-ansi: "npm:^6.0.0" + terminal-link: "npm:^2.0.0" + v8-to-istanbul: "npm:^9.0.1" + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + checksum: 10/bdce58bf1cf1fc0f7fb0c2ae02b5a9a1da32da83ee4697b2b23b8a5b0ac056af55dac07dcf7e869f963943e935da3bd26a788c478b6d52064c77320530d95a89 + languageName: node + linkType: hard + "@jest/reporters@npm:^29.7.0": version: 29.7.0 resolution: "@jest/reporters@npm:29.7.0" @@ -1303,6 +1538,15 @@ __metadata: languageName: node linkType: hard +"@jest/schemas@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/schemas@npm:28.1.3" + dependencies: + "@sinclair/typebox": "npm:^0.24.1" + checksum: 10/3cf1d4b66c9c4ffda58b246de1ddcba8e6ad085af63dccdf07922511f13b68c0cc480a7bc620cb4f3099a6f134801c747e1df7bfc7a4ef4dceefbdea3e31e1de + languageName: node + linkType: hard + "@jest/schemas@npm:^29.6.3": version: 29.6.3 resolution: "@jest/schemas@npm:29.6.3" @@ -1312,6 +1556,17 @@ __metadata: languageName: node linkType: hard +"@jest/source-map@npm:^28.1.2": + version: 28.1.2 + resolution: "@jest/source-map@npm:28.1.2" + dependencies: + "@jridgewell/trace-mapping": "npm:^0.3.13" + callsites: "npm:^3.0.0" + graceful-fs: "npm:^4.2.9" + checksum: 10/b82a5c2e93d35d86779c61a02ccb967d1b5cd2e9dd67d26d8add44958637cbbb99daeeb8129c7653389cb440dc2a2f5ae4d2183dc453c67669ff98938b775a3a + languageName: node + linkType: hard + "@jest/source-map@npm:^29.6.3": version: 29.6.3 resolution: "@jest/source-map@npm:29.6.3" @@ -1323,6 +1578,18 @@ __metadata: languageName: node linkType: hard +"@jest/test-result@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/test-result@npm:28.1.3" + dependencies: + "@jest/console": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/istanbul-lib-coverage": "npm:^2.0.0" + collect-v8-coverage: "npm:^1.0.0" + checksum: 10/d343f08e6e4971e8132540014711c5d29887651b036f03db8c7e9d6509fe9801316f0a6a393cd0af0431c50e6d1c1d310957f06b6cc20c08cab2e67b66a00c88 + languageName: node + linkType: hard + "@jest/test-result@npm:^29.7.0": version: 29.7.0 resolution: "@jest/test-result@npm:29.7.0" @@ -1335,6 +1602,18 @@ __metadata: languageName: node linkType: hard +"@jest/test-sequencer@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/test-sequencer@npm:28.1.3" + dependencies: + "@jest/test-result": "npm:^28.1.3" + graceful-fs: "npm:^4.2.9" + jest-haste-map: "npm:^28.1.3" + slash: "npm:^3.0.0" + checksum: 10/a2f05475c39a8e3e446a0f98c6830aa2492daffe8286db58c95e1870479ed4c2a74e2e51fac1d8b2958858aeb194331145c217d04482fb9312ba1a9e7dded171 + languageName: node + linkType: hard + "@jest/test-sequencer@npm:^29.7.0": version: 29.7.0 resolution: "@jest/test-sequencer@npm:29.7.0" @@ -1347,6 +1626,29 @@ __metadata: languageName: node linkType: hard +"@jest/transform@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/transform@npm:28.1.3" + dependencies: + "@babel/core": "npm:^7.11.6" + "@jest/types": "npm:^28.1.3" + "@jridgewell/trace-mapping": "npm:^0.3.13" + babel-plugin-istanbul: "npm:^6.1.1" + chalk: "npm:^4.0.0" + convert-source-map: "npm:^1.4.0" + fast-json-stable-stringify: "npm:^2.0.0" + graceful-fs: "npm:^4.2.9" + jest-haste-map: "npm:^28.1.3" + jest-regex-util: "npm:^28.0.2" + jest-util: "npm:^28.1.3" + micromatch: "npm:^4.0.4" + pirates: "npm:^4.0.4" + slash: "npm:^3.0.0" + write-file-atomic: "npm:^4.0.1" + checksum: 10/89bc17ca22d5e81eb35e9549beaa5778da0209c12c108552322b72fa7b41a387d119168dea28fd9415f16883fc6dd7a811690654ebb958375e70158b4d0e2965 + languageName: node + linkType: hard + "@jest/transform@npm:^29.7.0": version: 29.7.0 resolution: "@jest/transform@npm:29.7.0" @@ -1383,6 +1685,20 @@ __metadata: languageName: node linkType: hard +"@jest/types@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/types@npm:28.1.3" + dependencies: + "@jest/schemas": "npm:^28.1.3" + "@types/istanbul-lib-coverage": "npm:^2.0.0" + "@types/istanbul-reports": "npm:^3.0.0" + "@types/node": "npm:*" + "@types/yargs": "npm:^17.0.8" + chalk: "npm:^4.0.0" + checksum: 10/a90e636df760799b6c3d91e34e539e701ea803e80312257e674e345a3c23a7c892df7a301afbc7883ec1d623daf3ba266cde57c5965e0692e5f1e61915d3524b + languageName: node + linkType: hard + "@jest/types@npm:^29.6.3": version: 29.6.3 resolution: "@jest/types@npm:29.6.3" @@ -1439,7 +1755,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": +"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.13, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": version: 0.3.25 resolution: "@jridgewell/trace-mapping@npm:0.3.25" dependencies: @@ -1460,6 +1776,23 @@ __metadata: languageName: node linkType: hard +"@lavamoat/allow-scripts@npm:^3.0.4": + version: 3.3.0 + resolution: "@lavamoat/allow-scripts@npm:3.3.0" + dependencies: + "@lavamoat/aa": "npm:^4.3.0" + "@npmcli/run-script": "npm:8.1.0" + bin-links: "npm:4.0.4" + npm-normalize-package-bin: "npm:3.0.1" + yargs: "npm:17.7.2" + peerDependencies: + "@lavamoat/preinstall-always-fail": "*" + bin: + allow-scripts: src/cli.js + checksum: 10/476043c56425c3077d051a4a6ee4d045fab8b80bf16d50a9201c68224a2ddd77af03490388b7380004d348b11abf4ab7854ba52ba514d10d17c05d40dc8b870d + languageName: node + linkType: hard + "@lavamoat/allow-scripts@npm:^3.2.1": version: 3.2.1 resolution: "@lavamoat/allow-scripts@npm:3.2.1" @@ -1477,7 +1810,7 @@ __metadata: languageName: node linkType: hard -"@lavamoat/preinstall-always-fail@npm:^2.1.0": +"@lavamoat/preinstall-always-fail@npm:^2.0.0, @lavamoat/preinstall-always-fail@npm:^2.1.0": version: 2.1.0 resolution: "@lavamoat/preinstall-always-fail@npm:2.1.0" checksum: 10/385c3fac828b9edff2d8b5825bd29ea475206046984cdb3217518ad655f145ff37046414041534960d92cbe0759f0dc675f7c7dcf39a95003ae715a834fbd750 @@ -2135,6 +2468,7 @@ __metadata: "@lavamoat/allow-scripts": "npm:^3.2.1" "@lavamoat/preinstall-always-fail": "npm:^2.1.0" "@metamask/auto-changelog": "npm:^3.4.4" + "@metamask/keyring-utils": "npm:^0.0.1" "@metamask/providers": "npm:^18.1.0" "@metamask/snaps-sdk": "npm:^6.7.0" "@metamask/superstruct": "npm:^3.1.0" @@ -2142,7 +2476,6 @@ __metadata: "@ts-bridge/cli": "npm:^0.6.0" "@types/jest": "npm:^29.5.12" "@types/node": "npm:^20.12.12" - "@types/uuid": "npm:^9.0.8" "@types/webextension-polyfill": "npm:^0.12.1" bech32: "npm:^2.0.0" deepmerge: "npm:^4.2.2" @@ -2161,6 +2494,33 @@ __metadata: languageName: unknown linkType: soft +"@metamask/keyring-utils@npm:^0.0.1, @metamask/keyring-utils@workspace:packages/keyring-utils": + version: 0.0.0-use.local + resolution: "@metamask/keyring-utils@workspace:packages/keyring-utils" + dependencies: + "@lavamoat/allow-scripts": "npm:^3.0.4" + "@lavamoat/preinstall-always-fail": "npm:^2.0.0" + "@metamask/auto-changelog": "npm:^3.4.4" + "@metamask/providers": "npm:^17.1.1" + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^9.1.0" + "@types/jest": "npm:^29.5.12" + "@types/node": "npm:^20.12.12" + "@types/uuid": "npm:^9.0.8" + deepmerge: "npm:^4.2.2" + depcheck: "npm:^1.4.7" + jest: "npm:^28.1.3" + jest-it-up: "npm:^3.1.0" + rimraf: "npm:^5.0.7" + ts-jest: "npm:^28.0.8" + ts-node: "npm:^10.9.2" + tsd: "npm:^0.31.0" + typedoc: "npm:^0.25.13" + typescript: "npm:~4.8.4" + uuid: "npm:^9.0.1" + languageName: unknown + linkType: soft + "@metamask/number-to-bn@npm:^1.7.1": version: 1.7.1 resolution: "@metamask/number-to-bn@npm:1.7.1" @@ -2226,6 +2586,27 @@ __metadata: languageName: node linkType: hard +"@metamask/providers@npm:^17.1.1": + version: 17.2.1 + resolution: "@metamask/providers@npm:17.2.1" + dependencies: + "@metamask/json-rpc-engine": "npm:^9.0.1" + "@metamask/json-rpc-middleware-stream": "npm:^8.0.1" + "@metamask/object-multiplex": "npm:^2.0.0" + "@metamask/rpc-errors": "npm:^6.3.1" + "@metamask/safe-event-emitter": "npm:^3.1.1" + "@metamask/utils": "npm:^9.0.0" + detect-browser: "npm:^5.2.0" + extension-port-stream: "npm:^4.1.0" + fast-deep-equal: "npm:^3.1.3" + is-stream: "npm:^2.0.0" + readable-stream: "npm:^3.6.2" + peerDependencies: + webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0 + checksum: 10/ff9cbcdd4cfa410c52ae0d9d39ad9285fb21f583bcb36a8a39d1862681fe17483008c15ab0ce87797ea94cad82a2f2e58b29b1db1f02df151f9cf3b05013e8a4 + languageName: node + linkType: hard + "@metamask/providers@npm:^17.1.2": version: 17.2.0 resolution: "@metamask/providers@npm:17.2.0" @@ -2747,6 +3128,13 @@ __metadata: languageName: node linkType: hard +"@sinclair/typebox@npm:^0.24.1": + version: 0.24.51 + resolution: "@sinclair/typebox@npm:0.24.51" + checksum: 10/7886847b9deda1d926934066fe69165a1d9bbe7b0f836543c25efb96173c17009ef7a98619f48b379294bf27958844da3428eb35e65f8d941ea43563ad6e961e + languageName: node + linkType: hard + "@sinclair/typebox@npm:^0.27.8": version: 0.27.8 resolution: "@sinclair/typebox@npm:0.27.8" @@ -2768,6 +3156,15 @@ __metadata: languageName: node linkType: hard +"@sinonjs/commons@npm:^1.7.0": + version: 1.8.6 + resolution: "@sinonjs/commons@npm:1.8.6" + dependencies: + type-detect: "npm:4.0.8" + checksum: 10/51987338fd8b4d1e135822ad593dd23a3288764aa41d83c695124d512bc38b87eece859078008651ecc7f1df89a7e558a515dc6f02d21a93be4ba50b39a28914 + languageName: node + linkType: hard + "@sinonjs/commons@npm:^3.0.0, @sinonjs/commons@npm:^3.0.1": version: 3.0.1 resolution: "@sinonjs/commons@npm:3.0.1" @@ -2795,6 +3192,15 @@ __metadata: languageName: node linkType: hard +"@sinonjs/fake-timers@npm:^9.1.2": + version: 9.1.2 + resolution: "@sinonjs/fake-timers@npm:9.1.2" + dependencies: + "@sinonjs/commons": "npm:^1.7.0" + checksum: 10/033c74ad389b0655b6af2fa1af31dddf45878e65879f06c5d1940e0ceb053a234f2f46c728dcd97df8ee9312431e45dd7aedaee3a69d47f73a2001a7547fc3d6 + languageName: node + linkType: hard + "@sinonjs/samsam@npm:^8.0.1": version: 8.0.2 resolution: "@sinonjs/samsam@npm:8.0.2" @@ -3433,6 +3839,13 @@ __metadata: languageName: node linkType: hard +"@types/prettier@npm:^2.1.5": + version: 2.7.3 + resolution: "@types/prettier@npm:2.7.3" + checksum: 10/cda84c19acc3bf327545b1ce71114a7d08efbd67b5030b9e8277b347fa57b05178045f70debe1d363ff7efdae62f237260713aafc2d7217e06fc99b048a88497 + languageName: node + linkType: hard + "@types/punycode@npm:^2.1.0": version: 2.1.4 resolution: "@types/punycode@npm:2.1.4" @@ -4241,6 +4654,23 @@ __metadata: languageName: node linkType: hard +"babel-jest@npm:^28.1.3": + version: 28.1.3 + resolution: "babel-jest@npm:28.1.3" + dependencies: + "@jest/transform": "npm:^28.1.3" + "@types/babel__core": "npm:^7.1.14" + babel-plugin-istanbul: "npm:^6.1.1" + babel-preset-jest: "npm:^28.1.3" + chalk: "npm:^4.0.0" + graceful-fs: "npm:^4.2.9" + slash: "npm:^3.0.0" + peerDependencies: + "@babel/core": ^7.8.0 + checksum: 10/6dcbf194a037fb3df18d2aee56a3919a98a9b34292d1eb4aad823ebfa8b67f5a55f897213c1aafd52183928e99770319b8a094681ccb2910dc9993e6a7c1fd61 + languageName: node + linkType: hard + "babel-jest@npm:^29.7.0": version: 29.7.0 resolution: "babel-jest@npm:29.7.0" @@ -4271,6 +4701,18 @@ __metadata: languageName: node linkType: hard +"babel-plugin-jest-hoist@npm:^28.1.3": + version: 28.1.3 + resolution: "babel-plugin-jest-hoist@npm:28.1.3" + dependencies: + "@babel/template": "npm:^7.3.3" + "@babel/types": "npm:^7.3.3" + "@types/babel__core": "npm:^7.1.14" + "@types/babel__traverse": "npm:^7.0.6" + checksum: 10/355e383dae2b50efa0aff73a751f6bc55e7ae19ddfe72c73f4a0ad7667a671175aba17d824833d98b33602da18dd04e5e5d37d03c4f245940d8664c45ad29df5 + languageName: node + linkType: hard + "babel-plugin-jest-hoist@npm:^29.6.3": version: 29.6.3 resolution: "babel-plugin-jest-hoist@npm:29.6.3" @@ -4305,6 +4747,18 @@ __metadata: languageName: node linkType: hard +"babel-preset-jest@npm:^28.1.3": + version: 28.1.3 + resolution: "babel-preset-jest@npm:28.1.3" + dependencies: + babel-plugin-jest-hoist: "npm:^28.1.3" + babel-preset-current-node-syntax: "npm:^1.0.0" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/8248a4a5ca4242cc06ad13b10b9183ad2664da8fb0da060c352223dcf286f0ce9c708fa17901dc44ecabec25e6d309e5e5b9830a61dd777c3925f187a345a47d + languageName: node + linkType: hard + "babel-preset-jest@npm:^29.6.3": version: 29.6.3 resolution: "babel-preset-jest@npm:29.6.3" @@ -4564,7 +5018,7 @@ __metadata: languageName: node linkType: hard -"bs-logger@npm:^0.2.6": +"bs-logger@npm:0.x, bs-logger@npm:^0.2.6": version: 0.2.6 resolution: "bs-logger@npm:0.2.6" dependencies: @@ -5037,6 +5491,13 @@ __metadata: languageName: node linkType: hard +"convert-source-map@npm:^1.4.0": + version: 1.9.0 + resolution: "convert-source-map@npm:1.9.0" + checksum: 10/dc55a1f28ddd0e9485ef13565f8f756b342f9a46c4ae18b843fe3c30c675d058d6a4823eff86d472f187b176f0adf51ea7b69ea38be34be4a63cbbf91b0593c8 + languageName: node + linkType: hard + "convert-source-map@npm:^1.6.0": version: 1.7.0 resolution: "convert-source-map@npm:1.7.0" @@ -5258,6 +5719,13 @@ __metadata: languageName: node linkType: hard +"dedent@npm:^0.7.0": + version: 0.7.0 + resolution: "dedent@npm:0.7.0" + checksum: 10/87de191050d9a40dd70cad01159a0bcf05ecb59750951242070b6abf9569088684880d00ba92a955b4058804f16eeaf91d604f283929b4f614d181cd7ae633d2 + languageName: node + linkType: hard + "dedent@npm:^1.0.0": version: 1.5.3 resolution: "dedent@npm:1.5.3" @@ -5409,6 +5877,13 @@ __metadata: languageName: node linkType: hard +"diff-sequences@npm:^28.1.1": + version: 28.1.1 + resolution: "diff-sequences@npm:28.1.1" + checksum: 10/89752708215cf0d13ec98cb3cded36154951beec9ac8c23d5a665498ba880e1e3aad544ad046ad5223c141fc35b362665fae534e14a253654da77b514a28438d + languageName: node + linkType: hard + "diff-sequences@npm:^29.6.3": version: 29.6.3 resolution: "diff-sequences@npm:29.6.3" @@ -5535,7 +6010,14 @@ __metadata: languageName: node linkType: hard -"emittery@npm:^0.13.1": +"emittery@npm:^0.10.2": + version: 0.10.2 + resolution: "emittery@npm:0.10.2" + checksum: 10/fa86fc2b1f4c792d7d479a4de1a6a1f74b0b597770bae770336f0be6501e64be0995aa07d284ae502b269f5cec960cd0c44c91dd090d06d8deecee6d9787e396 + languageName: node + linkType: hard + +"emittery@npm:^0.13.1": version: 0.13.1 resolution: "emittery@npm:0.13.1" checksum: 10/fbe214171d878b924eedf1757badf58a5dce071cd1fa7f620fa841a0901a80d6da47ff05929d53163105e621ce11a71b9d8acb1148ffe1745e045145f6e69521 @@ -6322,6 +6804,19 @@ __metadata: languageName: node linkType: hard +"expect@npm:^28.1.3": + version: 28.1.3 + resolution: "expect@npm:28.1.3" + dependencies: + "@jest/expect-utils": "npm:^28.1.3" + jest-get-type: "npm:^28.0.2" + jest-matcher-utils: "npm:^28.1.3" + jest-message-util: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + checksum: 10/87033c88f7a578063ae7de98000fbd423bdb751756b1c6a1c69cd2b093bdb8b11a5b7a66eb89984068850d14978c7daffc2cc8ed56eb912424c24885a7573061 + languageName: node + linkType: hard + "expect@npm:^29.0.0, expect@npm:^29.7.0": version: 29.7.0 resolution: "expect@npm:29.7.0" @@ -6769,7 +7264,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^10.2.2, glob@npm:^10.3.10": +"glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.7": version: 10.4.5 resolution: "glob@npm:10.4.5" dependencies: @@ -7546,6 +8041,19 @@ __metadata: languageName: node linkType: hard +"istanbul-lib-instrument@npm:^5.1.0": + version: 5.2.1 + resolution: "istanbul-lib-instrument@npm:5.2.1" + dependencies: + "@babel/core": "npm:^7.12.3" + "@babel/parser": "npm:^7.14.7" + "@istanbuljs/schema": "npm:^0.1.2" + istanbul-lib-coverage: "npm:^3.2.0" + semver: "npm:^6.3.0" + checksum: 10/bbc4496c2f304d799f8ec22202ab38c010ac265c441947f075c0f7d46bd440b45c00e46017cf9053453d42182d768b1d6ed0e70a142c95ab00df9843aa5ab80e + languageName: node + linkType: hard + "istanbul-lib-instrument@npm:^6.0.0": version: 6.0.3 resolution: "istanbul-lib-instrument@npm:6.0.3" @@ -7640,6 +8148,16 @@ __metadata: languageName: node linkType: hard +"jest-changed-files@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-changed-files@npm:28.1.3" + dependencies: + execa: "npm:^5.0.0" + p-limit: "npm:^3.1.0" + checksum: 10/206be715fed00c70d69f46f6274129816b2959dd9fe5d77b7c929d572eef8f55092baea48f51cf45848edd17e23b00aa720201b5e7781904e6ede06ba666e668 + languageName: node + linkType: hard + "jest-changed-files@npm:^29.7.0": version: 29.7.0 resolution: "jest-changed-files@npm:29.7.0" @@ -7651,6 +8169,33 @@ __metadata: languageName: node linkType: hard +"jest-circus@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-circus@npm:28.1.3" + dependencies: + "@jest/environment": "npm:^28.1.3" + "@jest/expect": "npm:^28.1.3" + "@jest/test-result": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + chalk: "npm:^4.0.0" + co: "npm:^4.6.0" + dedent: "npm:^0.7.0" + is-generator-fn: "npm:^2.0.0" + jest-each: "npm:^28.1.3" + jest-matcher-utils: "npm:^28.1.3" + jest-message-util: "npm:^28.1.3" + jest-runtime: "npm:^28.1.3" + jest-snapshot: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + p-limit: "npm:^3.1.0" + pretty-format: "npm:^28.1.3" + slash: "npm:^3.0.0" + stack-utils: "npm:^2.0.3" + checksum: 10/3ac1f369cadbdd1982c123c04bc69f140b9790a8d0a729084f53aa13154bbdf318ba162dc70daecc37ef1d620afa339408d6b99a0314306238c547dc6a25b4a3 + languageName: node + linkType: hard + "jest-circus@npm:^29.7.0": version: 29.7.0 resolution: "jest-circus@npm:29.7.0" @@ -7679,6 +8224,33 @@ __metadata: languageName: node linkType: hard +"jest-cli@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-cli@npm:28.1.3" + dependencies: + "@jest/core": "npm:^28.1.3" + "@jest/test-result": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + chalk: "npm:^4.0.0" + exit: "npm:^0.1.2" + graceful-fs: "npm:^4.2.9" + import-local: "npm:^3.0.2" + jest-config: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + jest-validate: "npm:^28.1.3" + prompts: "npm:^2.0.1" + yargs: "npm:^17.3.1" + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + bin: + jest: bin/jest.js + checksum: 10/935a0c517e7b972e60543fdb921302fc63d78e629ab077195c91336279c0815978ca2e03c65ec6dbff3226a5c4ee64b13c7ef5a86387330c9da54454cd4bbbfb + languageName: node + linkType: hard + "jest-cli@npm:^29.7.0": version: 29.7.0 resolution: "jest-cli@npm:29.7.0" @@ -7705,6 +8277,44 @@ __metadata: languageName: node linkType: hard +"jest-config@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-config@npm:28.1.3" + dependencies: + "@babel/core": "npm:^7.11.6" + "@jest/test-sequencer": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + babel-jest: "npm:^28.1.3" + chalk: "npm:^4.0.0" + ci-info: "npm:^3.2.0" + deepmerge: "npm:^4.2.2" + glob: "npm:^7.1.3" + graceful-fs: "npm:^4.2.9" + jest-circus: "npm:^28.1.3" + jest-environment-node: "npm:^28.1.3" + jest-get-type: "npm:^28.0.2" + jest-regex-util: "npm:^28.0.2" + jest-resolve: "npm:^28.1.3" + jest-runner: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + jest-validate: "npm:^28.1.3" + micromatch: "npm:^4.0.4" + parse-json: "npm:^5.2.0" + pretty-format: "npm:^28.1.3" + slash: "npm:^3.0.0" + strip-json-comments: "npm:^3.1.1" + peerDependencies: + "@types/node": "*" + ts-node: ">=9.0.0" + peerDependenciesMeta: + "@types/node": + optional: true + ts-node: + optional: true + checksum: 10/457d8709e24e0e4d8a8a8e074a65092e896d80f30d80c0448f8ce6a24bd0b30060a1a593a20aa7fb8c3c2228d519f0a979ccdff3a176efb60afc7187785d59cf + languageName: node + linkType: hard + "jest-config@npm:^29.7.0": version: 29.7.0 resolution: "jest-config@npm:29.7.0" @@ -7743,6 +8353,18 @@ __metadata: languageName: node linkType: hard +"jest-diff@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-diff@npm:28.1.3" + dependencies: + chalk: "npm:^4.0.0" + diff-sequences: "npm:^28.1.1" + jest-get-type: "npm:^28.0.2" + pretty-format: "npm:^28.1.3" + checksum: 10/42b8d82c59df879b2cfdf3583fecd40c31ce8c9364644d8d430f5bd533a32e475ca0b383b7a744293332008c50f7901bedeac73c60463ac9e7e2b80249e1325c + languageName: node + linkType: hard + "jest-diff@npm:^29.0.3, jest-diff@npm:^29.7.0": version: 29.7.0 resolution: "jest-diff@npm:29.7.0" @@ -7755,6 +8377,15 @@ __metadata: languageName: node linkType: hard +"jest-docblock@npm:^28.1.1": + version: 28.1.1 + resolution: "jest-docblock@npm:28.1.1" + dependencies: + detect-newline: "npm:^3.0.0" + checksum: 10/4062cb9ba54c88c88f5452fcd054937f35755240014ea277ff8dbfde30efcbdb77a4844a09279e55ec98f2fe9a1978a9b8583315e93fdf03602a619ae070356b + languageName: node + linkType: hard + "jest-docblock@npm:^29.7.0": version: 29.7.0 resolution: "jest-docblock@npm:29.7.0" @@ -7764,6 +8395,19 @@ __metadata: languageName: node linkType: hard +"jest-each@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-each@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + chalk: "npm:^4.0.0" + jest-get-type: "npm:^28.0.2" + jest-util: "npm:^28.1.3" + pretty-format: "npm:^28.1.3" + checksum: 10/4877cdda70048923ad6aabf25779e3e2c6bc580253d95739b8af291fbc506b95b043031b498f26807093abe9e6e93ecd7b50e3ce5b7ab175fc21637a197a248b + languageName: node + linkType: hard + "jest-each@npm:^29.7.0": version: 29.7.0 resolution: "jest-each@npm:29.7.0" @@ -7798,6 +8442,20 @@ __metadata: languageName: node linkType: hard +"jest-environment-node@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-environment-node@npm:28.1.3" + dependencies: + "@jest/environment": "npm:^28.1.3" + "@jest/fake-timers": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + jest-mock: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + checksum: 10/ab9ec5c57309a0ca40ebc58ba84b4980445f24d351cc3292c8c8715062c7ea14442d9d8e7701eccb9cb810f425bbdb7eba631fd76fb1835b92150b6bdda7cb18 + languageName: node + linkType: hard + "jest-environment-node@npm:^29.7.0": version: 29.7.0 resolution: "jest-environment-node@npm:29.7.0" @@ -7812,6 +8470,13 @@ __metadata: languageName: node linkType: hard +"jest-get-type@npm:^28.0.2": + version: 28.0.2 + resolution: "jest-get-type@npm:28.0.2" + checksum: 10/5281d7c89bc8156605f6d15784f45074f4548501195c26e9b188742768f72d40948252d13230ea905b5349038865a1a8eeff0e614cc530ff289dfc41fe843abd + languageName: node + linkType: hard + "jest-get-type@npm:^29.6.3": version: 29.6.3 resolution: "jest-get-type@npm:29.6.3" @@ -7819,6 +8484,29 @@ __metadata: languageName: node linkType: hard +"jest-haste-map@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-haste-map@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + "@types/graceful-fs": "npm:^4.1.3" + "@types/node": "npm:*" + anymatch: "npm:^3.0.3" + fb-watchman: "npm:^2.0.0" + fsevents: "npm:^2.3.2" + graceful-fs: "npm:^4.2.9" + jest-regex-util: "npm:^28.0.2" + jest-util: "npm:^28.1.3" + jest-worker: "npm:^28.1.3" + micromatch: "npm:^4.0.4" + walker: "npm:^1.0.8" + dependenciesMeta: + fsevents: + optional: true + checksum: 10/c78e0e81e3f138f379440fb2ddfdc3753da377b74477df02ef404d5de1508d6545d28cf02516713dbde093a8c112098be6f50080a7a8fab6b888992720322a57 + languageName: node + linkType: hard + "jest-haste-map@npm:^29.7.0": version: 29.7.0 resolution: "jest-haste-map@npm:29.7.0" @@ -7855,6 +8543,16 @@ __metadata: languageName: node linkType: hard +"jest-leak-detector@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-leak-detector@npm:28.1.3" + dependencies: + jest-get-type: "npm:^28.0.2" + pretty-format: "npm:^28.1.3" + checksum: 10/2e976a4880cf9af11f53a19f6a3820e0f90b635a900737a5427fc42e337d5628ba446dcd7c020ecea3806cf92bc0bbf6982ed62a9cd84e5a13d8751aa30fbbb7 + languageName: node + linkType: hard + "jest-leak-detector@npm:^29.7.0": version: 29.7.0 resolution: "jest-leak-detector@npm:29.7.0" @@ -7865,6 +8563,18 @@ __metadata: languageName: node linkType: hard +"jest-matcher-utils@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-matcher-utils@npm:28.1.3" + dependencies: + chalk: "npm:^4.0.0" + jest-diff: "npm:^28.1.3" + jest-get-type: "npm:^28.0.2" + pretty-format: "npm:^28.1.3" + checksum: 10/958f4bacdaee6949f1d1da413129f2249083bc6fa3f4ac5c559795b370aec7159f99f02340f706cc895b90938c2bafe1aab347c9a34f8819c59afd1a4cd6c009 + languageName: node + linkType: hard + "jest-matcher-utils@npm:^29.7.0": version: 29.7.0 resolution: "jest-matcher-utils@npm:29.7.0" @@ -7877,6 +8587,23 @@ __metadata: languageName: node linkType: hard +"jest-message-util@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-message-util@npm:28.1.3" + dependencies: + "@babel/code-frame": "npm:^7.12.13" + "@jest/types": "npm:^28.1.3" + "@types/stack-utils": "npm:^2.0.0" + chalk: "npm:^4.0.0" + graceful-fs: "npm:^4.2.9" + micromatch: "npm:^4.0.4" + pretty-format: "npm:^28.1.3" + slash: "npm:^3.0.0" + stack-utils: "npm:^2.0.3" + checksum: 10/91137a507e9eb79ef6156a3d17c882a181fa662da28cc1a86245ff53ba13726653c8d5fed2660e922aae020a9caca4d22c3689bfe61a215c8a17a43e01b7eb5c + languageName: node + linkType: hard + "jest-message-util@npm:^29.7.0": version: 29.7.0 resolution: "jest-message-util@npm:29.7.0" @@ -7894,6 +8621,16 @@ __metadata: languageName: node linkType: hard +"jest-mock@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-mock@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + checksum: 10/43cbec0ceddea795b8b2bc09f8632eecc97b88ef018a9c9737b887ed6cbdbda000a436e9165dce2bccfbb949be8b0daca6faa530dc390d43a0e5e3099f3ae216 + languageName: node + linkType: hard + "jest-mock@npm:^29.7.0": version: 29.7.0 resolution: "jest-mock@npm:29.7.0" @@ -7917,6 +8654,13 @@ __metadata: languageName: node linkType: hard +"jest-regex-util@npm:^28.0.2": + version: 28.0.2 + resolution: "jest-regex-util@npm:28.0.2" + checksum: 10/0ea8c5c82ec88bc85e273c0ec82e0c0f35f7a1e2d055070e50f0cc2a2177f848eec55f73e37ae0d045c3db5014c42b2f90ac62c1ab3fdb354d2abd66a9e08add + languageName: node + linkType: hard + "jest-regex-util@npm:^29.6.3": version: 29.6.3 resolution: "jest-regex-util@npm:29.6.3" @@ -7924,6 +8668,16 @@ __metadata: languageName: node linkType: hard +"jest-resolve-dependencies@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-resolve-dependencies@npm:28.1.3" + dependencies: + jest-regex-util: "npm:^28.0.2" + jest-snapshot: "npm:^28.1.3" + checksum: 10/5c3128ea5f702a22141116b6a3d83c594c192d3e17b7235a1d47ecd64bcd9aa4924100668804e6b54faf5a1437a366f37165a2ea7170a2ce35899323b4ed7aac + languageName: node + linkType: hard + "jest-resolve-dependencies@npm:^29.7.0": version: 29.7.0 resolution: "jest-resolve-dependencies@npm:29.7.0" @@ -7934,6 +8688,23 @@ __metadata: languageName: node linkType: hard +"jest-resolve@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-resolve@npm:28.1.3" + dependencies: + chalk: "npm:^4.0.0" + graceful-fs: "npm:^4.2.9" + jest-haste-map: "npm:^28.1.3" + jest-pnp-resolver: "npm:^1.2.2" + jest-util: "npm:^28.1.3" + jest-validate: "npm:^28.1.3" + resolve: "npm:^1.20.0" + resolve.exports: "npm:^1.1.0" + slash: "npm:^3.0.0" + checksum: 10/742b2301a43172206bf88d405df73d19510cfd4eacb0fb16d620157de408e9f7399567a57c86c61b30aaa303c15d88a77b38a69ad0230d288e44db4d44d5f724 + languageName: node + linkType: hard + "jest-resolve@npm:^29.7.0": version: 29.7.0 resolution: "jest-resolve@npm:29.7.0" @@ -7951,6 +8722,35 @@ __metadata: languageName: node linkType: hard +"jest-runner@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-runner@npm:28.1.3" + dependencies: + "@jest/console": "npm:^28.1.3" + "@jest/environment": "npm:^28.1.3" + "@jest/test-result": "npm:^28.1.3" + "@jest/transform": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + chalk: "npm:^4.0.0" + emittery: "npm:^0.10.2" + graceful-fs: "npm:^4.2.9" + jest-docblock: "npm:^28.1.1" + jest-environment-node: "npm:^28.1.3" + jest-haste-map: "npm:^28.1.3" + jest-leak-detector: "npm:^28.1.3" + jest-message-util: "npm:^28.1.3" + jest-resolve: "npm:^28.1.3" + jest-runtime: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + jest-watcher: "npm:^28.1.3" + jest-worker: "npm:^28.1.3" + p-limit: "npm:^3.1.0" + source-map-support: "npm:0.5.13" + checksum: 10/0fb6ed4f628650da9ff502b89bfdf98ea7f3015ad0369429c223ddae793573d9c5f350e95756e8bb827e2e6e3de03e5cb94569075c5788e574697b63c09d80ae + languageName: node + linkType: hard + "jest-runner@npm:^29.7.0": version: 29.7.0 resolution: "jest-runner@npm:29.7.0" @@ -7980,6 +8780,36 @@ __metadata: languageName: node linkType: hard +"jest-runtime@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-runtime@npm:28.1.3" + dependencies: + "@jest/environment": "npm:^28.1.3" + "@jest/fake-timers": "npm:^28.1.3" + "@jest/globals": "npm:^28.1.3" + "@jest/source-map": "npm:^28.1.2" + "@jest/test-result": "npm:^28.1.3" + "@jest/transform": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + chalk: "npm:^4.0.0" + cjs-module-lexer: "npm:^1.0.0" + collect-v8-coverage: "npm:^1.0.0" + execa: "npm:^5.0.0" + glob: "npm:^7.1.3" + graceful-fs: "npm:^4.2.9" + jest-haste-map: "npm:^28.1.3" + jest-message-util: "npm:^28.1.3" + jest-mock: "npm:^28.1.3" + jest-regex-util: "npm:^28.0.2" + jest-resolve: "npm:^28.1.3" + jest-snapshot: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + slash: "npm:^3.0.0" + strip-bom: "npm:^4.0.0" + checksum: 10/d3d91b3f1082bbe3f87dc11ad7abce12f323797d98b3fa5ef7fb5efbd6d30e42041e3732cb8be5d41f0c8d8312d14461381d829ed1fe4e3712cfc82ea4a586fc + languageName: node + linkType: hard + "jest-runtime@npm:^29.7.0": version: 29.7.0 resolution: "jest-runtime@npm:29.7.0" @@ -8020,6 +8850,37 @@ __metadata: languageName: node linkType: hard +"jest-snapshot@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-snapshot@npm:28.1.3" + dependencies: + "@babel/core": "npm:^7.11.6" + "@babel/generator": "npm:^7.7.2" + "@babel/plugin-syntax-typescript": "npm:^7.7.2" + "@babel/traverse": "npm:^7.7.2" + "@babel/types": "npm:^7.3.3" + "@jest/expect-utils": "npm:^28.1.3" + "@jest/transform": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/babel__traverse": "npm:^7.0.6" + "@types/prettier": "npm:^2.1.5" + babel-preset-current-node-syntax: "npm:^1.0.0" + chalk: "npm:^4.0.0" + expect: "npm:^28.1.3" + graceful-fs: "npm:^4.2.9" + jest-diff: "npm:^28.1.3" + jest-get-type: "npm:^28.0.2" + jest-haste-map: "npm:^28.1.3" + jest-matcher-utils: "npm:^28.1.3" + jest-message-util: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + natural-compare: "npm:^1.4.0" + pretty-format: "npm:^28.1.3" + semver: "npm:^7.3.5" + checksum: 10/4e1f4e2aa5ccc776f1fdaab75f96342534f737df0d43458e0614af362f7e80097909f69e5d8f2d0aed2caae07fa122b1cf7b8da0c97c44c3b2d06da472d7ad79 + languageName: node + linkType: hard + "jest-snapshot@npm:^29.7.0": version: 29.7.0 resolution: "jest-snapshot@npm:29.7.0" @@ -8062,6 +8923,20 @@ __metadata: languageName: node linkType: hard +"jest-util@npm:^28.0.0, jest-util@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-util@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + chalk: "npm:^4.0.0" + ci-info: "npm:^3.2.0" + graceful-fs: "npm:^4.2.9" + picomatch: "npm:^2.2.3" + checksum: 10/92895523d30ddde8f22bebbc20ed6e1be35b0a21c8e9df8a1fc289bf354f6a3f96e5d271340f2ed212a5aa0b55fd7717ff3167da8c5f247d623e2a93a3bf7b32 + languageName: node + linkType: hard + "jest-util@npm:^29.0.0, jest-util@npm:^29.7.0": version: 29.7.0 resolution: "jest-util@npm:29.7.0" @@ -8076,6 +8951,20 @@ __metadata: languageName: node linkType: hard +"jest-validate@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-validate@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + camelcase: "npm:^6.2.0" + chalk: "npm:^4.0.0" + jest-get-type: "npm:^28.0.2" + leven: "npm:^3.1.0" + pretty-format: "npm:^28.1.3" + checksum: 10/c49c8c64b4afbfb5c7434cfd30f8adbe7c6f57ce3ad6be55cfd65403f9ae664822badc1f27844ae800b23c84653bea834e928ad79e18ea0afdc4aa2d0a121156 + languageName: node + linkType: hard + "jest-validate@npm:^29.7.0": version: 29.7.0 resolution: "jest-validate@npm:29.7.0" @@ -8090,6 +8979,22 @@ __metadata: languageName: node linkType: hard +"jest-watcher@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-watcher@npm:28.1.3" + dependencies: + "@jest/test-result": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + ansi-escapes: "npm:^4.2.1" + chalk: "npm:^4.0.0" + emittery: "npm:^0.10.2" + jest-util: "npm:^28.1.3" + string-length: "npm:^4.0.1" + checksum: 10/e6d2c099d461408a992d144c230112fb282b2d8f54c49227bdb0c3efcfa5ecab70a019fc57d8ad6360000459087bb942c4f72670b52fc5b97ac0d9834f87d24e + languageName: node + linkType: hard + "jest-watcher@npm:^29.7.0": version: 29.7.0 resolution: "jest-watcher@npm:29.7.0" @@ -8106,6 +9011,17 @@ __metadata: languageName: node linkType: hard +"jest-worker@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-worker@npm:28.1.3" + dependencies: + "@types/node": "npm:*" + merge-stream: "npm:^2.0.0" + supports-color: "npm:^8.0.0" + checksum: 10/0b5992308276ac8440a789e5317ff8feaa496cd9a0512c9cd73dbb9b6d2ff81b717cef1aa20113633c7280c9e29319af00a4d53d6bb35adbd1e3c01f0c290152 + languageName: node + linkType: hard + "jest-worker@npm:^29.7.0": version: 29.7.0 resolution: "jest-worker@npm:29.7.0" @@ -8118,6 +9034,25 @@ __metadata: languageName: node linkType: hard +"jest@npm:^28.1.3": + version: 28.1.3 + resolution: "jest@npm:28.1.3" + dependencies: + "@jest/core": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + import-local: "npm:^3.0.2" + jest-cli: "npm:^28.1.3" + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + bin: + jest: bin/jest.js + checksum: 10/fb7c93e8a9d4c760a59e2b7638886f9f05465a14a88e263dca448f205464434967897a89784a37f7623999dfc33206d3d61d0acdc83eed99c4474d84a4ed3cf8 + languageName: node + linkType: hard + "jest@npm:^29.5.0": version: 29.7.0 resolution: "jest@npm:29.7.0" @@ -8243,6 +9178,15 @@ __metadata: languageName: node linkType: hard +"jsesc@npm:^3.0.2": + version: 3.0.2 + resolution: "jsesc@npm:3.0.2" + bin: + jsesc: bin/jsesc + checksum: 10/8e5a7de6b70a8bd71f9cb0b5a7ade6a73ae6ab55e697c74cc997cede97417a3a65ed86c36f7dd6125fe49766e8386c845023d9e213916ca92c9dfdd56e2babf3 + languageName: node + linkType: hard + "json-parse-even-better-errors@npm:^2.3.0": version: 2.3.1 resolution: "json-parse-even-better-errors@npm:2.3.1" @@ -8297,7 +9241,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.2.3": +"json5@npm:^2.2.1, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -8416,7 +9360,7 @@ __metadata: languageName: node linkType: hard -"lodash.memoize@npm:^4.1.2": +"lodash.memoize@npm:4.x, lodash.memoize@npm:^4.1.2": version: 4.1.2 resolution: "lodash.memoize@npm:4.1.2" checksum: 10/192b2168f310c86f303580b53acf81ab029761b9bd9caa9506a019ffea5f3363ea98d7e39e7e11e6b9917066c9d36a09a11f6fe16f812326390d8f3a54a1a6da @@ -8546,7 +9490,7 @@ __metadata: languageName: node linkType: hard -"make-error@npm:^1.1.1, make-error@npm:^1.3.6": +"make-error@npm:1.x, make-error@npm:^1.1.1, make-error@npm:^1.3.6": version: 1.3.6 resolution: "make-error@npm:1.3.6" checksum: 10/b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402 @@ -9625,6 +10569,18 @@ __metadata: languageName: node linkType: hard +"pretty-format@npm:^28.1.3": + version: 28.1.3 + resolution: "pretty-format@npm:28.1.3" + dependencies: + "@jest/schemas": "npm:^28.1.3" + ansi-regex: "npm:^5.0.1" + ansi-styles: "npm:^5.0.0" + react-is: "npm:^18.0.0" + checksum: 10/26626d33e201388174a1ce352be46b8087f28184bf3684a88b2f7cf633e28419ffc664628eec261ba13b0f03748c3a6f85db063a2022f75a354c7b9e4e06526b + languageName: node + linkType: hard + "pretty-format@npm:^29.0.0, pretty-format@npm:^29.7.0": version: 29.7.0 resolution: "pretty-format@npm:29.7.0" @@ -9966,6 +10922,13 @@ __metadata: languageName: node linkType: hard +"resolve.exports@npm:^1.1.0": + version: 1.1.1 + resolution: "resolve.exports@npm:1.1.1" + checksum: 10/de58c30aca30883f0e29910e4ad1b7b9986ec5f69434ef2e957ddbe52d3250e138ddd2688e8cd67909b4ee9bf3437424c718a5962d59edd610f035b861ef8441 + languageName: node + linkType: hard + "resolve.exports@npm:^2.0.0": version: 2.0.2 resolution: "resolve.exports@npm:2.0.2" @@ -10030,7 +10993,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -10041,6 +11004,17 @@ __metadata: languageName: node linkType: hard +"rimraf@npm:^5.0.7": + version: 5.0.10 + resolution: "rimraf@npm:5.0.10" + dependencies: + glob: "npm:^10.3.7" + bin: + rimraf: dist/esm/bin.mjs + checksum: 10/f3b8ce81eecbde4628b07bdf9e2fa8b684e0caea4999acb1e3b0402c695cd41f28cd075609a808e61ce2672f528ca079f675ab1d8e8d5f86d56643a03e0b8d2e + languageName: node + linkType: hard + "ripemd160@npm:^2.0.0, ripemd160@npm:^2.0.1, ripemd160@npm:^2.0.2": version: 2.0.2 resolution: "ripemd160@npm:2.0.2" @@ -10242,7 +11216,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.6.3, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": +"semver@npm:7.6.3, semver@npm:7.x, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -10869,6 +11843,16 @@ __metadata: languageName: node linkType: hard +"terminal-link@npm:^2.0.0": + version: 2.1.1 + resolution: "terminal-link@npm:2.1.1" + dependencies: + ansi-escapes: "npm:^4.2.1" + supports-hyperlinks: "npm:^2.0.0" + checksum: 10/ce3d2cd3a438c4a9453947aa664581519173ea40e77e2534d08c088ee6dda449eabdbe0a76d2a516b8b73c33262fedd10d5270ccf7576ae316e3db170ce6562f + languageName: node + linkType: hard + "test-exclude@npm:^6.0.0": version: 6.0.0 resolution: "test-exclude@npm:6.0.0" @@ -10998,6 +11982,39 @@ __metadata: languageName: node linkType: hard +"ts-jest@npm:^28.0.8": + version: 28.0.8 + resolution: "ts-jest@npm:28.0.8" + dependencies: + bs-logger: "npm:0.x" + fast-json-stable-stringify: "npm:2.x" + jest-util: "npm:^28.0.0" + json5: "npm:^2.2.1" + lodash.memoize: "npm:4.x" + make-error: "npm:1.x" + semver: "npm:7.x" + yargs-parser: "npm:^21.0.1" + peerDependencies: + "@babel/core": ">=7.0.0-beta.0 <8" + "@jest/types": ^28.0.0 + babel-jest: ^28.0.0 + jest: ^28.0.0 + typescript: ">=4.3" + peerDependenciesMeta: + "@babel/core": + optional: true + "@jest/types": + optional: true + babel-jest: + optional: true + esbuild: + optional: true + bin: + ts-jest: cli.js + checksum: 10/16cfe812ac5ec6557c9dc17e93bb0785c535002e5c13287f5a2bd2440ab57ea03ff696b32a80ba2992ca9fddab1c8649d7ae42670c02a22322805212933b1096 + languageName: node + linkType: hard + "ts-jest@npm:^29.0.5": version: 29.2.5 resolution: "ts-jest@npm:29.2.5" @@ -11231,6 +12248,16 @@ __metadata: languageName: node linkType: hard +"typescript@npm:~4.8.4": + version: 4.8.4 + resolution: "typescript@npm:4.8.4" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10/f985d8dd6ae815753d61cb81e434f3a4a5796ac52e423370fca6ad11bcd188df4013d82e3ba3b88c9746745b9341390ba68f862dc9d30bac6465e0699f2a795b + languageName: node + linkType: hard + "typescript@npm:~5.6.3": version: 5.6.3 resolution: "typescript@npm:5.6.3" @@ -11241,6 +12268,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@npm%3A~4.8.4#optional!builtin": + version: 4.8.4 + resolution: "typescript@patch:typescript@npm%3A4.8.4#optional!builtin::version=4.8.4&hash=1a91c8" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10/5d81fd8cf5152091a0c0b84ebc868de8433583072a340c4899e0fc7ad6a80314b880a1466868c9a6a1f640c3d1f2fe7f41f8c541b99d78c8b414263dfa27eba3 + languageName: node + linkType: hard + "typescript@patch:typescript@npm%3A~5.6.3#optional!builtin": version: 5.6.3 resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin::version=5.6.3&hash=8c6c40" @@ -11666,7 +12703,7 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^4.0.2": +"write-file-atomic@npm:^4.0.1, write-file-atomic@npm:^4.0.2": version: 4.0.2 resolution: "write-file-atomic@npm:4.0.2" dependencies: @@ -11781,7 +12818,7 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^21.1.1": +"yargs-parser@npm:^21.0.1, yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1" checksum: 10/9dc2c217ea3bf8d858041252d43e074f7166b53f3d010a8c711275e09cd3d62a002969a39858b92bbda2a6a63a585c7127014534a560b9c69ed2d923d113406e From fec963eba9ed39e879dacfca8c262b7f6922a87d Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Mon, 9 Sep 2024 18:05:46 +0200 Subject: [PATCH 02/31] feat(keyring-internal-api): add new package @metamask/keyring-internal-api --- packages/keyring-api/src/index.ts | 4 - packages/keyring-internal-api/CHANGELOG.md | 10 + packages/keyring-internal-api/README.md | 15 + packages/keyring-internal-api/jest.config.js | 28 + packages/keyring-internal-api/package.json | 89 ++ .../src/btc/index.ts | 0 .../src/btc/types.test-d.ts | 0 .../src/btc/types.test.ts | 0 .../src/btc/types.ts | 5 +- .../src/eth/erc4337/index.ts | 0 .../src/eth/erc4337/types.test-d.ts | 0 .../src/eth/erc4337/types.test.ts | 0 .../src/eth/erc4337/types.ts | 2 +- .../src/eth/index.ts | 0 .../src/eth/types.test-d.ts | 0 .../src/eth/types.test.ts | 0 .../src/eth/types.ts | 5 +- .../src/eth/utils.test.ts | 7 +- .../src/eth/utils.ts | 4 +- packages/keyring-internal-api/src/index.ts | 4 + .../src/internal/api.ts | 18 +- .../src/internal/eth/EthKeyring.ts | 2 +- .../src/internal/eth/index.ts | 0 .../src/internal/events.test.ts | 4 +- .../src/internal/events.ts | 18 +- .../src/internal/index.ts | 0 .../src/internal/rpc.ts | 0 .../src/internal/types.test.ts | 0 .../src/internal/types.ts | 10 +- .../src/sol/index.ts | 0 .../src/sol/types.test-d.ts | 0 .../src/sol/types.test.ts | 0 .../src/sol/types.ts | 5 +- .../keyring-internal-api/tsconfig.build.json | 18 + packages/keyring-internal-api/tsconfig.json | 8 + packages/keyring-internal-api/typedoc.json | 6 + .../src/SnapKeyring.test.ts | 14 +- tsconfig.build.json | 1 + tsconfig.json | 1 + yarn.lock | 1084 +---------------- 40 files changed, 285 insertions(+), 1077 deletions(-) create mode 100644 packages/keyring-internal-api/CHANGELOG.md create mode 100644 packages/keyring-internal-api/README.md create mode 100644 packages/keyring-internal-api/jest.config.js create mode 100644 packages/keyring-internal-api/package.json rename packages/{keyring-api => keyring-internal-api}/src/btc/index.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/btc/types.test-d.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/btc/types.test.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/btc/types.ts (93%) rename packages/{keyring-api => keyring-internal-api}/src/eth/erc4337/index.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/eth/erc4337/types.test-d.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/eth/erc4337/types.test.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/eth/erc4337/types.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/eth/index.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/eth/types.test-d.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/eth/types.test.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/eth/types.ts (96%) rename packages/{keyring-api => keyring-internal-api}/src/eth/utils.test.ts (82%) rename packages/{keyring-api => keyring-internal-api}/src/eth/utils.ts (72%) create mode 100644 packages/keyring-internal-api/src/index.ts rename packages/{keyring-api => keyring-internal-api}/src/internal/api.ts (99%) rename packages/{keyring-api => keyring-internal-api}/src/internal/eth/EthKeyring.ts (95%) rename packages/{keyring-api => keyring-internal-api}/src/internal/eth/index.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/internal/events.test.ts (98%) rename packages/{keyring-api => keyring-internal-api}/src/internal/events.ts (82%) rename packages/{keyring-api => keyring-internal-api}/src/internal/index.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/internal/rpc.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/internal/types.test.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/internal/types.ts (98%) rename packages/{keyring-api => keyring-internal-api}/src/sol/index.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/sol/types.test-d.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/sol/types.test.ts (100%) rename packages/{keyring-api => keyring-internal-api}/src/sol/types.ts (92%) create mode 100644 packages/keyring-internal-api/tsconfig.build.json create mode 100644 packages/keyring-internal-api/tsconfig.json create mode 100644 packages/keyring-internal-api/typedoc.json diff --git a/packages/keyring-api/src/index.ts b/packages/keyring-api/src/index.ts index aead8e1d..dde3086b 100644 --- a/packages/keyring-api/src/index.ts +++ b/packages/keyring-api/src/index.ts @@ -1,10 +1,6 @@ export * from './api'; -export * from './btc'; export type * from './contexts'; -export * from './eth'; -export * from './sol'; export * from './events'; -export * from './internal'; export * from './JsonRpcRequest'; export * from './KeyringClient'; export * from './KeyringSnapRpcClient'; diff --git a/packages/keyring-internal-api/CHANGELOG.md b/packages/keyring-internal-api/CHANGELOG.md new file mode 100644 index 00000000..f4eb4815 --- /dev/null +++ b/packages/keyring-internal-api/CHANGELOG.md @@ -0,0 +1,10 @@ +# 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] + +[Unreleased]: https://github.com/MetaMask/accounts/ diff --git a/packages/keyring-internal-api/README.md b/packages/keyring-internal-api/README.md new file mode 100644 index 00000000..ff4e4bbf --- /dev/null +++ b/packages/keyring-internal-api/README.md @@ -0,0 +1,15 @@ +# MetaMask Keyring Internal API + +Keyring internal API that holds internal types and implementations. + +## Installation + +`yarn add @metamask/keyring-internal-api` + +or + +`npm install @metamask/keyring-internal-api` + +## Contributing + +This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/accounts#readme). diff --git a/packages/keyring-internal-api/jest.config.js b/packages/keyring-internal-api/jest.config.js new file mode 100644 index 00000000..2ce3d30d --- /dev/null +++ b/packages/keyring-internal-api/jest.config.js @@ -0,0 +1,28 @@ +/* + * For a detailed explanation regarding each configuration property and type check, visit: + * https://jestjs.io/docs/configuration + */ + +const merge = require('deepmerge'); +const path = require('path'); + +const baseConfig = require('../../jest.config.packages'); + +const displayName = path.basename(__dirname); + +module.exports = merge(baseConfig, { + // The display name when running multiple projects + displayName, + + coveragePathIgnorePatterns: ['./src/tests'], + + // An object that configures minimum threshold enforcement for coverage results + coverageThreshold: { + global: { + branches: 100, + functions: 87.5, + lines: 94.69, + statements: 94.69 + }, + }, +}); diff --git a/packages/keyring-internal-api/package.json b/packages/keyring-internal-api/package.json new file mode 100644 index 00000000..11f4b51e --- /dev/null +++ b/packages/keyring-internal-api/package.json @@ -0,0 +1,89 @@ +{ + "name": "@metamask/keyring-internal-api", + "version": "0.0.1", + "description": "MetaMask Keyring Internal API", + "keywords": [ + "metamask", + "keyring" + ], + "homepage": "https://github.com/MetaMask/accounts/tree/main/packages/keyring-internal-api#readme", + "bugs": { + "url": "https://github.com/MetaMask/accounts/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/MetaMask/accounts.git" + }, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist/" + ], + "scripts": { + "build": "tsc --build tsconfig.build.json", + "build:clean": "rimraf dist && yarn build", + "build:docs": "typedoc", + "build:force": "tsc --build tsconfig.build.json --force", + "changelog:update": "../../scripts/update-changelog.sh @metamask/keyring-internal-api", + "changelog:validate": "../../scripts/validate-changelog.sh @metamask/keyring-internal-api", + "publish:preview": "yarn npm publish --tag preview", + "test": "yarn test:source && yarn test:types", + "test:clean": "jest --clearCache", + "test:source": "jest && jest-it-up", + "test:types": "tsd", + "test:verbose": "jest --verbose", + "test:watch": "jest --watch" + }, + "dependencies": { + "@metamask/keyring-api": "workspace:^", + "@metamask/keyring-utils": "workspace:^", + "@metamask/superstruct": "^3.1.0", + "@metamask/utils": "^9.2.1", + "bech32": "^2.0.0", + "deepmerge": "^4.2.2" + }, + "devDependencies": { + "@lavamoat/allow-scripts": "^3.2.1", + "@lavamoat/preinstall-always-fail": "^2.1.0", + "@metamask/auto-changelog": "^3.4.4", + "@ts-bridge/cli": "^0.6.0", + "@types/jest": "^29.5.12", + "@types/node": "^20.12.12", + "depcheck": "^1.4.7", + "jest": "^29.5.0", + "jest-it-up": "^3.1.0", + "rimraf": "^5.0.7", + "ts-jest": "^29.0.5", + "ts-node": "^10.9.2", + "tsd": "^0.31.0", + "typedoc": "^0.25.13", + "typescript": "~5.6.3" + }, + "engines": { + "node": "^18.18 || >=20" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "lavamoat": { + "allowScripts": { + "@lavamoat/preinstall-always-fail": false + } + }, + "tsd": { + "directory": "src" + } +} diff --git a/packages/keyring-api/src/btc/index.ts b/packages/keyring-internal-api/src/btc/index.ts similarity index 100% rename from packages/keyring-api/src/btc/index.ts rename to packages/keyring-internal-api/src/btc/index.ts diff --git a/packages/keyring-api/src/btc/types.test-d.ts b/packages/keyring-internal-api/src/btc/types.test-d.ts similarity index 100% rename from packages/keyring-api/src/btc/types.test-d.ts rename to packages/keyring-internal-api/src/btc/types.test-d.ts diff --git a/packages/keyring-api/src/btc/types.test.ts b/packages/keyring-internal-api/src/btc/types.test.ts similarity index 100% rename from packages/keyring-api/src/btc/types.test.ts rename to packages/keyring-internal-api/src/btc/types.test.ts diff --git a/packages/keyring-api/src/btc/types.ts b/packages/keyring-internal-api/src/btc/types.ts similarity index 93% rename from packages/keyring-api/src/btc/types.ts rename to packages/keyring-internal-api/src/btc/types.ts index c5dd9b14..8052e34d 100644 --- a/packages/keyring-api/src/btc/types.ts +++ b/packages/keyring-internal-api/src/btc/types.ts @@ -1,10 +1,9 @@ +import { KeyringAccountStruct, BtcAccountType } from '@metamask/keyring-api'; +import { object } from '@metamask/keyring-utils'; import type { Infer } from '@metamask/superstruct'; import { string, array, enums, refine, literal } from '@metamask/superstruct'; import { bech32 } from 'bech32'; -import { KeyringAccountStruct, BtcAccountType } from '../api'; -import { object } from '@metamask/keyring-utils'; - export const BtcP2wpkhAddressStruct = refine( string(), 'BtcP2wpkhAddressStruct', diff --git a/packages/keyring-api/src/eth/erc4337/index.ts b/packages/keyring-internal-api/src/eth/erc4337/index.ts similarity index 100% rename from packages/keyring-api/src/eth/erc4337/index.ts rename to packages/keyring-internal-api/src/eth/erc4337/index.ts diff --git a/packages/keyring-api/src/eth/erc4337/types.test-d.ts b/packages/keyring-internal-api/src/eth/erc4337/types.test-d.ts similarity index 100% rename from packages/keyring-api/src/eth/erc4337/types.test-d.ts rename to packages/keyring-internal-api/src/eth/erc4337/types.test-d.ts diff --git a/packages/keyring-api/src/eth/erc4337/types.test.ts b/packages/keyring-internal-api/src/eth/erc4337/types.test.ts similarity index 100% rename from packages/keyring-api/src/eth/erc4337/types.test.ts rename to packages/keyring-internal-api/src/eth/erc4337/types.test.ts diff --git a/packages/keyring-api/src/eth/erc4337/types.ts b/packages/keyring-internal-api/src/eth/erc4337/types.ts similarity index 100% rename from packages/keyring-api/src/eth/erc4337/types.ts rename to packages/keyring-internal-api/src/eth/erc4337/types.ts index df373d89..c9fd8aab 100644 --- a/packages/keyring-api/src/eth/erc4337/types.ts +++ b/packages/keyring-internal-api/src/eth/erc4337/types.ts @@ -1,6 +1,6 @@ +import { exactOptional, object, UrlStruct } from '@metamask/keyring-utils'; import { type Infer } from '@metamask/superstruct'; -import { exactOptional, object, UrlStruct } from '@metamask/keyring-utils'; import { EthAddressStruct, EthBytesStruct, EthUint256Struct } from '../types'; /** diff --git a/packages/keyring-api/src/eth/index.ts b/packages/keyring-internal-api/src/eth/index.ts similarity index 100% rename from packages/keyring-api/src/eth/index.ts rename to packages/keyring-internal-api/src/eth/index.ts diff --git a/packages/keyring-api/src/eth/types.test-d.ts b/packages/keyring-internal-api/src/eth/types.test-d.ts similarity index 100% rename from packages/keyring-api/src/eth/types.test-d.ts rename to packages/keyring-internal-api/src/eth/types.test-d.ts diff --git a/packages/keyring-api/src/eth/types.test.ts b/packages/keyring-internal-api/src/eth/types.test.ts similarity index 100% rename from packages/keyring-api/src/eth/types.test.ts rename to packages/keyring-internal-api/src/eth/types.test.ts diff --git a/packages/keyring-api/src/eth/types.ts b/packages/keyring-internal-api/src/eth/types.ts similarity index 96% rename from packages/keyring-api/src/eth/types.ts rename to packages/keyring-internal-api/src/eth/types.ts index 2b702bb4..becdae17 100644 --- a/packages/keyring-api/src/eth/types.ts +++ b/packages/keyring-internal-api/src/eth/types.ts @@ -1,9 +1,8 @@ +import { EthAccountType, KeyringAccountStruct } from '@metamask/keyring-api'; +import { object, definePattern } from '@metamask/keyring-utils'; import type { Infer } from '@metamask/superstruct'; import { array, enums, literal } from '@metamask/superstruct'; -import { EthAccountType, KeyringAccountStruct } from '../api'; -import { object, definePattern } from '@metamask/keyring-utils'; - export const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu); export const EthAddressStruct = definePattern( diff --git a/packages/keyring-api/src/eth/utils.test.ts b/packages/keyring-internal-api/src/eth/utils.test.ts similarity index 82% rename from packages/keyring-api/src/eth/utils.test.ts rename to packages/keyring-internal-api/src/eth/utils.test.ts index 54b78f29..74d76552 100644 --- a/packages/keyring-api/src/eth/utils.test.ts +++ b/packages/keyring-internal-api/src/eth/utils.test.ts @@ -1,5 +1,10 @@ +import { + BtcAccountType, + EthAccountType, + SolAccountType, +} from '@metamask/keyring-api'; + import { isEvmAccountType } from './utils'; -import { BtcAccountType, EthAccountType, SolAccountType } from '../api'; describe('isEvmAccountType', () => { it.each([ diff --git a/packages/keyring-api/src/eth/utils.ts b/packages/keyring-internal-api/src/eth/utils.ts similarity index 72% rename from packages/keyring-api/src/eth/utils.ts rename to packages/keyring-internal-api/src/eth/utils.ts index e686e858..6c0db9e8 100644 --- a/packages/keyring-api/src/eth/utils.ts +++ b/packages/keyring-internal-api/src/eth/utils.ts @@ -1,5 +1,5 @@ -import type { KeyringAccountType } from '../api'; -import { EthAccountType } from '../api'; +import type { KeyringAccountType } from '@metamask/keyring-api'; +import { EthAccountType } from '@metamask/keyring-api'; /** * Checks if the given type is an EVM account type. diff --git a/packages/keyring-internal-api/src/index.ts b/packages/keyring-internal-api/src/index.ts new file mode 100644 index 00000000..66d2bf1d --- /dev/null +++ b/packages/keyring-internal-api/src/index.ts @@ -0,0 +1,4 @@ +export * from './internal'; +export * from './btc'; +export * from './eth'; +export * from './sol'; diff --git a/packages/keyring-api/src/internal/api.ts b/packages/keyring-internal-api/src/internal/api.ts similarity index 99% rename from packages/keyring-api/src/internal/api.ts rename to packages/keyring-internal-api/src/internal/api.ts index dbacdf64..4c74b8bc 100644 --- a/packages/keyring-api/src/internal/api.ts +++ b/packages/keyring-internal-api/src/internal/api.ts @@ -1,3 +1,12 @@ +import { + BalanceStruct, + CaipAssetTypeStruct, + KeyringAccountDataStruct, + KeyringAccountStruct, + KeyringRequestStruct, + KeyringResponseStruct, +} from '@metamask/keyring-api'; +import { object, UuidStruct } from '@metamask/keyring-utils'; import type { Infer } from '@metamask/superstruct'; import { array, @@ -9,15 +18,6 @@ import { } from '@metamask/superstruct'; import { JsonStruct } from '@metamask/utils'; -import { - BalanceStruct, - CaipAssetTypeStruct, - KeyringAccountDataStruct, - KeyringAccountStruct, - KeyringRequestStruct, - KeyringResponseStruct, -} from '../api'; -import { object, UuidStruct } from '@metamask/keyring-utils'; import { KeyringRpcMethod } from './rpc'; const CommonHeader = { diff --git a/packages/keyring-api/src/internal/eth/EthKeyring.ts b/packages/keyring-internal-api/src/internal/eth/EthKeyring.ts similarity index 95% rename from packages/keyring-api/src/internal/eth/EthKeyring.ts rename to packages/keyring-internal-api/src/internal/eth/EthKeyring.ts index 34cc4909..ee62078f 100644 --- a/packages/keyring-api/src/internal/eth/EthKeyring.ts +++ b/packages/keyring-internal-api/src/internal/eth/EthKeyring.ts @@ -1,6 +1,6 @@ +import type { KeyringExecutionContext } from '@metamask/keyring-api'; import type { Json, Keyring } from '@metamask/utils'; -import type { KeyringExecutionContext } from '../../contexts'; import type { EthBaseTransaction, EthBaseUserOperation, diff --git a/packages/keyring-api/src/internal/eth/index.ts b/packages/keyring-internal-api/src/internal/eth/index.ts similarity index 100% rename from packages/keyring-api/src/internal/eth/index.ts rename to packages/keyring-internal-api/src/internal/eth/index.ts diff --git a/packages/keyring-api/src/internal/events.test.ts b/packages/keyring-internal-api/src/internal/events.test.ts similarity index 98% rename from packages/keyring-api/src/internal/events.test.ts rename to packages/keyring-internal-api/src/internal/events.test.ts index e2e1873d..fd8b1cb7 100644 --- a/packages/keyring-api/src/internal/events.test.ts +++ b/packages/keyring-internal-api/src/internal/events.test.ts @@ -1,3 +1,4 @@ +import { EthAccountType } from '@metamask/keyring-api'; import { is } from '@metamask/superstruct'; import { @@ -6,9 +7,8 @@ import { AccountUpdatedEventStruct, RequestApprovedEventStruct, RequestRejectedEventStruct, + KeyringEvent, } from './events'; -import { EthAccountType } from '../api'; -import { KeyringEvent } from '../events'; describe('events', () => { describe('AccountCreatedEventStruct', () => { diff --git a/packages/keyring-api/src/internal/events.ts b/packages/keyring-internal-api/src/internal/events.ts similarity index 82% rename from packages/keyring-api/src/internal/events.ts rename to packages/keyring-internal-api/src/internal/events.ts index fc014b5d..847ccf21 100644 --- a/packages/keyring-api/src/internal/events.ts +++ b/packages/keyring-internal-api/src/internal/events.ts @@ -1,9 +1,21 @@ +import { KeyringAccountStruct } from '@metamask/keyring-api'; +import { exactOptional, object, UuidStruct } from '@metamask/keyring-utils'; import { boolean, literal, string } from '@metamask/superstruct'; import { JsonStruct } from '@metamask/utils'; -import { KeyringAccountStruct } from '../api'; -import { KeyringEvent } from '../events'; -import { exactOptional, object, UuidStruct } from '@metamask/keyring-utils'; +/** + * Supported keyring events. + */ +export enum KeyringEvent { + // Account events + AccountCreated = 'notify:accountCreated', + AccountUpdated = 'notify:accountUpdated', + AccountDeleted = 'notify:accountDeleted', + + // Request events + RequestApproved = 'notify:requestApproved', + RequestRejected = 'notify:requestRejected', +} export const AccountCreatedEventStruct = object({ method: literal(`${KeyringEvent.AccountCreated}`), diff --git a/packages/keyring-api/src/internal/index.ts b/packages/keyring-internal-api/src/internal/index.ts similarity index 100% rename from packages/keyring-api/src/internal/index.ts rename to packages/keyring-internal-api/src/internal/index.ts diff --git a/packages/keyring-api/src/internal/rpc.ts b/packages/keyring-internal-api/src/internal/rpc.ts similarity index 100% rename from packages/keyring-api/src/internal/rpc.ts rename to packages/keyring-internal-api/src/internal/rpc.ts diff --git a/packages/keyring-api/src/internal/types.test.ts b/packages/keyring-internal-api/src/internal/types.test.ts similarity index 100% rename from packages/keyring-api/src/internal/types.test.ts rename to packages/keyring-internal-api/src/internal/types.test.ts diff --git a/packages/keyring-api/src/internal/types.ts b/packages/keyring-internal-api/src/internal/types.ts similarity index 98% rename from packages/keyring-api/src/internal/types.ts rename to packages/keyring-internal-api/src/internal/types.ts index 1b322981..5dc4f9fe 100644 --- a/packages/keyring-api/src/internal/types.ts +++ b/packages/keyring-internal-api/src/internal/types.ts @@ -1,16 +1,16 @@ -import type { Infer, Struct } from '@metamask/superstruct'; -import { boolean, string, number } from '@metamask/superstruct'; - import { BtcAccountType, EthAccountType, KeyringAccountStruct, SolAccountType, -} from '../api'; +} from '@metamask/keyring-api'; +import { exactOptional, object } from '@metamask/keyring-utils'; +import type { Infer, Struct } from '@metamask/superstruct'; +import { boolean, string, number } from '@metamask/superstruct'; + import { BtcP2wpkhAccountStruct } from '../btc/types'; import { EthEoaAccountStruct, EthErc4337AccountStruct } from '../eth/types'; import { SolDataAccountStruct } from '../sol/types'; -import { exactOptional, object } from '@metamask/keyring-utils'; export type InternalAccountType = | EthAccountType diff --git a/packages/keyring-api/src/sol/index.ts b/packages/keyring-internal-api/src/sol/index.ts similarity index 100% rename from packages/keyring-api/src/sol/index.ts rename to packages/keyring-internal-api/src/sol/index.ts diff --git a/packages/keyring-api/src/sol/types.test-d.ts b/packages/keyring-internal-api/src/sol/types.test-d.ts similarity index 100% rename from packages/keyring-api/src/sol/types.test-d.ts rename to packages/keyring-internal-api/src/sol/types.test-d.ts diff --git a/packages/keyring-api/src/sol/types.test.ts b/packages/keyring-internal-api/src/sol/types.test.ts similarity index 100% rename from packages/keyring-api/src/sol/types.test.ts rename to packages/keyring-internal-api/src/sol/types.test.ts diff --git a/packages/keyring-api/src/sol/types.ts b/packages/keyring-internal-api/src/sol/types.ts similarity index 92% rename from packages/keyring-api/src/sol/types.ts rename to packages/keyring-internal-api/src/sol/types.ts index cef6504c..6abb5ff7 100644 --- a/packages/keyring-api/src/sol/types.ts +++ b/packages/keyring-internal-api/src/sol/types.ts @@ -1,9 +1,8 @@ +import { KeyringAccountStruct, SolAccountType } from '@metamask/keyring-api'; +import { object, definePattern } from '@metamask/keyring-utils'; import type { Infer } from '@metamask/superstruct'; import { array, enums, literal } from '@metamask/superstruct'; -import { KeyringAccountStruct, SolAccountType } from '../api'; -import { object, definePattern } from '@metamask/keyring-utils'; - /** * Solana addresses are represented in the format of a 256-bit ed25519 public key and * are encoded using base58. diff --git a/packages/keyring-internal-api/tsconfig.build.json b/packages/keyring-internal-api/tsconfig.build.json new file mode 100644 index 00000000..29973f41 --- /dev/null +++ b/packages/keyring-internal-api/tsconfig.build.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.packages.build.json", + "compilerOptions": { + "baseUrl": "./", + "outDir": "dist", + "rootDir": "src", + // FIXME: We should investigate how to get rid of this flag, as this will turn off type + // checking for all *.d.ts files + "skipLibCheck": true + }, + "references": [ + { + "path": "../keyring-api/tsconfig.build.json" + } + ], + "include": ["./src/**/*.ts"], + "exclude": ["./src/**/*.test.ts", "./src/**/*.test-d.ts"] +} diff --git a/packages/keyring-internal-api/tsconfig.json b/packages/keyring-internal-api/tsconfig.json new file mode 100644 index 00000000..bba26c34 --- /dev/null +++ b/packages/keyring-internal-api/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.packages.json", + "compilerOptions": { + "baseUrl": "./" + }, + "include": ["./src"], + "exclude": ["./dist/**/*"] +} diff --git a/packages/keyring-internal-api/typedoc.json b/packages/keyring-internal-api/typedoc.json new file mode 100644 index 00000000..b527b625 --- /dev/null +++ b/packages/keyring-internal-api/typedoc.json @@ -0,0 +1,6 @@ +{ + "entryPoints": ["./src/index.ts"], + "excludePrivate": true, + "hideGenerator": true, + "out": "docs" +} diff --git a/packages/keyring-snap-bridge/src/SnapKeyring.test.ts b/packages/keyring-snap-bridge/src/SnapKeyring.test.ts index 57fb9daa..a5e103e4 100644 --- a/packages/keyring-snap-bridge/src/SnapKeyring.test.ts +++ b/packages/keyring-snap-bridge/src/SnapKeyring.test.ts @@ -1,21 +1,21 @@ import { TransactionFactory } from '@ethereumjs/tx'; import { SignTypedDataVersion } from '@metamask/eth-sig-util'; import type { - EthBaseUserOperation, - EthUserOperation, - EthUserOperationPatch, KeyringAccount, KeyringExecutionContext, } from '@metamask/keyring-api'; +import { BtcAccountType, EthAccountType, SolAccountType } from '@metamask/keyring-api'; +import type { + EthBaseUserOperation, + EthUserOperation, + EthUserOperationPatch, +} from '@metamask/keyring-internal-api'; import { - BtcAccountType, BtcMethod, - EthAccountType, EthMethod, - SolAccountType, SolMethod, KeyringEvent, -} from '@metamask/keyring-api'; +} from '@metamask/keyring-internal-api'; import type { SnapController } from '@metamask/snaps-controllers'; import type { SnapId } from '@metamask/snaps-sdk'; import { KnownCaipNamespace, toCaipChainId } from '@metamask/utils'; diff --git a/tsconfig.build.json b/tsconfig.build.json index d8d7df0f..4103f804 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,6 +1,7 @@ { "references": [ { "path": "./packages/keyring-api/tsconfig.build.json" }, + { "path": "./packages/keyring-internal-api/tsconfig.build.json" }, { "path": "./packages/keyring-eth-ledger-bridge/tsconfig.build.json" }, { "path": "./packages/keyring-eth-simple/tsconfig.build.json" }, { "path": "./packages/keyring-eth-trezor/tsconfig.build.json" }, diff --git a/tsconfig.json b/tsconfig.json index 83f81d4a..a7d977e9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "esModuleInterop": true, "noEmit": true }, "references": [ { "path": "./packages/keyring-api" }, + { "path": "./packages/keyring-internal-api" }, { "path": "./packages/keyring-eth-ledger-bridge" }, { "path": "./packages/keyring-eth-simple" }, { "path": "./packages/keyring-eth-trezor" }, diff --git a/yarn.lock b/yarn.lock index ceb86b0c..954cd0fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,17 +32,6 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.25.9": - version: 7.26.2 - resolution: "@babel/code-frame@npm:7.26.2" - dependencies: - "@babel/helper-validator-identifier": "npm:^7.25.9" - js-tokens: "npm:^4.0.0" - picocolors: "npm:^1.0.0" - checksum: 10/db2c2122af79d31ca916755331bb4bac96feb2b334cdaca5097a6b467fdd41963b89b14b6836a14f083de7ff887fc78fa1b3c10b14e743d33e12dbfe5ee3d223 - languageName: node - linkType: hard - "@babel/compat-data@npm:^7.25.2": version: 7.25.4 resolution: "@babel/compat-data@npm:7.25.4" @@ -85,19 +74,6 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.25.9": - version: 7.26.2 - resolution: "@babel/generator@npm:7.26.2" - dependencies: - "@babel/parser": "npm:^7.26.2" - "@babel/types": "npm:^7.26.0" - "@jridgewell/gen-mapping": "npm:^0.3.5" - "@jridgewell/trace-mapping": "npm:^0.3.25" - jsesc: "npm:^3.0.2" - checksum: 10/71ace82b5b07a554846a003624bfab93275ccf73cdb9f1a37a4c1094bf9dc94bb677c67e8b8c939dbd6c5f0eda2e8f268aa2b0d9c3b9511072565660e717e045 - languageName: node - linkType: hard - "@babel/helper-annotate-as-pure@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-annotate-as-pure@npm:7.24.7" @@ -227,13 +203,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-string-parser@npm:7.25.9" - checksum: 10/c28656c52bd48e8c1d9f3e8e68ecafd09d949c57755b0d353739eb4eae7ba4f7e67e92e4036f1cd43378cc1397a2c943ed7bcaf5949b04ab48607def0258b775 - languageName: node - linkType: hard - "@babel/helper-validator-identifier@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-validator-identifier@npm:7.24.7" @@ -241,13 +210,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-validator-identifier@npm:7.25.9" - checksum: 10/3f9b649be0c2fd457fa1957b694b4e69532a668866b8a0d81eabfa34ba16dbf3107b39e0e7144c55c3c652bf773ec816af8df4a61273a2bb4eb3145ca9cf478e - languageName: node - linkType: hard - "@babel/helper-validator-option@npm:^7.24.7, @babel/helper-validator-option@npm:^7.24.8": version: 7.24.8 resolution: "@babel/helper-validator-option@npm:7.24.8" @@ -288,17 +250,6 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.2": - version: 7.26.2 - resolution: "@babel/parser@npm:7.26.2" - dependencies: - "@babel/types": "npm:^7.26.0" - bin: - parser: ./bin/babel-parser.js - checksum: 10/8baee43752a3678ad9f9e360ec845065eeee806f1fdc8e0f348a8a0e13eef0959dabed4a197c978896c493ea205c804d0a1187cc52e4a1ba017c7935bab4983d - languageName: node - linkType: hard - "@babel/plugin-syntax-async-generators@npm:^7.8.4": version: 7.8.4 resolution: "@babel/plugin-syntax-async-generators@npm:7.8.4" @@ -516,17 +467,6 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/template@npm:7.25.9" - dependencies: - "@babel/code-frame": "npm:^7.25.9" - "@babel/parser": "npm:^7.25.9" - "@babel/types": "npm:^7.25.9" - checksum: 10/e861180881507210150c1335ad94aff80fd9e9be6202e1efa752059c93224e2d5310186ddcdd4c0f0b0fc658ce48cb47823f15142b5c00c8456dde54f5de80b2 - languageName: node - linkType: hard - "@babel/traverse@npm:^7.23.2, @babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.24.8, @babel/traverse@npm:^7.25.0, @babel/traverse@npm:^7.25.2, @babel/traverse@npm:^7.25.4": version: 7.25.4 resolution: "@babel/traverse@npm:7.25.4" @@ -542,21 +482,6 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.7.2": - version: 7.25.9 - resolution: "@babel/traverse@npm:7.25.9" - dependencies: - "@babel/code-frame": "npm:^7.25.9" - "@babel/generator": "npm:^7.25.9" - "@babel/parser": "npm:^7.25.9" - "@babel/template": "npm:^7.25.9" - "@babel/types": "npm:^7.25.9" - debug: "npm:^4.3.1" - globals: "npm:^11.1.0" - checksum: 10/7431614d76d4a053e429208db82f2846a415833f3d9eb2e11ef72eeb3c64dfd71f4a4d983de1a4a047b36165a1f5a64de8ca2a417534cc472005c740ffcb9c6a - languageName: node - linkType: hard - "@babel/types@npm:^7.0.0, @babel/types@npm:^7.23.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.24.8, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.25.4, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3": version: 7.25.4 resolution: "@babel/types@npm:7.25.4" @@ -568,16 +493,6 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0": - version: 7.26.0 - resolution: "@babel/types@npm:7.26.0" - dependencies: - "@babel/helper-string-parser": "npm:^7.25.9" - "@babel/helper-validator-identifier": "npm:^7.25.9" - checksum: 10/40780741ecec886ed9edae234b5eb4976968cc70d72b4e5a40d55f83ff2cc457de20f9b0f4fe9d858350e43dab0ea496e7ef62e2b2f08df699481a76df02cd6e - languageName: node - linkType: hard - "@bcoe/v8-coverage@npm:^0.2.3": version: 0.2.3 resolution: "@bcoe/v8-coverage@npm:0.2.3" @@ -1239,20 +1154,6 @@ __metadata: languageName: node linkType: hard -"@jest/console@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/console@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - jest-message-util: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - slash: "npm:^3.0.0" - checksum: 10/82153eb24e61bd442bff350a7537d598e7c49097aabd9545b340582dcf1f17e5749baa342a67e564816a3a6ce746038b618ed9f66702140264bfa1e1d5cc9e5e - languageName: node - linkType: hard - "@jest/console@npm:^29.7.0": version: 29.7.0 resolution: "@jest/console@npm:29.7.0" @@ -1267,48 +1168,6 @@ __metadata: languageName: node linkType: hard -"@jest/core@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/core@npm:28.1.3" - dependencies: - "@jest/console": "npm:^28.1.3" - "@jest/reporters": "npm:^28.1.3" - "@jest/test-result": "npm:^28.1.3" - "@jest/transform": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - ansi-escapes: "npm:^4.2.1" - chalk: "npm:^4.0.0" - ci-info: "npm:^3.2.0" - exit: "npm:^0.1.2" - graceful-fs: "npm:^4.2.9" - jest-changed-files: "npm:^28.1.3" - jest-config: "npm:^28.1.3" - jest-haste-map: "npm:^28.1.3" - jest-message-util: "npm:^28.1.3" - jest-regex-util: "npm:^28.0.2" - jest-resolve: "npm:^28.1.3" - jest-resolve-dependencies: "npm:^28.1.3" - jest-runner: "npm:^28.1.3" - jest-runtime: "npm:^28.1.3" - jest-snapshot: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - jest-validate: "npm:^28.1.3" - jest-watcher: "npm:^28.1.3" - micromatch: "npm:^4.0.4" - pretty-format: "npm:^28.1.3" - rimraf: "npm:^3.0.0" - slash: "npm:^3.0.0" - strip-ansi: "npm:^6.0.0" - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - checksum: 10/72b56c7591dd1ec325c40e9f60f8111e17d4a09c918b7e5882de58ed1c656d6d34f085dfbdb49f65e6ac95b49919976c7b07821663cbcccd7f3a55c29db542b9 - languageName: node - linkType: hard - "@jest/core@npm:^29.7.0": version: 29.7.0 resolution: "@jest/core@npm:29.7.0" @@ -1350,18 +1209,6 @@ __metadata: languageName: node linkType: hard -"@jest/environment@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/environment@npm:28.1.3" - dependencies: - "@jest/fake-timers": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - jest-mock: "npm:^28.1.3" - checksum: 10/63a8efd099f8d5cd70398c7608d45fc91a5796b14d8f9f8c7fdb3a529e42004e3b60cf0c6e117cc88305d18ab7bb453f803a737e09293e9027a1e76ce835da57 - languageName: node - linkType: hard - "@jest/environment@npm:^29.7.0": version: 29.7.0 resolution: "@jest/environment@npm:29.7.0" @@ -1374,15 +1221,6 @@ __metadata: languageName: node linkType: hard -"@jest/expect-utils@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/expect-utils@npm:28.1.3" - dependencies: - jest-get-type: "npm:^28.0.2" - checksum: 10/f48e4c5b267438a565b6e4c00a06f2bd566dc65d8bb6114d57276ec1fa4f4cded548371e45caffe37c58e5cf3716dbec715c10cfacdae35c4c04b755d83fac96 - languageName: node - linkType: hard - "@jest/expect-utils@npm:^29.7.0": version: 29.7.0 resolution: "@jest/expect-utils@npm:29.7.0" @@ -1392,16 +1230,6 @@ __metadata: languageName: node linkType: hard -"@jest/expect@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/expect@npm:28.1.3" - dependencies: - expect: "npm:^28.1.3" - jest-snapshot: "npm:^28.1.3" - checksum: 10/31ea089e83a4c24f850043a97dfd777a352dd28a936819785f3d0de6e0bd537bfbfa8fd2df081db1adc68a6a55699e7d4ab3990d6a54e41753d86e5d2b66df2f - languageName: node - linkType: hard - "@jest/expect@npm:^29.7.0": version: 29.7.0 resolution: "@jest/expect@npm:29.7.0" @@ -1412,20 +1240,6 @@ __metadata: languageName: node linkType: hard -"@jest/fake-timers@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/fake-timers@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - "@sinonjs/fake-timers": "npm:^9.1.2" - "@types/node": "npm:*" - jest-message-util: "npm:^28.1.3" - jest-mock: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - checksum: 10/4002208f6637adc374175c97e845a19783f58874e9503fb956b801061ba1869a218964cf4631e1ac348e06e1667e982ceb94734db63ccfafdf37508f6b59be17 - languageName: node - linkType: hard - "@jest/fake-timers@npm:^29.7.0": version: 29.7.0 resolution: "@jest/fake-timers@npm:29.7.0" @@ -1440,17 +1254,6 @@ __metadata: languageName: node linkType: hard -"@jest/globals@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/globals@npm:28.1.3" - dependencies: - "@jest/environment": "npm:^28.1.3" - "@jest/expect": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - checksum: 10/3504bb23de629d466c6f2b6b75d2e1c1b10caccbbcfb7eaa82d22cc37711c8e364c243929581184846605c023b475ea6c42c2e3ea5994429a988d8d527af32cd - languageName: node - linkType: hard - "@jest/globals@npm:^29.7.0": version: 29.7.0 resolution: "@jest/globals@npm:29.7.0" @@ -1463,44 +1266,6 @@ __metadata: languageName: node linkType: hard -"@jest/reporters@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/reporters@npm:28.1.3" - dependencies: - "@bcoe/v8-coverage": "npm:^0.2.3" - "@jest/console": "npm:^28.1.3" - "@jest/test-result": "npm:^28.1.3" - "@jest/transform": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@jridgewell/trace-mapping": "npm:^0.3.13" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - collect-v8-coverage: "npm:^1.0.0" - exit: "npm:^0.1.2" - glob: "npm:^7.1.3" - graceful-fs: "npm:^4.2.9" - istanbul-lib-coverage: "npm:^3.0.0" - istanbul-lib-instrument: "npm:^5.1.0" - istanbul-lib-report: "npm:^3.0.0" - istanbul-lib-source-maps: "npm:^4.0.0" - istanbul-reports: "npm:^3.1.3" - jest-message-util: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - jest-worker: "npm:^28.1.3" - slash: "npm:^3.0.0" - string-length: "npm:^4.0.1" - strip-ansi: "npm:^6.0.0" - terminal-link: "npm:^2.0.0" - v8-to-istanbul: "npm:^9.0.1" - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - checksum: 10/bdce58bf1cf1fc0f7fb0c2ae02b5a9a1da32da83ee4697b2b23b8a5b0ac056af55dac07dcf7e869f963943e935da3bd26a788c478b6d52064c77320530d95a89 - languageName: node - linkType: hard - "@jest/reporters@npm:^29.7.0": version: 29.7.0 resolution: "@jest/reporters@npm:29.7.0" @@ -1538,15 +1303,6 @@ __metadata: languageName: node linkType: hard -"@jest/schemas@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/schemas@npm:28.1.3" - dependencies: - "@sinclair/typebox": "npm:^0.24.1" - checksum: 10/3cf1d4b66c9c4ffda58b246de1ddcba8e6ad085af63dccdf07922511f13b68c0cc480a7bc620cb4f3099a6f134801c747e1df7bfc7a4ef4dceefbdea3e31e1de - languageName: node - linkType: hard - "@jest/schemas@npm:^29.6.3": version: 29.6.3 resolution: "@jest/schemas@npm:29.6.3" @@ -1556,17 +1312,6 @@ __metadata: languageName: node linkType: hard -"@jest/source-map@npm:^28.1.2": - version: 28.1.2 - resolution: "@jest/source-map@npm:28.1.2" - dependencies: - "@jridgewell/trace-mapping": "npm:^0.3.13" - callsites: "npm:^3.0.0" - graceful-fs: "npm:^4.2.9" - checksum: 10/b82a5c2e93d35d86779c61a02ccb967d1b5cd2e9dd67d26d8add44958637cbbb99daeeb8129c7653389cb440dc2a2f5ae4d2183dc453c67669ff98938b775a3a - languageName: node - linkType: hard - "@jest/source-map@npm:^29.6.3": version: 29.6.3 resolution: "@jest/source-map@npm:29.6.3" @@ -1578,18 +1323,6 @@ __metadata: languageName: node linkType: hard -"@jest/test-result@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/test-result@npm:28.1.3" - dependencies: - "@jest/console": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/istanbul-lib-coverage": "npm:^2.0.0" - collect-v8-coverage: "npm:^1.0.0" - checksum: 10/d343f08e6e4971e8132540014711c5d29887651b036f03db8c7e9d6509fe9801316f0a6a393cd0af0431c50e6d1c1d310957f06b6cc20c08cab2e67b66a00c88 - languageName: node - linkType: hard - "@jest/test-result@npm:^29.7.0": version: 29.7.0 resolution: "@jest/test-result@npm:29.7.0" @@ -1602,18 +1335,6 @@ __metadata: languageName: node linkType: hard -"@jest/test-sequencer@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/test-sequencer@npm:28.1.3" - dependencies: - "@jest/test-result": "npm:^28.1.3" - graceful-fs: "npm:^4.2.9" - jest-haste-map: "npm:^28.1.3" - slash: "npm:^3.0.0" - checksum: 10/a2f05475c39a8e3e446a0f98c6830aa2492daffe8286db58c95e1870479ed4c2a74e2e51fac1d8b2958858aeb194331145c217d04482fb9312ba1a9e7dded171 - languageName: node - linkType: hard - "@jest/test-sequencer@npm:^29.7.0": version: 29.7.0 resolution: "@jest/test-sequencer@npm:29.7.0" @@ -1626,29 +1347,6 @@ __metadata: languageName: node linkType: hard -"@jest/transform@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/transform@npm:28.1.3" - dependencies: - "@babel/core": "npm:^7.11.6" - "@jest/types": "npm:^28.1.3" - "@jridgewell/trace-mapping": "npm:^0.3.13" - babel-plugin-istanbul: "npm:^6.1.1" - chalk: "npm:^4.0.0" - convert-source-map: "npm:^1.4.0" - fast-json-stable-stringify: "npm:^2.0.0" - graceful-fs: "npm:^4.2.9" - jest-haste-map: "npm:^28.1.3" - jest-regex-util: "npm:^28.0.2" - jest-util: "npm:^28.1.3" - micromatch: "npm:^4.0.4" - pirates: "npm:^4.0.4" - slash: "npm:^3.0.0" - write-file-atomic: "npm:^4.0.1" - checksum: 10/89bc17ca22d5e81eb35e9549beaa5778da0209c12c108552322b72fa7b41a387d119168dea28fd9415f16883fc6dd7a811690654ebb958375e70158b4d0e2965 - languageName: node - linkType: hard - "@jest/transform@npm:^29.7.0": version: 29.7.0 resolution: "@jest/transform@npm:29.7.0" @@ -1685,20 +1383,6 @@ __metadata: languageName: node linkType: hard -"@jest/types@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/types@npm:28.1.3" - dependencies: - "@jest/schemas": "npm:^28.1.3" - "@types/istanbul-lib-coverage": "npm:^2.0.0" - "@types/istanbul-reports": "npm:^3.0.0" - "@types/node": "npm:*" - "@types/yargs": "npm:^17.0.8" - chalk: "npm:^4.0.0" - checksum: 10/a90e636df760799b6c3d91e34e539e701ea803e80312257e674e345a3c23a7c892df7a301afbc7883ec1d623daf3ba266cde57c5965e0692e5f1e61915d3524b - languageName: node - linkType: hard - "@jest/types@npm:^29.6.3": version: 29.6.3 resolution: "@jest/types@npm:29.6.3" @@ -1755,7 +1439,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.13, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": +"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": version: 0.3.25 resolution: "@jridgewell/trace-mapping@npm:0.3.25" dependencies: @@ -1776,23 +1460,6 @@ __metadata: languageName: node linkType: hard -"@lavamoat/allow-scripts@npm:^3.0.4": - version: 3.3.0 - resolution: "@lavamoat/allow-scripts@npm:3.3.0" - dependencies: - "@lavamoat/aa": "npm:^4.3.0" - "@npmcli/run-script": "npm:8.1.0" - bin-links: "npm:4.0.4" - npm-normalize-package-bin: "npm:3.0.1" - yargs: "npm:17.7.2" - peerDependencies: - "@lavamoat/preinstall-always-fail": "*" - bin: - allow-scripts: src/cli.js - checksum: 10/476043c56425c3077d051a4a6ee4d045fab8b80bf16d50a9201c68224a2ddd77af03490388b7380004d348b11abf4ab7854ba52ba514d10d17c05d40dc8b870d - languageName: node - linkType: hard - "@lavamoat/allow-scripts@npm:^3.2.1": version: 3.2.1 resolution: "@lavamoat/allow-scripts@npm:3.2.1" @@ -1810,7 +1477,7 @@ __metadata: languageName: node linkType: hard -"@lavamoat/preinstall-always-fail@npm:^2.0.0, @lavamoat/preinstall-always-fail@npm:^2.1.0": +"@lavamoat/preinstall-always-fail@npm:^2.1.0": version: 2.1.0 resolution: "@lavamoat/preinstall-always-fail@npm:2.1.0" checksum: 10/385c3fac828b9edff2d8b5825bd29ea475206046984cdb3217518ad655f145ff37046414041534960d92cbe0759f0dc675f7c7dcf39a95003ae715a834fbd750 @@ -2461,16 +2128,15 @@ __metadata: languageName: node linkType: hard -"@metamask/keyring-api@workspace:packages/keyring-api": +"@metamask/keyring-api@workspace:^, @metamask/keyring-api@workspace:packages/keyring-api": version: 0.0.0-use.local resolution: "@metamask/keyring-api@workspace:packages/keyring-api" dependencies: "@lavamoat/allow-scripts": "npm:^3.2.1" "@lavamoat/preinstall-always-fail": "npm:^2.1.0" "@metamask/auto-changelog": "npm:^3.4.4" - "@metamask/keyring-utils": "npm:^0.0.1" + "@metamask/keyring-utils": "workspace:^" "@metamask/providers": "npm:^18.1.0" - "@metamask/snaps-sdk": "npm:^6.7.0" "@metamask/superstruct": "npm:^3.1.0" "@metamask/utils": "npm:^9.2.1" "@ts-bridge/cli": "npm:^0.6.0" @@ -2488,35 +2154,60 @@ __metadata: typedoc: "npm:^0.25.13" typescript: "npm:~5.6.3" uuid: "npm:^9.0.1" - webextension-polyfill: "npm:^0.12.0" - peerDependencies: - "@metamask/providers": ^18.1.0 languageName: unknown linkType: soft -"@metamask/keyring-utils@npm:^0.0.1, @metamask/keyring-utils@workspace:packages/keyring-utils": +"@metamask/keyring-internal-api@workspace:packages/keyring-internal-api": + version: 0.0.0-use.local + resolution: "@metamask/keyring-internal-api@workspace:packages/keyring-internal-api" + dependencies: + "@lavamoat/allow-scripts": "npm:^3.2.1" + "@lavamoat/preinstall-always-fail": "npm:^2.1.0" + "@metamask/auto-changelog": "npm:^3.4.4" + "@metamask/keyring-api": "workspace:^" + "@metamask/keyring-utils": "workspace:^" + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^9.2.1" + "@ts-bridge/cli": "npm:^0.6.0" + "@types/jest": "npm:^29.5.12" + "@types/node": "npm:^20.12.12" + bech32: "npm:^2.0.0" + deepmerge: "npm:^4.2.2" + depcheck: "npm:^1.4.7" + jest: "npm:^29.5.0" + jest-it-up: "npm:^3.1.0" + rimraf: "npm:^5.0.7" + ts-jest: "npm:^29.0.5" + ts-node: "npm:^10.9.2" + tsd: "npm:^0.31.0" + typedoc: "npm:^0.25.13" + typescript: "npm:~5.6.3" + languageName: unknown + linkType: soft + +"@metamask/keyring-utils@workspace:^, @metamask/keyring-utils@workspace:packages/keyring-utils": version: 0.0.0-use.local resolution: "@metamask/keyring-utils@workspace:packages/keyring-utils" dependencies: - "@lavamoat/allow-scripts": "npm:^3.0.4" - "@lavamoat/preinstall-always-fail": "npm:^2.0.0" + "@lavamoat/allow-scripts": "npm:^3.2.1" + "@lavamoat/preinstall-always-fail": "npm:^2.1.0" "@metamask/auto-changelog": "npm:^3.4.4" - "@metamask/providers": "npm:^17.1.1" "@metamask/superstruct": "npm:^3.1.0" - "@metamask/utils": "npm:^9.1.0" + "@metamask/utils": "npm:^9.2.1" + "@ts-bridge/cli": "npm:^0.6.0" "@types/jest": "npm:^29.5.12" "@types/node": "npm:^20.12.12" "@types/uuid": "npm:^9.0.8" deepmerge: "npm:^4.2.2" depcheck: "npm:^1.4.7" - jest: "npm:^28.1.3" + jest: "npm:^29.5.0" jest-it-up: "npm:^3.1.0" rimraf: "npm:^5.0.7" - ts-jest: "npm:^28.0.8" + ts-jest: "npm:^29.0.5" ts-node: "npm:^10.9.2" tsd: "npm:^0.31.0" typedoc: "npm:^0.25.13" - typescript: "npm:~4.8.4" + typescript: "npm:~5.6.3" uuid: "npm:^9.0.1" languageName: unknown linkType: soft @@ -2586,27 +2277,6 @@ __metadata: languageName: node linkType: hard -"@metamask/providers@npm:^17.1.1": - version: 17.2.1 - resolution: "@metamask/providers@npm:17.2.1" - dependencies: - "@metamask/json-rpc-engine": "npm:^9.0.1" - "@metamask/json-rpc-middleware-stream": "npm:^8.0.1" - "@metamask/object-multiplex": "npm:^2.0.0" - "@metamask/rpc-errors": "npm:^6.3.1" - "@metamask/safe-event-emitter": "npm:^3.1.1" - "@metamask/utils": "npm:^9.0.0" - detect-browser: "npm:^5.2.0" - extension-port-stream: "npm:^4.1.0" - fast-deep-equal: "npm:^3.1.3" - is-stream: "npm:^2.0.0" - readable-stream: "npm:^3.6.2" - peerDependencies: - webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0 - checksum: 10/ff9cbcdd4cfa410c52ae0d9d39ad9285fb21f583bcb36a8a39d1862681fe17483008c15ab0ce87797ea94cad82a2f2e58b29b1db1f02df151f9cf3b05013e8a4 - languageName: node - linkType: hard - "@metamask/providers@npm:^17.1.2": version: 17.2.0 resolution: "@metamask/providers@npm:17.2.0" @@ -3128,13 +2798,6 @@ __metadata: languageName: node linkType: hard -"@sinclair/typebox@npm:^0.24.1": - version: 0.24.51 - resolution: "@sinclair/typebox@npm:0.24.51" - checksum: 10/7886847b9deda1d926934066fe69165a1d9bbe7b0f836543c25efb96173c17009ef7a98619f48b379294bf27958844da3428eb35e65f8d941ea43563ad6e961e - languageName: node - linkType: hard - "@sinclair/typebox@npm:^0.27.8": version: 0.27.8 resolution: "@sinclair/typebox@npm:0.27.8" @@ -3156,15 +2819,6 @@ __metadata: languageName: node linkType: hard -"@sinonjs/commons@npm:^1.7.0": - version: 1.8.6 - resolution: "@sinonjs/commons@npm:1.8.6" - dependencies: - type-detect: "npm:4.0.8" - checksum: 10/51987338fd8b4d1e135822ad593dd23a3288764aa41d83c695124d512bc38b87eece859078008651ecc7f1df89a7e558a515dc6f02d21a93be4ba50b39a28914 - languageName: node - linkType: hard - "@sinonjs/commons@npm:^3.0.0, @sinonjs/commons@npm:^3.0.1": version: 3.0.1 resolution: "@sinonjs/commons@npm:3.0.1" @@ -3192,15 +2846,6 @@ __metadata: languageName: node linkType: hard -"@sinonjs/fake-timers@npm:^9.1.2": - version: 9.1.2 - resolution: "@sinonjs/fake-timers@npm:9.1.2" - dependencies: - "@sinonjs/commons": "npm:^1.7.0" - checksum: 10/033c74ad389b0655b6af2fa1af31dddf45878e65879f06c5d1940e0ceb053a234f2f46c728dcd97df8ee9312431e45dd7aedaee3a69d47f73a2001a7547fc3d6 - languageName: node - linkType: hard - "@sinonjs/samsam@npm:^8.0.1": version: 8.0.2 resolution: "@sinonjs/samsam@npm:8.0.2" @@ -3839,13 +3484,6 @@ __metadata: languageName: node linkType: hard -"@types/prettier@npm:^2.1.5": - version: 2.7.3 - resolution: "@types/prettier@npm:2.7.3" - checksum: 10/cda84c19acc3bf327545b1ce71114a7d08efbd67b5030b9e8277b347fa57b05178045f70debe1d363ff7efdae62f237260713aafc2d7217e06fc99b048a88497 - languageName: node - linkType: hard - "@types/punycode@npm:^2.1.0": version: 2.1.4 resolution: "@types/punycode@npm:2.1.4" @@ -4654,23 +4292,6 @@ __metadata: languageName: node linkType: hard -"babel-jest@npm:^28.1.3": - version: 28.1.3 - resolution: "babel-jest@npm:28.1.3" - dependencies: - "@jest/transform": "npm:^28.1.3" - "@types/babel__core": "npm:^7.1.14" - babel-plugin-istanbul: "npm:^6.1.1" - babel-preset-jest: "npm:^28.1.3" - chalk: "npm:^4.0.0" - graceful-fs: "npm:^4.2.9" - slash: "npm:^3.0.0" - peerDependencies: - "@babel/core": ^7.8.0 - checksum: 10/6dcbf194a037fb3df18d2aee56a3919a98a9b34292d1eb4aad823ebfa8b67f5a55f897213c1aafd52183928e99770319b8a094681ccb2910dc9993e6a7c1fd61 - languageName: node - linkType: hard - "babel-jest@npm:^29.7.0": version: 29.7.0 resolution: "babel-jest@npm:29.7.0" @@ -4701,18 +4322,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-jest-hoist@npm:^28.1.3": - version: 28.1.3 - resolution: "babel-plugin-jest-hoist@npm:28.1.3" - dependencies: - "@babel/template": "npm:^7.3.3" - "@babel/types": "npm:^7.3.3" - "@types/babel__core": "npm:^7.1.14" - "@types/babel__traverse": "npm:^7.0.6" - checksum: 10/355e383dae2b50efa0aff73a751f6bc55e7ae19ddfe72c73f4a0ad7667a671175aba17d824833d98b33602da18dd04e5e5d37d03c4f245940d8664c45ad29df5 - languageName: node - linkType: hard - "babel-plugin-jest-hoist@npm:^29.6.3": version: 29.6.3 resolution: "babel-plugin-jest-hoist@npm:29.6.3" @@ -4747,21 +4356,9 @@ __metadata: languageName: node linkType: hard -"babel-preset-jest@npm:^28.1.3": - version: 28.1.3 - resolution: "babel-preset-jest@npm:28.1.3" - dependencies: - babel-plugin-jest-hoist: "npm:^28.1.3" - babel-preset-current-node-syntax: "npm:^1.0.0" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10/8248a4a5ca4242cc06ad13b10b9183ad2664da8fb0da060c352223dcf286f0ce9c708fa17901dc44ecabec25e6d309e5e5b9830a61dd777c3925f187a345a47d - languageName: node - linkType: hard - -"babel-preset-jest@npm:^29.6.3": - version: 29.6.3 - resolution: "babel-preset-jest@npm:29.6.3" +"babel-preset-jest@npm:^29.6.3": + version: 29.6.3 + resolution: "babel-preset-jest@npm:29.6.3" dependencies: babel-plugin-jest-hoist: "npm:^29.6.3" babel-preset-current-node-syntax: "npm:^1.0.0" @@ -5018,7 +4615,7 @@ __metadata: languageName: node linkType: hard -"bs-logger@npm:0.x, bs-logger@npm:^0.2.6": +"bs-logger@npm:^0.2.6": version: 0.2.6 resolution: "bs-logger@npm:0.2.6" dependencies: @@ -5491,13 +5088,6 @@ __metadata: languageName: node linkType: hard -"convert-source-map@npm:^1.4.0": - version: 1.9.0 - resolution: "convert-source-map@npm:1.9.0" - checksum: 10/dc55a1f28ddd0e9485ef13565f8f756b342f9a46c4ae18b843fe3c30c675d058d6a4823eff86d472f187b176f0adf51ea7b69ea38be34be4a63cbbf91b0593c8 - languageName: node - linkType: hard - "convert-source-map@npm:^1.6.0": version: 1.7.0 resolution: "convert-source-map@npm:1.7.0" @@ -5719,13 +5309,6 @@ __metadata: languageName: node linkType: hard -"dedent@npm:^0.7.0": - version: 0.7.0 - resolution: "dedent@npm:0.7.0" - checksum: 10/87de191050d9a40dd70cad01159a0bcf05ecb59750951242070b6abf9569088684880d00ba92a955b4058804f16eeaf91d604f283929b4f614d181cd7ae633d2 - languageName: node - linkType: hard - "dedent@npm:^1.0.0": version: 1.5.3 resolution: "dedent@npm:1.5.3" @@ -5877,13 +5460,6 @@ __metadata: languageName: node linkType: hard -"diff-sequences@npm:^28.1.1": - version: 28.1.1 - resolution: "diff-sequences@npm:28.1.1" - checksum: 10/89752708215cf0d13ec98cb3cded36154951beec9ac8c23d5a665498ba880e1e3aad544ad046ad5223c141fc35b362665fae534e14a253654da77b514a28438d - languageName: node - linkType: hard - "diff-sequences@npm:^29.6.3": version: 29.6.3 resolution: "diff-sequences@npm:29.6.3" @@ -6010,13 +5586,6 @@ __metadata: languageName: node linkType: hard -"emittery@npm:^0.10.2": - version: 0.10.2 - resolution: "emittery@npm:0.10.2" - checksum: 10/fa86fc2b1f4c792d7d479a4de1a6a1f74b0b597770bae770336f0be6501e64be0995aa07d284ae502b269f5cec960cd0c44c91dd090d06d8deecee6d9787e396 - languageName: node - linkType: hard - "emittery@npm:^0.13.1": version: 0.13.1 resolution: "emittery@npm:0.13.1" @@ -6804,19 +6373,6 @@ __metadata: languageName: node linkType: hard -"expect@npm:^28.1.3": - version: 28.1.3 - resolution: "expect@npm:28.1.3" - dependencies: - "@jest/expect-utils": "npm:^28.1.3" - jest-get-type: "npm:^28.0.2" - jest-matcher-utils: "npm:^28.1.3" - jest-message-util: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - checksum: 10/87033c88f7a578063ae7de98000fbd423bdb751756b1c6a1c69cd2b093bdb8b11a5b7a66eb89984068850d14978c7daffc2cc8ed56eb912424c24885a7573061 - languageName: node - linkType: hard - "expect@npm:^29.0.0, expect@npm:^29.7.0": version: 29.7.0 resolution: "expect@npm:29.7.0" @@ -8041,19 +7597,6 @@ __metadata: languageName: node linkType: hard -"istanbul-lib-instrument@npm:^5.1.0": - version: 5.2.1 - resolution: "istanbul-lib-instrument@npm:5.2.1" - dependencies: - "@babel/core": "npm:^7.12.3" - "@babel/parser": "npm:^7.14.7" - "@istanbuljs/schema": "npm:^0.1.2" - istanbul-lib-coverage: "npm:^3.2.0" - semver: "npm:^6.3.0" - checksum: 10/bbc4496c2f304d799f8ec22202ab38c010ac265c441947f075c0f7d46bd440b45c00e46017cf9053453d42182d768b1d6ed0e70a142c95ab00df9843aa5ab80e - languageName: node - linkType: hard - "istanbul-lib-instrument@npm:^6.0.0": version: 6.0.3 resolution: "istanbul-lib-instrument@npm:6.0.3" @@ -8148,16 +7691,6 @@ __metadata: languageName: node linkType: hard -"jest-changed-files@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-changed-files@npm:28.1.3" - dependencies: - execa: "npm:^5.0.0" - p-limit: "npm:^3.1.0" - checksum: 10/206be715fed00c70d69f46f6274129816b2959dd9fe5d77b7c929d572eef8f55092baea48f51cf45848edd17e23b00aa720201b5e7781904e6ede06ba666e668 - languageName: node - linkType: hard - "jest-changed-files@npm:^29.7.0": version: 29.7.0 resolution: "jest-changed-files@npm:29.7.0" @@ -8169,33 +7702,6 @@ __metadata: languageName: node linkType: hard -"jest-circus@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-circus@npm:28.1.3" - dependencies: - "@jest/environment": "npm:^28.1.3" - "@jest/expect": "npm:^28.1.3" - "@jest/test-result": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - co: "npm:^4.6.0" - dedent: "npm:^0.7.0" - is-generator-fn: "npm:^2.0.0" - jest-each: "npm:^28.1.3" - jest-matcher-utils: "npm:^28.1.3" - jest-message-util: "npm:^28.1.3" - jest-runtime: "npm:^28.1.3" - jest-snapshot: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - p-limit: "npm:^3.1.0" - pretty-format: "npm:^28.1.3" - slash: "npm:^3.0.0" - stack-utils: "npm:^2.0.3" - checksum: 10/3ac1f369cadbdd1982c123c04bc69f140b9790a8d0a729084f53aa13154bbdf318ba162dc70daecc37ef1d620afa339408d6b99a0314306238c547dc6a25b4a3 - languageName: node - linkType: hard - "jest-circus@npm:^29.7.0": version: 29.7.0 resolution: "jest-circus@npm:29.7.0" @@ -8224,33 +7730,6 @@ __metadata: languageName: node linkType: hard -"jest-cli@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-cli@npm:28.1.3" - dependencies: - "@jest/core": "npm:^28.1.3" - "@jest/test-result": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - chalk: "npm:^4.0.0" - exit: "npm:^0.1.2" - graceful-fs: "npm:^4.2.9" - import-local: "npm:^3.0.2" - jest-config: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - jest-validate: "npm:^28.1.3" - prompts: "npm:^2.0.1" - yargs: "npm:^17.3.1" - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - bin: - jest: bin/jest.js - checksum: 10/935a0c517e7b972e60543fdb921302fc63d78e629ab077195c91336279c0815978ca2e03c65ec6dbff3226a5c4ee64b13c7ef5a86387330c9da54454cd4bbbfb - languageName: node - linkType: hard - "jest-cli@npm:^29.7.0": version: 29.7.0 resolution: "jest-cli@npm:29.7.0" @@ -8277,44 +7756,6 @@ __metadata: languageName: node linkType: hard -"jest-config@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-config@npm:28.1.3" - dependencies: - "@babel/core": "npm:^7.11.6" - "@jest/test-sequencer": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - babel-jest: "npm:^28.1.3" - chalk: "npm:^4.0.0" - ci-info: "npm:^3.2.0" - deepmerge: "npm:^4.2.2" - glob: "npm:^7.1.3" - graceful-fs: "npm:^4.2.9" - jest-circus: "npm:^28.1.3" - jest-environment-node: "npm:^28.1.3" - jest-get-type: "npm:^28.0.2" - jest-regex-util: "npm:^28.0.2" - jest-resolve: "npm:^28.1.3" - jest-runner: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - jest-validate: "npm:^28.1.3" - micromatch: "npm:^4.0.4" - parse-json: "npm:^5.2.0" - pretty-format: "npm:^28.1.3" - slash: "npm:^3.0.0" - strip-json-comments: "npm:^3.1.1" - peerDependencies: - "@types/node": "*" - ts-node: ">=9.0.0" - peerDependenciesMeta: - "@types/node": - optional: true - ts-node: - optional: true - checksum: 10/457d8709e24e0e4d8a8a8e074a65092e896d80f30d80c0448f8ce6a24bd0b30060a1a593a20aa7fb8c3c2228d519f0a979ccdff3a176efb60afc7187785d59cf - languageName: node - linkType: hard - "jest-config@npm:^29.7.0": version: 29.7.0 resolution: "jest-config@npm:29.7.0" @@ -8353,18 +7794,6 @@ __metadata: languageName: node linkType: hard -"jest-diff@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-diff@npm:28.1.3" - dependencies: - chalk: "npm:^4.0.0" - diff-sequences: "npm:^28.1.1" - jest-get-type: "npm:^28.0.2" - pretty-format: "npm:^28.1.3" - checksum: 10/42b8d82c59df879b2cfdf3583fecd40c31ce8c9364644d8d430f5bd533a32e475ca0b383b7a744293332008c50f7901bedeac73c60463ac9e7e2b80249e1325c - languageName: node - linkType: hard - "jest-diff@npm:^29.0.3, jest-diff@npm:^29.7.0": version: 29.7.0 resolution: "jest-diff@npm:29.7.0" @@ -8377,15 +7806,6 @@ __metadata: languageName: node linkType: hard -"jest-docblock@npm:^28.1.1": - version: 28.1.1 - resolution: "jest-docblock@npm:28.1.1" - dependencies: - detect-newline: "npm:^3.0.0" - checksum: 10/4062cb9ba54c88c88f5452fcd054937f35755240014ea277ff8dbfde30efcbdb77a4844a09279e55ec98f2fe9a1978a9b8583315e93fdf03602a619ae070356b - languageName: node - linkType: hard - "jest-docblock@npm:^29.7.0": version: 29.7.0 resolution: "jest-docblock@npm:29.7.0" @@ -8395,19 +7815,6 @@ __metadata: languageName: node linkType: hard -"jest-each@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-each@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - chalk: "npm:^4.0.0" - jest-get-type: "npm:^28.0.2" - jest-util: "npm:^28.1.3" - pretty-format: "npm:^28.1.3" - checksum: 10/4877cdda70048923ad6aabf25779e3e2c6bc580253d95739b8af291fbc506b95b043031b498f26807093abe9e6e93ecd7b50e3ce5b7ab175fc21637a197a248b - languageName: node - linkType: hard - "jest-each@npm:^29.7.0": version: 29.7.0 resolution: "jest-each@npm:29.7.0" @@ -8442,20 +7849,6 @@ __metadata: languageName: node linkType: hard -"jest-environment-node@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-environment-node@npm:28.1.3" - dependencies: - "@jest/environment": "npm:^28.1.3" - "@jest/fake-timers": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - jest-mock: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - checksum: 10/ab9ec5c57309a0ca40ebc58ba84b4980445f24d351cc3292c8c8715062c7ea14442d9d8e7701eccb9cb810f425bbdb7eba631fd76fb1835b92150b6bdda7cb18 - languageName: node - linkType: hard - "jest-environment-node@npm:^29.7.0": version: 29.7.0 resolution: "jest-environment-node@npm:29.7.0" @@ -8470,13 +7863,6 @@ __metadata: languageName: node linkType: hard -"jest-get-type@npm:^28.0.2": - version: 28.0.2 - resolution: "jest-get-type@npm:28.0.2" - checksum: 10/5281d7c89bc8156605f6d15784f45074f4548501195c26e9b188742768f72d40948252d13230ea905b5349038865a1a8eeff0e614cc530ff289dfc41fe843abd - languageName: node - linkType: hard - "jest-get-type@npm:^29.6.3": version: 29.6.3 resolution: "jest-get-type@npm:29.6.3" @@ -8484,29 +7870,6 @@ __metadata: languageName: node linkType: hard -"jest-haste-map@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-haste-map@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - "@types/graceful-fs": "npm:^4.1.3" - "@types/node": "npm:*" - anymatch: "npm:^3.0.3" - fb-watchman: "npm:^2.0.0" - fsevents: "npm:^2.3.2" - graceful-fs: "npm:^4.2.9" - jest-regex-util: "npm:^28.0.2" - jest-util: "npm:^28.1.3" - jest-worker: "npm:^28.1.3" - micromatch: "npm:^4.0.4" - walker: "npm:^1.0.8" - dependenciesMeta: - fsevents: - optional: true - checksum: 10/c78e0e81e3f138f379440fb2ddfdc3753da377b74477df02ef404d5de1508d6545d28cf02516713dbde093a8c112098be6f50080a7a8fab6b888992720322a57 - languageName: node - linkType: hard - "jest-haste-map@npm:^29.7.0": version: 29.7.0 resolution: "jest-haste-map@npm:29.7.0" @@ -8543,16 +7906,6 @@ __metadata: languageName: node linkType: hard -"jest-leak-detector@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-leak-detector@npm:28.1.3" - dependencies: - jest-get-type: "npm:^28.0.2" - pretty-format: "npm:^28.1.3" - checksum: 10/2e976a4880cf9af11f53a19f6a3820e0f90b635a900737a5427fc42e337d5628ba446dcd7c020ecea3806cf92bc0bbf6982ed62a9cd84e5a13d8751aa30fbbb7 - languageName: node - linkType: hard - "jest-leak-detector@npm:^29.7.0": version: 29.7.0 resolution: "jest-leak-detector@npm:29.7.0" @@ -8563,18 +7916,6 @@ __metadata: languageName: node linkType: hard -"jest-matcher-utils@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-matcher-utils@npm:28.1.3" - dependencies: - chalk: "npm:^4.0.0" - jest-diff: "npm:^28.1.3" - jest-get-type: "npm:^28.0.2" - pretty-format: "npm:^28.1.3" - checksum: 10/958f4bacdaee6949f1d1da413129f2249083bc6fa3f4ac5c559795b370aec7159f99f02340f706cc895b90938c2bafe1aab347c9a34f8819c59afd1a4cd6c009 - languageName: node - linkType: hard - "jest-matcher-utils@npm:^29.7.0": version: 29.7.0 resolution: "jest-matcher-utils@npm:29.7.0" @@ -8587,23 +7928,6 @@ __metadata: languageName: node linkType: hard -"jest-message-util@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-message-util@npm:28.1.3" - dependencies: - "@babel/code-frame": "npm:^7.12.13" - "@jest/types": "npm:^28.1.3" - "@types/stack-utils": "npm:^2.0.0" - chalk: "npm:^4.0.0" - graceful-fs: "npm:^4.2.9" - micromatch: "npm:^4.0.4" - pretty-format: "npm:^28.1.3" - slash: "npm:^3.0.0" - stack-utils: "npm:^2.0.3" - checksum: 10/91137a507e9eb79ef6156a3d17c882a181fa662da28cc1a86245ff53ba13726653c8d5fed2660e922aae020a9caca4d22c3689bfe61a215c8a17a43e01b7eb5c - languageName: node - linkType: hard - "jest-message-util@npm:^29.7.0": version: 29.7.0 resolution: "jest-message-util@npm:29.7.0" @@ -8621,16 +7945,6 @@ __metadata: languageName: node linkType: hard -"jest-mock@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-mock@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - checksum: 10/43cbec0ceddea795b8b2bc09f8632eecc97b88ef018a9c9737b887ed6cbdbda000a436e9165dce2bccfbb949be8b0daca6faa530dc390d43a0e5e3099f3ae216 - languageName: node - linkType: hard - "jest-mock@npm:^29.7.0": version: 29.7.0 resolution: "jest-mock@npm:29.7.0" @@ -8654,13 +7968,6 @@ __metadata: languageName: node linkType: hard -"jest-regex-util@npm:^28.0.2": - version: 28.0.2 - resolution: "jest-regex-util@npm:28.0.2" - checksum: 10/0ea8c5c82ec88bc85e273c0ec82e0c0f35f7a1e2d055070e50f0cc2a2177f848eec55f73e37ae0d045c3db5014c42b2f90ac62c1ab3fdb354d2abd66a9e08add - languageName: node - linkType: hard - "jest-regex-util@npm:^29.6.3": version: 29.6.3 resolution: "jest-regex-util@npm:29.6.3" @@ -8668,16 +7975,6 @@ __metadata: languageName: node linkType: hard -"jest-resolve-dependencies@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-resolve-dependencies@npm:28.1.3" - dependencies: - jest-regex-util: "npm:^28.0.2" - jest-snapshot: "npm:^28.1.3" - checksum: 10/5c3128ea5f702a22141116b6a3d83c594c192d3e17b7235a1d47ecd64bcd9aa4924100668804e6b54faf5a1437a366f37165a2ea7170a2ce35899323b4ed7aac - languageName: node - linkType: hard - "jest-resolve-dependencies@npm:^29.7.0": version: 29.7.0 resolution: "jest-resolve-dependencies@npm:29.7.0" @@ -8688,23 +7985,6 @@ __metadata: languageName: node linkType: hard -"jest-resolve@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-resolve@npm:28.1.3" - dependencies: - chalk: "npm:^4.0.0" - graceful-fs: "npm:^4.2.9" - jest-haste-map: "npm:^28.1.3" - jest-pnp-resolver: "npm:^1.2.2" - jest-util: "npm:^28.1.3" - jest-validate: "npm:^28.1.3" - resolve: "npm:^1.20.0" - resolve.exports: "npm:^1.1.0" - slash: "npm:^3.0.0" - checksum: 10/742b2301a43172206bf88d405df73d19510cfd4eacb0fb16d620157de408e9f7399567a57c86c61b30aaa303c15d88a77b38a69ad0230d288e44db4d44d5f724 - languageName: node - linkType: hard - "jest-resolve@npm:^29.7.0": version: 29.7.0 resolution: "jest-resolve@npm:29.7.0" @@ -8722,35 +8002,6 @@ __metadata: languageName: node linkType: hard -"jest-runner@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-runner@npm:28.1.3" - dependencies: - "@jest/console": "npm:^28.1.3" - "@jest/environment": "npm:^28.1.3" - "@jest/test-result": "npm:^28.1.3" - "@jest/transform": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - emittery: "npm:^0.10.2" - graceful-fs: "npm:^4.2.9" - jest-docblock: "npm:^28.1.1" - jest-environment-node: "npm:^28.1.3" - jest-haste-map: "npm:^28.1.3" - jest-leak-detector: "npm:^28.1.3" - jest-message-util: "npm:^28.1.3" - jest-resolve: "npm:^28.1.3" - jest-runtime: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - jest-watcher: "npm:^28.1.3" - jest-worker: "npm:^28.1.3" - p-limit: "npm:^3.1.0" - source-map-support: "npm:0.5.13" - checksum: 10/0fb6ed4f628650da9ff502b89bfdf98ea7f3015ad0369429c223ddae793573d9c5f350e95756e8bb827e2e6e3de03e5cb94569075c5788e574697b63c09d80ae - languageName: node - linkType: hard - "jest-runner@npm:^29.7.0": version: 29.7.0 resolution: "jest-runner@npm:29.7.0" @@ -8780,36 +8031,6 @@ __metadata: languageName: node linkType: hard -"jest-runtime@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-runtime@npm:28.1.3" - dependencies: - "@jest/environment": "npm:^28.1.3" - "@jest/fake-timers": "npm:^28.1.3" - "@jest/globals": "npm:^28.1.3" - "@jest/source-map": "npm:^28.1.2" - "@jest/test-result": "npm:^28.1.3" - "@jest/transform": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - chalk: "npm:^4.0.0" - cjs-module-lexer: "npm:^1.0.0" - collect-v8-coverage: "npm:^1.0.0" - execa: "npm:^5.0.0" - glob: "npm:^7.1.3" - graceful-fs: "npm:^4.2.9" - jest-haste-map: "npm:^28.1.3" - jest-message-util: "npm:^28.1.3" - jest-mock: "npm:^28.1.3" - jest-regex-util: "npm:^28.0.2" - jest-resolve: "npm:^28.1.3" - jest-snapshot: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - slash: "npm:^3.0.0" - strip-bom: "npm:^4.0.0" - checksum: 10/d3d91b3f1082bbe3f87dc11ad7abce12f323797d98b3fa5ef7fb5efbd6d30e42041e3732cb8be5d41f0c8d8312d14461381d829ed1fe4e3712cfc82ea4a586fc - languageName: node - linkType: hard - "jest-runtime@npm:^29.7.0": version: 29.7.0 resolution: "jest-runtime@npm:29.7.0" @@ -8850,37 +8071,6 @@ __metadata: languageName: node linkType: hard -"jest-snapshot@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-snapshot@npm:28.1.3" - dependencies: - "@babel/core": "npm:^7.11.6" - "@babel/generator": "npm:^7.7.2" - "@babel/plugin-syntax-typescript": "npm:^7.7.2" - "@babel/traverse": "npm:^7.7.2" - "@babel/types": "npm:^7.3.3" - "@jest/expect-utils": "npm:^28.1.3" - "@jest/transform": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/babel__traverse": "npm:^7.0.6" - "@types/prettier": "npm:^2.1.5" - babel-preset-current-node-syntax: "npm:^1.0.0" - chalk: "npm:^4.0.0" - expect: "npm:^28.1.3" - graceful-fs: "npm:^4.2.9" - jest-diff: "npm:^28.1.3" - jest-get-type: "npm:^28.0.2" - jest-haste-map: "npm:^28.1.3" - jest-matcher-utils: "npm:^28.1.3" - jest-message-util: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - natural-compare: "npm:^1.4.0" - pretty-format: "npm:^28.1.3" - semver: "npm:^7.3.5" - checksum: 10/4e1f4e2aa5ccc776f1fdaab75f96342534f737df0d43458e0614af362f7e80097909f69e5d8f2d0aed2caae07fa122b1cf7b8da0c97c44c3b2d06da472d7ad79 - languageName: node - linkType: hard - "jest-snapshot@npm:^29.7.0": version: 29.7.0 resolution: "jest-snapshot@npm:29.7.0" @@ -8923,20 +8113,6 @@ __metadata: languageName: node linkType: hard -"jest-util@npm:^28.0.0, jest-util@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-util@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - ci-info: "npm:^3.2.0" - graceful-fs: "npm:^4.2.9" - picomatch: "npm:^2.2.3" - checksum: 10/92895523d30ddde8f22bebbc20ed6e1be35b0a21c8e9df8a1fc289bf354f6a3f96e5d271340f2ed212a5aa0b55fd7717ff3167da8c5f247d623e2a93a3bf7b32 - languageName: node - linkType: hard - "jest-util@npm:^29.0.0, jest-util@npm:^29.7.0": version: 29.7.0 resolution: "jest-util@npm:29.7.0" @@ -8951,20 +8127,6 @@ __metadata: languageName: node linkType: hard -"jest-validate@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-validate@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - camelcase: "npm:^6.2.0" - chalk: "npm:^4.0.0" - jest-get-type: "npm:^28.0.2" - leven: "npm:^3.1.0" - pretty-format: "npm:^28.1.3" - checksum: 10/c49c8c64b4afbfb5c7434cfd30f8adbe7c6f57ce3ad6be55cfd65403f9ae664822badc1f27844ae800b23c84653bea834e928ad79e18ea0afdc4aa2d0a121156 - languageName: node - linkType: hard - "jest-validate@npm:^29.7.0": version: 29.7.0 resolution: "jest-validate@npm:29.7.0" @@ -8979,22 +8141,6 @@ __metadata: languageName: node linkType: hard -"jest-watcher@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-watcher@npm:28.1.3" - dependencies: - "@jest/test-result": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - ansi-escapes: "npm:^4.2.1" - chalk: "npm:^4.0.0" - emittery: "npm:^0.10.2" - jest-util: "npm:^28.1.3" - string-length: "npm:^4.0.1" - checksum: 10/e6d2c099d461408a992d144c230112fb282b2d8f54c49227bdb0c3efcfa5ecab70a019fc57d8ad6360000459087bb942c4f72670b52fc5b97ac0d9834f87d24e - languageName: node - linkType: hard - "jest-watcher@npm:^29.7.0": version: 29.7.0 resolution: "jest-watcher@npm:29.7.0" @@ -9011,17 +8157,6 @@ __metadata: languageName: node linkType: hard -"jest-worker@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-worker@npm:28.1.3" - dependencies: - "@types/node": "npm:*" - merge-stream: "npm:^2.0.0" - supports-color: "npm:^8.0.0" - checksum: 10/0b5992308276ac8440a789e5317ff8feaa496cd9a0512c9cd73dbb9b6d2ff81b717cef1aa20113633c7280c9e29319af00a4d53d6bb35adbd1e3c01f0c290152 - languageName: node - linkType: hard - "jest-worker@npm:^29.7.0": version: 29.7.0 resolution: "jest-worker@npm:29.7.0" @@ -9034,25 +8169,6 @@ __metadata: languageName: node linkType: hard -"jest@npm:^28.1.3": - version: 28.1.3 - resolution: "jest@npm:28.1.3" - dependencies: - "@jest/core": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - import-local: "npm:^3.0.2" - jest-cli: "npm:^28.1.3" - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - bin: - jest: bin/jest.js - checksum: 10/fb7c93e8a9d4c760a59e2b7638886f9f05465a14a88e263dca448f205464434967897a89784a37f7623999dfc33206d3d61d0acdc83eed99c4474d84a4ed3cf8 - languageName: node - linkType: hard - "jest@npm:^29.5.0": version: 29.7.0 resolution: "jest@npm:29.7.0" @@ -9178,15 +8294,6 @@ __metadata: languageName: node linkType: hard -"jsesc@npm:^3.0.2": - version: 3.0.2 - resolution: "jsesc@npm:3.0.2" - bin: - jsesc: bin/jsesc - checksum: 10/8e5a7de6b70a8bd71f9cb0b5a7ade6a73ae6ab55e697c74cc997cede97417a3a65ed86c36f7dd6125fe49766e8386c845023d9e213916ca92c9dfdd56e2babf3 - languageName: node - linkType: hard - "json-parse-even-better-errors@npm:^2.3.0": version: 2.3.1 resolution: "json-parse-even-better-errors@npm:2.3.1" @@ -9241,7 +8348,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.2.1, json5@npm:^2.2.3": +"json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -9360,7 +8467,7 @@ __metadata: languageName: node linkType: hard -"lodash.memoize@npm:4.x, lodash.memoize@npm:^4.1.2": +"lodash.memoize@npm:^4.1.2": version: 4.1.2 resolution: "lodash.memoize@npm:4.1.2" checksum: 10/192b2168f310c86f303580b53acf81ab029761b9bd9caa9506a019ffea5f3363ea98d7e39e7e11e6b9917066c9d36a09a11f6fe16f812326390d8f3a54a1a6da @@ -9490,7 +8597,7 @@ __metadata: languageName: node linkType: hard -"make-error@npm:1.x, make-error@npm:^1.1.1, make-error@npm:^1.3.6": +"make-error@npm:^1.1.1, make-error@npm:^1.3.6": version: 1.3.6 resolution: "make-error@npm:1.3.6" checksum: 10/b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402 @@ -10569,18 +9676,6 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^28.1.3": - version: 28.1.3 - resolution: "pretty-format@npm:28.1.3" - dependencies: - "@jest/schemas": "npm:^28.1.3" - ansi-regex: "npm:^5.0.1" - ansi-styles: "npm:^5.0.0" - react-is: "npm:^18.0.0" - checksum: 10/26626d33e201388174a1ce352be46b8087f28184bf3684a88b2f7cf633e28419ffc664628eec261ba13b0f03748c3a6f85db063a2022f75a354c7b9e4e06526b - languageName: node - linkType: hard - "pretty-format@npm:^29.0.0, pretty-format@npm:^29.7.0": version: 29.7.0 resolution: "pretty-format@npm:29.7.0" @@ -10922,13 +10017,6 @@ __metadata: languageName: node linkType: hard -"resolve.exports@npm:^1.1.0": - version: 1.1.1 - resolution: "resolve.exports@npm:1.1.1" - checksum: 10/de58c30aca30883f0e29910e4ad1b7b9986ec5f69434ef2e957ddbe52d3250e138ddd2688e8cd67909b4ee9bf3437424c718a5962d59edd610f035b861ef8441 - languageName: node - linkType: hard - "resolve.exports@npm:^2.0.0": version: 2.0.2 resolution: "resolve.exports@npm:2.0.2" @@ -10993,7 +10081,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -11216,7 +10304,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.6.3, semver@npm:7.x, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": +"semver@npm:7.6.3, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -11843,16 +10931,6 @@ __metadata: languageName: node linkType: hard -"terminal-link@npm:^2.0.0": - version: 2.1.1 - resolution: "terminal-link@npm:2.1.1" - dependencies: - ansi-escapes: "npm:^4.2.1" - supports-hyperlinks: "npm:^2.0.0" - checksum: 10/ce3d2cd3a438c4a9453947aa664581519173ea40e77e2534d08c088ee6dda449eabdbe0a76d2a516b8b73c33262fedd10d5270ccf7576ae316e3db170ce6562f - languageName: node - linkType: hard - "test-exclude@npm:^6.0.0": version: 6.0.0 resolution: "test-exclude@npm:6.0.0" @@ -11982,39 +11060,6 @@ __metadata: languageName: node linkType: hard -"ts-jest@npm:^28.0.8": - version: 28.0.8 - resolution: "ts-jest@npm:28.0.8" - dependencies: - bs-logger: "npm:0.x" - fast-json-stable-stringify: "npm:2.x" - jest-util: "npm:^28.0.0" - json5: "npm:^2.2.1" - lodash.memoize: "npm:4.x" - make-error: "npm:1.x" - semver: "npm:7.x" - yargs-parser: "npm:^21.0.1" - peerDependencies: - "@babel/core": ">=7.0.0-beta.0 <8" - "@jest/types": ^28.0.0 - babel-jest: ^28.0.0 - jest: ^28.0.0 - typescript: ">=4.3" - peerDependenciesMeta: - "@babel/core": - optional: true - "@jest/types": - optional: true - babel-jest: - optional: true - esbuild: - optional: true - bin: - ts-jest: cli.js - checksum: 10/16cfe812ac5ec6557c9dc17e93bb0785c535002e5c13287f5a2bd2440ab57ea03ff696b32a80ba2992ca9fddab1c8649d7ae42670c02a22322805212933b1096 - languageName: node - linkType: hard - "ts-jest@npm:^29.0.5": version: 29.2.5 resolution: "ts-jest@npm:29.2.5" @@ -12248,16 +11293,6 @@ __metadata: languageName: node linkType: hard -"typescript@npm:~4.8.4": - version: 4.8.4 - resolution: "typescript@npm:4.8.4" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10/f985d8dd6ae815753d61cb81e434f3a4a5796ac52e423370fca6ad11bcd188df4013d82e3ba3b88c9746745b9341390ba68f862dc9d30bac6465e0699f2a795b - languageName: node - linkType: hard - "typescript@npm:~5.6.3": version: 5.6.3 resolution: "typescript@npm:5.6.3" @@ -12268,16 +11303,6 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A~4.8.4#optional!builtin": - version: 4.8.4 - resolution: "typescript@patch:typescript@npm%3A4.8.4#optional!builtin::version=4.8.4&hash=1a91c8" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10/5d81fd8cf5152091a0c0b84ebc868de8433583072a340c4899e0fc7ad6a80314b880a1466868c9a6a1f640c3d1f2fe7f41f8c541b99d78c8b414263dfa27eba3 - languageName: node - linkType: hard - "typescript@patch:typescript@npm%3A~5.6.3#optional!builtin": version: 5.6.3 resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin::version=5.6.3&hash=8c6c40" @@ -12542,13 +11567,6 @@ __metadata: languageName: node linkType: hard -"webextension-polyfill@npm:^0.12.0": - version: 0.12.0 - resolution: "webextension-polyfill@npm:0.12.0" - checksum: 10/77e648b958b573ef075e75a0c180e2bbd74dee17b3145e86d21fcbb168c4999e4a311654fe634b8178997bee9b35ea5808d8d3d3e5ff2ad138f197f4f0ea75d9 - languageName: node - linkType: hard - "webidl-conversions@npm:^3.0.0": version: 3.0.1 resolution: "webidl-conversions@npm:3.0.1" @@ -12703,7 +11721,7 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^4.0.1, write-file-atomic@npm:^4.0.2": +"write-file-atomic@npm:^4.0.2": version: 4.0.2 resolution: "write-file-atomic@npm:4.0.2" dependencies: @@ -12818,7 +11836,7 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^21.0.1, yargs-parser@npm:^21.1.1": +"yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1" checksum: 10/9dc2c217ea3bf8d858041252d43e074f7166b53f3d010a8c711275e09cd3d62a002969a39858b92bbda2a6a63a585c7127014534a560b9c69ed2d923d113406e From 9ee292252ceaa9aded734ba29984eecc6710a502 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Mon, 9 Sep 2024 18:09:30 +0200 Subject: [PATCH 03/31] feat(keyring-snap-sdk): add new package @metamask/keyring-snap-sdk --- packages/keyring-api/src/events.ts | 13 ---- packages/keyring-api/src/index.ts | 2 - packages/keyring-snap-sdk/CHANGELOG.md | 10 +++ packages/keyring-snap-sdk/README.md | 15 ++++ packages/keyring-snap-sdk/jest.config.js | 28 +++++++ packages/keyring-snap-sdk/package.json | 78 +++++++++++++++++++ .../src/JsonRpcRequest.test.ts | 0 .../src/JsonRpcRequest.ts | 3 +- packages/keyring-snap-sdk/src/events.ts | 1 + packages/keyring-snap-sdk/src/index.ts | 4 + .../src/rpc-handler.test.ts | 10 ++- .../src/rpc-handler.ts | 12 +-- .../src/snap-utils.test.ts | 0 .../src/snap-utils.ts | 0 packages/keyring-snap-sdk/tsconfig.build.json | 18 +++++ packages/keyring-snap-sdk/tsconfig.json | 8 ++ packages/keyring-snap-sdk/typedoc.json | 6 ++ tsconfig.build.json | 3 +- tsconfig.json | 3 +- 19 files changed, 186 insertions(+), 28 deletions(-) delete mode 100644 packages/keyring-api/src/events.ts create mode 100644 packages/keyring-snap-sdk/CHANGELOG.md create mode 100644 packages/keyring-snap-sdk/README.md create mode 100644 packages/keyring-snap-sdk/jest.config.js create mode 100644 packages/keyring-snap-sdk/package.json rename packages/{keyring-api => keyring-snap-sdk}/src/JsonRpcRequest.test.ts (100%) rename packages/{keyring-api => keyring-snap-sdk}/src/JsonRpcRequest.ts (99%) create mode 100644 packages/keyring-snap-sdk/src/events.ts create mode 100644 packages/keyring-snap-sdk/src/index.ts rename packages/{keyring-api => keyring-snap-sdk}/src/rpc-handler.test.ts (98%) rename packages/{keyring-api => keyring-snap-sdk}/src/rpc-handler.ts (97%) rename packages/{keyring-api => keyring-snap-sdk}/src/snap-utils.test.ts (100%) rename packages/{keyring-api => keyring-snap-sdk}/src/snap-utils.ts (100%) create mode 100644 packages/keyring-snap-sdk/tsconfig.build.json create mode 100644 packages/keyring-snap-sdk/tsconfig.json create mode 100644 packages/keyring-snap-sdk/typedoc.json diff --git a/packages/keyring-api/src/events.ts b/packages/keyring-api/src/events.ts deleted file mode 100644 index d3f26d59..00000000 --- a/packages/keyring-api/src/events.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Supported keyring events. - */ -export enum KeyringEvent { - // Account events - AccountCreated = 'notify:accountCreated', - AccountUpdated = 'notify:accountUpdated', - AccountDeleted = 'notify:accountDeleted', - - // Request events - RequestApproved = 'notify:requestApproved', - RequestRejected = 'notify:requestRejected', -} diff --git a/packages/keyring-api/src/index.ts b/packages/keyring-api/src/index.ts index dde3086b..3773ce44 100644 --- a/packages/keyring-api/src/index.ts +++ b/packages/keyring-api/src/index.ts @@ -4,5 +4,3 @@ export * from './events'; export * from './JsonRpcRequest'; export * from './KeyringClient'; export * from './KeyringSnapRpcClient'; -export * from './rpc-handler'; -export * from './snap-utils'; diff --git a/packages/keyring-snap-sdk/CHANGELOG.md b/packages/keyring-snap-sdk/CHANGELOG.md new file mode 100644 index 00000000..f4eb4815 --- /dev/null +++ b/packages/keyring-snap-sdk/CHANGELOG.md @@ -0,0 +1,10 @@ +# 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] + +[Unreleased]: https://github.com/MetaMask/accounts/ diff --git a/packages/keyring-snap-sdk/README.md b/packages/keyring-snap-sdk/README.md new file mode 100644 index 00000000..8554a6fb --- /dev/null +++ b/packages/keyring-snap-sdk/README.md @@ -0,0 +1,15 @@ +# MetaMask Keyring Snap SDK + +Various JavaScript/TypeScript utilities required by the Snap Keyring. + +## Installation + +`yarn add @metamask/keyring-snap-sdk` + +or + +`npm install @metamask/keyring-snap-sdk` + +## Contributing + +This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/accounts#readme). diff --git a/packages/keyring-snap-sdk/jest.config.js b/packages/keyring-snap-sdk/jest.config.js new file mode 100644 index 00000000..d6e04ca7 --- /dev/null +++ b/packages/keyring-snap-sdk/jest.config.js @@ -0,0 +1,28 @@ +/* + * For a detailed explanation regarding each configuration property and type check, visit: + * https://jestjs.io/docs/configuration + */ + +const merge = require('deepmerge'); +const path = require('path'); + +const baseConfig = require('../../jest.config.packages'); + +const displayName = path.basename(__dirname); + +module.exports = merge(baseConfig, { + // The display name when running multiple projects + displayName, + + coveragePathIgnorePatterns: ['./src/tests'], + + // An object that configures minimum threshold enforcement for coverage results + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, +}); diff --git a/packages/keyring-snap-sdk/package.json b/packages/keyring-snap-sdk/package.json new file mode 100644 index 00000000..0e13293b --- /dev/null +++ b/packages/keyring-snap-sdk/package.json @@ -0,0 +1,78 @@ +{ + "name": "@metamask/keyring-snap-sdk", + "version": "0.0.1", + "description": "MetaMask Keyring Snap SDK", + "keywords": [ + "metamask", + "keyring" + ], + "homepage": "https://github.com/MetaMask/accounts/tree/main/packages/keyring-snap-sdk#readme", + "bugs": { + "url": "https://github.com/MetaMask/accounts/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/MetaMask/accounts.git" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist/" + ], + "scripts": { + "build": "tsc --build tsconfig.build.json", + "build:clean": "rimraf dist && yarn build", + "build:docs": "typedoc", + "build:force": "tsc --build tsconfig.build.json --force", + "changelog:update": "../../scripts/update-changelog.sh @metamask/keyring-snap-sdk", + "changelog:validate": "../../scripts/validate-changelog.sh @metamask/keyring-snap-sdk", + "publish:preview": "yarn npm publish --tag preview", + "test": "yarn test:source && yarn test:types", + "test:clean": "jest --clearCache", + "test:source": "jest && jest-it-up", + "test:types": "tsd", + "test:verbose": "jest --verbose", + "test:watch": "jest --watch" + }, + "dependencies": { + "@metamask/keyring-internal-api": "^0.0.1", + "@metamask/keyring-utils": "^0.0.1", + "@metamask/snaps-sdk": "^6.1.0", + "@metamask/superstruct": "^3.1.0", + "@metamask/utils": "^9.1.0", + "deepmerge": "^4.2.2" + }, + "devDependencies": { + "@lavamoat/allow-scripts": "^3.0.4", + "@lavamoat/preinstall-always-fail": "^2.0.0", + "@metamask/auto-changelog": "^3.4.4", + "@metamask/keyring-api": "^8.1.0", + "@metamask/providers": "^17.1.1", + "@types/jest": "^29.5.12", + "@types/node": "^20.12.12", + "depcheck": "^1.4.7", + "jest": "^28.1.3", + "jest-it-up": "^3.1.0", + "rimraf": "^5.0.7", + "ts-jest": "^28.0.8", + "ts-node": "^10.9.2", + "tsd": "^0.31.0", + "typedoc": "^0.25.13", + "typescript": "~4.8.4" + }, + "engines": { + "node": "^18.18 || >=20" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "lavamoat": { + "allowScripts": { + "@lavamoat/preinstall-always-fail": false + } + }, + "tsd": { + "directory": "src" + } +} diff --git a/packages/keyring-api/src/JsonRpcRequest.test.ts b/packages/keyring-snap-sdk/src/JsonRpcRequest.test.ts similarity index 100% rename from packages/keyring-api/src/JsonRpcRequest.test.ts rename to packages/keyring-snap-sdk/src/JsonRpcRequest.test.ts diff --git a/packages/keyring-api/src/JsonRpcRequest.ts b/packages/keyring-snap-sdk/src/JsonRpcRequest.ts similarity index 99% rename from packages/keyring-api/src/JsonRpcRequest.ts rename to packages/keyring-snap-sdk/src/JsonRpcRequest.ts index b9ce8403..e91ee9a5 100644 --- a/packages/keyring-api/src/JsonRpcRequest.ts +++ b/packages/keyring-snap-sdk/src/JsonRpcRequest.ts @@ -1,3 +1,4 @@ +import { exactOptional, object } from '@metamask/keyring-utils'; import { array, literal, @@ -9,8 +10,6 @@ import { import type { Infer } from '@metamask/superstruct'; import { JsonStruct } from '@metamask/utils'; -import { exactOptional, object } from '@metamask/keyring-utils'; - export const JsonRpcRequestStruct = object({ jsonrpc: literal('2.0'), id: union([string(), number(), literal(null)]), diff --git a/packages/keyring-snap-sdk/src/events.ts b/packages/keyring-snap-sdk/src/events.ts new file mode 100644 index 00000000..63d915ca --- /dev/null +++ b/packages/keyring-snap-sdk/src/events.ts @@ -0,0 +1 @@ +export { KeyringEvent } from '@metamask/keyring-internal-api'; diff --git a/packages/keyring-snap-sdk/src/index.ts b/packages/keyring-snap-sdk/src/index.ts new file mode 100644 index 00000000..cacb3038 --- /dev/null +++ b/packages/keyring-snap-sdk/src/index.ts @@ -0,0 +1,4 @@ +export * from './JsonRpcRequest'; +export * from './events'; +export * from './rpc-handler'; +export * from './snap-utils'; diff --git a/packages/keyring-api/src/rpc-handler.test.ts b/packages/keyring-snap-sdk/src/rpc-handler.test.ts similarity index 98% rename from packages/keyring-api/src/rpc-handler.test.ts rename to packages/keyring-snap-sdk/src/rpc-handler.test.ts index 29918ada..1121d373 100644 --- a/packages/keyring-api/src/rpc-handler.test.ts +++ b/packages/keyring-snap-sdk/src/rpc-handler.test.ts @@ -1,6 +1,10 @@ -import type { Keyring } from './api'; -import type { GetAccountBalancesRequest } from './internal'; -import { KeyringRpcMethod, isKeyringRpcMethod } from './internal/rpc'; +import type { Keyring } from '@metamask/keyring-api'; +import type { GetAccountBalancesRequest } from '@metamask/keyring-internal-api'; +import { + KeyringRpcMethod, + isKeyringRpcMethod, +} from '@metamask/keyring-internal-api'; + import type { JsonRpcRequest } from './JsonRpcRequest'; import { handleKeyringRequest } from './rpc-handler'; diff --git a/packages/keyring-api/src/rpc-handler.ts b/packages/keyring-snap-sdk/src/rpc-handler.ts similarity index 97% rename from packages/keyring-api/src/rpc-handler.ts rename to packages/keyring-snap-sdk/src/rpc-handler.ts index 0e48622a..ba577da6 100644 --- a/packages/keyring-api/src/rpc-handler.ts +++ b/packages/keyring-snap-sdk/src/rpc-handler.ts @@ -1,7 +1,4 @@ -import { assert } from '@metamask/superstruct'; -import type { Json } from '@metamask/utils'; - -import type { Keyring } from './api'; +import type { Keyring } from '@metamask/keyring-api'; import { GetAccountRequestStruct, CreateAccountRequestStruct, @@ -16,8 +13,11 @@ import { ListAccountsRequestStruct, ListRequestsRequestStruct, GetAccountBalancesRequestStruct, -} from './internal/api'; -import { KeyringRpcMethod } from './internal/rpc'; + KeyringRpcMethod, +} from '@metamask/keyring-internal-api'; +import { assert } from '@metamask/superstruct'; +import type { Json } from '@metamask/utils'; + import type { JsonRpcRequest } from './JsonRpcRequest'; import { JsonRpcRequestStruct } from './JsonRpcRequest'; diff --git a/packages/keyring-api/src/snap-utils.test.ts b/packages/keyring-snap-sdk/src/snap-utils.test.ts similarity index 100% rename from packages/keyring-api/src/snap-utils.test.ts rename to packages/keyring-snap-sdk/src/snap-utils.test.ts diff --git a/packages/keyring-api/src/snap-utils.ts b/packages/keyring-snap-sdk/src/snap-utils.ts similarity index 100% rename from packages/keyring-api/src/snap-utils.ts rename to packages/keyring-snap-sdk/src/snap-utils.ts diff --git a/packages/keyring-snap-sdk/tsconfig.build.json b/packages/keyring-snap-sdk/tsconfig.build.json new file mode 100644 index 00000000..b577a736 --- /dev/null +++ b/packages/keyring-snap-sdk/tsconfig.build.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.packages.build.json", + "compilerOptions": { + "baseUrl": "./", + "outDir": "dist", + "rootDir": "src", + // FIXME: We should investigate how to get rid of this flag, as this will turn off type + // checking for all *.d.ts files + "skipLibCheck": true + }, + "references": [ + { + "path": "../keyring-internal-api/tsconfig.build.json" + } + ], + "include": ["./src/**/*.ts"], + "exclude": ["./src/**/*.test.ts", "./src/**/*.test-d.ts"] +} diff --git a/packages/keyring-snap-sdk/tsconfig.json b/packages/keyring-snap-sdk/tsconfig.json new file mode 100644 index 00000000..bba26c34 --- /dev/null +++ b/packages/keyring-snap-sdk/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.packages.json", + "compilerOptions": { + "baseUrl": "./" + }, + "include": ["./src"], + "exclude": ["./dist/**/*"] +} diff --git a/packages/keyring-snap-sdk/typedoc.json b/packages/keyring-snap-sdk/typedoc.json new file mode 100644 index 00000000..b527b625 --- /dev/null +++ b/packages/keyring-snap-sdk/typedoc.json @@ -0,0 +1,6 @@ +{ + "entryPoints": ["./src/index.ts"], + "excludePrivate": true, + "hideGenerator": true, + "out": "docs" +} diff --git a/tsconfig.build.json b/tsconfig.build.json index 4103f804..aad8f42a 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -5,7 +5,8 @@ { "path": "./packages/keyring-eth-ledger-bridge/tsconfig.build.json" }, { "path": "./packages/keyring-eth-simple/tsconfig.build.json" }, { "path": "./packages/keyring-eth-trezor/tsconfig.build.json" }, - { "path": "./packages/keyring-snap-bridge/tsconfig.build.json" } + { "path": "./packages/keyring-snap-bridge/tsconfig.build.json" }, + { "path": "./packages/keyring-snap-sdk/tsconfig.build.json" } ], "files": [], "include": [] diff --git a/tsconfig.json b/tsconfig.json index a7d977e9..9aa3bfda 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,8 @@ { "path": "./packages/keyring-eth-ledger-bridge" }, { "path": "./packages/keyring-eth-simple" }, { "path": "./packages/keyring-eth-trezor" }, - { "path": "./packages/keyring-snap-bridge" } + { "path": "./packages/keyring-snap-bridge" }, + { "path": "./packages/keyring-snap-sdk" }, { "path": "./packages/keyring-utils" } ], "files": [], From 58d80eb38598ca2932a663b223903544d6f697a8 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Mon, 9 Sep 2024 18:12:25 +0200 Subject: [PATCH 04/31] feat(keyring-snap-client): add new package @metamask/keyring-snap-client --- packages/keyring-api/src/index.ts | 4 - packages/keyring-snap-bridge/package.json | 4 + .../src/KeyringSnapControllerClient.ts | 4 +- .../src/SnapKeyring.test.ts | 6 +- .../keyring-snap-bridge/src/SnapKeyring.ts | 14 +- packages/keyring-snap-bridge/src/index.ts | 1 - .../keyring-snap-bridge/tsconfig.build.json | 7 +- packages/keyring-snap-client/CHANGELOG.md | 10 + packages/keyring-snap-client/README.md | 15 + packages/keyring-snap-client/jest.config.js | 28 + packages/keyring-snap-client/package.json | 100 ++ .../src/KeyringClient.test.ts | 15 +- .../src/KeyringClient.ts | 15 +- .../src/KeyringSnapControllerClient.test.ts | 82 ++ .../src/KeyringSnapControllerClient.ts | 116 ++ .../src/KeyringSnapRpcClient.test.ts | 2 +- .../src/KeyringSnapRpcClient.ts | 2 +- packages/keyring-snap-client/src/index.ts | 3 + .../keyring-snap-client/tsconfig.build.json | 24 + packages/keyring-snap-client/tsconfig.json | 8 + packages/keyring-snap-client/typedoc.json | 6 + tsconfig.build.json | 3 +- tsconfig.json | 1 + yarn.lock | 1186 ++++++++++++++++- 24 files changed, 1610 insertions(+), 46 deletions(-) create mode 100644 packages/keyring-snap-client/CHANGELOG.md create mode 100644 packages/keyring-snap-client/README.md create mode 100644 packages/keyring-snap-client/jest.config.js create mode 100644 packages/keyring-snap-client/package.json rename packages/{keyring-api => keyring-snap-client}/src/KeyringClient.test.ts (97%) rename packages/{keyring-api => keyring-snap-client}/src/KeyringClient.ts (96%) create mode 100644 packages/keyring-snap-client/src/KeyringSnapControllerClient.test.ts create mode 100644 packages/keyring-snap-client/src/KeyringSnapControllerClient.ts rename packages/{keyring-api => keyring-snap-client}/src/KeyringSnapRpcClient.test.ts (95%) rename packages/{keyring-api => keyring-snap-client}/src/KeyringSnapRpcClient.ts (96%) create mode 100644 packages/keyring-snap-client/src/index.ts create mode 100644 packages/keyring-snap-client/tsconfig.build.json create mode 100644 packages/keyring-snap-client/tsconfig.json create mode 100644 packages/keyring-snap-client/typedoc.json diff --git a/packages/keyring-api/src/index.ts b/packages/keyring-api/src/index.ts index 3773ce44..bd560b15 100644 --- a/packages/keyring-api/src/index.ts +++ b/packages/keyring-api/src/index.ts @@ -1,6 +1,2 @@ export * from './api'; export type * from './contexts'; -export * from './events'; -export * from './JsonRpcRequest'; -export * from './KeyringClient'; -export * from './KeyringSnapRpcClient'; diff --git a/packages/keyring-snap-bridge/package.json b/packages/keyring-snap-bridge/package.json index 5e3a1383..fab7e2e2 100644 --- a/packages/keyring-snap-bridge/package.json +++ b/packages/keyring-snap-bridge/package.json @@ -37,6 +37,10 @@ "dependencies": { "@ethereumjs/tx": "^4.2.0", "@metamask/eth-sig-util": "^8.0.0", + "@metamask/keyring-api": "workspace:^", + "@metamask/keyring-internal-api": "workspace:^", + "@metamask/keyring-snap-client": "workspace:^", + "@metamask/keyring-snap-sdk": "workspace:^", "@metamask/snaps-controllers": "^9.10.0", "@metamask/snaps-sdk": "^6.7.0", "@metamask/snaps-utils": "^8.3.0", diff --git a/packages/keyring-snap-bridge/src/KeyringSnapControllerClient.ts b/packages/keyring-snap-bridge/src/KeyringSnapControllerClient.ts index c369470f..7e7785d1 100644 --- a/packages/keyring-snap-bridge/src/KeyringSnapControllerClient.ts +++ b/packages/keyring-snap-bridge/src/KeyringSnapControllerClient.ts @@ -1,5 +1,5 @@ -import type { JsonRpcRequest, Sender } from '@metamask/keyring-api'; -import { KeyringClient } from '@metamask/keyring-api'; +import { KeyringClient, type Sender } from '@metamask/keyring-snap-client'; +import type { JsonRpcRequest } from '@metamask/keyring-snap-sdk'; import type { SnapController } from '@metamask/snaps-controllers'; import type { SnapId } from '@metamask/snaps-sdk'; import type { HandlerType } from '@metamask/snaps-utils'; diff --git a/packages/keyring-snap-bridge/src/SnapKeyring.test.ts b/packages/keyring-snap-bridge/src/SnapKeyring.test.ts index a5e103e4..cdd39088 100644 --- a/packages/keyring-snap-bridge/src/SnapKeyring.test.ts +++ b/packages/keyring-snap-bridge/src/SnapKeyring.test.ts @@ -4,7 +4,11 @@ import type { KeyringAccount, KeyringExecutionContext, } from '@metamask/keyring-api'; -import { BtcAccountType, EthAccountType, SolAccountType } from '@metamask/keyring-api'; +import { + BtcAccountType, + EthAccountType, + SolAccountType, +} from '@metamask/keyring-api'; import type { EthBaseUserOperation, EthUserOperation, diff --git a/packages/keyring-snap-bridge/src/SnapKeyring.ts b/packages/keyring-snap-bridge/src/SnapKeyring.ts index b3524369..856c6149 100644 --- a/packages/keyring-snap-bridge/src/SnapKeyring.ts +++ b/packages/keyring-snap-bridge/src/SnapKeyring.ts @@ -6,6 +6,11 @@ import type { TypedTransaction } from '@ethereumjs/tx'; import { TransactionFactory } from '@ethereumjs/tx'; import type { TypedDataV1, TypedMessage } from '@metamask/eth-sig-util'; import { SignTypedDataVersion } from '@metamask/eth-sig-util'; +import type { + KeyringAccount, + KeyringExecutionContext, + KeyringResponse, +} from '@metamask/keyring-api'; import type { BtcMethod, EthBaseTransaction, @@ -13,10 +18,7 @@ import type { EthUserOperation, EthUserOperationPatch, InternalAccount, - KeyringAccount, - KeyringExecutionContext, - KeyringResponse, -} from '@metamask/keyring-api'; +} from '@metamask/keyring-internal-api'; import { AccountCreatedEventStruct, AccountDeletedEventStruct, @@ -29,7 +31,8 @@ import { KeyringEvent, RequestApprovedEventStruct, RequestRejectedEventStruct, -} from '@metamask/keyring-api'; +} from '@metamask/keyring-internal-api'; +import { KeyringSnapControllerClient } from '@metamask/keyring-snap-client'; import type { SnapController } from '@metamask/snaps-controllers'; import type { SnapId } from '@metamask/snaps-sdk'; import type { Snap } from '@metamask/snaps-utils'; @@ -44,7 +47,6 @@ import { EventEmitter } from 'events'; import { v4 as uuid } from 'uuid'; import { DeferredPromise } from './DeferredPromise'; -import { KeyringSnapControllerClient } from './KeyringSnapControllerClient'; import { projectLogger as log } from './logger'; import { SnapIdMap } from './SnapIdMap'; import type { SnapMessage } from './types'; diff --git a/packages/keyring-snap-bridge/src/index.ts b/packages/keyring-snap-bridge/src/index.ts index dab23fcf..d01d020e 100644 --- a/packages/keyring-snap-bridge/src/index.ts +++ b/packages/keyring-snap-bridge/src/index.ts @@ -1,3 +1,2 @@ export * from './types'; export * from './SnapKeyring'; -export * from './KeyringSnapControllerClient'; diff --git a/packages/keyring-snap-bridge/tsconfig.build.json b/packages/keyring-snap-bridge/tsconfig.build.json index 9a6ec1d7..d01feb1a 100644 --- a/packages/keyring-snap-bridge/tsconfig.build.json +++ b/packages/keyring-snap-bridge/tsconfig.build.json @@ -10,7 +10,12 @@ "lib": ["ES2020"], "target": "es2020" }, - "references": [{ "path": "../keyring-api/tsconfig.build.json" }], + "references": [ + { "path": "../keyring-api/tsconfig.build.json" }, + { "path": "../keyring-snap-sdk/tsconfig.build.json" }, + { "path": "../keyring-snap-client/tsconfig.build.json" }, + { "path": "../keyring-internal-api/tsconfig.build.json" } + ], "include": ["./src/**/*.ts"], "exclude": ["./src/**/*.test.ts"] } diff --git a/packages/keyring-snap-client/CHANGELOG.md b/packages/keyring-snap-client/CHANGELOG.md new file mode 100644 index 00000000..f4eb4815 --- /dev/null +++ b/packages/keyring-snap-client/CHANGELOG.md @@ -0,0 +1,10 @@ +# 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] + +[Unreleased]: https://github.com/MetaMask/accounts/ diff --git a/packages/keyring-snap-client/README.md b/packages/keyring-snap-client/README.md new file mode 100644 index 00000000..f4bbfb42 --- /dev/null +++ b/packages/keyring-snap-client/README.md @@ -0,0 +1,15 @@ +# MetaMask Keyring Snap Clients + +TODO + +## Installation + +`yarn add @metamask/keyring-snap-client` + +or + +`npm install @metamask/keyring-snap-client` + +## Contributing + +This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/accounts#readme). diff --git a/packages/keyring-snap-client/jest.config.js b/packages/keyring-snap-client/jest.config.js new file mode 100644 index 00000000..d6e04ca7 --- /dev/null +++ b/packages/keyring-snap-client/jest.config.js @@ -0,0 +1,28 @@ +/* + * For a detailed explanation regarding each configuration property and type check, visit: + * https://jestjs.io/docs/configuration + */ + +const merge = require('deepmerge'); +const path = require('path'); + +const baseConfig = require('../../jest.config.packages'); + +const displayName = path.basename(__dirname); + +module.exports = merge(baseConfig, { + // The display name when running multiple projects + displayName, + + coveragePathIgnorePatterns: ['./src/tests'], + + // An object that configures minimum threshold enforcement for coverage results + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, +}); diff --git a/packages/keyring-snap-client/package.json b/packages/keyring-snap-client/package.json new file mode 100644 index 00000000..21ff7d87 --- /dev/null +++ b/packages/keyring-snap-client/package.json @@ -0,0 +1,100 @@ +{ + "name": "@metamask/keyring-snap-client", + "version": "0.0.1", + "description": "MetaMask Keyring Snap clients", + "keywords": [ + "metamask", + "keyring" + ], + "homepage": "https://github.com/MetaMask/accounts/tree/main/packages/keyring-snap-client#readme", + "bugs": { + "url": "https://github.com/MetaMask/accounts/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/MetaMask/accounts.git" + }, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist/" + ], + "scripts": { + "build": "tsc --build tsconfig.build.json", + "build:clean": "rimraf dist && yarn build", + "build:docs": "typedoc", + "build:force": "tsc --build tsconfig.build.json --force", + "changelog:update": "../../scripts/update-changelog.sh @metamask/keyring-snap-client", + "changelog:validate": "../../scripts/validate-changelog.sh @metamask/keyring-snap-client", + "publish:preview": "yarn npm publish --tag preview", + "test": "yarn test:source && yarn test:types", + "test:clean": "jest --clearCache", + "test:source": "jest && jest-it-up", + "test:types": "tsd", + "test:verbose": "jest --verbose", + "test:watch": "jest --watch" + }, + "dependencies": { + "@metamask/keyring-api": "workspace:^", + "@metamask/keyring-internal-api": "workspace:^", + "@metamask/keyring-snap-sdk": "workspace:^", + "@metamask/keyring-utils": "workspace:^", + "@metamask/snaps-controllers": "^9.10.0", + "@metamask/snaps-sdk": "^6.7.0", + "@metamask/snaps-utils": "^8.3.0", + "@metamask/superstruct": "^3.1.0", + "@types/uuid": "^9.0.8", + "deepmerge": "^4.2.2", + "uuid": "^9.0.1", + "webextension-polyfill": "^0.12.0" + }, + "devDependencies": { + "@lavamoat/allow-scripts": "^3.2.1", + "@lavamoat/preinstall-always-fail": "^2.1.0", + "@metamask/auto-changelog": "^3.4.4", + "@metamask/providers": "^18.1.0", + "@metamask/utils": "^9.2.1", + "@ts-bridge/cli": "^0.6.0", + "@types/jest": "^29.5.12", + "@types/node": "^20.12.12", + "depcheck": "^1.4.7", + "jest": "^29.5.0", + "jest-it-up": "^3.1.0", + "rimraf": "^5.0.7", + "ts-jest": "^29.0.5", + "ts-node": "^10.9.2", + "tsd": "^0.31.0", + "typedoc": "^0.25.13", + "typescript": "~5.6.3" + }, + "peerDependencies": { + "@metamask/providers": "^18.1.0" + }, + "engines": { + "node": "^18.18 || >=20" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "lavamoat": { + "allowScripts": { + "@lavamoat/preinstall-always-fail": false + } + }, + "tsd": { + "directory": "src" + } +} diff --git a/packages/keyring-api/src/KeyringClient.test.ts b/packages/keyring-snap-client/src/KeyringClient.test.ts similarity index 97% rename from packages/keyring-api/src/KeyringClient.test.ts rename to packages/keyring-snap-client/src/KeyringClient.test.ts index c5d237b7..e6d8c612 100644 --- a/packages/keyring-api/src/KeyringClient.test.ts +++ b/packages/keyring-snap-client/src/KeyringClient.test.ts @@ -1,10 +1,11 @@ -import { - type KeyringAccount, - type KeyringRequest, - type KeyringResponse, - KeyringClient, - KeyringRpcMethod, -} from '.'; // Import from `index.ts` to test the public API +import type { + KeyringAccount, + KeyringRequest, + KeyringResponse, +} from '@metamask/keyring-api'; +import { KeyringRpcMethod } from '@metamask/keyring-internal-api'; + +import { KeyringClient } from '.'; // Import from `index.ts` to test the public API describe('KeyringClient', () => { const mockSender = { diff --git a/packages/keyring-api/src/KeyringClient.ts b/packages/keyring-snap-client/src/KeyringClient.ts similarity index 96% rename from packages/keyring-api/src/KeyringClient.ts rename to packages/keyring-snap-client/src/KeyringClient.ts index 4c570572..900d5bd1 100644 --- a/packages/keyring-api/src/KeyringClient.ts +++ b/packages/keyring-snap-client/src/KeyringClient.ts @@ -1,7 +1,3 @@ -import { assert } from '@metamask/superstruct'; -import type { Json } from '@metamask/utils'; -import { v4 as uuid } from 'uuid'; - import type { Keyring, KeyringAccount, @@ -10,7 +6,7 @@ import type { KeyringResponse, CaipAssetType, Balance, -} from './api'; +} from '@metamask/keyring-api'; import { ApproveRequestResponseStruct, CreateAccountResponseStruct, @@ -25,10 +21,13 @@ import { RejectRequestResponseStruct, SubmitRequestResponseStruct, UpdateAccountResponseStruct, -} from './internal/api'; -import { KeyringRpcMethod } from './internal/rpc'; -import type { JsonRpcRequest } from './JsonRpcRequest'; + KeyringRpcMethod, +} from '@metamask/keyring-internal-api'; +import type { JsonRpcRequest } from '@metamask/keyring-snap-sdk'; import { strictMask } from '@metamask/keyring-utils'; +import { assert } from '@metamask/superstruct'; +import type { Json } from '@metamask/utils'; +import { v4 as uuid } from 'uuid'; export type Sender = { send(request: JsonRpcRequest): Promise; diff --git a/packages/keyring-snap-client/src/KeyringSnapControllerClient.test.ts b/packages/keyring-snap-client/src/KeyringSnapControllerClient.test.ts new file mode 100644 index 00000000..9c16fc94 --- /dev/null +++ b/packages/keyring-snap-client/src/KeyringSnapControllerClient.test.ts @@ -0,0 +1,82 @@ +import type { KeyringAccount } from '@metamask/keyring-api'; +import type { SnapController } from '@metamask/snaps-controllers'; +import type { SnapId } from '@metamask/snaps-sdk'; + +import { KeyringSnapControllerClient } from './KeyringSnapControllerClient'; + +describe('KeyringSnapControllerClient', () => { + const snapId = 'local:localhost:3000' as SnapId; + + const accountsList: KeyringAccount[] = [ + { + id: '13f94041-6ae6-451f-a0fe-afdd2fda18a7', + address: '0xE9A74AACd7df8112911ca93260fC5a046f8a64Ae', + options: {}, + methods: [], + type: 'eip155:eoa', + }, + ]; + + const controller = { + handleRequest: jest.fn(), + }; + + describe('listAccounts', () => { + const request = { + snapId, + origin: 'metamask', + handler: 'onKeyringRequest', + request: { + id: expect.any(String), + jsonrpc: '2.0', + method: 'keyring_listAccounts', + }, + }; + + it('should call the listAccounts method and return the result', async () => { + const client = new KeyringSnapControllerClient({ + controller: controller as unknown as SnapController, + snapId, + }); + + controller.handleRequest.mockResolvedValue(accountsList); + const accounts = await client.listAccounts(); + expect(controller.handleRequest).toHaveBeenCalledWith(request); + expect(accounts).toStrictEqual(accountsList); + }); + + it('should call the listAccounts method and return the result (withSnapId)', async () => { + const client = new KeyringSnapControllerClient({ + controller: controller as unknown as SnapController, + }); + + controller.handleRequest.mockResolvedValue(accountsList); + const accounts = await client.withSnapId(snapId).listAccounts(); + expect(controller.handleRequest).toHaveBeenCalledWith(request); + expect(accounts).toStrictEqual(accountsList); + }); + + it('should call the default snapId value ("undefined")', async () => { + const client = new KeyringSnapControllerClient({ + controller: controller as unknown as SnapController, + }); + + controller.handleRequest.mockResolvedValue(accountsList); + await client.listAccounts(); + expect(controller.handleRequest).toHaveBeenCalledWith({ + ...request, + snapId: 'undefined', + }); + }); + }); + + describe('getController', () => { + it('should return the controller', () => { + const client = new KeyringSnapControllerClient({ + controller: controller as unknown as SnapController, + }); + + expect(client.getController()).toBe(controller); + }); + }); +}); diff --git a/packages/keyring-snap-client/src/KeyringSnapControllerClient.ts b/packages/keyring-snap-client/src/KeyringSnapControllerClient.ts new file mode 100644 index 00000000..85ceb4c9 --- /dev/null +++ b/packages/keyring-snap-client/src/KeyringSnapControllerClient.ts @@ -0,0 +1,116 @@ +import type { JsonRpcRequest } from '@metamask/keyring-snap-sdk'; +import type { SnapController } from '@metamask/snaps-controllers'; +import type { SnapId } from '@metamask/snaps-sdk'; +import type { HandlerType } from '@metamask/snaps-utils'; +import type { Json } from '@metamask/utils'; + +import { KeyringClient, type Sender } from './KeyringClient'; + +/** + * Implementation of the `Sender` interface that can be used to send requests + * to a snap through a `SnapController`. + */ +class SnapControllerSender implements Sender { + readonly #snapId: SnapId; + + readonly #origin: string; + + readonly #controller: SnapController; + + readonly #handler: HandlerType; + + /** + * Create a new instance of `SnapControllerSender`. + * + * @param controller - The `SnapController` instance to send requests to. + * @param snapId - The ID of the snap to use. + * @param origin - The sender's origin. + * @param handler - The handler type. + */ + constructor( + controller: any, + snapId: SnapId, + origin: string, + handler: HandlerType, + ) { + this.#controller = controller; + this.#snapId = snapId; + this.#origin = origin; + this.#handler = handler; + } + + /** + * Send a request to the snap and return the response. + * + * @param request - JSON-RPC request to send to the snap. + * @returns A promise that resolves to the response of the request. + */ + async send(request: JsonRpcRequest): Promise { + return this.#controller.handleRequest({ + snapId: this.#snapId, + origin: this.#origin, + handler: this.#handler, + request, + }) as Promise; + } +} + +/** + * A `KeyringClient` that allows the communication with a snap through the + * `SnapController`. + */ +export class KeyringSnapControllerClient extends KeyringClient { + readonly #controller: SnapController; + + /** + * Create a new instance of `KeyringSnapControllerClient`. + * + * The `handlerType` argument has a hard-coded default `string` value instead + * of a `HandlerType` value to prevent the `@metamask/snaps-utils` module + * from being required at runtime. + * + * @param args - Constructor arguments. + * @param args.controller - The `SnapController` instance to use. + * @param args.snapId - The ID of the snap to use (default: `'undefined'`). + * @param args.origin - The sender's origin (default: `'metamask'`). + * @param args.handler - The handler type (default: `'onKeyringRequest'`). + */ + constructor({ + controller, + snapId = 'undefined' as SnapId, + origin = 'metamask', + handler = 'onKeyringRequest' as HandlerType, + }: { + controller: SnapController; + snapId?: SnapId; + origin?: string; + handler?: HandlerType; + }) { + super(new SnapControllerSender(controller, snapId, origin, handler)); + this.#controller = controller; + } + + /** + * Create a new instance of `KeyringSnapControllerClient` with the specified + * `snapId`. + * + * @param snapId - The ID of the snap to use in the new instance. + * @returns A new instance of `KeyringSnapControllerClient` with the + * specified snap ID. + */ + withSnapId(snapId: SnapId): KeyringSnapControllerClient { + return new KeyringSnapControllerClient({ + controller: this.#controller, + snapId, + }); + } + + /** + * Get the `SnapController` instance used by this client. + * + * @returns The `SnapController` instance used by this client. + */ + getController(): SnapController { + return this.#controller; + } +} diff --git a/packages/keyring-api/src/KeyringSnapRpcClient.test.ts b/packages/keyring-snap-client/src/KeyringSnapRpcClient.test.ts similarity index 95% rename from packages/keyring-api/src/KeyringSnapRpcClient.test.ts rename to packages/keyring-snap-client/src/KeyringSnapRpcClient.test.ts index ce2d9b7e..b1b471ea 100644 --- a/packages/keyring-api/src/KeyringSnapRpcClient.test.ts +++ b/packages/keyring-snap-client/src/KeyringSnapRpcClient.test.ts @@ -1,6 +1,6 @@ +import type { KeyringAccount } from '@metamask/keyring-api'; import type { MetaMaskInpageProvider } from '@metamask/providers'; -import type { KeyringAccount } from './api'; import { KeyringSnapRpcClient } from './KeyringSnapRpcClient'; describe('KeyringSnapRpcClient', () => { diff --git a/packages/keyring-api/src/KeyringSnapRpcClient.ts b/packages/keyring-snap-client/src/KeyringSnapRpcClient.ts similarity index 96% rename from packages/keyring-api/src/KeyringSnapRpcClient.ts rename to packages/keyring-snap-client/src/KeyringSnapRpcClient.ts index 17f27d8b..bfc1df9b 100644 --- a/packages/keyring-api/src/KeyringSnapRpcClient.ts +++ b/packages/keyring-snap-client/src/KeyringSnapRpcClient.ts @@ -1,7 +1,7 @@ +import type { JsonRpcRequest } from '@metamask/keyring-snap-sdk'; import type { MetaMaskInpageProvider } from '@metamask/providers'; import type { Json } from '@metamask/utils'; -import type { JsonRpcRequest } from './JsonRpcRequest'; import type { Sender } from './KeyringClient'; import { KeyringClient } from './KeyringClient'; diff --git a/packages/keyring-snap-client/src/index.ts b/packages/keyring-snap-client/src/index.ts new file mode 100644 index 00000000..0e598f30 --- /dev/null +++ b/packages/keyring-snap-client/src/index.ts @@ -0,0 +1,3 @@ +export * from './KeyringClient'; +export * from './KeyringSnapControllerClient'; +export * from './KeyringSnapRpcClient'; diff --git a/packages/keyring-snap-client/tsconfig.build.json b/packages/keyring-snap-client/tsconfig.build.json new file mode 100644 index 00000000..39750db0 --- /dev/null +++ b/packages/keyring-snap-client/tsconfig.build.json @@ -0,0 +1,24 @@ +{ + "extends": "../../tsconfig.packages.build.json", + "compilerOptions": { + "baseUrl": "./", + "outDir": "dist", + "rootDir": "src", + // FIXME: We should investigate how to get rid of this flag, as this will turn off type + // checking for all *.d.ts files + "skipLibCheck": true + }, + "references": [ + { + "path": "../keyring-api/tsconfig.build.json" + }, + { + "path": "../keyring-snap-sdk/tsconfig.build.json" + }, + { + "path": "../keyring-api/tsconfig.build.json" + } + ], + "include": ["./src/**/*.ts"], + "exclude": ["./src/**/*.test.ts", "./src/**/*.test-d.ts"] +} diff --git a/packages/keyring-snap-client/tsconfig.json b/packages/keyring-snap-client/tsconfig.json new file mode 100644 index 00000000..bba26c34 --- /dev/null +++ b/packages/keyring-snap-client/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.packages.json", + "compilerOptions": { + "baseUrl": "./" + }, + "include": ["./src"], + "exclude": ["./dist/**/*"] +} diff --git a/packages/keyring-snap-client/typedoc.json b/packages/keyring-snap-client/typedoc.json new file mode 100644 index 00000000..b527b625 --- /dev/null +++ b/packages/keyring-snap-client/typedoc.json @@ -0,0 +1,6 @@ +{ + "entryPoints": ["./src/index.ts"], + "excludePrivate": true, + "hideGenerator": true, + "out": "docs" +} diff --git a/tsconfig.build.json b/tsconfig.build.json index aad8f42a..d54c2a10 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -6,7 +6,8 @@ { "path": "./packages/keyring-eth-simple/tsconfig.build.json" }, { "path": "./packages/keyring-eth-trezor/tsconfig.build.json" }, { "path": "./packages/keyring-snap-bridge/tsconfig.build.json" }, - { "path": "./packages/keyring-snap-sdk/tsconfig.build.json" } + { "path": "./packages/keyring-snap-sdk/tsconfig.build.json" }, + { "path": "./packages/keyring-snap-client/tsconfig.build.json" } ], "files": [], "include": [] diff --git a/tsconfig.json b/tsconfig.json index 9aa3bfda..57a50bb3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ { "path": "./packages/keyring-eth-simple" }, { "path": "./packages/keyring-eth-trezor" }, { "path": "./packages/keyring-snap-bridge" }, + { "path": "./packages/keyring-snap-client" }, { "path": "./packages/keyring-snap-sdk" }, { "path": "./packages/keyring-utils" } ], diff --git a/yarn.lock b/yarn.lock index 954cd0fb..f70e6e76 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,6 +32,17 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.25.9": + version: 7.26.2 + resolution: "@babel/code-frame@npm:7.26.2" + dependencies: + "@babel/helper-validator-identifier": "npm:^7.25.9" + js-tokens: "npm:^4.0.0" + picocolors: "npm:^1.0.0" + checksum: 10/db2c2122af79d31ca916755331bb4bac96feb2b334cdaca5097a6b467fdd41963b89b14b6836a14f083de7ff887fc78fa1b3c10b14e743d33e12dbfe5ee3d223 + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.25.2": version: 7.25.4 resolution: "@babel/compat-data@npm:7.25.4" @@ -74,6 +85,19 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.25.9": + version: 7.26.2 + resolution: "@babel/generator@npm:7.26.2" + dependencies: + "@babel/parser": "npm:^7.26.2" + "@babel/types": "npm:^7.26.0" + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.25" + jsesc: "npm:^3.0.2" + checksum: 10/71ace82b5b07a554846a003624bfab93275ccf73cdb9f1a37a4c1094bf9dc94bb677c67e8b8c939dbd6c5f0eda2e8f268aa2b0d9c3b9511072565660e717e045 + languageName: node + linkType: hard + "@babel/helper-annotate-as-pure@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-annotate-as-pure@npm:7.24.7" @@ -203,6 +227,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-string-parser@npm:7.25.9" + checksum: 10/c28656c52bd48e8c1d9f3e8e68ecafd09d949c57755b0d353739eb4eae7ba4f7e67e92e4036f1cd43378cc1397a2c943ed7bcaf5949b04ab48607def0258b775 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-validator-identifier@npm:7.24.7" @@ -210,6 +241,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-validator-identifier@npm:7.25.9" + checksum: 10/3f9b649be0c2fd457fa1957b694b4e69532a668866b8a0d81eabfa34ba16dbf3107b39e0e7144c55c3c652bf773ec816af8df4a61273a2bb4eb3145ca9cf478e + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.24.7, @babel/helper-validator-option@npm:^7.24.8": version: 7.24.8 resolution: "@babel/helper-validator-option@npm:7.24.8" @@ -250,6 +288,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.2": + version: 7.26.2 + resolution: "@babel/parser@npm:7.26.2" + dependencies: + "@babel/types": "npm:^7.26.0" + bin: + parser: ./bin/babel-parser.js + checksum: 10/8baee43752a3678ad9f9e360ec845065eeee806f1fdc8e0f348a8a0e13eef0959dabed4a197c978896c493ea205c804d0a1187cc52e4a1ba017c7935bab4983d + languageName: node + linkType: hard + "@babel/plugin-syntax-async-generators@npm:^7.8.4": version: 7.8.4 resolution: "@babel/plugin-syntax-async-generators@npm:7.8.4" @@ -467,6 +516,17 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/template@npm:7.25.9" + dependencies: + "@babel/code-frame": "npm:^7.25.9" + "@babel/parser": "npm:^7.25.9" + "@babel/types": "npm:^7.25.9" + checksum: 10/e861180881507210150c1335ad94aff80fd9e9be6202e1efa752059c93224e2d5310186ddcdd4c0f0b0fc658ce48cb47823f15142b5c00c8456dde54f5de80b2 + languageName: node + linkType: hard + "@babel/traverse@npm:^7.23.2, @babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.24.8, @babel/traverse@npm:^7.25.0, @babel/traverse@npm:^7.25.2, @babel/traverse@npm:^7.25.4": version: 7.25.4 resolution: "@babel/traverse@npm:7.25.4" @@ -482,6 +542,21 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.7.2": + version: 7.25.9 + resolution: "@babel/traverse@npm:7.25.9" + dependencies: + "@babel/code-frame": "npm:^7.25.9" + "@babel/generator": "npm:^7.25.9" + "@babel/parser": "npm:^7.25.9" + "@babel/template": "npm:^7.25.9" + "@babel/types": "npm:^7.25.9" + debug: "npm:^4.3.1" + globals: "npm:^11.1.0" + checksum: 10/7431614d76d4a053e429208db82f2846a415833f3d9eb2e11ef72eeb3c64dfd71f4a4d983de1a4a047b36165a1f5a64de8ca2a417534cc472005c740ffcb9c6a + languageName: node + linkType: hard + "@babel/types@npm:^7.0.0, @babel/types@npm:^7.23.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.24.8, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.25.4, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3": version: 7.25.4 resolution: "@babel/types@npm:7.25.4" @@ -493,6 +568,16 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0": + version: 7.26.0 + resolution: "@babel/types@npm:7.26.0" + dependencies: + "@babel/helper-string-parser": "npm:^7.25.9" + "@babel/helper-validator-identifier": "npm:^7.25.9" + checksum: 10/40780741ecec886ed9edae234b5eb4976968cc70d72b4e5a40d55f83ff2cc457de20f9b0f4fe9d858350e43dab0ea496e7ef62e2b2f08df699481a76df02cd6e + languageName: node + linkType: hard + "@bcoe/v8-coverage@npm:^0.2.3": version: 0.2.3 resolution: "@bcoe/v8-coverage@npm:0.2.3" @@ -1154,6 +1239,20 @@ __metadata: languageName: node linkType: hard +"@jest/console@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/console@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + chalk: "npm:^4.0.0" + jest-message-util: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + slash: "npm:^3.0.0" + checksum: 10/82153eb24e61bd442bff350a7537d598e7c49097aabd9545b340582dcf1f17e5749baa342a67e564816a3a6ce746038b618ed9f66702140264bfa1e1d5cc9e5e + languageName: node + linkType: hard + "@jest/console@npm:^29.7.0": version: 29.7.0 resolution: "@jest/console@npm:29.7.0" @@ -1168,6 +1267,48 @@ __metadata: languageName: node linkType: hard +"@jest/core@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/core@npm:28.1.3" + dependencies: + "@jest/console": "npm:^28.1.3" + "@jest/reporters": "npm:^28.1.3" + "@jest/test-result": "npm:^28.1.3" + "@jest/transform": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + ansi-escapes: "npm:^4.2.1" + chalk: "npm:^4.0.0" + ci-info: "npm:^3.2.0" + exit: "npm:^0.1.2" + graceful-fs: "npm:^4.2.9" + jest-changed-files: "npm:^28.1.3" + jest-config: "npm:^28.1.3" + jest-haste-map: "npm:^28.1.3" + jest-message-util: "npm:^28.1.3" + jest-regex-util: "npm:^28.0.2" + jest-resolve: "npm:^28.1.3" + jest-resolve-dependencies: "npm:^28.1.3" + jest-runner: "npm:^28.1.3" + jest-runtime: "npm:^28.1.3" + jest-snapshot: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + jest-validate: "npm:^28.1.3" + jest-watcher: "npm:^28.1.3" + micromatch: "npm:^4.0.4" + pretty-format: "npm:^28.1.3" + rimraf: "npm:^3.0.0" + slash: "npm:^3.0.0" + strip-ansi: "npm:^6.0.0" + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + checksum: 10/72b56c7591dd1ec325c40e9f60f8111e17d4a09c918b7e5882de58ed1c656d6d34f085dfbdb49f65e6ac95b49919976c7b07821663cbcccd7f3a55c29db542b9 + languageName: node + linkType: hard + "@jest/core@npm:^29.7.0": version: 29.7.0 resolution: "@jest/core@npm:29.7.0" @@ -1209,6 +1350,18 @@ __metadata: languageName: node linkType: hard +"@jest/environment@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/environment@npm:28.1.3" + dependencies: + "@jest/fake-timers": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + jest-mock: "npm:^28.1.3" + checksum: 10/63a8efd099f8d5cd70398c7608d45fc91a5796b14d8f9f8c7fdb3a529e42004e3b60cf0c6e117cc88305d18ab7bb453f803a737e09293e9027a1e76ce835da57 + languageName: node + linkType: hard + "@jest/environment@npm:^29.7.0": version: 29.7.0 resolution: "@jest/environment@npm:29.7.0" @@ -1221,6 +1374,15 @@ __metadata: languageName: node linkType: hard +"@jest/expect-utils@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/expect-utils@npm:28.1.3" + dependencies: + jest-get-type: "npm:^28.0.2" + checksum: 10/f48e4c5b267438a565b6e4c00a06f2bd566dc65d8bb6114d57276ec1fa4f4cded548371e45caffe37c58e5cf3716dbec715c10cfacdae35c4c04b755d83fac96 + languageName: node + linkType: hard + "@jest/expect-utils@npm:^29.7.0": version: 29.7.0 resolution: "@jest/expect-utils@npm:29.7.0" @@ -1230,6 +1392,16 @@ __metadata: languageName: node linkType: hard +"@jest/expect@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/expect@npm:28.1.3" + dependencies: + expect: "npm:^28.1.3" + jest-snapshot: "npm:^28.1.3" + checksum: 10/31ea089e83a4c24f850043a97dfd777a352dd28a936819785f3d0de6e0bd537bfbfa8fd2df081db1adc68a6a55699e7d4ab3990d6a54e41753d86e5d2b66df2f + languageName: node + linkType: hard + "@jest/expect@npm:^29.7.0": version: 29.7.0 resolution: "@jest/expect@npm:29.7.0" @@ -1240,6 +1412,20 @@ __metadata: languageName: node linkType: hard +"@jest/fake-timers@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/fake-timers@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + "@sinonjs/fake-timers": "npm:^9.1.2" + "@types/node": "npm:*" + jest-message-util: "npm:^28.1.3" + jest-mock: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + checksum: 10/4002208f6637adc374175c97e845a19783f58874e9503fb956b801061ba1869a218964cf4631e1ac348e06e1667e982ceb94734db63ccfafdf37508f6b59be17 + languageName: node + linkType: hard + "@jest/fake-timers@npm:^29.7.0": version: 29.7.0 resolution: "@jest/fake-timers@npm:29.7.0" @@ -1254,6 +1440,17 @@ __metadata: languageName: node linkType: hard +"@jest/globals@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/globals@npm:28.1.3" + dependencies: + "@jest/environment": "npm:^28.1.3" + "@jest/expect": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + checksum: 10/3504bb23de629d466c6f2b6b75d2e1c1b10caccbbcfb7eaa82d22cc37711c8e364c243929581184846605c023b475ea6c42c2e3ea5994429a988d8d527af32cd + languageName: node + linkType: hard + "@jest/globals@npm:^29.7.0": version: 29.7.0 resolution: "@jest/globals@npm:29.7.0" @@ -1266,6 +1463,44 @@ __metadata: languageName: node linkType: hard +"@jest/reporters@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/reporters@npm:28.1.3" + dependencies: + "@bcoe/v8-coverage": "npm:^0.2.3" + "@jest/console": "npm:^28.1.3" + "@jest/test-result": "npm:^28.1.3" + "@jest/transform": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@jridgewell/trace-mapping": "npm:^0.3.13" + "@types/node": "npm:*" + chalk: "npm:^4.0.0" + collect-v8-coverage: "npm:^1.0.0" + exit: "npm:^0.1.2" + glob: "npm:^7.1.3" + graceful-fs: "npm:^4.2.9" + istanbul-lib-coverage: "npm:^3.0.0" + istanbul-lib-instrument: "npm:^5.1.0" + istanbul-lib-report: "npm:^3.0.0" + istanbul-lib-source-maps: "npm:^4.0.0" + istanbul-reports: "npm:^3.1.3" + jest-message-util: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + jest-worker: "npm:^28.1.3" + slash: "npm:^3.0.0" + string-length: "npm:^4.0.1" + strip-ansi: "npm:^6.0.0" + terminal-link: "npm:^2.0.0" + v8-to-istanbul: "npm:^9.0.1" + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + checksum: 10/bdce58bf1cf1fc0f7fb0c2ae02b5a9a1da32da83ee4697b2b23b8a5b0ac056af55dac07dcf7e869f963943e935da3bd26a788c478b6d52064c77320530d95a89 + languageName: node + linkType: hard + "@jest/reporters@npm:^29.7.0": version: 29.7.0 resolution: "@jest/reporters@npm:29.7.0" @@ -1303,6 +1538,15 @@ __metadata: languageName: node linkType: hard +"@jest/schemas@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/schemas@npm:28.1.3" + dependencies: + "@sinclair/typebox": "npm:^0.24.1" + checksum: 10/3cf1d4b66c9c4ffda58b246de1ddcba8e6ad085af63dccdf07922511f13b68c0cc480a7bc620cb4f3099a6f134801c747e1df7bfc7a4ef4dceefbdea3e31e1de + languageName: node + linkType: hard + "@jest/schemas@npm:^29.6.3": version: 29.6.3 resolution: "@jest/schemas@npm:29.6.3" @@ -1312,6 +1556,17 @@ __metadata: languageName: node linkType: hard +"@jest/source-map@npm:^28.1.2": + version: 28.1.2 + resolution: "@jest/source-map@npm:28.1.2" + dependencies: + "@jridgewell/trace-mapping": "npm:^0.3.13" + callsites: "npm:^3.0.0" + graceful-fs: "npm:^4.2.9" + checksum: 10/b82a5c2e93d35d86779c61a02ccb967d1b5cd2e9dd67d26d8add44958637cbbb99daeeb8129c7653389cb440dc2a2f5ae4d2183dc453c67669ff98938b775a3a + languageName: node + linkType: hard + "@jest/source-map@npm:^29.6.3": version: 29.6.3 resolution: "@jest/source-map@npm:29.6.3" @@ -1323,6 +1578,18 @@ __metadata: languageName: node linkType: hard +"@jest/test-result@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/test-result@npm:28.1.3" + dependencies: + "@jest/console": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/istanbul-lib-coverage": "npm:^2.0.0" + collect-v8-coverage: "npm:^1.0.0" + checksum: 10/d343f08e6e4971e8132540014711c5d29887651b036f03db8c7e9d6509fe9801316f0a6a393cd0af0431c50e6d1c1d310957f06b6cc20c08cab2e67b66a00c88 + languageName: node + linkType: hard + "@jest/test-result@npm:^29.7.0": version: 29.7.0 resolution: "@jest/test-result@npm:29.7.0" @@ -1335,6 +1602,18 @@ __metadata: languageName: node linkType: hard +"@jest/test-sequencer@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/test-sequencer@npm:28.1.3" + dependencies: + "@jest/test-result": "npm:^28.1.3" + graceful-fs: "npm:^4.2.9" + jest-haste-map: "npm:^28.1.3" + slash: "npm:^3.0.0" + checksum: 10/a2f05475c39a8e3e446a0f98c6830aa2492daffe8286db58c95e1870479ed4c2a74e2e51fac1d8b2958858aeb194331145c217d04482fb9312ba1a9e7dded171 + languageName: node + linkType: hard + "@jest/test-sequencer@npm:^29.7.0": version: 29.7.0 resolution: "@jest/test-sequencer@npm:29.7.0" @@ -1347,6 +1626,29 @@ __metadata: languageName: node linkType: hard +"@jest/transform@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/transform@npm:28.1.3" + dependencies: + "@babel/core": "npm:^7.11.6" + "@jest/types": "npm:^28.1.3" + "@jridgewell/trace-mapping": "npm:^0.3.13" + babel-plugin-istanbul: "npm:^6.1.1" + chalk: "npm:^4.0.0" + convert-source-map: "npm:^1.4.0" + fast-json-stable-stringify: "npm:^2.0.0" + graceful-fs: "npm:^4.2.9" + jest-haste-map: "npm:^28.1.3" + jest-regex-util: "npm:^28.0.2" + jest-util: "npm:^28.1.3" + micromatch: "npm:^4.0.4" + pirates: "npm:^4.0.4" + slash: "npm:^3.0.0" + write-file-atomic: "npm:^4.0.1" + checksum: 10/89bc17ca22d5e81eb35e9549beaa5778da0209c12c108552322b72fa7b41a387d119168dea28fd9415f16883fc6dd7a811690654ebb958375e70158b4d0e2965 + languageName: node + linkType: hard + "@jest/transform@npm:^29.7.0": version: 29.7.0 resolution: "@jest/transform@npm:29.7.0" @@ -1383,6 +1685,20 @@ __metadata: languageName: node linkType: hard +"@jest/types@npm:^28.1.3": + version: 28.1.3 + resolution: "@jest/types@npm:28.1.3" + dependencies: + "@jest/schemas": "npm:^28.1.3" + "@types/istanbul-lib-coverage": "npm:^2.0.0" + "@types/istanbul-reports": "npm:^3.0.0" + "@types/node": "npm:*" + "@types/yargs": "npm:^17.0.8" + chalk: "npm:^4.0.0" + checksum: 10/a90e636df760799b6c3d91e34e539e701ea803e80312257e674e345a3c23a7c892df7a301afbc7883ec1d623daf3ba266cde57c5965e0692e5f1e61915d3524b + languageName: node + linkType: hard + "@jest/types@npm:^29.6.3": version: 29.6.3 resolution: "@jest/types@npm:29.6.3" @@ -1439,7 +1755,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": +"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.13, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": version: 0.3.25 resolution: "@jridgewell/trace-mapping@npm:0.3.25" dependencies: @@ -1460,6 +1776,23 @@ __metadata: languageName: node linkType: hard +"@lavamoat/allow-scripts@npm:^3.0.4": + version: 3.3.0 + resolution: "@lavamoat/allow-scripts@npm:3.3.0" + dependencies: + "@lavamoat/aa": "npm:^4.3.0" + "@npmcli/run-script": "npm:8.1.0" + bin-links: "npm:4.0.4" + npm-normalize-package-bin: "npm:3.0.1" + yargs: "npm:17.7.2" + peerDependencies: + "@lavamoat/preinstall-always-fail": "*" + bin: + allow-scripts: src/cli.js + checksum: 10/476043c56425c3077d051a4a6ee4d045fab8b80bf16d50a9201c68224a2ddd77af03490388b7380004d348b11abf4ab7854ba52ba514d10d17c05d40dc8b870d + languageName: node + linkType: hard + "@lavamoat/allow-scripts@npm:^3.2.1": version: 3.2.1 resolution: "@lavamoat/allow-scripts@npm:3.2.1" @@ -1477,7 +1810,7 @@ __metadata: languageName: node linkType: hard -"@lavamoat/preinstall-always-fail@npm:^2.1.0": +"@lavamoat/preinstall-always-fail@npm:^2.0.0, @lavamoat/preinstall-always-fail@npm:^2.1.0": version: 2.1.0 resolution: "@lavamoat/preinstall-always-fail@npm:2.1.0" checksum: 10/385c3fac828b9edff2d8b5825bd29ea475206046984cdb3217518ad655f145ff37046414041534960d92cbe0759f0dc675f7c7dcf39a95003ae715a834fbd750 @@ -1997,6 +2330,10 @@ __metadata: "@lavamoat/preinstall-always-fail": "npm:^2.1.0" "@metamask/auto-changelog": "npm:^3.4.4" "@metamask/eth-sig-util": "npm:^8.0.0" + "@metamask/keyring-api": "workspace:^" + "@metamask/keyring-internal-api": "workspace:^" + "@metamask/keyring-snap-client": "workspace:^" + "@metamask/keyring-snap-sdk": "workspace:^" "@metamask/snaps-controllers": "npm:^9.10.0" "@metamask/snaps-sdk": "npm:^6.7.0" "@metamask/snaps-utils": "npm:^8.3.0" @@ -2079,6 +2416,17 @@ __metadata: languageName: node linkType: hard +"@metamask/json-rpc-engine@npm:^10.0.1": + version: 10.0.1 + resolution: "@metamask/json-rpc-engine@npm:10.0.1" + dependencies: + "@metamask/rpc-errors": "npm:^7.0.1" + "@metamask/safe-event-emitter": "npm:^3.0.0" + "@metamask/utils": "npm:^10.0.0" + checksum: 10/15a8eeab9af39b9ed87311da728e81169484ace733a8ef9fc469bd887654e37afa19f9e5228246dc80daad3fbf9b16067e73b2969d37d44acf5bc6ffa2c70082 + languageName: node + linkType: hard + "@metamask/json-rpc-engine@npm:^9.0.1, @metamask/json-rpc-engine@npm:^9.0.2": version: 9.0.2 resolution: "@metamask/json-rpc-engine@npm:9.0.2" @@ -2102,6 +2450,18 @@ __metadata: languageName: node linkType: hard +"@metamask/json-rpc-middleware-stream@npm:^8.0.5": + version: 8.0.5 + resolution: "@metamask/json-rpc-middleware-stream@npm:8.0.5" + dependencies: + "@metamask/json-rpc-engine": "npm:^10.0.1" + "@metamask/safe-event-emitter": "npm:^3.0.0" + "@metamask/utils": "npm:^10.0.0" + readable-stream: "npm:^3.6.2" + checksum: 10/486a4c64d445dc7ac7927ac5b9d01818ecef3fbb23d17eadada4748ed6cae9e259741e3c9380829b04a5c141d0972384647aedfde906dc83501b9d7f700ed621 + languageName: node + linkType: hard + "@metamask/key-tree@npm:^10.0.0": version: 10.0.0 resolution: "@metamask/key-tree@npm:10.0.0" @@ -2128,6 +2488,22 @@ __metadata: languageName: node linkType: hard +"@metamask/keyring-api@npm:^8.1.0": + version: 8.1.3 + resolution: "@metamask/keyring-api@npm:8.1.3" + dependencies: + "@metamask/snaps-sdk": "npm:^6.5.1" + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^9.2.1" + "@types/uuid": "npm:^9.0.8" + bech32: "npm:^2.0.0" + uuid: "npm:^9.0.1" + peerDependencies: + "@metamask/providers": ^17.2.0 + checksum: 10/9857b6286760d22b1b7102ea8bdf03ebf56c71e9f0adee19a2230def6b7a9230561c1a3bfcb308735b79ab9a5afa9afd07a1617c1d165f63d193cd6a6b6e7a15 + languageName: node + linkType: hard + "@metamask/keyring-api@workspace:^, @metamask/keyring-api@workspace:packages/keyring-api": version: 0.0.0-use.local resolution: "@metamask/keyring-api@workspace:packages/keyring-api" @@ -2157,7 +2533,7 @@ __metadata: languageName: unknown linkType: soft -"@metamask/keyring-internal-api@workspace:packages/keyring-internal-api": +"@metamask/keyring-internal-api@npm:^0.0.1, @metamask/keyring-internal-api@workspace:^, @metamask/keyring-internal-api@workspace:packages/keyring-internal-api": version: 0.0.0-use.local resolution: "@metamask/keyring-internal-api@workspace:packages/keyring-internal-api" dependencies: @@ -2185,7 +2561,74 @@ __metadata: languageName: unknown linkType: soft -"@metamask/keyring-utils@workspace:^, @metamask/keyring-utils@workspace:packages/keyring-utils": +"@metamask/keyring-snap-client@workspace:^, @metamask/keyring-snap-client@workspace:packages/keyring-snap-client": + version: 0.0.0-use.local + resolution: "@metamask/keyring-snap-client@workspace:packages/keyring-snap-client" + dependencies: + "@lavamoat/allow-scripts": "npm:^3.2.1" + "@lavamoat/preinstall-always-fail": "npm:^2.1.0" + "@metamask/auto-changelog": "npm:^3.4.4" + "@metamask/keyring-api": "workspace:^" + "@metamask/keyring-internal-api": "workspace:^" + "@metamask/keyring-snap-sdk": "workspace:^" + "@metamask/keyring-utils": "workspace:^" + "@metamask/providers": "npm:^18.1.0" + "@metamask/snaps-controllers": "npm:^9.10.0" + "@metamask/snaps-sdk": "npm:^6.7.0" + "@metamask/snaps-utils": "npm:^8.3.0" + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^9.2.1" + "@ts-bridge/cli": "npm:^0.6.0" + "@types/jest": "npm:^29.5.12" + "@types/node": "npm:^20.12.12" + "@types/uuid": "npm:^9.0.8" + deepmerge: "npm:^4.2.2" + depcheck: "npm:^1.4.7" + jest: "npm:^29.5.0" + jest-it-up: "npm:^3.1.0" + rimraf: "npm:^5.0.7" + ts-jest: "npm:^29.0.5" + ts-node: "npm:^10.9.2" + tsd: "npm:^0.31.0" + typedoc: "npm:^0.25.13" + typescript: "npm:~5.6.3" + uuid: "npm:^9.0.1" + webextension-polyfill: "npm:^0.12.0" + peerDependencies: + "@metamask/providers": ^18.1.0 + languageName: unknown + linkType: soft + +"@metamask/keyring-snap-sdk@workspace:^, @metamask/keyring-snap-sdk@workspace:packages/keyring-snap-sdk": + version: 0.0.0-use.local + resolution: "@metamask/keyring-snap-sdk@workspace:packages/keyring-snap-sdk" + dependencies: + "@lavamoat/allow-scripts": "npm:^3.0.4" + "@lavamoat/preinstall-always-fail": "npm:^2.0.0" + "@metamask/auto-changelog": "npm:^3.4.4" + "@metamask/keyring-api": "npm:^8.1.0" + "@metamask/keyring-internal-api": "npm:^0.0.1" + "@metamask/keyring-utils": "npm:^0.0.1" + "@metamask/providers": "npm:^17.1.1" + "@metamask/snaps-sdk": "npm:^6.1.0" + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^9.1.0" + "@types/jest": "npm:^29.5.12" + "@types/node": "npm:^20.12.12" + deepmerge: "npm:^4.2.2" + depcheck: "npm:^1.4.7" + jest: "npm:^28.1.3" + jest-it-up: "npm:^3.1.0" + rimraf: "npm:^5.0.7" + ts-jest: "npm:^28.0.8" + ts-node: "npm:^10.9.2" + tsd: "npm:^0.31.0" + typedoc: "npm:^0.25.13" + typescript: "npm:~4.8.4" + languageName: unknown + linkType: soft + +"@metamask/keyring-utils@npm:^0.0.1, @metamask/keyring-utils@workspace:^, @metamask/keyring-utils@workspace:packages/keyring-utils": version: 0.0.0-use.local resolution: "@metamask/keyring-utils@workspace:packages/keyring-utils" dependencies: @@ -2277,6 +2720,27 @@ __metadata: languageName: node linkType: hard +"@metamask/providers@npm:^17.1.1": + version: 17.2.1 + resolution: "@metamask/providers@npm:17.2.1" + dependencies: + "@metamask/json-rpc-engine": "npm:^9.0.1" + "@metamask/json-rpc-middleware-stream": "npm:^8.0.1" + "@metamask/object-multiplex": "npm:^2.0.0" + "@metamask/rpc-errors": "npm:^6.3.1" + "@metamask/safe-event-emitter": "npm:^3.1.1" + "@metamask/utils": "npm:^9.0.0" + detect-browser: "npm:^5.2.0" + extension-port-stream: "npm:^4.1.0" + fast-deep-equal: "npm:^3.1.3" + is-stream: "npm:^2.0.0" + readable-stream: "npm:^3.6.2" + peerDependencies: + webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0 + checksum: 10/ff9cbcdd4cfa410c52ae0d9d39ad9285fb21f583bcb36a8a39d1862681fe17483008c15ab0ce87797ea94cad82a2f2e58b29b1db1f02df151f9cf3b05013e8a4 + languageName: node + linkType: hard + "@metamask/providers@npm:^17.1.2": version: 17.2.0 resolution: "@metamask/providers@npm:17.2.0" @@ -2319,6 +2783,27 @@ __metadata: languageName: node linkType: hard +"@metamask/providers@npm:^18.1.1": + version: 18.1.1 + resolution: "@metamask/providers@npm:18.1.1" + dependencies: + "@metamask/json-rpc-engine": "npm:^10.0.1" + "@metamask/json-rpc-middleware-stream": "npm:^8.0.5" + "@metamask/object-multiplex": "npm:^2.0.0" + "@metamask/rpc-errors": "npm:^7.0.1" + "@metamask/safe-event-emitter": "npm:^3.1.1" + "@metamask/utils": "npm:^10.0.0" + detect-browser: "npm:^5.2.0" + extension-port-stream: "npm:^4.1.0" + fast-deep-equal: "npm:^3.1.3" + is-stream: "npm:^2.0.0" + readable-stream: "npm:^3.6.2" + peerDependencies: + webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0 + checksum: 10/dca428d84e490343d85921d4fb09216a0b64be59a036d7b4f7b5ca4e2581c29a4106d58ff9dfe0650dc2b9387dd2adad508fc61073a9fda8ebde8ee3a5137abe + languageName: node + linkType: hard + "@metamask/rpc-errors@npm:^6.3.1": version: 6.3.1 resolution: "@metamask/rpc-errors@npm:6.3.1" @@ -2339,6 +2824,16 @@ __metadata: languageName: node linkType: hard +"@metamask/rpc-errors@npm:^7.0.1": + version: 7.0.1 + resolution: "@metamask/rpc-errors@npm:7.0.1" + dependencies: + "@metamask/utils": "npm:^10.0.0" + fast-safe-stringify: "npm:^2.0.6" + checksum: 10/819708b4a7d9695ee67fd867d8f94bb5a273b479a242b17bd53c83d1fceec421fc42928f0bb340f4f138ec803dd82ec9659ce7b09a86aedad6a81d5a39ec5c35 + languageName: node + linkType: hard + "@metamask/safe-event-emitter@npm:^3.0.0, @metamask/safe-event-emitter@npm:^3.1.1": version: 3.1.1 resolution: "@metamask/safe-event-emitter@npm:3.1.1" @@ -2428,6 +2923,19 @@ __metadata: languageName: node linkType: hard +"@metamask/snaps-sdk@npm:^6.1.0, @metamask/snaps-sdk@npm:^6.5.1": + version: 6.12.0 + resolution: "@metamask/snaps-sdk@npm:6.12.0" + dependencies: + "@metamask/key-tree": "npm:^9.1.2" + "@metamask/providers": "npm:^18.1.1" + "@metamask/rpc-errors": "npm:^7.0.1" + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^10.0.0" + checksum: 10/b0e24fee2c90ac2f456aeb5babc180c74f56b8cf94f38abdd9b022c65a9cac4a10015e3d4053784292c184238f97704cb2b6a41f6e7a04f23ffaa8d519d2a39e + languageName: node + linkType: hard + "@metamask/snaps-sdk@npm:^6.7.0": version: 6.7.0 resolution: "@metamask/snaps-sdk@npm:6.7.0" @@ -2479,7 +2987,7 @@ __metadata: languageName: node linkType: hard -"@metamask/utils@npm:^10.0.1": +"@metamask/utils@npm:^10.0.0, @metamask/utils@npm:^10.0.1": version: 10.0.1 resolution: "@metamask/utils@npm:10.0.1" dependencies: @@ -2798,6 +3306,13 @@ __metadata: languageName: node linkType: hard +"@sinclair/typebox@npm:^0.24.1": + version: 0.24.51 + resolution: "@sinclair/typebox@npm:0.24.51" + checksum: 10/7886847b9deda1d926934066fe69165a1d9bbe7b0f836543c25efb96173c17009ef7a98619f48b379294bf27958844da3428eb35e65f8d941ea43563ad6e961e + languageName: node + linkType: hard + "@sinclair/typebox@npm:^0.27.8": version: 0.27.8 resolution: "@sinclair/typebox@npm:0.27.8" @@ -2819,6 +3334,15 @@ __metadata: languageName: node linkType: hard +"@sinonjs/commons@npm:^1.7.0": + version: 1.8.6 + resolution: "@sinonjs/commons@npm:1.8.6" + dependencies: + type-detect: "npm:4.0.8" + checksum: 10/51987338fd8b4d1e135822ad593dd23a3288764aa41d83c695124d512bc38b87eece859078008651ecc7f1df89a7e558a515dc6f02d21a93be4ba50b39a28914 + languageName: node + linkType: hard + "@sinonjs/commons@npm:^3.0.0, @sinonjs/commons@npm:^3.0.1": version: 3.0.1 resolution: "@sinonjs/commons@npm:3.0.1" @@ -2846,6 +3370,15 @@ __metadata: languageName: node linkType: hard +"@sinonjs/fake-timers@npm:^9.1.2": + version: 9.1.2 + resolution: "@sinonjs/fake-timers@npm:9.1.2" + dependencies: + "@sinonjs/commons": "npm:^1.7.0" + checksum: 10/033c74ad389b0655b6af2fa1af31dddf45878e65879f06c5d1940e0ceb053a234f2f46c728dcd97df8ee9312431e45dd7aedaee3a69d47f73a2001a7547fc3d6 + languageName: node + linkType: hard + "@sinonjs/samsam@npm:^8.0.1": version: 8.0.2 resolution: "@sinonjs/samsam@npm:8.0.2" @@ -3484,6 +4017,13 @@ __metadata: languageName: node linkType: hard +"@types/prettier@npm:^2.1.5": + version: 2.7.3 + resolution: "@types/prettier@npm:2.7.3" + checksum: 10/cda84c19acc3bf327545b1ce71114a7d08efbd67b5030b9e8277b347fa57b05178045f70debe1d363ff7efdae62f237260713aafc2d7217e06fc99b048a88497 + languageName: node + linkType: hard + "@types/punycode@npm:^2.1.0": version: 2.1.4 resolution: "@types/punycode@npm:2.1.4" @@ -4292,6 +4832,23 @@ __metadata: languageName: node linkType: hard +"babel-jest@npm:^28.1.3": + version: 28.1.3 + resolution: "babel-jest@npm:28.1.3" + dependencies: + "@jest/transform": "npm:^28.1.3" + "@types/babel__core": "npm:^7.1.14" + babel-plugin-istanbul: "npm:^6.1.1" + babel-preset-jest: "npm:^28.1.3" + chalk: "npm:^4.0.0" + graceful-fs: "npm:^4.2.9" + slash: "npm:^3.0.0" + peerDependencies: + "@babel/core": ^7.8.0 + checksum: 10/6dcbf194a037fb3df18d2aee56a3919a98a9b34292d1eb4aad823ebfa8b67f5a55f897213c1aafd52183928e99770319b8a094681ccb2910dc9993e6a7c1fd61 + languageName: node + linkType: hard + "babel-jest@npm:^29.7.0": version: 29.7.0 resolution: "babel-jest@npm:29.7.0" @@ -4322,6 +4879,18 @@ __metadata: languageName: node linkType: hard +"babel-plugin-jest-hoist@npm:^28.1.3": + version: 28.1.3 + resolution: "babel-plugin-jest-hoist@npm:28.1.3" + dependencies: + "@babel/template": "npm:^7.3.3" + "@babel/types": "npm:^7.3.3" + "@types/babel__core": "npm:^7.1.14" + "@types/babel__traverse": "npm:^7.0.6" + checksum: 10/355e383dae2b50efa0aff73a751f6bc55e7ae19ddfe72c73f4a0ad7667a671175aba17d824833d98b33602da18dd04e5e5d37d03c4f245940d8664c45ad29df5 + languageName: node + linkType: hard + "babel-plugin-jest-hoist@npm:^29.6.3": version: 29.6.3 resolution: "babel-plugin-jest-hoist@npm:29.6.3" @@ -4356,6 +4925,18 @@ __metadata: languageName: node linkType: hard +"babel-preset-jest@npm:^28.1.3": + version: 28.1.3 + resolution: "babel-preset-jest@npm:28.1.3" + dependencies: + babel-plugin-jest-hoist: "npm:^28.1.3" + babel-preset-current-node-syntax: "npm:^1.0.0" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/8248a4a5ca4242cc06ad13b10b9183ad2664da8fb0da060c352223dcf286f0ce9c708fa17901dc44ecabec25e6d309e5e5b9830a61dd777c3925f187a345a47d + languageName: node + linkType: hard + "babel-preset-jest@npm:^29.6.3": version: 29.6.3 resolution: "babel-preset-jest@npm:29.6.3" @@ -4615,7 +5196,7 @@ __metadata: languageName: node linkType: hard -"bs-logger@npm:^0.2.6": +"bs-logger@npm:0.x, bs-logger@npm:^0.2.6": version: 0.2.6 resolution: "bs-logger@npm:0.2.6" dependencies: @@ -5088,6 +5669,13 @@ __metadata: languageName: node linkType: hard +"convert-source-map@npm:^1.4.0": + version: 1.9.0 + resolution: "convert-source-map@npm:1.9.0" + checksum: 10/dc55a1f28ddd0e9485ef13565f8f756b342f9a46c4ae18b843fe3c30c675d058d6a4823eff86d472f187b176f0adf51ea7b69ea38be34be4a63cbbf91b0593c8 + languageName: node + linkType: hard + "convert-source-map@npm:^1.6.0": version: 1.7.0 resolution: "convert-source-map@npm:1.7.0" @@ -5309,6 +5897,13 @@ __metadata: languageName: node linkType: hard +"dedent@npm:^0.7.0": + version: 0.7.0 + resolution: "dedent@npm:0.7.0" + checksum: 10/87de191050d9a40dd70cad01159a0bcf05ecb59750951242070b6abf9569088684880d00ba92a955b4058804f16eeaf91d604f283929b4f614d181cd7ae633d2 + languageName: node + linkType: hard + "dedent@npm:^1.0.0": version: 1.5.3 resolution: "dedent@npm:1.5.3" @@ -5460,6 +6055,13 @@ __metadata: languageName: node linkType: hard +"diff-sequences@npm:^28.1.1": + version: 28.1.1 + resolution: "diff-sequences@npm:28.1.1" + checksum: 10/89752708215cf0d13ec98cb3cded36154951beec9ac8c23d5a665498ba880e1e3aad544ad046ad5223c141fc35b362665fae534e14a253654da77b514a28438d + languageName: node + linkType: hard + "diff-sequences@npm:^29.6.3": version: 29.6.3 resolution: "diff-sequences@npm:29.6.3" @@ -5586,6 +6188,13 @@ __metadata: languageName: node linkType: hard +"emittery@npm:^0.10.2": + version: 0.10.2 + resolution: "emittery@npm:0.10.2" + checksum: 10/fa86fc2b1f4c792d7d479a4de1a6a1f74b0b597770bae770336f0be6501e64be0995aa07d284ae502b269f5cec960cd0c44c91dd090d06d8deecee6d9787e396 + languageName: node + linkType: hard + "emittery@npm:^0.13.1": version: 0.13.1 resolution: "emittery@npm:0.13.1" @@ -6373,6 +6982,19 @@ __metadata: languageName: node linkType: hard +"expect@npm:^28.1.3": + version: 28.1.3 + resolution: "expect@npm:28.1.3" + dependencies: + "@jest/expect-utils": "npm:^28.1.3" + jest-get-type: "npm:^28.0.2" + jest-matcher-utils: "npm:^28.1.3" + jest-message-util: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + checksum: 10/87033c88f7a578063ae7de98000fbd423bdb751756b1c6a1c69cd2b093bdb8b11a5b7a66eb89984068850d14978c7daffc2cc8ed56eb912424c24885a7573061 + languageName: node + linkType: hard + "expect@npm:^29.0.0, expect@npm:^29.7.0": version: 29.7.0 resolution: "expect@npm:29.7.0" @@ -7597,6 +8219,19 @@ __metadata: languageName: node linkType: hard +"istanbul-lib-instrument@npm:^5.1.0": + version: 5.2.1 + resolution: "istanbul-lib-instrument@npm:5.2.1" + dependencies: + "@babel/core": "npm:^7.12.3" + "@babel/parser": "npm:^7.14.7" + "@istanbuljs/schema": "npm:^0.1.2" + istanbul-lib-coverage: "npm:^3.2.0" + semver: "npm:^6.3.0" + checksum: 10/bbc4496c2f304d799f8ec22202ab38c010ac265c441947f075c0f7d46bd440b45c00e46017cf9053453d42182d768b1d6ed0e70a142c95ab00df9843aa5ab80e + languageName: node + linkType: hard + "istanbul-lib-instrument@npm:^6.0.0": version: 6.0.3 resolution: "istanbul-lib-instrument@npm:6.0.3" @@ -7691,6 +8326,16 @@ __metadata: languageName: node linkType: hard +"jest-changed-files@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-changed-files@npm:28.1.3" + dependencies: + execa: "npm:^5.0.0" + p-limit: "npm:^3.1.0" + checksum: 10/206be715fed00c70d69f46f6274129816b2959dd9fe5d77b7c929d572eef8f55092baea48f51cf45848edd17e23b00aa720201b5e7781904e6ede06ba666e668 + languageName: node + linkType: hard + "jest-changed-files@npm:^29.7.0": version: 29.7.0 resolution: "jest-changed-files@npm:29.7.0" @@ -7702,6 +8347,33 @@ __metadata: languageName: node linkType: hard +"jest-circus@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-circus@npm:28.1.3" + dependencies: + "@jest/environment": "npm:^28.1.3" + "@jest/expect": "npm:^28.1.3" + "@jest/test-result": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + chalk: "npm:^4.0.0" + co: "npm:^4.6.0" + dedent: "npm:^0.7.0" + is-generator-fn: "npm:^2.0.0" + jest-each: "npm:^28.1.3" + jest-matcher-utils: "npm:^28.1.3" + jest-message-util: "npm:^28.1.3" + jest-runtime: "npm:^28.1.3" + jest-snapshot: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + p-limit: "npm:^3.1.0" + pretty-format: "npm:^28.1.3" + slash: "npm:^3.0.0" + stack-utils: "npm:^2.0.3" + checksum: 10/3ac1f369cadbdd1982c123c04bc69f140b9790a8d0a729084f53aa13154bbdf318ba162dc70daecc37ef1d620afa339408d6b99a0314306238c547dc6a25b4a3 + languageName: node + linkType: hard + "jest-circus@npm:^29.7.0": version: 29.7.0 resolution: "jest-circus@npm:29.7.0" @@ -7730,6 +8402,33 @@ __metadata: languageName: node linkType: hard +"jest-cli@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-cli@npm:28.1.3" + dependencies: + "@jest/core": "npm:^28.1.3" + "@jest/test-result": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + chalk: "npm:^4.0.0" + exit: "npm:^0.1.2" + graceful-fs: "npm:^4.2.9" + import-local: "npm:^3.0.2" + jest-config: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + jest-validate: "npm:^28.1.3" + prompts: "npm:^2.0.1" + yargs: "npm:^17.3.1" + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + bin: + jest: bin/jest.js + checksum: 10/935a0c517e7b972e60543fdb921302fc63d78e629ab077195c91336279c0815978ca2e03c65ec6dbff3226a5c4ee64b13c7ef5a86387330c9da54454cd4bbbfb + languageName: node + linkType: hard + "jest-cli@npm:^29.7.0": version: 29.7.0 resolution: "jest-cli@npm:29.7.0" @@ -7756,6 +8455,44 @@ __metadata: languageName: node linkType: hard +"jest-config@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-config@npm:28.1.3" + dependencies: + "@babel/core": "npm:^7.11.6" + "@jest/test-sequencer": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + babel-jest: "npm:^28.1.3" + chalk: "npm:^4.0.0" + ci-info: "npm:^3.2.0" + deepmerge: "npm:^4.2.2" + glob: "npm:^7.1.3" + graceful-fs: "npm:^4.2.9" + jest-circus: "npm:^28.1.3" + jest-environment-node: "npm:^28.1.3" + jest-get-type: "npm:^28.0.2" + jest-regex-util: "npm:^28.0.2" + jest-resolve: "npm:^28.1.3" + jest-runner: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + jest-validate: "npm:^28.1.3" + micromatch: "npm:^4.0.4" + parse-json: "npm:^5.2.0" + pretty-format: "npm:^28.1.3" + slash: "npm:^3.0.0" + strip-json-comments: "npm:^3.1.1" + peerDependencies: + "@types/node": "*" + ts-node: ">=9.0.0" + peerDependenciesMeta: + "@types/node": + optional: true + ts-node: + optional: true + checksum: 10/457d8709e24e0e4d8a8a8e074a65092e896d80f30d80c0448f8ce6a24bd0b30060a1a593a20aa7fb8c3c2228d519f0a979ccdff3a176efb60afc7187785d59cf + languageName: node + linkType: hard + "jest-config@npm:^29.7.0": version: 29.7.0 resolution: "jest-config@npm:29.7.0" @@ -7794,6 +8531,18 @@ __metadata: languageName: node linkType: hard +"jest-diff@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-diff@npm:28.1.3" + dependencies: + chalk: "npm:^4.0.0" + diff-sequences: "npm:^28.1.1" + jest-get-type: "npm:^28.0.2" + pretty-format: "npm:^28.1.3" + checksum: 10/42b8d82c59df879b2cfdf3583fecd40c31ce8c9364644d8d430f5bd533a32e475ca0b383b7a744293332008c50f7901bedeac73c60463ac9e7e2b80249e1325c + languageName: node + linkType: hard + "jest-diff@npm:^29.0.3, jest-diff@npm:^29.7.0": version: 29.7.0 resolution: "jest-diff@npm:29.7.0" @@ -7806,6 +8555,15 @@ __metadata: languageName: node linkType: hard +"jest-docblock@npm:^28.1.1": + version: 28.1.1 + resolution: "jest-docblock@npm:28.1.1" + dependencies: + detect-newline: "npm:^3.0.0" + checksum: 10/4062cb9ba54c88c88f5452fcd054937f35755240014ea277ff8dbfde30efcbdb77a4844a09279e55ec98f2fe9a1978a9b8583315e93fdf03602a619ae070356b + languageName: node + linkType: hard + "jest-docblock@npm:^29.7.0": version: 29.7.0 resolution: "jest-docblock@npm:29.7.0" @@ -7815,6 +8573,19 @@ __metadata: languageName: node linkType: hard +"jest-each@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-each@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + chalk: "npm:^4.0.0" + jest-get-type: "npm:^28.0.2" + jest-util: "npm:^28.1.3" + pretty-format: "npm:^28.1.3" + checksum: 10/4877cdda70048923ad6aabf25779e3e2c6bc580253d95739b8af291fbc506b95b043031b498f26807093abe9e6e93ecd7b50e3ce5b7ab175fc21637a197a248b + languageName: node + linkType: hard + "jest-each@npm:^29.7.0": version: 29.7.0 resolution: "jest-each@npm:29.7.0" @@ -7849,6 +8620,20 @@ __metadata: languageName: node linkType: hard +"jest-environment-node@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-environment-node@npm:28.1.3" + dependencies: + "@jest/environment": "npm:^28.1.3" + "@jest/fake-timers": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + jest-mock: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + checksum: 10/ab9ec5c57309a0ca40ebc58ba84b4980445f24d351cc3292c8c8715062c7ea14442d9d8e7701eccb9cb810f425bbdb7eba631fd76fb1835b92150b6bdda7cb18 + languageName: node + linkType: hard + "jest-environment-node@npm:^29.7.0": version: 29.7.0 resolution: "jest-environment-node@npm:29.7.0" @@ -7863,6 +8648,13 @@ __metadata: languageName: node linkType: hard +"jest-get-type@npm:^28.0.2": + version: 28.0.2 + resolution: "jest-get-type@npm:28.0.2" + checksum: 10/5281d7c89bc8156605f6d15784f45074f4548501195c26e9b188742768f72d40948252d13230ea905b5349038865a1a8eeff0e614cc530ff289dfc41fe843abd + languageName: node + linkType: hard + "jest-get-type@npm:^29.6.3": version: 29.6.3 resolution: "jest-get-type@npm:29.6.3" @@ -7870,6 +8662,29 @@ __metadata: languageName: node linkType: hard +"jest-haste-map@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-haste-map@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + "@types/graceful-fs": "npm:^4.1.3" + "@types/node": "npm:*" + anymatch: "npm:^3.0.3" + fb-watchman: "npm:^2.0.0" + fsevents: "npm:^2.3.2" + graceful-fs: "npm:^4.2.9" + jest-regex-util: "npm:^28.0.2" + jest-util: "npm:^28.1.3" + jest-worker: "npm:^28.1.3" + micromatch: "npm:^4.0.4" + walker: "npm:^1.0.8" + dependenciesMeta: + fsevents: + optional: true + checksum: 10/c78e0e81e3f138f379440fb2ddfdc3753da377b74477df02ef404d5de1508d6545d28cf02516713dbde093a8c112098be6f50080a7a8fab6b888992720322a57 + languageName: node + linkType: hard + "jest-haste-map@npm:^29.7.0": version: 29.7.0 resolution: "jest-haste-map@npm:29.7.0" @@ -7906,6 +8721,16 @@ __metadata: languageName: node linkType: hard +"jest-leak-detector@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-leak-detector@npm:28.1.3" + dependencies: + jest-get-type: "npm:^28.0.2" + pretty-format: "npm:^28.1.3" + checksum: 10/2e976a4880cf9af11f53a19f6a3820e0f90b635a900737a5427fc42e337d5628ba446dcd7c020ecea3806cf92bc0bbf6982ed62a9cd84e5a13d8751aa30fbbb7 + languageName: node + linkType: hard + "jest-leak-detector@npm:^29.7.0": version: 29.7.0 resolution: "jest-leak-detector@npm:29.7.0" @@ -7916,6 +8741,18 @@ __metadata: languageName: node linkType: hard +"jest-matcher-utils@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-matcher-utils@npm:28.1.3" + dependencies: + chalk: "npm:^4.0.0" + jest-diff: "npm:^28.1.3" + jest-get-type: "npm:^28.0.2" + pretty-format: "npm:^28.1.3" + checksum: 10/958f4bacdaee6949f1d1da413129f2249083bc6fa3f4ac5c559795b370aec7159f99f02340f706cc895b90938c2bafe1aab347c9a34f8819c59afd1a4cd6c009 + languageName: node + linkType: hard + "jest-matcher-utils@npm:^29.7.0": version: 29.7.0 resolution: "jest-matcher-utils@npm:29.7.0" @@ -7928,6 +8765,23 @@ __metadata: languageName: node linkType: hard +"jest-message-util@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-message-util@npm:28.1.3" + dependencies: + "@babel/code-frame": "npm:^7.12.13" + "@jest/types": "npm:^28.1.3" + "@types/stack-utils": "npm:^2.0.0" + chalk: "npm:^4.0.0" + graceful-fs: "npm:^4.2.9" + micromatch: "npm:^4.0.4" + pretty-format: "npm:^28.1.3" + slash: "npm:^3.0.0" + stack-utils: "npm:^2.0.3" + checksum: 10/91137a507e9eb79ef6156a3d17c882a181fa662da28cc1a86245ff53ba13726653c8d5fed2660e922aae020a9caca4d22c3689bfe61a215c8a17a43e01b7eb5c + languageName: node + linkType: hard + "jest-message-util@npm:^29.7.0": version: 29.7.0 resolution: "jest-message-util@npm:29.7.0" @@ -7945,6 +8799,16 @@ __metadata: languageName: node linkType: hard +"jest-mock@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-mock@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + checksum: 10/43cbec0ceddea795b8b2bc09f8632eecc97b88ef018a9c9737b887ed6cbdbda000a436e9165dce2bccfbb949be8b0daca6faa530dc390d43a0e5e3099f3ae216 + languageName: node + linkType: hard + "jest-mock@npm:^29.7.0": version: 29.7.0 resolution: "jest-mock@npm:29.7.0" @@ -7968,6 +8832,13 @@ __metadata: languageName: node linkType: hard +"jest-regex-util@npm:^28.0.2": + version: 28.0.2 + resolution: "jest-regex-util@npm:28.0.2" + checksum: 10/0ea8c5c82ec88bc85e273c0ec82e0c0f35f7a1e2d055070e50f0cc2a2177f848eec55f73e37ae0d045c3db5014c42b2f90ac62c1ab3fdb354d2abd66a9e08add + languageName: node + linkType: hard + "jest-regex-util@npm:^29.6.3": version: 29.6.3 resolution: "jest-regex-util@npm:29.6.3" @@ -7975,6 +8846,16 @@ __metadata: languageName: node linkType: hard +"jest-resolve-dependencies@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-resolve-dependencies@npm:28.1.3" + dependencies: + jest-regex-util: "npm:^28.0.2" + jest-snapshot: "npm:^28.1.3" + checksum: 10/5c3128ea5f702a22141116b6a3d83c594c192d3e17b7235a1d47ecd64bcd9aa4924100668804e6b54faf5a1437a366f37165a2ea7170a2ce35899323b4ed7aac + languageName: node + linkType: hard + "jest-resolve-dependencies@npm:^29.7.0": version: 29.7.0 resolution: "jest-resolve-dependencies@npm:29.7.0" @@ -7985,6 +8866,23 @@ __metadata: languageName: node linkType: hard +"jest-resolve@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-resolve@npm:28.1.3" + dependencies: + chalk: "npm:^4.0.0" + graceful-fs: "npm:^4.2.9" + jest-haste-map: "npm:^28.1.3" + jest-pnp-resolver: "npm:^1.2.2" + jest-util: "npm:^28.1.3" + jest-validate: "npm:^28.1.3" + resolve: "npm:^1.20.0" + resolve.exports: "npm:^1.1.0" + slash: "npm:^3.0.0" + checksum: 10/742b2301a43172206bf88d405df73d19510cfd4eacb0fb16d620157de408e9f7399567a57c86c61b30aaa303c15d88a77b38a69ad0230d288e44db4d44d5f724 + languageName: node + linkType: hard + "jest-resolve@npm:^29.7.0": version: 29.7.0 resolution: "jest-resolve@npm:29.7.0" @@ -8002,6 +8900,35 @@ __metadata: languageName: node linkType: hard +"jest-runner@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-runner@npm:28.1.3" + dependencies: + "@jest/console": "npm:^28.1.3" + "@jest/environment": "npm:^28.1.3" + "@jest/test-result": "npm:^28.1.3" + "@jest/transform": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + chalk: "npm:^4.0.0" + emittery: "npm:^0.10.2" + graceful-fs: "npm:^4.2.9" + jest-docblock: "npm:^28.1.1" + jest-environment-node: "npm:^28.1.3" + jest-haste-map: "npm:^28.1.3" + jest-leak-detector: "npm:^28.1.3" + jest-message-util: "npm:^28.1.3" + jest-resolve: "npm:^28.1.3" + jest-runtime: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + jest-watcher: "npm:^28.1.3" + jest-worker: "npm:^28.1.3" + p-limit: "npm:^3.1.0" + source-map-support: "npm:0.5.13" + checksum: 10/0fb6ed4f628650da9ff502b89bfdf98ea7f3015ad0369429c223ddae793573d9c5f350e95756e8bb827e2e6e3de03e5cb94569075c5788e574697b63c09d80ae + languageName: node + linkType: hard + "jest-runner@npm:^29.7.0": version: 29.7.0 resolution: "jest-runner@npm:29.7.0" @@ -8031,6 +8958,36 @@ __metadata: languageName: node linkType: hard +"jest-runtime@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-runtime@npm:28.1.3" + dependencies: + "@jest/environment": "npm:^28.1.3" + "@jest/fake-timers": "npm:^28.1.3" + "@jest/globals": "npm:^28.1.3" + "@jest/source-map": "npm:^28.1.2" + "@jest/test-result": "npm:^28.1.3" + "@jest/transform": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + chalk: "npm:^4.0.0" + cjs-module-lexer: "npm:^1.0.0" + collect-v8-coverage: "npm:^1.0.0" + execa: "npm:^5.0.0" + glob: "npm:^7.1.3" + graceful-fs: "npm:^4.2.9" + jest-haste-map: "npm:^28.1.3" + jest-message-util: "npm:^28.1.3" + jest-mock: "npm:^28.1.3" + jest-regex-util: "npm:^28.0.2" + jest-resolve: "npm:^28.1.3" + jest-snapshot: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + slash: "npm:^3.0.0" + strip-bom: "npm:^4.0.0" + checksum: 10/d3d91b3f1082bbe3f87dc11ad7abce12f323797d98b3fa5ef7fb5efbd6d30e42041e3732cb8be5d41f0c8d8312d14461381d829ed1fe4e3712cfc82ea4a586fc + languageName: node + linkType: hard + "jest-runtime@npm:^29.7.0": version: 29.7.0 resolution: "jest-runtime@npm:29.7.0" @@ -8071,6 +9028,37 @@ __metadata: languageName: node linkType: hard +"jest-snapshot@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-snapshot@npm:28.1.3" + dependencies: + "@babel/core": "npm:^7.11.6" + "@babel/generator": "npm:^7.7.2" + "@babel/plugin-syntax-typescript": "npm:^7.7.2" + "@babel/traverse": "npm:^7.7.2" + "@babel/types": "npm:^7.3.3" + "@jest/expect-utils": "npm:^28.1.3" + "@jest/transform": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/babel__traverse": "npm:^7.0.6" + "@types/prettier": "npm:^2.1.5" + babel-preset-current-node-syntax: "npm:^1.0.0" + chalk: "npm:^4.0.0" + expect: "npm:^28.1.3" + graceful-fs: "npm:^4.2.9" + jest-diff: "npm:^28.1.3" + jest-get-type: "npm:^28.0.2" + jest-haste-map: "npm:^28.1.3" + jest-matcher-utils: "npm:^28.1.3" + jest-message-util: "npm:^28.1.3" + jest-util: "npm:^28.1.3" + natural-compare: "npm:^1.4.0" + pretty-format: "npm:^28.1.3" + semver: "npm:^7.3.5" + checksum: 10/4e1f4e2aa5ccc776f1fdaab75f96342534f737df0d43458e0614af362f7e80097909f69e5d8f2d0aed2caae07fa122b1cf7b8da0c97c44c3b2d06da472d7ad79 + languageName: node + linkType: hard + "jest-snapshot@npm:^29.7.0": version: 29.7.0 resolution: "jest-snapshot@npm:29.7.0" @@ -8113,6 +9101,20 @@ __metadata: languageName: node linkType: hard +"jest-util@npm:^28.0.0, jest-util@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-util@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + chalk: "npm:^4.0.0" + ci-info: "npm:^3.2.0" + graceful-fs: "npm:^4.2.9" + picomatch: "npm:^2.2.3" + checksum: 10/92895523d30ddde8f22bebbc20ed6e1be35b0a21c8e9df8a1fc289bf354f6a3f96e5d271340f2ed212a5aa0b55fd7717ff3167da8c5f247d623e2a93a3bf7b32 + languageName: node + linkType: hard + "jest-util@npm:^29.0.0, jest-util@npm:^29.7.0": version: 29.7.0 resolution: "jest-util@npm:29.7.0" @@ -8127,6 +9129,20 @@ __metadata: languageName: node linkType: hard +"jest-validate@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-validate@npm:28.1.3" + dependencies: + "@jest/types": "npm:^28.1.3" + camelcase: "npm:^6.2.0" + chalk: "npm:^4.0.0" + jest-get-type: "npm:^28.0.2" + leven: "npm:^3.1.0" + pretty-format: "npm:^28.1.3" + checksum: 10/c49c8c64b4afbfb5c7434cfd30f8adbe7c6f57ce3ad6be55cfd65403f9ae664822badc1f27844ae800b23c84653bea834e928ad79e18ea0afdc4aa2d0a121156 + languageName: node + linkType: hard + "jest-validate@npm:^29.7.0": version: 29.7.0 resolution: "jest-validate@npm:29.7.0" @@ -8141,6 +9157,22 @@ __metadata: languageName: node linkType: hard +"jest-watcher@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-watcher@npm:28.1.3" + dependencies: + "@jest/test-result": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + "@types/node": "npm:*" + ansi-escapes: "npm:^4.2.1" + chalk: "npm:^4.0.0" + emittery: "npm:^0.10.2" + jest-util: "npm:^28.1.3" + string-length: "npm:^4.0.1" + checksum: 10/e6d2c099d461408a992d144c230112fb282b2d8f54c49227bdb0c3efcfa5ecab70a019fc57d8ad6360000459087bb942c4f72670b52fc5b97ac0d9834f87d24e + languageName: node + linkType: hard + "jest-watcher@npm:^29.7.0": version: 29.7.0 resolution: "jest-watcher@npm:29.7.0" @@ -8157,6 +9189,17 @@ __metadata: languageName: node linkType: hard +"jest-worker@npm:^28.1.3": + version: 28.1.3 + resolution: "jest-worker@npm:28.1.3" + dependencies: + "@types/node": "npm:*" + merge-stream: "npm:^2.0.0" + supports-color: "npm:^8.0.0" + checksum: 10/0b5992308276ac8440a789e5317ff8feaa496cd9a0512c9cd73dbb9b6d2ff81b717cef1aa20113633c7280c9e29319af00a4d53d6bb35adbd1e3c01f0c290152 + languageName: node + linkType: hard + "jest-worker@npm:^29.7.0": version: 29.7.0 resolution: "jest-worker@npm:29.7.0" @@ -8169,6 +9212,25 @@ __metadata: languageName: node linkType: hard +"jest@npm:^28.1.3": + version: 28.1.3 + resolution: "jest@npm:28.1.3" + dependencies: + "@jest/core": "npm:^28.1.3" + "@jest/types": "npm:^28.1.3" + import-local: "npm:^3.0.2" + jest-cli: "npm:^28.1.3" + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + bin: + jest: bin/jest.js + checksum: 10/fb7c93e8a9d4c760a59e2b7638886f9f05465a14a88e263dca448f205464434967897a89784a37f7623999dfc33206d3d61d0acdc83eed99c4474d84a4ed3cf8 + languageName: node + linkType: hard + "jest@npm:^29.5.0": version: 29.7.0 resolution: "jest@npm:29.7.0" @@ -8294,6 +9356,15 @@ __metadata: languageName: node linkType: hard +"jsesc@npm:^3.0.2": + version: 3.0.2 + resolution: "jsesc@npm:3.0.2" + bin: + jsesc: bin/jsesc + checksum: 10/8e5a7de6b70a8bd71f9cb0b5a7ade6a73ae6ab55e697c74cc997cede97417a3a65ed86c36f7dd6125fe49766e8386c845023d9e213916ca92c9dfdd56e2babf3 + languageName: node + linkType: hard + "json-parse-even-better-errors@npm:^2.3.0": version: 2.3.1 resolution: "json-parse-even-better-errors@npm:2.3.1" @@ -8348,7 +9419,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.2.3": +"json5@npm:^2.2.1, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -8467,7 +9538,7 @@ __metadata: languageName: node linkType: hard -"lodash.memoize@npm:^4.1.2": +"lodash.memoize@npm:4.x, lodash.memoize@npm:^4.1.2": version: 4.1.2 resolution: "lodash.memoize@npm:4.1.2" checksum: 10/192b2168f310c86f303580b53acf81ab029761b9bd9caa9506a019ffea5f3363ea98d7e39e7e11e6b9917066c9d36a09a11f6fe16f812326390d8f3a54a1a6da @@ -8597,7 +9668,7 @@ __metadata: languageName: node linkType: hard -"make-error@npm:^1.1.1, make-error@npm:^1.3.6": +"make-error@npm:1.x, make-error@npm:^1.1.1, make-error@npm:^1.3.6": version: 1.3.6 resolution: "make-error@npm:1.3.6" checksum: 10/b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402 @@ -9676,6 +10747,18 @@ __metadata: languageName: node linkType: hard +"pretty-format@npm:^28.1.3": + version: 28.1.3 + resolution: "pretty-format@npm:28.1.3" + dependencies: + "@jest/schemas": "npm:^28.1.3" + ansi-regex: "npm:^5.0.1" + ansi-styles: "npm:^5.0.0" + react-is: "npm:^18.0.0" + checksum: 10/26626d33e201388174a1ce352be46b8087f28184bf3684a88b2f7cf633e28419ffc664628eec261ba13b0f03748c3a6f85db063a2022f75a354c7b9e4e06526b + languageName: node + linkType: hard + "pretty-format@npm:^29.0.0, pretty-format@npm:^29.7.0": version: 29.7.0 resolution: "pretty-format@npm:29.7.0" @@ -10017,6 +11100,13 @@ __metadata: languageName: node linkType: hard +"resolve.exports@npm:^1.1.0": + version: 1.1.1 + resolution: "resolve.exports@npm:1.1.1" + checksum: 10/de58c30aca30883f0e29910e4ad1b7b9986ec5f69434ef2e957ddbe52d3250e138ddd2688e8cd67909b4ee9bf3437424c718a5962d59edd610f035b861ef8441 + languageName: node + linkType: hard + "resolve.exports@npm:^2.0.0": version: 2.0.2 resolution: "resolve.exports@npm:2.0.2" @@ -10081,7 +11171,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -10304,7 +11394,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.6.3, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": +"semver@npm:7.6.3, semver@npm:7.x, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -10931,6 +12021,16 @@ __metadata: languageName: node linkType: hard +"terminal-link@npm:^2.0.0": + version: 2.1.1 + resolution: "terminal-link@npm:2.1.1" + dependencies: + ansi-escapes: "npm:^4.2.1" + supports-hyperlinks: "npm:^2.0.0" + checksum: 10/ce3d2cd3a438c4a9453947aa664581519173ea40e77e2534d08c088ee6dda449eabdbe0a76d2a516b8b73c33262fedd10d5270ccf7576ae316e3db170ce6562f + languageName: node + linkType: hard + "test-exclude@npm:^6.0.0": version: 6.0.0 resolution: "test-exclude@npm:6.0.0" @@ -11060,6 +12160,39 @@ __metadata: languageName: node linkType: hard +"ts-jest@npm:^28.0.8": + version: 28.0.8 + resolution: "ts-jest@npm:28.0.8" + dependencies: + bs-logger: "npm:0.x" + fast-json-stable-stringify: "npm:2.x" + jest-util: "npm:^28.0.0" + json5: "npm:^2.2.1" + lodash.memoize: "npm:4.x" + make-error: "npm:1.x" + semver: "npm:7.x" + yargs-parser: "npm:^21.0.1" + peerDependencies: + "@babel/core": ">=7.0.0-beta.0 <8" + "@jest/types": ^28.0.0 + babel-jest: ^28.0.0 + jest: ^28.0.0 + typescript: ">=4.3" + peerDependenciesMeta: + "@babel/core": + optional: true + "@jest/types": + optional: true + babel-jest: + optional: true + esbuild: + optional: true + bin: + ts-jest: cli.js + checksum: 10/16cfe812ac5ec6557c9dc17e93bb0785c535002e5c13287f5a2bd2440ab57ea03ff696b32a80ba2992ca9fddab1c8649d7ae42670c02a22322805212933b1096 + languageName: node + linkType: hard + "ts-jest@npm:^29.0.5": version: 29.2.5 resolution: "ts-jest@npm:29.2.5" @@ -11293,6 +12426,16 @@ __metadata: languageName: node linkType: hard +"typescript@npm:~4.8.4": + version: 4.8.4 + resolution: "typescript@npm:4.8.4" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10/f985d8dd6ae815753d61cb81e434f3a4a5796ac52e423370fca6ad11bcd188df4013d82e3ba3b88c9746745b9341390ba68f862dc9d30bac6465e0699f2a795b + languageName: node + linkType: hard + "typescript@npm:~5.6.3": version: 5.6.3 resolution: "typescript@npm:5.6.3" @@ -11303,6 +12446,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@npm%3A~4.8.4#optional!builtin": + version: 4.8.4 + resolution: "typescript@patch:typescript@npm%3A4.8.4#optional!builtin::version=4.8.4&hash=1a91c8" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10/5d81fd8cf5152091a0c0b84ebc868de8433583072a340c4899e0fc7ad6a80314b880a1466868c9a6a1f640c3d1f2fe7f41f8c541b99d78c8b414263dfa27eba3 + languageName: node + linkType: hard + "typescript@patch:typescript@npm%3A~5.6.3#optional!builtin": version: 5.6.3 resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin::version=5.6.3&hash=8c6c40" @@ -11567,6 +12720,13 @@ __metadata: languageName: node linkType: hard +"webextension-polyfill@npm:^0.12.0": + version: 0.12.0 + resolution: "webextension-polyfill@npm:0.12.0" + checksum: 10/77e648b958b573ef075e75a0c180e2bbd74dee17b3145e86d21fcbb168c4999e4a311654fe634b8178997bee9b35ea5808d8d3d3e5ff2ad138f197f4f0ea75d9 + languageName: node + linkType: hard + "webidl-conversions@npm:^3.0.0": version: 3.0.1 resolution: "webidl-conversions@npm:3.0.1" @@ -11721,7 +12881,7 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^4.0.2": +"write-file-atomic@npm:^4.0.1, write-file-atomic@npm:^4.0.2": version: 4.0.2 resolution: "write-file-atomic@npm:4.0.2" dependencies: @@ -11836,7 +12996,7 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^21.1.1": +"yargs-parser@npm:^21.0.1, yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1" checksum: 10/9dc2c217ea3bf8d858041252d43e074f7166b53f3d010a8c711275e09cd3d62a002969a39858b92bbda2a6a63a585c7127014534a560b9c69ed2d923d113406e From 97b67b40f1213fcc3eadca0df94efdc37258522c Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 10 Sep 2024 16:48:42 +0200 Subject: [PATCH 05/31] fix(keyring-internal-api): silent some eslint rules --- .eslintrc.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 9f8f213f..8f7bb5e3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -87,6 +87,18 @@ module.exports = { 'jsdoc/newline-after-description': 'off', }, }, + // @metamask/keyring-internal-api + { + files: ['packages/keyring-internal-api/src/**/*.ts'], + extends: ['@metamask/eslint-config-typescript'], + parserOptions, + rules: { + // FIXME: for some reason, it seems eslint is not able to infere those (this + // works on the original repository, so there might be some side-effects now that + // we are building in a monorepo) + '@typescript-eslint/restrict-template-expressions': 'off', + }, + }, // @metamask/keyring-eth-hd { files: ['packages/keyring-eth-hd/**/*.js'], From 6e515a3f1291b010a6e0d1fd7eb57c20909093b2 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 10 Sep 2024 11:46:33 +0200 Subject: [PATCH 06/31] fix(keyring-snap-sdk): silent some eslint rules --- .eslintrc.js | 12 ++++++++ packages/keyring-snap-sdk/package.json | 41 ++++++++++++++++++-------- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 8f7bb5e3..6d31f116 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -191,6 +191,18 @@ module.exports = { '@typescript-eslint/restrict-template-expressions': 'off', }, }, + // @metamask/keyring-snap-sdk + { + files: ['packages/keyring-snap-sdk/src/**/*.test.ts'], + extends: ['@metamask/eslint-config-typescript'], + parserOptions, + rules: { + // FIXME: for some reason, it seems eslint is not able to infere those (this + // works on the original repository, so there might be some side-effects now that + // we are building in a monorepo) + '@typescript-eslint/restrict-template-expressions': 'off', + }, + }, ], rules: { 'jsdoc/match-description': [ diff --git a/packages/keyring-snap-sdk/package.json b/packages/keyring-snap-sdk/package.json index 0e13293b..66a023ca 100644 --- a/packages/keyring-snap-sdk/package.json +++ b/packages/keyring-snap-sdk/package.json @@ -14,6 +14,18 @@ "type": "git", "url": "https://github.com/MetaMask/accounts.git" }, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, "main": "./dist/index.js", "types": "./dist/index.d.ts", "files": [ @@ -35,30 +47,35 @@ "test:watch": "jest --watch" }, "dependencies": { - "@metamask/keyring-internal-api": "^0.0.1", - "@metamask/keyring-utils": "^0.0.1", - "@metamask/snaps-sdk": "^6.1.0", + "@metamask/keyring-internal-api": "workspace:^", + "@metamask/keyring-utils": "workspace:^", + "@metamask/snaps-sdk": "^6.7.0", "@metamask/superstruct": "^3.1.0", - "@metamask/utils": "^9.1.0", - "deepmerge": "^4.2.2" + "@metamask/utils": "^9.2.1", + "deepmerge": "^4.2.2", + "webextension-polyfill": "^0.12.0" }, "devDependencies": { - "@lavamoat/allow-scripts": "^3.0.4", - "@lavamoat/preinstall-always-fail": "^2.0.0", + "@lavamoat/allow-scripts": "^3.2.1", + "@lavamoat/preinstall-always-fail": "^2.1.0", "@metamask/auto-changelog": "^3.4.4", - "@metamask/keyring-api": "^8.1.0", - "@metamask/providers": "^17.1.1", + "@metamask/keyring-api": "workspace:^", + "@metamask/providers": "^18.1.0", + "@ts-bridge/cli": "^0.6.0", "@types/jest": "^29.5.12", "@types/node": "^20.12.12", "depcheck": "^1.4.7", - "jest": "^28.1.3", + "jest": "^29.5.0", "jest-it-up": "^3.1.0", "rimraf": "^5.0.7", - "ts-jest": "^28.0.8", + "ts-jest": "^29.0.5", "ts-node": "^10.9.2", "tsd": "^0.31.0", "typedoc": "^0.25.13", - "typescript": "~4.8.4" + "typescript": "~5.6.3" + }, + "peerDependencies": { + "@metamask/providers": "^18.1.0" }, "engines": { "node": "^18.18 || >=20" From 3dbb7de4af3730de33fbbecd1dc0c6589a221d17 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 10 Sep 2024 11:46:43 +0200 Subject: [PATCH 07/31] fix(keyring-snap-client): silent some eslint rules --- .eslintrc.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 6d31f116..c0316560 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -203,6 +203,20 @@ module.exports = { '@typescript-eslint/restrict-template-expressions': 'off', }, }, + // @metamask/keyring-snap-client + { + files: ['packages/keyring-snap-client/src/**/*.ts'], + extends: ['@metamask/eslint-config-typescript'], + parserOptions, + rules: { + // TODO: re-lint everything once the migration is done + '@typescript-eslint/no-explicit-any': 'off', + // FIXME: for some reason, it seems eslint is not able to infere those (this + // works on the original repository, so there might be some side-effects now that + // we are building in a monorepo) + '@typescript-eslint/restrict-template-expressions': 'off', + }, + }, ], rules: { 'jsdoc/match-description': [ From ca8561d4ed7ab57bc8ed4fa7c7a921fd38ba9c34 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 26 Nov 2024 14:00:06 +0100 Subject: [PATCH 08/31] fix(keyring-internal-api): silent eslint type-constitents rules --- packages/keyring-internal-api/src/internal/types.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/keyring-internal-api/src/internal/types.ts b/packages/keyring-internal-api/src/internal/types.ts index 5dc4f9fe..ba03ecb7 100644 --- a/packages/keyring-internal-api/src/internal/types.ts +++ b/packages/keyring-internal-api/src/internal/types.ts @@ -1,3 +1,8 @@ +/* eslint-disable @typescript-eslint/no-redundant-type-constituents */ +/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */ +// Those rule seem to be triggering a false positive on the `InternalAccountStructs` +// and `InternalAccountTypes`. + import { BtcAccountType, EthAccountType, From 13214bf02a3674e83f86c0941a0536de10231c20 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Mon, 9 Sep 2024 09:01:16 +0200 Subject: [PATCH 09/31] build: use local @metamask/keyring-{utils,interntal-api,snap-sdk,snap-client} --- tsconfig.build.json | 3 +- yarn.lock | 1142 ++----------------------------------------- 2 files changed, 34 insertions(+), 1111 deletions(-) diff --git a/tsconfig.build.json b/tsconfig.build.json index d54c2a10..5646b87e 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -7,7 +7,8 @@ { "path": "./packages/keyring-eth-trezor/tsconfig.build.json" }, { "path": "./packages/keyring-snap-bridge/tsconfig.build.json" }, { "path": "./packages/keyring-snap-sdk/tsconfig.build.json" }, - { "path": "./packages/keyring-snap-client/tsconfig.build.json" } + { "path": "./packages/keyring-snap-client/tsconfig.build.json" }, + { "path": "./packages/keyring-utils/tsconfig.build.json" } ], "files": [], "include": [] diff --git a/yarn.lock b/yarn.lock index f70e6e76..a5a41ebd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,17 +32,6 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.25.9": - version: 7.26.2 - resolution: "@babel/code-frame@npm:7.26.2" - dependencies: - "@babel/helper-validator-identifier": "npm:^7.25.9" - js-tokens: "npm:^4.0.0" - picocolors: "npm:^1.0.0" - checksum: 10/db2c2122af79d31ca916755331bb4bac96feb2b334cdaca5097a6b467fdd41963b89b14b6836a14f083de7ff887fc78fa1b3c10b14e743d33e12dbfe5ee3d223 - languageName: node - linkType: hard - "@babel/compat-data@npm:^7.25.2": version: 7.25.4 resolution: "@babel/compat-data@npm:7.25.4" @@ -85,19 +74,6 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.25.9": - version: 7.26.2 - resolution: "@babel/generator@npm:7.26.2" - dependencies: - "@babel/parser": "npm:^7.26.2" - "@babel/types": "npm:^7.26.0" - "@jridgewell/gen-mapping": "npm:^0.3.5" - "@jridgewell/trace-mapping": "npm:^0.3.25" - jsesc: "npm:^3.0.2" - checksum: 10/71ace82b5b07a554846a003624bfab93275ccf73cdb9f1a37a4c1094bf9dc94bb677c67e8b8c939dbd6c5f0eda2e8f268aa2b0d9c3b9511072565660e717e045 - languageName: node - linkType: hard - "@babel/helper-annotate-as-pure@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-annotate-as-pure@npm:7.24.7" @@ -227,13 +203,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-string-parser@npm:7.25.9" - checksum: 10/c28656c52bd48e8c1d9f3e8e68ecafd09d949c57755b0d353739eb4eae7ba4f7e67e92e4036f1cd43378cc1397a2c943ed7bcaf5949b04ab48607def0258b775 - languageName: node - linkType: hard - "@babel/helper-validator-identifier@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-validator-identifier@npm:7.24.7" @@ -241,13 +210,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-validator-identifier@npm:7.25.9" - checksum: 10/3f9b649be0c2fd457fa1957b694b4e69532a668866b8a0d81eabfa34ba16dbf3107b39e0e7144c55c3c652bf773ec816af8df4a61273a2bb4eb3145ca9cf478e - languageName: node - linkType: hard - "@babel/helper-validator-option@npm:^7.24.7, @babel/helper-validator-option@npm:^7.24.8": version: 7.24.8 resolution: "@babel/helper-validator-option@npm:7.24.8" @@ -288,17 +250,6 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.2": - version: 7.26.2 - resolution: "@babel/parser@npm:7.26.2" - dependencies: - "@babel/types": "npm:^7.26.0" - bin: - parser: ./bin/babel-parser.js - checksum: 10/8baee43752a3678ad9f9e360ec845065eeee806f1fdc8e0f348a8a0e13eef0959dabed4a197c978896c493ea205c804d0a1187cc52e4a1ba017c7935bab4983d - languageName: node - linkType: hard - "@babel/plugin-syntax-async-generators@npm:^7.8.4": version: 7.8.4 resolution: "@babel/plugin-syntax-async-generators@npm:7.8.4" @@ -516,17 +467,6 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/template@npm:7.25.9" - dependencies: - "@babel/code-frame": "npm:^7.25.9" - "@babel/parser": "npm:^7.25.9" - "@babel/types": "npm:^7.25.9" - checksum: 10/e861180881507210150c1335ad94aff80fd9e9be6202e1efa752059c93224e2d5310186ddcdd4c0f0b0fc658ce48cb47823f15142b5c00c8456dde54f5de80b2 - languageName: node - linkType: hard - "@babel/traverse@npm:^7.23.2, @babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.24.8, @babel/traverse@npm:^7.25.0, @babel/traverse@npm:^7.25.2, @babel/traverse@npm:^7.25.4": version: 7.25.4 resolution: "@babel/traverse@npm:7.25.4" @@ -542,21 +482,6 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.7.2": - version: 7.25.9 - resolution: "@babel/traverse@npm:7.25.9" - dependencies: - "@babel/code-frame": "npm:^7.25.9" - "@babel/generator": "npm:^7.25.9" - "@babel/parser": "npm:^7.25.9" - "@babel/template": "npm:^7.25.9" - "@babel/types": "npm:^7.25.9" - debug: "npm:^4.3.1" - globals: "npm:^11.1.0" - checksum: 10/7431614d76d4a053e429208db82f2846a415833f3d9eb2e11ef72eeb3c64dfd71f4a4d983de1a4a047b36165a1f5a64de8ca2a417534cc472005c740ffcb9c6a - languageName: node - linkType: hard - "@babel/types@npm:^7.0.0, @babel/types@npm:^7.23.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.24.8, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.25.4, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3": version: 7.25.4 resolution: "@babel/types@npm:7.25.4" @@ -568,16 +493,6 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0": - version: 7.26.0 - resolution: "@babel/types@npm:7.26.0" - dependencies: - "@babel/helper-string-parser": "npm:^7.25.9" - "@babel/helper-validator-identifier": "npm:^7.25.9" - checksum: 10/40780741ecec886ed9edae234b5eb4976968cc70d72b4e5a40d55f83ff2cc457de20f9b0f4fe9d858350e43dab0ea496e7ef62e2b2f08df699481a76df02cd6e - languageName: node - linkType: hard - "@bcoe/v8-coverage@npm:^0.2.3": version: 0.2.3 resolution: "@bcoe/v8-coverage@npm:0.2.3" @@ -1239,20 +1154,6 @@ __metadata: languageName: node linkType: hard -"@jest/console@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/console@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - jest-message-util: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - slash: "npm:^3.0.0" - checksum: 10/82153eb24e61bd442bff350a7537d598e7c49097aabd9545b340582dcf1f17e5749baa342a67e564816a3a6ce746038b618ed9f66702140264bfa1e1d5cc9e5e - languageName: node - linkType: hard - "@jest/console@npm:^29.7.0": version: 29.7.0 resolution: "@jest/console@npm:29.7.0" @@ -1267,48 +1168,6 @@ __metadata: languageName: node linkType: hard -"@jest/core@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/core@npm:28.1.3" - dependencies: - "@jest/console": "npm:^28.1.3" - "@jest/reporters": "npm:^28.1.3" - "@jest/test-result": "npm:^28.1.3" - "@jest/transform": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - ansi-escapes: "npm:^4.2.1" - chalk: "npm:^4.0.0" - ci-info: "npm:^3.2.0" - exit: "npm:^0.1.2" - graceful-fs: "npm:^4.2.9" - jest-changed-files: "npm:^28.1.3" - jest-config: "npm:^28.1.3" - jest-haste-map: "npm:^28.1.3" - jest-message-util: "npm:^28.1.3" - jest-regex-util: "npm:^28.0.2" - jest-resolve: "npm:^28.1.3" - jest-resolve-dependencies: "npm:^28.1.3" - jest-runner: "npm:^28.1.3" - jest-runtime: "npm:^28.1.3" - jest-snapshot: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - jest-validate: "npm:^28.1.3" - jest-watcher: "npm:^28.1.3" - micromatch: "npm:^4.0.4" - pretty-format: "npm:^28.1.3" - rimraf: "npm:^3.0.0" - slash: "npm:^3.0.0" - strip-ansi: "npm:^6.0.0" - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - checksum: 10/72b56c7591dd1ec325c40e9f60f8111e17d4a09c918b7e5882de58ed1c656d6d34f085dfbdb49f65e6ac95b49919976c7b07821663cbcccd7f3a55c29db542b9 - languageName: node - linkType: hard - "@jest/core@npm:^29.7.0": version: 29.7.0 resolution: "@jest/core@npm:29.7.0" @@ -1350,18 +1209,6 @@ __metadata: languageName: node linkType: hard -"@jest/environment@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/environment@npm:28.1.3" - dependencies: - "@jest/fake-timers": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - jest-mock: "npm:^28.1.3" - checksum: 10/63a8efd099f8d5cd70398c7608d45fc91a5796b14d8f9f8c7fdb3a529e42004e3b60cf0c6e117cc88305d18ab7bb453f803a737e09293e9027a1e76ce835da57 - languageName: node - linkType: hard - "@jest/environment@npm:^29.7.0": version: 29.7.0 resolution: "@jest/environment@npm:29.7.0" @@ -1374,15 +1221,6 @@ __metadata: languageName: node linkType: hard -"@jest/expect-utils@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/expect-utils@npm:28.1.3" - dependencies: - jest-get-type: "npm:^28.0.2" - checksum: 10/f48e4c5b267438a565b6e4c00a06f2bd566dc65d8bb6114d57276ec1fa4f4cded548371e45caffe37c58e5cf3716dbec715c10cfacdae35c4c04b755d83fac96 - languageName: node - linkType: hard - "@jest/expect-utils@npm:^29.7.0": version: 29.7.0 resolution: "@jest/expect-utils@npm:29.7.0" @@ -1392,16 +1230,6 @@ __metadata: languageName: node linkType: hard -"@jest/expect@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/expect@npm:28.1.3" - dependencies: - expect: "npm:^28.1.3" - jest-snapshot: "npm:^28.1.3" - checksum: 10/31ea089e83a4c24f850043a97dfd777a352dd28a936819785f3d0de6e0bd537bfbfa8fd2df081db1adc68a6a55699e7d4ab3990d6a54e41753d86e5d2b66df2f - languageName: node - linkType: hard - "@jest/expect@npm:^29.7.0": version: 29.7.0 resolution: "@jest/expect@npm:29.7.0" @@ -1412,20 +1240,6 @@ __metadata: languageName: node linkType: hard -"@jest/fake-timers@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/fake-timers@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - "@sinonjs/fake-timers": "npm:^9.1.2" - "@types/node": "npm:*" - jest-message-util: "npm:^28.1.3" - jest-mock: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - checksum: 10/4002208f6637adc374175c97e845a19783f58874e9503fb956b801061ba1869a218964cf4631e1ac348e06e1667e982ceb94734db63ccfafdf37508f6b59be17 - languageName: node - linkType: hard - "@jest/fake-timers@npm:^29.7.0": version: 29.7.0 resolution: "@jest/fake-timers@npm:29.7.0" @@ -1440,17 +1254,6 @@ __metadata: languageName: node linkType: hard -"@jest/globals@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/globals@npm:28.1.3" - dependencies: - "@jest/environment": "npm:^28.1.3" - "@jest/expect": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - checksum: 10/3504bb23de629d466c6f2b6b75d2e1c1b10caccbbcfb7eaa82d22cc37711c8e364c243929581184846605c023b475ea6c42c2e3ea5994429a988d8d527af32cd - languageName: node - linkType: hard - "@jest/globals@npm:^29.7.0": version: 29.7.0 resolution: "@jest/globals@npm:29.7.0" @@ -1463,44 +1266,6 @@ __metadata: languageName: node linkType: hard -"@jest/reporters@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/reporters@npm:28.1.3" - dependencies: - "@bcoe/v8-coverage": "npm:^0.2.3" - "@jest/console": "npm:^28.1.3" - "@jest/test-result": "npm:^28.1.3" - "@jest/transform": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@jridgewell/trace-mapping": "npm:^0.3.13" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - collect-v8-coverage: "npm:^1.0.0" - exit: "npm:^0.1.2" - glob: "npm:^7.1.3" - graceful-fs: "npm:^4.2.9" - istanbul-lib-coverage: "npm:^3.0.0" - istanbul-lib-instrument: "npm:^5.1.0" - istanbul-lib-report: "npm:^3.0.0" - istanbul-lib-source-maps: "npm:^4.0.0" - istanbul-reports: "npm:^3.1.3" - jest-message-util: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - jest-worker: "npm:^28.1.3" - slash: "npm:^3.0.0" - string-length: "npm:^4.0.1" - strip-ansi: "npm:^6.0.0" - terminal-link: "npm:^2.0.0" - v8-to-istanbul: "npm:^9.0.1" - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - checksum: 10/bdce58bf1cf1fc0f7fb0c2ae02b5a9a1da32da83ee4697b2b23b8a5b0ac056af55dac07dcf7e869f963943e935da3bd26a788c478b6d52064c77320530d95a89 - languageName: node - linkType: hard - "@jest/reporters@npm:^29.7.0": version: 29.7.0 resolution: "@jest/reporters@npm:29.7.0" @@ -1538,15 +1303,6 @@ __metadata: languageName: node linkType: hard -"@jest/schemas@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/schemas@npm:28.1.3" - dependencies: - "@sinclair/typebox": "npm:^0.24.1" - checksum: 10/3cf1d4b66c9c4ffda58b246de1ddcba8e6ad085af63dccdf07922511f13b68c0cc480a7bc620cb4f3099a6f134801c747e1df7bfc7a4ef4dceefbdea3e31e1de - languageName: node - linkType: hard - "@jest/schemas@npm:^29.6.3": version: 29.6.3 resolution: "@jest/schemas@npm:29.6.3" @@ -1556,17 +1312,6 @@ __metadata: languageName: node linkType: hard -"@jest/source-map@npm:^28.1.2": - version: 28.1.2 - resolution: "@jest/source-map@npm:28.1.2" - dependencies: - "@jridgewell/trace-mapping": "npm:^0.3.13" - callsites: "npm:^3.0.0" - graceful-fs: "npm:^4.2.9" - checksum: 10/b82a5c2e93d35d86779c61a02ccb967d1b5cd2e9dd67d26d8add44958637cbbb99daeeb8129c7653389cb440dc2a2f5ae4d2183dc453c67669ff98938b775a3a - languageName: node - linkType: hard - "@jest/source-map@npm:^29.6.3": version: 29.6.3 resolution: "@jest/source-map@npm:29.6.3" @@ -1578,18 +1323,6 @@ __metadata: languageName: node linkType: hard -"@jest/test-result@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/test-result@npm:28.1.3" - dependencies: - "@jest/console": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/istanbul-lib-coverage": "npm:^2.0.0" - collect-v8-coverage: "npm:^1.0.0" - checksum: 10/d343f08e6e4971e8132540014711c5d29887651b036f03db8c7e9d6509fe9801316f0a6a393cd0af0431c50e6d1c1d310957f06b6cc20c08cab2e67b66a00c88 - languageName: node - linkType: hard - "@jest/test-result@npm:^29.7.0": version: 29.7.0 resolution: "@jest/test-result@npm:29.7.0" @@ -1602,18 +1335,6 @@ __metadata: languageName: node linkType: hard -"@jest/test-sequencer@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/test-sequencer@npm:28.1.3" - dependencies: - "@jest/test-result": "npm:^28.1.3" - graceful-fs: "npm:^4.2.9" - jest-haste-map: "npm:^28.1.3" - slash: "npm:^3.0.0" - checksum: 10/a2f05475c39a8e3e446a0f98c6830aa2492daffe8286db58c95e1870479ed4c2a74e2e51fac1d8b2958858aeb194331145c217d04482fb9312ba1a9e7dded171 - languageName: node - linkType: hard - "@jest/test-sequencer@npm:^29.7.0": version: 29.7.0 resolution: "@jest/test-sequencer@npm:29.7.0" @@ -1626,29 +1347,6 @@ __metadata: languageName: node linkType: hard -"@jest/transform@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/transform@npm:28.1.3" - dependencies: - "@babel/core": "npm:^7.11.6" - "@jest/types": "npm:^28.1.3" - "@jridgewell/trace-mapping": "npm:^0.3.13" - babel-plugin-istanbul: "npm:^6.1.1" - chalk: "npm:^4.0.0" - convert-source-map: "npm:^1.4.0" - fast-json-stable-stringify: "npm:^2.0.0" - graceful-fs: "npm:^4.2.9" - jest-haste-map: "npm:^28.1.3" - jest-regex-util: "npm:^28.0.2" - jest-util: "npm:^28.1.3" - micromatch: "npm:^4.0.4" - pirates: "npm:^4.0.4" - slash: "npm:^3.0.0" - write-file-atomic: "npm:^4.0.1" - checksum: 10/89bc17ca22d5e81eb35e9549beaa5778da0209c12c108552322b72fa7b41a387d119168dea28fd9415f16883fc6dd7a811690654ebb958375e70158b4d0e2965 - languageName: node - linkType: hard - "@jest/transform@npm:^29.7.0": version: 29.7.0 resolution: "@jest/transform@npm:29.7.0" @@ -1685,20 +1383,6 @@ __metadata: languageName: node linkType: hard -"@jest/types@npm:^28.1.3": - version: 28.1.3 - resolution: "@jest/types@npm:28.1.3" - dependencies: - "@jest/schemas": "npm:^28.1.3" - "@types/istanbul-lib-coverage": "npm:^2.0.0" - "@types/istanbul-reports": "npm:^3.0.0" - "@types/node": "npm:*" - "@types/yargs": "npm:^17.0.8" - chalk: "npm:^4.0.0" - checksum: 10/a90e636df760799b6c3d91e34e539e701ea803e80312257e674e345a3c23a7c892df7a301afbc7883ec1d623daf3ba266cde57c5965e0692e5f1e61915d3524b - languageName: node - linkType: hard - "@jest/types@npm:^29.6.3": version: 29.6.3 resolution: "@jest/types@npm:29.6.3" @@ -1755,7 +1439,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.13, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": +"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": version: 0.3.25 resolution: "@jridgewell/trace-mapping@npm:0.3.25" dependencies: @@ -1776,23 +1460,6 @@ __metadata: languageName: node linkType: hard -"@lavamoat/allow-scripts@npm:^3.0.4": - version: 3.3.0 - resolution: "@lavamoat/allow-scripts@npm:3.3.0" - dependencies: - "@lavamoat/aa": "npm:^4.3.0" - "@npmcli/run-script": "npm:8.1.0" - bin-links: "npm:4.0.4" - npm-normalize-package-bin: "npm:3.0.1" - yargs: "npm:17.7.2" - peerDependencies: - "@lavamoat/preinstall-always-fail": "*" - bin: - allow-scripts: src/cli.js - checksum: 10/476043c56425c3077d051a4a6ee4d045fab8b80bf16d50a9201c68224a2ddd77af03490388b7380004d348b11abf4ab7854ba52ba514d10d17c05d40dc8b870d - languageName: node - linkType: hard - "@lavamoat/allow-scripts@npm:^3.2.1": version: 3.2.1 resolution: "@lavamoat/allow-scripts@npm:3.2.1" @@ -1810,7 +1477,7 @@ __metadata: languageName: node linkType: hard -"@lavamoat/preinstall-always-fail@npm:^2.0.0, @lavamoat/preinstall-always-fail@npm:^2.1.0": +"@lavamoat/preinstall-always-fail@npm:^2.1.0": version: 2.1.0 resolution: "@lavamoat/preinstall-always-fail@npm:2.1.0" checksum: 10/385c3fac828b9edff2d8b5825bd29ea475206046984cdb3217518ad655f145ff37046414041534960d92cbe0759f0dc675f7c7dcf39a95003ae715a834fbd750 @@ -2416,17 +2083,6 @@ __metadata: languageName: node linkType: hard -"@metamask/json-rpc-engine@npm:^10.0.1": - version: 10.0.1 - resolution: "@metamask/json-rpc-engine@npm:10.0.1" - dependencies: - "@metamask/rpc-errors": "npm:^7.0.1" - "@metamask/safe-event-emitter": "npm:^3.0.0" - "@metamask/utils": "npm:^10.0.0" - checksum: 10/15a8eeab9af39b9ed87311da728e81169484ace733a8ef9fc469bd887654e37afa19f9e5228246dc80daad3fbf9b16067e73b2969d37d44acf5bc6ffa2c70082 - languageName: node - linkType: hard - "@metamask/json-rpc-engine@npm:^9.0.1, @metamask/json-rpc-engine@npm:^9.0.2": version: 9.0.2 resolution: "@metamask/json-rpc-engine@npm:9.0.2" @@ -2450,18 +2106,6 @@ __metadata: languageName: node linkType: hard -"@metamask/json-rpc-middleware-stream@npm:^8.0.5": - version: 8.0.5 - resolution: "@metamask/json-rpc-middleware-stream@npm:8.0.5" - dependencies: - "@metamask/json-rpc-engine": "npm:^10.0.1" - "@metamask/safe-event-emitter": "npm:^3.0.0" - "@metamask/utils": "npm:^10.0.0" - readable-stream: "npm:^3.6.2" - checksum: 10/486a4c64d445dc7ac7927ac5b9d01818ecef3fbb23d17eadada4748ed6cae9e259741e3c9380829b04a5c141d0972384647aedfde906dc83501b9d7f700ed621 - languageName: node - linkType: hard - "@metamask/key-tree@npm:^10.0.0": version: 10.0.0 resolution: "@metamask/key-tree@npm:10.0.0" @@ -2488,22 +2132,6 @@ __metadata: languageName: node linkType: hard -"@metamask/keyring-api@npm:^8.1.0": - version: 8.1.3 - resolution: "@metamask/keyring-api@npm:8.1.3" - dependencies: - "@metamask/snaps-sdk": "npm:^6.5.1" - "@metamask/superstruct": "npm:^3.1.0" - "@metamask/utils": "npm:^9.2.1" - "@types/uuid": "npm:^9.0.8" - bech32: "npm:^2.0.0" - uuid: "npm:^9.0.1" - peerDependencies: - "@metamask/providers": ^17.2.0 - checksum: 10/9857b6286760d22b1b7102ea8bdf03ebf56c71e9f0adee19a2230def6b7a9230561c1a3bfcb308735b79ab9a5afa9afd07a1617c1d165f63d193cd6a6b6e7a15 - languageName: node - linkType: hard - "@metamask/keyring-api@workspace:^, @metamask/keyring-api@workspace:packages/keyring-api": version: 0.0.0-use.local resolution: "@metamask/keyring-api@workspace:packages/keyring-api" @@ -2533,7 +2161,7 @@ __metadata: languageName: unknown linkType: soft -"@metamask/keyring-internal-api@npm:^0.0.1, @metamask/keyring-internal-api@workspace:^, @metamask/keyring-internal-api@workspace:packages/keyring-internal-api": +"@metamask/keyring-internal-api@workspace:^, @metamask/keyring-internal-api@workspace:packages/keyring-internal-api": version: 0.0.0-use.local resolution: "@metamask/keyring-internal-api@workspace:packages/keyring-internal-api" dependencies: @@ -2603,32 +2231,36 @@ __metadata: version: 0.0.0-use.local resolution: "@metamask/keyring-snap-sdk@workspace:packages/keyring-snap-sdk" dependencies: - "@lavamoat/allow-scripts": "npm:^3.0.4" - "@lavamoat/preinstall-always-fail": "npm:^2.0.0" + "@lavamoat/allow-scripts": "npm:^3.2.1" + "@lavamoat/preinstall-always-fail": "npm:^2.1.0" "@metamask/auto-changelog": "npm:^3.4.4" - "@metamask/keyring-api": "npm:^8.1.0" - "@metamask/keyring-internal-api": "npm:^0.0.1" - "@metamask/keyring-utils": "npm:^0.0.1" - "@metamask/providers": "npm:^17.1.1" - "@metamask/snaps-sdk": "npm:^6.1.0" + "@metamask/keyring-api": "workspace:^" + "@metamask/keyring-internal-api": "workspace:^" + "@metamask/keyring-utils": "workspace:^" + "@metamask/providers": "npm:^18.1.0" + "@metamask/snaps-sdk": "npm:^6.7.0" "@metamask/superstruct": "npm:^3.1.0" - "@metamask/utils": "npm:^9.1.0" + "@metamask/utils": "npm:^9.2.1" + "@ts-bridge/cli": "npm:^0.6.0" "@types/jest": "npm:^29.5.12" "@types/node": "npm:^20.12.12" deepmerge: "npm:^4.2.2" depcheck: "npm:^1.4.7" - jest: "npm:^28.1.3" + jest: "npm:^29.5.0" jest-it-up: "npm:^3.1.0" rimraf: "npm:^5.0.7" - ts-jest: "npm:^28.0.8" + ts-jest: "npm:^29.0.5" ts-node: "npm:^10.9.2" tsd: "npm:^0.31.0" typedoc: "npm:^0.25.13" - typescript: "npm:~4.8.4" + typescript: "npm:~5.6.3" + webextension-polyfill: "npm:^0.12.0" + peerDependencies: + "@metamask/providers": ^18.1.0 languageName: unknown linkType: soft -"@metamask/keyring-utils@npm:^0.0.1, @metamask/keyring-utils@workspace:^, @metamask/keyring-utils@workspace:packages/keyring-utils": +"@metamask/keyring-utils@workspace:^, @metamask/keyring-utils@workspace:packages/keyring-utils": version: 0.0.0-use.local resolution: "@metamask/keyring-utils@workspace:packages/keyring-utils" dependencies: @@ -2720,27 +2352,6 @@ __metadata: languageName: node linkType: hard -"@metamask/providers@npm:^17.1.1": - version: 17.2.1 - resolution: "@metamask/providers@npm:17.2.1" - dependencies: - "@metamask/json-rpc-engine": "npm:^9.0.1" - "@metamask/json-rpc-middleware-stream": "npm:^8.0.1" - "@metamask/object-multiplex": "npm:^2.0.0" - "@metamask/rpc-errors": "npm:^6.3.1" - "@metamask/safe-event-emitter": "npm:^3.1.1" - "@metamask/utils": "npm:^9.0.0" - detect-browser: "npm:^5.2.0" - extension-port-stream: "npm:^4.1.0" - fast-deep-equal: "npm:^3.1.3" - is-stream: "npm:^2.0.0" - readable-stream: "npm:^3.6.2" - peerDependencies: - webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0 - checksum: 10/ff9cbcdd4cfa410c52ae0d9d39ad9285fb21f583bcb36a8a39d1862681fe17483008c15ab0ce87797ea94cad82a2f2e58b29b1db1f02df151f9cf3b05013e8a4 - languageName: node - linkType: hard - "@metamask/providers@npm:^17.1.2": version: 17.2.0 resolution: "@metamask/providers@npm:17.2.0" @@ -2783,27 +2394,6 @@ __metadata: languageName: node linkType: hard -"@metamask/providers@npm:^18.1.1": - version: 18.1.1 - resolution: "@metamask/providers@npm:18.1.1" - dependencies: - "@metamask/json-rpc-engine": "npm:^10.0.1" - "@metamask/json-rpc-middleware-stream": "npm:^8.0.5" - "@metamask/object-multiplex": "npm:^2.0.0" - "@metamask/rpc-errors": "npm:^7.0.1" - "@metamask/safe-event-emitter": "npm:^3.1.1" - "@metamask/utils": "npm:^10.0.0" - detect-browser: "npm:^5.2.0" - extension-port-stream: "npm:^4.1.0" - fast-deep-equal: "npm:^3.1.3" - is-stream: "npm:^2.0.0" - readable-stream: "npm:^3.6.2" - peerDependencies: - webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0 - checksum: 10/dca428d84e490343d85921d4fb09216a0b64be59a036d7b4f7b5ca4e2581c29a4106d58ff9dfe0650dc2b9387dd2adad508fc61073a9fda8ebde8ee3a5137abe - languageName: node - linkType: hard - "@metamask/rpc-errors@npm:^6.3.1": version: 6.3.1 resolution: "@metamask/rpc-errors@npm:6.3.1" @@ -2824,16 +2414,6 @@ __metadata: languageName: node linkType: hard -"@metamask/rpc-errors@npm:^7.0.1": - version: 7.0.1 - resolution: "@metamask/rpc-errors@npm:7.0.1" - dependencies: - "@metamask/utils": "npm:^10.0.0" - fast-safe-stringify: "npm:^2.0.6" - checksum: 10/819708b4a7d9695ee67fd867d8f94bb5a273b479a242b17bd53c83d1fceec421fc42928f0bb340f4f138ec803dd82ec9659ce7b09a86aedad6a81d5a39ec5c35 - languageName: node - linkType: hard - "@metamask/safe-event-emitter@npm:^3.0.0, @metamask/safe-event-emitter@npm:^3.1.1": version: 3.1.1 resolution: "@metamask/safe-event-emitter@npm:3.1.1" @@ -2923,19 +2503,6 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-sdk@npm:^6.1.0, @metamask/snaps-sdk@npm:^6.5.1": - version: 6.12.0 - resolution: "@metamask/snaps-sdk@npm:6.12.0" - dependencies: - "@metamask/key-tree": "npm:^9.1.2" - "@metamask/providers": "npm:^18.1.1" - "@metamask/rpc-errors": "npm:^7.0.1" - "@metamask/superstruct": "npm:^3.1.0" - "@metamask/utils": "npm:^10.0.0" - checksum: 10/b0e24fee2c90ac2f456aeb5babc180c74f56b8cf94f38abdd9b022c65a9cac4a10015e3d4053784292c184238f97704cb2b6a41f6e7a04f23ffaa8d519d2a39e - languageName: node - linkType: hard - "@metamask/snaps-sdk@npm:^6.7.0": version: 6.7.0 resolution: "@metamask/snaps-sdk@npm:6.7.0" @@ -2987,7 +2554,7 @@ __metadata: languageName: node linkType: hard -"@metamask/utils@npm:^10.0.0, @metamask/utils@npm:^10.0.1": +"@metamask/utils@npm:^10.0.1": version: 10.0.1 resolution: "@metamask/utils@npm:10.0.1" dependencies: @@ -3306,13 +2873,6 @@ __metadata: languageName: node linkType: hard -"@sinclair/typebox@npm:^0.24.1": - version: 0.24.51 - resolution: "@sinclair/typebox@npm:0.24.51" - checksum: 10/7886847b9deda1d926934066fe69165a1d9bbe7b0f836543c25efb96173c17009ef7a98619f48b379294bf27958844da3428eb35e65f8d941ea43563ad6e961e - languageName: node - linkType: hard - "@sinclair/typebox@npm:^0.27.8": version: 0.27.8 resolution: "@sinclair/typebox@npm:0.27.8" @@ -3334,15 +2894,6 @@ __metadata: languageName: node linkType: hard -"@sinonjs/commons@npm:^1.7.0": - version: 1.8.6 - resolution: "@sinonjs/commons@npm:1.8.6" - dependencies: - type-detect: "npm:4.0.8" - checksum: 10/51987338fd8b4d1e135822ad593dd23a3288764aa41d83c695124d512bc38b87eece859078008651ecc7f1df89a7e558a515dc6f02d21a93be4ba50b39a28914 - languageName: node - linkType: hard - "@sinonjs/commons@npm:^3.0.0, @sinonjs/commons@npm:^3.0.1": version: 3.0.1 resolution: "@sinonjs/commons@npm:3.0.1" @@ -3370,15 +2921,6 @@ __metadata: languageName: node linkType: hard -"@sinonjs/fake-timers@npm:^9.1.2": - version: 9.1.2 - resolution: "@sinonjs/fake-timers@npm:9.1.2" - dependencies: - "@sinonjs/commons": "npm:^1.7.0" - checksum: 10/033c74ad389b0655b6af2fa1af31dddf45878e65879f06c5d1940e0ceb053a234f2f46c728dcd97df8ee9312431e45dd7aedaee3a69d47f73a2001a7547fc3d6 - languageName: node - linkType: hard - "@sinonjs/samsam@npm:^8.0.1": version: 8.0.2 resolution: "@sinonjs/samsam@npm:8.0.2" @@ -4017,13 +3559,6 @@ __metadata: languageName: node linkType: hard -"@types/prettier@npm:^2.1.5": - version: 2.7.3 - resolution: "@types/prettier@npm:2.7.3" - checksum: 10/cda84c19acc3bf327545b1ce71114a7d08efbd67b5030b9e8277b347fa57b05178045f70debe1d363ff7efdae62f237260713aafc2d7217e06fc99b048a88497 - languageName: node - linkType: hard - "@types/punycode@npm:^2.1.0": version: 2.1.4 resolution: "@types/punycode@npm:2.1.4" @@ -4832,23 +4367,6 @@ __metadata: languageName: node linkType: hard -"babel-jest@npm:^28.1.3": - version: 28.1.3 - resolution: "babel-jest@npm:28.1.3" - dependencies: - "@jest/transform": "npm:^28.1.3" - "@types/babel__core": "npm:^7.1.14" - babel-plugin-istanbul: "npm:^6.1.1" - babel-preset-jest: "npm:^28.1.3" - chalk: "npm:^4.0.0" - graceful-fs: "npm:^4.2.9" - slash: "npm:^3.0.0" - peerDependencies: - "@babel/core": ^7.8.0 - checksum: 10/6dcbf194a037fb3df18d2aee56a3919a98a9b34292d1eb4aad823ebfa8b67f5a55f897213c1aafd52183928e99770319b8a094681ccb2910dc9993e6a7c1fd61 - languageName: node - linkType: hard - "babel-jest@npm:^29.7.0": version: 29.7.0 resolution: "babel-jest@npm:29.7.0" @@ -4879,18 +4397,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-jest-hoist@npm:^28.1.3": - version: 28.1.3 - resolution: "babel-plugin-jest-hoist@npm:28.1.3" - dependencies: - "@babel/template": "npm:^7.3.3" - "@babel/types": "npm:^7.3.3" - "@types/babel__core": "npm:^7.1.14" - "@types/babel__traverse": "npm:^7.0.6" - checksum: 10/355e383dae2b50efa0aff73a751f6bc55e7ae19ddfe72c73f4a0ad7667a671175aba17d824833d98b33602da18dd04e5e5d37d03c4f245940d8664c45ad29df5 - languageName: node - linkType: hard - "babel-plugin-jest-hoist@npm:^29.6.3": version: 29.6.3 resolution: "babel-plugin-jest-hoist@npm:29.6.3" @@ -4925,18 +4431,6 @@ __metadata: languageName: node linkType: hard -"babel-preset-jest@npm:^28.1.3": - version: 28.1.3 - resolution: "babel-preset-jest@npm:28.1.3" - dependencies: - babel-plugin-jest-hoist: "npm:^28.1.3" - babel-preset-current-node-syntax: "npm:^1.0.0" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10/8248a4a5ca4242cc06ad13b10b9183ad2664da8fb0da060c352223dcf286f0ce9c708fa17901dc44ecabec25e6d309e5e5b9830a61dd777c3925f187a345a47d - languageName: node - linkType: hard - "babel-preset-jest@npm:^29.6.3": version: 29.6.3 resolution: "babel-preset-jest@npm:29.6.3" @@ -5196,7 +4690,7 @@ __metadata: languageName: node linkType: hard -"bs-logger@npm:0.x, bs-logger@npm:^0.2.6": +"bs-logger@npm:^0.2.6": version: 0.2.6 resolution: "bs-logger@npm:0.2.6" dependencies: @@ -5669,13 +5163,6 @@ __metadata: languageName: node linkType: hard -"convert-source-map@npm:^1.4.0": - version: 1.9.0 - resolution: "convert-source-map@npm:1.9.0" - checksum: 10/dc55a1f28ddd0e9485ef13565f8f756b342f9a46c4ae18b843fe3c30c675d058d6a4823eff86d472f187b176f0adf51ea7b69ea38be34be4a63cbbf91b0593c8 - languageName: node - linkType: hard - "convert-source-map@npm:^1.6.0": version: 1.7.0 resolution: "convert-source-map@npm:1.7.0" @@ -5897,13 +5384,6 @@ __metadata: languageName: node linkType: hard -"dedent@npm:^0.7.0": - version: 0.7.0 - resolution: "dedent@npm:0.7.0" - checksum: 10/87de191050d9a40dd70cad01159a0bcf05ecb59750951242070b6abf9569088684880d00ba92a955b4058804f16eeaf91d604f283929b4f614d181cd7ae633d2 - languageName: node - linkType: hard - "dedent@npm:^1.0.0": version: 1.5.3 resolution: "dedent@npm:1.5.3" @@ -6055,13 +5535,6 @@ __metadata: languageName: node linkType: hard -"diff-sequences@npm:^28.1.1": - version: 28.1.1 - resolution: "diff-sequences@npm:28.1.1" - checksum: 10/89752708215cf0d13ec98cb3cded36154951beec9ac8c23d5a665498ba880e1e3aad544ad046ad5223c141fc35b362665fae534e14a253654da77b514a28438d - languageName: node - linkType: hard - "diff-sequences@npm:^29.6.3": version: 29.6.3 resolution: "diff-sequences@npm:29.6.3" @@ -6188,13 +5661,6 @@ __metadata: languageName: node linkType: hard -"emittery@npm:^0.10.2": - version: 0.10.2 - resolution: "emittery@npm:0.10.2" - checksum: 10/fa86fc2b1f4c792d7d479a4de1a6a1f74b0b597770bae770336f0be6501e64be0995aa07d284ae502b269f5cec960cd0c44c91dd090d06d8deecee6d9787e396 - languageName: node - linkType: hard - "emittery@npm:^0.13.1": version: 0.13.1 resolution: "emittery@npm:0.13.1" @@ -6982,19 +6448,6 @@ __metadata: languageName: node linkType: hard -"expect@npm:^28.1.3": - version: 28.1.3 - resolution: "expect@npm:28.1.3" - dependencies: - "@jest/expect-utils": "npm:^28.1.3" - jest-get-type: "npm:^28.0.2" - jest-matcher-utils: "npm:^28.1.3" - jest-message-util: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - checksum: 10/87033c88f7a578063ae7de98000fbd423bdb751756b1c6a1c69cd2b093bdb8b11a5b7a66eb89984068850d14978c7daffc2cc8ed56eb912424c24885a7573061 - languageName: node - linkType: hard - "expect@npm:^29.0.0, expect@npm:^29.7.0": version: 29.7.0 resolution: "expect@npm:29.7.0" @@ -8219,19 +7672,6 @@ __metadata: languageName: node linkType: hard -"istanbul-lib-instrument@npm:^5.1.0": - version: 5.2.1 - resolution: "istanbul-lib-instrument@npm:5.2.1" - dependencies: - "@babel/core": "npm:^7.12.3" - "@babel/parser": "npm:^7.14.7" - "@istanbuljs/schema": "npm:^0.1.2" - istanbul-lib-coverage: "npm:^3.2.0" - semver: "npm:^6.3.0" - checksum: 10/bbc4496c2f304d799f8ec22202ab38c010ac265c441947f075c0f7d46bd440b45c00e46017cf9053453d42182d768b1d6ed0e70a142c95ab00df9843aa5ab80e - languageName: node - linkType: hard - "istanbul-lib-instrument@npm:^6.0.0": version: 6.0.3 resolution: "istanbul-lib-instrument@npm:6.0.3" @@ -8326,51 +7766,14 @@ __metadata: languageName: node linkType: hard -"jest-changed-files@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-changed-files@npm:28.1.3" - dependencies: - execa: "npm:^5.0.0" - p-limit: "npm:^3.1.0" - checksum: 10/206be715fed00c70d69f46f6274129816b2959dd9fe5d77b7c929d572eef8f55092baea48f51cf45848edd17e23b00aa720201b5e7781904e6ede06ba666e668 - languageName: node - linkType: hard - "jest-changed-files@npm:^29.7.0": version: 29.7.0 resolution: "jest-changed-files@npm:29.7.0" - dependencies: - execa: "npm:^5.0.0" - jest-util: "npm:^29.7.0" - p-limit: "npm:^3.1.0" - checksum: 10/3d93742e56b1a73a145d55b66e96711fbf87ef89b96c2fab7cfdfba8ec06612591a982111ca2b712bb853dbc16831ec8b43585a2a96b83862d6767de59cbf83d - languageName: node - linkType: hard - -"jest-circus@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-circus@npm:28.1.3" - dependencies: - "@jest/environment": "npm:^28.1.3" - "@jest/expect": "npm:^28.1.3" - "@jest/test-result": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - co: "npm:^4.6.0" - dedent: "npm:^0.7.0" - is-generator-fn: "npm:^2.0.0" - jest-each: "npm:^28.1.3" - jest-matcher-utils: "npm:^28.1.3" - jest-message-util: "npm:^28.1.3" - jest-runtime: "npm:^28.1.3" - jest-snapshot: "npm:^28.1.3" - jest-util: "npm:^28.1.3" + dependencies: + execa: "npm:^5.0.0" + jest-util: "npm:^29.7.0" p-limit: "npm:^3.1.0" - pretty-format: "npm:^28.1.3" - slash: "npm:^3.0.0" - stack-utils: "npm:^2.0.3" - checksum: 10/3ac1f369cadbdd1982c123c04bc69f140b9790a8d0a729084f53aa13154bbdf318ba162dc70daecc37ef1d620afa339408d6b99a0314306238c547dc6a25b4a3 + checksum: 10/3d93742e56b1a73a145d55b66e96711fbf87ef89b96c2fab7cfdfba8ec06612591a982111ca2b712bb853dbc16831ec8b43585a2a96b83862d6767de59cbf83d languageName: node linkType: hard @@ -8402,33 +7805,6 @@ __metadata: languageName: node linkType: hard -"jest-cli@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-cli@npm:28.1.3" - dependencies: - "@jest/core": "npm:^28.1.3" - "@jest/test-result": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - chalk: "npm:^4.0.0" - exit: "npm:^0.1.2" - graceful-fs: "npm:^4.2.9" - import-local: "npm:^3.0.2" - jest-config: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - jest-validate: "npm:^28.1.3" - prompts: "npm:^2.0.1" - yargs: "npm:^17.3.1" - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - bin: - jest: bin/jest.js - checksum: 10/935a0c517e7b972e60543fdb921302fc63d78e629ab077195c91336279c0815978ca2e03c65ec6dbff3226a5c4ee64b13c7ef5a86387330c9da54454cd4bbbfb - languageName: node - linkType: hard - "jest-cli@npm:^29.7.0": version: 29.7.0 resolution: "jest-cli@npm:29.7.0" @@ -8455,44 +7831,6 @@ __metadata: languageName: node linkType: hard -"jest-config@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-config@npm:28.1.3" - dependencies: - "@babel/core": "npm:^7.11.6" - "@jest/test-sequencer": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - babel-jest: "npm:^28.1.3" - chalk: "npm:^4.0.0" - ci-info: "npm:^3.2.0" - deepmerge: "npm:^4.2.2" - glob: "npm:^7.1.3" - graceful-fs: "npm:^4.2.9" - jest-circus: "npm:^28.1.3" - jest-environment-node: "npm:^28.1.3" - jest-get-type: "npm:^28.0.2" - jest-regex-util: "npm:^28.0.2" - jest-resolve: "npm:^28.1.3" - jest-runner: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - jest-validate: "npm:^28.1.3" - micromatch: "npm:^4.0.4" - parse-json: "npm:^5.2.0" - pretty-format: "npm:^28.1.3" - slash: "npm:^3.0.0" - strip-json-comments: "npm:^3.1.1" - peerDependencies: - "@types/node": "*" - ts-node: ">=9.0.0" - peerDependenciesMeta: - "@types/node": - optional: true - ts-node: - optional: true - checksum: 10/457d8709e24e0e4d8a8a8e074a65092e896d80f30d80c0448f8ce6a24bd0b30060a1a593a20aa7fb8c3c2228d519f0a979ccdff3a176efb60afc7187785d59cf - languageName: node - linkType: hard - "jest-config@npm:^29.7.0": version: 29.7.0 resolution: "jest-config@npm:29.7.0" @@ -8531,18 +7869,6 @@ __metadata: languageName: node linkType: hard -"jest-diff@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-diff@npm:28.1.3" - dependencies: - chalk: "npm:^4.0.0" - diff-sequences: "npm:^28.1.1" - jest-get-type: "npm:^28.0.2" - pretty-format: "npm:^28.1.3" - checksum: 10/42b8d82c59df879b2cfdf3583fecd40c31ce8c9364644d8d430f5bd533a32e475ca0b383b7a744293332008c50f7901bedeac73c60463ac9e7e2b80249e1325c - languageName: node - linkType: hard - "jest-diff@npm:^29.0.3, jest-diff@npm:^29.7.0": version: 29.7.0 resolution: "jest-diff@npm:29.7.0" @@ -8555,15 +7881,6 @@ __metadata: languageName: node linkType: hard -"jest-docblock@npm:^28.1.1": - version: 28.1.1 - resolution: "jest-docblock@npm:28.1.1" - dependencies: - detect-newline: "npm:^3.0.0" - checksum: 10/4062cb9ba54c88c88f5452fcd054937f35755240014ea277ff8dbfde30efcbdb77a4844a09279e55ec98f2fe9a1978a9b8583315e93fdf03602a619ae070356b - languageName: node - linkType: hard - "jest-docblock@npm:^29.7.0": version: 29.7.0 resolution: "jest-docblock@npm:29.7.0" @@ -8573,19 +7890,6 @@ __metadata: languageName: node linkType: hard -"jest-each@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-each@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - chalk: "npm:^4.0.0" - jest-get-type: "npm:^28.0.2" - jest-util: "npm:^28.1.3" - pretty-format: "npm:^28.1.3" - checksum: 10/4877cdda70048923ad6aabf25779e3e2c6bc580253d95739b8af291fbc506b95b043031b498f26807093abe9e6e93ecd7b50e3ce5b7ab175fc21637a197a248b - languageName: node - linkType: hard - "jest-each@npm:^29.7.0": version: 29.7.0 resolution: "jest-each@npm:29.7.0" @@ -8620,20 +7924,6 @@ __metadata: languageName: node linkType: hard -"jest-environment-node@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-environment-node@npm:28.1.3" - dependencies: - "@jest/environment": "npm:^28.1.3" - "@jest/fake-timers": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - jest-mock: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - checksum: 10/ab9ec5c57309a0ca40ebc58ba84b4980445f24d351cc3292c8c8715062c7ea14442d9d8e7701eccb9cb810f425bbdb7eba631fd76fb1835b92150b6bdda7cb18 - languageName: node - linkType: hard - "jest-environment-node@npm:^29.7.0": version: 29.7.0 resolution: "jest-environment-node@npm:29.7.0" @@ -8648,13 +7938,6 @@ __metadata: languageName: node linkType: hard -"jest-get-type@npm:^28.0.2": - version: 28.0.2 - resolution: "jest-get-type@npm:28.0.2" - checksum: 10/5281d7c89bc8156605f6d15784f45074f4548501195c26e9b188742768f72d40948252d13230ea905b5349038865a1a8eeff0e614cc530ff289dfc41fe843abd - languageName: node - linkType: hard - "jest-get-type@npm:^29.6.3": version: 29.6.3 resolution: "jest-get-type@npm:29.6.3" @@ -8662,29 +7945,6 @@ __metadata: languageName: node linkType: hard -"jest-haste-map@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-haste-map@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - "@types/graceful-fs": "npm:^4.1.3" - "@types/node": "npm:*" - anymatch: "npm:^3.0.3" - fb-watchman: "npm:^2.0.0" - fsevents: "npm:^2.3.2" - graceful-fs: "npm:^4.2.9" - jest-regex-util: "npm:^28.0.2" - jest-util: "npm:^28.1.3" - jest-worker: "npm:^28.1.3" - micromatch: "npm:^4.0.4" - walker: "npm:^1.0.8" - dependenciesMeta: - fsevents: - optional: true - checksum: 10/c78e0e81e3f138f379440fb2ddfdc3753da377b74477df02ef404d5de1508d6545d28cf02516713dbde093a8c112098be6f50080a7a8fab6b888992720322a57 - languageName: node - linkType: hard - "jest-haste-map@npm:^29.7.0": version: 29.7.0 resolution: "jest-haste-map@npm:29.7.0" @@ -8721,16 +7981,6 @@ __metadata: languageName: node linkType: hard -"jest-leak-detector@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-leak-detector@npm:28.1.3" - dependencies: - jest-get-type: "npm:^28.0.2" - pretty-format: "npm:^28.1.3" - checksum: 10/2e976a4880cf9af11f53a19f6a3820e0f90b635a900737a5427fc42e337d5628ba446dcd7c020ecea3806cf92bc0bbf6982ed62a9cd84e5a13d8751aa30fbbb7 - languageName: node - linkType: hard - "jest-leak-detector@npm:^29.7.0": version: 29.7.0 resolution: "jest-leak-detector@npm:29.7.0" @@ -8741,18 +7991,6 @@ __metadata: languageName: node linkType: hard -"jest-matcher-utils@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-matcher-utils@npm:28.1.3" - dependencies: - chalk: "npm:^4.0.0" - jest-diff: "npm:^28.1.3" - jest-get-type: "npm:^28.0.2" - pretty-format: "npm:^28.1.3" - checksum: 10/958f4bacdaee6949f1d1da413129f2249083bc6fa3f4ac5c559795b370aec7159f99f02340f706cc895b90938c2bafe1aab347c9a34f8819c59afd1a4cd6c009 - languageName: node - linkType: hard - "jest-matcher-utils@npm:^29.7.0": version: 29.7.0 resolution: "jest-matcher-utils@npm:29.7.0" @@ -8765,23 +8003,6 @@ __metadata: languageName: node linkType: hard -"jest-message-util@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-message-util@npm:28.1.3" - dependencies: - "@babel/code-frame": "npm:^7.12.13" - "@jest/types": "npm:^28.1.3" - "@types/stack-utils": "npm:^2.0.0" - chalk: "npm:^4.0.0" - graceful-fs: "npm:^4.2.9" - micromatch: "npm:^4.0.4" - pretty-format: "npm:^28.1.3" - slash: "npm:^3.0.0" - stack-utils: "npm:^2.0.3" - checksum: 10/91137a507e9eb79ef6156a3d17c882a181fa662da28cc1a86245ff53ba13726653c8d5fed2660e922aae020a9caca4d22c3689bfe61a215c8a17a43e01b7eb5c - languageName: node - linkType: hard - "jest-message-util@npm:^29.7.0": version: 29.7.0 resolution: "jest-message-util@npm:29.7.0" @@ -8799,16 +8020,6 @@ __metadata: languageName: node linkType: hard -"jest-mock@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-mock@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - checksum: 10/43cbec0ceddea795b8b2bc09f8632eecc97b88ef018a9c9737b887ed6cbdbda000a436e9165dce2bccfbb949be8b0daca6faa530dc390d43a0e5e3099f3ae216 - languageName: node - linkType: hard - "jest-mock@npm:^29.7.0": version: 29.7.0 resolution: "jest-mock@npm:29.7.0" @@ -8832,13 +8043,6 @@ __metadata: languageName: node linkType: hard -"jest-regex-util@npm:^28.0.2": - version: 28.0.2 - resolution: "jest-regex-util@npm:28.0.2" - checksum: 10/0ea8c5c82ec88bc85e273c0ec82e0c0f35f7a1e2d055070e50f0cc2a2177f848eec55f73e37ae0d045c3db5014c42b2f90ac62c1ab3fdb354d2abd66a9e08add - languageName: node - linkType: hard - "jest-regex-util@npm:^29.6.3": version: 29.6.3 resolution: "jest-regex-util@npm:29.6.3" @@ -8846,16 +8050,6 @@ __metadata: languageName: node linkType: hard -"jest-resolve-dependencies@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-resolve-dependencies@npm:28.1.3" - dependencies: - jest-regex-util: "npm:^28.0.2" - jest-snapshot: "npm:^28.1.3" - checksum: 10/5c3128ea5f702a22141116b6a3d83c594c192d3e17b7235a1d47ecd64bcd9aa4924100668804e6b54faf5a1437a366f37165a2ea7170a2ce35899323b4ed7aac - languageName: node - linkType: hard - "jest-resolve-dependencies@npm:^29.7.0": version: 29.7.0 resolution: "jest-resolve-dependencies@npm:29.7.0" @@ -8866,23 +8060,6 @@ __metadata: languageName: node linkType: hard -"jest-resolve@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-resolve@npm:28.1.3" - dependencies: - chalk: "npm:^4.0.0" - graceful-fs: "npm:^4.2.9" - jest-haste-map: "npm:^28.1.3" - jest-pnp-resolver: "npm:^1.2.2" - jest-util: "npm:^28.1.3" - jest-validate: "npm:^28.1.3" - resolve: "npm:^1.20.0" - resolve.exports: "npm:^1.1.0" - slash: "npm:^3.0.0" - checksum: 10/742b2301a43172206bf88d405df73d19510cfd4eacb0fb16d620157de408e9f7399567a57c86c61b30aaa303c15d88a77b38a69ad0230d288e44db4d44d5f724 - languageName: node - linkType: hard - "jest-resolve@npm:^29.7.0": version: 29.7.0 resolution: "jest-resolve@npm:29.7.0" @@ -8900,35 +8077,6 @@ __metadata: languageName: node linkType: hard -"jest-runner@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-runner@npm:28.1.3" - dependencies: - "@jest/console": "npm:^28.1.3" - "@jest/environment": "npm:^28.1.3" - "@jest/test-result": "npm:^28.1.3" - "@jest/transform": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - emittery: "npm:^0.10.2" - graceful-fs: "npm:^4.2.9" - jest-docblock: "npm:^28.1.1" - jest-environment-node: "npm:^28.1.3" - jest-haste-map: "npm:^28.1.3" - jest-leak-detector: "npm:^28.1.3" - jest-message-util: "npm:^28.1.3" - jest-resolve: "npm:^28.1.3" - jest-runtime: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - jest-watcher: "npm:^28.1.3" - jest-worker: "npm:^28.1.3" - p-limit: "npm:^3.1.0" - source-map-support: "npm:0.5.13" - checksum: 10/0fb6ed4f628650da9ff502b89bfdf98ea7f3015ad0369429c223ddae793573d9c5f350e95756e8bb827e2e6e3de03e5cb94569075c5788e574697b63c09d80ae - languageName: node - linkType: hard - "jest-runner@npm:^29.7.0": version: 29.7.0 resolution: "jest-runner@npm:29.7.0" @@ -8958,36 +8106,6 @@ __metadata: languageName: node linkType: hard -"jest-runtime@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-runtime@npm:28.1.3" - dependencies: - "@jest/environment": "npm:^28.1.3" - "@jest/fake-timers": "npm:^28.1.3" - "@jest/globals": "npm:^28.1.3" - "@jest/source-map": "npm:^28.1.2" - "@jest/test-result": "npm:^28.1.3" - "@jest/transform": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - chalk: "npm:^4.0.0" - cjs-module-lexer: "npm:^1.0.0" - collect-v8-coverage: "npm:^1.0.0" - execa: "npm:^5.0.0" - glob: "npm:^7.1.3" - graceful-fs: "npm:^4.2.9" - jest-haste-map: "npm:^28.1.3" - jest-message-util: "npm:^28.1.3" - jest-mock: "npm:^28.1.3" - jest-regex-util: "npm:^28.0.2" - jest-resolve: "npm:^28.1.3" - jest-snapshot: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - slash: "npm:^3.0.0" - strip-bom: "npm:^4.0.0" - checksum: 10/d3d91b3f1082bbe3f87dc11ad7abce12f323797d98b3fa5ef7fb5efbd6d30e42041e3732cb8be5d41f0c8d8312d14461381d829ed1fe4e3712cfc82ea4a586fc - languageName: node - linkType: hard - "jest-runtime@npm:^29.7.0": version: 29.7.0 resolution: "jest-runtime@npm:29.7.0" @@ -9028,37 +8146,6 @@ __metadata: languageName: node linkType: hard -"jest-snapshot@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-snapshot@npm:28.1.3" - dependencies: - "@babel/core": "npm:^7.11.6" - "@babel/generator": "npm:^7.7.2" - "@babel/plugin-syntax-typescript": "npm:^7.7.2" - "@babel/traverse": "npm:^7.7.2" - "@babel/types": "npm:^7.3.3" - "@jest/expect-utils": "npm:^28.1.3" - "@jest/transform": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/babel__traverse": "npm:^7.0.6" - "@types/prettier": "npm:^2.1.5" - babel-preset-current-node-syntax: "npm:^1.0.0" - chalk: "npm:^4.0.0" - expect: "npm:^28.1.3" - graceful-fs: "npm:^4.2.9" - jest-diff: "npm:^28.1.3" - jest-get-type: "npm:^28.0.2" - jest-haste-map: "npm:^28.1.3" - jest-matcher-utils: "npm:^28.1.3" - jest-message-util: "npm:^28.1.3" - jest-util: "npm:^28.1.3" - natural-compare: "npm:^1.4.0" - pretty-format: "npm:^28.1.3" - semver: "npm:^7.3.5" - checksum: 10/4e1f4e2aa5ccc776f1fdaab75f96342534f737df0d43458e0614af362f7e80097909f69e5d8f2d0aed2caae07fa122b1cf7b8da0c97c44c3b2d06da472d7ad79 - languageName: node - linkType: hard - "jest-snapshot@npm:^29.7.0": version: 29.7.0 resolution: "jest-snapshot@npm:29.7.0" @@ -9101,20 +8188,6 @@ __metadata: languageName: node linkType: hard -"jest-util@npm:^28.0.0, jest-util@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-util@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - ci-info: "npm:^3.2.0" - graceful-fs: "npm:^4.2.9" - picomatch: "npm:^2.2.3" - checksum: 10/92895523d30ddde8f22bebbc20ed6e1be35b0a21c8e9df8a1fc289bf354f6a3f96e5d271340f2ed212a5aa0b55fd7717ff3167da8c5f247d623e2a93a3bf7b32 - languageName: node - linkType: hard - "jest-util@npm:^29.0.0, jest-util@npm:^29.7.0": version: 29.7.0 resolution: "jest-util@npm:29.7.0" @@ -9129,20 +8202,6 @@ __metadata: languageName: node linkType: hard -"jest-validate@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-validate@npm:28.1.3" - dependencies: - "@jest/types": "npm:^28.1.3" - camelcase: "npm:^6.2.0" - chalk: "npm:^4.0.0" - jest-get-type: "npm:^28.0.2" - leven: "npm:^3.1.0" - pretty-format: "npm:^28.1.3" - checksum: 10/c49c8c64b4afbfb5c7434cfd30f8adbe7c6f57ce3ad6be55cfd65403f9ae664822badc1f27844ae800b23c84653bea834e928ad79e18ea0afdc4aa2d0a121156 - languageName: node - linkType: hard - "jest-validate@npm:^29.7.0": version: 29.7.0 resolution: "jest-validate@npm:29.7.0" @@ -9157,22 +8216,6 @@ __metadata: languageName: node linkType: hard -"jest-watcher@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-watcher@npm:28.1.3" - dependencies: - "@jest/test-result": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - "@types/node": "npm:*" - ansi-escapes: "npm:^4.2.1" - chalk: "npm:^4.0.0" - emittery: "npm:^0.10.2" - jest-util: "npm:^28.1.3" - string-length: "npm:^4.0.1" - checksum: 10/e6d2c099d461408a992d144c230112fb282b2d8f54c49227bdb0c3efcfa5ecab70a019fc57d8ad6360000459087bb942c4f72670b52fc5b97ac0d9834f87d24e - languageName: node - linkType: hard - "jest-watcher@npm:^29.7.0": version: 29.7.0 resolution: "jest-watcher@npm:29.7.0" @@ -9189,17 +8232,6 @@ __metadata: languageName: node linkType: hard -"jest-worker@npm:^28.1.3": - version: 28.1.3 - resolution: "jest-worker@npm:28.1.3" - dependencies: - "@types/node": "npm:*" - merge-stream: "npm:^2.0.0" - supports-color: "npm:^8.0.0" - checksum: 10/0b5992308276ac8440a789e5317ff8feaa496cd9a0512c9cd73dbb9b6d2ff81b717cef1aa20113633c7280c9e29319af00a4d53d6bb35adbd1e3c01f0c290152 - languageName: node - linkType: hard - "jest-worker@npm:^29.7.0": version: 29.7.0 resolution: "jest-worker@npm:29.7.0" @@ -9212,25 +8244,6 @@ __metadata: languageName: node linkType: hard -"jest@npm:^28.1.3": - version: 28.1.3 - resolution: "jest@npm:28.1.3" - dependencies: - "@jest/core": "npm:^28.1.3" - "@jest/types": "npm:^28.1.3" - import-local: "npm:^3.0.2" - jest-cli: "npm:^28.1.3" - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - bin: - jest: bin/jest.js - checksum: 10/fb7c93e8a9d4c760a59e2b7638886f9f05465a14a88e263dca448f205464434967897a89784a37f7623999dfc33206d3d61d0acdc83eed99c4474d84a4ed3cf8 - languageName: node - linkType: hard - "jest@npm:^29.5.0": version: 29.7.0 resolution: "jest@npm:29.7.0" @@ -9356,15 +8369,6 @@ __metadata: languageName: node linkType: hard -"jsesc@npm:^3.0.2": - version: 3.0.2 - resolution: "jsesc@npm:3.0.2" - bin: - jsesc: bin/jsesc - checksum: 10/8e5a7de6b70a8bd71f9cb0b5a7ade6a73ae6ab55e697c74cc997cede97417a3a65ed86c36f7dd6125fe49766e8386c845023d9e213916ca92c9dfdd56e2babf3 - languageName: node - linkType: hard - "json-parse-even-better-errors@npm:^2.3.0": version: 2.3.1 resolution: "json-parse-even-better-errors@npm:2.3.1" @@ -9419,7 +8423,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.2.1, json5@npm:^2.2.3": +"json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -9538,7 +8542,7 @@ __metadata: languageName: node linkType: hard -"lodash.memoize@npm:4.x, lodash.memoize@npm:^4.1.2": +"lodash.memoize@npm:^4.1.2": version: 4.1.2 resolution: "lodash.memoize@npm:4.1.2" checksum: 10/192b2168f310c86f303580b53acf81ab029761b9bd9caa9506a019ffea5f3363ea98d7e39e7e11e6b9917066c9d36a09a11f6fe16f812326390d8f3a54a1a6da @@ -9668,7 +8672,7 @@ __metadata: languageName: node linkType: hard -"make-error@npm:1.x, make-error@npm:^1.1.1, make-error@npm:^1.3.6": +"make-error@npm:^1.1.1, make-error@npm:^1.3.6": version: 1.3.6 resolution: "make-error@npm:1.3.6" checksum: 10/b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402 @@ -10747,18 +9751,6 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^28.1.3": - version: 28.1.3 - resolution: "pretty-format@npm:28.1.3" - dependencies: - "@jest/schemas": "npm:^28.1.3" - ansi-regex: "npm:^5.0.1" - ansi-styles: "npm:^5.0.0" - react-is: "npm:^18.0.0" - checksum: 10/26626d33e201388174a1ce352be46b8087f28184bf3684a88b2f7cf633e28419ffc664628eec261ba13b0f03748c3a6f85db063a2022f75a354c7b9e4e06526b - languageName: node - linkType: hard - "pretty-format@npm:^29.0.0, pretty-format@npm:^29.7.0": version: 29.7.0 resolution: "pretty-format@npm:29.7.0" @@ -11100,13 +10092,6 @@ __metadata: languageName: node linkType: hard -"resolve.exports@npm:^1.1.0": - version: 1.1.1 - resolution: "resolve.exports@npm:1.1.1" - checksum: 10/de58c30aca30883f0e29910e4ad1b7b9986ec5f69434ef2e957ddbe52d3250e138ddd2688e8cd67909b4ee9bf3437424c718a5962d59edd610f035b861ef8441 - languageName: node - linkType: hard - "resolve.exports@npm:^2.0.0": version: 2.0.2 resolution: "resolve.exports@npm:2.0.2" @@ -11171,7 +10156,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -11394,7 +10379,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.6.3, semver@npm:7.x, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": +"semver@npm:7.6.3, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -12021,16 +11006,6 @@ __metadata: languageName: node linkType: hard -"terminal-link@npm:^2.0.0": - version: 2.1.1 - resolution: "terminal-link@npm:2.1.1" - dependencies: - ansi-escapes: "npm:^4.2.1" - supports-hyperlinks: "npm:^2.0.0" - checksum: 10/ce3d2cd3a438c4a9453947aa664581519173ea40e77e2534d08c088ee6dda449eabdbe0a76d2a516b8b73c33262fedd10d5270ccf7576ae316e3db170ce6562f - languageName: node - linkType: hard - "test-exclude@npm:^6.0.0": version: 6.0.0 resolution: "test-exclude@npm:6.0.0" @@ -12160,39 +11135,6 @@ __metadata: languageName: node linkType: hard -"ts-jest@npm:^28.0.8": - version: 28.0.8 - resolution: "ts-jest@npm:28.0.8" - dependencies: - bs-logger: "npm:0.x" - fast-json-stable-stringify: "npm:2.x" - jest-util: "npm:^28.0.0" - json5: "npm:^2.2.1" - lodash.memoize: "npm:4.x" - make-error: "npm:1.x" - semver: "npm:7.x" - yargs-parser: "npm:^21.0.1" - peerDependencies: - "@babel/core": ">=7.0.0-beta.0 <8" - "@jest/types": ^28.0.0 - babel-jest: ^28.0.0 - jest: ^28.0.0 - typescript: ">=4.3" - peerDependenciesMeta: - "@babel/core": - optional: true - "@jest/types": - optional: true - babel-jest: - optional: true - esbuild: - optional: true - bin: - ts-jest: cli.js - checksum: 10/16cfe812ac5ec6557c9dc17e93bb0785c535002e5c13287f5a2bd2440ab57ea03ff696b32a80ba2992ca9fddab1c8649d7ae42670c02a22322805212933b1096 - languageName: node - linkType: hard - "ts-jest@npm:^29.0.5": version: 29.2.5 resolution: "ts-jest@npm:29.2.5" @@ -12426,16 +11368,6 @@ __metadata: languageName: node linkType: hard -"typescript@npm:~4.8.4": - version: 4.8.4 - resolution: "typescript@npm:4.8.4" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10/f985d8dd6ae815753d61cb81e434f3a4a5796ac52e423370fca6ad11bcd188df4013d82e3ba3b88c9746745b9341390ba68f862dc9d30bac6465e0699f2a795b - languageName: node - linkType: hard - "typescript@npm:~5.6.3": version: 5.6.3 resolution: "typescript@npm:5.6.3" @@ -12446,16 +11378,6 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A~4.8.4#optional!builtin": - version: 4.8.4 - resolution: "typescript@patch:typescript@npm%3A4.8.4#optional!builtin::version=4.8.4&hash=1a91c8" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10/5d81fd8cf5152091a0c0b84ebc868de8433583072a340c4899e0fc7ad6a80314b880a1466868c9a6a1f640c3d1f2fe7f41f8c541b99d78c8b414263dfa27eba3 - languageName: node - linkType: hard - "typescript@patch:typescript@npm%3A~5.6.3#optional!builtin": version: 5.6.3 resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin::version=5.6.3&hash=8c6c40" @@ -12881,7 +11803,7 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^4.0.1, write-file-atomic@npm:^4.0.2": +"write-file-atomic@npm:^4.0.2": version: 4.0.2 resolution: "write-file-atomic@npm:4.0.2" dependencies: @@ -12996,7 +11918,7 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^21.0.1, yargs-parser@npm:^21.1.1": +"yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1" checksum: 10/9dc2c217ea3bf8d858041252d43e074f7166b53f3d010a8c711275e09cd3d62a002969a39858b92bbda2a6a63a585c7127014534a560b9c69ed2d923d113406e From 2265d9e29329ed531b72aa96eff0ef9548621d43 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Fri, 6 Sep 2024 18:14:12 +0200 Subject: [PATCH 10/31] chore: update README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 2a7d36fb..6a7a4067 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,10 @@ This repository contains the following packages [^fn1]: - [`@metamask/eth-snap-keyring`](packages/keyring-snap) - [`@metamask/eth-trezor-keyring`](packages/keyring-eth-trezor) - [`@metamask/keyring-api`](packages/keyring-api) +- [`@metamask/keyring-internal-api`](packages/keyring-internal-api) +- [`@metamask/keyring-snap-client`](packages/keyring-snap-client) +- [`@metamask/keyring-snap-sdk`](packages/keyring-snap-sdk) +- [`@metamask/keyring-utils`](packages/keyring-utils) @@ -34,8 +38,19 @@ linkStyle default opacity:0.5 eth_ledger_bridge_keyring(["@metamask/eth-ledger-bridge-keyring"]); eth_simple_keyring(["@metamask/eth-simple-keyring"]); eth_trezor_keyring(["@metamask/eth-trezor-keyring"]); + keyring_internal_api(["@metamask/keyring-internal-api"]); eth_snap_keyring(["@metamask/eth-snap-keyring"]); + keyring_snap_client(["@metamask/keyring-snap-client"]); + keyring_snap_sdk(["@metamask/keyring-snap-sdk"]); + keyring_utils(["@metamask/keyring-utils"]); + keyring_api --> keyring_utils; + keyring_internal_api --> keyring_api; eth_snap_keyring --> keyring_api; + eth_snap_keyring --> keyring_snap_client; + eth_snap_keyring --> keyring_snap_sdk; + keyring_snap_client --> keyring_api; + keyring_snap_client --> keyring_snap_sdk; + keyring_snap_sdk --> keyring_api; ``` From 908ea840a7d5160f7d1fdefefea8f47399020777 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 26 Nov 2024 13:56:19 +0100 Subject: [PATCH 11/31] chore(syncpack): use workspace:^ for new packages --- .syncpackrc | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.syncpackrc b/.syncpackrc index 5be04059..ab7d67c1 100644 --- a/.syncpackrc +++ b/.syncpackrc @@ -26,6 +26,30 @@ "dependencyTypes": ["!local"], "dependencies": ["@metamask/keyring-api"], "pinVersion": "workspace:^" - } + }, + { + "label": "use workspace version of the keyring-internal-api", + "dependencyTypes": ["!local"], + "dependencies": ["@metamask/keyring-internal-api"], + "pinVersion": "workspace:^" + }, + { + "label": "use workspace version of the keyring-snap-sdk", + "dependencyTypes": ["!local"], + "dependencies": ["@metamask/keyring-snap-sdk"], + "pinVersion": "workspace:^" + }, + { + "label": "use workspace version of the keyring-snap-client", + "dependencyTypes": ["!local"], + "dependencies": ["@metamask/keyring-snap-client"], + "pinVersion": "workspace:^" + }, + { + "label": "use workspace version of the keyring-utils", + "dependencyTypes": ["!local"], + "dependencies": ["@metamask/keyring-utils"], + "pinVersion": "workspace:^" + }, ] } From 8d4d99861cfb3ad5b2483d94176a37a24796c1b6 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 26 Nov 2024 17:54:09 +0100 Subject: [PATCH 12/31] build: build new packages with ts-bridge --- packages/keyring-internal-api/package.json | 5 ++--- packages/keyring-snap-client/package.json | 5 ++--- packages/keyring-snap-sdk/package.json | 5 ++--- packages/keyring-utils/package.json | 5 ++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/packages/keyring-internal-api/package.json b/packages/keyring-internal-api/package.json index 11f4b51e..9a3dbd0d 100644 --- a/packages/keyring-internal-api/package.json +++ b/packages/keyring-internal-api/package.json @@ -32,10 +32,9 @@ "dist/" ], "scripts": { - "build": "tsc --build tsconfig.build.json", - "build:clean": "rimraf dist && yarn build", + "build": "ts-bridge --project tsconfig.build.json --no-references", + "build:clean": "yarn build --clean", "build:docs": "typedoc", - "build:force": "tsc --build tsconfig.build.json --force", "changelog:update": "../../scripts/update-changelog.sh @metamask/keyring-internal-api", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/keyring-internal-api", "publish:preview": "yarn npm publish --tag preview", diff --git a/packages/keyring-snap-client/package.json b/packages/keyring-snap-client/package.json index 21ff7d87..500353a1 100644 --- a/packages/keyring-snap-client/package.json +++ b/packages/keyring-snap-client/package.json @@ -32,10 +32,9 @@ "dist/" ], "scripts": { - "build": "tsc --build tsconfig.build.json", - "build:clean": "rimraf dist && yarn build", + "build": "ts-bridge --project tsconfig.build.json --no-references", + "build:clean": "yarn build --clean", "build:docs": "typedoc", - "build:force": "tsc --build tsconfig.build.json --force", "changelog:update": "../../scripts/update-changelog.sh @metamask/keyring-snap-client", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/keyring-snap-client", "publish:preview": "yarn npm publish --tag preview", diff --git a/packages/keyring-snap-sdk/package.json b/packages/keyring-snap-sdk/package.json index 66a023ca..c348284f 100644 --- a/packages/keyring-snap-sdk/package.json +++ b/packages/keyring-snap-sdk/package.json @@ -32,10 +32,9 @@ "dist/" ], "scripts": { - "build": "tsc --build tsconfig.build.json", - "build:clean": "rimraf dist && yarn build", + "build": "ts-bridge --project tsconfig.build.json --no-references", + "build:clean": "yarn build --clean", "build:docs": "typedoc", - "build:force": "tsc --build tsconfig.build.json --force", "changelog:update": "../../scripts/update-changelog.sh @metamask/keyring-snap-sdk", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/keyring-snap-sdk", "publish:preview": "yarn npm publish --tag preview", diff --git a/packages/keyring-utils/package.json b/packages/keyring-utils/package.json index bbaf745f..70e3458a 100644 --- a/packages/keyring-utils/package.json +++ b/packages/keyring-utils/package.json @@ -32,10 +32,9 @@ "dist/" ], "scripts": { - "build": "tsc --build tsconfig.build.json", - "build:clean": "rimraf dist && yarn build", + "build": "ts-bridge --project tsconfig.build.json --no-references", + "build:clean": "yarn build --clean", "build:docs": "typedoc", - "build:force": "tsc --build tsconfig.build.json --force", "changelog:update": "../../scripts/update-changelog.sh @metamask/keyring-utils", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/keyring-utils", "publish:preview": "yarn npm publish --tag preview", From 247c3e73e31d27f826a0664af7b1026b81d78eef Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 26 Nov 2024 17:55:05 +0100 Subject: [PATCH 13/31] test(keyring-utils): fix coverage --- .../src/eth/types.test.ts | 30 ------------- .../keyring-utils/src/superstruct.test.ts | 23 +++++++++- packages/keyring-utils/src/types.test.ts | 45 ++++++++++++++++++- 3 files changed, 65 insertions(+), 33 deletions(-) delete mode 100644 packages/keyring-internal-api/src/eth/types.test.ts diff --git a/packages/keyring-internal-api/src/eth/types.test.ts b/packages/keyring-internal-api/src/eth/types.test.ts deleted file mode 100644 index 8624052a..00000000 --- a/packages/keyring-internal-api/src/eth/types.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { UrlStruct } from '@metamask/keyring-utils'; - -describe('types', () => { - it('is a valid BundlerUrl', () => { - const url = 'https://api.example.com'; - expect(() => UrlStruct.assert(url)).not.toThrow(); - }); - - it('is a valid BundlerUrl with query parameters', () => { - const url = 'https://api.example.com?foo=bar'; - expect(() => UrlStruct.assert(url)).not.toThrow(); - }); - - it('accepts path parameters', () => { - const url = 'https://api.example.com/foo/bar'; - expect(() => UrlStruct.assert(url)).not.toThrow(); - }); - - it('fails if it does not start with http or https', () => { - const url = 'ftp://api.example.com'; - expect(() => UrlStruct.assert(url)).toThrow( - 'Expected a value of type `Url`, but received: `"ftp://api.example.com"`', - ); - }); - - it('has to start with http or https', () => { - const url = 'http://api.example.com'; - expect(() => UrlStruct.assert(url)).not.toThrow(); - }); -}); diff --git a/packages/keyring-utils/src/superstruct.test.ts b/packages/keyring-utils/src/superstruct.test.ts index 1eb944a5..2b35ed95 100644 --- a/packages/keyring-utils/src/superstruct.test.ts +++ b/packages/keyring-utils/src/superstruct.test.ts @@ -1,6 +1,6 @@ import { is, literal, max, number, string, union } from '@metamask/superstruct'; -import { exactOptional, object } from '.'; +import { exactOptional, object, strictMask } from '.'; describe('@metamask/superstruct', () => { describe('exactOptional', () => { @@ -69,4 +69,25 @@ describe('@metamask/superstruct', () => { expect(is({ foo: 1 }, struct)).toBe(false); }); }); + + describe('strictMask', () => { + const struct = object({ + foo: string(), + bar: number(), + }); + + it('is valid', + () => { + expect(() => strictMask({ foo: 'foo', bar: 1 }, struct)).not.toThrow(); + }, + ); + + it('fails if the object is not strictly matching', + () => { + expect(() => strictMask({ foo: 'foo', bar: 1, zzz: [] }, struct)).toThrow(); + expect(() => strictMask({ foo: 'foo' }, struct)).toThrow(); + expect(() => strictMask({ bar: 1 }, struct)).toThrow(); + }, + ); + }); }); diff --git a/packages/keyring-utils/src/types.test.ts b/packages/keyring-utils/src/types.test.ts index 7cf685ce..29e70c95 100644 --- a/packages/keyring-utils/src/types.test.ts +++ b/packages/keyring-utils/src/types.test.ts @@ -1,6 +1,47 @@ -import { is } from '@metamask/superstruct'; +import { is, assert } from '@metamask/superstruct'; -import { StringNumberStruct } from './types'; +import { StringNumberStruct, UrlStruct } from './types'; + +describe('types', () => { + it('is a valid URL', () => { + const url = 'https://api.example.com'; + expect(() => assert(url, UrlStruct)).not.toThrow(); + }); + + it('is a valid URL', () => { + const url = 'https://api.example.com'; + expect(() => assert(url, UrlStruct)).not.toThrow(); + }); + + it('is a valid URL with query parameters', () => { + const url = 'https://api.example.com?foo=bar'; + expect(() => assert(url, UrlStruct)).not.toThrow(); + }); + + it('accepts path parameters', () => { + const url = 'https://api.example.com/foo/bar'; + expect(() => assert(url, UrlStruct)).not.toThrow(); + }); + + it('fails if it does not start with http or https', () => { + const url = 'ftp://api.example.com'; + expect(() => assert(url, UrlStruct)).toThrow( + 'Expected a value of type `Url`, but received: `"ftp://api.example.com"`', + ); + }); + + it('fails if the URL is not valid', () => { + const url = 'api.example.com'; // No protocol. + expect(() => assert(url, UrlStruct)).toThrow( + 'Expected a value of type `Url`, but received: `"api.example.com"`', + ); + }); + + it('has to start with http or https', () => { + const url = 'http://api.example.com'; + expect(() => assert(url, UrlStruct)).not.toThrow(); + }); +}); describe('StringNumber', () => { it.each(['0', '0.0', '0.1', '0.19', '00.19', '0.000000000000000000000'])( From 955a0d630947b73929f58d1f64738de5f09e2807 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 27 Nov 2024 14:16:15 +0100 Subject: [PATCH 14/31] test(keyring-api): fix coverage --- packages/keyring-api/src/api/balance.test.ts | 32 ++++++ packages/keyring-api/src/api/export.test.ts | 29 +++++ packages/keyring-api/src/api/request.test.ts | 105 ++++++++++++++++++ packages/keyring-api/src/api/response.test.ts | 73 ++++++++++++ 4 files changed, 239 insertions(+) create mode 100644 packages/keyring-api/src/api/balance.test.ts create mode 100644 packages/keyring-api/src/api/export.test.ts create mode 100644 packages/keyring-api/src/api/request.test.ts create mode 100644 packages/keyring-api/src/api/response.test.ts diff --git a/packages/keyring-api/src/api/balance.test.ts b/packages/keyring-api/src/api/balance.test.ts new file mode 100644 index 00000000..8aba82a3 --- /dev/null +++ b/packages/keyring-api/src/api/balance.test.ts @@ -0,0 +1,32 @@ +import { is } from '@metamask/superstruct'; + +import { BalanceStruct } from './balance'; + +describe('BalanceStruct', () => { + it.each([ + // Valid + { balance: { amount: '1.0', unit: 'ETH' }, expected: true }, + { balance: { amount: '0.1', unit: 'BTC' }, expected: true }, + // FIXME: Those are not valid for `StringNumberStruct`, but they should be: + // { balance: { amount: '.1', unit: 'gwei' }, expected: true }, + // { balance: { amount: '.1', unit: 'wei' }, expected: true }, + // { balance: { amount: '1.', unit: 'sat' }, expected: true }, + // Missing amount + { balance: { unit: 'ETH' }, expected: false }, + // Missing unit + { balance: { amount: '1.0' }, expected: false }, + // Invalid amount type + { balance: { amount: 1, unit: 'ETH' }, expected: false }, + { balance: { amount: true, unit: 'ETH' }, expected: false }, + { balance: { amount: null, unit: 'ETH' }, expected: false }, + // Invalid unit type + { balance: { amount: '1.0', unit: 1 }, expected: false }, + { balance: { amount: '1.0', unit: true }, expected: false }, + { balance: { amount: '1.0', unit: null }, expected: false }, + ])( + 'returns $expected for is($balance, BalanceStruct)', + ({ balance, expected }) => { + expect(is(balance, BalanceStruct)).toBe(expected); + }, + ); +}); diff --git a/packages/keyring-api/src/api/export.test.ts b/packages/keyring-api/src/api/export.test.ts new file mode 100644 index 00000000..7a0dea4a --- /dev/null +++ b/packages/keyring-api/src/api/export.test.ts @@ -0,0 +1,29 @@ +import { is } from '@metamask/superstruct'; + +import { KeyringAccountDataStruct } from './export'; + +describe('KeyringAccountDataStruct', () => { + const sym = Symbol(); + it.each([ + // Valid + { data: { foo: 'bar' }, expected: true }, + { data: { foo: 'bar', bar: 1 }, expected: true }, + // Undefined is not allowed in JSON + { data: { foo: undefined, bar: null }, expected: false }, + // Invalid + { data: 0, expected: false }, + { + data: '34a0b893b66e312a8b0f7dc4bc4c7930b67f8823513aff5444fb5c64aa060c5a', + expected: false, + }, + { data: sym, expected: false }, + // FIXME: Not sure why this one works, maybe the array is + // mapped as: { 0: 0xdead, 1: 0xbeef, 2: '!' }? + { data: [0xdead, 0xbeef, '!'], expected: true }, + ])( + 'returns $expected for is($data, KeyringAccountDataStruct)', + ({ data, expected }) => { + expect(is(data, KeyringAccountDataStruct)).toBe(expected); + }, + ); +}); diff --git a/packages/keyring-api/src/api/request.test.ts b/packages/keyring-api/src/api/request.test.ts new file mode 100644 index 00000000..53fe0db2 --- /dev/null +++ b/packages/keyring-api/src/api/request.test.ts @@ -0,0 +1,105 @@ +import { is } from '@metamask/superstruct'; + +import { KeyringRequestStruct } from './request'; + +describe('KeyringRequest', () => { + it.each([ + // Valid + { + request: { + id: '47d782ac-15c8-4c81-8bfe-759ae1be4a3e', + scope: 'eip155:1', + account: 'd6311e3c-a4ec-43fa-b341-592ffefd9797', + request: { + method: 'eth_personalSign', + params: { + data: '0x00...', + }, + }, + }, + expected: true, + }, + { + request: { + id: '47d782ac-15c8-4c81-8bfe-759ae1be4a3e', + scope: 'eip155:1', + account: 'd6311e3c-a4ec-43fa-b341-592ffefd9797', + request: { + method: 'eth_somethingElseWithNoParameters', + }, + }, + expected: true, + }, + // Invalid: + // Missing id + { + request: { + scope: 'eip155:1', + account: 'd6311e3c-a4ec-43fa-b341-592ffefd9797', + request: { + method: 'eth_personalSign', + params: { + data: '0x00...', + }, + }, + }, + expected: false, + }, + // Missing scope + { + request: { + id: '47d782ac-15c8-4c81-8bfe-759ae1be4a3e', + account: 'd6311e3c-a4ec-43fa-b341-592ffefd9797', + request: { + method: 'eth_personalSign', + params: { + data: '0x00...', + }, + }, + }, + expected: false, + }, + // Missing account + { + request: { + id: '47d782ac-15c8-4c81-8bfe-759ae1be4a3e', + scope: 'eip155:1', + request: { + method: 'eth_personalSign', + params: { + data: '0x00...', + }, + }, + }, + expected: false, + }, + // Missing request + { + request: { + id: '47d782ac-15c8-4c81-8bfe-759ae1be4a3e', + scope: 'eip155:1', + account: 'd6311e3c-a4ec-43fa-b341-592ffefd9797', + }, + expected: false, + }, + // Missing request.method + { + request: { + id: '47d782ac-15c8-4c81-8bfe-759ae1be4a3e', + scope: 'eip155:1', + account: 'd6311e3c-a4ec-43fa-b341-592ffefd9797', + request: { + params: { + data: '0x00...', + }, + }, + }, + expected: false, + }, + ])( + 'returns $expected for is($data, KeyringRequestStruct)', + ({ request, expected }) => { + expect(is(request, KeyringRequestStruct)).toBe(expected); + }, + ); +}); diff --git a/packages/keyring-api/src/api/response.test.ts b/packages/keyring-api/src/api/response.test.ts new file mode 100644 index 00000000..861edff2 --- /dev/null +++ b/packages/keyring-api/src/api/response.test.ts @@ -0,0 +1,73 @@ +import { is } from '@metamask/superstruct'; + +import { KeyringResponseStruct } from './response'; + +describe('KeyringResponseStruct', () => { + it.each([ + // Valid + { + response: { + pending: false, + result: {}, + }, + expected: true, + }, + { + response: { + pending: true, + redirect: { + message: 'success', + url: 'http://dapp.example.com/continue', + }, + }, + expected: true, + }, + { + response: { + pending: true, + redirect: { + url: 'http://dapp.example.com/continue', + }, + }, + expected: true, + }, + { + response: { + pending: true, + redirect: { + message: 'success', + }, + }, + expected: true, + }, + { + response: { + pending: true, + }, + expected: true, + }, + // Invalid + { + response: { + pending: true, + result: {}, + }, + expected: false, + }, + { + response: { + pending: false, + redirect: { + message: 'success', + url: 'http://dapp.example.com/continue', + }, + }, + expected: false, + }, + ])( + 'returns $expected for is($data, KeyringResponseStruct)', + ({ response, expected }) => { + expect(is(response, KeyringResponseStruct)).toBe(expected); + }, + ); +}); From bc68ebc4bc2bfdf5078410abc52e4e59dcbd4da2 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 27 Nov 2024 14:16:48 +0100 Subject: [PATCH 15/31] chore: f fix coverage keyring-utils --- .../keyring-utils/src/superstruct.test.ts | 22 +++++++++---------- packages/keyring-utils/src/types.test.ts | 21 +++++++++++++----- packages/keyring-utils/src/types.ts | 2 +- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/packages/keyring-utils/src/superstruct.test.ts b/packages/keyring-utils/src/superstruct.test.ts index 2b35ed95..af7c5911 100644 --- a/packages/keyring-utils/src/superstruct.test.ts +++ b/packages/keyring-utils/src/superstruct.test.ts @@ -76,18 +76,16 @@ describe('@metamask/superstruct', () => { bar: number(), }); - it('is valid', - () => { - expect(() => strictMask({ foo: 'foo', bar: 1 }, struct)).not.toThrow(); - }, - ); + it('is valid', () => { + expect(() => strictMask({ foo: 'foo', bar: 1 }, struct)).not.toThrow(); + }); - it('fails if the object is not strictly matching', - () => { - expect(() => strictMask({ foo: 'foo', bar: 1, zzz: [] }, struct)).toThrow(); - expect(() => strictMask({ foo: 'foo' }, struct)).toThrow(); - expect(() => strictMask({ bar: 1 }, struct)).toThrow(); - }, - ); + it('fails if the object is not strictly matching', () => { + expect(() => + strictMask({ foo: 'foo', bar: 1, zzz: [] }, struct), + ).toThrow(); + expect(() => strictMask({ foo: 'foo' }, struct)).toThrow(); + expect(() => strictMask({ bar: 1 }, struct)).toThrow(); + }); }); }); diff --git a/packages/keyring-utils/src/types.test.ts b/packages/keyring-utils/src/types.test.ts index 29e70c95..d7561061 100644 --- a/packages/keyring-utils/src/types.test.ts +++ b/packages/keyring-utils/src/types.test.ts @@ -1,13 +1,24 @@ import { is, assert } from '@metamask/superstruct'; -import { StringNumberStruct, UrlStruct } from './types'; +import { StringNumberStruct, UrlStruct, UuidStruct } from './types'; -describe('types', () => { - it('is a valid URL', () => { - const url = 'https://api.example.com'; - expect(() => assert(url, UrlStruct)).not.toThrow(); +describe('UuidStruct', () => { + it('is a valid UUID', () => { + const uuid = '47d782ac-15c8-4c81-8bfe-759ae1be4a3e'; + expect(() => assert(uuid, UuidStruct)).not.toThrow(); }); + it.each([ + '', + 'invalid-uuid', + '47d782ac_15c8_4c81_8bfe_759ae1be4a3e', + '47d782ac15c84c818bfe759ae1be4a3e', + ])('fails if the UUID is a valid', (uuid) => { + expect(() => assert(uuid, UuidStruct)).toThrow(); + }); +}); + +describe('UrlStruct', () => { it('is a valid URL', () => { const url = 'https://api.example.com'; expect(() => assert(url, UrlStruct)).not.toThrow(); diff --git a/packages/keyring-utils/src/types.ts b/packages/keyring-utils/src/types.ts index 56ce5690..bed5d122 100644 --- a/packages/keyring-utils/src/types.ts +++ b/packages/keyring-utils/src/types.ts @@ -30,6 +30,6 @@ export const UrlStruct = define('Url', (value: unknown) => { */ export const StringNumberStruct = definePattern( 'StringNumber', - /^\d+(\.\d+)?$/u, + /^\d*(\.\d+)?$/u, ); export type StringNumber = Infer; From eb9204bb43cafd32c8c921a9e68f324ee5f68c3d Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 27 Nov 2024 14:17:08 +0100 Subject: [PATCH 16/31] test(keyring-internal-api): fix coverage --- packages/keyring-internal-api/jest.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/keyring-internal-api/jest.config.js b/packages/keyring-internal-api/jest.config.js index 2ce3d30d..d6e04ca7 100644 --- a/packages/keyring-internal-api/jest.config.js +++ b/packages/keyring-internal-api/jest.config.js @@ -20,9 +20,9 @@ module.exports = merge(baseConfig, { coverageThreshold: { global: { branches: 100, - functions: 87.5, - lines: 94.69, - statements: 94.69 + functions: 100, + lines: 100, + statements: 100, }, }, }); From a233021b34c22df2ddc2c0314b2d74b69d1d049d Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 27 Nov 2024 14:25:35 +0100 Subject: [PATCH 17/31] refactor(keyring-api): flatten folders --- packages/keyring-api/src/{api => }/account.test.ts | 0 packages/keyring-api/src/{api => }/account.ts | 0 packages/keyring-api/src/api/index.ts | 7 ------- packages/keyring-api/src/{api => }/balance.test-d.ts | 0 packages/keyring-api/src/{api => }/balance.test.ts | 0 packages/keyring-api/src/{api => }/balance.ts | 0 packages/keyring-api/src/{api => }/caip.test.ts | 0 packages/keyring-api/src/{api => }/caip.ts | 0 packages/keyring-api/src/{api => }/export.test.ts | 0 packages/keyring-api/src/{api => }/export.ts | 0 packages/keyring-api/src/index.ts | 8 +++++++- packages/keyring-api/src/{api => }/keyring.ts | 0 packages/keyring-api/src/{api => }/request.test.ts | 0 packages/keyring-api/src/{api => }/request.ts | 0 packages/keyring-api/src/{api => }/response.test.ts | 0 packages/keyring-api/src/{api => }/response.ts | 0 16 files changed, 7 insertions(+), 8 deletions(-) rename packages/keyring-api/src/{api => }/account.test.ts (100%) rename packages/keyring-api/src/{api => }/account.ts (100%) delete mode 100644 packages/keyring-api/src/api/index.ts rename packages/keyring-api/src/{api => }/balance.test-d.ts (100%) rename packages/keyring-api/src/{api => }/balance.test.ts (100%) rename packages/keyring-api/src/{api => }/balance.ts (100%) rename packages/keyring-api/src/{api => }/caip.test.ts (100%) rename packages/keyring-api/src/{api => }/caip.ts (100%) rename packages/keyring-api/src/{api => }/export.test.ts (100%) rename packages/keyring-api/src/{api => }/export.ts (100%) rename packages/keyring-api/src/{api => }/keyring.ts (100%) rename packages/keyring-api/src/{api => }/request.test.ts (100%) rename packages/keyring-api/src/{api => }/request.ts (100%) rename packages/keyring-api/src/{api => }/response.test.ts (100%) rename packages/keyring-api/src/{api => }/response.ts (100%) diff --git a/packages/keyring-api/src/api/account.test.ts b/packages/keyring-api/src/account.test.ts similarity index 100% rename from packages/keyring-api/src/api/account.test.ts rename to packages/keyring-api/src/account.test.ts diff --git a/packages/keyring-api/src/api/account.ts b/packages/keyring-api/src/account.ts similarity index 100% rename from packages/keyring-api/src/api/account.ts rename to packages/keyring-api/src/account.ts diff --git a/packages/keyring-api/src/api/index.ts b/packages/keyring-api/src/api/index.ts deleted file mode 100644 index 81f77490..00000000 --- a/packages/keyring-api/src/api/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './account'; -export * from './balance'; -export * from './caip'; -export * from './export'; -export type * from './keyring'; -export * from './request'; -export * from './response'; diff --git a/packages/keyring-api/src/api/balance.test-d.ts b/packages/keyring-api/src/balance.test-d.ts similarity index 100% rename from packages/keyring-api/src/api/balance.test-d.ts rename to packages/keyring-api/src/balance.test-d.ts diff --git a/packages/keyring-api/src/api/balance.test.ts b/packages/keyring-api/src/balance.test.ts similarity index 100% rename from packages/keyring-api/src/api/balance.test.ts rename to packages/keyring-api/src/balance.test.ts diff --git a/packages/keyring-api/src/api/balance.ts b/packages/keyring-api/src/balance.ts similarity index 100% rename from packages/keyring-api/src/api/balance.ts rename to packages/keyring-api/src/balance.ts diff --git a/packages/keyring-api/src/api/caip.test.ts b/packages/keyring-api/src/caip.test.ts similarity index 100% rename from packages/keyring-api/src/api/caip.test.ts rename to packages/keyring-api/src/caip.test.ts diff --git a/packages/keyring-api/src/api/caip.ts b/packages/keyring-api/src/caip.ts similarity index 100% rename from packages/keyring-api/src/api/caip.ts rename to packages/keyring-api/src/caip.ts diff --git a/packages/keyring-api/src/api/export.test.ts b/packages/keyring-api/src/export.test.ts similarity index 100% rename from packages/keyring-api/src/api/export.test.ts rename to packages/keyring-api/src/export.test.ts diff --git a/packages/keyring-api/src/api/export.ts b/packages/keyring-api/src/export.ts similarity index 100% rename from packages/keyring-api/src/api/export.ts rename to packages/keyring-api/src/export.ts diff --git a/packages/keyring-api/src/index.ts b/packages/keyring-api/src/index.ts index bd560b15..95bb9305 100644 --- a/packages/keyring-api/src/index.ts +++ b/packages/keyring-api/src/index.ts @@ -1,2 +1,8 @@ -export * from './api'; +export * from './account'; +export * from './balance'; +export * from './caip'; +export * from './export'; +export type * from './keyring'; +export * from './request'; +export * from './response'; export type * from './contexts'; diff --git a/packages/keyring-api/src/api/keyring.ts b/packages/keyring-api/src/keyring.ts similarity index 100% rename from packages/keyring-api/src/api/keyring.ts rename to packages/keyring-api/src/keyring.ts diff --git a/packages/keyring-api/src/api/request.test.ts b/packages/keyring-api/src/request.test.ts similarity index 100% rename from packages/keyring-api/src/api/request.test.ts rename to packages/keyring-api/src/request.test.ts diff --git a/packages/keyring-api/src/api/request.ts b/packages/keyring-api/src/request.ts similarity index 100% rename from packages/keyring-api/src/api/request.ts rename to packages/keyring-api/src/request.ts diff --git a/packages/keyring-api/src/api/response.test.ts b/packages/keyring-api/src/response.test.ts similarity index 100% rename from packages/keyring-api/src/api/response.test.ts rename to packages/keyring-api/src/response.test.ts diff --git a/packages/keyring-api/src/api/response.ts b/packages/keyring-api/src/response.ts similarity index 100% rename from packages/keyring-api/src/api/response.ts rename to packages/keyring-api/src/response.ts From 03b206c437114ca12f5e566d14fd3e66d51ad977 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 27 Nov 2024 15:35:15 +0100 Subject: [PATCH 18/31] refactor(keyring-internal-api): flatten folders --- packages/keyring-internal-api/src/{internal => }/api.ts | 0 .../src/{internal => }/eth/EthKeyring.ts | 2 +- packages/keyring-internal-api/src/eth/index.ts | 1 + .../keyring-internal-api/src/{internal => }/events.test.ts | 0 packages/keyring-internal-api/src/{internal => }/events.ts | 0 packages/keyring-internal-api/src/index.ts | 5 ++++- packages/keyring-internal-api/src/internal/eth/index.ts | 1 - packages/keyring-internal-api/src/internal/index.ts | 5 ----- packages/keyring-internal-api/src/{internal => }/rpc.ts | 0 .../keyring-internal-api/src/{internal => }/types.test.ts | 0 packages/keyring-internal-api/src/{internal => }/types.ts | 6 +++--- 11 files changed, 9 insertions(+), 11 deletions(-) rename packages/keyring-internal-api/src/{internal => }/api.ts (100%) rename packages/keyring-internal-api/src/{internal => }/eth/EthKeyring.ts (98%) rename packages/keyring-internal-api/src/{internal => }/events.test.ts (100%) rename packages/keyring-internal-api/src/{internal => }/events.ts (100%) delete mode 100644 packages/keyring-internal-api/src/internal/eth/index.ts delete mode 100644 packages/keyring-internal-api/src/internal/index.ts rename packages/keyring-internal-api/src/{internal => }/rpc.ts (100%) rename packages/keyring-internal-api/src/{internal => }/types.test.ts (100%) rename packages/keyring-internal-api/src/{internal => }/types.ts (94%) diff --git a/packages/keyring-internal-api/src/internal/api.ts b/packages/keyring-internal-api/src/api.ts similarity index 100% rename from packages/keyring-internal-api/src/internal/api.ts rename to packages/keyring-internal-api/src/api.ts diff --git a/packages/keyring-internal-api/src/internal/eth/EthKeyring.ts b/packages/keyring-internal-api/src/eth/EthKeyring.ts similarity index 98% rename from packages/keyring-internal-api/src/internal/eth/EthKeyring.ts rename to packages/keyring-internal-api/src/eth/EthKeyring.ts index ee62078f..2e6904a0 100644 --- a/packages/keyring-internal-api/src/internal/eth/EthKeyring.ts +++ b/packages/keyring-internal-api/src/eth/EthKeyring.ts @@ -6,7 +6,7 @@ import type { EthBaseUserOperation, EthUserOperation, EthUserOperationPatch, -} from '../../eth'; +} from '.'; export type EthKeyring = Keyring & { /** diff --git a/packages/keyring-internal-api/src/eth/index.ts b/packages/keyring-internal-api/src/eth/index.ts index 0e8ad032..33d4cf85 100644 --- a/packages/keyring-internal-api/src/eth/index.ts +++ b/packages/keyring-internal-api/src/eth/index.ts @@ -1,3 +1,4 @@ export * from './erc4337'; export * from './types'; export * from './utils'; +export type * from './EthKeyring'; diff --git a/packages/keyring-internal-api/src/internal/events.test.ts b/packages/keyring-internal-api/src/events.test.ts similarity index 100% rename from packages/keyring-internal-api/src/internal/events.test.ts rename to packages/keyring-internal-api/src/events.test.ts diff --git a/packages/keyring-internal-api/src/internal/events.ts b/packages/keyring-internal-api/src/events.ts similarity index 100% rename from packages/keyring-internal-api/src/internal/events.ts rename to packages/keyring-internal-api/src/events.ts diff --git a/packages/keyring-internal-api/src/index.ts b/packages/keyring-internal-api/src/index.ts index 66d2bf1d..26ec5307 100644 --- a/packages/keyring-internal-api/src/index.ts +++ b/packages/keyring-internal-api/src/index.ts @@ -1,4 +1,7 @@ -export * from './internal'; export * from './btc'; export * from './eth'; export * from './sol'; +export * from './api'; +export * from './events'; +export * from './rpc'; +export * from './types'; diff --git a/packages/keyring-internal-api/src/internal/eth/index.ts b/packages/keyring-internal-api/src/internal/eth/index.ts deleted file mode 100644 index ab70630a..00000000 --- a/packages/keyring-internal-api/src/internal/eth/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from './EthKeyring'; diff --git a/packages/keyring-internal-api/src/internal/index.ts b/packages/keyring-internal-api/src/internal/index.ts deleted file mode 100644 index 2ec237b3..00000000 --- a/packages/keyring-internal-api/src/internal/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './api'; -export type * from './eth'; -export * from './events'; -export * from './rpc'; -export * from './types'; diff --git a/packages/keyring-internal-api/src/internal/rpc.ts b/packages/keyring-internal-api/src/rpc.ts similarity index 100% rename from packages/keyring-internal-api/src/internal/rpc.ts rename to packages/keyring-internal-api/src/rpc.ts diff --git a/packages/keyring-internal-api/src/internal/types.test.ts b/packages/keyring-internal-api/src/types.test.ts similarity index 100% rename from packages/keyring-internal-api/src/internal/types.test.ts rename to packages/keyring-internal-api/src/types.test.ts diff --git a/packages/keyring-internal-api/src/internal/types.ts b/packages/keyring-internal-api/src/types.ts similarity index 94% rename from packages/keyring-internal-api/src/internal/types.ts rename to packages/keyring-internal-api/src/types.ts index ba03ecb7..3318111a 100644 --- a/packages/keyring-internal-api/src/internal/types.ts +++ b/packages/keyring-internal-api/src/types.ts @@ -13,9 +13,9 @@ import { exactOptional, object } from '@metamask/keyring-utils'; import type { Infer, Struct } from '@metamask/superstruct'; import { boolean, string, number } from '@metamask/superstruct'; -import { BtcP2wpkhAccountStruct } from '../btc/types'; -import { EthEoaAccountStruct, EthErc4337AccountStruct } from '../eth/types'; -import { SolDataAccountStruct } from '../sol/types'; +import { BtcP2wpkhAccountStruct } from './btc/types'; +import { EthEoaAccountStruct, EthErc4337AccountStruct } from './eth/types'; +import { SolDataAccountStruct } from './sol/types'; export type InternalAccountType = | EthAccountType From 8be617b4e922c8efbaac1f4383abcb1f6e1827f8 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 27 Nov 2024 15:40:54 +0100 Subject: [PATCH 19/31] test(keyring-internal-api): add tests for Keyring RPC methods --- packages/keyring-internal-api/src/rpc.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 packages/keyring-internal-api/src/rpc.test.ts diff --git a/packages/keyring-internal-api/src/rpc.test.ts b/packages/keyring-internal-api/src/rpc.test.ts new file mode 100644 index 00000000..aa3edd04 --- /dev/null +++ b/packages/keyring-internal-api/src/rpc.test.ts @@ -0,0 +1,11 @@ +import { KeyringRpcMethod, isKeyringRpcMethod } from './rpc'; + +describe('isKeyringRpcMethod', () => { + it.each(Object.values(KeyringRpcMethod))('returns true for: KeyringRpcMethod.$s', (method) => { + expect(isKeyringRpcMethod(method)).toBe(true); + }); + + it('returns false for unknown method', () => { + expect(isKeyringRpcMethod('keyring_unknownMethod')).toBe(false); + }); +}); From b89588d3edbe913c8d131560ee1d86f518131cbf Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 28 Nov 2024 10:23:42 +0100 Subject: [PATCH 20/31] fix: fix types field in package.json --- packages/keyring-internal-api/package.json | 2 +- packages/keyring-snap-client/package.json | 2 +- packages/keyring-snap-sdk/package.json | 2 +- packages/keyring-utils/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/keyring-internal-api/package.json b/packages/keyring-internal-api/package.json index 9a3dbd0d..21f40682 100644 --- a/packages/keyring-internal-api/package.json +++ b/packages/keyring-internal-api/package.json @@ -27,7 +27,7 @@ } }, "main": "./dist/index.js", - "types": "./dist/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist/" ], diff --git a/packages/keyring-snap-client/package.json b/packages/keyring-snap-client/package.json index 500353a1..8e8bc6c3 100644 --- a/packages/keyring-snap-client/package.json +++ b/packages/keyring-snap-client/package.json @@ -27,7 +27,7 @@ } }, "main": "./dist/index.js", - "types": "./dist/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist/" ], diff --git a/packages/keyring-snap-sdk/package.json b/packages/keyring-snap-sdk/package.json index c348284f..89713bf5 100644 --- a/packages/keyring-snap-sdk/package.json +++ b/packages/keyring-snap-sdk/package.json @@ -27,7 +27,7 @@ } }, "main": "./dist/index.js", - "types": "./dist/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist/" ], diff --git a/packages/keyring-utils/package.json b/packages/keyring-utils/package.json index 70e3458a..962fc2b1 100644 --- a/packages/keyring-utils/package.json +++ b/packages/keyring-utils/package.json @@ -27,7 +27,7 @@ } }, "main": "./dist/index.js", - "types": "./dist/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "dist/" ], From b3e0e2634ef55ba1a31e7256bbf3da626ac3cfc4 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 28 Nov 2024 10:30:41 +0100 Subject: [PATCH 21/31] refactor: remove test:verbose --- packages/keyring-internal-api/package.json | 1 - packages/keyring-snap-client/package.json | 1 - packages/keyring-snap-sdk/package.json | 1 - packages/keyring-utils/package.json | 1 - 4 files changed, 4 deletions(-) diff --git a/packages/keyring-internal-api/package.json b/packages/keyring-internal-api/package.json index 21f40682..6b639ed0 100644 --- a/packages/keyring-internal-api/package.json +++ b/packages/keyring-internal-api/package.json @@ -42,7 +42,6 @@ "test:clean": "jest --clearCache", "test:source": "jest && jest-it-up", "test:types": "tsd", - "test:verbose": "jest --verbose", "test:watch": "jest --watch" }, "dependencies": { diff --git a/packages/keyring-snap-client/package.json b/packages/keyring-snap-client/package.json index 8e8bc6c3..2ad47ab4 100644 --- a/packages/keyring-snap-client/package.json +++ b/packages/keyring-snap-client/package.json @@ -42,7 +42,6 @@ "test:clean": "jest --clearCache", "test:source": "jest && jest-it-up", "test:types": "tsd", - "test:verbose": "jest --verbose", "test:watch": "jest --watch" }, "dependencies": { diff --git a/packages/keyring-snap-sdk/package.json b/packages/keyring-snap-sdk/package.json index 89713bf5..1bab8b6c 100644 --- a/packages/keyring-snap-sdk/package.json +++ b/packages/keyring-snap-sdk/package.json @@ -42,7 +42,6 @@ "test:clean": "jest --clearCache", "test:source": "jest && jest-it-up", "test:types": "tsd", - "test:verbose": "jest --verbose", "test:watch": "jest --watch" }, "dependencies": { diff --git a/packages/keyring-utils/package.json b/packages/keyring-utils/package.json index 962fc2b1..cc28fe5b 100644 --- a/packages/keyring-utils/package.json +++ b/packages/keyring-utils/package.json @@ -42,7 +42,6 @@ "test:clean": "jest --clearCache", "test:source": "jest && jest-it-up", "test:types": "tsd", - "test:verbose": "jest --verbose", "test:watch": "jest --watch" }, "dependencies": { From 165b65ffd43e4e6f061f6bfc046a863948b175d8 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 28 Nov 2024 11:20:55 +0100 Subject: [PATCH 22/31] fix(tsd): fix tsd support for every new packages --- packages/keyring-api/package.json | 7 +++++-- packages/keyring-internal-api/package.json | 7 +++++-- packages/keyring-snap-client/package.json | 2 +- packages/keyring-snap-sdk/package.json | 2 +- packages/keyring-utils/package.json | 7 +++++-- scripts/tsd-test.sh | 18 ++++++++++++++++++ tsconfig.packages.json | 4 ++++ 7 files changed, 39 insertions(+), 8 deletions(-) create mode 100755 scripts/tsd-test.sh diff --git a/packages/keyring-api/package.json b/packages/keyring-api/package.json index 65b495ea..edf19b5d 100644 --- a/packages/keyring-api/package.json +++ b/packages/keyring-api/package.json @@ -42,7 +42,7 @@ "test": "yarn test:source && yarn test:types", "test:clean": "jest --clearCache", "test:source": "jest && jest-it-up", - "test:types": "tsd", + "test:types": "../../scripts/tsd-test.sh ./src", "test:watch": "jest --watch" }, "dependencies": { @@ -87,6 +87,9 @@ } }, "tsd": { - "directory": "src" + "directory": "src", + "compilerOptions": { + "composite": "false" + } } } diff --git a/packages/keyring-internal-api/package.json b/packages/keyring-internal-api/package.json index 6b639ed0..46eb0c81 100644 --- a/packages/keyring-internal-api/package.json +++ b/packages/keyring-internal-api/package.json @@ -41,7 +41,7 @@ "test": "yarn test:source && yarn test:types", "test:clean": "jest --clearCache", "test:source": "jest && jest-it-up", - "test:types": "tsd", + "test:types": "../../scripts/tsd-test.sh ./src", "test:watch": "jest --watch" }, "dependencies": { @@ -82,6 +82,9 @@ } }, "tsd": { - "directory": "src" + "directory": "src", + "compilerOptions": { + "composite": "false" + } } } diff --git a/packages/keyring-snap-client/package.json b/packages/keyring-snap-client/package.json index 2ad47ab4..b7843466 100644 --- a/packages/keyring-snap-client/package.json +++ b/packages/keyring-snap-client/package.json @@ -41,7 +41,7 @@ "test": "yarn test:source && yarn test:types", "test:clean": "jest --clearCache", "test:source": "jest && jest-it-up", - "test:types": "tsd", + "test:types": "echo 'No tests to run for now'", "test:watch": "jest --watch" }, "dependencies": { diff --git a/packages/keyring-snap-sdk/package.json b/packages/keyring-snap-sdk/package.json index 1bab8b6c..cd2f9821 100644 --- a/packages/keyring-snap-sdk/package.json +++ b/packages/keyring-snap-sdk/package.json @@ -41,7 +41,7 @@ "test": "yarn test:source && yarn test:types", "test:clean": "jest --clearCache", "test:source": "jest && jest-it-up", - "test:types": "tsd", + "test:types": "echo 'No tests to run for now'", "test:watch": "jest --watch" }, "dependencies": { diff --git a/packages/keyring-utils/package.json b/packages/keyring-utils/package.json index cc28fe5b..858f3e0c 100644 --- a/packages/keyring-utils/package.json +++ b/packages/keyring-utils/package.json @@ -41,7 +41,7 @@ "test": "yarn test:source && yarn test:types", "test:clean": "jest --clearCache", "test:source": "jest && jest-it-up", - "test:types": "tsd", + "test:types": "../../scripts/tsd-test.sh ./src", "test:watch": "jest --watch" }, "dependencies": { @@ -81,6 +81,9 @@ } }, "tsd": { - "directory": "src" + "directory": "src", + "compilerOptions": { + "composite": "false" + } } } diff --git a/scripts/tsd-test.sh b/scripts/tsd-test.sh new file mode 100755 index 00000000..96f9e740 --- /dev/null +++ b/scripts/tsd-test.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -euo pipefail + +# Get the current package test directory +if [[ $# -eq 0 ]]; then + echo "Missing package test directory." + exit 1 +fi + +package_test_dir="$1" + +# For some reason, just running `tsd` with no arguments does not work properly. If you have some +# static errors in your *.test-d.ts, they might not be evaluated. However, specifying each tests +# with `--files` works everytime. So for now, we just use this wrapper for our typing tests. +# NOTE: This directive is expected since we want the output to be splitted: +# shellcheck disable=SC2046 +tsd $(find "${package_test_dir}" -name "*.test-d.ts" -exec echo -n "--files {} " \;) diff --git a/tsconfig.packages.json b/tsconfig.packages.json index 84712874..847976f5 100644 --- a/tsconfig.packages.json +++ b/tsconfig.packages.json @@ -1,5 +1,9 @@ { "compilerOptions": { + // NOTE: For some reason, this flag has to be disabled for tsd. See: + // https://stackoverflow.com/a/70964056 + // It is required to build the entire project though, so this flag will be disabled explicitly + // in every package.json that uses tsd for their typing tests. "composite": true, "esModuleInterop": true, "exactOptionalPropertyTypes": true, From e9921c2227b799500a0c1866d11234d120f49c44 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 28 Nov 2024 11:21:38 +0100 Subject: [PATCH 23/31] fix(keyring-internal-api): fix *.test-d.ts new imports --- packages/keyring-internal-api/src/btc/types.test-d.ts | 6 +++--- packages/keyring-internal-api/src/eth/types.test-d.ts | 8 ++++---- packages/keyring-internal-api/src/sol/types.test-d.ts | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/keyring-internal-api/src/btc/types.test-d.ts b/packages/keyring-internal-api/src/btc/types.test-d.ts index 74367be1..a988df37 100644 --- a/packages/keyring-internal-api/src/btc/types.test-d.ts +++ b/packages/keyring-internal-api/src/btc/types.test-d.ts @@ -1,7 +1,7 @@ import type { BtcP2wpkhAccount } from './types'; -import type { KeyringAccount } from '../api'; -import type { Extends } from '../utils'; -import { expectTrue } from '../utils'; +import type { KeyringAccount } from '@metamask/keyring-api'; +import type { Extends } from '@metamask/keyring-utils'; +import { expectTrue } from '@metamask/keyring-utils'; // `BtcP2wpkhAccount` extends `KeyringAccount` expectTrue>(); diff --git a/packages/keyring-internal-api/src/eth/types.test-d.ts b/packages/keyring-internal-api/src/eth/types.test-d.ts index 250f7eb6..244d1e7d 100644 --- a/packages/keyring-internal-api/src/eth/types.test-d.ts +++ b/packages/keyring-internal-api/src/eth/types.test-d.ts @@ -2,10 +2,10 @@ import { expectAssignable, expectNotAssignable } from 'tsd'; import type { EthEoaAccount, EthErc4337Account } from './types'; import { EthMethod } from './types'; -import type { KeyringAccount } from '../api'; -import { EthAccountType } from '../api'; -import type { Extends } from '../utils'; -import { expectTrue } from '../utils'; +import type { KeyringAccount } from '@metamask/keyring-api'; +import { EthAccountType } from '@metamask/keyring-api'; +import type { Extends } from '@metamask/keyring-utils'; +import { expectTrue } from '@metamask/keyring-utils'; const id = '606a7759-b0fb-48e4-9874-bab62ff8e7eb'; const address = '0x000'; diff --git a/packages/keyring-internal-api/src/sol/types.test-d.ts b/packages/keyring-internal-api/src/sol/types.test-d.ts index 8647f89e..da1eb337 100644 --- a/packages/keyring-internal-api/src/sol/types.test-d.ts +++ b/packages/keyring-internal-api/src/sol/types.test-d.ts @@ -1,7 +1,7 @@ import type { SolDataAccount } from './types'; -import type { KeyringAccount } from '../api'; -import type { Extends } from '../utils'; -import { expectTrue } from '../utils'; +import type { KeyringAccount } from '@metamask/keyring-api'; +import type { Extends } from '@metamask/keyring-utils'; +import { expectTrue } from '@metamask/keyring-utils'; // `SolDataAccount` extends `KeyringAccount` expectTrue>(); From 9e5806abc351f6fb7e95c30f6f7bdfa397eb7906 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 28 Nov 2024 12:22:28 +0100 Subject: [PATCH 24/31] chore: lint + missing toThrow messages in tests --- packages/keyring-api/src/export.test.ts | 2 +- .../keyring-internal-api/src/btc/types.test-d.ts | 3 ++- .../keyring-internal-api/src/eth/types.test-d.ts | 8 ++++---- packages/keyring-internal-api/src/rpc.test.ts | 9 ++++++--- .../keyring-internal-api/src/sol/types.test-d.ts | 3 ++- packages/keyring-utils/src/superstruct.test.ts | 14 +++++++++----- packages/keyring-utils/src/types.test.ts | 4 +++- 7 files changed, 27 insertions(+), 16 deletions(-) diff --git a/packages/keyring-api/src/export.test.ts b/packages/keyring-api/src/export.test.ts index 7a0dea4a..e22a27d8 100644 --- a/packages/keyring-api/src/export.test.ts +++ b/packages/keyring-api/src/export.test.ts @@ -3,7 +3,7 @@ import { is } from '@metamask/superstruct'; import { KeyringAccountDataStruct } from './export'; describe('KeyringAccountDataStruct', () => { - const sym = Symbol(); + const sym = Symbol('Unique symbol for testing purposes'); it.each([ // Valid { data: { foo: 'bar' }, expected: true }, diff --git a/packages/keyring-internal-api/src/btc/types.test-d.ts b/packages/keyring-internal-api/src/btc/types.test-d.ts index a988df37..a28321cd 100644 --- a/packages/keyring-internal-api/src/btc/types.test-d.ts +++ b/packages/keyring-internal-api/src/btc/types.test-d.ts @@ -1,7 +1,8 @@ -import type { BtcP2wpkhAccount } from './types'; import type { KeyringAccount } from '@metamask/keyring-api'; import type { Extends } from '@metamask/keyring-utils'; import { expectTrue } from '@metamask/keyring-utils'; +import type { BtcP2wpkhAccount } from './types'; + // `BtcP2wpkhAccount` extends `KeyringAccount` expectTrue>(); diff --git a/packages/keyring-internal-api/src/eth/types.test-d.ts b/packages/keyring-internal-api/src/eth/types.test-d.ts index 244d1e7d..91f857b3 100644 --- a/packages/keyring-internal-api/src/eth/types.test-d.ts +++ b/packages/keyring-internal-api/src/eth/types.test-d.ts @@ -1,11 +1,11 @@ -import { expectAssignable, expectNotAssignable } from 'tsd'; - -import type { EthEoaAccount, EthErc4337Account } from './types'; -import { EthMethod } from './types'; import type { KeyringAccount } from '@metamask/keyring-api'; import { EthAccountType } from '@metamask/keyring-api'; import type { Extends } from '@metamask/keyring-utils'; import { expectTrue } from '@metamask/keyring-utils'; +import { expectAssignable, expectNotAssignable } from 'tsd'; + +import type { EthEoaAccount, EthErc4337Account } from './types'; +import { EthMethod } from './types'; const id = '606a7759-b0fb-48e4-9874-bab62ff8e7eb'; const address = '0x000'; diff --git a/packages/keyring-internal-api/src/rpc.test.ts b/packages/keyring-internal-api/src/rpc.test.ts index aa3edd04..e2f0afde 100644 --- a/packages/keyring-internal-api/src/rpc.test.ts +++ b/packages/keyring-internal-api/src/rpc.test.ts @@ -1,9 +1,12 @@ import { KeyringRpcMethod, isKeyringRpcMethod } from './rpc'; describe('isKeyringRpcMethod', () => { - it.each(Object.values(KeyringRpcMethod))('returns true for: KeyringRpcMethod.$s', (method) => { - expect(isKeyringRpcMethod(method)).toBe(true); - }); + it.each(Object.values(KeyringRpcMethod))( + 'returns true for: KeyringRpcMethod.$s', + (method) => { + expect(isKeyringRpcMethod(method)).toBe(true); + }, + ); it('returns false for unknown method', () => { expect(isKeyringRpcMethod('keyring_unknownMethod')).toBe(false); diff --git a/packages/keyring-internal-api/src/sol/types.test-d.ts b/packages/keyring-internal-api/src/sol/types.test-d.ts index da1eb337..b503011a 100644 --- a/packages/keyring-internal-api/src/sol/types.test-d.ts +++ b/packages/keyring-internal-api/src/sol/types.test-d.ts @@ -1,7 +1,8 @@ -import type { SolDataAccount } from './types'; import type { KeyringAccount } from '@metamask/keyring-api'; import type { Extends } from '@metamask/keyring-utils'; import { expectTrue } from '@metamask/keyring-utils'; +import type { SolDataAccount } from './types'; + // `SolDataAccount` extends `KeyringAccount` expectTrue>(); diff --git a/packages/keyring-utils/src/superstruct.test.ts b/packages/keyring-utils/src/superstruct.test.ts index af7c5911..33116089 100644 --- a/packages/keyring-utils/src/superstruct.test.ts +++ b/packages/keyring-utils/src/superstruct.test.ts @@ -81,11 +81,15 @@ describe('@metamask/superstruct', () => { }); it('fails if the object is not strictly matching', () => { - expect(() => - strictMask({ foo: 'foo', bar: 1, zzz: [] }, struct), - ).toThrow(); - expect(() => strictMask({ foo: 'foo' }, struct)).toThrow(); - expect(() => strictMask({ bar: 1 }, struct)).toThrow(); + expect(() => strictMask({ foo: 'foo', bar: 1, zzz: [] }, struct)).toThrow( + 'At path: zzz -- Expected a value of type `never`, but received: ``', + ); + expect(() => strictMask({ foo: 'foo' }, struct)).toThrow( + 'At path: bar -- Expected a number, but received: undefined', + ); + expect(() => strictMask({ bar: 1 }, struct)).toThrow( + 'At path: foo -- Expected a string, but received: undefined', + ); }); }); }); diff --git a/packages/keyring-utils/src/types.test.ts b/packages/keyring-utils/src/types.test.ts index d7561061..3a11fd17 100644 --- a/packages/keyring-utils/src/types.test.ts +++ b/packages/keyring-utils/src/types.test.ts @@ -14,7 +14,9 @@ describe('UuidStruct', () => { '47d782ac_15c8_4c81_8bfe_759ae1be4a3e', '47d782ac15c84c818bfe759ae1be4a3e', ])('fails if the UUID is a valid', (uuid) => { - expect(() => assert(uuid, UuidStruct)).toThrow(); + expect(() => assert(uuid, UuidStruct)).toThrow( + `Expected a value of type \`UuidV4\`, but received: \`"${uuid}"\``, + ); }); }); From 8797cbfa4aeadf401b112618b2130b055f6c16af Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 28 Nov 2024 12:54:44 +0100 Subject: [PATCH 25/31] fix(keyring-api): disable no-redundant-type-constituents lint warning for keyring.ts --- packages/keyring-api/src/keyring.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/keyring-api/src/keyring.ts b/packages/keyring-api/src/keyring.ts index 5952ab14..3cdd2deb 100644 --- a/packages/keyring-api/src/keyring.ts +++ b/packages/keyring-api/src/keyring.ts @@ -1,3 +1,6 @@ +/* eslint-disable @typescript-eslint/no-redundant-type-constituents */ +// This rule seems to be triggering a false positive on the `KeyringAccount`. + import type { Json } from '@metamask/utils'; import type { KeyringAccount } from './account'; From 11541a92a041cb8edf7072667abe619fd4ec73f3 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 28 Nov 2024 12:55:41 +0100 Subject: [PATCH 26/31] chore: better comments --- packages/keyring-internal-api/src/types.ts | 2 +- packages/keyring-snap-bridge/src/SnapKeyring.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/keyring-internal-api/src/types.ts b/packages/keyring-internal-api/src/types.ts index 3318111a..8ff0802c 100644 --- a/packages/keyring-internal-api/src/types.ts +++ b/packages/keyring-internal-api/src/types.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-redundant-type-constituents */ /* eslint-disable @typescript-eslint/no-duplicate-type-constituents */ -// Those rule seem to be triggering a false positive on the `InternalAccountStructs` +// Those rules seem to be triggering a false positive on the `InternalAccountStructs` // and `InternalAccountTypes`. import { diff --git a/packages/keyring-snap-bridge/src/SnapKeyring.ts b/packages/keyring-snap-bridge/src/SnapKeyring.ts index 856c6149..2f0b0fc1 100644 --- a/packages/keyring-snap-bridge/src/SnapKeyring.ts +++ b/packages/keyring-snap-bridge/src/SnapKeyring.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-redundant-type-constituents */ // This rule seems to be triggering a false positive. Possibly eslint is not -// inferring the EthMethod, BtcMethod, and InternalAccount types correctly. +// inferring the `EthMethod`, `BtcMethod`, and `InternalAccount` types correctly. import type { TypedTransaction } from '@ethereumjs/tx'; import { TransactionFactory } from '@ethereumjs/tx'; From b85bfaadf49517c6d51b616f1148f041e9871b93 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Thu, 28 Nov 2024 16:39:05 +0100 Subject: [PATCH 27/31] fix: fix main file for new packages --- packages/keyring-internal-api/package.json | 2 +- packages/keyring-snap-client/package.json | 2 +- packages/keyring-snap-sdk/package.json | 2 +- packages/keyring-utils/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/keyring-internal-api/package.json b/packages/keyring-internal-api/package.json index 46eb0c81..3de9c012 100644 --- a/packages/keyring-internal-api/package.json +++ b/packages/keyring-internal-api/package.json @@ -26,7 +26,7 @@ } } }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "types": "./dist/index.d.cts", "files": [ "dist/" diff --git a/packages/keyring-snap-client/package.json b/packages/keyring-snap-client/package.json index b7843466..8d76350c 100644 --- a/packages/keyring-snap-client/package.json +++ b/packages/keyring-snap-client/package.json @@ -26,7 +26,7 @@ } } }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "types": "./dist/index.d.cts", "files": [ "dist/" diff --git a/packages/keyring-snap-sdk/package.json b/packages/keyring-snap-sdk/package.json index cd2f9821..f5c9180f 100644 --- a/packages/keyring-snap-sdk/package.json +++ b/packages/keyring-snap-sdk/package.json @@ -26,7 +26,7 @@ } } }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "types": "./dist/index.d.cts", "files": [ "dist/" diff --git a/packages/keyring-utils/package.json b/packages/keyring-utils/package.json index 858f3e0c..794faf2e 100644 --- a/packages/keyring-utils/package.json +++ b/packages/keyring-utils/package.json @@ -26,7 +26,7 @@ } } }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", "types": "./dist/index.d.cts", "files": [ "dist/" From d4f18e407b1aa6f3ce0b228dacaf3d468b493782 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Fri, 29 Nov 2024 16:19:32 +0100 Subject: [PATCH 28/31] refactor: cleanup deps --- packages/keyring-api/package.json | 1 - packages/keyring-snap-bridge/package.json | 7 +++++-- yarn.lock | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/keyring-api/package.json b/packages/keyring-api/package.json index edf19b5d..f0c73044 100644 --- a/packages/keyring-api/package.json +++ b/packages/keyring-api/package.json @@ -57,7 +57,6 @@ "@lavamoat/preinstall-always-fail": "^2.1.0", "@metamask/auto-changelog": "^3.4.4", "@metamask/keyring-utils": "workspace:^", - "@metamask/providers": "^18.1.0", "@ts-bridge/cli": "^0.6.0", "@types/jest": "^29.5.12", "@types/node": "^20.12.12", diff --git a/packages/keyring-snap-bridge/package.json b/packages/keyring-snap-bridge/package.json index fab7e2e2..89cd6c09 100644 --- a/packages/keyring-snap-bridge/package.json +++ b/packages/keyring-snap-bridge/package.json @@ -47,12 +47,14 @@ "@metamask/superstruct": "^3.1.0", "@metamask/utils": "^9.2.1", "@types/uuid": "^9.0.8", - "uuid": "^9.0.1" + "uuid": "^9.0.1", + "webextension-polyfill": "^0.12.0" }, "devDependencies": { "@lavamoat/allow-scripts": "^3.2.1", "@lavamoat/preinstall-always-fail": "^2.1.0", "@metamask/auto-changelog": "^3.4.4", + "@metamask/providers": "^18.1.0", "@ts-bridge/cli": "^0.6.0", "@types/jest": "^29.5.12", "@types/node": "^20.12.12", @@ -66,7 +68,8 @@ "typescript": "~5.6.3" }, "peerDependencies": { - "@metamask/keyring-api": "workspace:^" + "@metamask/keyring-api": "workspace:^", + "@metamask/providers": "^18.1.0" }, "engines": { "node": "^18.18 || >=20" diff --git a/yarn.lock b/yarn.lock index a5a41ebd..2162082f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2001,6 +2001,7 @@ __metadata: "@metamask/keyring-internal-api": "workspace:^" "@metamask/keyring-snap-client": "workspace:^" "@metamask/keyring-snap-sdk": "workspace:^" + "@metamask/providers": "npm:^18.1.0" "@metamask/snaps-controllers": "npm:^9.10.0" "@metamask/snaps-sdk": "npm:^6.7.0" "@metamask/snaps-utils": "npm:^8.3.0" @@ -2019,8 +2020,10 @@ __metadata: typedoc: "npm:^0.25.13" typescript: "npm:~5.6.3" uuid: "npm:^9.0.1" + webextension-polyfill: "npm:^0.12.0" peerDependencies: "@metamask/keyring-api": "workspace:^" + "@metamask/providers": ^18.1.0 languageName: unknown linkType: soft @@ -2140,7 +2143,6 @@ __metadata: "@lavamoat/preinstall-always-fail": "npm:^2.1.0" "@metamask/auto-changelog": "npm:^3.4.4" "@metamask/keyring-utils": "workspace:^" - "@metamask/providers": "npm:^18.1.0" "@metamask/superstruct": "npm:^3.1.0" "@metamask/utils": "npm:^9.2.1" "@ts-bridge/cli": "npm:^0.6.0" From e9c0e4e594c385120bc6201769d5c9f927c201a2 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Fri, 29 Nov 2024 17:43:59 +0100 Subject: [PATCH 29/31] refactor: keyring-internal-api/src/{btc,eth,sol} -> keyring-api/src --- .../keyring-api/src/{ => api}/account.test.ts | 0 packages/keyring-api/src/{ => api}/account.ts | 0 .../src/{ => api}/balance.test-d.ts | 0 .../keyring-api/src/{ => api}/balance.test.ts | 0 packages/keyring-api/src/{ => api}/balance.ts | 0 .../keyring-api/src/{ => api}/caip.test.ts | 0 packages/keyring-api/src/{ => api}/caip.ts | 0 .../keyring-api/src/{ => api}/export.test.ts | 0 packages/keyring-api/src/{ => api}/export.ts | 0 packages/keyring-api/src/api/index.ts | 7 +++++ packages/keyring-api/src/{ => api}/keyring.ts | 0 .../keyring-api/src/{ => api}/request.test.ts | 0 packages/keyring-api/src/{ => api}/request.ts | 0 .../src/{ => api}/response.test.ts | 0 .../keyring-api/src/{ => api}/response.ts | 0 .../src/btc/index.ts | 0 .../src/btc/types.test-d.ts | 0 .../src/btc/types.test.ts | 0 .../src/btc/types.ts | 3 ++- .../src/eth/erc4337/index.ts | 0 .../src/eth/erc4337/types.test-d.ts | 0 .../src/eth/erc4337/types.test.ts | 0 .../src/eth/erc4337/types.ts | 0 packages/keyring-api/src/eth/index.ts | 3 +++ .../src/eth/types.test-d.ts | 4 +-- .../src/eth/types.ts | 3 ++- .../src/eth/utils.test.ts | 7 +---- .../src/eth/utils.ts | 4 +-- .../src/events.test.ts | 2 +- .../src/events.ts | 3 ++- packages/keyring-api/src/index.ts | 13 +++++----- .../src/rpc.test.ts | 0 .../src/rpc.ts | 0 .../src/sol/index.ts | 0 .../src/sol/types.test-d.ts | 0 .../src/sol/types.test.ts | 0 .../src/sol/types.ts | 3 ++- packages/keyring-internal-api/src/api.ts | 3 +-- .../src/eth/EthKeyring.ts | 7 +++-- .../keyring-internal-api/src/eth/index.ts | 3 --- packages/keyring-internal-api/src/index.ts | 6 +---- packages/keyring-internal-api/src/types.ts | 8 +++--- .../keyring-snap-bridge/src/SnapKeyring.ts | 26 +++++++++---------- .../keyring-snap-client/src/KeyringClient.ts | 2 +- packages/keyring-snap-sdk/src/events.ts | 1 - packages/keyring-snap-sdk/src/index.ts | 1 - packages/keyring-snap-sdk/src/rpc-handler.ts | 2 +- packages/keyring-snap-sdk/src/snap-utils.ts | 3 +-- 48 files changed, 54 insertions(+), 60 deletions(-) rename packages/keyring-api/src/{ => api}/account.test.ts (100%) rename packages/keyring-api/src/{ => api}/account.ts (100%) rename packages/keyring-api/src/{ => api}/balance.test-d.ts (100%) rename packages/keyring-api/src/{ => api}/balance.test.ts (100%) rename packages/keyring-api/src/{ => api}/balance.ts (100%) rename packages/keyring-api/src/{ => api}/caip.test.ts (100%) rename packages/keyring-api/src/{ => api}/caip.ts (100%) rename packages/keyring-api/src/{ => api}/export.test.ts (100%) rename packages/keyring-api/src/{ => api}/export.ts (100%) create mode 100644 packages/keyring-api/src/api/index.ts rename packages/keyring-api/src/{ => api}/keyring.ts (100%) rename packages/keyring-api/src/{ => api}/request.test.ts (100%) rename packages/keyring-api/src/{ => api}/request.ts (100%) rename packages/keyring-api/src/{ => api}/response.test.ts (100%) rename packages/keyring-api/src/{ => api}/response.ts (100%) rename packages/{keyring-internal-api => keyring-api}/src/btc/index.ts (100%) rename packages/{keyring-internal-api => keyring-api}/src/btc/types.test-d.ts (100%) rename packages/{keyring-internal-api => keyring-api}/src/btc/types.test.ts (100%) rename packages/{keyring-internal-api => keyring-api}/src/btc/types.ts (93%) rename packages/{keyring-internal-api => keyring-api}/src/eth/erc4337/index.ts (100%) rename packages/{keyring-internal-api => keyring-api}/src/eth/erc4337/types.test-d.ts (100%) rename packages/{keyring-internal-api => keyring-api}/src/eth/erc4337/types.test.ts (100%) rename packages/{keyring-internal-api => keyring-api}/src/eth/erc4337/types.ts (100%) create mode 100644 packages/keyring-api/src/eth/index.ts rename packages/{keyring-internal-api => keyring-api}/src/eth/types.test-d.ts (96%) rename packages/{keyring-internal-api => keyring-api}/src/eth/types.ts (96%) rename packages/{keyring-internal-api => keyring-api}/src/eth/utils.test.ts (82%) rename packages/{keyring-internal-api => keyring-api}/src/eth/utils.ts (72%) rename packages/{keyring-internal-api => keyring-api}/src/events.test.ts (98%) rename packages/{keyring-internal-api => keyring-api}/src/events.ts (97%) rename packages/{keyring-internal-api => keyring-api}/src/rpc.test.ts (100%) rename packages/{keyring-internal-api => keyring-api}/src/rpc.ts (100%) rename packages/{keyring-internal-api => keyring-api}/src/sol/index.ts (100%) rename packages/{keyring-internal-api => keyring-api}/src/sol/types.test-d.ts (100%) rename packages/{keyring-internal-api => keyring-api}/src/sol/types.test.ts (100%) rename packages/{keyring-internal-api => keyring-api}/src/sol/types.ts (92%) delete mode 100644 packages/keyring-snap-sdk/src/events.ts diff --git a/packages/keyring-api/src/account.test.ts b/packages/keyring-api/src/api/account.test.ts similarity index 100% rename from packages/keyring-api/src/account.test.ts rename to packages/keyring-api/src/api/account.test.ts diff --git a/packages/keyring-api/src/account.ts b/packages/keyring-api/src/api/account.ts similarity index 100% rename from packages/keyring-api/src/account.ts rename to packages/keyring-api/src/api/account.ts diff --git a/packages/keyring-api/src/balance.test-d.ts b/packages/keyring-api/src/api/balance.test-d.ts similarity index 100% rename from packages/keyring-api/src/balance.test-d.ts rename to packages/keyring-api/src/api/balance.test-d.ts diff --git a/packages/keyring-api/src/balance.test.ts b/packages/keyring-api/src/api/balance.test.ts similarity index 100% rename from packages/keyring-api/src/balance.test.ts rename to packages/keyring-api/src/api/balance.test.ts diff --git a/packages/keyring-api/src/balance.ts b/packages/keyring-api/src/api/balance.ts similarity index 100% rename from packages/keyring-api/src/balance.ts rename to packages/keyring-api/src/api/balance.ts diff --git a/packages/keyring-api/src/caip.test.ts b/packages/keyring-api/src/api/caip.test.ts similarity index 100% rename from packages/keyring-api/src/caip.test.ts rename to packages/keyring-api/src/api/caip.test.ts diff --git a/packages/keyring-api/src/caip.ts b/packages/keyring-api/src/api/caip.ts similarity index 100% rename from packages/keyring-api/src/caip.ts rename to packages/keyring-api/src/api/caip.ts diff --git a/packages/keyring-api/src/export.test.ts b/packages/keyring-api/src/api/export.test.ts similarity index 100% rename from packages/keyring-api/src/export.test.ts rename to packages/keyring-api/src/api/export.test.ts diff --git a/packages/keyring-api/src/export.ts b/packages/keyring-api/src/api/export.ts similarity index 100% rename from packages/keyring-api/src/export.ts rename to packages/keyring-api/src/api/export.ts diff --git a/packages/keyring-api/src/api/index.ts b/packages/keyring-api/src/api/index.ts new file mode 100644 index 00000000..81f77490 --- /dev/null +++ b/packages/keyring-api/src/api/index.ts @@ -0,0 +1,7 @@ +export * from './account'; +export * from './balance'; +export * from './caip'; +export * from './export'; +export type * from './keyring'; +export * from './request'; +export * from './response'; diff --git a/packages/keyring-api/src/keyring.ts b/packages/keyring-api/src/api/keyring.ts similarity index 100% rename from packages/keyring-api/src/keyring.ts rename to packages/keyring-api/src/api/keyring.ts diff --git a/packages/keyring-api/src/request.test.ts b/packages/keyring-api/src/api/request.test.ts similarity index 100% rename from packages/keyring-api/src/request.test.ts rename to packages/keyring-api/src/api/request.test.ts diff --git a/packages/keyring-api/src/request.ts b/packages/keyring-api/src/api/request.ts similarity index 100% rename from packages/keyring-api/src/request.ts rename to packages/keyring-api/src/api/request.ts diff --git a/packages/keyring-api/src/response.test.ts b/packages/keyring-api/src/api/response.test.ts similarity index 100% rename from packages/keyring-api/src/response.test.ts rename to packages/keyring-api/src/api/response.test.ts diff --git a/packages/keyring-api/src/response.ts b/packages/keyring-api/src/api/response.ts similarity index 100% rename from packages/keyring-api/src/response.ts rename to packages/keyring-api/src/api/response.ts diff --git a/packages/keyring-internal-api/src/btc/index.ts b/packages/keyring-api/src/btc/index.ts similarity index 100% rename from packages/keyring-internal-api/src/btc/index.ts rename to packages/keyring-api/src/btc/index.ts diff --git a/packages/keyring-internal-api/src/btc/types.test-d.ts b/packages/keyring-api/src/btc/types.test-d.ts similarity index 100% rename from packages/keyring-internal-api/src/btc/types.test-d.ts rename to packages/keyring-api/src/btc/types.test-d.ts diff --git a/packages/keyring-internal-api/src/btc/types.test.ts b/packages/keyring-api/src/btc/types.test.ts similarity index 100% rename from packages/keyring-internal-api/src/btc/types.test.ts rename to packages/keyring-api/src/btc/types.test.ts diff --git a/packages/keyring-internal-api/src/btc/types.ts b/packages/keyring-api/src/btc/types.ts similarity index 93% rename from packages/keyring-internal-api/src/btc/types.ts rename to packages/keyring-api/src/btc/types.ts index 8052e34d..f610293d 100644 --- a/packages/keyring-internal-api/src/btc/types.ts +++ b/packages/keyring-api/src/btc/types.ts @@ -1,9 +1,10 @@ -import { KeyringAccountStruct, BtcAccountType } from '@metamask/keyring-api'; import { object } from '@metamask/keyring-utils'; import type { Infer } from '@metamask/superstruct'; import { string, array, enums, refine, literal } from '@metamask/superstruct'; import { bech32 } from 'bech32'; +import { BtcAccountType, KeyringAccountStruct } from '../api'; + export const BtcP2wpkhAddressStruct = refine( string(), 'BtcP2wpkhAddressStruct', diff --git a/packages/keyring-internal-api/src/eth/erc4337/index.ts b/packages/keyring-api/src/eth/erc4337/index.ts similarity index 100% rename from packages/keyring-internal-api/src/eth/erc4337/index.ts rename to packages/keyring-api/src/eth/erc4337/index.ts diff --git a/packages/keyring-internal-api/src/eth/erc4337/types.test-d.ts b/packages/keyring-api/src/eth/erc4337/types.test-d.ts similarity index 100% rename from packages/keyring-internal-api/src/eth/erc4337/types.test-d.ts rename to packages/keyring-api/src/eth/erc4337/types.test-d.ts diff --git a/packages/keyring-internal-api/src/eth/erc4337/types.test.ts b/packages/keyring-api/src/eth/erc4337/types.test.ts similarity index 100% rename from packages/keyring-internal-api/src/eth/erc4337/types.test.ts rename to packages/keyring-api/src/eth/erc4337/types.test.ts diff --git a/packages/keyring-internal-api/src/eth/erc4337/types.ts b/packages/keyring-api/src/eth/erc4337/types.ts similarity index 100% rename from packages/keyring-internal-api/src/eth/erc4337/types.ts rename to packages/keyring-api/src/eth/erc4337/types.ts diff --git a/packages/keyring-api/src/eth/index.ts b/packages/keyring-api/src/eth/index.ts new file mode 100644 index 00000000..0e8ad032 --- /dev/null +++ b/packages/keyring-api/src/eth/index.ts @@ -0,0 +1,3 @@ +export * from './erc4337'; +export * from './types'; +export * from './utils'; diff --git a/packages/keyring-internal-api/src/eth/types.test-d.ts b/packages/keyring-api/src/eth/types.test-d.ts similarity index 96% rename from packages/keyring-internal-api/src/eth/types.test-d.ts rename to packages/keyring-api/src/eth/types.test-d.ts index 91f857b3..69edac4f 100644 --- a/packages/keyring-internal-api/src/eth/types.test-d.ts +++ b/packages/keyring-api/src/eth/types.test-d.ts @@ -1,11 +1,11 @@ -import type { KeyringAccount } from '@metamask/keyring-api'; -import { EthAccountType } from '@metamask/keyring-api'; import type { Extends } from '@metamask/keyring-utils'; import { expectTrue } from '@metamask/keyring-utils'; import { expectAssignable, expectNotAssignable } from 'tsd'; import type { EthEoaAccount, EthErc4337Account } from './types'; import { EthMethod } from './types'; +import { EthAccountType } from '../api'; +import type { KeyringAccount } from '../api'; const id = '606a7759-b0fb-48e4-9874-bab62ff8e7eb'; const address = '0x000'; diff --git a/packages/keyring-internal-api/src/eth/types.ts b/packages/keyring-api/src/eth/types.ts similarity index 96% rename from packages/keyring-internal-api/src/eth/types.ts rename to packages/keyring-api/src/eth/types.ts index becdae17..892bcc5e 100644 --- a/packages/keyring-internal-api/src/eth/types.ts +++ b/packages/keyring-api/src/eth/types.ts @@ -1,8 +1,9 @@ -import { EthAccountType, KeyringAccountStruct } from '@metamask/keyring-api'; import { object, definePattern } from '@metamask/keyring-utils'; import type { Infer } from '@metamask/superstruct'; import { array, enums, literal } from '@metamask/superstruct'; +import { EthAccountType, KeyringAccountStruct } from '../api'; + export const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu); export const EthAddressStruct = definePattern( diff --git a/packages/keyring-internal-api/src/eth/utils.test.ts b/packages/keyring-api/src/eth/utils.test.ts similarity index 82% rename from packages/keyring-internal-api/src/eth/utils.test.ts rename to packages/keyring-api/src/eth/utils.test.ts index 74d76552..54b78f29 100644 --- a/packages/keyring-internal-api/src/eth/utils.test.ts +++ b/packages/keyring-api/src/eth/utils.test.ts @@ -1,10 +1,5 @@ -import { - BtcAccountType, - EthAccountType, - SolAccountType, -} from '@metamask/keyring-api'; - import { isEvmAccountType } from './utils'; +import { BtcAccountType, EthAccountType, SolAccountType } from '../api'; describe('isEvmAccountType', () => { it.each([ diff --git a/packages/keyring-internal-api/src/eth/utils.ts b/packages/keyring-api/src/eth/utils.ts similarity index 72% rename from packages/keyring-internal-api/src/eth/utils.ts rename to packages/keyring-api/src/eth/utils.ts index 6c0db9e8..6a0005ff 100644 --- a/packages/keyring-internal-api/src/eth/utils.ts +++ b/packages/keyring-api/src/eth/utils.ts @@ -1,5 +1,5 @@ -import type { KeyringAccountType } from '@metamask/keyring-api'; -import { EthAccountType } from '@metamask/keyring-api'; +import { EthAccountType } from '../api'; +import type { KeyringAccountType } from '../api'; /** * Checks if the given type is an EVM account type. diff --git a/packages/keyring-internal-api/src/events.test.ts b/packages/keyring-api/src/events.test.ts similarity index 98% rename from packages/keyring-internal-api/src/events.test.ts rename to packages/keyring-api/src/events.test.ts index fd8b1cb7..f52d79e9 100644 --- a/packages/keyring-internal-api/src/events.test.ts +++ b/packages/keyring-api/src/events.test.ts @@ -1,4 +1,3 @@ -import { EthAccountType } from '@metamask/keyring-api'; import { is } from '@metamask/superstruct'; import { @@ -9,6 +8,7 @@ import { RequestRejectedEventStruct, KeyringEvent, } from './events'; +import { EthAccountType } from '../api'; describe('events', () => { describe('AccountCreatedEventStruct', () => { diff --git a/packages/keyring-internal-api/src/events.ts b/packages/keyring-api/src/events.ts similarity index 97% rename from packages/keyring-internal-api/src/events.ts rename to packages/keyring-api/src/events.ts index 847ccf21..b5e433f6 100644 --- a/packages/keyring-internal-api/src/events.ts +++ b/packages/keyring-api/src/events.ts @@ -1,8 +1,9 @@ -import { KeyringAccountStruct } from '@metamask/keyring-api'; import { exactOptional, object, UuidStruct } from '@metamask/keyring-utils'; import { boolean, literal, string } from '@metamask/superstruct'; import { JsonStruct } from '@metamask/utils'; +import { KeyringAccountStruct } from './api'; + /** * Supported keyring events. */ diff --git a/packages/keyring-api/src/index.ts b/packages/keyring-api/src/index.ts index 95bb9305..42d55f74 100644 --- a/packages/keyring-api/src/index.ts +++ b/packages/keyring-api/src/index.ts @@ -1,8 +1,7 @@ -export * from './account'; -export * from './balance'; -export * from './caip'; -export * from './export'; -export type * from './keyring'; -export * from './request'; -export * from './response'; +export * from './api'; +export * from './btc'; +export * from './sol'; +export * from './eth'; export type * from './contexts'; +export * from './rpc'; +export * from './events'; diff --git a/packages/keyring-internal-api/src/rpc.test.ts b/packages/keyring-api/src/rpc.test.ts similarity index 100% rename from packages/keyring-internal-api/src/rpc.test.ts rename to packages/keyring-api/src/rpc.test.ts diff --git a/packages/keyring-internal-api/src/rpc.ts b/packages/keyring-api/src/rpc.ts similarity index 100% rename from packages/keyring-internal-api/src/rpc.ts rename to packages/keyring-api/src/rpc.ts diff --git a/packages/keyring-internal-api/src/sol/index.ts b/packages/keyring-api/src/sol/index.ts similarity index 100% rename from packages/keyring-internal-api/src/sol/index.ts rename to packages/keyring-api/src/sol/index.ts diff --git a/packages/keyring-internal-api/src/sol/types.test-d.ts b/packages/keyring-api/src/sol/types.test-d.ts similarity index 100% rename from packages/keyring-internal-api/src/sol/types.test-d.ts rename to packages/keyring-api/src/sol/types.test-d.ts diff --git a/packages/keyring-internal-api/src/sol/types.test.ts b/packages/keyring-api/src/sol/types.test.ts similarity index 100% rename from packages/keyring-internal-api/src/sol/types.test.ts rename to packages/keyring-api/src/sol/types.test.ts diff --git a/packages/keyring-internal-api/src/sol/types.ts b/packages/keyring-api/src/sol/types.ts similarity index 92% rename from packages/keyring-internal-api/src/sol/types.ts rename to packages/keyring-api/src/sol/types.ts index 6abb5ff7..64dcaa66 100644 --- a/packages/keyring-internal-api/src/sol/types.ts +++ b/packages/keyring-api/src/sol/types.ts @@ -1,8 +1,9 @@ -import { KeyringAccountStruct, SolAccountType } from '@metamask/keyring-api'; import { object, definePattern } from '@metamask/keyring-utils'; import type { Infer } from '@metamask/superstruct'; import { array, enums, literal } from '@metamask/superstruct'; +import { KeyringAccountStruct, SolAccountType } from '../api'; + /** * Solana addresses are represented in the format of a 256-bit ed25519 public key and * are encoded using base58. diff --git a/packages/keyring-internal-api/src/api.ts b/packages/keyring-internal-api/src/api.ts index 4c74b8bc..5ff96087 100644 --- a/packages/keyring-internal-api/src/api.ts +++ b/packages/keyring-internal-api/src/api.ts @@ -5,6 +5,7 @@ import { KeyringAccountStruct, KeyringRequestStruct, KeyringResponseStruct, + KeyringRpcMethod, } from '@metamask/keyring-api'; import { object, UuidStruct } from '@metamask/keyring-utils'; import type { Infer } from '@metamask/superstruct'; @@ -18,8 +19,6 @@ import { } from '@metamask/superstruct'; import { JsonStruct } from '@metamask/utils'; -import { KeyringRpcMethod } from './rpc'; - const CommonHeader = { jsonrpc: literal('2.0'), id: union([string(), number(), literal(null)]), diff --git a/packages/keyring-internal-api/src/eth/EthKeyring.ts b/packages/keyring-internal-api/src/eth/EthKeyring.ts index 2e6904a0..9f583deb 100644 --- a/packages/keyring-internal-api/src/eth/EthKeyring.ts +++ b/packages/keyring-internal-api/src/eth/EthKeyring.ts @@ -1,12 +1,11 @@ -import type { KeyringExecutionContext } from '@metamask/keyring-api'; -import type { Json, Keyring } from '@metamask/utils'; - import type { + KeyringExecutionContext, EthBaseTransaction, EthBaseUserOperation, EthUserOperation, EthUserOperationPatch, -} from '.'; +} from '@metamask/keyring-api'; +import type { Json, Keyring } from '@metamask/utils'; export type EthKeyring = Keyring & { /** diff --git a/packages/keyring-internal-api/src/eth/index.ts b/packages/keyring-internal-api/src/eth/index.ts index 33d4cf85..ab70630a 100644 --- a/packages/keyring-internal-api/src/eth/index.ts +++ b/packages/keyring-internal-api/src/eth/index.ts @@ -1,4 +1 @@ -export * from './erc4337'; -export * from './types'; -export * from './utils'; export type * from './EthKeyring'; diff --git a/packages/keyring-internal-api/src/index.ts b/packages/keyring-internal-api/src/index.ts index 26ec5307..49f1e291 100644 --- a/packages/keyring-internal-api/src/index.ts +++ b/packages/keyring-internal-api/src/index.ts @@ -1,7 +1,3 @@ -export * from './btc'; -export * from './eth'; -export * from './sol'; +export type * from './eth'; export * from './api'; -export * from './events'; -export * from './rpc'; export * from './types'; diff --git a/packages/keyring-internal-api/src/types.ts b/packages/keyring-internal-api/src/types.ts index 8ff0802c..b4d959ae 100644 --- a/packages/keyring-internal-api/src/types.ts +++ b/packages/keyring-internal-api/src/types.ts @@ -8,15 +8,15 @@ import { EthAccountType, KeyringAccountStruct, SolAccountType, + BtcP2wpkhAccountStruct, + EthEoaAccountStruct, + EthErc4337AccountStruct, + SolDataAccountStruct, } from '@metamask/keyring-api'; import { exactOptional, object } from '@metamask/keyring-utils'; import type { Infer, Struct } from '@metamask/superstruct'; import { boolean, string, number } from '@metamask/superstruct'; -import { BtcP2wpkhAccountStruct } from './btc/types'; -import { EthEoaAccountStruct, EthErc4337AccountStruct } from './eth/types'; -import { SolDataAccountStruct } from './sol/types'; - export type InternalAccountType = | EthAccountType | BtcAccountType diff --git a/packages/keyring-snap-bridge/src/SnapKeyring.ts b/packages/keyring-snap-bridge/src/SnapKeyring.ts index 2f0b0fc1..699960b3 100644 --- a/packages/keyring-snap-bridge/src/SnapKeyring.ts +++ b/packages/keyring-snap-bridge/src/SnapKeyring.ts @@ -6,19 +6,6 @@ import type { TypedTransaction } from '@ethereumjs/tx'; import { TransactionFactory } from '@ethereumjs/tx'; import type { TypedDataV1, TypedMessage } from '@metamask/eth-sig-util'; import { SignTypedDataVersion } from '@metamask/eth-sig-util'; -import type { - KeyringAccount, - KeyringExecutionContext, - KeyringResponse, -} from '@metamask/keyring-api'; -import type { - BtcMethod, - EthBaseTransaction, - EthBaseUserOperation, - EthUserOperation, - EthUserOperationPatch, - InternalAccount, -} from '@metamask/keyring-internal-api'; import { AccountCreatedEventStruct, AccountDeletedEventStruct, @@ -31,7 +18,18 @@ import { KeyringEvent, RequestApprovedEventStruct, RequestRejectedEventStruct, -} from '@metamask/keyring-internal-api'; +} from '@metamask/keyring-api'; +import type { + KeyringAccount, + KeyringExecutionContext, + KeyringResponse, + BtcMethod, + EthBaseTransaction, + EthBaseUserOperation, + EthUserOperation, + EthUserOperationPatch, +} from '@metamask/keyring-api'; +import type { InternalAccount } from '@metamask/keyring-internal-api'; import { KeyringSnapControllerClient } from '@metamask/keyring-snap-client'; import type { SnapController } from '@metamask/snaps-controllers'; import type { SnapId } from '@metamask/snaps-sdk'; diff --git a/packages/keyring-snap-client/src/KeyringClient.ts b/packages/keyring-snap-client/src/KeyringClient.ts index 900d5bd1..6c26875b 100644 --- a/packages/keyring-snap-client/src/KeyringClient.ts +++ b/packages/keyring-snap-client/src/KeyringClient.ts @@ -7,6 +7,7 @@ import type { CaipAssetType, Balance, } from '@metamask/keyring-api'; +import { KeyringRpcMethod } from '@metamask/keyring-api'; import { ApproveRequestResponseStruct, CreateAccountResponseStruct, @@ -21,7 +22,6 @@ import { RejectRequestResponseStruct, SubmitRequestResponseStruct, UpdateAccountResponseStruct, - KeyringRpcMethod, } from '@metamask/keyring-internal-api'; import type { JsonRpcRequest } from '@metamask/keyring-snap-sdk'; import { strictMask } from '@metamask/keyring-utils'; diff --git a/packages/keyring-snap-sdk/src/events.ts b/packages/keyring-snap-sdk/src/events.ts deleted file mode 100644 index 63d915ca..00000000 --- a/packages/keyring-snap-sdk/src/events.ts +++ /dev/null @@ -1 +0,0 @@ -export { KeyringEvent } from '@metamask/keyring-internal-api'; diff --git a/packages/keyring-snap-sdk/src/index.ts b/packages/keyring-snap-sdk/src/index.ts index cacb3038..6bccead9 100644 --- a/packages/keyring-snap-sdk/src/index.ts +++ b/packages/keyring-snap-sdk/src/index.ts @@ -1,4 +1,3 @@ export * from './JsonRpcRequest'; -export * from './events'; export * from './rpc-handler'; export * from './snap-utils'; diff --git a/packages/keyring-snap-sdk/src/rpc-handler.ts b/packages/keyring-snap-sdk/src/rpc-handler.ts index ba577da6..7ede6cfe 100644 --- a/packages/keyring-snap-sdk/src/rpc-handler.ts +++ b/packages/keyring-snap-sdk/src/rpc-handler.ts @@ -1,4 +1,5 @@ import type { Keyring } from '@metamask/keyring-api'; +import { KeyringRpcMethod } from '@metamask/keyring-api'; import { GetAccountRequestStruct, CreateAccountRequestStruct, @@ -13,7 +14,6 @@ import { ListAccountsRequestStruct, ListRequestsRequestStruct, GetAccountBalancesRequestStruct, - KeyringRpcMethod, } from '@metamask/keyring-internal-api'; import { assert } from '@metamask/superstruct'; import type { Json } from '@metamask/utils'; diff --git a/packages/keyring-snap-sdk/src/snap-utils.ts b/packages/keyring-snap-sdk/src/snap-utils.ts index c77d0cc9..58734668 100644 --- a/packages/keyring-snap-sdk/src/snap-utils.ts +++ b/packages/keyring-snap-sdk/src/snap-utils.ts @@ -1,8 +1,7 @@ +import type { KeyringEvent } from '@metamask/keyring-api'; import type { SnapsProvider } from '@metamask/snaps-sdk'; import type { Json } from '@metamask/utils'; -import type { KeyringEvent } from './events'; - /** * Emit a keyring event from a snap. * From 4ebf2ef5acc774ca76b833564db19c6b1cb5ea99 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Fri, 29 Nov 2024 18:11:29 +0100 Subject: [PATCH 30/31] fix: fix imports --- packages/keyring-api/src/events.test.ts | 2 +- packages/keyring-snap-bridge/src/SnapKeyring.test.ts | 12 ++++-------- .../keyring-snap-client/src/KeyringClient.test.ts | 2 +- packages/keyring-snap-sdk/src/rpc-handler.test.ts | 5 +---- packages/keyring-snap-sdk/src/snap-utils.test.ts | 3 ++- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/packages/keyring-api/src/events.test.ts b/packages/keyring-api/src/events.test.ts index f52d79e9..8748aa5a 100644 --- a/packages/keyring-api/src/events.test.ts +++ b/packages/keyring-api/src/events.test.ts @@ -1,5 +1,6 @@ import { is } from '@metamask/superstruct'; +import { EthAccountType } from './api'; import { AccountCreatedEventStruct, AccountDeletedEventStruct, @@ -8,7 +9,6 @@ import { RequestRejectedEventStruct, KeyringEvent, } from './events'; -import { EthAccountType } from '../api'; describe('events', () => { describe('AccountCreatedEventStruct', () => { diff --git a/packages/keyring-snap-bridge/src/SnapKeyring.test.ts b/packages/keyring-snap-bridge/src/SnapKeyring.test.ts index cdd39088..a4552236 100644 --- a/packages/keyring-snap-bridge/src/SnapKeyring.test.ts +++ b/packages/keyring-snap-bridge/src/SnapKeyring.test.ts @@ -3,23 +3,19 @@ import { SignTypedDataVersion } from '@metamask/eth-sig-util'; import type { KeyringAccount, KeyringExecutionContext, + EthBaseUserOperation, + EthUserOperation, + EthUserOperationPatch, } from '@metamask/keyring-api'; import { BtcAccountType, EthAccountType, SolAccountType, -} from '@metamask/keyring-api'; -import type { - EthBaseUserOperation, - EthUserOperation, - EthUserOperationPatch, -} from '@metamask/keyring-internal-api'; -import { BtcMethod, EthMethod, SolMethod, KeyringEvent, -} from '@metamask/keyring-internal-api'; +} from '@metamask/keyring-api'; import type { SnapController } from '@metamask/snaps-controllers'; import type { SnapId } from '@metamask/snaps-sdk'; import { KnownCaipNamespace, toCaipChainId } from '@metamask/utils'; diff --git a/packages/keyring-snap-client/src/KeyringClient.test.ts b/packages/keyring-snap-client/src/KeyringClient.test.ts index e6d8c612..81832a72 100644 --- a/packages/keyring-snap-client/src/KeyringClient.test.ts +++ b/packages/keyring-snap-client/src/KeyringClient.test.ts @@ -3,7 +3,7 @@ import type { KeyringRequest, KeyringResponse, } from '@metamask/keyring-api'; -import { KeyringRpcMethod } from '@metamask/keyring-internal-api'; +import { KeyringRpcMethod } from '@metamask/keyring-api'; import { KeyringClient } from '.'; // Import from `index.ts` to test the public API diff --git a/packages/keyring-snap-sdk/src/rpc-handler.test.ts b/packages/keyring-snap-sdk/src/rpc-handler.test.ts index 1121d373..79bad855 100644 --- a/packages/keyring-snap-sdk/src/rpc-handler.test.ts +++ b/packages/keyring-snap-sdk/src/rpc-handler.test.ts @@ -1,9 +1,6 @@ import type { Keyring } from '@metamask/keyring-api'; +import { KeyringRpcMethod, isKeyringRpcMethod } from '@metamask/keyring-api'; import type { GetAccountBalancesRequest } from '@metamask/keyring-internal-api'; -import { - KeyringRpcMethod, - isKeyringRpcMethod, -} from '@metamask/keyring-internal-api'; import type { JsonRpcRequest } from './JsonRpcRequest'; import { handleKeyringRequest } from './rpc-handler'; diff --git a/packages/keyring-snap-sdk/src/snap-utils.test.ts b/packages/keyring-snap-sdk/src/snap-utils.test.ts index cd7694fb..77814d09 100644 --- a/packages/keyring-snap-sdk/src/snap-utils.test.ts +++ b/packages/keyring-snap-sdk/src/snap-utils.test.ts @@ -1,4 +1,5 @@ -import { KeyringEvent } from './events'; +import { KeyringEvent } from '@metamask/keyring-api'; + import { emitSnapKeyringEvent } from './snap-utils'; describe('emitSnapKeyringEvent', () => { From b250745184ba4b928cc895bda033e21cd8e0a99b Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Fri, 29 Nov 2024 18:22:20 +0100 Subject: [PATCH 31/31] refactor: exclude sub-folders index.ts from coverage --- jest.config.packages.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jest.config.packages.js b/jest.config.packages.js index 402cd2e0..39c0a3f1 100644 --- a/jest.config.packages.js +++ b/jest.config.packages.js @@ -22,7 +22,13 @@ module.exports = { collectCoverage: true, // An array of glob patterns indicating a set of files for which coverage information should be collected - collectCoverageFrom: ['./src/**/*.ts', '!./src/**/*.test-d.ts'], + collectCoverageFrom: [ + './src/**/*.ts', + // Ignore typing test files + '!./src/**/*.test-d.ts', + // Ignore index of subdirectories + '!./src/**/*/index.ts', + ], // The directory where Jest should output its coverage files coverageDirectory: 'coverage',