diff --git a/src/nibiru/index.ts b/src/nibiru/index.ts index f588a4fdc5..5fcc5f63a0 100644 --- a/src/nibiru/index.ts +++ b/src/nibiru/index.ts @@ -3,61 +3,29 @@ import type { LocalConfig } from '@/stores'; const PLAYGROUND_NETWORKS = 'https://networks.play.nibiru.fi/ping-pub'; const DEV_NETWORKS = 'https://networks.testnet.nibiru.fi/ping-pub'; const ITN_NETWORKS = 'https://networks.itn.nibiru.fi/ping-pub'; +const MAIN_NETWORK = 'https://networks.nibiru.fi/ping-pub'; -export const getItn = async (): Promise => { +export const getNetwork = async (url: string): Promise => { try { - const testnets = await fetch(ITN_NETWORKS).then((response) => - response.json() - ); - testnets.forEach((_: any, i: string | number) => { - testnets[i].visible = true; + const net = await fetch(url).then((response) => response.json()); + net.forEach((_: any, i: string | number) => { + net[i].visible = true; }); - return testnets; + return net; } catch (error) { console.log(error); - return; - } -}; - -export const getDevnets = async (): Promise => { - try { - const devnets = await fetch(DEV_NETWORKS).then((response) => - response.json() - ); - devnets.forEach((_: any, i: string | number) => { - devnets[i].visible = false; - }); - return devnets; - } catch (error) { - console.log(error); - return; - } -}; - -export const getPlaynets = async (): Promise => { - try { - const playnets = await fetch(PLAYGROUND_NETWORKS).then((response) => - response.json() - ); - playnets.forEach((_: any, i: string | number) => { - playnets[i].visible = false; - }); - return playnets; - } catch (error) { - console.log(error); - return; + return []; } }; export const getNibiruChains = async (): Promise<{ [key: string]: LocalConfig; }> => { - const [playnets, devnets, itn] = await Promise.all([ - undefined, //getPlaynets(), - undefined, //getDevnets(), - getItn(), + const [itn, main] = await Promise.all([ + getNetwork(ITN_NETWORKS), + getNetwork(MAIN_NETWORK), ]); - const chains = (itn ?? []).concat(playnets ?? [], devnets ?? []); + const chains = main.concat(itn); const chainsObj: { [key: string]: LocalConfig } = {}; chains.forEach((chain) => { chainsObj[chain.chain_name] = chain; diff --git a/src/stores/useDashboard.ts b/src/stores/useDashboard.ts index cf8b2b656e..79512ceeae 100644 --- a/src/stores/useDashboard.ts +++ b/src/stores/useDashboard.ts @@ -260,7 +260,7 @@ export const useDashboard = defineStore('dashboard', { state: () => { const favMap = JSON.parse( localStorage.getItem('favoriteMap') ?? - '{"cosmos":true, "osmosis":true, "nibiru":true, "nibiru-itn-3":true}' + '{"nibiru":true,"nibiru-itn-3":true,"cataclysm-1":true,"nibiru-testnet-1":true}' ); return { status: LoadingStatus.Empty,