import type { HookContext, NetworkHooks } from "hardhat/types/hooks"; import type { ChainType, NetworkConnection } from "hardhat/types/network"; import { NetworkHelpers } from "../network-helpers/network-helpers.js"; export default async (): Promise> => { const handlers: Partial = { async newConnection( context: HookContext, next: ( nextContext: HookContext, ) => Promise>, ) { const connection = await next(context); connection.networkHelpers = new NetworkHelpers(connection); return connection; }, }; return handlers; };