|
| 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