@metamask-previews/multichain-account-service 1.6.2-preview-9fa15fd0 → 2.0.0-preview-46d2c977

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.0.0]
11
+
12
+ ### Changed
13
+
14
+ - **BREAKING:** Use new `Messenger` from `@metamask/messenger` ([#6544](https://github.com/MetaMask/core/pull/6544))
15
+ - Previously, `MultichainAccountService` accepted a `RestrictedMessenger` instance from `@metamask/base-controller`.
16
+ - **BREAKING:** Bump `@metamask/accounts-controller` from `^33.0.0` to `^34.0.0` ([#6962](https://github.com/MetaMask/core/pull/6962))
17
+ - **BREAKING:** Bump `@metamask/keyring-controller` from `^23.0.0` to `^24.0.0` ([#6962](https://github.com/MetaMask/core/pull/6962))
18
+ - Bump `@metamask/base-controller` from `^8.4.2` to `^9.0.0` ([#6962](https://github.com/MetaMask/core/pull/6962))
19
+ - Bump `@metamask/eth-snap-keyring` from `^17.0.0` to `^18.0.0` ([#6951](https://github.com/MetaMask/core/pull/6951))
20
+
10
21
  ## [1.6.2]
11
22
 
12
23
  ### Changed
@@ -233,7 +244,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
233
244
  - Add `MultichainAccountService` ([#6141](https://github.com/MetaMask/core/pull/6141)), ([#6165](https://github.com/MetaMask/core/pull/6165))
234
245
  - This service manages multichain accounts/wallets.
235
246
 
236
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/multichain-account-service@1.6.2...HEAD
247
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/multichain-account-service@2.0.0...HEAD
248
+ [2.0.0]: https://github.com/MetaMask/core/compare/@metamask/multichain-account-service@1.6.2...@metamask/multichain-account-service@2.0.0
237
249
  [1.6.2]: https://github.com/MetaMask/core/compare/@metamask/multichain-account-service@1.6.1...@metamask/multichain-account-service@1.6.2
238
250
  [1.6.1]: https://github.com/MetaMask/core/compare/@metamask/multichain-account-service@1.6.0...@metamask/multichain-account-service@1.6.1
239
251
  [1.6.0]: https://github.com/MetaMask/core/compare/@metamask/multichain-account-service@1.5.0...@metamask/multichain-account-service@1.6.0
@@ -1,31 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getMultichainAccountServiceMessenger = exports.getRootMessenger = void 0;
4
- const base_controller_1 = require("@metamask/base-controller");
4
+ const messenger_1 = require("@metamask/messenger");
5
5
  /**
6
- * Creates a new root messenger instance for testing.
6
+ * Creates and returns a root messenger for testing
7
7
  *
8
- * @returns A new Messenger instance.
8
+ * @returns A messenger instance
9
9
  */
10
10
  function getRootMessenger() {
11
- return new base_controller_1.Messenger();
11
+ return new messenger_1.Messenger({
12
+ namespace: messenger_1.MOCK_ANY_NAMESPACE,
13
+ });
12
14
  }
13
15
  exports.getRootMessenger = getRootMessenger;
14
16
  /**
15
17
  * Retrieves a restricted messenger for the MultichainAccountService.
16
18
  *
17
- * @param messenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
19
+ * @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
18
20
  * @returns The restricted messenger for the MultichainAccountService.
19
21
  */
20
- function getMultichainAccountServiceMessenger(messenger) {
21
- return messenger.getRestricted({
22
- name: 'MultichainAccountService',
23
- allowedEvents: [
24
- 'KeyringController:stateChange',
25
- 'AccountsController:accountAdded',
26
- 'AccountsController:accountRemoved',
27
- ],
28
- allowedActions: [
22
+ function getMultichainAccountServiceMessenger(rootMessenger) {
23
+ const messenger = new messenger_1.Messenger({
24
+ namespace: 'MultichainAccountService',
25
+ parent: rootMessenger,
26
+ });
27
+ rootMessenger.delegate({
28
+ messenger,
29
+ actions: [
29
30
  'AccountsController:getAccount',
30
31
  'AccountsController:getAccountByAddress',
31
32
  'AccountsController:listMultichainAccounts',
@@ -37,7 +38,13 @@ function getMultichainAccountServiceMessenger(messenger) {
37
38
  'NetworkController:findNetworkClientIdByChainId',
38
39
  'NetworkController:getNetworkClientById',
39
40
  ],
41
+ events: [
42
+ 'KeyringController:stateChange',
43
+ 'AccountsController:accountAdded',
44
+ 'AccountsController:accountRemoved',
45
+ ],
40
46
  });
47
+ return messenger;
41
48
  }
42
49
  exports.getMultichainAccountServiceMessenger = getMultichainAccountServiceMessenger;
43
50
  //# sourceMappingURL=messenger.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"messenger.cjs","sourceRoot":"","sources":["../../src/tests/messenger.ts"],"names":[],"mappings":";;;AAAA,+DAAsD;AAUtD;;;;GAIG;AACH,SAAgB,gBAAgB;IAC9B,OAAO,IAAI,2BAAS,EAGjB,CAAC;AACN,CAAC;AALD,4CAKC;AAED;;;;;GAKG;AACH,SAAgB,oCAAoC,CAClD,SAA8C;IAE9C,OAAO,SAAS,CAAC,aAAa,CAAC;QAC7B,IAAI,EAAE,0BAA0B;QAChC,aAAa,EAAE;YACb,+BAA+B;YAC/B,iCAAiC;YACjC,mCAAmC;SACpC;QACD,cAAc,EAAE;YACd,+BAA+B;YAC/B,wCAAwC;YACxC,2CAA2C;YAC3C,8BAA8B;YAC9B,+BAA+B;YAC/B,4BAA4B;YAC5B,qCAAqC;YACrC,iCAAiC;YACjC,gDAAgD;YAChD,wCAAwC;SACzC;KACF,CAAC,CAAC;AACL,CAAC;AAvBD,oFAuBC","sourcesContent":["import { Messenger } from '@metamask/base-controller';\n\nimport type {\n AllowedActions,\n AllowedEvents,\n MultichainAccountServiceActions,\n MultichainAccountServiceEvents,\n MultichainAccountServiceMessenger,\n} from '../types';\n\n/**\n * Creates a new root messenger instance for testing.\n *\n * @returns A new Messenger instance.\n */\nexport function getRootMessenger() {\n return new Messenger<\n MultichainAccountServiceActions | AllowedActions,\n MultichainAccountServiceEvents | AllowedEvents\n >();\n}\n\n/**\n * Retrieves a restricted messenger for the MultichainAccountService.\n *\n * @param messenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().\n * @returns The restricted messenger for the MultichainAccountService.\n */\nexport function getMultichainAccountServiceMessenger(\n messenger: ReturnType<typeof getRootMessenger>,\n): MultichainAccountServiceMessenger {\n return messenger.getRestricted({\n name: 'MultichainAccountService',\n allowedEvents: [\n 'KeyringController:stateChange',\n 'AccountsController:accountAdded',\n 'AccountsController:accountRemoved',\n ],\n allowedActions: [\n 'AccountsController:getAccount',\n 'AccountsController:getAccountByAddress',\n 'AccountsController:listMultichainAccounts',\n 'SnapController:handleRequest',\n 'KeyringController:withKeyring',\n 'KeyringController:getState',\n 'KeyringController:getKeyringsByType',\n 'KeyringController:addNewKeyring',\n 'NetworkController:findNetworkClientIdByChainId',\n 'NetworkController:getNetworkClientById',\n ],\n });\n}\n"]}
1
+ {"version":3,"file":"messenger.cjs","sourceRoot":"","sources":["../../src/tests/messenger.ts"],"names":[],"mappings":";;;AAAA,mDAM6B;AAgB7B;;;;GAIG;AACH,SAAgB,gBAAgB;IAC9B,OAAO,IAAI,qBAAS,CAAC;QACnB,SAAS,EAAE,8BAAkB;KAC9B,CAAC,CAAC;AACL,CAAC;AAJD,4CAIC;AAED;;;;;GAKG;AACH,SAAgB,oCAAoC,CAClD,aAA4B;IAE5B,MAAM,SAAS,GAAG,IAAI,qBAAS,CAK7B;QACA,SAAS,EAAE,0BAA0B;QACrC,MAAM,EAAE,aAAa;KACtB,CAAC,CAAC;IACH,aAAa,CAAC,QAAQ,CAAC;QACrB,SAAS;QACT,OAAO,EAAE;YACP,+BAA+B;YAC/B,wCAAwC;YACxC,2CAA2C;YAC3C,8BAA8B;YAC9B,+BAA+B;YAC/B,4BAA4B;YAC5B,qCAAqC;YACrC,iCAAiC;YACjC,gDAAgD;YAChD,wCAAwC;SACzC;QACD,MAAM,EAAE;YACN,+BAA+B;YAC/B,iCAAiC;YACjC,mCAAmC;SACpC;KACF,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC;AAjCD,oFAiCC","sourcesContent":["import {\n Messenger,\n MOCK_ANY_NAMESPACE,\n type MessengerActions,\n type MessengerEvents,\n type MockAnyNamespace,\n} from '@metamask/messenger';\n\nimport type { MultichainAccountServiceMessenger } from '../types';\n\ntype AllMultichainAccountServiceActions =\n MessengerActions<MultichainAccountServiceMessenger>;\n\ntype AllMultichainAccountServiceEvents =\n MessengerEvents<MultichainAccountServiceMessenger>;\n\nexport type RootMessenger = Messenger<\n MockAnyNamespace,\n AllMultichainAccountServiceActions,\n AllMultichainAccountServiceEvents\n>;\n\n/**\n * Creates and returns a root messenger for testing\n *\n * @returns A messenger instance\n */\nexport function getRootMessenger(): RootMessenger {\n return new Messenger({\n namespace: MOCK_ANY_NAMESPACE,\n });\n}\n\n/**\n * Retrieves a restricted messenger for the MultichainAccountService.\n *\n * @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().\n * @returns The restricted messenger for the MultichainAccountService.\n */\nexport function getMultichainAccountServiceMessenger(\n rootMessenger: RootMessenger,\n): MultichainAccountServiceMessenger {\n const messenger = new Messenger<\n 'MultichainAccountService',\n AllMultichainAccountServiceActions,\n AllMultichainAccountServiceEvents,\n RootMessenger\n >({\n namespace: 'MultichainAccountService',\n parent: rootMessenger,\n });\n rootMessenger.delegate({\n messenger,\n actions: [\n 'AccountsController:getAccount',\n 'AccountsController:getAccountByAddress',\n 'AccountsController:listMultichainAccounts',\n 'SnapController:handleRequest',\n 'KeyringController:withKeyring',\n 'KeyringController:getState',\n 'KeyringController:getKeyringsByType',\n 'KeyringController:addNewKeyring',\n 'NetworkController:findNetworkClientIdByChainId',\n 'NetworkController:getNetworkClientById',\n ],\n events: [\n 'KeyringController:stateChange',\n 'AccountsController:accountAdded',\n 'AccountsController:accountRemoved',\n ],\n });\n return messenger;\n}\n"]}
@@ -1,16 +1,20 @@
1
- import { Messenger } from "@metamask/base-controller";
2
- import type { AllowedActions, AllowedEvents, MultichainAccountServiceActions, MultichainAccountServiceEvents, MultichainAccountServiceMessenger } from "../types.cjs";
1
+ import { Messenger, type MessengerActions, type MessengerEvents, type MockAnyNamespace } from "@metamask/messenger";
2
+ import type { MultichainAccountServiceMessenger } from "../types.cjs";
3
+ type AllMultichainAccountServiceActions = MessengerActions<MultichainAccountServiceMessenger>;
4
+ type AllMultichainAccountServiceEvents = MessengerEvents<MultichainAccountServiceMessenger>;
5
+ export type RootMessenger = Messenger<MockAnyNamespace, AllMultichainAccountServiceActions, AllMultichainAccountServiceEvents>;
3
6
  /**
4
- * Creates a new root messenger instance for testing.
7
+ * Creates and returns a root messenger for testing
5
8
  *
6
- * @returns A new Messenger instance.
9
+ * @returns A messenger instance
7
10
  */
8
- export declare function getRootMessenger(): Messenger<MultichainAccountServiceActions | AllowedActions, MultichainAccountServiceEvents | AllowedEvents>;
11
+ export declare function getRootMessenger(): RootMessenger;
9
12
  /**
10
13
  * Retrieves a restricted messenger for the MultichainAccountService.
11
14
  *
12
- * @param messenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
15
+ * @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
13
16
  * @returns The restricted messenger for the MultichainAccountService.
14
17
  */
15
- export declare function getMultichainAccountServiceMessenger(messenger: ReturnType<typeof getRootMessenger>): MultichainAccountServiceMessenger;
18
+ export declare function getMultichainAccountServiceMessenger(rootMessenger: RootMessenger): MultichainAccountServiceMessenger;
19
+ export {};
16
20
  //# sourceMappingURL=messenger.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messenger.d.cts","sourceRoot":"","sources":["../../src/tests/messenger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kCAAkC;AAEtD,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,+BAA+B,EAC/B,8BAA8B,EAC9B,iCAAiC,EAClC,qBAAiB;AAElB;;;;GAIG;AACH,wBAAgB,gBAAgB,gHAK/B;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,SAAS,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,GAC7C,iCAAiC,CAqBnC"}
1
+ {"version":3,"file":"messenger.d.cts","sourceRoot":"","sources":["../../src/tests/messenger.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,4BAA4B;AAE7B,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAiB;AAElE,KAAK,kCAAkC,GACrC,gBAAgB,CAAC,iCAAiC,CAAC,CAAC;AAEtD,KAAK,iCAAiC,GACpC,eAAe,CAAC,iCAAiC,CAAC,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG,SAAS,CACnC,gBAAgB,EAChB,kCAAkC,EAClC,iCAAiC,CAClC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAIhD;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,aAAa,EAAE,aAAa,GAC3B,iCAAiC,CA+BnC"}
@@ -1,16 +1,20 @@
1
- import { Messenger } from "@metamask/base-controller";
2
- import type { AllowedActions, AllowedEvents, MultichainAccountServiceActions, MultichainAccountServiceEvents, MultichainAccountServiceMessenger } from "../types.mjs";
1
+ import { Messenger, type MessengerActions, type MessengerEvents, type MockAnyNamespace } from "@metamask/messenger";
2
+ import type { MultichainAccountServiceMessenger } from "../types.mjs";
3
+ type AllMultichainAccountServiceActions = MessengerActions<MultichainAccountServiceMessenger>;
4
+ type AllMultichainAccountServiceEvents = MessengerEvents<MultichainAccountServiceMessenger>;
5
+ export type RootMessenger = Messenger<MockAnyNamespace, AllMultichainAccountServiceActions, AllMultichainAccountServiceEvents>;
3
6
  /**
4
- * Creates a new root messenger instance for testing.
7
+ * Creates and returns a root messenger for testing
5
8
  *
6
- * @returns A new Messenger instance.
9
+ * @returns A messenger instance
7
10
  */
8
- export declare function getRootMessenger(): Messenger<MultichainAccountServiceActions | AllowedActions, MultichainAccountServiceEvents | AllowedEvents>;
11
+ export declare function getRootMessenger(): RootMessenger;
9
12
  /**
10
13
  * Retrieves a restricted messenger for the MultichainAccountService.
11
14
  *
12
- * @param messenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
15
+ * @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
13
16
  * @returns The restricted messenger for the MultichainAccountService.
14
17
  */
15
- export declare function getMultichainAccountServiceMessenger(messenger: ReturnType<typeof getRootMessenger>): MultichainAccountServiceMessenger;
18
+ export declare function getMultichainAccountServiceMessenger(rootMessenger: RootMessenger): MultichainAccountServiceMessenger;
19
+ export {};
16
20
  //# sourceMappingURL=messenger.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messenger.d.mts","sourceRoot":"","sources":["../../src/tests/messenger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kCAAkC;AAEtD,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,+BAA+B,EAC/B,8BAA8B,EAC9B,iCAAiC,EAClC,qBAAiB;AAElB;;;;GAIG;AACH,wBAAgB,gBAAgB,gHAK/B;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,SAAS,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,GAC7C,iCAAiC,CAqBnC"}
1
+ {"version":3,"file":"messenger.d.mts","sourceRoot":"","sources":["../../src/tests/messenger.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,4BAA4B;AAE7B,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAiB;AAElE,KAAK,kCAAkC,GACrC,gBAAgB,CAAC,iCAAiC,CAAC,CAAC;AAEtD,KAAK,iCAAiC,GACpC,eAAe,CAAC,iCAAiC,CAAC,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG,SAAS,CACnC,gBAAgB,EAChB,kCAAkC,EAClC,iCAAiC,CAClC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAIhD;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,aAAa,EAAE,aAAa,GAC3B,iCAAiC,CA+BnC"}
@@ -1,27 +1,28 @@
1
- import { Messenger } from "@metamask/base-controller";
1
+ import { Messenger, MOCK_ANY_NAMESPACE } from "@metamask/messenger";
2
2
  /**
3
- * Creates a new root messenger instance for testing.
3
+ * Creates and returns a root messenger for testing
4
4
  *
5
- * @returns A new Messenger instance.
5
+ * @returns A messenger instance
6
6
  */
7
7
  export function getRootMessenger() {
8
- return new Messenger();
8
+ return new Messenger({
9
+ namespace: MOCK_ANY_NAMESPACE,
10
+ });
9
11
  }
10
12
  /**
11
13
  * Retrieves a restricted messenger for the MultichainAccountService.
12
14
  *
13
- * @param messenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
15
+ * @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
14
16
  * @returns The restricted messenger for the MultichainAccountService.
15
17
  */
16
- export function getMultichainAccountServiceMessenger(messenger) {
17
- return messenger.getRestricted({
18
- name: 'MultichainAccountService',
19
- allowedEvents: [
20
- 'KeyringController:stateChange',
21
- 'AccountsController:accountAdded',
22
- 'AccountsController:accountRemoved',
23
- ],
24
- allowedActions: [
18
+ export function getMultichainAccountServiceMessenger(rootMessenger) {
19
+ const messenger = new Messenger({
20
+ namespace: 'MultichainAccountService',
21
+ parent: rootMessenger,
22
+ });
23
+ rootMessenger.delegate({
24
+ messenger,
25
+ actions: [
25
26
  'AccountsController:getAccount',
26
27
  'AccountsController:getAccountByAddress',
27
28
  'AccountsController:listMultichainAccounts',
@@ -33,6 +34,12 @@ export function getMultichainAccountServiceMessenger(messenger) {
33
34
  'NetworkController:findNetworkClientIdByChainId',
34
35
  'NetworkController:getNetworkClientById',
35
36
  ],
37
+ events: [
38
+ 'KeyringController:stateChange',
39
+ 'AccountsController:accountAdded',
40
+ 'AccountsController:accountRemoved',
41
+ ],
36
42
  });
43
+ return messenger;
37
44
  }
38
45
  //# sourceMappingURL=messenger.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"messenger.mjs","sourceRoot":"","sources":["../../src/tests/messenger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kCAAkC;AAUtD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,SAAS,EAGjB,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oCAAoC,CAClD,SAA8C;IAE9C,OAAO,SAAS,CAAC,aAAa,CAAC;QAC7B,IAAI,EAAE,0BAA0B;QAChC,aAAa,EAAE;YACb,+BAA+B;YAC/B,iCAAiC;YACjC,mCAAmC;SACpC;QACD,cAAc,EAAE;YACd,+BAA+B;YAC/B,wCAAwC;YACxC,2CAA2C;YAC3C,8BAA8B;YAC9B,+BAA+B;YAC/B,4BAA4B;YAC5B,qCAAqC;YACrC,iCAAiC;YACjC,gDAAgD;YAChD,wCAAwC;SACzC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Messenger } from '@metamask/base-controller';\n\nimport type {\n AllowedActions,\n AllowedEvents,\n MultichainAccountServiceActions,\n MultichainAccountServiceEvents,\n MultichainAccountServiceMessenger,\n} from '../types';\n\n/**\n * Creates a new root messenger instance for testing.\n *\n * @returns A new Messenger instance.\n */\nexport function getRootMessenger() {\n return new Messenger<\n MultichainAccountServiceActions | AllowedActions,\n MultichainAccountServiceEvents | AllowedEvents\n >();\n}\n\n/**\n * Retrieves a restricted messenger for the MultichainAccountService.\n *\n * @param messenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().\n * @returns The restricted messenger for the MultichainAccountService.\n */\nexport function getMultichainAccountServiceMessenger(\n messenger: ReturnType<typeof getRootMessenger>,\n): MultichainAccountServiceMessenger {\n return messenger.getRestricted({\n name: 'MultichainAccountService',\n allowedEvents: [\n 'KeyringController:stateChange',\n 'AccountsController:accountAdded',\n 'AccountsController:accountRemoved',\n ],\n allowedActions: [\n 'AccountsController:getAccount',\n 'AccountsController:getAccountByAddress',\n 'AccountsController:listMultichainAccounts',\n 'SnapController:handleRequest',\n 'KeyringController:withKeyring',\n 'KeyringController:getState',\n 'KeyringController:getKeyringsByType',\n 'KeyringController:addNewKeyring',\n 'NetworkController:findNetworkClientIdByChainId',\n 'NetworkController:getNetworkClientById',\n ],\n });\n}\n"]}
1
+ {"version":3,"file":"messenger.mjs","sourceRoot":"","sources":["../../src/tests/messenger.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,kBAAkB,EAInB,4BAA4B;AAgB7B;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,SAAS,CAAC;QACnB,SAAS,EAAE,kBAAkB;KAC9B,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oCAAoC,CAClD,aAA4B;IAE5B,MAAM,SAAS,GAAG,IAAI,SAAS,CAK7B;QACA,SAAS,EAAE,0BAA0B;QACrC,MAAM,EAAE,aAAa;KACtB,CAAC,CAAC;IACH,aAAa,CAAC,QAAQ,CAAC;QACrB,SAAS;QACT,OAAO,EAAE;YACP,+BAA+B;YAC/B,wCAAwC;YACxC,2CAA2C;YAC3C,8BAA8B;YAC9B,+BAA+B;YAC/B,4BAA4B;YAC5B,qCAAqC;YACrC,iCAAiC;YACjC,gDAAgD;YAChD,wCAAwC;SACzC;QACD,MAAM,EAAE;YACN,+BAA+B;YAC/B,iCAAiC;YACjC,mCAAmC;SACpC;KACF,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import {\n Messenger,\n MOCK_ANY_NAMESPACE,\n type MessengerActions,\n type MessengerEvents,\n type MockAnyNamespace,\n} from '@metamask/messenger';\n\nimport type { MultichainAccountServiceMessenger } from '../types';\n\ntype AllMultichainAccountServiceActions =\n MessengerActions<MultichainAccountServiceMessenger>;\n\ntype AllMultichainAccountServiceEvents =\n MessengerEvents<MultichainAccountServiceMessenger>;\n\nexport type RootMessenger = Messenger<\n MockAnyNamespace,\n AllMultichainAccountServiceActions,\n AllMultichainAccountServiceEvents\n>;\n\n/**\n * Creates and returns a root messenger for testing\n *\n * @returns A messenger instance\n */\nexport function getRootMessenger(): RootMessenger {\n return new Messenger({\n namespace: MOCK_ANY_NAMESPACE,\n });\n}\n\n/**\n * Retrieves a restricted messenger for the MultichainAccountService.\n *\n * @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().\n * @returns The restricted messenger for the MultichainAccountService.\n */\nexport function getMultichainAccountServiceMessenger(\n rootMessenger: RootMessenger,\n): MultichainAccountServiceMessenger {\n const messenger = new Messenger<\n 'MultichainAccountService',\n AllMultichainAccountServiceActions,\n AllMultichainAccountServiceEvents,\n RootMessenger\n >({\n namespace: 'MultichainAccountService',\n parent: rootMessenger,\n });\n rootMessenger.delegate({\n messenger,\n actions: [\n 'AccountsController:getAccount',\n 'AccountsController:getAccountByAddress',\n 'AccountsController:listMultichainAccounts',\n 'SnapController:handleRequest',\n 'KeyringController:withKeyring',\n 'KeyringController:getState',\n 'KeyringController:getKeyringsByType',\n 'KeyringController:addNewKeyring',\n 'NetworkController:findNetworkClientIdByChainId',\n 'NetworkController:getNetworkClientById',\n ],\n events: [\n 'KeyringController:stateChange',\n 'AccountsController:accountAdded',\n 'AccountsController:accountRemoved',\n ],\n });\n return messenger;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n Bip44Account,\n MultichainAccountGroup,\n MultichainAccountWalletId,\n MultichainAccountWalletStatus,\n} from '@metamask/account-api';\nimport type {\n AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetAccountByAddressAction,\n AccountsControllerListMultichainAccountsAction,\n} from '@metamask/accounts-controller';\nimport type { RestrictedMessenger } from '@metamask/base-controller';\nimport type { KeyringAccount } from '@metamask/keyring-api';\nimport type {\n KeyringControllerAddNewKeyringAction,\n KeyringControllerGetKeyringsByTypeAction,\n KeyringControllerGetStateAction,\n KeyringControllerStateChangeEvent,\n KeyringControllerWithKeyringAction,\n} from '@metamask/keyring-controller';\nimport type {\n NetworkControllerFindNetworkClientIdByChainIdAction,\n NetworkControllerGetNetworkClientByIdAction,\n} from '@metamask/network-controller';\nimport type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from '@metamask/snaps-controllers';\n\nimport type {\n MultichainAccountService,\n serviceName,\n} from './MultichainAccountService';\n\nexport type MultichainAccountServiceGetMultichainAccountGroupAction = {\n type: `${typeof serviceName}:getMultichainAccountGroup`;\n handler: MultichainAccountService['getMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountGroupsAction = {\n type: `${typeof serviceName}:getMultichainAccountGroups`;\n handler: MultichainAccountService['getMultichainAccountGroups'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletAction = {\n type: `${typeof serviceName}:getMultichainAccountWallet`;\n handler: MultichainAccountService['getMultichainAccountWallet'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletsAction = {\n type: `${typeof serviceName}:getMultichainAccountWallets`;\n handler: MultichainAccountService['getMultichainAccountWallets'];\n};\n\nexport type MultichainAccountServiceCreateNextMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createNextMultichainAccountGroup`;\n handler: MultichainAccountService['createNextMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceCreateMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createMultichainAccountGroup`;\n handler: MultichainAccountService['createMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceSetBasicFunctionalityAction = {\n type: `${typeof serviceName}:setBasicFunctionality`;\n handler: MultichainAccountService['setBasicFunctionality'];\n};\n\nexport type MultichainAccountServiceAlignWalletAction = {\n type: `${typeof serviceName}:alignWallet`;\n handler: MultichainAccountService['alignWallet'];\n};\n\nexport type MultichainAccountServiceAlignWalletsAction = {\n type: `${typeof serviceName}:alignWallets`;\n handler: MultichainAccountService['alignWallets'];\n};\n\nexport type MultichainAccountServiceCreateMultichainAccountWalletAction = {\n type: `${typeof serviceName}:createMultichainAccountWallet`;\n handler: MultichainAccountService['createMultichainAccountWallet'];\n};\n\n/**\n * All actions that {@link MultichainAccountService} registers so that other\n * modules can call them.\n */\nexport type MultichainAccountServiceActions =\n | MultichainAccountServiceGetMultichainAccountGroupAction\n | MultichainAccountServiceGetMultichainAccountGroupsAction\n | MultichainAccountServiceGetMultichainAccountWalletAction\n | MultichainAccountServiceGetMultichainAccountWalletsAction\n | MultichainAccountServiceCreateNextMultichainAccountGroupAction\n | MultichainAccountServiceCreateMultichainAccountGroupAction\n | MultichainAccountServiceSetBasicFunctionalityAction\n | MultichainAccountServiceAlignWalletAction\n | MultichainAccountServiceAlignWalletsAction\n | MultichainAccountServiceCreateMultichainAccountWalletAction;\n\nexport type MultichainAccountServiceMultichainAccountGroupCreatedEvent = {\n type: `${typeof serviceName}:multichainAccountGroupCreated`;\n payload: [MultichainAccountGroup<Bip44Account<KeyringAccount>>];\n};\n\nexport type MultichainAccountServiceMultichainAccountGroupUpdatedEvent = {\n type: `${typeof serviceName}:multichainAccountGroupUpdated`;\n payload: [MultichainAccountGroup<Bip44Account<KeyringAccount>>];\n};\n\nexport type MultichainAccountServiceWalletStatusChangeEvent = {\n type: `${typeof serviceName}:walletStatusChange`;\n payload: [MultichainAccountWalletId, MultichainAccountWalletStatus];\n};\n\n/**\n * All events that {@link MultichainAccountService} publishes so that other modules\n * can subscribe to them.\n */\nexport type MultichainAccountServiceEvents =\n | MultichainAccountServiceMultichainAccountGroupCreatedEvent\n | MultichainAccountServiceMultichainAccountGroupUpdatedEvent\n | MultichainAccountServiceWalletStatusChangeEvent;\n\n/**\n * All actions registered by other modules that {@link MultichainAccountService}\n * calls.\n */\nexport type AllowedActions =\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerGetAccountAction\n | AccountsControllerGetAccountByAddressAction\n | SnapControllerHandleSnapRequestAction\n | KeyringControllerWithKeyringAction\n | KeyringControllerGetStateAction\n | KeyringControllerGetKeyringsByTypeAction\n | KeyringControllerAddNewKeyringAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkControllerFindNetworkClientIdByChainIdAction;\n\n/**\n * All events published by other modules that {@link MultichainAccountService}\n * subscribes to.\n */\nexport type AllowedEvents =\n | KeyringControllerStateChangeEvent\n | AccountsControllerAccountAddedEvent\n | AccountsControllerAccountRemovedEvent;\n\n/**\n * The messenger restricted to actions and events that\n * {@link MultichainAccountService} needs to access.\n */\nexport type MultichainAccountServiceMessenger = RestrictedMessenger<\n 'MultichainAccountService',\n MultichainAccountServiceActions | AllowedActions,\n MultichainAccountServiceEvents | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n>;\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n Bip44Account,\n MultichainAccountGroup,\n MultichainAccountWalletId,\n MultichainAccountWalletStatus,\n} from '@metamask/account-api';\nimport type {\n AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetAccountByAddressAction,\n AccountsControllerListMultichainAccountsAction,\n} from '@metamask/accounts-controller';\nimport type { KeyringAccount } from '@metamask/keyring-api';\nimport type {\n KeyringControllerAddNewKeyringAction,\n KeyringControllerGetKeyringsByTypeAction,\n KeyringControllerGetStateAction,\n KeyringControllerStateChangeEvent,\n KeyringControllerWithKeyringAction,\n} from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type {\n NetworkControllerFindNetworkClientIdByChainIdAction,\n NetworkControllerGetNetworkClientByIdAction,\n} from '@metamask/network-controller';\nimport type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from '@metamask/snaps-controllers';\n\nimport type {\n MultichainAccountService,\n serviceName,\n} from './MultichainAccountService';\n\nexport type MultichainAccountServiceGetMultichainAccountGroupAction = {\n type: `${typeof serviceName}:getMultichainAccountGroup`;\n handler: MultichainAccountService['getMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountGroupsAction = {\n type: `${typeof serviceName}:getMultichainAccountGroups`;\n handler: MultichainAccountService['getMultichainAccountGroups'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletAction = {\n type: `${typeof serviceName}:getMultichainAccountWallet`;\n handler: MultichainAccountService['getMultichainAccountWallet'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletsAction = {\n type: `${typeof serviceName}:getMultichainAccountWallets`;\n handler: MultichainAccountService['getMultichainAccountWallets'];\n};\n\nexport type MultichainAccountServiceCreateNextMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createNextMultichainAccountGroup`;\n handler: MultichainAccountService['createNextMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceCreateMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createMultichainAccountGroup`;\n handler: MultichainAccountService['createMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceSetBasicFunctionalityAction = {\n type: `${typeof serviceName}:setBasicFunctionality`;\n handler: MultichainAccountService['setBasicFunctionality'];\n};\n\nexport type MultichainAccountServiceAlignWalletAction = {\n type: `${typeof serviceName}:alignWallet`;\n handler: MultichainAccountService['alignWallet'];\n};\n\nexport type MultichainAccountServiceAlignWalletsAction = {\n type: `${typeof serviceName}:alignWallets`;\n handler: MultichainAccountService['alignWallets'];\n};\n\nexport type MultichainAccountServiceCreateMultichainAccountWalletAction = {\n type: `${typeof serviceName}:createMultichainAccountWallet`;\n handler: MultichainAccountService['createMultichainAccountWallet'];\n};\n\n/**\n * All actions that {@link MultichainAccountService} registers so that other\n * modules can call them.\n */\nexport type MultichainAccountServiceActions =\n | MultichainAccountServiceGetMultichainAccountGroupAction\n | MultichainAccountServiceGetMultichainAccountGroupsAction\n | MultichainAccountServiceGetMultichainAccountWalletAction\n | MultichainAccountServiceGetMultichainAccountWalletsAction\n | MultichainAccountServiceCreateNextMultichainAccountGroupAction\n | MultichainAccountServiceCreateMultichainAccountGroupAction\n | MultichainAccountServiceSetBasicFunctionalityAction\n | MultichainAccountServiceAlignWalletAction\n | MultichainAccountServiceAlignWalletsAction\n | MultichainAccountServiceCreateMultichainAccountWalletAction;\n\nexport type MultichainAccountServiceMultichainAccountGroupCreatedEvent = {\n type: `${typeof serviceName}:multichainAccountGroupCreated`;\n payload: [MultichainAccountGroup<Bip44Account<KeyringAccount>>];\n};\n\nexport type MultichainAccountServiceMultichainAccountGroupUpdatedEvent = {\n type: `${typeof serviceName}:multichainAccountGroupUpdated`;\n payload: [MultichainAccountGroup<Bip44Account<KeyringAccount>>];\n};\n\nexport type MultichainAccountServiceWalletStatusChangeEvent = {\n type: `${typeof serviceName}:walletStatusChange`;\n payload: [MultichainAccountWalletId, MultichainAccountWalletStatus];\n};\n\n/**\n * All events that {@link MultichainAccountService} publishes so that other modules\n * can subscribe to them.\n */\nexport type MultichainAccountServiceEvents =\n | MultichainAccountServiceMultichainAccountGroupCreatedEvent\n | MultichainAccountServiceMultichainAccountGroupUpdatedEvent\n | MultichainAccountServiceWalletStatusChangeEvent;\n\n/**\n * All actions registered by other modules that {@link MultichainAccountService}\n * calls.\n */\ntype AllowedActions =\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerGetAccountAction\n | AccountsControllerGetAccountByAddressAction\n | SnapControllerHandleSnapRequestAction\n | KeyringControllerWithKeyringAction\n | KeyringControllerGetStateAction\n | KeyringControllerGetKeyringsByTypeAction\n | KeyringControllerAddNewKeyringAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkControllerFindNetworkClientIdByChainIdAction;\n\n/**\n * All events published by other modules that {@link MultichainAccountService}\n * subscribes to.\n */\ntype AllowedEvents =\n | KeyringControllerStateChangeEvent\n | AccountsControllerAccountAddedEvent\n | AccountsControllerAccountRemovedEvent;\n\n/**\n * The messenger restricted to actions and events that\n * {@link MultichainAccountService} needs to access.\n */\nexport type MultichainAccountServiceMessenger = Messenger<\n 'MultichainAccountService',\n MultichainAccountServiceActions | AllowedActions,\n MultichainAccountServiceEvents | AllowedEvents\n>;\n"]}
package/dist/types.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { Bip44Account, MultichainAccountGroup, MultichainAccountWalletId, MultichainAccountWalletStatus } from "@metamask/account-api";
2
2
  import type { AccountsControllerAccountAddedEvent, AccountsControllerAccountRemovedEvent, AccountsControllerGetAccountAction, AccountsControllerGetAccountByAddressAction, AccountsControllerListMultichainAccountsAction } from "@metamask/accounts-controller";
3
- import type { RestrictedMessenger } from "@metamask/base-controller";
4
3
  import type { KeyringAccount } from "@metamask/keyring-api";
5
4
  import type { KeyringControllerAddNewKeyringAction, KeyringControllerGetKeyringsByTypeAction, KeyringControllerGetStateAction, KeyringControllerStateChangeEvent, KeyringControllerWithKeyringAction } from "@metamask/keyring-controller";
5
+ import type { Messenger } from "@metamask/messenger";
6
6
  import type { NetworkControllerFindNetworkClientIdByChainIdAction, NetworkControllerGetNetworkClientByIdAction } from "@metamask/network-controller";
7
7
  import type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from "@metamask/snaps-controllers";
8
8
  import type { MultichainAccountService, serviceName } from "./MultichainAccountService.cjs";
@@ -72,15 +72,16 @@ export type MultichainAccountServiceEvents = MultichainAccountServiceMultichainA
72
72
  * All actions registered by other modules that {@link MultichainAccountService}
73
73
  * calls.
74
74
  */
75
- export type AllowedActions = AccountsControllerListMultichainAccountsAction | AccountsControllerGetAccountAction | AccountsControllerGetAccountByAddressAction | SnapControllerHandleSnapRequestAction | KeyringControllerWithKeyringAction | KeyringControllerGetStateAction | KeyringControllerGetKeyringsByTypeAction | KeyringControllerAddNewKeyringAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerFindNetworkClientIdByChainIdAction;
75
+ type AllowedActions = AccountsControllerListMultichainAccountsAction | AccountsControllerGetAccountAction | AccountsControllerGetAccountByAddressAction | SnapControllerHandleSnapRequestAction | KeyringControllerWithKeyringAction | KeyringControllerGetStateAction | KeyringControllerGetKeyringsByTypeAction | KeyringControllerAddNewKeyringAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerFindNetworkClientIdByChainIdAction;
76
76
  /**
77
77
  * All events published by other modules that {@link MultichainAccountService}
78
78
  * subscribes to.
79
79
  */
80
- export type AllowedEvents = KeyringControllerStateChangeEvent | AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent;
80
+ type AllowedEvents = KeyringControllerStateChangeEvent | AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent;
81
81
  /**
82
82
  * The messenger restricted to actions and events that
83
83
  * {@link MultichainAccountService} needs to access.
84
84
  */
85
- export type MultichainAccountServiceMessenger = RestrictedMessenger<'MultichainAccountService', MultichainAccountServiceActions | AllowedActions, MultichainAccountServiceEvents | AllowedEvents, AllowedActions['type'], AllowedEvents['type']>;
85
+ export type MultichainAccountServiceMessenger = Messenger<'MultichainAccountService', MultichainAccountServiceActions | AllowedActions, MultichainAccountServiceEvents | AllowedEvents>;
86
+ export {};
86
87
  //# sourceMappingURL=types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,yBAAyB,EACzB,6BAA6B,EAC9B,8BAA8B;AAC/B,OAAO,KAAK,EACV,mCAAmC,EACnC,qCAAqC,EACrC,kCAAkC,EAClC,2CAA2C,EAC3C,8CAA8C,EAC/C,sCAAsC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,kCAAkC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAC5D,OAAO,KAAK,EACV,oCAAoC,EACpC,wCAAwC,EACxC,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EACnC,qCAAqC;AACtC,O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S,CACvD,0BAA0B,EAC1B,+BAA+B,GAAG,cAAc,EAChD,8BAA8B,GAAG,aAAa,CAC/C,CAAC"}
package/dist/types.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { Bip44Account, MultichainAccountGroup, MultichainAccountWalletId, MultichainAccountWalletStatus } from "@metamask/account-api";
2
2
  import type { AccountsControllerAccountAddedEvent, AccountsControllerAccountRemovedEvent, AccountsControllerGetAccountAction, AccountsControllerGetAccountByAddressAction, AccountsControllerListMultichainAccountsAction } from "@metamask/accounts-controller";
3
- import type { RestrictedMessenger } from "@metamask/base-controller";
4
3
  import type { KeyringAccount } from "@metamask/keyring-api";
5
4
  import type { KeyringControllerAddNewKeyringAction, KeyringControllerGetKeyringsByTypeAction, KeyringControllerGetStateAction, KeyringControllerStateChangeEvent, KeyringControllerWithKeyringAction } from "@metamask/keyring-controller";
5
+ import type { Messenger } from "@metamask/messenger";
6
6
  import type { NetworkControllerFindNetworkClientIdByChainIdAction, NetworkControllerGetNetworkClientByIdAction } from "@metamask/network-controller";
7
7
  import type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from "@metamask/snaps-controllers";
8
8
  import type { MultichainAccountService, serviceName } from "./MultichainAccountService.mjs";
@@ -72,15 +72,16 @@ export type MultichainAccountServiceEvents = MultichainAccountServiceMultichainA
72
72
  * All actions registered by other modules that {@link MultichainAccountService}
73
73
  * calls.
74
74
  */
75
- export type AllowedActions = AccountsControllerListMultichainAccountsAction | AccountsControllerGetAccountAction | AccountsControllerGetAccountByAddressAction | SnapControllerHandleSnapRequestAction | KeyringControllerWithKeyringAction | KeyringControllerGetStateAction | KeyringControllerGetKeyringsByTypeAction | KeyringControllerAddNewKeyringAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerFindNetworkClientIdByChainIdAction;
75
+ type AllowedActions = AccountsControllerListMultichainAccountsAction | AccountsControllerGetAccountAction | AccountsControllerGetAccountByAddressAction | SnapControllerHandleSnapRequestAction | KeyringControllerWithKeyringAction | KeyringControllerGetStateAction | KeyringControllerGetKeyringsByTypeAction | KeyringControllerAddNewKeyringAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerFindNetworkClientIdByChainIdAction;
76
76
  /**
77
77
  * All events published by other modules that {@link MultichainAccountService}
78
78
  * subscribes to.
79
79
  */
80
- export type AllowedEvents = KeyringControllerStateChangeEvent | AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent;
80
+ type AllowedEvents = KeyringControllerStateChangeEvent | AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent;
81
81
  /**
82
82
  * The messenger restricted to actions and events that
83
83
  * {@link MultichainAccountService} needs to access.
84
84
  */
85
- export type MultichainAccountServiceMessenger = RestrictedMessenger<'MultichainAccountService', MultichainAccountServiceActions | AllowedActions, MultichainAccountServiceEvents | AllowedEvents, AllowedActions['type'], AllowedEvents['type']>;
85
+ export type MultichainAccountServiceMessenger = Messenger<'MultichainAccountService', MultichainAccountServiceActions | AllowedActions, MultichainAccountServiceEvents | AllowedEvents>;
86
+ export {};
86
87
  //# sourceMappingURL=types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,yBAAyB,EACzB,6BAA6B,EAC9B,8BAA8B;AAC/B,OAAO,KAAK,EACV,mCAAmC,EACnC,qCAAqC,EACrC,kCAAkC,EAClC,2CAA2C,EAC3C,8CAA8C,EAC/C,sCAAsC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,kCAAkC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAC5D,OAAO,KAAK,EACV,oCAAoC,EACpC,wCAAwC,EACxC,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EACnC,qCAAqC;AACtC,OAAO,KAAK,EACV,mDAAmD,EACnD,2CAA2C,EAC5C,qCAAqC;AACtC,OAAO,KAAK,EAAE,iBA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C"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n Bip44Account,\n MultichainAccountGroup,\n MultichainAccountWalletId,\n MultichainAccountWalletStatus,\n} from '@metamask/account-api';\nimport type {\n AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetAccountByAddressAction,\n AccountsControllerListMultichainAccountsAction,\n} from '@metamask/accounts-controller';\nimport type { RestrictedMessenger } from '@metamask/base-controller';\nimport type { KeyringAccount } from '@metamask/keyring-api';\nimport type {\n KeyringControllerAddNewKeyringAction,\n KeyringControllerGetKeyringsByTypeAction,\n KeyringControllerGetStateAction,\n KeyringControllerStateChangeEvent,\n KeyringControllerWithKeyringAction,\n} from '@metamask/keyring-controller';\nimport type {\n NetworkControllerFindNetworkClientIdByChainIdAction,\n NetworkControllerGetNetworkClientByIdAction,\n} from '@metamask/network-controller';\nimport type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from '@metamask/snaps-controllers';\n\nimport type {\n MultichainAccountService,\n serviceName,\n} from './MultichainAccountService';\n\nexport type MultichainAccountServiceGetMultichainAccountGroupAction = {\n type: `${typeof serviceName}:getMultichainAccountGroup`;\n handler: MultichainAccountService['getMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountGroupsAction = {\n type: `${typeof serviceName}:getMultichainAccountGroups`;\n handler: MultichainAccountService['getMultichainAccountGroups'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletAction = {\n type: `${typeof serviceName}:getMultichainAccountWallet`;\n handler: MultichainAccountService['getMultichainAccountWallet'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletsAction = {\n type: `${typeof serviceName}:getMultichainAccountWallets`;\n handler: MultichainAccountService['getMultichainAccountWallets'];\n};\n\nexport type MultichainAccountServiceCreateNextMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createNextMultichainAccountGroup`;\n handler: MultichainAccountService['createNextMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceCreateMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createMultichainAccountGroup`;\n handler: MultichainAccountService['createMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceSetBasicFunctionalityAction = {\n type: `${typeof serviceName}:setBasicFunctionality`;\n handler: MultichainAccountService['setBasicFunctionality'];\n};\n\nexport type MultichainAccountServiceAlignWalletAction = {\n type: `${typeof serviceName}:alignWallet`;\n handler: MultichainAccountService['alignWallet'];\n};\n\nexport type MultichainAccountServiceAlignWalletsAction = {\n type: `${typeof serviceName}:alignWallets`;\n handler: MultichainAccountService['alignWallets'];\n};\n\nexport type MultichainAccountServiceCreateMultichainAccountWalletAction = {\n type: `${typeof serviceName}:createMultichainAccountWallet`;\n handler: MultichainAccountService['createMultichainAccountWallet'];\n};\n\n/**\n * All actions that {@link MultichainAccountService} registers so that other\n * modules can call them.\n */\nexport type MultichainAccountServiceActions =\n | MultichainAccountServiceGetMultichainAccountGroupAction\n | MultichainAccountServiceGetMultichainAccountGroupsAction\n | MultichainAccountServiceGetMultichainAccountWalletAction\n | MultichainAccountServiceGetMultichainAccountWalletsAction\n | MultichainAccountServiceCreateNextMultichainAccountGroupAction\n | MultichainAccountServiceCreateMultichainAccountGroupAction\n | MultichainAccountServiceSetBasicFunctionalityAction\n | MultichainAccountServiceAlignWalletAction\n | MultichainAccountServiceAlignWalletsAction\n | MultichainAccountServiceCreateMultichainAccountWalletAction;\n\nexport type MultichainAccountServiceMultichainAccountGroupCreatedEvent = {\n type: `${typeof serviceName}:multichainAccountGroupCreated`;\n payload: [MultichainAccountGroup<Bip44Account<KeyringAccount>>];\n};\n\nexport type MultichainAccountServiceMultichainAccountGroupUpdatedEvent = {\n type: `${typeof serviceName}:multichainAccountGroupUpdated`;\n payload: [MultichainAccountGroup<Bip44Account<KeyringAccount>>];\n};\n\nexport type MultichainAccountServiceWalletStatusChangeEvent = {\n type: `${typeof serviceName}:walletStatusChange`;\n payload: [MultichainAccountWalletId, MultichainAccountWalletStatus];\n};\n\n/**\n * All events that {@link MultichainAccountService} publishes so that other modules\n * can subscribe to them.\n */\nexport type MultichainAccountServiceEvents =\n | MultichainAccountServiceMultichainAccountGroupCreatedEvent\n | MultichainAccountServiceMultichainAccountGroupUpdatedEvent\n | MultichainAccountServiceWalletStatusChangeEvent;\n\n/**\n * All actions registered by other modules that {@link MultichainAccountService}\n * calls.\n */\nexport type AllowedActions =\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerGetAccountAction\n | AccountsControllerGetAccountByAddressAction\n | SnapControllerHandleSnapRequestAction\n | KeyringControllerWithKeyringAction\n | KeyringControllerGetStateAction\n | KeyringControllerGetKeyringsByTypeAction\n | KeyringControllerAddNewKeyringAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkControllerFindNetworkClientIdByChainIdAction;\n\n/**\n * All events published by other modules that {@link MultichainAccountService}\n * subscribes to.\n */\nexport type AllowedEvents =\n | KeyringControllerStateChangeEvent\n | AccountsControllerAccountAddedEvent\n | AccountsControllerAccountRemovedEvent;\n\n/**\n * The messenger restricted to actions and events that\n * {@link MultichainAccountService} needs to access.\n */\nexport type MultichainAccountServiceMessenger = RestrictedMessenger<\n 'MultichainAccountService',\n MultichainAccountServiceActions | AllowedActions,\n MultichainAccountServiceEvents | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n>;\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n Bip44Account,\n MultichainAccountGroup,\n MultichainAccountWalletId,\n MultichainAccountWalletStatus,\n} from '@metamask/account-api';\nimport type {\n AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetAccountByAddressAction,\n AccountsControllerListMultichainAccountsAction,\n} from '@metamask/accounts-controller';\nimport type { KeyringAccount } from '@metamask/keyring-api';\nimport type {\n KeyringControllerAddNewKeyringAction,\n KeyringControllerGetKeyringsByTypeAction,\n KeyringControllerGetStateAction,\n KeyringControllerStateChangeEvent,\n KeyringControllerWithKeyringAction,\n} from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type {\n NetworkControllerFindNetworkClientIdByChainIdAction,\n NetworkControllerGetNetworkClientByIdAction,\n} from '@metamask/network-controller';\nimport type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from '@metamask/snaps-controllers';\n\nimport type {\n MultichainAccountService,\n serviceName,\n} from './MultichainAccountService';\n\nexport type MultichainAccountServiceGetMultichainAccountGroupAction = {\n type: `${typeof serviceName}:getMultichainAccountGroup`;\n handler: MultichainAccountService['getMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountGroupsAction = {\n type: `${typeof serviceName}:getMultichainAccountGroups`;\n handler: MultichainAccountService['getMultichainAccountGroups'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletAction = {\n type: `${typeof serviceName}:getMultichainAccountWallet`;\n handler: MultichainAccountService['getMultichainAccountWallet'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletsAction = {\n type: `${typeof serviceName}:getMultichainAccountWallets`;\n handler: MultichainAccountService['getMultichainAccountWallets'];\n};\n\nexport type MultichainAccountServiceCreateNextMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createNextMultichainAccountGroup`;\n handler: MultichainAccountService['createNextMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceCreateMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createMultichainAccountGroup`;\n handler: MultichainAccountService['createMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceSetBasicFunctionalityAction = {\n type: `${typeof serviceName}:setBasicFunctionality`;\n handler: MultichainAccountService['setBasicFunctionality'];\n};\n\nexport type MultichainAccountServiceAlignWalletAction = {\n type: `${typeof serviceName}:alignWallet`;\n handler: MultichainAccountService['alignWallet'];\n};\n\nexport type MultichainAccountServiceAlignWalletsAction = {\n type: `${typeof serviceName}:alignWallets`;\n handler: MultichainAccountService['alignWallets'];\n};\n\nexport type MultichainAccountServiceCreateMultichainAccountWalletAction = {\n type: `${typeof serviceName}:createMultichainAccountWallet`;\n handler: MultichainAccountService['createMultichainAccountWallet'];\n};\n\n/**\n * All actions that {@link MultichainAccountService} registers so that other\n * modules can call them.\n */\nexport type MultichainAccountServiceActions =\n | MultichainAccountServiceGetMultichainAccountGroupAction\n | MultichainAccountServiceGetMultichainAccountGroupsAction\n | MultichainAccountServiceGetMultichainAccountWalletAction\n | MultichainAccountServiceGetMultichainAccountWalletsAction\n | MultichainAccountServiceCreateNextMultichainAccountGroupAction\n | MultichainAccountServiceCreateMultichainAccountGroupAction\n | MultichainAccountServiceSetBasicFunctionalityAction\n | MultichainAccountServiceAlignWalletAction\n | MultichainAccountServiceAlignWalletsAction\n | MultichainAccountServiceCreateMultichainAccountWalletAction;\n\nexport type MultichainAccountServiceMultichainAccountGroupCreatedEvent = {\n type: `${typeof serviceName}:multichainAccountGroupCreated`;\n payload: [MultichainAccountGroup<Bip44Account<KeyringAccount>>];\n};\n\nexport type MultichainAccountServiceMultichainAccountGroupUpdatedEvent = {\n type: `${typeof serviceName}:multichainAccountGroupUpdated`;\n payload: [MultichainAccountGroup<Bip44Account<KeyringAccount>>];\n};\n\nexport type MultichainAccountServiceWalletStatusChangeEvent = {\n type: `${typeof serviceName}:walletStatusChange`;\n payload: [MultichainAccountWalletId, MultichainAccountWalletStatus];\n};\n\n/**\n * All events that {@link MultichainAccountService} publishes so that other modules\n * can subscribe to them.\n */\nexport type MultichainAccountServiceEvents =\n | MultichainAccountServiceMultichainAccountGroupCreatedEvent\n | MultichainAccountServiceMultichainAccountGroupUpdatedEvent\n | MultichainAccountServiceWalletStatusChangeEvent;\n\n/**\n * All actions registered by other modules that {@link MultichainAccountService}\n * calls.\n */\ntype AllowedActions =\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerGetAccountAction\n | AccountsControllerGetAccountByAddressAction\n | SnapControllerHandleSnapRequestAction\n | KeyringControllerWithKeyringAction\n | KeyringControllerGetStateAction\n | KeyringControllerGetKeyringsByTypeAction\n | KeyringControllerAddNewKeyringAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkControllerFindNetworkClientIdByChainIdAction;\n\n/**\n * All events published by other modules that {@link MultichainAccountService}\n * subscribes to.\n */\ntype AllowedEvents =\n | KeyringControllerStateChangeEvent\n | AccountsControllerAccountAddedEvent\n | AccountsControllerAccountRemovedEvent;\n\n/**\n * The messenger restricted to actions and events that\n * {@link MultichainAccountService} needs to access.\n */\nexport type MultichainAccountServiceMessenger = Messenger<\n 'MultichainAccountService',\n MultichainAccountServiceActions | AllowedActions,\n MultichainAccountServiceEvents | AllowedEvents\n>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/multichain-account-service",
3
- "version": "1.6.2-preview-9fa15fd0",
3
+ "version": "2.0.0-preview-46d2c977",
4
4
  "description": "Service to manage multichain accounts",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -48,13 +48,14 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@ethereumjs/util": "^9.1.0",
51
- "@metamask/base-controller": "^8.4.2",
52
- "@metamask/eth-snap-keyring": "^17.0.0",
51
+ "@metamask/base-controller": "^9.0.0",
52
+ "@metamask/eth-snap-keyring": "^18.0.0",
53
53
  "@metamask/key-tree": "^10.1.1",
54
54
  "@metamask/keyring-api": "^21.0.0",
55
55
  "@metamask/keyring-internal-api": "^9.0.0",
56
56
  "@metamask/keyring-snap-client": "^8.0.0",
57
57
  "@metamask/keyring-utils": "^3.1.0",
58
+ "@metamask/messenger": "^0.3.0",
58
59
  "@metamask/snaps-sdk": "^9.0.0",
59
60
  "@metamask/snaps-utils": "^11.0.0",
60
61
  "@metamask/superstruct": "^3.1.0",
@@ -63,10 +64,10 @@
63
64
  },
64
65
  "devDependencies": {
65
66
  "@metamask/account-api": "^0.12.0",
66
- "@metamask/accounts-controller": "^33.2.0",
67
+ "@metamask/accounts-controller": "^34.0.0",
67
68
  "@metamask/auto-changelog": "^3.4.4",
68
69
  "@metamask/eth-hd-keyring": "^13.0.0",
69
- "@metamask/keyring-controller": "^23.2.0",
70
+ "@metamask/keyring-controller": "^24.0.0",
70
71
  "@metamask/providers": "^22.1.0",
71
72
  "@metamask/snaps-controllers": "^14.0.1",
72
73
  "@types/jest": "^27.4.1",
@@ -82,8 +83,8 @@
82
83
  },
83
84
  "peerDependencies": {
84
85
  "@metamask/account-api": "^0.12.0",
85
- "@metamask/accounts-controller": "^33.0.0",
86
- "@metamask/keyring-controller": "^23.0.0",
86
+ "@metamask/accounts-controller": "^34.0.0",
87
+ "@metamask/keyring-controller": "^24.0.0",
87
88
  "@metamask/providers": "^22.0.0",
88
89
  "@metamask/snaps-controllers": "^14.0.0",
89
90
  "webextension-polyfill": "^0.10.0 || ^0.11.0 || ^0.12.0"