From 05b900adf8661006171241b758fe8f2047a0a7a1 Mon Sep 17 00:00:00 2001 From: legobeat <109787230+legobeat@users.noreply.github.com> Date: Tue, 26 Sep 2023 18:47:31 +0000 Subject: [PATCH] Revert Typescript migration (#90) (#101) This reverts commit f2a6d077722ac1e1e455b51eacfab954776b27c4 --- .eslintrc.js | 31 +- .gitignore | 4 +- index.js | 312 ++++++++++++ jest.config.js | 11 +- package.json | 16 +- src/HDKeyring.ts | 460 ------------------ src/errors.ts | 16 - src/index.ts | 1 - src/HDKeyring.test.ts => test/index.js | 256 +++++----- tsconfig.build.json | 13 - tsconfig.json | 16 - yarn.lock | 635 +------------------------ 12 files changed, 458 insertions(+), 1313 deletions(-) create mode 100644 index.js delete mode 100644 src/HDKeyring.ts delete mode 100644 src/errors.ts delete mode 100644 src/index.ts rename src/HDKeyring.test.ts => test/index.js (80%) delete mode 100644 tsconfig.build.json delete mode 100644 tsconfig.json diff --git a/.eslintrc.js b/.eslintrc.js index dc7fd43..5141010 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,36 +1,17 @@ module.exports = { root: true, - extends: ['@metamask/eslint-config'], + extends: ['@metamask/eslint-config', '@metamask/eslint-config-nodejs'], overrides: [ { - files: ['*.ts'], - extends: ['@metamask/eslint-config-typescript'], - }, - - { - files: ['*.js'], - parserOptions: { - sourceType: 'script', + files: ['test/**/*.js'], + extends: ['@metamask/eslint-config-jest'], + rules: { + 'node/no-unpublished-require': 0, }, - extends: ['@metamask/eslint-config-nodejs'], - }, - - { - files: ['*.test.ts', '*.test.js'], - extends: [ - '@metamask/eslint-config-jest', - '@metamask/eslint-config-nodejs', - ], }, ], - ignorePatterns: [ - '!.eslintrc.js', - '!.prettierrc.js', - 'dist/', - 'docs/', - '.yarn/', - ], + ignorePatterns: ['!.eslintrc.js', '!.prettierrc.js'], }; diff --git a/.gitignore b/.gitignore index 6317c40..26e0a18 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,4 @@ package-lock.json !.yarn/plugins !.yarn/releases !.yarn/sdks -!.yarn/versions - -dist/ \ No newline at end of file +!.yarn/versions \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..ac15394 --- /dev/null +++ b/index.js @@ -0,0 +1,312 @@ +const { HDKey } = require('ethereum-cryptography/hdkey'); +const { keccak256 } = require('ethereum-cryptography/keccak'); +const { bytesToHex } = require('ethereum-cryptography/utils'); +const { + privateToPublic, + publicToAddress, + ecsign, + arrToBufArr, + bufferToHex, +} = require('@ethereumjs/util'); +const bip39 = require('@metamask/scure-bip39'); +const { wordlist } = require('@metamask/scure-bip39/dist/wordlists/english'); +const { + concatSig, + decrypt, + getEncryptionPublicKey, + normalize, + personalSign, + signTypedData, + SignTypedDataVersion, +} = require('@metamask/eth-sig-util'); +const { assertIsHexString, remove0x } = require('@metamask/utils'); + +// Options: +const hdPathString = `m/44'/60'/0'/0`; +const type = 'HD Key Tree'; + +class HdKeyring { + /* PUBLIC METHODS */ + constructor(opts = {}) { + this.type = type; + this._wallets = []; + this.deserialize(opts); + } + + generateRandomMnemonic() { + this._initFromMnemonic(bip39.generateMnemonic(wordlist)); + } + + _uint8ArrayToString(mnemonic) { + const recoveredIndices = Array.from( + new Uint16Array(new Uint8Array(mnemonic).buffer), + ); + return recoveredIndices.map((i) => wordlist[i]).join(' '); + } + + _stringToUint8Array(mnemonic) { + const indices = mnemonic.split(' ').map((word) => wordlist.indexOf(word)); + return new Uint8Array(new Uint16Array(indices).buffer); + } + + _mnemonicToUint8Array(mnemonic) { + let mnemonicData = mnemonic; + // when encrypted/decrypted, buffers get cast into js object with a property type set to buffer + if (mnemonic && mnemonic.type && mnemonic.type === 'Buffer') { + mnemonicData = mnemonic.data; + } + + if ( + // this block is for backwards compatibility with vaults that were previously stored as buffers, number arrays or plain text strings + typeof mnemonicData === 'string' || + Buffer.isBuffer(mnemonicData) || + Array.isArray(mnemonicData) + ) { + let mnemonicAsString = mnemonicData; + if (Array.isArray(mnemonicData)) { + mnemonicAsString = Buffer.from(mnemonicData).toString(); + } else if (Buffer.isBuffer(mnemonicData)) { + mnemonicAsString = mnemonicData.toString(); + } + return this._stringToUint8Array(mnemonicAsString); + } else if ( + mnemonicData instanceof Object && + !(mnemonicData instanceof Uint8Array) + ) { + // when encrypted/decrypted the Uint8Array becomes a js object we need to cast back to a Uint8Array + return Uint8Array.from(Object.values(mnemonicData)); + } + return mnemonicData; + } + + serialize() { + const mnemonicAsString = this._uint8ArrayToString(this.mnemonic); + const uint8ArrayMnemonic = new TextEncoder('utf-8').encode( + mnemonicAsString, + ); + + return Promise.resolve({ + mnemonic: Array.from(uint8ArrayMnemonic), + numberOfAccounts: this._wallets.length, + hdPath: this.hdPath, + }); + } + + deserialize(opts = {}) { + if (opts.numberOfAccounts && !opts.mnemonic) { + throw new Error( + 'Eth-Hd-Keyring: Deserialize method cannot be called with an opts value for numberOfAccounts and no menmonic', + ); + } + + if (this.root) { + throw new Error( + 'Eth-Hd-Keyring: Secret recovery phrase already provided', + ); + } + this.opts = opts; + this._wallets = []; + this.mnemonic = null; + this.root = null; + this.hdPath = opts.hdPath || hdPathString; + + if (opts.mnemonic) { + this._initFromMnemonic(opts.mnemonic); + } + + if (opts.numberOfAccounts) { + return this.addAccounts(opts.numberOfAccounts); + } + + return Promise.resolve([]); + } + + addAccounts(numberOfAccounts = 1) { + if (!this.root) { + throw new Error('Eth-Hd-Keyring: No secret recovery phrase provided'); + } + + const oldLen = this._wallets.length; + const newWallets = []; + for (let i = oldLen; i < numberOfAccounts + oldLen; i++) { + const wallet = this.root.deriveChild(i); + newWallets.push(wallet); + this._wallets.push(wallet); + } + const hexWallets = newWallets.map((w) => { + return this._addressfromPublicKey(w.publicKey); + }); + return Promise.resolve(hexWallets); + } + + getAccounts() { + return this._wallets.map((w) => this._addressfromPublicKey(w.publicKey)); + } + + /* BASE KEYRING METHODS */ + + // returns an address specific to an app + async getAppKeyAddress(address, origin) { + if (!origin || typeof origin !== 'string') { + throw new Error(`'origin' must be a non-empty string`); + } + const wallet = this._getWalletForAccount(address, { + withAppKeyOrigin: origin, + }); + const appKeyAddress = normalize( + publicToAddress(wallet.publicKey).toString('hex'), + ); + + return appKeyAddress; + } + + // exportAccount should return a hex-encoded private key: + async exportAccount(address, opts = {}) { + const wallet = this._getWalletForAccount(address, opts); + return bytesToHex(wallet.privateKey); + } + + // tx is an instance of the ethereumjs-transaction class. + async signTransaction(address, tx, opts = {}) { + const privKey = this._getPrivateKeyFor(address, opts); + const signedTx = tx.sign(privKey); + // Newer versions of Ethereumjs-tx are immutable and return a new tx object + return signedTx === undefined ? tx : signedTx; + } + + // For eth_sign, we need to sign arbitrary data: + async signMessage(address, data, opts = {}) { + assertIsHexString(data); + const message = remove0x(data); + const privKey = this._getPrivateKeyFor(address, opts); + const msgSig = ecsign(Buffer.from(message, 'hex'), privKey); + const rawMsgSig = concatSig(msgSig.v, msgSig.r, msgSig.s); + return rawMsgSig; + } + + // For personal_sign, we need to prefix the message: + async signPersonalMessage(address, msgHex, opts = {}) { + const privKey = this._getPrivateKeyFor(address, opts); + const privateKey = Buffer.from(privKey, 'hex'); + const sig = personalSign({ privateKey, data: msgHex }); + return sig; + } + + // For eth_decryptMessage: + async decryptMessage(withAccount, encryptedData) { + const wallet = this._getWalletForAccount(withAccount); + const { privateKey: privateKeyAsUint8Array } = wallet; + const privateKeyAsHex = Buffer.from(privateKeyAsUint8Array).toString('hex'); + const sig = decrypt({ privateKey: privateKeyAsHex, encryptedData }); + return sig; + } + + // personal_signTypedData, signs data along with the schema + async signTypedData( + withAccount, + typedData, + opts = { version: SignTypedDataVersion.V1 }, + ) { + // Treat invalid versions as "V1" + const version = Object.keys(SignTypedDataVersion).includes(opts.version) + ? opts.version + : SignTypedDataVersion.V1; + + const privateKey = this._getPrivateKeyFor(withAccount, opts); + return signTypedData({ privateKey, data: typedData, version }); + } + + removeAccount(account) { + const address = normalize(account); + if ( + !this._wallets + .map(({ publicKey }) => this._addressfromPublicKey(publicKey)) + .includes(address) + ) { + throw new Error(`Address ${address} not found in this keyring`); + } + + this._wallets = this._wallets.filter( + ({ publicKey }) => this._addressfromPublicKey(publicKey) !== address, + ); + } + + // get public key for nacl + async getEncryptionPublicKey(withAccount, opts = {}) { + const privKey = this._getPrivateKeyFor(withAccount, opts); + const publicKey = getEncryptionPublicKey(privKey); + return publicKey; + } + + _getPrivateKeyFor(address, opts = {}) { + if (!address) { + throw new Error('Must specify address.'); + } + const wallet = this._getWalletForAccount(address, opts); + return wallet.privateKey; + } + + _getWalletForAccount(account, opts = {}) { + const address = normalize(account); + let wallet = this._wallets.find(({ publicKey }) => { + return this._addressfromPublicKey(publicKey) === address; + }); + if (!wallet) { + throw new Error('HD Keyring - Unable to find matching address.'); + } + + if (opts.withAppKeyOrigin) { + const { privateKey } = wallet; + const appKeyOriginBuffer = Buffer.from(opts.withAppKeyOrigin, 'utf8'); + const appKeyBuffer = Buffer.concat([privateKey, appKeyOriginBuffer]); + const appKeyPrivateKey = arrToBufArr(keccak256(appKeyBuffer, 256)); + const appKeyPublicKey = privateToPublic(appKeyPrivateKey); + wallet = { privateKey: appKeyPrivateKey, publicKey: appKeyPublicKey }; + } + + return wallet; + } + + /* PRIVATE / UTILITY METHODS */ + + /** + * Sets appropriate properties for the keyring based on the given + * BIP39-compliant mnemonic. + * + * @param {string|Array|Buffer} mnemonic - A seed phrase represented + * as a string, an array of UTF-8 bytes, or a Buffer. Mnemonic input + * passed as type buffer or array of UTF-8 bytes must be NFKD normalized. + */ + _initFromMnemonic(mnemonic) { + if (this.root) { + throw new Error( + 'Eth-Hd-Keyring: Secret recovery phrase already provided', + ); + } + + this.mnemonic = this._mnemonicToUint8Array(mnemonic); + + // validate before initializing + const isValid = bip39.validateMnemonic(this.mnemonic, wordlist); + if (!isValid) { + throw new Error( + 'Eth-Hd-Keyring: Invalid secret recovery phrase provided', + ); + } + + // eslint-disable-next-line node/no-sync + const seed = bip39.mnemonicToSeedSync(this.mnemonic, wordlist); + this.hdWallet = HDKey.fromMasterSeed(seed); + this.root = this.hdWallet.derive(this.hdPath); + } + + // small helper function to convert publicKey in Uint8Array form to a publicAddress as a hex + _addressfromPublicKey(publicKey) { + return bufferToHex( + publicToAddress(Buffer.from(publicKey), true), + ).toLowerCase(); + } +} + +HdKeyring.type = type; +module.exports = HdKeyring; diff --git a/jest.config.js b/jest.config.js index 18e309c..c44a835 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,10 +3,10 @@ module.exports = { coverageReporters: ['text', 'html'], coverageThreshold: { global: { - branches: 73.91, + branches: 84, functions: 100, - lines: 91.81, - statements: 91.95, + lines: 95, + statements: 95, }, }, moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node'], @@ -18,9 +18,6 @@ module.exports = { // modules. restoreMocks: true, testEnvironment: 'node', - testMatch: ['./**/*.test.ts'], + testMatch: ['**/test/**/*.js'], testTimeout: 2500, - transform: { - '^.+\\.tsx?$': 'ts-jest', - }, }; diff --git a/package.json b/package.json index d6e64ca..c0a6e08 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "author": "Dan Finlay", "main": "index.js", "scripts": { - "build": "tsc --project tsconfig.build.json", "lint": "yarn lint:eslint && yarn lint:misc --check", "lint:eslint": "eslint . --cache --ext js,ts", "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", @@ -26,41 +25,32 @@ "test": "jest" }, "dependencies": { - "@ethereumjs/tx": "^4.2.0", "@ethereumjs/util": "^8.1.0", - "@metamask/bip39": "^4.0.0", "@metamask/eth-sig-util": "^7.0.0", "@metamask/scure-bip39": "^2.1.0", "@metamask/utils": "^8.1.0", "ethereum-cryptography": "^2.1.2" }, "devDependencies": { + "@ethereumjs/tx": "^4.0.1", "@lavamoat/allow-scripts": "^2.3.1", "@lavamoat/preinstall-always-fail": "^1.0.0", "@metamask/auto-changelog": "^2.5.0", + "@metamask/bip39": "^4.0.0", "@metamask/eslint-config": "^8.0.0", "@metamask/eslint-config-jest": "^9.0.0", "@metamask/eslint-config-nodejs": "^8.0.0", - "@metamask/eslint-config-typescript": "^11.1.0", "@metamask/eth-hd-keyring": "4.0.1", "@types/jest": "^29.4.0", - "@types/node": "^18.14.6", - "@typescript-eslint/eslint-plugin": "latest", - "@typescript-eslint/parser": "^5.54.1", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.24.2", "eslint-plugin-jest": "^24.3.6", - "eslint-plugin-jsdoc": "latest", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^3.3.1", "jest": "^29.4.3", "prettier": "^2.4.1", - "prettier-plugin-packagejson": "^2.2.12", - "ts-jest": "^29.0.5", - "ts-node": "^10.9.1", - "typedoc": "^0.23.26", - "typescript": "^4.9.5" + "prettier-plugin-packagejson": "^2.2.12" }, "packageManager": "yarn@3.3.0", "engines": { diff --git a/src/HDKeyring.ts b/src/HDKeyring.ts deleted file mode 100644 index a0fc8c1..0000000 --- a/src/HDKeyring.ts +++ /dev/null @@ -1,460 +0,0 @@ -import { HDKey } from 'ethereum-cryptography/hdkey'; -import { keccak256 } from 'ethereum-cryptography/keccak'; -import { bytesToHex } from 'ethereum-cryptography/utils'; -import { - privateToPublic, - publicToAddress, - ecsign, - arrToBufArr, - bufferToHex, - ECDSASignature, -} from '@ethereumjs/util'; - -import { wordlist } from '@metamask/scure-bip39/dist/wordlists/english'; -import { - concatSig, - decrypt, - getEncryptionPublicKey, - normalize, - personalSign, - signTypedData, - SignTypedDataVersion, - TypedDataV1, - TypedMessage, -} from '@metamask/eth-sig-util'; -import type { Hex, Keyring, Eip1024EncryptedData } from '@metamask/utils'; -import { assertIsHexString, remove0x } from '@metamask/utils'; -import { TxData, TypedTransaction } from '@ethereumjs/tx'; -import { HDKeyringErrors } from './errors'; - -// TODO: Find out why when imported usin ES6, mnemonic changes -// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports -const bip39 = require('@metamask/scure-bip39'); - -type JsCastedBuffer = { - type: string; - data: any; -}; -type KeyringOpt = { - mnemonic?: Buffer | JsCastedBuffer | string | Uint8Array | number[]; - numberOfAccounts?: number; - hdPath?: string; - withAppKeyOrigin?: string; - version?: SignTypedDataVersion; -}; - -type SerializedHdKeyringState = { - mnemonic: number[]; - numberOfAccounts: number; - hdPath: string; -}; - -// Options: -const hdPathString = `m/44'/60'/0'/0`; -const type = 'HD Key Tree'; - -export class HDKeyring implements Keyring { - static type: string = type; - - type: string; - - #wallets: HDKey[] = []; - - root: HDKey | undefined | null; - - mnemonic: Uint8Array | undefined | null; - - hdWallet: HDKey | undefined | null; - - hdPath: string = hdPathString; - - opts: KeyringOpt | undefined | null; - - /* PUBLIC METHODS */ - constructor(opts: KeyringOpt = {}) { - this.type = type; - this.#wallets = []; - // eslint-disable-next-line @typescript-eslint/no-floating-promises, @typescript-eslint/promise-function-async - this.deserialize(opts); - } - - generateRandomMnemonic() { - this.#initFromMnemonic(bip39.generateMnemonic(wordlist)); - } - - #uint8ArrayToString(mnemonic: Uint8Array): string { - const recoveredIndices = Array.from( - new Uint16Array(new Uint8Array(mnemonic).buffer), - ); - return recoveredIndices.map((i) => wordlist[i]).join(' '); - } - - #stringToUint8Array(mnemonic: string): Uint8Array { - const indices = mnemonic.split(' ').map((word) => wordlist.indexOf(word)); - return new Uint8Array(new Uint16Array(indices).buffer); - } - - #mnemonicToUint8Array( - mnemonic: Buffer | JsCastedBuffer | string | Uint8Array | number[], - ): Uint8Array { - let mnemonicData = mnemonic; - // when encrypted/decrypted, buffers get cast into js object with a property type set to buffer - if ( - mnemonic && - typeof mnemonic !== 'string' && - !ArrayBuffer.isView(mnemonic) && - !Array.isArray(mnemonic) && - !Buffer.isBuffer(mnemonic) && - mnemonic.type === 'Buffer' - ) { - mnemonicData = mnemonic.data; - } - - if ( - // this block is for backwards compatibility with vaults that were previously stored as buffers, number arrays or plain text strings - typeof mnemonicData === 'string' || - Buffer.isBuffer(mnemonicData) || - Array.isArray(mnemonicData) - ) { - let mnemonicAsString; - if (Array.isArray(mnemonicData)) { - mnemonicAsString = Buffer.from(mnemonicData).toString(); - } else if (Buffer.isBuffer(mnemonicData)) { - mnemonicAsString = mnemonicData.toString(); - } else { - mnemonicAsString = mnemonicData; - } - return this.#stringToUint8Array(mnemonicAsString); - } else if ( - mnemonicData instanceof Object && - !(mnemonicData instanceof Uint8Array) - ) { - // when encrypted/decrypted the Uint8Array becomes a js object we need to cast back to a Uint8Array - return Uint8Array.from(Object.values(mnemonicData)); - } - return mnemonicData; - } - - async serialize(): Promise { - if (!this.mnemonic) { - throw new Error(HDKeyringErrors.MissingMnemonic); - } - - const mnemonicAsString = this.#uint8ArrayToString(this.mnemonic); - const uint8ArrayMnemonic = new TextEncoder().encode(mnemonicAsString); - - return Promise.resolve({ - mnemonic: Array.from(uint8ArrayMnemonic), - numberOfAccounts: this.#wallets.length, - hdPath: this.hdPath, - }); - } - - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore return type is void - // eslint-disable-next-line @typescript-eslint/promise-function-async - deserialize(state: KeyringOpt = {}) { - if (state.numberOfAccounts && !state.mnemonic) { - throw new Error( - HDKeyringErrors.DeserializeErrorNumberOfAccountWithMissingMnemonic, - ); - } - - if (this.root) { - throw new Error(HDKeyringErrors.SRPAlreadyProvided); - } - this.opts = state; - this.#wallets = []; - this.mnemonic = null; - this.root = null; - this.hdPath = state.hdPath ?? hdPathString; - - if (state.mnemonic) { - this.#initFromMnemonic(state.mnemonic); - } - - if (state.numberOfAccounts) { - return this.addAccounts(state.numberOfAccounts); - } - - return Promise.resolve([]); - } - - async addAccounts(numberOfAccounts = 1): Promise { - if (!this.root) { - throw new Error(HDKeyringErrors.NoSRPProvided); - } - - const oldLen = this.#wallets.length; - const newWallets: HDKey[] = []; - for (let i = oldLen; i < numberOfAccounts + oldLen; i++) { - const wallet = this.root.deriveChild(i); - newWallets.push(wallet); - this.#wallets.push(wallet); - } - - const hexWallets: Hex[] = newWallets.map((w) => { - if (!w.publicKey) { - throw new Error(HDKeyringErrors.MissingPublicKey); - } - // HDKey's method publicKey can return null - return this.#addressfromPublicKey(w.publicKey); - }); - return Promise.resolve(hexWallets); - } - - async getAccounts(): Promise { - return Promise.resolve( - this.#wallets.map((w) => { - if (!w.publicKey) { - throw new Error(HDKeyringErrors.MissingPublicKey); - } - return this.#addressfromPublicKey(w.publicKey); - }), - ); - } - - /* BASE KEYRING METHODS */ - - // returns an address specific to an app - async getAppKeyAddress(address: Hex, origin: string): Promise { - if (!origin || typeof origin !== 'string') { - throw new Error(HDKeyringErrors.OriginNotEmpty); - } - const wallet = this.#getWalletForAccount(address, { - withAppKeyOrigin: origin, - }); - - if (!wallet.publicKey) { - throw new Error(HDKeyringErrors.MissingPublicKey); - } - // normalize will prefix the address with 0x - const appKeyAddress = normalize( - publicToAddress(Buffer.from(wallet.publicKey)).toString('hex'), - ) as Hex; - - return appKeyAddress; - } - - // exportAccount should return a hex-encoded private key: - async exportAccount(address: Hex, opts: KeyringOpt = {}): Promise { - const wallet = this.#getWalletForAccount(address, opts); - if (!wallet.privateKey) { - throw new Error(HDKeyringErrors.MissingPrivateKey); - } - return bytesToHex(wallet.privateKey); - } - - // tx is an instance of the ethereumjs-transaction class. - async signTransaction( - address: Hex, - transaction: TypedTransaction, - options: KeyringOpt = {}, - ): Promise { - const privKey = this.#getPrivateKeyFor(address, options); - const signedTx = transaction.sign(Buffer.from(privKey)); - - // Newer versions of Ethereumjs-tx are immutable and return a new tx object - return signedTx === undefined ? transaction : signedTx; - } - - // For eth_sign, we need to sign arbitrary data: - async signMessage( - address: Hex, - data: string, - opts: KeyringOpt = {}, - ): Promise { - assertIsHexString(data); - const message: string = remove0x(data); - const privKey: Uint8Array = this.#getPrivateKeyFor(address, opts); - const msgSig: ECDSASignature = ecsign( - Buffer.from(message, 'hex'), - Buffer.from(privKey), - ); - const rawMsgSig: string = concatSig( - msgSig.v as unknown as Buffer, - msgSig.r, - msgSig.s, - ); - return rawMsgSig; - } - - // For personal_sign, we need to prefix the message: - async signPersonalMessage( - address: Hex, - message: Hex, - options: Record = {}, - ): Promise { - const privKey: Uint8Array = this.#getPrivateKeyFor(address, options); - const privateKey = Buffer.from(privKey); - const sig = personalSign({ privateKey, data: message as string }); - return sig; - } - - // For eth_decryptMessage: - async decryptMessage( - withAccount: Hex, - encryptedData: Eip1024EncryptedData, - ): Promise { - const wallet = this.#getWalletForAccount(withAccount); - const { privateKey: privateKeyAsUint8Array } = wallet; - if (!privateKeyAsUint8Array) { - throw new Error(HDKeyringErrors.MissingPrivateKey); - } - const privateKeyAsHex = Buffer.from(privateKeyAsUint8Array).toString('hex'); - const sig = decrypt({ privateKey: privateKeyAsHex, encryptedData }); - return sig; - } - - // personal_signTypedData, signs data along with the schema - async signTypedData( - withAccount: Hex, - typedData: Record | TypedDataV1 | TypedMessage, - opts: KeyringOpt = { version: SignTypedDataVersion.V1 }, - ): Promise { - let version: SignTypedDataVersion; - if ( - opts.version && - Object.keys(SignTypedDataVersion).includes(opts.version as string) - ) { - version = opts.version; - } else { - // Treat invalid versions as "V1" - version = SignTypedDataVersion.V1; - } - - const privateKey: Uint8Array = this.#getPrivateKeyFor(withAccount, opts); - return signTypedData({ - privateKey: Buffer.from(privateKey), - data: typedData as unknown as TypedDataV1 | TypedMessage, - version, - }); - } - - removeAccount(account: Hex): void { - const address = account; - if ( - !this.#wallets - .map(({ publicKey }) => { - if (!publicKey) { - throw new Error(HDKeyringErrors.MissingPublicKey); - } - return this.#addressfromPublicKey(publicKey); - }) - .includes(address) - ) { - throw new Error( - HDKeyringErrors.AddressNotFound.replace('$address', address), - ); - } - - this.#wallets = this.#wallets.filter(({ publicKey }) => { - if (!publicKey) { - // should never be here - throw new Error(HDKeyringErrors.MissingPublicKey); - } - return this.#addressfromPublicKey(publicKey) !== address; - }); - } - - // get public key for nacl - async getEncryptionPublicKey( - withAccount: Hex, - opts: KeyringOpt = {}, - ): Promise { - const privKey = this.#getPrivateKeyFor(withAccount, opts); - const publicKey = getEncryptionPublicKey( - Buffer.from(privKey).toString('hex'), - ); - return publicKey; - } - - #getPrivateKeyFor(address: Hex, opts: KeyringOpt = {}): Uint8Array { - if (!address) { - throw new Error(HDKeyringErrors.AddressNotProvided); - } - const wallet = this.#getWalletForAccount(address, opts); - if (!wallet.privateKey) { - throw new Error(HDKeyringErrors.MissingPrivateKey); - } - return wallet.privateKey; - } - - #getWalletForAccount(address: string, opts: KeyringOpt = {}): HDKey { - const normalizedAddress = normalize(address); - let wallet = this.#wallets.find(({ publicKey }) => { - if (!publicKey) { - throw new Error(HDKeyringErrors.MissingPublicKey); - } - // If a wallet is found, public key will not be null - return this.#addressfromPublicKey(publicKey) === normalizedAddress; - }); - - if (opts.withAppKeyOrigin) { - if (!wallet) { - throw new Error(HDKeyringErrors.NoMatchingAddress); - } - const { privateKey } = wallet; - if (!privateKey) { - throw new Error(HDKeyringErrors.MissingPrivateKey); - } - const appKeyOriginBuffer = Buffer.from(opts.withAppKeyOrigin, 'utf8'); - const appKeyBuffer = Buffer.concat([privateKey, appKeyOriginBuffer]); - const appKeyPrivateKey = arrToBufArr(keccak256(appKeyBuffer)); - const appKeyPublicKey = privateToPublic(appKeyPrivateKey); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore special case for appKey - wallet = { privateKey: appKeyPrivateKey, publicKey: appKeyPublicKey }; - } - - if (!wallet) { - throw new Error(HDKeyringErrors.NoMatchingAddress); - } - - return wallet; - } - - /* PRIVATE / UTILITY METHODS */ - - /** - * Sets appropriate properties for the keyring based on the given - * BIP39-compliant mnemonic. - * - * @param mnemonic - A seed phrase represented - * as a string, an array of UTF-8 bytes, or a Buffer. Mnemonic input - * passed as type buffer or array of UTF-8 bytes must be NFKD normalized. - */ - #initFromMnemonic( - mnemonic: string | number[] | Buffer | Uint8Array | JsCastedBuffer, - ): void { - if (this.root) { - throw new Error(HDKeyringErrors.SRPAlreadyProvided); - } - - this.mnemonic = this.#mnemonicToUint8Array(mnemonic); - - // validate before initializing - const isValid = bip39.validateMnemonic(this.mnemonic, wordlist); - if (!isValid) { - throw new Error(HDKeyringErrors.InvalidSRP); - } - - // eslint-disable-next-line node/no-sync - const seed = bip39.mnemonicToSeedSync(this.mnemonic, wordlist); - this.hdWallet = HDKey.fromMasterSeed(seed); - if (!this.hdPath) { - throw new Error(HDKeyringErrors.MissingHdPath); - } - this.root = this.hdWallet.derive(this.hdPath); - } - - // small helper function to convert publicKey in Uint8Array form to a publicAddress as a hex - #addressfromPublicKey(publicKey: Uint8Array): Hex { - // bufferToHex adds a 0x prefix - const address = bufferToHex( - publicToAddress(Buffer.from(publicKey), true), - ).toLowerCase() as Hex; - - return address; - } -} diff --git a/src/errors.ts b/src/errors.ts deleted file mode 100644 index 3bdb269..0000000 --- a/src/errors.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* eslint-disable no-shadow */ -/* eslint-disable no-unused-vars */ -export enum HDKeyringErrors { - MissingMnemonic = 'Eth-Hd-Keyring: Missing mnemonic when serializing', - DeserializeErrorNumberOfAccountWithMissingMnemonic = 'Eth-Hd-Keyring: Deserialize method cannot be called with an opts value for numberOfAccounts and no menmonic', - NoSRPProvided = 'Eth-Hd-Keyring: No secret recovery phrase provided', - OriginNotEmpty = `Eth-Hd-Keyring: 'origin' must be a non-empty string`, - AddressNotFound = 'Eth-Hd-Keyring: Address $address not found in this keyring', - AddressNotProvided = 'Eth-Hd-Keyring: Must specify address.', - NoMatchingAddress = 'Eth-Hd-Keyring: Unable to find matching address.', - InvalidSRP = 'Eth-Hd-Keyring: Invalid secret recovery phrase provided', - SRPAlreadyProvided = 'Eth-Hd-Keyring: Secret recovery phrase already provided', - MissingHdPath = 'Eth-Hd-Keyring: Missing hd path', - MissingPrivateKey = 'Eth-Hd-Keyring: Missing private key in wallet', - MissingPublicKey = 'Eth-Hd-Keyring: Missing public key in wallet', -} diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index dd01524..0000000 --- a/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { HDKeyring } from './HDKeyring'; diff --git a/src/HDKeyring.test.ts b/test/index.js similarity index 80% rename from src/HDKeyring.test.ts rename to test/index.js index 7483ce5..465e598 100644 --- a/src/HDKeyring.test.ts +++ b/test/index.js @@ -1,4 +1,4 @@ -import { +const { normalize, personalSign, recoverPersonalSignature, @@ -6,27 +6,24 @@ import { signTypedData, SignTypedDataVersion, encrypt, - EthEncryptedData, -} from '@metamask/eth-sig-util'; -import { wordlist } from '@metamask/scure-bip39/dist/wordlists/english'; -import { generateMnemonic as oldMMForkBIP39GenerateMnemonic } from '@metamask/bip39'; -import { +} = require('@metamask/eth-sig-util'); +const { wordlist } = require('@metamask/scure-bip39/dist/wordlists/english'); +const oldMMForkBIP39 = require('@metamask/bip39'); +const { isValidAddress, bufferToHex, toBuffer, ecrecover, pubToAddress, -} from '@ethereumjs/util'; -import { TransactionFactory, Transaction as EthereumTx } from '@ethereumjs/tx'; -import { keccak256 } from 'ethereum-cryptography/keccak'; -import { Eip1024EncryptedData, Hex, add0x, assert } from '@metamask/utils'; - -// we do not want to add this to dependency -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore - TS7016: Could not find a declaration file for module -// eslint-disable-next-line node/no-unpublished-import -import OldHDKeyring from '@metamask/eth-hd-keyring'; -import { HDKeyring } from './HDKeyring'; +} = require('@ethereumjs/util'); +const { + TransactionFactory, + Transaction: EthereumTx, +} = require('@ethereumjs/tx'); + +const OldHdKeyring = require('@metamask/eth-hd-keyring'); +const { keccak256 } = require('ethereum-cryptography/keccak'); +const HdKeyring = require('..'); // Sample account: const privKeyHex = @@ -42,23 +39,25 @@ const notKeyringAddress = '0xbD20F6F5F1616947a39E11926E78ec94817B3931'; describe('hd-keyring', () => { describe('compare old bip39 implementation with new', () => { it('should derive the same accounts from the same mnemonics', async () => { - const mnemonics: Buffer[] = []; + const mnemonics = []; for (let i = 0; i < 99; i++) { - mnemonics.push(oldMMForkBIP39GenerateMnemonic()); + mnemonics.push(oldMMForkBIP39.generateMnemonic()); } await Promise.all( mnemonics.map(async (mnemonic) => { - const newHDKeyring = new HDKeyring({ mnemonic, numberOfAccounts: 3 }); - const oldHDKeyring = new OldHDKeyring({ + const newHDKeyring = new HdKeyring({ mnemonic, numberOfAccounts: 3 }); + const oldHDKeyring = new OldHdKeyring({ mnemonic, numberOfAccounts: 3, }); const newAccounts = await newHDKeyring.getAccounts(); const oldAccounts = await oldHDKeyring.getAccounts(); - expect(newAccounts[0]).toStrictEqual(oldAccounts[0]); - expect(newAccounts[1]).toStrictEqual(oldAccounts[1]); - expect(newAccounts[2]).toStrictEqual(oldAccounts[2]); + await expect(newAccounts[0]).toStrictEqual(oldAccounts[0]); + + await expect(newAccounts[1]).toStrictEqual(oldAccounts[1]); + + await expect(newAccounts[2]).toStrictEqual(oldAccounts[2]); }), ); }); @@ -66,7 +65,7 @@ describe('hd-keyring', () => { describe('constructor', () => { it('constructs with a typeof string mnemonic', async () => { - const keyring = new HDKeyring({ + const keyring = new HdKeyring({ mnemonic: sampleMnemonic, numberOfAccounts: 2, }); @@ -77,7 +76,7 @@ describe('hd-keyring', () => { }); it('constructs with a typeof buffer mnemonic', async () => { - const keyring = new HDKeyring({ + const keyring = new HdKeyring({ mnemonic: Buffer.from(sampleMnemonic, 'utf8'), numberOfAccounts: 2, }); @@ -94,7 +93,7 @@ describe('hd-keyring', () => { const uInt8ArrayOfMnemonic = new Uint8Array( new Uint16Array(indices).buffer, ); - const keyring = new HDKeyring({ + const keyring = new HdKeyring({ mnemonic: uInt8ArrayOfMnemonic, numberOfAccounts: 2, }); @@ -104,35 +103,23 @@ describe('hd-keyring', () => { expect(accounts[1]).toStrictEqual(secondAcct); }); - it('constructs with jscasted buffer', async () => { - const jscastedBuffer = Buffer.from(sampleMnemonic).toJSON(); - const keyring = new HDKeyring({ - mnemonic: jscastedBuffer, - numberOfAccounts: 2, - }); - - const accounts = await keyring.getAccounts(); - expect(accounts[0]).toStrictEqual(firstAcct); - expect(accounts[1]).toStrictEqual(secondAcct); - }); - it('throws on invalid mnemonic', () => { expect( () => - new HDKeyring({ + new HdKeyring({ mnemonic: 'abc xyz', numberOfAccounts: 2, }), ).toThrow('Eth-Hd-Keyring: Invalid secret recovery phrase provided'); }); - it('throws when numberOfAccounts is passed with no mnemonic', async () => { - expect(() => { - // eslint-disable-next-line no-new - new HDKeyring({ - numberOfAccounts: 1, - }); - }).toThrow( + it('throws when numberOfAccounts is passed with no mnemonic', () => { + expect( + () => + new HdKeyring({ + numberOfAccounts: 2, + }), + ).toThrow( 'Eth-Hd-Keyring: Deserialize method cannot be called with an opts value for numberOfAccounts and no menmonic', ); }); @@ -142,7 +129,7 @@ describe('hd-keyring', () => { const alreadyProvidedError = 'Eth-Hd-Keyring: Secret recovery phrase already provided'; it('double generateRandomMnemonic', () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); keyring.generateRandomMnemonic(); expect(() => { keyring.generateRandomMnemonic(); @@ -150,7 +137,7 @@ describe('hd-keyring', () => { }); it('constructor + generateRandomMnemonic', () => { - const keyring = new HDKeyring({ + const keyring = new HdKeyring({ mnemonic: sampleMnemonic, numberOfAccounts: 2, }); @@ -161,13 +148,12 @@ describe('hd-keyring', () => { }); it('constructor + deserialize', () => { - const keyring = new HDKeyring({ + const keyring = new HdKeyring({ mnemonic: sampleMnemonic, numberOfAccounts: 2, }); expect(() => { - // eslint-disable-next-line @typescript-eslint/no-floating-promises keyring.deserialize({ mnemonic: sampleMnemonic, numberOfAccounts: 1, @@ -178,28 +164,28 @@ describe('hd-keyring', () => { describe('Keyring.type', () => { it('is a class property that returns the type string.', () => { - const { type } = HDKeyring; + const { type } = HdKeyring; expect(typeof type).toBe('string'); }); }); describe('#type', () => { it('returns the correct value', () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); const { type } = keyring; - const correct = HDKeyring.type; + const correct = HdKeyring.type; expect(type).toStrictEqual(correct); }); }); describe('#serialize mnemonic.', () => { it('serializes the mnemonic in the same format as previous version (an array of utf8 encoded bytes)', async () => { - const keyring = new HDKeyring({ + const keyring = new HdKeyring({ mnemonic: sampleMnemonic, }); // uses previous version of eth-hd-keyring to ensure backwards compatibility - const oldHDKeyring = new OldHDKeyring({ mnemonic: sampleMnemonic }); + const oldHDKeyring = new OldHdKeyring({ mnemonic: sampleMnemonic }); const { mnemonic: oldKeyringSerializedMnemonic } = await oldHDKeyring.serialize(); @@ -208,7 +194,7 @@ describe('hd-keyring', () => { }); it('serializes mnemonic passed in as a string to an array of utf8 encoded bytes', async () => { - const keyring = new HDKeyring({ + const keyring = new HdKeyring({ mnemonic: sampleMnemonic, }); const output = await keyring.serialize(); @@ -218,9 +204,9 @@ describe('hd-keyring', () => { }); it('serializes mnemonic passed in as a an array of utf8 encoded bytes in the same format', async () => { - const uint8Array = new TextEncoder().encode(sampleMnemonic); + const uint8Array = new TextEncoder('utf-8').encode(sampleMnemonic); const mnemonicAsArrayOfUtf8EncodedBytes = Array.from(uint8Array); - const keyring = new HDKeyring({ + const keyring = new HdKeyring({ mnemonic: mnemonicAsArrayOfUtf8EncodedBytes, }); @@ -229,18 +215,11 @@ describe('hd-keyring', () => { const mnemonicAsString = Buffer.from(output.mnemonic).toString(); expect(mnemonicAsString).toStrictEqual(sampleMnemonic); }); - - it('throws if mnemnoic is not set', async () => { - const keyring = new HDKeyring({}); - await expect(keyring.serialize()).rejects.toThrow( - 'Eth-Hd-Keyring: Missing mnemonic when serializing', - ); - }); }); describe('#deserialize a private key', () => { it('serializes what it deserializes', async () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); await keyring.deserialize({ mnemonic: sampleMnemonic, numberOfAccounts: 1, @@ -263,7 +242,7 @@ describe('hd-keyring', () => { describe('#addAccounts', () => { describe('with no arguments', () => { it('creates a single wallet', async () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); keyring.generateRandomMnemonic(); await keyring.addAccounts(); const accounts = await keyring.getAccounts(); @@ -271,8 +250,8 @@ describe('hd-keyring', () => { }); it('throws an error when no SRP has been generated yet', async () => { - const keyring = new HDKeyring(); - await expect(keyring.addAccounts()).rejects.toThrow( + const keyring = new HdKeyring(); + expect(() => keyring.addAccounts()).toThrow( 'Eth-Hd-Keyring: No secret recovery phrase provided', ); }); @@ -280,7 +259,7 @@ describe('hd-keyring', () => { describe('with a numeric argument', () => { it('creates that number of wallets', async () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); keyring.generateRandomMnemonic(); await keyring.addAccounts(3); const accounts = await keyring.getAccounts(); @@ -291,7 +270,7 @@ describe('hd-keyring', () => { describe('#signPersonalMessage', () => { it('returns the expected value', async () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); const address = firstAcct; const message = '0x68656c6c6f20776f726c64'; @@ -314,7 +293,7 @@ describe('hd-keyring', () => { describe('#signTypedData', () => { it('can recover a basic signature', async () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); Buffer.from(privKeyHex, 'hex'); const typedData = [ { @@ -325,9 +304,8 @@ describe('hd-keyring', () => { ]; keyring.generateRandomMnemonic(); await keyring.addAccounts(1); - const [rawAddress] = await keyring.getAccounts(); - assert(rawAddress, 'addresses is empty'); - const address = add0x(rawAddress); + const addresses = await keyring.getAccounts(); + const address = addresses[0]; const signature = await keyring.signTypedData(address, typedData); const restored = recoverTypedSignature({ data: typedData, @@ -348,12 +326,11 @@ describe('hd-keyring', () => { ]; it('signs in a compliant and recoverable way', async () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); keyring.generateRandomMnemonic(); await keyring.addAccounts(1); - const [rawAddress] = await keyring.getAccounts(); - assert(rawAddress, 'addresses is empty'); - const address = add0x(rawAddress); + const addresses = await keyring.getAccounts(); + const address = addresses[0]; const signature = await keyring.signTypedData(address, typedData, { version: SignTypedDataVersion.V1, }); @@ -368,13 +345,13 @@ describe('hd-keyring', () => { describe('#signTypedData_v3', () => { it('signs in a compliant and recoverable way', async () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); const typedData = { types: { EIP712Domain: [], }, domain: {}, - primaryType: 'EIP712Domain' as const, + primaryType: 'EIP712Domain', message: {}, }; @@ -382,9 +359,8 @@ describe('hd-keyring', () => { mnemonic: sampleMnemonic, numberOfAccounts: 1, }); - const [rawAddress] = await keyring.getAccounts(); - assert(rawAddress, 'addresses is empty'); - const address = add0x(rawAddress); + const addresses = await keyring.getAccounts(); + const address = addresses[0]; const signature = await keyring.signTypedData(address, typedData, { version: SignTypedDataVersion.V3, }); @@ -399,7 +375,7 @@ describe('hd-keyring', () => { describe('#signTypedData_v3 signature verification', () => { it('signs in a recoverable way.', async () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); const typedData = { types: { EIP712Domain: [ @@ -418,7 +394,7 @@ describe('hd-keyring', () => { { name: 'contents', type: 'string' }, ], }, - primaryType: 'Mail' as const, + primaryType: 'Mail', domain: { name: 'Ether Mail', version: '1', @@ -440,9 +416,8 @@ describe('hd-keyring', () => { keyring.generateRandomMnemonic(); await keyring.addAccounts(1); - const [rawAddress] = await keyring.getAccounts(); - assert(rawAddress, 'addresses is empty'); - const address = add0x(rawAddress); + const addresses = await keyring.getAccounts(); + const address = addresses[0]; const signature = await keyring.signTypedData(address, typedData, { version: SignTypedDataVersion.V3, }); @@ -457,9 +432,9 @@ describe('hd-keyring', () => { describe('custom hd paths', () => { it('can deserialize with an hdPath param and generate the same accounts.', async () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); const hdPathString = `m/44'/60'/0'/0`; - await keyring.deserialize({ + keyring.deserialize({ mnemonic: sampleMnemonic, numberOfAccounts: 1, hdPath: hdPathString, @@ -471,9 +446,9 @@ describe('hd-keyring', () => { }); it('can deserialize with an hdPath param and generate different accounts.', async () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); const hdPathString = `m/44'/60'/0'/1`; - await keyring.deserialize({ + keyring.deserialize({ mnemonic: sampleMnemonic, numberOfAccounts: 1, hdPath: hdPathString, @@ -493,14 +468,14 @@ describe('hd-keyring', () => { for (let i = 0; i < 1e3; i++) { - const keyring = new HDKeyring({ + const keyring = new HdKeyring({ numberOfAccounts: 1, }) const originalAccounts = await keyring.getAccounts() const serialized = await keyring.serialize() const mnemonic = serialized.mnemonic - const keyring = new HDKeyring({ + const keyring = new HdKeyring({ numberOfAccounts: 1, mnemonic, }) @@ -520,7 +495,7 @@ describe('hd-keyring', () => { describe('signing methods withAppKeyOrigin option', () => { it('should signPersonalMessage with the expected key when passed a withAppKeyOrigin', async () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); const address = firstAcct; const message = '0x68656c6c6f20776f726c64'; @@ -542,14 +517,14 @@ describe('hd-keyring', () => { }); it('should signTypedData with the expected key when passed a withAppKeyOrigin', async () => { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); const address = firstAcct; const typedData = { types: { EIP712Domain: [], }, domain: {}, - primaryType: 'EIP712Domain' as const, + primaryType: 'EIP712Domain', message: {}, }; @@ -587,7 +562,7 @@ describe('hd-keyring', () => { '0xb21867b2221db0172e970b7370825b71c57823ff8714168ce9748f32f450e2c43d0fe396eb5b5f59284b7fd108c8cf61a6180a6756bdd3d4b7b9ccc4ac6d51611b'; it('passes the dennis test', async function () { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); await keyring.deserialize({ mnemonic: sampleMnemonic, numberOfAccounts: 1, @@ -597,7 +572,7 @@ describe('hd-keyring', () => { }); it('reliably can decode messages it signs', async function () { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); await keyring.deserialize({ mnemonic: sampleMnemonic, numberOfAccounts: 1, @@ -605,11 +580,11 @@ describe('hd-keyring', () => { const localMessage = 'hello there!'; const msgHashHex = bufferToHex( Buffer.from(keccak256(Buffer.from(localMessage))), - ) as Hex; + ); await keyring.addAccounts(9); const addresses = await keyring.getAccounts(); const signatures = await Promise.all( - addresses.map(async (accountAddress: Hex) => { + addresses.map(async (accountAddress) => { return await keyring.signMessage(accountAddress, msgHashHex); }), ); @@ -628,7 +603,7 @@ describe('hd-keyring', () => { }); it('throw error for invalid message', async function () { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); await keyring.deserialize({ mnemonic: sampleMnemonic, numberOfAccounts: 1, @@ -640,20 +615,19 @@ describe('hd-keyring', () => { }); it('throw error if empty address is passed', async function () { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); await keyring.deserialize({ mnemonic: sampleMnemonic, numberOfAccounts: 1, }); - // @ts-expect-error we inputting an invalid address await expect(keyring.signMessage('', message)).rejects.toThrow( 'Must specify address.', ); }); it('throw error if address not associated with the current keyring is passed', async function () { - const keyring = new HDKeyring(); + const keyring = new HdKeyring(); await keyring.deserialize({ mnemonic: sampleMnemonic, numberOfAccounts: 1, @@ -661,14 +635,14 @@ describe('hd-keyring', () => { await expect( keyring.signMessage(notKeyringAddress, message), - ).rejects.toThrow('Eth-Hd-Keyring: Unable to find matching address.'); + ).rejects.toThrow('HD Keyring - Unable to find matching address.'); }); }); describe('#removeAccount', function () { - let keyring: HDKeyring; + let keyring; beforeEach(() => { - keyring = new HDKeyring({ + keyring = new HdKeyring({ mnemonic: sampleMnemonic, numberOfAccounts: 1, }); @@ -676,12 +650,9 @@ describe('hd-keyring', () => { describe('if the account exists', function () { it('should remove that account', async function () { - const rawAddresses = await keyring.getAccounts(); - const [rawAddress] = rawAddresses; - expect(rawAddresses).toHaveLength(1); - assert(rawAddress, 'rawAddress should be empty'); - const address = add0x(rawAddress); - keyring.removeAccount(address); + const addresses = await keyring.getAccounts(); + expect(addresses).toHaveLength(1); + keyring.removeAccount(addresses[0]); const addressesAfterRemoval = await keyring.getAccounts(); expect(addressesAfterRemoval).toHaveLength(0); }); @@ -698,9 +669,9 @@ describe('hd-keyring', () => { }); describe('getAppKeyAddress', function () { - let keyring: HDKeyring; + let keyring; beforeEach(() => { - keyring = new HDKeyring({ + keyring = new HdKeyring({ mnemonic: sampleMnemonic, numberOfAccounts: 1, }); @@ -751,7 +722,6 @@ describe('hd-keyring', () => { }); it('should throw error if the provided origin is not a string', async function () { - // @ts-expect-error we are providing an incorrect origin key await expect(keyring.getAppKeyAddress(firstAcct, [])).rejects.toThrow( `'origin' must be a non-empty string`, ); @@ -765,9 +735,9 @@ describe('hd-keyring', () => { }); describe('exportAccount', function () { - let keyring: HDKeyring; + let keyring; beforeEach(() => { - keyring = new HDKeyring({ + keyring = new HdKeyring({ mnemonic: sampleMnemonic, numberOfAccounts: 1, }); @@ -783,16 +753,16 @@ describe('hd-keyring', () => { it('throw error if account is not present', async function () { await expect(keyring.exportAccount(notKeyringAddress)).rejects.toThrow( - 'Eth-Hd-Keyring: Unable to find matching address.', + 'HD Keyring - Unable to find matching address.', ); }); }); describe('#encryptionPublicKey', function () { const publicKey = 'LV7lWhd0mUDcvxkMU2o6uKXftu25zq4bMYdmMqppXic='; - let keyring: HDKeyring; + let keyring; beforeEach(() => { - keyring = new HDKeyring({ + keyring = new HdKeyring({ mnemonic: sampleMnemonic, numberOfAccounts: 1, }); @@ -806,7 +776,6 @@ describe('hd-keyring', () => { }); it('throw error if address is blank', async function () { - // @ts-expect-error provide an invalid key await expect(keyring.getEncryptionPublicKey('')).rejects.toThrow( 'Must specify address.', ); @@ -815,14 +784,14 @@ describe('hd-keyring', () => { it('throw error if address is not present in the keyring', async function () { await expect( keyring.getEncryptionPublicKey(notKeyringAddress), - ).rejects.toThrow('Eth-Hd-Keyring: Unable to find matching address.'); + ).rejects.toThrow('HD Keyring - Unable to find matching address.'); }); }); describe('#signTypedData V4 signature verification', function () { - let keyring: HDKeyring; + let keyring; beforeEach(() => { - keyring = new HDKeyring({ + keyring = new HdKeyring({ mnemonic: sampleMnemonic, numberOfAccounts: 1, }); @@ -860,7 +829,7 @@ describe('hd-keyring', () => { chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, - primaryType: 'Mail' as const, + primaryType: 'Mail', message: { from: { name: 'Cow', @@ -886,8 +855,8 @@ describe('hd-keyring', () => { const addresses = await keyring.getAccounts(); const [address] = addresses; - const signature = await keyring.signTypedData(address as Hex, typedData, { - version: SignTypedDataVersion.V4, + const signature = await keyring.signTypedData(address, typedData, { + version: 'V4', }); expect(signature).toBe(expectedSignature); const restored = recoverTypedSignature({ @@ -901,10 +870,10 @@ describe('hd-keyring', () => { describe('#decryptMessage', function () { const message = 'Hello world!'; - let encryptedMessage: EthEncryptedData, keyring: HDKeyring; + let encryptedMessage, keyring; beforeEach(async () => { - keyring = new HDKeyring({ + keyring = new HdKeyring({ mnemonic: sampleMnemonic, numberOfAccounts: 1, }); @@ -930,20 +899,20 @@ describe('hd-keyring', () => { it('throw error if address passed is not present in the keyring', async function () { await expect( keyring.decryptMessage(notKeyringAddress, encryptedMessage), - ).rejects.toThrow('Eth-Hd-Keyring: Unable to find matching address.'); + ).rejects.toThrow('HD Keyring - Unable to find matching address.'); }); it('throw error if wrong encrypted data object is passed', async function () { - await expect( - keyring.decryptMessage(firstAcct, {} as Eip1024EncryptedData), - ).rejects.toThrow('Encryption type/version not supported.'); + await expect(keyring.decryptMessage(firstAcct, {})).rejects.toThrow( + 'Encryption type/version not supported.', + ); }); }); describe('#signTransaction', function () { - let keyring: HDKeyring; + let keyring; beforeEach(() => { - keyring = new HDKeyring({ + keyring = new HdKeyring({ mnemonic: sampleMnemonic, numberOfAccounts: 1, }); @@ -963,8 +932,7 @@ describe('hd-keyring', () => { expect(tx.isSigned()).toBe(false); const signed = await keyring.signTransaction(firstAcct, tx); - const signedTx = TransactionFactory.fromTxData(signed); - expect(signedTx.isSigned()).toBe(true); + expect(signed.isSigned()).toBe(true); }); it('returns a signed tx object', async function () { @@ -972,13 +940,11 @@ describe('hd-keyring', () => { expect(tx.isSigned()).toBe(false); const signed = await keyring.signTransaction(firstAcct, tx); - const signedTx = TransactionFactory.fromTxData(signed); - expect(signedTx.isSigned()).toBe(true); + expect(signed.isSigned()).toBe(true); }); it('returns rejected promise if empty address is passed', async function () { const tx = TransactionFactory.fromTxData(txParams); - // @ts-expect-error provide invalid address await expect(keyring.signTransaction('', tx)).rejects.toThrow( 'Must specify address.', ); @@ -988,7 +954,7 @@ describe('hd-keyring', () => { const tx = TransactionFactory.fromTxData(txParams); await expect( keyring.signTransaction(notKeyringAddress, tx), - ).rejects.toThrow('Eth-Hd-Keyring: Unable to find matching address.'); + ).rejects.toThrow('HD Keyring - Unable to find matching address.'); }); }); }); diff --git a/tsconfig.build.json b/tsconfig.build.json deleted file mode 100644 index c6e00d6..0000000 --- a/tsconfig.build.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "declaration": true, - "inlineSources": true, - "noEmit": false, - "outDir": "dist", - "rootDir": "src", - "sourceMap": true - }, - "include": ["./src/**/*.ts"], - "exclude": ["./src/**/*.test.ts"] -} diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 23c8ceb..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compilerOptions": { - "esModuleInterop": true, - "exactOptionalPropertyTypes": true, - "forceConsistentCasingInFileNames": true, - "lib": ["ES2020"], - "module": "CommonJS", - "moduleResolution": "node", - "noEmit": true, - "noErrorTruncation": true, - "noUncheckedIndexedAccess": true, - "strict": true, - "target": "es2020" - }, - "exclude": ["./dist/**/*"] -} diff --git a/yarn.lock b/yarn.lock index b4ec00a..0af10e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -418,44 +418,6 @@ __metadata: languageName: node linkType: hard -"@cspotcode/source-map-support@npm:^0.8.0": - version: 0.8.1 - resolution: "@cspotcode/source-map-support@npm:0.8.1" - dependencies: - "@jridgewell/trace-mapping": 0.3.9 - checksum: 5718f267085ed8edb3e7ef210137241775e607ee18b77d95aa5bd7514f47f5019aa2d82d96b3bf342ef7aa890a346fa1044532ff7cc3009e7d24fce3ce6200fa - languageName: node - linkType: hard - -"@es-joy/jsdoccomment@npm:~0.37.0": - version: 0.37.0 - resolution: "@es-joy/jsdoccomment@npm:0.37.0" - dependencies: - comment-parser: 1.3.1 - esquery: ^1.4.0 - jsdoc-type-pratt-parser: ~4.0.0 - checksum: 949c0d164573f189998a7ad7ace936639535e1cacf495d7daa893142dbe9e947f146602615732eaa3174b7ca08af9eea5d9fa97a68fdfe0aa14213ab0f319b13 - languageName: node - linkType: hard - -"@eslint-community/eslint-utils@npm:^4.2.0": - version: 4.3.0 - resolution: "@eslint-community/eslint-utils@npm:4.3.0" - dependencies: - eslint-visitor-keys: ^3.3.0 - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - checksum: f487760a692f0f1fef76e248ad72976919576ba57edc2b1b1dc1d182553bae6b5bf7b078e654da85d04f0af8a485d20bd26280002768f4fbcd2e330078340cb0 - languageName: node - linkType: hard - -"@eslint-community/regexpp@npm:^4.4.0": - version: 4.4.0 - resolution: "@eslint-community/regexpp@npm:4.4.0" - checksum: 2d127af0c752b80e8a782eacfe996a86925d21de92da3ffc6f9e615e701145e44a62e26bdd88bfac2cd76779c39ba8d9875a91046ec5e7e5f23cb647c247ea6a - languageName: node - linkType: hard - "@eslint/eslintrc@npm:^0.4.3": version: 0.4.3 resolution: "@eslint/eslintrc@npm:0.4.3" @@ -492,7 +454,7 @@ __metadata: languageName: node linkType: hard -"@ethereumjs/tx@npm:^4.1.2, @ethereumjs/tx@npm:^4.2.0": +"@ethereumjs/tx@npm:^4.0.1, @ethereumjs/tx@npm:^4.1.2": version: 4.2.0 resolution: "@ethereumjs/tx@npm:4.2.0" dependencies: @@ -825,7 +787,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/resolve-uri@npm:3.1.0, @jridgewell/resolve-uri@npm:^3.0.3": +"@jridgewell/resolve-uri@npm:3.1.0": version: 3.1.0 resolution: "@jridgewell/resolve-uri@npm:3.1.0" checksum: b5ceaaf9a110fcb2780d1d8f8d4a0bfd216702f31c988d8042e5f8fbe353c55d9b0f55a1733afdc64806f8e79c485d2464680ac48a0d9fcadb9548ee6b81d267 @@ -846,16 +808,6 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:0.3.9": - version: 0.3.9 - resolution: "@jridgewell/trace-mapping@npm:0.3.9" - dependencies: - "@jridgewell/resolve-uri": ^3.0.3 - "@jridgewell/sourcemap-codec": ^1.4.10 - checksum: d89597752fd88d3f3480845691a05a44bd21faac18e2185b6f436c3b0fd0c5a859fbbd9aaa92050c4052caf325ad3e10e2e1d1b64327517471b7d51babc0ddef - languageName: node - linkType: hard - "@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.15, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.17 resolution: "@jridgewell/trace-mapping@npm:0.3.17" @@ -957,19 +909,6 @@ __metadata: languageName: node linkType: hard -"@metamask/eslint-config-typescript@npm:^11.1.0": - version: 11.1.0 - resolution: "@metamask/eslint-config-typescript@npm:11.1.0" - peerDependencies: - "@metamask/eslint-config": ^11.0.0 - "@typescript-eslint/eslint-plugin": ^5.42.1 - "@typescript-eslint/parser": ^5.42.1 - eslint: ^8.27.0 - typescript: ~4.8.4 - checksum: 86f20303730fce7a2d6944d133e3d4cf745816bdc202fd17ebd341e4937777c662e80b3c1496a8da7d5e06e39518dec3206c4a4e872d9491f423e792bcdf56db - languageName: node - linkType: hard - "@metamask/eslint-config@npm:^8.0.0": version: 8.0.0 resolution: "@metamask/eslint-config@npm:8.0.0" @@ -1000,7 +939,7 @@ __metadata: version: 0.0.0-use.local resolution: "@metamask/eth-hd-keyring@workspace:." dependencies: - "@ethereumjs/tx": ^4.2.0 + "@ethereumjs/tx": ^4.0.1 "@ethereumjs/util": ^8.1.0 "@lavamoat/allow-scripts": ^2.3.1 "@lavamoat/preinstall-always-fail": ^1.0.0 @@ -1009,30 +948,21 @@ __metadata: "@metamask/eslint-config": ^8.0.0 "@metamask/eslint-config-jest": ^9.0.0 "@metamask/eslint-config-nodejs": ^8.0.0 - "@metamask/eslint-config-typescript": ^11.1.0 "@metamask/eth-hd-keyring": 4.0.1 "@metamask/eth-sig-util": ^7.0.0 "@metamask/scure-bip39": ^2.1.0 "@metamask/utils": ^8.1.0 "@types/jest": ^29.4.0 - "@types/node": ^18.14.6 - "@typescript-eslint/eslint-plugin": latest - "@typescript-eslint/parser": ^5.54.1 eslint: ^7.32.0 eslint-config-prettier: ^8.3.0 eslint-plugin-import: ^2.24.2 eslint-plugin-jest: ^24.3.6 - eslint-plugin-jsdoc: latest eslint-plugin-node: ^11.1.0 eslint-plugin-prettier: ^3.3.1 ethereum-cryptography: ^2.1.2 jest: ^29.4.3 prettier: ^2.4.1 prettier-plugin-packagejson: ^2.2.12 - ts-jest: ^29.0.5 - ts-node: ^10.9.1 - typedoc: ^0.23.26 - typescript: ^4.9.5 languageName: unknown linkType: soft @@ -1270,34 +1200,6 @@ __metadata: languageName: node linkType: hard -"@tsconfig/node10@npm:^1.0.7": - version: 1.0.9 - resolution: "@tsconfig/node10@npm:1.0.9" - checksum: a33ae4dc2a621c0678ac8ac4bceb8e512ae75dac65417a2ad9b022d9b5411e863c4c198b6ba9ef659e14b9fb609bbec680841a2e84c1172df7a5ffcf076539df - languageName: node - linkType: hard - -"@tsconfig/node12@npm:^1.0.7": - version: 1.0.11 - resolution: "@tsconfig/node12@npm:1.0.11" - checksum: 5ce29a41b13e7897a58b8e2df11269c5395999e588b9a467386f99d1d26f6c77d1af2719e407621412520ea30517d718d5192a32403b8dfcc163bf33e40a338a - languageName: node - linkType: hard - -"@tsconfig/node14@npm:^1.0.0": - version: 1.0.3 - resolution: "@tsconfig/node14@npm:1.0.3" - checksum: 19275fe80c4c8d0ad0abed6a96dbf00642e88b220b090418609c4376e1cef81bf16237bf170ad1b341452feddb8115d8dd2e5acdfdea1b27422071163dc9ba9d - languageName: node - linkType: hard - -"@tsconfig/node16@npm:^1.0.2": - version: 1.0.3 - resolution: "@tsconfig/node16@npm:1.0.3" - checksum: 3a8b657dd047495b7ad23437d6afd20297ce90380ff0bdee93fc7d39a900dbd8d9e26e53ff6b465e7967ce2adf0b218782590ce9013285121e6a5928fbd6819f - languageName: node - linkType: hard - "@types/babel__core@npm:^7.1.14": version: 7.1.19 resolution: "@types/babel__core@npm:7.1.19" @@ -1420,7 +1322,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:^7.0.7, @types/json-schema@npm:^7.0.9": +"@types/json-schema@npm:^7.0.7": version: 7.0.11 resolution: "@types/json-schema@npm:7.0.11" checksum: 527bddfe62db9012fccd7627794bd4c71beb77601861055d87e3ee464f2217c85fca7a4b56ae677478367bbd248dbde13553312b7d4dbc702a2f2bbf60c4018d @@ -1448,7 +1350,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:^18.14.6": +"@types/node@npm:*": version: 18.14.6 resolution: "@types/node@npm:18.14.6" checksum: 2f88f482cabadc6dbddd627a1674239e68c3c9beab56eb4ae2309fb96fd17fc3a509d99b0309bafe13b58529574f49ecf3a583f2ebe2896dd32fe4be436dc96e @@ -1487,13 +1389,6 @@ __metadata: languageName: node linkType: hard -"@types/semver@npm:^7.3.12": - version: 7.3.13 - resolution: "@types/semver@npm:7.3.13" - checksum: 00c0724d54757c2f4bc60b5032fe91cda6410e48689633d5f35ece8a0a66445e3e57fa1d6e07eb780f792e82ac542948ec4d0b76eb3484297b79bd18b8cf1cb0 - languageName: node - linkType: hard - "@types/stack-utils@npm:^2.0.0": version: 2.0.1 resolution: "@types/stack-utils@npm:2.0.1" @@ -1517,30 +1412,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:latest": - version: 5.56.0 - resolution: "@typescript-eslint/eslint-plugin@npm:5.56.0" - dependencies: - "@eslint-community/regexpp": ^4.4.0 - "@typescript-eslint/scope-manager": 5.56.0 - "@typescript-eslint/type-utils": 5.56.0 - "@typescript-eslint/utils": 5.56.0 - debug: ^4.3.4 - grapheme-splitter: ^1.0.4 - ignore: ^5.2.0 - natural-compare-lite: ^1.4.0 - semver: ^7.3.7 - tsutils: ^3.21.0 - peerDependencies: - "@typescript-eslint/parser": ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 2eed4a4ed8279950ad553252e8623e947ffdee39b0d677a13f6e4e2d863ea1cbc5d683ff189e55d0de6fd5a25afd72d3c3a9ab7ae417d5405a21ead907e1b154 - languageName: node - linkType: hard - "@typescript-eslint/experimental-utils@npm:^4.0.1": version: 4.33.0 resolution: "@typescript-eslint/experimental-utils@npm:4.33.0" @@ -1557,23 +1428,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/parser@npm:5.54.1" - dependencies: - "@typescript-eslint/scope-manager": 5.54.1 - "@typescript-eslint/types": 5.54.1 - "@typescript-eslint/typescript-estree": 5.54.1 - debug: ^4.3.4 - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: f466513d306ca926b97c2cec1eebaf2cd15d45bd5633a4358f23ba9a4de1b0ec4630b1c20abc395943934ed1d2ef65f545fd6737c317a7abe579612101e8a83f - languageName: node - linkType: hard - "@typescript-eslint/scope-manager@npm:4.33.0": version: 4.33.0 resolution: "@typescript-eslint/scope-manager@npm:4.33.0" @@ -1584,43 +1438,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/scope-manager@npm:5.54.1" - dependencies: - "@typescript-eslint/types": 5.54.1 - "@typescript-eslint/visitor-keys": 5.54.1 - checksum: 9add24cf3a7852634ad0680a827646860ac4698a6ac8aae31e8b781e29f59e84b51f0cdaacffd0747811012647f01b51969d988da9b302ead374ceebffbe204b - languageName: node - linkType: hard - -"@typescript-eslint/scope-manager@npm:5.56.0": - version: 5.56.0 - resolution: "@typescript-eslint/scope-manager@npm:5.56.0" - dependencies: - "@typescript-eslint/types": 5.56.0 - "@typescript-eslint/visitor-keys": 5.56.0 - checksum: bacac255ee52148cee6622be2811c0d7e25419058b89f1a11f4c1303faef4535a0a1237549f9556ec1d7a297c640ce4357183a1a8465d72e1393b7d8fb43874b - languageName: node - linkType: hard - -"@typescript-eslint/type-utils@npm:5.56.0": - version: 5.56.0 - resolution: "@typescript-eslint/type-utils@npm:5.56.0" - dependencies: - "@typescript-eslint/typescript-estree": 5.56.0 - "@typescript-eslint/utils": 5.56.0 - debug: ^4.3.4 - tsutils: ^3.21.0 - peerDependencies: - eslint: "*" - peerDependenciesMeta: - typescript: - optional: true - checksum: 3dd1fcfadad18790b900a3d90f6617904adb6b0e2bd1e1edb6ebf239e1399865ca9098647405385feb4252d8b2b4577883e6fd3ef8d00bdd521d6070972d486b - languageName: node - linkType: hard - "@typescript-eslint/types@npm:4.33.0": version: 4.33.0 resolution: "@typescript-eslint/types@npm:4.33.0" @@ -1628,20 +1445,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/types@npm:5.54.1" - checksum: 84a8f725cfa10646af389659e09c510c38d82c65960c7b613f844a264acc0e197471cba03f3e8f4b6411bc35dca28922c8352a7bd44621411c73fd6dd4096da2 - languageName: node - linkType: hard - -"@typescript-eslint/types@npm:5.56.0": - version: 5.56.0 - resolution: "@typescript-eslint/types@npm:5.56.0" - checksum: 82ca11553bbb1bbfcaf7e7760b03c0d898940238dc002552c21af3e58f7d482c64c3c6cf0666521aff2a1e7b4b58bb6e4d9a00b1e4998a16b5039f5d288d003a - languageName: node - linkType: hard - "@typescript-eslint/typescript-estree@npm:4.33.0": version: 4.33.0 resolution: "@typescript-eslint/typescript-estree@npm:4.33.0" @@ -1660,60 +1463,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/typescript-estree@npm:5.54.1" - dependencies: - "@typescript-eslint/types": 5.54.1 - "@typescript-eslint/visitor-keys": 5.54.1 - debug: ^4.3.4 - globby: ^11.1.0 - is-glob: ^4.0.3 - semver: ^7.3.7 - tsutils: ^3.21.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: ea42bdb4832fa96fa1121237c9b664ac4506e2836646651e08a8542c8601d78af6c288779707f893ca4c884221829bb7d7b4b43c4a9c3ed959519266d03a139b - languageName: node - linkType: hard - -"@typescript-eslint/typescript-estree@npm:5.56.0": - version: 5.56.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.56.0" - dependencies: - "@typescript-eslint/types": 5.56.0 - "@typescript-eslint/visitor-keys": 5.56.0 - debug: ^4.3.4 - globby: ^11.1.0 - is-glob: ^4.0.3 - semver: ^7.3.7 - tsutils: ^3.21.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: ec3e85201786aa9adddba7cb834a9f330a7f55c729ee9ccf847dbdc2f7437b760f3774152ccad6d0aa48d13fd78df766c880e3a7ca42e01a20aba0e1a1ed61c5 - languageName: node - linkType: hard - -"@typescript-eslint/utils@npm:5.56.0": - version: 5.56.0 - resolution: "@typescript-eslint/utils@npm:5.56.0" - dependencies: - "@eslint-community/eslint-utils": ^4.2.0 - "@types/json-schema": ^7.0.9 - "@types/semver": ^7.3.12 - "@typescript-eslint/scope-manager": 5.56.0 - "@typescript-eslint/types": 5.56.0 - "@typescript-eslint/typescript-estree": 5.56.0 - eslint-scope: ^5.1.1 - semver: ^7.3.7 - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 413e8d4bf7023ee5ba4f695b62e796a1f94930bb92fe5aa0cee58f63b9837116c23f618825a9c671f610e50f5630188b6059b4ed6b05a2a3336f01d8e977becb - languageName: node - linkType: hard - "@typescript-eslint/visitor-keys@npm:4.33.0": version: 4.33.0 resolution: "@typescript-eslint/visitor-keys@npm:4.33.0" @@ -1724,26 +1473,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.54.1": - version: 5.54.1 - resolution: "@typescript-eslint/visitor-keys@npm:5.54.1" - dependencies: - "@typescript-eslint/types": 5.54.1 - eslint-visitor-keys: ^3.3.0 - checksum: 3a691abd2a43b86a0c41526d14a2afcc93a2e0512b5f8b9ec43f6029c493870808036eae5ee4fc655d26e1999017c4a4dffb241f47c36c2a1238ec9fbd08719c - languageName: node - linkType: hard - -"@typescript-eslint/visitor-keys@npm:5.56.0": - version: 5.56.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.56.0" - dependencies: - "@typescript-eslint/types": 5.56.0 - eslint-visitor-keys: ^3.3.0 - checksum: 568fda40134e153d7befb59b55698f7919ba780d2d3431d8745feabf2e0fbb8aa7a02173b3c467dd20a0f6594e5248a1f82bb25d6c37827716d77452e86cad29 - languageName: node - linkType: hard - "abbrev@npm:^1.0.0": version: 1.1.1 resolution: "abbrev@npm:1.1.1" @@ -1760,13 +1489,6 @@ __metadata: languageName: node linkType: hard -"acorn-walk@npm:^8.1.1": - version: 8.2.0 - resolution: "acorn-walk@npm:8.2.0" - checksum: 1715e76c01dd7b2d4ca472f9c58968516a4899378a63ad5b6c2d668bba8da21a71976c14ec5f5b75f887b6317c4ae0b897ab141c831d741dc76024d8745f1ad1 - languageName: node - linkType: hard - "acorn@npm:^7.4.0": version: 7.4.1 resolution: "acorn@npm:7.4.1" @@ -1776,15 +1498,6 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.4.1": - version: 8.8.2 - resolution: "acorn@npm:8.8.2" - bin: - acorn: bin/acorn - checksum: f790b99a1bf63ef160c967e23c46feea7787e531292bb827126334612c234ed489a0dc2c7ba33156416f0ffa8d25bf2b0fdb7f35c2ba60eb3e960572bece4001 - languageName: node - linkType: hard - "aes-js@npm:^3.1.2": version: 3.1.2 resolution: "aes-js@npm:3.1.2" @@ -1876,13 +1589,6 @@ __metadata: languageName: node linkType: hard -"ansi-sequence-parser@npm:^1.1.0": - version: 1.1.0 - resolution: "ansi-sequence-parser@npm:1.1.0" - checksum: 75f4d3a4c555655a698aec05b5763cbddcd16ccccdbfd178fb0aa471ab74fdf98e031b875ef26e64be6a95cf970c89238744b26de6e34af97f316d5186b1df53 - languageName: node - linkType: hard - "ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" @@ -1942,13 +1648,6 @@ __metadata: languageName: node linkType: hard -"arg@npm:^4.1.0": - version: 4.1.3 - resolution: "arg@npm:4.1.3" - checksum: 544af8dd3f60546d3e4aff084d451b96961d2267d668670199692f8d054f0415d86fc5497d0e641e91546f0aa920e7c29e5250e99fc89f5552a34b5d93b77f43 - languageName: node - linkType: hard - "argparse@npm:^1.0.7": version: 1.0.10 resolution: "argparse@npm:1.0.10" @@ -2185,15 +1884,6 @@ __metadata: languageName: node linkType: hard -"bs-logger@npm:0.x": - version: 0.2.6 - resolution: "bs-logger@npm:0.2.6" - dependencies: - fast-json-stable-stringify: 2.x - checksum: d34bdaf68c64bd099ab97c3ea608c9ae7d3f5faa1178b3f3f345acd94e852e608b2d4f9103fb2e503f5e69780e98293df41691b84be909b41cf5045374d54606 - languageName: node - linkType: hard - "bs58@npm:^4.0.0": version: 4.0.1 resolution: "bs58@npm:4.0.1" @@ -2471,13 +2161,6 @@ __metadata: languageName: node linkType: hard -"comment-parser@npm:1.3.1": - version: 1.3.1 - resolution: "comment-parser@npm:1.3.1" - checksum: 421e6a113a3afd548500e7174ab46a2049dccf92e82bbaa3b209031b1bdf97552aabfa1ae2a120c0b62df17e1ba70e0d8b05d68504fee78e1ef974c59bcfe718 - languageName: node - linkType: hard - "concat-map@npm:0.0.1": version: 0.0.1 resolution: "concat-map@npm:0.0.1" @@ -2544,13 +2227,6 @@ __metadata: languageName: node linkType: hard -"create-require@npm:^1.1.0": - version: 1.1.1 - resolution: "create-require@npm:1.1.1" - checksum: a9a1503d4390d8b59ad86f4607de7870b39cad43d929813599a23714831e81c520bddf61bcdd1f8e30f05fd3a2b71ae8538e946eb2786dc65c2bbc520f692eff - languageName: node - linkType: hard - "cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" @@ -2658,13 +2334,6 @@ __metadata: languageName: node linkType: hard -"diff@npm:^4.0.1": - version: 4.0.2 - resolution: "diff@npm:4.0.2" - checksum: f2c09b0ce4e6b301c221addd83bf3f454c0bc00caa3dd837cf6c127d6edf7223aa2bbe3b688feea110b7f262adbfc845b757c44c8a9f8c0c5b15d8fa9ce9d20d - languageName: node - linkType: hard - "diff@npm:^5.0.0": version: 5.1.0 resolution: "diff@npm:5.1.0" @@ -2952,23 +2621,6 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-jsdoc@npm:latest": - version: 40.1.0 - resolution: "eslint-plugin-jsdoc@npm:40.1.0" - dependencies: - "@es-joy/jsdoccomment": ~0.37.0 - comment-parser: 1.3.1 - debug: ^4.3.4 - escape-string-regexp: ^4.0.0 - esquery: ^1.5.0 - semver: ^7.3.8 - spdx-expression-parse: ^3.0.1 - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - checksum: 58e7d5b5d44af92dff844b3012e46fd52c8afea1f44ac1837ed85a6f5ff02cbd1bc4df04f84d47afce8ec69ae2aa8e137cd89b6cb39e3c389dbe978f260aa6ea - languageName: node - linkType: hard - "eslint-plugin-node@npm:^11.1.0": version: 11.1.0 resolution: "eslint-plugin-node@npm:11.1.0" @@ -3044,13 +2696,6 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0": - version: 3.3.0 - resolution: "eslint-visitor-keys@npm:3.3.0" - checksum: d59e68a7c5a6d0146526b0eec16ce87fbf97fe46b8281e0d41384224375c4e52f5ffb9e16d48f4ea50785cde93f766b0c898e31ab89978d88b0e1720fbfb7808 - languageName: node - linkType: hard - "eslint@npm:^7.32.0": version: 7.32.0 resolution: "eslint@npm:7.32.0" @@ -3122,7 +2767,7 @@ __metadata: languageName: node linkType: hard -"esquery@npm:^1.4.0, esquery@npm:^1.5.0": +"esquery@npm:^1.4.0": version: 1.5.0 resolution: "esquery@npm:1.5.0" dependencies: @@ -3388,7 +3033,7 @@ __metadata: languageName: node linkType: hard -"fast-json-stable-stringify@npm:2.x, fast-json-stable-stringify@npm:^2.0.0, fast-json-stable-stringify@npm:^2.1.0": +"fast-json-stable-stringify@npm:^2.0.0, fast-json-stable-stringify@npm:^2.1.0": version: 2.1.0 resolution: "fast-json-stable-stringify@npm:2.1.0" checksum: b191531e36c607977e5b1c47811158733c34ccb3bfde92c44798929e9b4154884378536d26ad90dfecd32e1ffc09c545d23535ad91b3161a27ddbb8ebe0cbecb @@ -3707,7 +3352,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:^11.0.3, globby@npm:^11.1.0": +"globby@npm:^11.0.3": version: 11.1.0 resolution: "globby@npm:11.1.0" dependencies: @@ -3728,13 +3373,6 @@ __metadata: languageName: node linkType: hard -"grapheme-splitter@npm:^1.0.4": - version: 1.0.4 - resolution: "grapheme-splitter@npm:1.0.4" - checksum: 0c22ec54dee1b05cd480f78cf14f732cb5b108edc073572c4ec205df4cd63f30f8db8025afc5debc8835a8ddeacf648a1c7992fe3dcd6ad38f9a476d84906620 - languageName: node - linkType: hard - "has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2": version: 1.0.2 resolution: "has-bigints@npm:1.0.2" @@ -4598,7 +4236,7 @@ __metadata: languageName: node linkType: hard -"jest-util@npm:^29.0.0, jest-util@npm:^29.4.3": +"jest-util@npm:^29.4.3": version: 29.4.3 resolution: "jest-util@npm:29.4.3" dependencies: @@ -4692,13 +4330,6 @@ __metadata: languageName: node linkType: hard -"jsdoc-type-pratt-parser@npm:~4.0.0": - version: 4.0.0 - resolution: "jsdoc-type-pratt-parser@npm:4.0.0" - checksum: af0629c9517e484be778d8564440fec8de5b7610e0c9c88a3ba4554321364faf72b46689c8d8845faa12c0718437a9ed97e231977efc0f2d50e8a2dbad807eb3 - languageName: node - linkType: hard - "jsesc@npm:^2.5.1": version: 2.5.2 resolution: "jsesc@npm:2.5.2" @@ -4754,7 +4385,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.2.2, json5@npm:^2.2.3": +"json5@npm:^2.2.2": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -4763,13 +4394,6 @@ __metadata: languageName: node linkType: hard -"jsonc-parser@npm:^3.2.0": - version: 3.2.0 - resolution: "jsonc-parser@npm:3.2.0" - checksum: 946dd9a5f326b745aa326d48a7257e3f4a4b62c5e98ec8e49fa2bdd8d96cef7e6febf1399f5c7016114fd1f68a1c62c6138826d5d90bc650448e3cf0951c53c7 - languageName: node - linkType: hard - "keccak@npm:^3.0.0": version: 3.0.2 resolution: "keccak@npm:3.0.2" @@ -4822,13 +4446,6 @@ __metadata: languageName: node linkType: hard -"lodash.memoize@npm:4.x": - version: 4.1.2 - resolution: "lodash.memoize@npm:4.1.2" - checksum: 9ff3942feeccffa4f1fafa88d32f0d24fdc62fd15ded5a74a5f950ff5f0c6f61916157246744c620173dddf38d37095a92327d5fd3861e2063e736a5c207d089 - languageName: node - linkType: hard - "lodash.merge@npm:^4.6.2": version: 4.6.2 resolution: "lodash.merge@npm:4.6.2" @@ -4875,13 +4492,6 @@ __metadata: languageName: node linkType: hard -"lunr@npm:^2.3.9": - version: 2.3.9 - resolution: "lunr@npm:2.3.9" - checksum: 176719e24fcce7d3cf1baccce9dd5633cd8bdc1f41ebe6a180112e5ee99d80373fe2454f5d4624d437e5a8319698ca6837b9950566e15d2cae5f2a543a3db4b8 - languageName: node - linkType: hard - "make-dir@npm:^3.0.0": version: 3.1.0 resolution: "make-dir@npm:3.1.0" @@ -4891,13 +4501,6 @@ __metadata: languageName: node linkType: hard -"make-error@npm:1.x, make-error@npm:^1.1.1": - version: 1.3.6 - resolution: "make-error@npm:1.3.6" - checksum: b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402 - languageName: node - linkType: hard - "make-fetch-happen@npm:^10.0.3": version: 10.2.1 resolution: "make-fetch-happen@npm:10.2.1" @@ -4954,15 +4557,6 @@ __metadata: languageName: node linkType: hard -"marked@npm:^4.2.12": - version: 4.2.12 - resolution: "marked@npm:4.2.12" - bin: - marked: bin/marked.js - checksum: bd551cd61028ee639d4ca2ccdfcc5a6ba4227c1b143c4538f3cde27f569dcb57df8e6313560394645b418b84a7336c07ab1e438b89b6324c29d7d8cdd3102d63 - languageName: node - linkType: hard - "md5.js@npm:^1.3.4": version: 1.3.5 resolution: "md5.js@npm:1.3.5" @@ -5044,15 +4638,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^7.1.3": - version: 7.4.2 - resolution: "minimatch@npm:7.4.2" - dependencies: - brace-expansion: ^2.0.1 - checksum: 9e341b04e69d5ab03e4206dcb61c8a158e3b8709628bf5e1a4eaa9f3b72c0ba925e24ad959b1f6ce6835caa5a927131d5087fae6836b69e7d99d7d5e63ef0bd8 - languageName: node - linkType: hard - "minimatch@npm:^9.0.1": version: 9.0.3 resolution: "minimatch@npm:9.0.3" @@ -5198,13 +4783,6 @@ __metadata: languageName: node linkType: hard -"natural-compare-lite@npm:^1.4.0": - version: 1.4.0 - resolution: "natural-compare-lite@npm:1.4.0" - checksum: 5222ac3986a2b78dd6069ac62cbb52a7bf8ffc90d972ab76dfe7b01892485d229530ed20d0c62e79a6b363a663b273db3bde195a1358ce9e5f779d4453887225 - languageName: node - linkType: hard - "natural-compare@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare@npm:1.4.0" @@ -5883,23 +5461,23 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.x, semver@npm:^7.2.1, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.4": - version: 7.5.4 - resolution: "semver@npm:7.5.4" - dependencies: - lru-cache: ^6.0.0 +"semver@npm:^6.0.0, semver@npm:^6.1.0, semver@npm:^6.3.0": + version: 6.3.1 + resolution: "semver@npm:6.3.1" bin: semver: bin/semver.js - checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3 + checksum: ae47d06de28836adb9d3e25f22a92943477371292d9b665fb023fae278d345d508ca1958232af086d85e0155aee22e313e100971898bbb8d5d89b8b1d4054ca2 languageName: node linkType: hard -"semver@npm:^6.0.0, semver@npm:^6.1.0, semver@npm:^6.3.0": - version: 6.3.1 - resolution: "semver@npm:6.3.1" +"semver@npm:^7.2.1, semver@npm:^7.3.5, semver@npm:^7.5.4": + version: 7.5.4 + resolution: "semver@npm:7.5.4" + dependencies: + lru-cache: ^6.0.0 bin: semver: bin/semver.js - checksum: ae47d06de28836adb9d3e25f22a92943477371292d9b665fb023fae278d345d508ca1958232af086d85e0155aee22e313e100971898bbb8d5d89b8b1d4054ca2 + checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3 languageName: node linkType: hard @@ -5945,18 +5523,6 @@ __metadata: languageName: node linkType: hard -"shiki@npm:^0.14.1": - version: 0.14.1 - resolution: "shiki@npm:0.14.1" - dependencies: - ansi-sequence-parser: ^1.1.0 - jsonc-parser: ^3.2.0 - vscode-oniguruma: ^1.7.0 - vscode-textmate: ^8.0.0 - checksum: b19ea337cc84da69d99ca39d109f82946e0c56c11cc4c67b3b91cc14a9479203365fd0c9e0dd87e908f493ab409dc6f1849175384b6ca593ce7da884ae1edca2 - languageName: node - linkType: hard - "side-channel@npm:^1.0.4": version: 1.0.4 resolution: "side-channel@npm:1.0.4" @@ -6075,30 +5641,6 @@ __metadata: languageName: node linkType: hard -"spdx-exceptions@npm:^2.1.0": - version: 2.3.0 - resolution: "spdx-exceptions@npm:2.3.0" - checksum: cb69a26fa3b46305637123cd37c85f75610e8c477b6476fa7354eb67c08128d159f1d36715f19be6f9daf4b680337deb8c65acdcae7f2608ba51931540687ac0 - languageName: node - linkType: hard - -"spdx-expression-parse@npm:^3.0.1": - version: 3.0.1 - resolution: "spdx-expression-parse@npm:3.0.1" - dependencies: - spdx-exceptions: ^2.1.0 - spdx-license-ids: ^3.0.0 - checksum: a1c6e104a2cbada7a593eaa9f430bd5e148ef5290d4c0409899855ce8b1c39652bcc88a725259491a82601159d6dc790bedefc9016c7472f7de8de7361f8ccde - languageName: node - linkType: hard - -"spdx-license-ids@npm:^3.0.0": - version: 3.0.13 - resolution: "spdx-license-ids@npm:3.0.13" - checksum: 3469d85c65f3245a279fa11afc250c3dca96e9e847f2f79d57f466940c5bb8495da08a542646086d499b7f24a74b8d0b42f3fc0f95d50ff99af1f599f6360ad7 - languageName: node - linkType: hard - "sprintf-js@npm:~1.0.2": version: 1.0.3 resolution: "sprintf-js@npm:1.0.3" @@ -6360,77 +5902,6 @@ __metadata: languageName: node linkType: hard -"ts-jest@npm:^29.0.5": - version: 29.0.5 - resolution: "ts-jest@npm:29.0.5" - dependencies: - bs-logger: 0.x - fast-json-stable-stringify: 2.x - jest-util: ^29.0.0 - json5: ^2.2.3 - lodash.memoize: 4.x - make-error: 1.x - semver: 7.x - yargs-parser: ^21.0.1 - peerDependencies: - "@babel/core": ">=7.0.0-beta.0 <8" - "@jest/types": ^29.0.0 - babel-jest: ^29.0.0 - jest: ^29.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: f60f129c2287f4c963d9ee2677132496c5c5a5d39c27ad234199a1140c26318a7d5bda34890ab0e30636ec42a8de28f84487c09e9dcec639c9c67812b3a38373 - languageName: node - linkType: hard - -"ts-node@npm:^10.9.1": - version: 10.9.1 - resolution: "ts-node@npm:10.9.1" - dependencies: - "@cspotcode/source-map-support": ^0.8.0 - "@tsconfig/node10": ^1.0.7 - "@tsconfig/node12": ^1.0.7 - "@tsconfig/node14": ^1.0.0 - "@tsconfig/node16": ^1.0.2 - acorn: ^8.4.1 - acorn-walk: ^8.1.1 - arg: ^4.1.0 - create-require: ^1.1.0 - diff: ^4.0.1 - make-error: ^1.1.1 - v8-compile-cache-lib: ^3.0.1 - yn: 3.1.1 - peerDependencies: - "@swc/core": ">=1.2.50" - "@swc/wasm": ">=1.2.50" - "@types/node": "*" - typescript: ">=2.7" - peerDependenciesMeta: - "@swc/core": - optional: true - "@swc/wasm": - optional: true - bin: - ts-node: dist/bin.js - ts-node-cwd: dist/bin-cwd.js - ts-node-esm: dist/bin-esm.js - ts-node-script: dist/bin-script.js - ts-node-transpile-only: dist/bin-transpile.js - ts-script: dist/bin-script-deprecated.js - checksum: 090adff1302ab20bd3486e6b4799e90f97726ed39e02b39e566f8ab674fd5bd5f727f43615debbfc580d33c6d9d1c6b1b3ce7d8e3cca3e20530a145ffa232c35 - languageName: node - linkType: hard - "tsconfig-paths@npm:^3.14.1": version: 3.14.1 resolution: "tsconfig-paths@npm:3.14.1" @@ -6505,42 +5976,6 @@ __metadata: languageName: node linkType: hard -"typedoc@npm:^0.23.26": - version: 0.23.26 - resolution: "typedoc@npm:0.23.26" - dependencies: - lunr: ^2.3.9 - marked: ^4.2.12 - minimatch: ^7.1.3 - shiki: ^0.14.1 - peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x - bin: - typedoc: bin/typedoc - checksum: 09dbd221b5bd27a7f6c593a6aa7e4efc3c46f20761e109a76bf0ed7239011cca1261357094710c01472582060d75a7558aab5bf5b78db3aff7c52188d146ee65 - languageName: node - linkType: hard - -"typescript@npm:^4.9.5": - version: 4.9.5 - resolution: "typescript@npm:4.9.5" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: ee000bc26848147ad423b581bd250075662a354d84f0e06eb76d3b892328d8d4440b7487b5a83e851b12b255f55d71835b008a66cbf8f255a11e4400159237db - languageName: node - linkType: hard - -"typescript@patch:typescript@^4.9.5#~builtin": - version: 4.9.5 - resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin::version=4.9.5&hash=d73830" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 2eee5c37cad4390385db5db5a8e81470e42e8f1401b0358d7390095d6f681b410f2c4a0c496c6ff9ebd775423c7785cdace7bcdad76c7bee283df3d9718c0f20 - languageName: node - linkType: hard - "unbox-primitive@npm:^1.0.2": version: 1.0.2 resolution: "unbox-primitive@npm:1.0.2" @@ -6635,13 +6070,6 @@ __metadata: languageName: node linkType: hard -"v8-compile-cache-lib@npm:^3.0.1": - version: 3.0.1 - resolution: "v8-compile-cache-lib@npm:3.0.1" - checksum: 78089ad549e21bcdbfca10c08850022b22024cdcc2da9b168bcf5a73a6ed7bf01a9cebb9eac28e03cd23a684d81e0502797e88f3ccd27a32aeab1cfc44c39da0 - languageName: node - linkType: hard - "v8-compile-cache@npm:^2.0.3": version: 2.3.0 resolution: "v8-compile-cache@npm:2.3.0" @@ -6660,20 +6088,6 @@ __metadata: languageName: node linkType: hard -"vscode-oniguruma@npm:^1.7.0": - version: 1.7.0 - resolution: "vscode-oniguruma@npm:1.7.0" - checksum: 53519d91d90593e6fb080260892e87d447e9b200c4964d766772b5053f5699066539d92100f77f1302c91e8fc5d9c772fbe40fe4c90f3d411a96d5a9b1e63f42 - languageName: node - linkType: hard - -"vscode-textmate@npm:^8.0.0": - version: 8.0.0 - resolution: "vscode-textmate@npm:8.0.0" - checksum: 127780dfea89559d70b8326df6ec344cfd701312dd7f3f591a718693812b7852c30b6715e3cfc8b3200a4e2515b4c96f0843c0eacc0a3020969b5de262c2a4bb - languageName: node - linkType: hard - "walker@npm:^1.0.8": version: 1.0.8 resolution: "walker@npm:1.0.8" @@ -6811,7 +6225,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: ed2d96a616a9e3e1cc7d204c62ecc61f7aaab633dcbfab2c6df50f7f87b393993fe6640d017759fe112d0cb1e0119f2b4150a87305cc873fd90831c6a58ccf1c @@ -6848,13 +6262,6 @@ __metadata: languageName: node linkType: hard -"yn@npm:3.1.1": - version: 3.1.1 - resolution: "yn@npm:3.1.1" - checksum: 2c487b0e149e746ef48cda9f8bad10fc83693cd69d7f9dcd8be4214e985de33a29c9e24f3c0d6bcf2288427040a8947406ab27f7af67ee9456e6b84854f02dd6 - languageName: node - linkType: hard - "yocto-queue@npm:^0.1.0": version: 0.1.0 resolution: "yocto-queue@npm:0.1.0"