diff --git a/packages/react-api/src/Api.tsx b/packages/react-api/src/Api.tsx index 2b6fc9ed62..b414c3ddfd 100644 --- a/packages/react-api/src/Api.tsx +++ b/packages/react-api/src/Api.tsx @@ -132,7 +132,7 @@ async function retrieve (api: ApiPromise, injectedPromise: Promise, store: KeyringStore | undefined, types: Record>): Promise { +async function loadOnReady (api: ApiPromise, endpoint: LinkOption | null, injectedPromise: Promise, store: KeyringStore | undefined, types: Record>, urlIsEthereum = false): Promise { statics.registry.register(types); const { injectedAccounts, properties, systemChain, systemChainType, systemName, systemVersion } = await retrieve(api, injectedPromise); @@ -142,7 +142,7 @@ async function loadOnReady (api: ApiPromise, endpoint: LinkOption | null, inject : settings.prefix; const tokenSymbol = properties.tokenSymbol.unwrapOr([formatBalance.getDefaults().unit, ...DEFAULT_AUX]); const tokenDecimals = properties.tokenDecimals.unwrapOr([DEFAULT_DECIMALS]); - const isEthereum = ethereumChains.includes(api.runtimeVersion.specName.toString()); + const isEthereum = ethereumChains.includes(api.runtimeVersion.specName.toString()) || urlIsEthereum; const isDevelopment = (systemChainType.isDevelopment || systemChainType.isLocal || isTestChain(systemChain)); console.log(`chain: ${systemChain} (${systemChainType.toString()}), ${stringify(properties)}`); @@ -299,7 +299,9 @@ export function ApiCtxRoot ({ apiUrl, children, isElectron, store }: Props): Rea .then(setExtensions) .catch(console.error); - loadOnReady(statics.api, apiEndpoint, injectedPromise, store, types) + const urlIsEthereum = !!location.href.includes('keyring-type=ethereum'); + + loadOnReady(statics.api, apiEndpoint, injectedPromise, store, types, urlIsEthereum) .then(setState) .catch(onError); });