@wagmi/cli
Version:
Manage and generate code from Ethereum ABIs
57 lines • 1.82 kB
TypeScript
import type { Address } from 'viem';
import type { ContractConfig } from '../config.js';
import type { Compute } from '../types.js';
export type BlockExplorerConfig = {
/**
* API key for block explorer. Appended to the request URL as query param `&apikey=${apiKey}`.
*/
apiKey?: string | undefined;
/**
* Base URL for block explorer.
*/
baseUrl: string;
/**
* Duration in milliseconds to cache ABIs.
*
* @default 1_800_000 // 30m in ms
*/
cacheDuration?: number | undefined;
/**
* Contracts to fetch ABIs for.
*/
contracts: Compute<Omit<ContractConfig, 'abi'>>[];
/**
* Function to get address from contract config.
*/
getAddress?: ((config: {
address: NonNullable<ContractConfig['address']>;
}) => Address) | undefined;
/**
* Name of source.
*/
name?: ContractConfig['name'] | undefined;
};
/**
* Fetches contract ABIs from block explorers, supporting `?module=contract&action=getabi` requests.
*/
export declare function blockExplorer(config: BlockExplorerConfig): {
contracts: () => import("../types.js").MaybePromise<ContractConfig[]>;
name: string;
run?: ((config: {
contracts: import("../config.js").Contract[];
isTypeScript: boolean;
outputs: readonly {
plugin: Pick<import("../config.js").Plugin, "name">;
imports?: string;
prepend?: string;
content: string;
}[];
}) => import("../types.js").MaybePromise<{
imports?: string;
prepend?: string;
content: string;
}>) | undefined;
validate?: (() => import("../types.js").MaybePromise<void>) | undefined;
watch?: import("../config.js").Watch | undefined;
};
//# sourceMappingURL=blockExplorer.d.ts.map