diff --git a/src/blockchain/addresses.ts b/src/blockchain/addresses.ts index 9f5e530..0000bfc 100644 --- a/src/blockchain/addresses.ts +++ b/src/blockchain/addresses.ts @@ -17,9 +17,9 @@ const Tokens: { [key in NetworkEnum]: {[key in TokenEnum] :string} } = { }; export const getTokenByAddress = (address: string) => { - for ( let network in NetworkEnum ) { - for (const token of Object.keys(Tokens[network])) { - if (address === Tokens[network][token as TokenEnum]) { + for ( const [, network] of Object.entries(NetworkEnum) ) { + for (const token of Object.keys(Tokens[network as NetworkEnum])) { + if (address === Tokens[network as NetworkEnum][token as TokenEnum]) { return token as TokenEnum; } } diff --git a/src/utils/imagesPath.ts b/src/utils/imagesPath.ts index 607c574..161072d 100644 --- a/src/utils/imagesPath.ts +++ b/src/utils/imagesPath.ts @@ -2,7 +2,7 @@ import type { NetworkEnum, TokenEnum } from "@/model/NetworkEnum"; export const imagesPath = import.meta.glob('@/assets/*.{png,svg}', { eager: true, query: '?url', import: 'default' }); -export const getNetworkImage = (networkName: NetworkEnum): string => { +export const getNetworkImage = (networkName: string): string => { const path = Object.keys(imagesPath).find((key) => key.endsWith(`${networkName.toLowerCase()}.svg`) );