Skip to content

Commit eb404f9

Browse files
committed
fix: fix circular dep
1 parent 6a859e5 commit eb404f9

File tree

4 files changed

+52
-4
lines changed

4 files changed

+52
-4
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export type { MultichainAccountControllerMessenger } from './MultichainAccountController';
1+
export type { MultichainAccountControllerMessenger } from './types';
22
export { MultichainAccountController } from './MultichainAccountController';

packages/multichain-account-controller/src/providers/EvmAccountProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type {
99
InternalAccount,
1010
} from '@metamask/keyring-internal-api';
1111
import type { AccountProvider } from '@metamask/multichain-account-api';
12-
import type { MultichainAccountControllerMessenger } from 'src/MultichainAccountController';
12+
import type { MultichainAccountControllerMessenger } from '../types';
1313

1414
// Max index used by discovery (until we move the proper discovery here).
1515
const MAX_GROUP_INDEX = 1;

packages/multichain-account-controller/src/providers/SolAccountProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type { AccountProvider } from '@metamask/multichain-account-api';
1010
import type { SnapId } from '@metamask/snaps-sdk';
1111
import { HandlerType } from '@metamask/snaps-utils';
1212
import type { Json, JsonRpcRequest } from '@metamask/utils';
13-
import type { MultichainAccountControllerMessenger } from 'src/MultichainAccountController';
13+
import type { MultichainAccountControllerMessenger } from '../types';
1414

1515
type SolInternalAccount = InternalAccount & {
1616
options: {
@@ -30,7 +30,7 @@ function assertInternalAccountExists(
3030

3131
export class SolAccountProvider implements AccountProvider {
3232
readonly #messenger: MultichainAccountControllerMessenger;
33-
33+
3434
readonly #client: KeyringClient;
3535

3636
constructor(messenger: MultichainAccountControllerMessenger) {
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import type {
2+
AccountsControllerGetAccountAction,
3+
AccountsControllerGetAccountByAddressAction,
4+
AccountsControllerListMultichainAccountsAction,
5+
} from '@metamask/accounts-controller';
6+
import type { RestrictedMessenger } from '@metamask/base-controller';
7+
import type { KeyringControllerWithKeyringAction } from '@metamask/keyring-controller';
8+
import type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from '@metamask/snaps-controllers';
9+
10+
/**
11+
* All actions that {@link MultichainAccountController} registers so that other
12+
* modules can call them.
13+
*/
14+
export type MultichainAccountControllerActions = never;
15+
/**
16+
* All events that {@link MultichainAccountController} publishes so that other modules
17+
* can subscribe to them.
18+
*/
19+
export type MultichainAccountControllerEvents = never;
20+
21+
/**
22+
* All actions registered by other modules that {@link MultichainAccountController}
23+
* calls.
24+
*/
25+
export type AllowedActions =
26+
| AccountsControllerListMultichainAccountsAction
27+
| AccountsControllerGetAccountAction
28+
| AccountsControllerGetAccountByAddressAction
29+
| SnapControllerHandleSnapRequestAction
30+
| KeyringControllerWithKeyringAction;
31+
32+
/**
33+
* All events published by other modules that {@link MultichainAccountController}
34+
* subscribes to.
35+
*/
36+
export type AllowedEvents = never;
37+
38+
/**
39+
* The messenger restricted to actions and events that
40+
* {@link MultichainAccountController} needs to access.
41+
*/
42+
export type MultichainAccountControllerMessenger = RestrictedMessenger<
43+
'MultichainAccountController',
44+
MultichainAccountControllerActions | AllowedActions,
45+
MultichainAccountControllerEvents | AllowedEvents,
46+
AllowedActions['type'],
47+
AllowedEvents['type']
48+
>;

0 commit comments

Comments
 (0)