import { ChainMetadata } from "../../model/response.js"; import "../../model/index.js"; import { ChainCompareCounts, CompareCounts, DiffPathCount } from "./fieldDiff.js"; import { Logger } from "pino"; //#region src/dev/mode-parity/scriptUtils.d.ts /** * Chains the compare scripts attach to. **/ export type ComparedNetwork = "Mainnet" | "Monad" | "Plasma" | "Somnia" | "Etherlink"; export declare const NETWORKS: ComparedNetwork[]; export declare const BACKEND_URL: string; export declare const TIMEOUT = 480000; /** * Totals both compare reports print. **/ export interface PrintableCompareSummary extends CompareCounts { byChain: ChainCompareCounts[]; diffsByPath: DiffPathCount[]; /** * Present on position reports: wallets whose listings could not be read. **/ walletsFailed?: number; } /** * Per-source chain metadata both compare reports carry. **/ export interface PrintableCompareReport { backendUrl: string; summary: PrintableCompareSummary; onchainChains: ChainMetadata[]; offchainChains: ChainMetadata[]; } export declare function requireEnv(name: string): string; export declare function rpcUrls(): Record; export declare function createLogger(): Logger; export declare function errorMessage(error: unknown): string; /** * Runs `fn` over `items` with at most `concurrency` in flight. **/ export declare function mapPool(items: readonly T[], concurrency: number, fn: (item: T) => Promise): Promise; /** * Formats a relative difference in bps as a percent, e.g. 12.5 → `"0.125%"`. **/ export declare function formatBpsAsPercent(bps: number): string; /** * Reasons a compare run should fail CI: unexpected membership or field diffs, * both sources empty, a chain that could not be read, or wallets that failed * to list. Expected diffs (mode-scoped, backend-preferred, tolerance) do not * fail the run. **/ export declare function evaluateCompareFailure(report: PrintableCompareReport): string[]; /** * Prints the shared membership table, the fields that differed most often, * and any chain that failed to answer. **/ export declare function printCompareSummary(noun: string, report: PrintableCompareReport, extraLines?: string[]): void; /** * Markdown of the same summary printed to the console, for GitHub job summaries. **/ export declare function formatCompareMarkdown(noun: string, report: PrintableCompareReport, extraLines?: string[], reasons?: string[]): string; /** * Appends {@link formatCompareMarkdown} to `GITHUB_STEP_SUMMARY` when running * in GitHub Actions. No-op locally. **/ export declare function writeGithubJobSummary(noun: string, report: PrintableCompareReport, extraLines?: string[], reasons?: string[]): void; /** * Console + job-summary output for a compare run. Returns the failure reasons * so the caller can exit 1 when the report is not similar. **/ export declare function reportCompare(noun: string, report: PrintableCompareReport, extraLines?: string[]): string[]; //#endregion