From cd4b9b3593f39769b0dfd816c4c92d3719ad40c9 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Fri, 10 Jan 2025 12:31:48 +0100 Subject: [PATCH] Clear cache on lock --- packages/snaps-controllers/coverage.json | 4 +- packages/snaps-controllers/package.json | 1 + .../src/snaps/SnapController.test.tsx | 54 ++ .../src/snaps/SnapController.ts | 23 +- .../src/test-utils/controller.ts | 1 + yarn.lock | 591 +++++++++++++++++- 6 files changed, 660 insertions(+), 14 deletions(-) diff --git a/packages/snaps-controllers/coverage.json b/packages/snaps-controllers/coverage.json index 81b6406aa8..609decfdbc 100644 --- a/packages/snaps-controllers/coverage.json +++ b/packages/snaps-controllers/coverage.json @@ -1,6 +1,6 @@ { "branches": 92.41, "functions": 96.56, - "lines": 97.99, - "statements": 97.71 + "lines": 98, + "statements": 97.72 } diff --git a/packages/snaps-controllers/package.json b/packages/snaps-controllers/package.json index ec3fd6f31d..0ac124713b 100644 --- a/packages/snaps-controllers/package.json +++ b/packages/snaps-controllers/package.json @@ -84,6 +84,7 @@ "@metamask/json-rpc-engine": "^10.0.1", "@metamask/json-rpc-middleware-stream": "^8.0.5", "@metamask/key-tree": "^10.0.1", + "@metamask/keyring-controller": "^19.0.2", "@metamask/object-multiplex": "^2.0.0", "@metamask/permission-controller": "^11.0.4", "@metamask/phishing-controller": "^12.3.1", diff --git a/packages/snaps-controllers/src/snaps/SnapController.test.tsx b/packages/snaps-controllers/src/snaps/SnapController.test.tsx index 9f6b494f9b..84ce803216 100644 --- a/packages/snaps-controllers/src/snaps/SnapController.test.tsx +++ b/packages/snaps-controllers/src/snaps/SnapController.test.tsx @@ -52,6 +52,7 @@ import { MOCK_SNAP_NAME, DEFAULT_SOURCE_PATH, DEFAULT_ICON_PATH, + TEST_SECRET_RECOVERY_PHRASE_BYTES, } from '@metamask/snaps-utils/test-utils'; import type { SemVerRange, SemVerVersion, Json } from '@metamask/utils'; import { @@ -2120,6 +2121,59 @@ describe('SnapController', () => { await service.terminateAllSnaps(); }); + it('clears encrypted state of Snaps when the client is locked', async () => { + const rootMessenger = getControllerMessenger(); + const messenger = getSnapControllerMessenger(rootMessenger); + + const state = { myVariable: 1 }; + + const mockEncryptedState = await encrypt( + ENCRYPTION_KEY, + state, + undefined, + undefined, + DEFAULT_ENCRYPTION_KEY_DERIVATION_OPTIONS, + ); + + const getMnemonic = jest + .fn() + .mockReturnValue(TEST_SECRET_RECOVERY_PHRASE_BYTES); + + const snapController = getSnapController( + getSnapControllerOptions({ + messenger, + state: { + snaps: { + [MOCK_SNAP_ID]: getPersistedSnapObject(), + }, + snapStates: { + [MOCK_SNAP_ID]: mockEncryptedState, + }, + }, + getMnemonic, + }), + ); + + expect( + await messenger.call('SnapController:getSnapState', MOCK_SNAP_ID, true), + ).toStrictEqual(state); + expect(getMnemonic).toHaveBeenCalledTimes(1); + + rootMessenger.publish('KeyringController:lock'); + + expect( + await messenger.call('SnapController:getSnapState', MOCK_SNAP_ID, true), + ).toStrictEqual(state); + + // We assume `getMnemonic` is called again because the controller needs to + // decrypt the state again. This is not an ideal way to test this, but it + // is the easiest to test this without exposing the internal state of the + // `SnapController`. + expect(getMnemonic).toHaveBeenCalledTimes(2); + + snapController.destroy(); + }); + describe('handleRequest', () => { it.each( Object.keys(handlerEndowments).filter( diff --git a/packages/snaps-controllers/src/snaps/SnapController.ts b/packages/snaps-controllers/src/snaps/SnapController.ts index bb25357596..901128c258 100644 --- a/packages/snaps-controllers/src/snaps/SnapController.ts +++ b/packages/snaps-controllers/src/snaps/SnapController.ts @@ -9,6 +9,7 @@ import type { } from '@metamask/base-controller'; import { BaseController } from '@metamask/base-controller'; import type { CryptographicFunctions } from '@metamask/key-tree'; +import type { KeyringControllerLockEvent } from '@metamask/keyring-controller'; import type { Caveat, GetEndowments, @@ -607,7 +608,8 @@ export type AllowedActions = export type AllowedEvents = | ExecutionServiceEvents | SnapInstalled - | SnapUpdated; + | SnapUpdated + | KeyringControllerLockEvent; type SnapControllerMessenger = RestrictedControllerMessenger< typeof controllerName, @@ -967,6 +969,11 @@ export class SnapController extends BaseController< }, ); + this.messagingSystem.subscribe( + 'KeyringController:lock', + this.#handleLock.bind(this), + ); + this.#initializeStateMachine(); this.#registerMessageHandlers(); @@ -1832,6 +1839,7 @@ export class SnapController extends BaseController< const useCache = this.#hasCachedEncryptionKey(snapId) || this.#encryptor.isVaultUpdated(state); + const { key } = await this.#getSnapEncryptionKey({ snapId, salt, @@ -4007,4 +4015,17 @@ export class SnapController extends BaseController< }, }); } + + /** + * Handle the `KeyringController:lock` event. + * + * Currently this clears the cached encrypted state (if any) for all Snaps. + */ + #handleLock() { + for (const runtime of this.#snapsRuntimeData.values()) { + runtime.encryptionKey = null; + runtime.encryptionSalt = null; + runtime.state = undefined; + } + } } diff --git a/packages/snaps-controllers/src/test-utils/controller.ts b/packages/snaps-controllers/src/test-utils/controller.ts index 1602db2e66..1f2abe725d 100644 --- a/packages/snaps-controllers/src/test-utils/controller.ts +++ b/packages/snaps-controllers/src/test-utils/controller.ts @@ -469,6 +469,7 @@ export const getSnapControllerMessenger = ( 'SnapController:snapUpdated', 'SnapController:stateChange', 'SnapController:snapRolledback', + 'KeyringController:lock', ], allowedActions: [ 'ApprovalController:addRequest', diff --git a/yarn.lock b/yarn.lock index 29065c5256..3cd3d672ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3230,7 +3230,7 @@ __metadata: languageName: node linkType: hard -"@ethereumjs/tx@npm:^4.2.0": +"@ethereumjs/tx@npm:^4.0.2, @ethereumjs/tx@npm:^4.2.0": version: 4.2.0 resolution: "@ethereumjs/tx@npm:4.2.0" dependencies: @@ -3242,7 +3242,7 @@ __metadata: languageName: node linkType: hard -"@ethereumjs/util@npm:^8.1.0": +"@ethereumjs/util@npm:^8.0.0, @ethereumjs/util@npm:^8.1.0": version: 8.1.0 resolution: "@ethereumjs/util@npm:8.1.0" dependencies: @@ -3762,6 +3762,64 @@ __metadata: languageName: node linkType: hard +"@keystonehq/alias-sampling@npm:^0.1.1": + version: 0.1.2 + resolution: "@keystonehq/alias-sampling@npm:0.1.2" + checksum: 10/4dfdfb91e070b1d9f28058c92b5b8fad81696ac63bd432cd6bd359f2ab92eb50df75e8c5da1f75a351756387e9902f043b3ecc2cbf662c9c9456ecacc848abfd + languageName: node + linkType: hard + +"@keystonehq/base-eth-keyring@npm:^0.14.1": + version: 0.14.1 + resolution: "@keystonehq/base-eth-keyring@npm:0.14.1" + dependencies: + "@ethereumjs/tx": "npm:^4.0.2" + "@ethereumjs/util": "npm:^8.0.0" + "@keystonehq/bc-ur-registry-eth": "npm:^0.19.1" + hdkey: "npm:^2.0.1" + rlp: "npm:^3.0.0" + uuid: "npm:^8.3.2" + checksum: 10/07516e967fc5c618ef0ce67b155ba69c04f8fd84d5a6fd35f025f989c41256c9e6fa0375cfb0318da42876a61c64839e312d910e4b9fa801f86179df826adc69 + languageName: node + linkType: hard + +"@keystonehq/bc-ur-registry-eth@npm:^0.19.1": + version: 0.19.1 + resolution: "@keystonehq/bc-ur-registry-eth@npm:0.19.1" + dependencies: + "@ethereumjs/util": "npm:^8.0.0" + "@keystonehq/bc-ur-registry": "npm:^0.6.0" + hdkey: "npm:^2.0.1" + uuid: "npm:^8.3.2" + checksum: 10/7e64e6a754e6b66fc83a8f3880b54828c5b37f4eaaea3287eee31bd9d9b5ac0ba4cd4b8e751af9bd2f66e6f19291eaf02f46cd177d05ed9b30c1349cdd04572f + languageName: node + linkType: hard + +"@keystonehq/bc-ur-registry@npm:^0.6.0": + version: 0.6.4 + resolution: "@keystonehq/bc-ur-registry@npm:0.6.4" + dependencies: + "@ngraveio/bc-ur": "npm:^1.1.5" + bs58check: "npm:^2.1.2" + tslib: "npm:^2.3.0" + checksum: 10/d4cdbefc14f3305543340d509564e1a795eb458327d46aad8665927999150df7e282939dcb714b81fea386061019e3b9f41eedbbb09a59d404355711c33159b2 + languageName: node + linkType: hard + +"@keystonehq/metamask-airgapped-keyring@npm:^0.14.1": + version: 0.14.1 + resolution: "@keystonehq/metamask-airgapped-keyring@npm:0.14.1" + dependencies: + "@ethereumjs/tx": "npm:^4.0.2" + "@keystonehq/base-eth-keyring": "npm:^0.14.1" + "@keystonehq/bc-ur-registry-eth": "npm:^0.19.1" + "@metamask/obs-store": "npm:^9.0.0" + rlp: "npm:^2.2.6" + uuid: "npm:^8.3.2" + checksum: 10/8e34be8813c51488c7dc9b641ed17258740dda45fb72fe48670b077ecfb92273e0c5a2fbbab121b01d7e0906a3ec512f261fceb95da8089550021ab6a0c89c6b + languageName: node + linkType: hard + "@lavamoat/aa@npm:^4.1.0, @lavamoat/aa@npm:^4.2.0": version: 4.2.0 resolution: "@lavamoat/aa@npm:4.2.0" @@ -3853,6 +3911,16 @@ __metadata: languageName: node linkType: hard +"@metamask/abi-utils@npm:^3.0.0": + version: 3.0.0 + resolution: "@metamask/abi-utils@npm:3.0.0" + dependencies: + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^11.0.1" + checksum: 10/068b98185148b9e185b4af4392c6a6f82f1d4b1ff60013c57679c618f37afe9030e3ccc940e1a8b690be6f62ea91115ab18b73f3c3c09f4eff1794e31ababb9b + languageName: node + linkType: hard + "@metamask/action-utils@npm:^1.0.0": version: 1.1.1 resolution: "@metamask/action-utils@npm:1.1.1" @@ -3998,6 +4066,15 @@ __metadata: languageName: unknown linkType: soft +"@metamask/browser-passworder@npm:^4.3.0": + version: 4.3.0 + resolution: "@metamask/browser-passworder@npm:4.3.0" + dependencies: + "@metamask/utils": "npm:^8.2.0" + checksum: 10/8ba5c50cd6274b0cc0f90a1ee16b960ee150f14c29083f3515f4abe018a28ead32c21f5f4a62a6e27a946b1228adc2ff1f195e71e38782fa39fa8fff116173e6 + languageName: node + linkType: hard + "@metamask/browser-passworder@npm:^5.0.1": version: 5.0.1 resolution: "@metamask/browser-passworder@npm:5.0.1" @@ -4476,6 +4553,19 @@ __metadata: languageName: node linkType: hard +"@metamask/eth-hd-keyring@npm:^7.0.4": + version: 7.0.4 + resolution: "@metamask/eth-hd-keyring@npm:7.0.4" + dependencies: + "@ethereumjs/util": "npm:^8.1.0" + "@metamask/eth-sig-util": "npm:^7.0.3" + "@metamask/scure-bip39": "npm:^2.1.1" + "@metamask/utils": "npm:^9.2.1" + ethereum-cryptography: "npm:^2.1.2" + checksum: 10/493d06f55225b6f9da48ee001486e18898d6a4a3afd2cf40ff1dcae2ece42d5e96174f6a05b7c39419cb3531b530c8af294d9422195661788c5e0b687a328874 + languageName: node + linkType: hard + "@metamask/eth-json-rpc-middleware@npm:^15.0.0": version: 15.0.0 resolution: "@metamask/eth-json-rpc-middleware@npm:15.0.0" @@ -4532,6 +4622,33 @@ __metadata: languageName: node linkType: hard +"@metamask/eth-sig-util@npm:^8.0.0": + version: 8.1.2 + resolution: "@metamask/eth-sig-util@npm:8.1.2" + dependencies: + "@ethereumjs/util": "npm:^8.1.0" + "@metamask/abi-utils": "npm:^3.0.0" + "@metamask/utils": "npm:^11.0.1" + "@scure/base": "npm:~1.1.3" + ethereum-cryptography: "npm:^2.1.2" + tweetnacl: "npm:^1.0.3" + checksum: 10/32b284fc8c3229e3741b1c21f44ca3f55c2215ef8ad700775cd9501bbaab56a4e861827bef24ed263734d28c899eb3b34a9646e9d21ec3fce12204b7eb58bfed + languageName: node + linkType: hard + +"@metamask/eth-simple-keyring@npm:^6.0.5": + version: 6.0.5 + resolution: "@metamask/eth-simple-keyring@npm:6.0.5" + dependencies: + "@ethereumjs/util": "npm:^8.1.0" + "@metamask/eth-sig-util": "npm:^7.0.3" + "@metamask/utils": "npm:^9.2.1" + ethereum-cryptography: "npm:^2.1.2" + randombytes: "npm:^2.1.0" + checksum: 10/98b7bd00df25e7630324e2c762e3a03a7f199108a4dfe22e5a1938f1d01c9b2cd64ab4bb6fd242bf898624903d5a68a2e1f61c95f94a141266ab23dae8d97d21 + languageName: node + linkType: hard + "@metamask/ethereum-provider-example-snap@workspace:^, @metamask/ethereum-provider-example-snap@workspace:packages/examples/packages/ethereum-provider": version: 0.0.0-use.local resolution: "@metamask/ethereum-provider-example-snap@workspace:packages/examples/packages/ethereum-provider" @@ -5058,6 +5175,74 @@ __metadata: languageName: node linkType: hard +"@metamask/keyring-api@npm:^12.0.0": + version: 12.0.0 + resolution: "@metamask/keyring-api@npm:12.0.0" + dependencies: + "@metamask/keyring-utils": "npm:^1.0.0" + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^9.3.0" + bech32: "npm:^2.0.0" + checksum: 10/ba8b75c55d3fcb9f8b52c58ff141cba81f7c416c3fa684e089965717ea129d50e8df7a73e7ab1c96eaf59d70b6e2dd8a618434939b75ef0d3402b547b5196877 + languageName: node + linkType: hard + +"@metamask/keyring-api@npm:^13.0.0": + version: 13.0.0 + resolution: "@metamask/keyring-api@npm:13.0.0" + dependencies: + "@metamask/keyring-utils": "npm:^1.0.0" + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^11.0.1" + bech32: "npm:^2.0.0" + checksum: 10/f7e8982112a2813790354267af8f79cbf241d7ca9d733fe5e8de1a13993203b154ac6d358a92bd4340cbd4d25f4bac48681d17a25e3dc6f2336c95c00c371686 + languageName: node + linkType: hard + +"@metamask/keyring-controller@npm:^19.0.2": + version: 19.0.2 + resolution: "@metamask/keyring-controller@npm:19.0.2" + dependencies: + "@ethereumjs/util": "npm:^8.1.0" + "@keystonehq/metamask-airgapped-keyring": "npm:^0.14.1" + "@metamask/base-controller": "npm:^7.0.2" + "@metamask/browser-passworder": "npm:^4.3.0" + "@metamask/eth-hd-keyring": "npm:^7.0.4" + "@metamask/eth-sig-util": "npm:^8.0.0" + "@metamask/eth-simple-keyring": "npm:^6.0.5" + "@metamask/keyring-api": "npm:^12.0.0" + "@metamask/keyring-internal-api": "npm:^1.0.0" + "@metamask/message-manager": "npm:^11.0.3" + "@metamask/utils": "npm:^10.0.0" + async-mutex: "npm:^0.5.0" + ethereumjs-wallet: "npm:^1.0.1" + immer: "npm:^9.0.6" + checksum: 10/bbc140db91902dc8a9b8e1220d3c07e91858d68b9888d26df74fe300b1baf1331c5df62dde4ea71be77b485a0bca314bfc899358375490c7dbce594810bc74b6 + languageName: node + linkType: hard + +"@metamask/keyring-internal-api@npm:^1.0.0": + version: 1.1.0 + resolution: "@metamask/keyring-internal-api@npm:1.1.0" + dependencies: + "@metamask/keyring-api": "npm:^13.0.0" + "@metamask/keyring-utils": "npm:^1.0.0" + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^11.0.1" + checksum: 10/5db127cfe319c289b95d55d08b6737820f00761564e219d756a55e030b83043fb43d18bac3b63fcc69cd2e03129f831410ce960ba954d8183d976d87a6781b8c + languageName: node + linkType: hard + +"@metamask/keyring-utils@npm:^1.0.0": + version: 1.0.0 + resolution: "@metamask/keyring-utils@npm:1.0.0" + dependencies: + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^9.3.0" + checksum: 10/f74f7343a7154b029e0fa4c25735c589eba4dc25a9e323d43b7c733ce5dbb23ce603a4f02aac455163993649ceeaf714b8b843985ba7a9cb00b926b3b8dc6b51 + languageName: node + linkType: hard + "@metamask/lifecycle-hooks-example-snap@workspace:^, @metamask/lifecycle-hooks-example-snap@workspace:packages/examples/packages/lifecycle-hooks": version: 0.0.0-use.local resolution: "@metamask/lifecycle-hooks-example-snap@workspace:packages/examples/packages/lifecycle-hooks" @@ -5170,6 +5355,21 @@ __metadata: languageName: unknown linkType: soft +"@metamask/message-manager@npm:^11.0.3": + version: 11.0.3 + resolution: "@metamask/message-manager@npm:11.0.3" + dependencies: + "@metamask/base-controller": "npm:^7.0.2" + "@metamask/controller-utils": "npm:^11.4.4" + "@metamask/eth-sig-util": "npm:^8.0.0" + "@metamask/utils": "npm:^10.0.0" + "@types/uuid": "npm:^8.3.0" + jsonschema: "npm:^1.4.1" + uuid: "npm:^8.3.2" + checksum: 10/18f5b0091474fc45e854db9c91ad8f5f898017ba9a08b01c770904ad3929b004c65298fe246b989f3c92fd2f03b5932dfa31adadb95ca81ce6940cb28a2ec793 + languageName: node + linkType: hard + "@metamask/name-lookup-example-snap@workspace:^, @metamask/name-lookup-example-snap@workspace:packages/examples/packages/name-lookup": version: 0.0.0-use.local resolution: "@metamask/name-lookup-example-snap@workspace:packages/examples/packages/name-lookup" @@ -5303,6 +5503,16 @@ __metadata: languageName: node linkType: hard +"@metamask/obs-store@npm:^9.0.0": + version: 9.1.0 + resolution: "@metamask/obs-store@npm:9.1.0" + dependencies: + "@metamask/safe-event-emitter": "npm:^3.0.0" + readable-stream: "npm:^3.6.2" + checksum: 10/fa37a0b9e1e25f54c93a8f16449b3fc771c15b70d79d590cf41e22f871a19d673bcfd0d08b044093235d10d0bb031b47b8209d89997def0cb256abe3e371064f + languageName: node + linkType: hard + "@metamask/permission-controller@npm:^11.0.4": version: 11.0.4 resolution: "@metamask/permission-controller@npm:11.0.4" @@ -5719,6 +5929,7 @@ __metadata: "@metamask/json-rpc-engine": "npm:^10.0.1" "@metamask/json-rpc-middleware-stream": "npm:^8.0.5" "@metamask/key-tree": "npm:^10.0.1" + "@metamask/keyring-controller": "npm:^19.0.2" "@metamask/object-multiplex": "npm:^2.0.0" "@metamask/permission-controller": "npm:^11.0.4" "@metamask/phishing-controller": "npm:^12.3.1" @@ -6365,7 +6576,7 @@ __metadata: languageName: unknown linkType: soft -"@metamask/superstruct@npm:^3.1.0": +"@metamask/superstruct@npm:^3.0.0, @metamask/superstruct@npm:^3.1.0": version: 3.1.0 resolution: "@metamask/superstruct@npm:3.1.0" checksum: 10/5066fe228d5f11da387606d7f9545de2b473ab5a9e0f1bb8aea2f52d3e2c9d25e427151acde61f4a2de80a07a9871fe9505ad06abca6a61b7c3b54ed5c403b01 @@ -6499,6 +6710,23 @@ __metadata: languageName: node linkType: hard +"@metamask/utils@npm:^8.2.0": + version: 8.5.0 + resolution: "@metamask/utils@npm:8.5.0" + dependencies: + "@ethereumjs/tx": "npm:^4.2.0" + "@metamask/superstruct": "npm:^3.0.0" + "@noble/hashes": "npm:^1.3.1" + "@scure/base": "npm:^1.1.3" + "@types/debug": "npm:^4.1.7" + debug: "npm:^4.3.4" + pony-cause: "npm:^2.1.10" + semver: "npm:^7.5.4" + uuid: "npm:^9.0.1" + checksum: 10/68a42a55f7dc750b75467fb7c05a496c20dac073a2753e0f4d9642c4d8dcb3f9ddf51a09d30337e11637f1777f3dfe22e15b5159dbafb0fdb7bd8c9236056153 + languageName: node + linkType: hard + "@metamask/utils@npm:^9.0.0, @metamask/utils@npm:^9.1.0": version: 9.2.1 resolution: "@metamask/utils@npm:9.2.1" @@ -6516,6 +6744,23 @@ __metadata: languageName: node linkType: hard +"@metamask/utils@npm:^9.2.1, @metamask/utils@npm:^9.3.0": + version: 9.3.0 + resolution: "@metamask/utils@npm:9.3.0" + dependencies: + "@ethereumjs/tx": "npm:^4.2.0" + "@metamask/superstruct": "npm:^3.1.0" + "@noble/hashes": "npm:^1.3.1" + "@scure/base": "npm:^1.1.3" + "@types/debug": "npm:^4.1.7" + debug: "npm:^4.3.4" + pony-cause: "npm:^2.1.10" + semver: "npm:^7.5.4" + uuid: "npm:^9.0.1" + checksum: 10/ed6648cd973bbf3b4eb0e862903b795a99d27784c820e19f62f0bc0ddf353e98c2858d7e9aaebc0249a586391b344e35b9249d13c08e3ea0c74b23dc1c6b1558 + languageName: node + linkType: hard + "@metamask/wasm-example-snap@workspace:^, @metamask/wasm-example-snap@workspace:packages/examples/packages/wasm": version: 0.0.0-use.local resolution: "@metamask/wasm-example-snap@workspace:packages/examples/packages/wasm" @@ -6679,6 +6924,21 @@ __metadata: languageName: node linkType: hard +"@ngraveio/bc-ur@npm:^1.1.5": + version: 1.1.13 + resolution: "@ngraveio/bc-ur@npm:1.1.13" + dependencies: + "@keystonehq/alias-sampling": "npm:^0.1.1" + assert: "npm:^2.0.0" + bignumber.js: "npm:^9.0.1" + cbor-sync: "npm:^1.0.4" + crc: "npm:^3.8.0" + jsbi: "npm:^3.1.5" + sha.js: "npm:^2.4.11" + checksum: 10/0d3301b673a0bd9a069dae1f017cfd03010fddf19c1449d1a9e986b9b879ee4611f5af690ace9f59b75707573d1d3d6a4983166207db743425974a736689c6a0 + languageName: node + linkType: hard + "@noble/bls12-381@npm:^1.2.0": version: 1.4.0 resolution: "@noble/bls12-381@npm:1.4.0" @@ -7594,6 +7854,15 @@ __metadata: languageName: node linkType: hard +"@types/bn.js@npm:^5.1.0": + version: 5.1.6 + resolution: "@types/bn.js@npm:5.1.6" + dependencies: + "@types/node": "npm:*" + checksum: 10/db565b5a2af59b09459d74441153bf23a0e80f1fb2d070330786054e7ce1a7285dc40afcd8f289426c61a83166bdd70814f70e2d439744686aac5d3ea75daf13 + languageName: node + linkType: hard + "@types/bn.js@npm:^5.1.5": version: 5.1.5 resolution: "@types/bn.js@npm:5.1.5" @@ -8033,6 +8302,15 @@ __metadata: languageName: node linkType: hard +"@types/pbkdf2@npm:^3.0.0": + version: 3.1.2 + resolution: "@types/pbkdf2@npm:3.1.2" + dependencies: + "@types/node": "npm:*" + checksum: 10/bebe1e596cbbe5f7d2726a58859e61986c5a42459048e29cb7f2d4d764be6bbb0844572fd5d70ca8955a8a17e8b4ed80984fc4903e165d9efb8807a3fbb051aa + languageName: node + linkType: hard + "@types/prettier@npm:^2.1.5": version: 2.3.2 resolution: "@types/prettier@npm:2.3.2" @@ -8128,6 +8406,15 @@ __metadata: languageName: node linkType: hard +"@types/secp256k1@npm:^4.0.1": + version: 4.0.6 + resolution: "@types/secp256k1@npm:4.0.6" + dependencies: + "@types/node": "npm:*" + checksum: 10/211f823be990b55612e604d620acf0dc3bc942d3836bdd8da604269effabc86d98161e5947487b4e4e128f9180fc1682daae2f89ea7a4d9648fdfe52fba365fc + languageName: node + linkType: hard + "@types/semver@npm:^7.3.12, @types/semver@npm:^7.3.6, @types/semver@npm:^7.5.0": version: 7.5.0 resolution: "@types/semver@npm:7.5.0" @@ -8219,6 +8506,13 @@ __metadata: languageName: node linkType: hard +"@types/uuid@npm:^8.3.0": + version: 8.3.4 + resolution: "@types/uuid@npm:8.3.4" + checksum: 10/6f11f3ff70f30210edaa8071422d405e9c1d4e53abbe50fdce365150d3c698fe7bbff65c1e71ae080cbfb8fded860dbb5e174da96fdbbdfcaa3fb3daa474d20f + languageName: node + linkType: hard + "@types/validate-npm-package-name@npm:^4.0.0": version: 4.0.0 resolution: "@types/validate-npm-package-name@npm:4.0.0" @@ -9166,6 +9460,13 @@ __metadata: languageName: node linkType: hard +"aes-js@npm:^3.1.2": + version: 3.1.2 + resolution: "aes-js@npm:3.1.2" + checksum: 10/b65916767034a51375a3ac5aad62af452d89a386c1ae7b607bb9145d0bb8b8823bf2f3eba85bdfa52d61c65d5aed90ba90f677b8c826bfa1a8b7ae2fa3b54d91 + languageName: node + linkType: hard + "agent-base@npm:6, agent-base@npm:^6.0.2": version: 6.0.2 resolution: "agent-base@npm:6.0.2" @@ -9655,6 +9956,15 @@ __metadata: languageName: node linkType: hard +"async-mutex@npm:^0.5.0": + version: 0.5.0 + resolution: "async-mutex@npm:0.5.0" + dependencies: + tslib: "npm:^2.4.0" + checksum: 10/4c6bfce1cc9cd43f723c4d96403ac5f4757f885c953b839cde6956ec8817ff39623b82d67614de10c7933e21626925882fb9bac367db7d15d7cb4f84228722c9 + languageName: node + linkType: hard + "async@npm:^3.2.3, async@npm:^3.2.4": version: 3.2.4 resolution: "async@npm:3.2.4" @@ -9863,6 +10173,15 @@ __metadata: languageName: node linkType: hard +"base-x@npm:^3.0.2": + version: 3.0.10 + resolution: "base-x@npm:3.0.10" + dependencies: + safe-buffer: "npm:^5.0.1" + checksum: 10/52307739559e81d9980889de2359cb4f816cc0eb9a463028fa3ab239ab913d9044a1b47b4520f98e68453df32a457b8ba58b8d0ee7e757fc3fb971f3fa7a1482 + languageName: node + linkType: hard + "base64-js@npm:^1.0.2, base64-js@npm:^1.3.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" @@ -9893,6 +10212,13 @@ __metadata: languageName: node linkType: hard +"bech32@npm:^2.0.0": + version: 2.0.0 + resolution: "bech32@npm:2.0.0" + checksum: 10/fa15acb270b59aa496734a01f9155677b478987b773bf701f465858bf1606c6a970085babd43d71ce61895f1baa594cb41a2cd1394bd2c6698f03cc2d811300e + languageName: node + linkType: hard + "big-integer@npm:^1.6.17": version: 1.6.51 resolution: "big-integer@npm:1.6.51" @@ -9907,7 +10233,7 @@ __metadata: languageName: node linkType: hard -"bignumber.js@npm:^9.1.2": +"bignumber.js@npm:^9.0.1, bignumber.js@npm:^9.1.2": version: 9.1.2 resolution: "bignumber.js@npm:9.1.2" checksum: 10/d89b8800a987225d2c00dcbf8a69dc08e92aa0880157c851c287b307d31ceb2fc2acb0c62c3e3a3d42b6c5fcae9b004035f13eb4386e56d529d7edac18d5c9d8 @@ -9973,6 +10299,13 @@ __metadata: languageName: node linkType: hard +"blakejs@npm:^1.1.0": + version: 1.2.1 + resolution: "blakejs@npm:1.2.1" + checksum: 10/0638b1bd058b21892633929c43005aa6a4cc4b2ac5b338a146c3c076622f1b360795bd7a4d1f077c9b01863ed2df0c1504a81c5b520d164179120434847e6cd7 + languageName: node + linkType: hard + "bluebird@npm:~3.4.1": version: 3.4.7 resolution: "bluebird@npm:3.4.7" @@ -9980,7 +10313,7 @@ __metadata: languageName: node linkType: hard -"bn.js@npm:5.2.1, bn.js@npm:^5.0.0, bn.js@npm:^5.2.1": +"bn.js@npm:5.2.1, bn.js@npm:^5.0.0, bn.js@npm:^5.1.2, bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": version: 5.2.1 resolution: "bn.js@npm:5.2.1" checksum: 10/7a7e8764d7a6e9708b8b9841b2b3d6019cc154d2fc23716d0efecfe1e16921b7533c6f7361fb05471eab47986c4aa310c270f88e3507172104632ac8df2cfd84 @@ -10109,7 +10442,7 @@ __metadata: languageName: node linkType: hard -"browserify-aes@npm:^1.0.0, browserify-aes@npm:^1.0.4": +"browserify-aes@npm:^1.0.0, browserify-aes@npm:^1.0.4, browserify-aes@npm:^1.2.0": version: 1.2.0 resolution: "browserify-aes@npm:1.2.0" dependencies: @@ -10263,6 +10596,26 @@ __metadata: languageName: node linkType: hard +"bs58@npm:^4.0.0": + version: 4.0.1 + resolution: "bs58@npm:4.0.1" + dependencies: + base-x: "npm:^3.0.2" + checksum: 10/b3c5365bb9e0c561e1a82f1a2d809a1a692059fae016be233a6127ad2f50a6b986467c3a50669ce4c18929dcccb297c5909314dd347a25a68c21b68eb3e95ac2 + languageName: node + linkType: hard + +"bs58check@npm:^2.1.2": + version: 2.1.2 + resolution: "bs58check@npm:2.1.2" + dependencies: + bs58: "npm:^4.0.0" + create-hash: "npm:^1.1.0" + safe-buffer: "npm:^5.1.2" + checksum: 10/43bdf08a5dd04581b78f040bc4169480e17008da482ffe2a6507327bbc4fc5c28de0501f7faf22901cfe57fbca79cbb202ca529003fedb4cb8dccd265b38e54d + languageName: node + linkType: hard + "bser@npm:2.1.1": version: 2.1.1 resolution: "bser@npm:2.1.1" @@ -10300,7 +10653,7 @@ __metadata: languageName: node linkType: hard -"buffer@npm:^5.2.1, buffer@npm:^5.5.0": +"buffer@npm:^5.1.0, buffer@npm:^5.2.1, buffer@npm:^5.5.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" dependencies: @@ -10539,6 +10892,13 @@ __metadata: languageName: node linkType: hard +"cbor-sync@npm:^1.0.4": + version: 1.0.4 + resolution: "cbor-sync@npm:1.0.4" + checksum: 10/bdad5fbf442b5b2478ba59433cab145ad823f963f674ec42f3b730689e679327ec8a6dfab97724b63295badac915574139984e702475ff8025d7cb175e50e9ae + languageName: node + linkType: hard + "chainsaw@npm:~0.1.0": version: 0.1.0 resolution: "chainsaw@npm:0.1.0" @@ -11258,6 +11618,15 @@ __metadata: languageName: node linkType: hard +"crc@npm:^3.8.0": + version: 3.8.0 + resolution: "crc@npm:3.8.0" + dependencies: + buffer: "npm:^5.1.0" + checksum: 10/3a43061e692113d60fbaf5e438c5f6aa3374fe2368244a75cc083ecee6762513bcee8583f67c2c56feea0b0c72b41b7304fbd3c1e26cfcfaec310b9a18543fa8 + languageName: node + linkType: hard + "create-ecdh@npm:^4.0.0": version: 4.0.4 resolution: "create-ecdh@npm:4.0.4" @@ -12258,6 +12627,21 @@ __metadata: languageName: node linkType: hard +"elliptic@npm:^6.5.7": + version: 6.6.1 + resolution: "elliptic@npm:6.6.1" + dependencies: + bn.js: "npm:^4.11.9" + brorand: "npm:^1.1.0" + hash.js: "npm:^1.0.0" + hmac-drbg: "npm:^1.0.1" + inherits: "npm:^2.0.4" + minimalistic-assert: "npm:^1.0.1" + minimalistic-crypto-utils: "npm:^1.0.1" + checksum: 10/dc678c9febd89a219c4008ba3a9abb82237be853d9fd171cd602c8fb5ec39927e65c6b5e7a1b2a4ea82ee8e0ded72275e7932bb2da04a5790c2638b818e4e1c5 + languageName: node + linkType: hard + "emittery@npm:^0.13.1": version: 0.13.1 resolution: "emittery@npm:0.13.1" @@ -13296,6 +13680,29 @@ __metadata: languageName: node linkType: hard +"ethereum-cryptography@npm:^0.1.3": + version: 0.1.3 + resolution: "ethereum-cryptography@npm:0.1.3" + dependencies: + "@types/pbkdf2": "npm:^3.0.0" + "@types/secp256k1": "npm:^4.0.1" + blakejs: "npm:^1.1.0" + browserify-aes: "npm:^1.2.0" + bs58check: "npm:^2.1.2" + create-hash: "npm:^1.2.0" + create-hmac: "npm:^1.1.7" + hash.js: "npm:^1.1.7" + keccak: "npm:^3.0.0" + pbkdf2: "npm:^3.0.17" + randombytes: "npm:^2.1.0" + safe-buffer: "npm:^5.1.2" + scrypt-js: "npm:^3.0.0" + secp256k1: "npm:^4.0.1" + setimmediate: "npm:^1.0.5" + checksum: 10/975e476782746acd97d5b37366801ae622a52fb31e5d83f600804be230a61ef7b9d289dcecd9c308fb441967caf3a6e3768dd7c8add6441fcc60c398175d5a96 + languageName: node + linkType: hard + "ethereum-cryptography@npm:^2.0.0, ethereum-cryptography@npm:^2.1.2": version: 2.1.2 resolution: "ethereum-cryptography@npm:2.1.2" @@ -13308,6 +13715,35 @@ __metadata: languageName: node linkType: hard +"ethereumjs-util@npm:^7.1.2": + version: 7.1.5 + resolution: "ethereumjs-util@npm:7.1.5" + dependencies: + "@types/bn.js": "npm:^5.1.0" + bn.js: "npm:^5.1.2" + create-hash: "npm:^1.1.2" + ethereum-cryptography: "npm:^0.1.3" + rlp: "npm:^2.2.4" + checksum: 10/f28fc1ebb8f35bf9e418f76f51be737d94d603b912c3e014c4e87cd45ccd1b10bdfef764c8f152574b57e9faa260a18773cbc110f9e0a754d6b3730699e54dc9 + languageName: node + linkType: hard + +"ethereumjs-wallet@npm:^1.0.1": + version: 1.0.2 + resolution: "ethereumjs-wallet@npm:1.0.2" + dependencies: + aes-js: "npm:^3.1.2" + bs58check: "npm:^2.1.2" + ethereum-cryptography: "npm:^0.1.3" + ethereumjs-util: "npm:^7.1.2" + randombytes: "npm:^2.1.0" + scrypt-js: "npm:^3.0.1" + utf8: "npm:^3.0.0" + uuid: "npm:^8.3.2" + checksum: 10/0a9ad0ac0930627c15e6fa6115dde8d1dd81160e57fbdf81ef0bcd1e0edd750fe9e8b00992651e694cabefee29eef2ad651dce8b24ae5253861927d0e19b6c90 + languageName: node + linkType: hard + "ethers@npm:^6.3.0": version: 6.13.4 resolution: "ethers@npm:6.13.4" @@ -14694,7 +15130,7 @@ __metadata: languageName: node linkType: hard -"hash.js@npm:^1.0.0, hash.js@npm:^1.0.3": +"hash.js@npm:^1.0.0, hash.js@npm:^1.0.3, hash.js@npm:^1.1.7": version: 1.1.7 resolution: "hash.js@npm:1.1.7" dependencies: @@ -14713,6 +15149,18 @@ __metadata: languageName: node linkType: hard +"hdkey@npm:^2.0.1": + version: 2.1.0 + resolution: "hdkey@npm:2.1.0" + dependencies: + bs58check: "npm:^2.1.2" + ripemd160: "npm:^2.0.2" + safe-buffer: "npm:^5.1.1" + secp256k1: "npm:^4.0.0" + checksum: 10/c4ee2189ea3d87070ebd14ad7368e292b1e0b30e4d8a107eb8f33624634df6e57b8a3b2cda65b3bd97e88474f6798cfdbe7b63b6037429f0e169321d84a0db58 + languageName: node + linkType: hard + "he@npm:1.2.0, he@npm:^1.2.0": version: 1.2.0 resolution: "he@npm:1.2.0" @@ -16480,6 +16928,13 @@ __metadata: languageName: node linkType: hard +"jsbi@npm:^3.1.5": + version: 3.2.5 + resolution: "jsbi@npm:3.2.5" + checksum: 10/2cceb3a06dcb16493e936aa22384d912dd5f0a1fd474b97b5c6705011bd0aac8214d9a392a730b3f3ffb61a8fbe910a34d0fe881329be6a02857520d7a61ace6 + languageName: node + linkType: hard + "jsbn@npm:1.1.0": version: 1.1.0 resolution: "jsbn@npm:1.1.0" @@ -16678,6 +17133,13 @@ __metadata: languageName: node linkType: hard +"jsonschema@npm:^1.4.1": + version: 1.5.0 + resolution: "jsonschema@npm:1.5.0" + checksum: 10/46bf49b388ba922073bcb3c8d5e90af9d29fc8303dc866fd440182c88d6b4fd2807679fd39cdefb4113156d104ea47da9c0ff4bbcb0032c9fa29461cb1a92182 + languageName: node + linkType: hard + "jsx-ast-utils@npm:^2.4.1 || ^3.0.0": version: 3.3.3 resolution: "jsx-ast-utils@npm:3.3.3" @@ -16688,6 +17150,18 @@ __metadata: languageName: node linkType: hard +"keccak@npm:^3.0.0": + version: 3.0.4 + resolution: "keccak@npm:3.0.4" + dependencies: + node-addon-api: "npm:^2.0.0" + node-gyp: "npm:latest" + node-gyp-build: "npm:^4.2.0" + readable-stream: "npm:^3.6.0" + checksum: 10/45478bb0a57e44d0108646499b8360914b0fbc8b0e088f1076659cb34faaa9eb829c40f6dd9dadb3460bb86cc33153c41fed37fe5ce09465a60e71e78c23fa55 + languageName: node + linkType: hard + "keyv@npm:^4.5.3": version: 4.5.3 resolution: "keyv@npm:4.5.3" @@ -18068,6 +18542,24 @@ __metadata: languageName: node linkType: hard +"node-addon-api@npm:^2.0.0": + version: 2.0.2 + resolution: "node-addon-api@npm:2.0.2" + dependencies: + node-gyp: "npm:latest" + checksum: 10/e4ce4daac5b2fefa6b94491b86979a9c12d9cceba571d2c6df1eb5859f9da68e5dc198f128798e1785a88aafee6e11f4992dcccd4bf86bec90973927d158bd60 + languageName: node + linkType: hard + +"node-addon-api@npm:^5.0.0": + version: 5.1.0 + resolution: "node-addon-api@npm:5.1.0" + dependencies: + node-gyp: "npm:latest" + checksum: 10/595f59ffb4630564f587c502119cbd980d302e482781021f3b479f5fc7e41cf8f2f7280fdc2795f32d148e4f3259bd15043c52d4a3442796aa6f1ae97b959636 + languageName: node + linkType: hard + "node-addon-api@npm:^6.1.0": version: 6.1.0 resolution: "node-addon-api@npm:6.1.0" @@ -18134,6 +18626,17 @@ __metadata: languageName: node linkType: hard +"node-gyp-build@npm:^4.2.0": + version: 4.8.4 + resolution: "node-gyp-build@npm:4.8.4" + bin: + node-gyp-build: bin.js + node-gyp-build-optional: optional.js + node-gyp-build-test: build-test.js + checksum: 10/6a7d62289d1afc419fc8fc9bd00aa4e554369e50ca0acbc215cb91446148b75ff7e2a3b53c2c5b2c09a39d416d69f3d3237937860373104b5fe429bf30ad9ac5 + languageName: node + linkType: hard + "node-gyp@npm:^10.0.0": version: 10.0.1 resolution: "node-gyp@npm:10.0.1" @@ -18925,6 +19428,19 @@ __metadata: languageName: node linkType: hard +"pbkdf2@npm:^3.0.17": + version: 3.1.2 + resolution: "pbkdf2@npm:3.1.2" + dependencies: + create-hash: "npm:^1.1.2" + create-hmac: "npm:^1.1.4" + ripemd160: "npm:^2.0.1" + safe-buffer: "npm:^5.0.1" + sha.js: "npm:^2.4.8" + checksum: 10/40bdf30df1c9bb1ae41ec50c11e480cf0d36484b7c7933bf55e4451d1d0e3f09589df70935c56e7fccc5702779a0d7b842d012be8c08a187b44eb24d55bb9460 + languageName: node + linkType: hard + "pbkdf2@npm:^3.0.3": version: 3.1.1 resolution: "pbkdf2@npm:3.1.1" @@ -20421,7 +20937,7 @@ __metadata: languageName: node linkType: hard -"ripemd160@npm:^2.0.0, ripemd160@npm:^2.0.1": +"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" dependencies: @@ -20431,6 +20947,26 @@ __metadata: languageName: node linkType: hard +"rlp@npm:^2.2.4, rlp@npm:^2.2.6": + version: 2.2.7 + resolution: "rlp@npm:2.2.7" + dependencies: + bn.js: "npm:^5.2.0" + bin: + rlp: bin/rlp + checksum: 10/cf1919a2dc99f336191b3363b76299db567c192b7ee3c6f5c722728c34f65577883c9c88eeb7a1bfcbc26693c8a4f1fb0662e79ee86f0c98dd258d6987303498 + languageName: node + linkType: hard + +"rlp@npm:^3.0.0": + version: 3.0.0 + resolution: "rlp@npm:3.0.0" + bin: + rlp: bin/rlp + checksum: 10/c85549fa5368ef029707d02f0937c0c503b69fb330c5941508c9eef537a4f179fbeecd17149aeb795d430ed5249b68d7c66383a9863068712a191d388786cfc1 + languageName: node + linkType: hard + "rollup-plugin-inject@npm:^3.0.0": version: 3.0.2 resolution: "rollup-plugin-inject@npm:3.0.2" @@ -20662,6 +21198,25 @@ __metadata: languageName: node linkType: hard +"scrypt-js@npm:^3.0.0, scrypt-js@npm:^3.0.1": + version: 3.0.1 + resolution: "scrypt-js@npm:3.0.1" + checksum: 10/2f8aa72b7f76a6f9c446bbec5670f80d47497bccce98474203d89b5667717223eeb04a50492ae685ed7adc5a060fc2d8f9fd988f8f7ebdaf3341967f3aeff116 + languageName: node + linkType: hard + +"secp256k1@npm:^4.0.0, secp256k1@npm:^4.0.1": + version: 4.0.4 + resolution: "secp256k1@npm:4.0.4" + dependencies: + elliptic: "npm:^6.5.7" + node-addon-api: "npm:^5.0.0" + node-gyp: "npm:latest" + node-gyp-build: "npm:^4.2.0" + checksum: 10/45000f348c853df7c1e2b67c48efb062ae78c0620ab1a5cfb02fa20d3aad39c641f4e7a18b3de3b54a7c0cc1e0addeb8ecd9d88bc332e92df17a92b60c36122a + languageName: node + linkType: hard + "select-hose@npm:^2.0.0": version: 2.0.0 resolution: "select-hose@npm:2.0.0" @@ -20832,7 +21387,7 @@ __metadata: languageName: node linkType: hard -"setimmediate@npm:^1.0.4, setimmediate@npm:~1.0.4": +"setimmediate@npm:^1.0.4, setimmediate@npm:^1.0.5, setimmediate@npm:~1.0.4": version: 1.0.5 resolution: "setimmediate@npm:1.0.5" checksum: 10/76e3f5d7f4b581b6100ff819761f04a984fa3f3990e72a6554b57188ded53efce2d3d6c0932c10f810b7c59414f85e2ab3c11521877d1dea1ce0b56dc906f485 @@ -20853,7 +21408,7 @@ __metadata: languageName: node linkType: hard -"sha.js@npm:^2.4.0, sha.js@npm:^2.4.8": +"sha.js@npm:^2.4.0, sha.js@npm:^2.4.11, sha.js@npm:^2.4.8": version: 2.4.11 resolution: "sha.js@npm:2.4.11" dependencies: @@ -22177,6 +22732,13 @@ __metadata: languageName: node linkType: hard +"tslib@npm:^2.3.0": + version: 2.8.1 + resolution: "tslib@npm:2.8.1" + checksum: 10/3e2e043d5c2316461cb54e5c7fe02c30ef6dccb3384717ca22ae5c6b5bc95232a6241df19c622d9c73b809bea33b187f6dbc73030963e29950c2141bc32a79f7 + languageName: node + linkType: hard + "tsutils@npm:^3.21.0": version: 3.21.0 resolution: "tsutils@npm:3.21.0" @@ -22640,6 +23202,13 @@ __metadata: languageName: node linkType: hard +"utf8@npm:^3.0.0": + version: 3.0.0 + resolution: "utf8@npm:3.0.0" + checksum: 10/31d19c4faacbb65b09ebc1c21c32b20bdb0919c6f6773cee5001b99bb83f8e503e7233c08fc71ebb34f7cfebd95cec3243b81d90176097aa2f286cccb4ce866e + languageName: node + linkType: hard + "util-deprecate@npm:^1.0.1, util-deprecate@npm:^1.0.2, util-deprecate@npm:~1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2"