fixed types
Some checks failed
Some checks failed
This commit is contained in:
parent
fd61376b36
commit
135a01b7fd
@ -17,9 +17,9 @@ const Tokens: { [key in NetworkEnum]: {[key in TokenEnum] :string} } = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getTokenByAddress = (address: string) => {
|
export const getTokenByAddress = (address: string) => {
|
||||||
for ( let network in NetworkEnum ) {
|
for ( const [, network] of Object.entries(NetworkEnum) ) {
|
||||||
for (const token of Object.keys(Tokens[network])) {
|
for (const token of Object.keys(Tokens[network as NetworkEnum])) {
|
||||||
if (address === Tokens[network][token as TokenEnum]) {
|
if (address === Tokens[network as NetworkEnum][token as TokenEnum]) {
|
||||||
return token as TokenEnum;
|
return token as TokenEnum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import type { NetworkEnum, TokenEnum } from "@/model/NetworkEnum";
|
|||||||
|
|
||||||
export const imagesPath = import.meta.glob<string>('@/assets/*.{png,svg}', { eager: true, query: '?url', import: 'default' });
|
export const imagesPath = import.meta.glob<string>('@/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) =>
|
const path = Object.keys(imagesPath).find((key) =>
|
||||||
key.endsWith(`${networkName.toLowerCase()}.svg`)
|
key.endsWith(`${networkName.toLowerCase()}.svg`)
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user