Skip to content

Commit

Permalink
rm scam url check (#5128)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylarbarrera authored Oct 18, 2023
1 parent 8f36ed6 commit 056d7b0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
9 changes: 1 addition & 8 deletions src/resources/assets/UserAssetsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import {
} from '@/redux/data';
import store from '@/redux/store';
import { useQuery } from '@tanstack/react-query';
import {
filterPositionsData,
hideTokensWithUrls,
parseAddressAsset,
} from './assets';
import { filterPositionsData, parseAddressAsset } from './assets';
import { fetchHardhatBalances } from './hardhatAssets';
import {
AddysAccountAssetsMeta,
Expand Down Expand Up @@ -226,9 +222,6 @@ const fetchAndParseUserAssetsForChainIds = async (
parsedSuccessResults
);

// add tokens with URLs to hidden list
hideTokensWithUrls(parsedSuccessResults, address);

// update account empty state
if (!isEmpty(parsedSuccessResults)) {
saveAccountEmptyState(false, address, Network.mainnet);
Expand Down
18 changes: 0 additions & 18 deletions src/resources/assets/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,3 @@ function addHiddenCoins(coins: string[], address: string) {
dispatch(setHiddenCoins(newHiddenCoins));
storage.set(storageKey, JSON.stringify(newHiddenCoins));
}

const getTokenUrlScams = (tokens: RainbowAddressAssets): string[] =>
Object.values(tokens)
.filter(
asset =>
((asset?.name && isValidDomain(asset?.name.replaceAll(' ', ''))) ||
(asset?.symbol && isValidDomain(asset.symbol))) &&
!asset.isVerified
)
.map(asset => asset.uniqueId);

export const hideTokensWithUrls = (
tokens: RainbowAddressAssets,
address: string
) => {
const tokensWithUrls = getTokenUrlScams(tokens);
addHiddenCoins(tokensWithUrls, address);
};

0 comments on commit 056d7b0

Please sign in to comment.