@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.
- package/package.json +1 -1
- package/utils/network.ts +7 -3
package/package.json
CHANGED
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
|
|
366
|
+
return network?.name;
|
|
367
367
|
};
|
|
368
368
|
|
|
369
369
|
export const getRpcURLByChainId = (chainId: ChainId | number | string) => {
|
|
370
|
-
|
|
371
|
-
|
|
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) => {
|