@metamask-previews/multichain-account-service 4.1.0-preview-9462ebb8 → 5.0.0-preview-cb897e9
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 +20 -1
- package/dist/MultichainAccountGroup.cjs +1 -1
- package/dist/MultichainAccountGroup.cjs.map +1 -1
- package/dist/MultichainAccountGroup.d.cts.map +1 -1
- package/dist/MultichainAccountGroup.d.mts.map +1 -1
- package/dist/MultichainAccountGroup.mjs +1 -1
- package/dist/MultichainAccountGroup.mjs.map +1 -1
- package/dist/MultichainAccountService.cjs +10 -3
- package/dist/MultichainAccountService.cjs.map +1 -1
- package/dist/MultichainAccountService.d.cts +1 -0
- package/dist/MultichainAccountService.d.cts.map +1 -1
- package/dist/MultichainAccountService.d.mts +1 -0
- package/dist/MultichainAccountService.d.mts.map +1 -1
- package/dist/MultichainAccountService.mjs +10 -3
- package/dist/MultichainAccountService.mjs.map +1 -1
- package/dist/MultichainAccountWallet.cjs +4 -4
- package/dist/MultichainAccountWallet.cjs.map +1 -1
- package/dist/MultichainAccountWallet.d.cts.map +1 -1
- package/dist/MultichainAccountWallet.d.mts.map +1 -1
- package/dist/MultichainAccountWallet.mjs +4 -4
- package/dist/MultichainAccountWallet.mjs.map +1 -1
- package/dist/providers/BtcAccountProvider.cjs +46 -32
- package/dist/providers/BtcAccountProvider.cjs.map +1 -1
- package/dist/providers/BtcAccountProvider.d.cts +2 -1
- package/dist/providers/BtcAccountProvider.d.cts.map +1 -1
- package/dist/providers/BtcAccountProvider.d.mts +2 -1
- package/dist/providers/BtcAccountProvider.d.mts.map +1 -1
- package/dist/providers/BtcAccountProvider.mjs +46 -32
- package/dist/providers/BtcAccountProvider.mjs.map +1 -1
- package/dist/providers/SnapAccountProvider.cjs +81 -54
- package/dist/providers/SnapAccountProvider.cjs.map +1 -1
- package/dist/providers/SnapAccountProvider.d.cts +16 -4
- package/dist/providers/SnapAccountProvider.d.cts.map +1 -1
- package/dist/providers/SnapAccountProvider.d.mts +16 -4
- package/dist/providers/SnapAccountProvider.d.mts.map +1 -1
- package/dist/providers/SnapAccountProvider.mjs +81 -54
- package/dist/providers/SnapAccountProvider.mjs.map +1 -1
- package/dist/providers/SolAccountProvider.cjs +36 -31
- package/dist/providers/SolAccountProvider.cjs.map +1 -1
- package/dist/providers/SolAccountProvider.d.cts.map +1 -1
- package/dist/providers/SolAccountProvider.d.mts.map +1 -1
- package/dist/providers/SolAccountProvider.mjs +36 -31
- package/dist/providers/SolAccountProvider.mjs.map +1 -1
- package/dist/providers/TrxAccountProvider.cjs +47 -29
- package/dist/providers/TrxAccountProvider.cjs.map +1 -1
- package/dist/providers/TrxAccountProvider.d.cts +1 -0
- package/dist/providers/TrxAccountProvider.d.cts.map +1 -1
- package/dist/providers/TrxAccountProvider.d.mts +1 -0
- package/dist/providers/TrxAccountProvider.d.mts.map +1 -1
- package/dist/providers/TrxAccountProvider.mjs +47 -29
- package/dist/providers/TrxAccountProvider.mjs.map +1 -1
- package/dist/snaps/SnapPlatformWatcher.cjs +60 -0
- package/dist/snaps/SnapPlatformWatcher.cjs.map +1 -0
- package/dist/snaps/SnapPlatformWatcher.d.cts +8 -0
- package/dist/snaps/SnapPlatformWatcher.d.cts.map +1 -0
- package/dist/snaps/SnapPlatformWatcher.d.mts +8 -0
- package/dist/snaps/SnapPlatformWatcher.d.mts.map +1 -0
- package/dist/snaps/SnapPlatformWatcher.mjs +57 -0
- package/dist/snaps/SnapPlatformWatcher.mjs.map +1 -0
- package/dist/tests/messenger.cjs +9 -2
- package/dist/tests/messenger.cjs.map +1 -1
- package/dist/tests/messenger.d.cts +9 -4
- package/dist/tests/messenger.d.cts.map +1 -1
- package/dist/tests/messenger.d.mts +9 -4
- package/dist/tests/messenger.d.mts.map +1 -1
- package/dist/tests/messenger.mjs +9 -2
- package/dist/tests/messenger.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +8 -5
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +8 -5
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Messenger } from "@metamask/messenger";
|
|
2
2
|
import type { MessengerActions, MessengerEvents, MockAnyNamespace } from "@metamask/messenger";
|
|
3
3
|
import type { MultichainAccountServiceMessenger } from "../types.cjs";
|
|
4
|
-
type AllMultichainAccountServiceActions = MessengerActions<MultichainAccountServiceMessenger>;
|
|
5
|
-
type AllMultichainAccountServiceEvents = MessengerEvents<MultichainAccountServiceMessenger>;
|
|
4
|
+
export type AllMultichainAccountServiceActions = MessengerActions<MultichainAccountServiceMessenger>;
|
|
5
|
+
export type AllMultichainAccountServiceEvents = MessengerEvents<MultichainAccountServiceMessenger>;
|
|
6
6
|
export type RootMessenger = Messenger<MockAnyNamespace, AllMultichainAccountServiceActions, AllMultichainAccountServiceEvents>;
|
|
7
7
|
/**
|
|
8
8
|
* Creates and returns a root messenger for testing
|
|
@@ -14,8 +14,13 @@ export declare function getRootMessenger(): RootMessenger;
|
|
|
14
14
|
* Retrieves a restricted messenger for the MultichainAccountService.
|
|
15
15
|
*
|
|
16
16
|
* @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
|
|
17
|
+
* @param extra - Extra messenger options.
|
|
18
|
+
* @param extra.actions - Extra actions to delegate.
|
|
19
|
+
* @param extra.events - Extra events to delegate.
|
|
17
20
|
* @returns The restricted messenger for the MultichainAccountService.
|
|
18
21
|
*/
|
|
19
|
-
export declare function getMultichainAccountServiceMessenger(rootMessenger: RootMessenger
|
|
20
|
-
|
|
22
|
+
export declare function getMultichainAccountServiceMessenger(rootMessenger: RootMessenger, extra?: {
|
|
23
|
+
actions?: AllMultichainAccountServiceActions['type'][];
|
|
24
|
+
events?: AllMultichainAccountServiceEvents['type'][];
|
|
25
|
+
}): MultichainAccountServiceMessenger;
|
|
21
26
|
//# 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,EAAsB,4BAA4B;AACpE,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EACjB,4BAA4B;AAE7B,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAiB;AAElE,
|
|
1
|
+
{"version":3,"file":"messenger.d.cts","sourceRoot":"","sources":["../../src/tests/messenger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,4BAA4B;AACpE,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EACjB,4BAA4B;AAE7B,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAiB;AAElE,MAAM,MAAM,kCAAkC,GAC5C,gBAAgB,CAAC,iCAAiC,CAAC,CAAC;AAEtD,MAAM,MAAM,iCAAiC,GAC3C,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,CAKhD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oCAAoC,CAClD,aAAa,EAAE,aAAa,EAC5B,KAAK,CAAC,EAAE;IACN,OAAO,CAAC,EAAE,kCAAkC,CAAC,MAAM,CAAC,EAAE,CAAC;IACvD,MAAM,CAAC,EAAE,iCAAiC,CAAC,MAAM,CAAC,EAAE,CAAC;CACtD,GACA,iCAAiC,CAmCnC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Messenger } from "@metamask/messenger";
|
|
2
2
|
import type { MessengerActions, MessengerEvents, MockAnyNamespace } from "@metamask/messenger";
|
|
3
3
|
import type { MultichainAccountServiceMessenger } from "../types.mjs";
|
|
4
|
-
type AllMultichainAccountServiceActions = MessengerActions<MultichainAccountServiceMessenger>;
|
|
5
|
-
type AllMultichainAccountServiceEvents = MessengerEvents<MultichainAccountServiceMessenger>;
|
|
4
|
+
export type AllMultichainAccountServiceActions = MessengerActions<MultichainAccountServiceMessenger>;
|
|
5
|
+
export type AllMultichainAccountServiceEvents = MessengerEvents<MultichainAccountServiceMessenger>;
|
|
6
6
|
export type RootMessenger = Messenger<MockAnyNamespace, AllMultichainAccountServiceActions, AllMultichainAccountServiceEvents>;
|
|
7
7
|
/**
|
|
8
8
|
* Creates and returns a root messenger for testing
|
|
@@ -14,8 +14,13 @@ export declare function getRootMessenger(): RootMessenger;
|
|
|
14
14
|
* Retrieves a restricted messenger for the MultichainAccountService.
|
|
15
15
|
*
|
|
16
16
|
* @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
|
|
17
|
+
* @param extra - Extra messenger options.
|
|
18
|
+
* @param extra.actions - Extra actions to delegate.
|
|
19
|
+
* @param extra.events - Extra events to delegate.
|
|
17
20
|
* @returns The restricted messenger for the MultichainAccountService.
|
|
18
21
|
*/
|
|
19
|
-
export declare function getMultichainAccountServiceMessenger(rootMessenger: RootMessenger
|
|
20
|
-
|
|
22
|
+
export declare function getMultichainAccountServiceMessenger(rootMessenger: RootMessenger, extra?: {
|
|
23
|
+
actions?: AllMultichainAccountServiceActions['type'][];
|
|
24
|
+
events?: AllMultichainAccountServiceEvents['type'][];
|
|
25
|
+
}): MultichainAccountServiceMessenger;
|
|
21
26
|
//# 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,EAAsB,4BAA4B;AACpE,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EACjB,4BAA4B;AAE7B,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAiB;AAElE,
|
|
1
|
+
{"version":3,"file":"messenger.d.mts","sourceRoot":"","sources":["../../src/tests/messenger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,4BAA4B;AACpE,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EACjB,4BAA4B;AAE7B,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAiB;AAElE,MAAM,MAAM,kCAAkC,GAC5C,gBAAgB,CAAC,iCAAiC,CAAC,CAAC;AAEtD,MAAM,MAAM,iCAAiC,GAC3C,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,CAKhD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oCAAoC,CAClD,aAAa,EAAE,aAAa,EAC5B,KAAK,CAAC,EAAE;IACN,OAAO,CAAC,EAAE,kCAAkC,CAAC,MAAM,CAAC,EAAE,CAAC;IACvD,MAAM,CAAC,EAAE,iCAAiC,CAAC,MAAM,CAAC,EAAE,CAAC;CACtD,GACA,iCAAiC,CAmCnC"}
|
package/dist/tests/messenger.mjs
CHANGED
|
@@ -7,15 +7,19 @@ import { Messenger, MOCK_ANY_NAMESPACE } from "@metamask/messenger";
|
|
|
7
7
|
export function getRootMessenger() {
|
|
8
8
|
return new Messenger({
|
|
9
9
|
namespace: MOCK_ANY_NAMESPACE,
|
|
10
|
+
captureException: jest.fn(),
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
13
14
|
* Retrieves a restricted messenger for the MultichainAccountService.
|
|
14
15
|
*
|
|
15
16
|
* @param rootMessenger - The root messenger instance. Defaults to a new Messenger created by getRootMessenger().
|
|
17
|
+
* @param extra - Extra messenger options.
|
|
18
|
+
* @param extra.actions - Extra actions to delegate.
|
|
19
|
+
* @param extra.events - Extra events to delegate.
|
|
16
20
|
* @returns The restricted messenger for the MultichainAccountService.
|
|
17
21
|
*/
|
|
18
|
-
export function getMultichainAccountServiceMessenger(rootMessenger) {
|
|
22
|
+
export function getMultichainAccountServiceMessenger(rootMessenger, extra) {
|
|
19
23
|
const messenger = new Messenger({
|
|
20
24
|
namespace: 'MultichainAccountService',
|
|
21
25
|
parent: rootMessenger,
|
|
@@ -26,7 +30,7 @@ export function getMultichainAccountServiceMessenger(rootMessenger) {
|
|
|
26
30
|
'AccountsController:getAccount',
|
|
27
31
|
'AccountsController:getAccountByAddress',
|
|
28
32
|
'AccountsController:listMultichainAccounts',
|
|
29
|
-
'
|
|
33
|
+
'SnapController:getState',
|
|
30
34
|
'SnapController:handleRequest',
|
|
31
35
|
'KeyringController:withKeyring',
|
|
32
36
|
'KeyringController:getState',
|
|
@@ -34,11 +38,14 @@ export function getMultichainAccountServiceMessenger(rootMessenger) {
|
|
|
34
38
|
'KeyringController:addNewKeyring',
|
|
35
39
|
'NetworkController:findNetworkClientIdByChainId',
|
|
36
40
|
'NetworkController:getNetworkClientById',
|
|
41
|
+
...(extra?.actions ?? []),
|
|
37
42
|
],
|
|
38
43
|
events: [
|
|
39
44
|
'KeyringController:stateChange',
|
|
45
|
+
'SnapController:stateChange',
|
|
40
46
|
'AccountsController:accountAdded',
|
|
41
47
|
'AccountsController:accountRemoved',
|
|
48
|
+
...(extra?.events ?? []),
|
|
42
49
|
],
|
|
43
50
|
});
|
|
44
51
|
return messenger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messenger.mjs","sourceRoot":"","sources":["../../src/tests/messenger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,4BAA4B;AAqBpE;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,SAAS,CAAC;QACnB,SAAS,EAAE,kBAAkB;
|
|
1
|
+
{"version":3,"file":"messenger.mjs","sourceRoot":"","sources":["../../src/tests/messenger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,4BAA4B;AAqBpE;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,SAAS,CAAC;QACnB,SAAS,EAAE,kBAAkB;QAC7B,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE;KAC5B,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oCAAoC,CAClD,aAA4B,EAC5B,KAGC;IAED,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,yBAAyB;YACzB,8BAA8B;YAC9B,+BAA+B;YAC/B,4BAA4B;YAC5B,qCAAqC;YACrC,iCAAiC;YACjC,gDAAgD;YAChD,wCAAwC;YACxC,GAAG,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE,CAAC;SAC1B;QACD,MAAM,EAAE;YACN,+BAA+B;YAC/B,4BAA4B;YAC5B,iCAAiC;YACjC,mCAAmC;YACnC,GAAG,CAAC,KAAK,EAAE,MAAM,IAAI,EAAE,CAAC;SACzB;KACF,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger';\nimport type {\n MessengerActions,\n MessengerEvents,\n MockAnyNamespace,\n} from '@metamask/messenger';\n\nimport type { MultichainAccountServiceMessenger } from '../types';\n\nexport type AllMultichainAccountServiceActions =\n MessengerActions<MultichainAccountServiceMessenger>;\n\nexport type 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 captureException: jest.fn(),\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 * @param extra - Extra messenger options.\n * @param extra.actions - Extra actions to delegate.\n * @param extra.events - Extra events to delegate.\n * @returns The restricted messenger for the MultichainAccountService.\n */\nexport function getMultichainAccountServiceMessenger(\n rootMessenger: RootMessenger,\n extra?: {\n actions?: AllMultichainAccountServiceActions['type'][];\n events?: AllMultichainAccountServiceEvents['type'][];\n },\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:getState',\n 'SnapController:handleRequest',\n 'KeyringController:withKeyring',\n 'KeyringController:getState',\n 'KeyringController:getKeyringsByType',\n 'KeyringController:addNewKeyring',\n 'NetworkController:findNetworkClientIdByChainId',\n 'NetworkController:getNetworkClientById',\n ...(extra?.actions ?? []),\n ],\n events: [\n 'KeyringController:stateChange',\n 'SnapController:stateChange',\n 'AccountsController:accountAdded',\n 'AccountsController:accountRemoved',\n ...(extra?.events ?? []),\n ],\n });\n return messenger;\n}\n"]}
|
package/dist/types.cjs.map
CHANGED
|
@@ -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 { TraceCallback } from '@metamask/controller-utils';\nimport type {
|
|
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 { TraceCallback } from '@metamask/controller-utils';\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 {\n HandleSnapRequest as SnapControllerHandleSnapRequestAction,\n SnapControllerGetStateAction,\n SnapStateChange as SnapControllerStateChangeEvent,\n} 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\nexport type MultichainAccountServiceResyncAccountsAction = {\n type: `${typeof serviceName}:resyncAccounts`;\n handler: MultichainAccountService['resyncAccounts'];\n};\n\nexport type MultichainAccountServiceEnsureCanUseSnapPlatformAction = {\n type: `${typeof serviceName}:ensureCanUseSnapPlatform`;\n handler: MultichainAccountService['ensureCanUseSnapPlatform'];\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 | MultichainAccountServiceResyncAccountsAction\n | MultichainAccountServiceEnsureCanUseSnapPlatformAction;\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 | SnapControllerGetStateAction\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 | SnapControllerStateChangeEvent\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\nexport type MultichainAccountServiceConfig = {\n trace?: TraceCallback;\n};\n"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
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
3
|
import type { TraceCallback } from "@metamask/controller-utils";
|
|
4
|
-
import type { ErrorReportingServiceCaptureExceptionAction } from "@metamask/error-reporting-service";
|
|
5
4
|
import type { KeyringAccount } from "@metamask/keyring-api";
|
|
6
5
|
import type { KeyringControllerAddNewKeyringAction, KeyringControllerGetKeyringsByTypeAction, KeyringControllerGetStateAction, KeyringControllerStateChangeEvent, KeyringControllerWithKeyringAction } from "@metamask/keyring-controller";
|
|
7
6
|
import type { Messenger } from "@metamask/messenger";
|
|
8
7
|
import type { NetworkControllerFindNetworkClientIdByChainIdAction, NetworkControllerGetNetworkClientByIdAction } from "@metamask/network-controller";
|
|
9
|
-
import type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from "@metamask/snaps-controllers";
|
|
8
|
+
import type { HandleSnapRequest as SnapControllerHandleSnapRequestAction, SnapControllerGetStateAction, SnapStateChange as SnapControllerStateChangeEvent } from "@metamask/snaps-controllers";
|
|
10
9
|
import type { MultichainAccountService, serviceName } from "./MultichainAccountService.cjs";
|
|
11
10
|
export type MultichainAccountServiceGetMultichainAccountGroupAction = {
|
|
12
11
|
type: `${typeof serviceName}:getMultichainAccountGroup`;
|
|
@@ -52,11 +51,15 @@ export type MultichainAccountServiceResyncAccountsAction = {
|
|
|
52
51
|
type: `${typeof serviceName}:resyncAccounts`;
|
|
53
52
|
handler: MultichainAccountService['resyncAccounts'];
|
|
54
53
|
};
|
|
54
|
+
export type MultichainAccountServiceEnsureCanUseSnapPlatformAction = {
|
|
55
|
+
type: `${typeof serviceName}:ensureCanUseSnapPlatform`;
|
|
56
|
+
handler: MultichainAccountService['ensureCanUseSnapPlatform'];
|
|
57
|
+
};
|
|
55
58
|
/**
|
|
56
59
|
* All actions that {@link MultichainAccountService} registers so that other
|
|
57
60
|
* modules can call them.
|
|
58
61
|
*/
|
|
59
|
-
export type MultichainAccountServiceActions = MultichainAccountServiceGetMultichainAccountGroupAction | MultichainAccountServiceGetMultichainAccountGroupsAction | MultichainAccountServiceGetMultichainAccountWalletAction | MultichainAccountServiceGetMultichainAccountWalletsAction | MultichainAccountServiceCreateNextMultichainAccountGroupAction | MultichainAccountServiceCreateMultichainAccountGroupAction | MultichainAccountServiceSetBasicFunctionalityAction | MultichainAccountServiceAlignWalletAction | MultichainAccountServiceAlignWalletsAction | MultichainAccountServiceCreateMultichainAccountWalletAction | MultichainAccountServiceResyncAccountsAction;
|
|
62
|
+
export type MultichainAccountServiceActions = MultichainAccountServiceGetMultichainAccountGroupAction | MultichainAccountServiceGetMultichainAccountGroupsAction | MultichainAccountServiceGetMultichainAccountWalletAction | MultichainAccountServiceGetMultichainAccountWalletsAction | MultichainAccountServiceCreateNextMultichainAccountGroupAction | MultichainAccountServiceCreateMultichainAccountGroupAction | MultichainAccountServiceSetBasicFunctionalityAction | MultichainAccountServiceAlignWalletAction | MultichainAccountServiceAlignWalletsAction | MultichainAccountServiceCreateMultichainAccountWalletAction | MultichainAccountServiceResyncAccountsAction | MultichainAccountServiceEnsureCanUseSnapPlatformAction;
|
|
60
63
|
export type MultichainAccountServiceMultichainAccountGroupCreatedEvent = {
|
|
61
64
|
type: `${typeof serviceName}:multichainAccountGroupCreated`;
|
|
62
65
|
payload: [MultichainAccountGroup<Bip44Account<KeyringAccount>>];
|
|
@@ -78,12 +81,12 @@ export type MultichainAccountServiceEvents = MultichainAccountServiceMultichainA
|
|
|
78
81
|
* All actions registered by other modules that {@link MultichainAccountService}
|
|
79
82
|
* calls.
|
|
80
83
|
*/
|
|
81
|
-
type AllowedActions = AccountsControllerListMultichainAccountsAction | AccountsControllerGetAccountAction | AccountsControllerGetAccountByAddressAction | SnapControllerHandleSnapRequestAction | KeyringControllerWithKeyringAction | KeyringControllerGetStateAction | KeyringControllerGetKeyringsByTypeAction | KeyringControllerAddNewKeyringAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerFindNetworkClientIdByChainIdAction
|
|
84
|
+
type AllowedActions = AccountsControllerListMultichainAccountsAction | AccountsControllerGetAccountAction | AccountsControllerGetAccountByAddressAction | SnapControllerGetStateAction | SnapControllerHandleSnapRequestAction | KeyringControllerWithKeyringAction | KeyringControllerGetStateAction | KeyringControllerGetKeyringsByTypeAction | KeyringControllerAddNewKeyringAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerFindNetworkClientIdByChainIdAction;
|
|
82
85
|
/**
|
|
83
86
|
* All events published by other modules that {@link MultichainAccountService}
|
|
84
87
|
* subscribes to.
|
|
85
88
|
*/
|
|
86
|
-
type AllowedEvents = KeyringControllerStateChangeEvent | AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent;
|
|
89
|
+
type AllowedEvents = SnapControllerStateChangeEvent | KeyringControllerStateChangeEvent | AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent;
|
|
87
90
|
/**
|
|
88
91
|
* The messenger restricted to actions and events that
|
|
89
92
|
* {@link MultichainAccountService} needs to access.
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,yBAA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,GACxC,oCAAoC,GACpC,2CAA2C,GAC3C,mDAAmD,CAAC;AAExD;;;GAGG;AACH,KAAK,aAAa,GACd,8BAA8B,GAC9B,iCAAiC,GACjC,mCAAmC,GACnC,qCAAqC,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG,SAAS,CACvD,0BAA0B,EAC1B,+BAA+B,GAAG,cAAc,EAChD,8BAA8B,GAAG,aAAa,CAC/C,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC"}
|
package/dist/types.d.mts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
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
3
|
import type { TraceCallback } from "@metamask/controller-utils";
|
|
4
|
-
import type { ErrorReportingServiceCaptureExceptionAction } from "@metamask/error-reporting-service";
|
|
5
4
|
import type { KeyringAccount } from "@metamask/keyring-api";
|
|
6
5
|
import type { KeyringControllerAddNewKeyringAction, KeyringControllerGetKeyringsByTypeAction, KeyringControllerGetStateAction, KeyringControllerStateChangeEvent, KeyringControllerWithKeyringAction } from "@metamask/keyring-controller";
|
|
7
6
|
import type { Messenger } from "@metamask/messenger";
|
|
8
7
|
import type { NetworkControllerFindNetworkClientIdByChainIdAction, NetworkControllerGetNetworkClientByIdAction } from "@metamask/network-controller";
|
|
9
|
-
import type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from "@metamask/snaps-controllers";
|
|
8
|
+
import type { HandleSnapRequest as SnapControllerHandleSnapRequestAction, SnapControllerGetStateAction, SnapStateChange as SnapControllerStateChangeEvent } from "@metamask/snaps-controllers";
|
|
10
9
|
import type { MultichainAccountService, serviceName } from "./MultichainAccountService.mjs";
|
|
11
10
|
export type MultichainAccountServiceGetMultichainAccountGroupAction = {
|
|
12
11
|
type: `${typeof serviceName}:getMultichainAccountGroup`;
|
|
@@ -52,11 +51,15 @@ export type MultichainAccountServiceResyncAccountsAction = {
|
|
|
52
51
|
type: `${typeof serviceName}:resyncAccounts`;
|
|
53
52
|
handler: MultichainAccountService['resyncAccounts'];
|
|
54
53
|
};
|
|
54
|
+
export type MultichainAccountServiceEnsureCanUseSnapPlatformAction = {
|
|
55
|
+
type: `${typeof serviceName}:ensureCanUseSnapPlatform`;
|
|
56
|
+
handler: MultichainAccountService['ensureCanUseSnapPlatform'];
|
|
57
|
+
};
|
|
55
58
|
/**
|
|
56
59
|
* All actions that {@link MultichainAccountService} registers so that other
|
|
57
60
|
* modules can call them.
|
|
58
61
|
*/
|
|
59
|
-
export type MultichainAccountServiceActions = MultichainAccountServiceGetMultichainAccountGroupAction | MultichainAccountServiceGetMultichainAccountGroupsAction | MultichainAccountServiceGetMultichainAccountWalletAction | MultichainAccountServiceGetMultichainAccountWalletsAction | MultichainAccountServiceCreateNextMultichainAccountGroupAction | MultichainAccountServiceCreateMultichainAccountGroupAction | MultichainAccountServiceSetBasicFunctionalityAction | MultichainAccountServiceAlignWalletAction | MultichainAccountServiceAlignWalletsAction | MultichainAccountServiceCreateMultichainAccountWalletAction | MultichainAccountServiceResyncAccountsAction;
|
|
62
|
+
export type MultichainAccountServiceActions = MultichainAccountServiceGetMultichainAccountGroupAction | MultichainAccountServiceGetMultichainAccountGroupsAction | MultichainAccountServiceGetMultichainAccountWalletAction | MultichainAccountServiceGetMultichainAccountWalletsAction | MultichainAccountServiceCreateNextMultichainAccountGroupAction | MultichainAccountServiceCreateMultichainAccountGroupAction | MultichainAccountServiceSetBasicFunctionalityAction | MultichainAccountServiceAlignWalletAction | MultichainAccountServiceAlignWalletsAction | MultichainAccountServiceCreateMultichainAccountWalletAction | MultichainAccountServiceResyncAccountsAction | MultichainAccountServiceEnsureCanUseSnapPlatformAction;
|
|
60
63
|
export type MultichainAccountServiceMultichainAccountGroupCreatedEvent = {
|
|
61
64
|
type: `${typeof serviceName}:multichainAccountGroupCreated`;
|
|
62
65
|
payload: [MultichainAccountGroup<Bip44Account<KeyringAccount>>];
|
|
@@ -78,12 +81,12 @@ export type MultichainAccountServiceEvents = MultichainAccountServiceMultichainA
|
|
|
78
81
|
* All actions registered by other modules that {@link MultichainAccountService}
|
|
79
82
|
* calls.
|
|
80
83
|
*/
|
|
81
|
-
type AllowedActions = AccountsControllerListMultichainAccountsAction | AccountsControllerGetAccountAction | AccountsControllerGetAccountByAddressAction | SnapControllerHandleSnapRequestAction | KeyringControllerWithKeyringAction | KeyringControllerGetStateAction | KeyringControllerGetKeyringsByTypeAction | KeyringControllerAddNewKeyringAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerFindNetworkClientIdByChainIdAction
|
|
84
|
+
type AllowedActions = AccountsControllerListMultichainAccountsAction | AccountsControllerGetAccountAction | AccountsControllerGetAccountByAddressAction | SnapControllerGetStateAction | SnapControllerHandleSnapRequestAction | KeyringControllerWithKeyringAction | KeyringControllerGetStateAction | KeyringControllerGetKeyringsByTypeAction | KeyringControllerAddNewKeyringAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerFindNetworkClientIdByChainIdAction;
|
|
82
85
|
/**
|
|
83
86
|
* All events published by other modules that {@link MultichainAccountService}
|
|
84
87
|
* subscribes to.
|
|
85
88
|
*/
|
|
86
|
-
type AllowedEvents = KeyringControllerStateChangeEvent | AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent;
|
|
89
|
+
type AllowedEvents = SnapControllerStateChangeEvent | KeyringControllerStateChangeEvent | AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent;
|
|
87
90
|
/**
|
|
88
91
|
* The messenger restricted to actions and events that
|
|
89
92
|
* {@link MultichainAccountService} needs to access.
|
package/dist/types.d.mts.map
CHANGED
|
@@ -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,aAAa,EAAE,mCAAmC;AAChE,OAAO,KAAK,EAAE,
|
|
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,aAAa,EAAE,mCAAmC;AAChE,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,EACV,iBAAiB,IAAI,qCAAqC,EAC1D,4BAA4B,EAC5B,eAAe,IAAI,8BAA8B,EAClD,oCAAoC;AAErC,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,M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KAAK,cAAc,GACf,8CAA8C,GAC9C,kCAAkC,GAClC,2CAA2C,GAC3C,4BAA4B,GAC5B,qCAAqC,GACrC,kCAAkC,GAClC,+BAA+B,GAC/B,wCAAwC,GACxC,oCAAoC,GACpC,2CAA2C,GAC3C,mDAAmD,CAAC;AAExD;;;GAGG;AACH,KAAK,aAAa,GACd,8BAA8B,GAC9B,iCAAiC,GACjC,mCAAmC,GACnC,qCAAqC,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG,SAAS,CACvD,0BAA0B,EAC1B,+BAA+B,GAAG,cAAc,EAChD,8BAA8B,GAAG,aAAa,CAC/C,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC"}
|
package/dist/types.mjs.map
CHANGED
|
@@ -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 { TraceCallback } from '@metamask/controller-utils';\nimport type {
|
|
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 { TraceCallback } from '@metamask/controller-utils';\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 {\n HandleSnapRequest as SnapControllerHandleSnapRequestAction,\n SnapControllerGetStateAction,\n SnapStateChange as SnapControllerStateChangeEvent,\n} 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\nexport type MultichainAccountServiceResyncAccountsAction = {\n type: `${typeof serviceName}:resyncAccounts`;\n handler: MultichainAccountService['resyncAccounts'];\n};\n\nexport type MultichainAccountServiceEnsureCanUseSnapPlatformAction = {\n type: `${typeof serviceName}:ensureCanUseSnapPlatform`;\n handler: MultichainAccountService['ensureCanUseSnapPlatform'];\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 | MultichainAccountServiceResyncAccountsAction\n | MultichainAccountServiceEnsureCanUseSnapPlatformAction;\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 | SnapControllerGetStateAction\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 | SnapControllerStateChangeEvent\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\nexport type MultichainAccountServiceConfig = {\n trace?: TraceCallback;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/multichain-account-service",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-preview-cb897e9",
|
|
4
4
|
"description": "Service to manage multichain accounts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"@ethereumjs/util": "^9.1.0",
|
|
52
52
|
"@metamask/accounts-controller": "^35.0.0",
|
|
53
53
|
"@metamask/base-controller": "^9.0.0",
|
|
54
|
-
"@metamask/error-reporting-service": "^3.0.1",
|
|
55
54
|
"@metamask/eth-snap-keyring": "^18.0.0",
|
|
56
55
|
"@metamask/key-tree": "^10.1.1",
|
|
57
56
|
"@metamask/keyring-api": "^21.0.0",
|
|
@@ -60,12 +59,13 @@
|
|
|
60
59
|
"@metamask/keyring-snap-client": "^8.0.0",
|
|
61
60
|
"@metamask/keyring-utils": "^3.1.0",
|
|
62
61
|
"@metamask/messenger": "^0.3.0",
|
|
63
|
-
"@metamask/snaps-controllers": "^
|
|
64
|
-
"@metamask/snaps-sdk": "^
|
|
65
|
-
"@metamask/snaps-utils": "^11.
|
|
62
|
+
"@metamask/snaps-controllers": "^17.2.0",
|
|
63
|
+
"@metamask/snaps-sdk": "^10.3.0",
|
|
64
|
+
"@metamask/snaps-utils": "^11.7.0",
|
|
66
65
|
"@metamask/superstruct": "^3.1.0",
|
|
67
66
|
"@metamask/utils": "^11.9.0",
|
|
68
|
-
"async-mutex": "^0.5.0"
|
|
67
|
+
"async-mutex": "^0.5.0",
|
|
68
|
+
"lodash": "^4.17.21"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@metamask/account-api": "^0.12.0",
|