mirror of
https://github.com/luxfhe/example-dapps.git
synced 2026-10-30 18:13:32 +00:00
12 lines
463 B
TypeScript
12 lines
463 B
TypeScript
import { useTargetNetwork } from "~~/hooks/helper";
|
|
import { GenericContractsDeclaration, contracts } from "~~/utils/helper/contract";
|
|
|
|
const DEFAULT_ALL_CONTRACTS: GenericContractsDeclaration[number] = {};
|
|
|
|
export function useAllContracts() {
|
|
const { targetNetwork } = useTargetNetwork();
|
|
const contractsData = contracts?.[targetNetwork.id];
|
|
// using constant to avoid creating a new object on every call
|
|
return contractsData || DEFAULT_ALL_CONTRACTS;
|
|
}
|