@@ -51,7 +51,6 @@ import {
51
51
KnownCaipNamespace ,
52
52
toCaipChainId ,
53
53
} from '@metamask/utils' ;
54
- import { EventEmitter } from 'events' ;
55
54
import { v4 as uuid } from 'uuid' ;
56
55
57
56
import { transformAccount } from './account' ;
@@ -74,6 +73,7 @@ import type {
74
73
SnapKeyringEvents ,
75
74
SnapKeyringMessenger ,
76
75
} from './SnapKeyringMessenger' ;
76
+ import { SNAP_KEYRING_NAME } from './SnapKeyringMessenger' ;
77
77
import type { SnapMessage } from './types' ;
78
78
import { SnapMessageStruct } from './types' ;
79
79
import {
@@ -154,11 +154,16 @@ function normalizeAccountAddress(account: KeyringAccount): string {
154
154
/**
155
155
* Keyring bridge implementation to support Snaps.
156
156
*/
157
- export class SnapKeyring extends EventEmitter {
157
+ export class SnapKeyring {
158
158
static type : string = SNAP_KEYRING_TYPE ;
159
159
160
160
type : string ;
161
161
162
+ // Name and state are required for modular initialisation.
163
+ name : typeof SNAP_KEYRING_NAME = SNAP_KEYRING_NAME ;
164
+
165
+ state = null ;
166
+
162
167
/**
163
168
* Messenger to dispatch requests to the Snaps controller.
164
169
*/
@@ -225,7 +230,6 @@ export class SnapKeyring extends EventEmitter {
225
230
callbacks : SnapKeyringCallbacks ;
226
231
isAnyAccountTypeAllowed ?: boolean ;
227
232
} ) {
228
- super ( ) ;
229
233
this . type = SnapKeyring . type ;
230
234
this . #messenger = messenger ;
231
235
this . #snapClient = new KeyringInternalSnapClient ( { messenger } ) ;
0 commit comments