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