File tree Expand file tree Collapse file tree 6 files changed +51
-311
lines changed Expand file tree Collapse file tree 6 files changed +51
-311
lines changed Original file line number Diff line number Diff line change 42
42
"@ledgerhq/hw-app-eth" : " ^5.7.0" ,
43
43
"@ledgerhq/hw-transport-u2f" : " ^5.7.0" ,
44
44
"@portis/web3" : " ^2.0.0-beta.42" ,
45
- "@toruslabs/torus-embed" : " ^0.2.11 " ,
45
+ "@toruslabs/torus-embed" : " ^1.1.1 " ,
46
46
"@walletconnect/web3-provider" : " ^1.0.0-beta.45" ,
47
47
"authereum" : " ^0.0.4-beta.88" ,
48
48
"bignumber.js" : " ^9.0.0" ,
Original file line number Diff line number Diff line change @@ -158,6 +158,16 @@ export interface TorusOptions {
158
158
showTorusButton ?: boolean
159
159
buttonPosition ?: 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left'
160
160
enableLogging ?: boolean
161
+ enabledVerifiers : TorusVerifierStatus
162
+ }
163
+
164
+
165
+ interface TorusVerifierStatus {
166
+ google ?: boolean ;
167
+ facebook ?: boolean ;
168
+ reddit ?: boolean ;
169
+ twitch ?: boolean ;
170
+ discord ?: boolean ;
161
171
}
162
172
163
173
export interface AuthereumOptions {
Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ function torus(options: TorusOptions & CommonWalletOptions): WalletModule {
18
18
buttonPosition,
19
19
enableLogging,
20
20
loginMethod,
21
- showTorusButton
21
+ showTorusButton,
22
+ enabledVerifiers
22
23
} = options
23
24
24
25
return {
@@ -39,7 +40,8 @@ function torus(options: TorusOptions & CommonWalletOptions): WalletModule {
39
40
chainId : networkId , // default: 1
40
41
networkName : `${ networkName ( networkId ) } Network` // default: Main Ethereum Network
41
42
} ,
42
- showTorusButton : showTorusButton // default: true
43
+ showTorusButton : showTorusButton , // default: true
44
+ enabledVerifiers : enabledVerifiers
43
45
} )
44
46
45
47
const provider = instance . provider
Original file line number Diff line number Diff line change @@ -153,6 +153,11 @@ export function createLegacyProviderInterface(provider: any): WalletInterface {
153
153
export function getProviderName ( provider : any ) : string | undefined {
154
154
if ( ! provider ) return
155
155
156
+ // Torus also exports isMetamask to be true for backward compatibility
157
+ if ( provider . isTorus ) {
158
+ return 'Torus'
159
+ }
160
+
156
161
if ( provider . isMetaMask ) {
157
162
return 'MetaMask'
158
163
}
@@ -177,10 +182,6 @@ export function getProviderName(provider: any): string | undefined {
177
182
return 'Toshi'
178
183
}
179
184
180
- if ( provider . isTorus ) {
181
- return 'Torus'
182
- }
183
-
184
185
if ( provider . isCipher ) {
185
186
return 'Cipher'
186
187
}
Original file line number Diff line number Diff line change @@ -532,6 +532,7 @@ export function validateWalletInit(
532
532
enableLogging,
533
533
loginMethod,
534
534
showTorusButton,
535
+ enabledVerifiers,
535
536
disableNotifications,
536
537
...otherParams
537
538
} = walletInit
@@ -554,7 +555,8 @@ export function validateWalletInit(
554
555
'buttonPosition' ,
555
556
'enableLogging' ,
556
557
'loginMethod' ,
557
- 'showTorusButton'
558
+ 'showTorusButton' ,
559
+ 'enabledVerifiers'
558
560
] ,
559
561
'walletInitObject'
560
562
)
@@ -658,6 +660,14 @@ export function validateWalletInit(
658
660
optional : true
659
661
} )
660
662
663
+
664
+ validateType ( {
665
+ name : 'walletInit.enabledVerifiers' ,
666
+ value : enabledVerifiers ,
667
+ type : 'object' ,
668
+ optional : true
669
+ } )
670
+
661
671
validateType ( {
662
672
name : 'walletInit.buttonPosition' ,
663
673
value : buttonPosition ,
You can’t perform that action at this time.
0 commit comments