|
|
|
@ -4,6 +4,7 @@ import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi'; |
|
|
|
|
import { SINGLE_CALL_BALANCES_ADDRESS } from '../constants/contracts'; |
|
|
|
|
import { MINUTE } from '../../../shared/constants/time'; |
|
|
|
|
import { isEqualCaseInsensitive } from '../../../ui/helpers/utils/util'; |
|
|
|
|
import { MAINNET_CHAIN_ID } from '../../../shared/constants/network'; |
|
|
|
|
|
|
|
|
|
// By default, poll every 3 minutes
|
|
|
|
|
const DEFAULT_INTERVAL = MINUTE * 3; |
|
|
|
@ -79,7 +80,13 @@ export default class DetectTokensController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const { tokenList } = this._tokenList.state; |
|
|
|
|
if (Object.keys(tokenList).length === 0) { |
|
|
|
|
// since the token detection is currently enabled only on Mainnet
|
|
|
|
|
// we can use the chainId check to ensure token detection is not triggered for any other network
|
|
|
|
|
// but once the balance check contract for other networks are deploayed and ready to use, we need to update this check.
|
|
|
|
|
if ( |
|
|
|
|
this._network.store.getState().provider.chainId !== MAINNET_CHAIN_ID || |
|
|
|
|
Object.keys(tokenList).length === 0 |
|
|
|
|
) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|