Detect dapper provider

This commit is contained in:
mmv 2019-10-25 16:14:46 +04:00
parent beae72c471
commit e8d54b6228
1 changed files with 11 additions and 2 deletions

View File

@ -24,8 +24,16 @@ export const WALLET_PROVIDER = {
SQUARELINK: 'SQUARELINK',
WALLETCONNECT: 'WALLETCONNECT',
OPERA: 'OPERA',
DAPPER: 'DAPPER',
}
export const INJECTED_PROVIDERS = [
WALLET_PROVIDER.SAFE,
WALLET_PROVIDER.METAMASK,
WALLET_PROVIDER.OPERA,
WALLET_PROVIDER.DAPPER,
]
export const ETHEREUM_NETWORK_IDS = {
// $FlowFixMe
1: ETHEREUM_NETWORK.MAINNET,
@ -82,6 +90,9 @@ const getProviderName: Function = (web3Provider): string => {
name = 'Wallet'
}
break
case 'DapperLegacyProvider':
name = WALLET_PROVIDER.DAPPER
break
default:
name = 'Wallet'
}
@ -105,8 +116,6 @@ const getProviderName: Function = (web3Provider): string => {
return name
}
export const INJECTED_PROVIDERS = [WALLET_PROVIDER.SAFE, WALLET_PROVIDER.METAMASK, WALLET_PROVIDER.OPERA]
export const getAccountFrom: Function = async (web3Provider): Promise<string | null> => {
const accounts = await web3Provider.eth.getAccounts()