/** * Fork network configuration * Allows a custom network to inherit contract aliases from a parent network */ export interface ForkNetworkConfig { host: string; fork: string; } /** * Network configuration - either a string (host) or fork configuration */ export type NetworkConfig = string | ForkNetworkConfig; export interface FlowJson { networks?: { [key: string]: NetworkConfig; }; accounts?: { [key: string]: { address: string; key?: string | object; }; }; contracts?: { [key: string]: { source: string; aliases: { [key: string]: string; }; canonical?: string; }; }; dependencies?: { [key: string]: { source: string; hash: string; aliases: { [key: string]: string; }; canonical?: string; }; }; deployments?: { [key: string]: { [contract: string]: string[]; }; }; } /** * @description Support if/then/else behavior in a function way. * @param testFn - Function to test * @param posCond - Function to run if testFn is true * @param negCond - Function to run it testFn is false * @returns Function that returns the result of posCond or negCond */ export declare const ifElse: (testFn: (v: T) => U, posCond: (v: T) => U, negCond: (v: T) => U) => (v: T) => U; /** * @description Take in flow.json files and return contract to address mapping by network * @param jsons - Flow JSON or array of Flow JSONs * @param network - Network to gather addresses for (can be a fork network) * @returns Contract names by addresses mapping including canonical references * * Returns both contract addresses and canonical references for import aliases: * - Contract addresses: { "HelloWorld": "0x123", "FUSD1": "0xe223..." } * - Canonical references: { "FUSD1.canonical": "FUSD" } * * These are stored in config as: * - system.contracts.FUSD1 = "0xe223..." * - system.contracts.FUSD1.canonical = "FUSD" * * The canonical reference enables import alias resolution: * - import "FUSD1" → import FUSD as FUSD1 from 0xe223... * * Fork networks use fallback resolution: * - First collects all aliases from the parent network (e.g., "mainnet") * - Then overlays aliases from the fork network (e.g., "mainnet-fork") * - This allows fork-specific overrides while inheriting the rest */ export declare const getContracts: (jsons: FlowJson | FlowJson[], network: string) => {}; /** * @description Take in flow.json or array of flow.json files and checks for private keys * @param value - Flow JSON or array of Flow JSONs * @returns Has private keys status */ export declare const anyHasPrivateKeys: (value: FlowJson | FlowJson[]) => boolean; /** * @description Format network name, converting 'local' to 'emulator' * @param network - Network to format * @returns Formatted network name * * This function now accepts any network name (including custom fork networks). * It only transforms "local" to "emulator" for backward compatibility. */ export declare const cleanNetwork: (network: string) => string;