aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-17 07:41:54 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-17 07:41:54 +0800
commit1564415e5dc29cd76ac17f679ed83e0973764153 (patch)
treeefeba5d9948e588dc2ff9c36575c0c2d1a2b2e74 /packages/instant/src/util
parent83a6d7b97d9bea901c4d02d1a46186e64e3db367 (diff)
downloaddexon-0x-contracts-1564415e5dc29cd76ac17f679ed83e0973764153.tar.gz
dexon-0x-contracts-1564415e5dc29cd76ac17f679ed83e0973764153.tar.zst
dexon-0x-contracts-1564415e5dc29cd76ac17f679ed83e0973764153.zip
Specify fallback web3 provider in analytics
Diffstat (limited to 'packages/instant/src/util')
-rw-r--r--packages/instant/src/util/env.ts2
-rw-r--r--packages/instant/src/util/provider_factory.ts4
2 files changed, 6 insertions, 0 deletions
diff --git a/packages/instant/src/util/env.ts b/packages/instant/src/util/env.ts
index 4a32f9cb1..59b47d1e3 100644
--- a/packages/instant/src/util/env.ts
+++ b/packages/instant/src/util/env.ts
@@ -52,6 +52,8 @@ export const envUtil = {
return ProviderType.CoinbaseWallet;
} else if (!_.isUndefined(_.get(window, '__CIPHER__'))) {
return ProviderType.Cipher;
+ } else if ((provider as any).zeroExInstantFallbackEngine) {
+ return ProviderType.Fallback;
}
return;
},
diff --git a/packages/instant/src/util/provider_factory.ts b/packages/instant/src/util/provider_factory.ts
index 603f7674d..d77407521 100644
--- a/packages/instant/src/util/provider_factory.ts
+++ b/packages/instant/src/util/provider_factory.ts
@@ -29,6 +29,10 @@ export const providerFactory = {
providerEngine.addProvider(new RPCSubprovider(rpcUrl));
// // Start the Provider Engine
providerEngine.start();
+ // This feels a bit dirty, but was the only way I could think of
+ // checking to see if this engine is our fallback engine, and not
+ // another Web3Provider engine provided by some dapp browser
+ (providerEngine as any).zeroExInstantFallbackEngine = true;
return providerEngine;
},
};