@instadapp/avocado-base 0.0.78 → 0.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/network.ts +7 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instadapp/avocado-base",
3
- "version": "0.0.78",
3
+ "version": "0.0.80",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "global.d.ts",
package/utils/network.ts CHANGED
@@ -363,12 +363,16 @@ export const availableNetworks = networks.filter(
363
363
 
364
364
  export const chainIdToName = (chainId: ChainId | number | string) => {
365
365
  const network = getNetworkByChainId(chainId);
366
- return network.name;
366
+ return network?.name;
367
367
  };
368
368
 
369
369
  export const getRpcURLByChainId = (chainId: ChainId | number | string) => {
370
- const network = getNetworkByChainId(chainId);
371
- return network.params.rpcUrls[0];
370
+ try {
371
+ const network = getNetworkByChainId(chainId);
372
+ return network.params.rpcUrls[0];
373
+ } catch (e) {
374
+ return "";
375
+ }
372
376
  };
373
377
 
374
378
  export const RPCMap = networks.reduce((acc, network) => {