aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util
diff options
context:
space:
mode:
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;
},
};