From 1564415e5dc29cd76ac17f679ed83e0973764153 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Fri, 16 Nov 2018 15:41:54 -0800 Subject: Specify fallback web3 provider in analytics --- packages/instant/src/util/env.ts | 2 ++ packages/instant/src/util/provider_factory.ts | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'packages/instant/src/util') 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; }, }; -- cgit