mirror of
https://github.com/luxfhe/example-redact.git
synced 2026-10-30 18:13:20 +00:00
9 lines
418 B
TypeScript
9 lines
418 B
TypeScript
import scaffoldConfig from "~~/scaffold.config";
|
|
import { useGlobalState } from "~~/services/store/store";
|
|
import { AllowedChainIds } from "~~/utils/scaffold-eth";
|
|
|
|
export function useSelectedNetwork(chainId?: AllowedChainIds) {
|
|
const targetNetwork = useGlobalState(({ targetNetwork }) => targetNetwork);
|
|
return scaffoldConfig.targetNetworks.find(targetNetwork => targetNetwork.id === chainId) ?? targetNetwork;
|
|
}
|