@metamask-previews/multichain-account-service 1.6.1-preview-ab0ad568 → 1.6.2-preview-ebf01f52

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,10 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.6.2]
11
+
10
12
  ### Changed
11
13
 
12
- - **BREAKING:** Use new `Messenger` from `@metamask/messenger` ([#6544](https://github.com/MetaMask/core/pull/6544))
13
- - Previously, `MultichainAccountService` accepted a `RestrictedMessenger` instance from `@metamask/base-controller`.
14
14
  - Bump `@metamask/base-controller` from `^8.4.1` to `^8.4.2` ([#6917](https://github.com/MetaMask/core/pull/6917))
15
15
 
16
16
  ## [1.6.1]
@@ -233,7 +233,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
233
233
  - Add `MultichainAccountService` ([#6141](https://github.com/MetaMask/core/pull/6141)), ([#6165](https://github.com/MetaMask/core/pull/6165))
234
234
  - This service manages multichain accounts/wallets.
235
235
 
236
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/multichain-account-service@1.6.1...HEAD
236
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/multichain-account-service@1.6.2...HEAD
237
+ [1.6.2]: https://github.com/MetaMask/core/compare/@metamask/multichain-account-service@1.6.1...@metamask/multichain-account-service@1.6.2
237
238
  [1.6.1]: https://github.com/MetaMask/core/compare/@metamask/multichain-account-service@1.6.0...@metamask/multichain-account-service@1.6.1
238
239
  [1.6.0]: https://github.com/MetaMask/core/compare/@metamask/multichain-account-service@1.5.0...@metamask/multichain-account-service@1.6.0
239
240
  [1.5.0]: https://github.com/MetaMask/core/compare/@metamask/multichain-account-service@1.4.0...@metamask/multichain-account-service@1.5.0
@@ -1,32 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getMultichainAccountServiceMessenger = exports.getRootMessenger = void 0;
4
- const messenger_1 = require("@metamask/messenger");
4
+ const base_controller_1 = require("@metamask/base-controller");
5
5
  /**
6
- * Creates and returns a root messenger for testing
6
+ * Creates a new root messenger instance for testing.
7
7
  *
8
- * @returns A messenger instance
8
+ * @returns A new Messenger instance.
9
9
  */
10
10
  function getRootMessenger() {
11
- return new messenger_1.Messenger({
12
- namespace: messenger_1.MOCK_ANY_NAMESPACE,
13
- });
11
+ return new base_controller_1.Messenger();
14
12
  }
15
13
  exports.getRootMessenger = getRootMessenger;
16
14
  /**
17
15
  * Retrieves a restricted messenger for the MultichainAccountService.
18
16
  *
19
- * @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
17
+ * @param messenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
20
18
  * @returns The restricted messenger for the MultichainAccountService.
21
19
  */
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: [
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: [
30
29
  'AccountsController:getAccount',
31
30
  'AccountsController:getAccountByAddress',
32
31
  'AccountsController:listMultichainAccounts',
@@ -38,13 +37,7 @@ function getMultichainAccountServiceMessenger(rootMessenger) {
38
37
  'NetworkController:findNetworkClientIdByChainId',
39
38
  'NetworkController:getNetworkClientById',
40
39
  ],
41
- events: [
42
- 'KeyringController:stateChange',
43
- 'AccountsController:accountAdded',
44
- 'AccountsController:accountRemoved',
45
- ],
46
40
  });
47
- return messenger;
48
41
  }
49
42
  exports.getMultichainAccountServiceMessenger = getMultichainAccountServiceMessenger;
50
43
  //# sourceMappingURL=messenger.cjs.map
@@ -1 +1 @@
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
+ {"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,20 +1,16 @@
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>;
1
+ import { Messenger } from "@metamask/base-controller";
2
+ import type { AllowedActions, AllowedEvents, MultichainAccountServiceActions, MultichainAccountServiceEvents, MultichainAccountServiceMessenger } from "../types.cjs";
6
3
  /**
7
- * Creates and returns a root messenger for testing
4
+ * Creates a new root messenger instance for testing.
8
5
  *
9
- * @returns A messenger instance
6
+ * @returns A new Messenger instance.
10
7
  */
11
- export declare function getRootMessenger(): RootMessenger;
8
+ export declare function getRootMessenger(): Messenger<MultichainAccountServiceActions | AllowedActions, MultichainAccountServiceEvents | AllowedEvents>;
12
9
  /**
13
10
  * Retrieves a restricted messenger for the MultichainAccountService.
14
11
  *
15
- * @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
12
+ * @param messenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
16
13
  * @returns The restricted messenger for the MultichainAccountService.
17
14
  */
18
- export declare function getMultichainAccountServiceMessenger(rootMessenger: RootMessenger): MultichainAccountServiceMessenger;
19
- export {};
15
+ export declare function getMultichainAccountServiceMessenger(messenger: ReturnType<typeof getRootMessenger>): MultichainAccountServiceMessenger;
20
16
  //# sourceMappingURL=messenger.d.cts.map
@@ -1 +1 @@
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
+ {"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,20 +1,16 @@
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>;
1
+ import { Messenger } from "@metamask/base-controller";
2
+ import type { AllowedActions, AllowedEvents, MultichainAccountServiceActions, MultichainAccountServiceEvents, MultichainAccountServiceMessenger } from "../types.mjs";
6
3
  /**
7
- * Creates and returns a root messenger for testing
4
+ * Creates a new root messenger instance for testing.
8
5
  *
9
- * @returns A messenger instance
6
+ * @returns A new Messenger instance.
10
7
  */
11
- export declare function getRootMessenger(): RootMessenger;
8
+ export declare function getRootMessenger(): Messenger<MultichainAccountServiceActions | AllowedActions, MultichainAccountServiceEvents | AllowedEvents>;
12
9
  /**
13
10
  * Retrieves a restricted messenger for the MultichainAccountService.
14
11
  *
15
- * @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
12
+ * @param messenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
16
13
  * @returns The restricted messenger for the MultichainAccountService.
17
14
  */
18
- export declare function getMultichainAccountServiceMessenger(rootMessenger: RootMessenger): MultichainAccountServiceMessenger;
19
- export {};
15
+ export declare function getMultichainAccountServiceMessenger(messenger: ReturnType<typeof getRootMessenger>): MultichainAccountServiceMessenger;
20
16
  //# sourceMappingURL=messenger.d.mts.map
@@ -1 +1 @@
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
+ {"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,28 +1,27 @@
1
- import { Messenger, MOCK_ANY_NAMESPACE } from "@metamask/messenger";
1
+ import { Messenger } from "@metamask/base-controller";
2
2
  /**
3
- * Creates and returns a root messenger for testing
3
+ * Creates a new root messenger instance for testing.
4
4
  *
5
- * @returns A messenger instance
5
+ * @returns A new Messenger instance.
6
6
  */
7
7
  export function getRootMessenger() {
8
- return new Messenger({
9
- namespace: MOCK_ANY_NAMESPACE,
10
- });
8
+ return new Messenger();
11
9
  }
12
10
  /**
13
11
  * Retrieves a restricted messenger for the MultichainAccountService.
14
12
  *
15
- * @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
13
+ * @param messenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
16
14
  * @returns The restricted messenger for the MultichainAccountService.
17
15
  */
18
- export function getMultichainAccountServiceMessenger(rootMessenger) {
19
- const messenger = new Messenger({
20
- namespace: 'MultichainAccountService',
21
- parent: rootMessenger,
22
- });
23
- rootMessenger.delegate({
24
- messenger,
25
- actions: [
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: [
26
25
  'AccountsController:getAccount',
27
26
  'AccountsController:getAccountByAddress',
28
27
  'AccountsController:listMultichainAccounts',
@@ -34,12 +33,6 @@ export function getMultichainAccountServiceMessenger(rootMessenger) {
34
33
  'NetworkController:findNetworkClientIdByChainId',
35
34
  'NetworkController:getNetworkClientById',
36
35
  ],
37
- events: [
38
- 'KeyringController:stateChange',
39
- 'AccountsController:accountAdded',
40
- 'AccountsController:accountRemoved',
41
- ],
42
36
  });
43
- return messenger;
44
37
  }
45
38
  //# sourceMappingURL=messenger.mjs.map
@@ -1 +1 @@
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
+ {"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 +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 { 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"]}
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"]}
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";
3
4
  import type { KeyringAccount } from "@metamask/keyring-api";
4
5
  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,16 +72,15 @@ export type MultichainAccountServiceEvents = MultichainAccountServiceMultichainA
72
72
  * All actions registered by other modules that {@link MultichainAccountService}
73
73
  * calls.
74
74
  */
75
- type AllowedActions = AccountsControllerListMultichainAccountsAction | AccountsControllerGetAccountAction | AccountsControllerGetAccountByAddressAction | SnapControllerHandleSnapRequestAction | KeyringControllerWithKeyringAction | KeyringControllerGetStateAction | KeyringControllerGetKeyringsByTypeAction | KeyringControllerAddNewKeyringAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerFindNetworkClientIdByChainIdAction;
75
+ export 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
- type AllowedEvents = KeyringControllerStateChangeEvent | AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent;
80
+ export 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 = Messenger<'MultichainAccountService', MultichainAccountServiceActions | AllowedActions, MultichainAccountServiceEvents | AllowedEvents>;
86
- export {};
85
+ export type MultichainAccountServiceMessenger = RestrictedMessenger<'MultichainAccountService', MultichainAccountServiceActions | AllowedActions, MultichainAccountServiceEvents | AllowedEvents, AllowedActions['type'], AllowedEvents['type']>;
87
86
  //# 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,cAAc,EAAE,8BAA8B;AAC5D,OAAO,KAAK,EACV,oCAAoC,EACpC,wCAAwC,EACxC,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EACnC,qCAAqC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EACV,mDAAmD,EACnD,2CAA2C,EAC5C,qCAAqC;AACtC,OAAO,KAAK,EAAE,iBAAiB,IAAI,qCAAqC,EAAE,oCAAoC;AAE9G,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EACZ,uCAAmC;AAEpC,MAAM,MAAM,uDAAuD,GAAG;IACpE,IAAI,EAAE,GAAG,OAAO,WAAW,4BAA4B,CAAC;IACxD,OAAO,EAAE,wBAAwB,CAAC,2BAA2B,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AO,WAAW,gCAAgC,CAAC;IAC5D,OAAO,EAAE,CAAC,sBAAsB,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,0DAA0D,GAAG;IACvE,IAAI,EAAE,GAAG,OAAO,WAAW,gCAAgC,CAAC;IAC5D,OAAO,EAAE,CAAC,sBAAsB,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,GAAG,OAAO,WAAW,qBAAqB,CAAC;IACjD,OAAO,EAAE,CAAC,yBAAyB,EAAE,6BAA6B,CAAC,CAAC;CACrE,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GACtC,0DAA0D,GAC1D,0DAA0D,GAC1D,+CAA+C,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,8CAA8C,GAC9C,kCAAkC,GAClC,2CAA2C,GAC3C,qCAAqC,GACrC,kCAAkC,GAClC,+BAA+B,GAC/B,wCAAwC,GACxC,oCAAoC,GACpC,2CAA2C,GAC3C,mDAAmD,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,aAAa,GACrB,iCAAiC,GACjC,mCAAmC,GACnC,qCAAqC,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG,mBAAmB,CACjE,0BAA0B,EAC1B,+BAA+B,GAAG,cAAc,EAChD,8BAA8B,GAAG,aAAa,EAC9C,cAAc,CAAC,MAAM,CAAC,EACtB,aAAa,CAAC,MAAM,CAAC,CACtB,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";
3
4
  import type { KeyringAccount } from "@metamask/keyring-api";
4
5
  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,16 +72,15 @@ export type MultichainAccountServiceEvents = MultichainAccountServiceMultichainA
72
72
  * All actions registered by other modules that {@link MultichainAccountService}
73
73
  * calls.
74
74
  */
75
- type AllowedActions = AccountsControllerListMultichainAccountsAction | AccountsControllerGetAccountAction | AccountsControllerGetAccountByAddressAction | SnapControllerHandleSnapRequestAction | KeyringControllerWithKeyringAction | KeyringControllerGetStateAction | KeyringControllerGetKeyringsByTypeAction | KeyringControllerAddNewKeyringAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerFindNetworkClientIdByChainIdAction;
75
+ export 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
- type AllowedEvents = KeyringControllerStateChangeEvent | AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent;
80
+ export 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 = Messenger<'MultichainAccountService', MultichainAccountServiceActions | AllowedActions, MultichainAccountServiceEvents | AllowedEvents>;
86
- export {};
85
+ export type MultichainAccountServiceMessenger = RestrictedMessenger<'MultichainAccountService', MultichainAccountServiceActions | AllowedActions, MultichainAccountServiceEvents | AllowedEvents, AllowedActions['type'], AllowedEvents['type']>;
87
86
  //# 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,cAAc,EAAE,8BAA8B;AAC5D,OAAO,KAAK,EACV,oCAAoC,EACpC,wCAAwC,EACxC,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EACnC,qCAAqC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EACV,mDAAmD,EACnD,2CAA2C,EAC5C,qCAAqC;AACtC,OAAO,KAAK,EAAE,iBAAiB,IAAI,qCAAqC,EAAE,oCAAoC;AAE9G,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EACZ,uCAAmC;AAEpC,MAAM,MAAM,uDAAuD,GAAG;IACpE,IAAI,EAAE,GAAG,OAAO,WAAW,4BAA4B,CAAC;IACxD,OAAO,EAAE,wBAAwB,CAAC,2BAA2B,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,wDAAwD,GAAG;IACrE,IAAI,EAAE,GAAG,OA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AAC,CAAC,CAAC,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,0DAA0D,GAAG;IACvE,IAAI,EAAE,GAAG,OAAO,WAAW,gCAAgC,CAAC;IAC5D,OAAO,EAAE,CAAC,sBAAsB,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,GAAG,OAAO,WAAW,qBAAqB,CAAC;IACjD,OAAO,EAAE,CAAC,yBAAyB,EAAE,6BAA6B,CAAC,CAAC;CACrE,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GACtC,0DAA0D,GAC1D,0DAA0D,GAC1D,+CAA+C,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,8CAA8C,GAC9C,kCAAkC,GAClC,2CAA2C,GAC3C,qCAAqC,GACrC,kCAAkC,GAClC,+BAA+B,GAC/B,wCAAwC,GACxC,oCAAoC,GACpC,2CAA2C,GAC3C,mDAAmD,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,aAAa,GACrB,iCAAiC,GACjC,mCAAmC,GACnC,qCAAqC,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG,mBAAmB,CACjE,0BAA0B,EAC1B,+BAA+B,GAAG,cAAc,EAChD,8BAA8B,GAAG,aAAa,EAC9C,cAAc,CAAC,MAAM,CAAC,EACtB,aAAa,CAAC,MAAM,CAAC,CACtB,CAAC"}
@@ -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 { 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"]}
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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/multichain-account-service",
3
- "version": "1.6.1-preview-ab0ad568",
3
+ "version": "1.6.2-preview-ebf01f52",
4
4
  "description": "Service to manage multichain accounts",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -55,7 +55,6 @@
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",
59
58
  "@metamask/snaps-sdk": "^9.0.0",
60
59
  "@metamask/snaps-utils": "^11.0.0",
61
60
  "@metamask/superstruct": "^3.1.0",
@@ -64,10 +63,10 @@
64
63
  },
65
64
  "devDependencies": {
66
65
  "@metamask/account-api": "^0.12.0",
67
- "@metamask/accounts-controller": "^33.1.1",
66
+ "@metamask/accounts-controller": "^33.2.0",
68
67
  "@metamask/auto-changelog": "^3.4.4",
69
68
  "@metamask/eth-hd-keyring": "^13.0.0",
70
- "@metamask/keyring-controller": "^23.1.1",
69
+ "@metamask/keyring-controller": "^23.2.0",
71
70
  "@metamask/providers": "^22.1.0",
72
71
  "@metamask/snaps-controllers": "^14.0.1",
73
72
  "@types/jest": "^27.4.1",