@@ -96,24 +96,18 @@ export class Provider {
96
96
this . #listeners. get ( 'connect' ) ?.( { chainId : '0x1' } )
97
97
this . #listeners. get ( 'connected' ) ?.( { chainId : '0x1' } )
98
98
this . connected = true
99
-
100
- console . log ( 'connected::' )
101
99
}
102
100
103
101
if ( method === 'wallet_switchEthereumChain' ) {
104
102
this . #listeners. get ( 'chainChanged' ) ?.( message . data )
105
103
this . #listeners. get ( 'networkChanged' ) ?.( message . data )
106
-
107
- console . log ( 'chainChanged::' )
108
104
}
109
105
110
106
resolve ( message . data )
111
107
112
108
return
113
109
}
114
110
case 'status:proxy:error' : {
115
- console . error ( message . error )
116
-
117
111
// note: for those dApps that make call after having permissions revoked
118
112
if (
119
113
message . error . message === 'dApp is not permitted by user' &&
@@ -154,21 +148,15 @@ export class Provider {
154
148
}
155
149
156
150
public on ( event : Event , handler : ( args : unknown ) => void ) : void {
157
- console . log ( 'on::' , event , handler )
158
-
159
151
this . #listeners. set ( event , handler )
160
152
}
161
153
162
154
/** @deprecated */
163
- public async close ( ...args : unknown [ ] ) : Promise < void > {
164
- console . log ( 'close::' , args )
165
-
155
+ public async close ( ) : Promise < void > {
166
156
this . disconnect ( )
167
157
}
168
158
169
- public removeListener ( event : Event , handler : ( args : unknown ) => void ) : void {
170
- console . log ( 'removeListener::' , event , handler )
171
-
159
+ public removeListener ( event : Event ) : void {
172
160
// note: not all dapps remove these on disconnect
173
161
if ( event === 'close' || event === 'disconnect' ) {
174
162
this . disconnect ( )
@@ -177,15 +165,17 @@ export class Provider {
177
165
this . #listeners. delete ( event )
178
166
}
179
167
168
+ public async enable ( ) {
169
+ return true
170
+ }
171
+
180
172
private async disconnect ( ) {
181
173
if ( ! this . connected ) {
182
174
return
183
175
}
184
176
185
177
this . connected = false
186
178
187
- console . log ( 'disconnect::' )
188
-
189
179
await this . request ( {
190
180
method : 'wallet_revokePermissions' ,
191
181
params : [
0 commit comments