Skip to content

Commit

Permalink
chore: pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
CalicoNino committed Nov 10, 2023
1 parent 2e5fcd5 commit 7bf114c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/nibiru/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ 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 getNetwork = async (
url: string
): Promise<LocalConfig[] | undefined> => {
export const getNetwork = async (url: string): Promise<LocalConfig[]> => {
try {
const net = await fetch(url).then((response) => response.json());
net.forEach((_: any, i: string | number) => {
Expand All @@ -16,7 +14,7 @@ export const getNetwork = async (
return net;
} catch (error) {
console.log(error);
return;
return [];
}
};

Expand All @@ -27,7 +25,7 @@ export const getNibiruChains = async (): Promise<{
getNetwork(ITN_NETWORKS),
getNetwork(MAIN_NETWORK),
]);
const chains = (main ?? []).concat(itn ?? []);
const chains = main.concat(itn);
const chainsObj: { [key: string]: LocalConfig } = {};
chains.forEach((chain) => {
chainsObj[chain.chain_name] = chain;
Expand Down

0 comments on commit 7bf114c

Please sign in to comment.