@@ -82,7 +82,7 @@ export function walletConnect(parameters: AppKitOptionsParams, appKit: AppKit) {
82
82
name : 'WalletConnect' ,
83
83
type : walletConnect . type ,
84
84
85
- async setup ( this : Properties ) {
85
+ async setup ( ) {
86
86
const provider = await this . getProvider ( ) . catch ( ( ) => null )
87
87
if ( ! provider ) {
88
88
return
@@ -205,7 +205,7 @@ export function walletConnect(parameters: AppKitOptionsParams, appKit: AppKit) {
205
205
throw error
206
206
}
207
207
} ,
208
- async disconnect ( this : Properties ) {
208
+ async disconnect ( ) {
209
209
const provider = await this . getProvider ( )
210
210
try {
211
211
await provider ?. disconnect ( )
@@ -302,7 +302,7 @@ export function walletConnect(parameters: AppKitOptionsParams, appKit: AppKit) {
302
302
303
303
return network ?. id as number
304
304
} ,
305
- async isAuthorized ( this : Properties ) {
305
+ async isAuthorized ( ) {
306
306
try {
307
307
const [ accounts , provider ] = await Promise . all ( [ this . getAccounts ( ) , this . getProvider ( ) ] )
308
308
@@ -326,7 +326,7 @@ export function walletConnect(parameters: AppKitOptionsParams, appKit: AppKit) {
326
326
return false
327
327
}
328
328
} ,
329
- async switchChain ( this : Properties , { addEthereumChainParameter, chainId } ) {
329
+ async switchChain ( { addEthereumChainParameter, chainId } ) {
330
330
const provider = await this . getProvider ( )
331
331
if ( ! provider ) {
332
332
throw new ProviderNotFoundError ( )
@@ -397,7 +397,7 @@ export function walletConnect(parameters: AppKitOptionsParams, appKit: AppKit) {
397
397
}
398
398
}
399
399
} ,
400
- onAccountsChanged ( this : Properties , accounts ) {
400
+ onAccountsChanged ( accounts ) {
401
401
if ( accounts . length === 0 ) {
402
402
this . onDisconnect ( )
403
403
} else {
@@ -406,15 +406,15 @@ export function walletConnect(parameters: AppKitOptionsParams, appKit: AppKit) {
406
406
} )
407
407
}
408
408
} ,
409
- onChainChanged ( this : Properties , chain ) {
409
+ onChainChanged ( chain ) {
410
410
const chainId = Number ( chain )
411
411
412
412
config . emitter . emit ( 'change' , { chainId } )
413
413
} ,
414
- onConnect ( this : Properties , _connectInfo ) {
414
+ onConnect ( _connectInfo ) {
415
415
this . setRequestedChainsIds ( ChainController . getCaipNetworks ( ) . map ( x => Number ( x . id ) ) )
416
416
} ,
417
- async onDisconnect ( this : Properties , _error ) {
417
+ async onDisconnect ( _error ) {
418
418
this . setRequestedChainsIds ( [ ] )
419
419
config . emitter . emit ( 'disconnect' )
420
420
@@ -440,13 +440,13 @@ export function walletConnect(parameters: AppKitOptionsParams, appKit: AppKit) {
440
440
provider . on ( 'connect' , connect )
441
441
}
442
442
} ,
443
- onDisplayUri ( this : Properties , uri ) {
443
+ onDisplayUri ( uri ) {
444
444
config . emitter . emit ( 'message' , { type : 'display_uri' , data : uri } )
445
445
} ,
446
- onSessionDelete ( this : Properties ) {
446
+ onSessionDelete ( ) {
447
447
this . onDisconnect ( )
448
448
} ,
449
- getNamespaceChainsIds ( this : Properties ) {
449
+ getNamespaceChainsIds ( ) {
450
450
if ( ! provider_ ?. session ?. namespaces ) {
451
451
return [ ]
452
452
}
@@ -459,7 +459,7 @@ export function walletConnect(parameters: AppKitOptionsParams, appKit: AppKit) {
459
459
return chainIds
460
460
} ,
461
461
462
- async getRequestedChainsIds ( this : Properties ) {
462
+ async getRequestedChainsIds ( ) {
463
463
const chainIds = ( await config . storage ?. getItem ( this . requestedChainsStorageKey ) ) ?? [ ]
464
464
465
465
return [ ...new Set ( chainIds ) ]
@@ -475,7 +475,7 @@ export function walletConnect(parameters: AppKitOptionsParams, appKit: AppKit) {
475
475
* connector later on, however, this chain will not have been approved or rejected
476
476
* by the wallet. In this case, the chain is considered stale.
477
477
*/
478
- async isChainsStale ( this : Properties ) {
478
+ async isChainsStale ( ) {
479
479
if ( ! isNewChainsStale ) {
480
480
return false
481
481
}
@@ -493,7 +493,7 @@ export function walletConnect(parameters: AppKitOptionsParams, appKit: AppKit) {
493
493
return ! connectorChains . every ( id => requestedChains . includes ( Number ( id ) ) )
494
494
} ,
495
495
496
- async setRequestedChainsIds ( this : Properties , chains ) {
496
+ async setRequestedChainsIds ( chains ) {
497
497
await config . storage ?. setItem ( this . requestedChainsStorageKey , chains )
498
498
} ,
499
499
0 commit comments