feature(instant): add trust wallet detection

This commit is contained in:
Brandon Millman
2018-12-14 14:10:15 -08:00
parent 926fcb296f
commit 21a193e516
3 changed files with 4 additions and 0 deletions

View File

@@ -71,5 +71,6 @@ export const PROVIDER_TYPE_TO_NAME: { [key in ProviderType]: string } = {
[ProviderType.Mist]: 'Mist',
[ProviderType.CoinbaseWallet]: 'Coinbase Wallet',
[ProviderType.Parity]: 'Parity',
[ProviderType.TrustWallet]: 'Trust Wallet',
[ProviderType.Fallback]: 'Fallback',
};

View File

@@ -176,6 +176,7 @@ export enum ProviderType {
Mist = 'MIST',
CoinbaseWallet = 'COINBASE_WALLET',
Cipher = 'CIPHER',
TrustWallet = 'TRUST_WALLET',
Fallback = 'FALLBACK',
}

View File

@@ -44,6 +44,8 @@ export const envUtil = {
getProviderType(provider: Provider): ProviderType | undefined {
if (provider.constructor.name === 'EthereumProvider') {
return ProviderType.Mist;
} else if (provider.constructor.name === 'TrustWeb3Provider') {
return ProviderType.TrustWallet;
} else if ((provider as any).isParity) {
return ProviderType.Parity;
} else if ((provider as any).isMetaMask) {