We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b0c091 commit 102b1e3Copy full SHA for 102b1e3
1 file changed
modules/statics/src/networks.ts
@@ -2786,3 +2786,15 @@ export const Networks = {
2786
unieth: Object.freeze(new UniethTestnet()),
2787
},
2788
};
2789
+
2790
+const networkByName: Map<string, BaseNetwork> = new Map(
2791
+ Object.values(Networks).flatMap((category) => Object.values(category).map((network) => [network.name, network]))
2792
+);
2793
2794
+/**
2795
+ * Look up a registered network by its display name (e.g. "Ethereum", "Bitcoin").
2796
+ * Returns undefined for names not registered in local statics.
2797
+ */
2798
+export function getNetworkByName(name: string): BaseNetwork | undefined {
2799
+ return networkByName.get(name);
2800
+}
0 commit comments