Adds Fortmatic to providerType

Uses fortmatic as default provider
This commit is contained in:
apane
2019-10-01 16:48:36 -03:00
committed by David Sun
parent 9f8cb99340
commit 85bdccbc06
3 changed files with 7 additions and 4 deletions

View File

@@ -91,5 +91,6 @@ export const PROVIDER_TYPE_TO_NAME: { [key in ProviderType]: string } = {
[ProviderType.Parity]: 'Parity',
[ProviderType.TrustWallet]: 'Trust Wallet',
[ProviderType.Opera]: 'Opera Wallet',
[ProviderType.Fortmatic]: 'Fortmatic',
[ProviderType.Fallback]: 'Fallback',
};

View File

@@ -185,6 +185,7 @@ export enum ProviderType {
Cipher = 'CIPHER',
TrustWallet = 'TRUST_WALLET',
Opera = 'OPERA',
Fortmatic = 'Fortmatic',
Fallback = 'FALLBACK',
}

View File

@@ -1,9 +1,9 @@
import * as bowser from 'bowser';
import { ZeroExProvider } from 'ethereum-types';
import {ZeroExProvider} from 'ethereum-types';
import * as _ from 'lodash';
import { PROVIDER_TYPE_TO_NAME } from '../constants';
import { Browser, OperatingSystem, ProviderType } from '../types';
import {PROVIDER_TYPE_TO_NAME} from '../constants';
import {Browser, OperatingSystem, ProviderType} from '../types';
export const envUtil = {
getBrowser(): Browser {
@@ -58,7 +58,8 @@ export const envUtil = {
} else if (envUtil.getBrowser() === Browser.Opera && !anyProvider.isMetaMask) {
return ProviderType.Opera;
}
return;
// If the provider is not supported by 0x, use fortmatic
return ProviderType.Fortmatic;
},
getProviderName(provider: ZeroExProvider): string {
const providerTypeIfExists = envUtil.getProviderType(provider);