Compare commits

...

3 Commits

Author SHA1 Message Date
hueso
5d70b16619 fix web3onboard calling wrong rpcUrl 2025-10-12 19:14:17 -03:00
hueso
a3e3f0506c add rsk testnet icon 2025-10-12 18:57:36 -03:00
hueso
976c48ac4b optimized icon importing 2025-10-12 18:57:25 -03:00
9 changed files with 81 additions and 23 deletions

View File

@ -15,7 +15,7 @@ const targetNetwork = ref(DEFAULT_NETWORK);
const web3Onboard = init({
wallets: [injected],
chains: Object.values(Networks).map((network) => ({
id: network.id,
id: `0x${network.id.toString(16)}`,
token: network.nativeCurrency.symbol,
label: network.name,
rpcUrl: network.rpcUrls.default.http[0],

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 79 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 644 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1,29 +1,11 @@
import type { TokenEnum } from "@/model/NetworkEnum";
export const imagesPath = import.meta.glob<string>("@/assets/*.{png,svg}", {
eager: true,
query: "?url",
import: "default",
});
import { Networks } from "@/config/networks";
export const getNetworkImage = (networkName: string): string => {
const imageName = networkName
.toLowerCase()
.replace(/[^a-z0-9]/g, '-');
try {
const path = Object.keys(imagesPath).find((key) =>
key.endsWith(`${imageName}.svg`)
);
return path ? imagesPath[path] : "";
} catch (error) {
console.error("Error fetching network image");
return "";
}
const normalizedName = networkName.toLowerCase().replace(/[^a-z0-9]/g, '-');
return new URL(`../assets/networks/${normalizedName}.svg`, import.meta.url).href;
};
export const getTokenImage = (tokenName: TokenEnum): string => {
const path = Object.keys(imagesPath).find((key) =>
key.endsWith(`${tokenName.toLowerCase()}.svg`)
);
return path ? imagesPath[path] : "";
return new URL(`../assets/tokens/${tokenName.toLowerCase()}.svg`, import.meta.url).href;
};