File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
src/modules/select/wallets Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,6 @@ function torus(options: TorusOptions & { networkId: number }): WalletModule {
23
23
loginMethod
24
24
} = options
25
25
26
- let account : string
27
-
28
26
return {
29
27
name : label || 'Torus' ,
30
28
svg : svg || torusIcon ,
@@ -61,27 +59,25 @@ function torus(options: TorusOptions & { networkId: number }): WalletModule {
61
59
name : 'Torus' ,
62
60
connect : async ( ) => {
63
61
const result = await instance . login ( { verifier : loginMethod } )
64
- account = result [ 0 ]
65
62
return { message : result [ 0 ] }
66
63
} ,
67
64
disconnect : ( ) => instance . cleanUp ( ) ,
68
65
address : {
69
- get : ( ) => Promise . resolve ( account )
66
+ get : ( ) => Promise . resolve ( instance . web3 . eth . accounts [ 0 ] )
70
67
} ,
71
68
network : {
72
- get : ( ) => Promise . resolve ( Number ( networkId ) )
69
+ get : ( ) => Promise . resolve ( Number ( instance . web3 . version . network ) )
73
70
} ,
74
71
balance : {
75
72
get : ( ) =>
76
73
new Promise ( async ( resolve , reject ) => {
77
74
instance . web3 . eth . getBalance (
78
- account ,
79
- instance . web3 . eth . defaultBlock ,
80
- ( err : any , data : string ) => {
75
+ instance . web3 . eth . accounts [ 0 ] ,
76
+ ( err : any , data : any ) => {
81
77
if ( err ) {
82
78
reject ( `Error while checking Balance: ${ err } ` )
83
79
} else {
84
- resolve ( data . toString ( ) )
80
+ resolve ( data . toString ( 10 ) )
85
81
}
86
82
}
87
83
)
You can’t perform that action at this time.
0 commit comments