async detectCollectibles() {
    /* istanbul ignore if */
    if (!this.isMainnet()) {
      return
    }
    const { selectedAddress } = this
    /* istanbul ignore else */
    if (!selectedAddress) {
      return
    }
    this.assetController.setSelectedAddress(selectedAddress)
    const apiCollectibles = await this.getOwnerCollectibles()
    for (const {
      token_id: tokenID,
      image_url: imageURL,
      name,
      description,
      asset_contract: {
        address: contractAddress,
        name: contractName,
        symbol: contractSymbol,
        image_url: contractImage = '',
        total_supply: contractSupply,
        description: contractDescription,
      },
    } of apiCollectibles) {
      // eslint-disable-next-line no-await-in-loop
      await this.assetController.addCollectible(
        contractAddress,
        tokenID.toString(),
        {
          description,
          image: imageURL || (contractImage || '').replace('=s60', '=s240'),
          name: name || `${contractName}#${tokenID}`,
          contractAddress,
          contractName,
          contractSymbol,
          contractImage: (contractImage || '').replace('=s60', '=s240') || imageURL,
          contractSupply,
          contractDescription,
        },
        true
      )
    }
  }
/**
   * Triggers asset ERC721 token auto detection on mainnet
   * adding new collectibles and removing not owned collectibles
   */
Triggers asset ERC721 token auto detection on mainnet
adding new collectibles and removing not owned collectibles
Triggers asset ERC721 token auto detection on mainnet adding new collectibles and removing not owned collectibles
async detectCollectibles() {
    if (!this.isMainnet()) {
      return
    }
    const { selectedAddress } = this
    if (!selectedAddress) {
      return
    }
    this.assetController.setSelectedAddress(selectedAddress)
    const apiCollectibles = await this.getOwnerCollectibles()
    for (const {
      token_id: tokenID,
      image_url: imageURL,
      name,
      description,
      asset_contract: {
        address: contractAddress,
        name: contractName,
        symbol: contractSymbol,
        image_url: contractImage = '',
        total_supply: contractSupply,
        description: contractDescription,
      },
    } of apiCollectibles) {
      await this.assetController.addCollectible(
        contractAddress,
        tokenID.toString(),
        {
          description,
          image: imageURL || (contractImage || '').replace('=s60', '=s240'),
          name: name || `${contractName}#${tokenID}`,
          contractAddress,
          contractName,
          contractSymbol,
          contractImage: (contractImage || '').replace('=s60', '=s240') || imageURL,
          contractSupply,
          contractDescription,
        },
        true
      )
    }
  }
async detectCollectibles ( ) { if ( ! this . isMainnet ( ) ) { return } const { selectedAddress } = this if ( ! selectedAddress ) { return } this . assetController . setSelectedAddress ( selectedAddress ) const apiCollectibles = await this . getOwnerCollectibles ( ) for ( const { token_id : tokenID , image_url : imageURL , name , description , asset_contract : { address : contractAddress , name : contractName , symbol : contractSymbol , image_url : contractImage = '' , total_supply : contractSupply , description : contractDescription , } , } of apiCollectibles ) { await this . assetController . addCollectible ( contractAddress , tokenID . toString ( ) , { description , image : imageURL || ( contractImage || '' ) . replace ( '=s60' , '=s240' ) , name : name || ` ${ contractName } ${ tokenID } ` , contractAddress , contractName , contractSymbol , contractImage : ( contractImage || '' ) . replace ( '=s60' , '=s240' ) || imageURL , contractSupply , contractDescription , } , true ) } }
Triggers asset ERC721 token auto detection on mainnet
 adding new collectibles and removing not owned collectibles
Triggers asset ERC721 token auto detection on mainnet adding new collectibles and removing not owned collectibles
/* istanbul ignore if */ /* istanbul ignore else */ // eslint-disable-next-line no-await-in-loop