@wagmi/cli
Version:
Manage and generate code from Ethereum ABIs
60 lines • 2.49 kB
TypeScript
import type { ContractConfig } from '../config.js';
import type { Compute } from '../types.js';
export type EtherscanConfig<chainId extends number> = {
/**
* Etherscan API key.
*
* Create or manage keys at https://etherscan.io/myapikey
*/
apiKey: string;
/**
* Duration in milliseconds to cache ABIs.
*
* @default 1_800_000 // 30m in ms
*/
cacheDuration?: number | undefined;
/**
* Chain ID to use for fetching ABI.
*
* If `address` is an object, `chainId` is used to select the address.
*
* View supported chains on the [Etherscan docs](https://docs.etherscan.io/etherscan-v2/getting-started/supported-chains).
*/
chainId: (chainId extends ChainId ? chainId : never) | (ChainId & {});
/**
* Contracts to fetch ABIs for.
*/
contracts: Compute<Omit<ContractConfig<ChainId, chainId>, 'abi'>>[];
/**
* Whether to try fetching proxy implementation address of the contract
*
* @default false
*/
tryFetchProxyImplementation?: boolean | undefined;
};
/**
* Fetches contract ABIs from Etherscan.
*/
export declare function etherscan<chainId extends ChainId>(config: EtherscanConfig<chainId>): {
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 | undefined;
validate?: (() => import("../types.js").MaybePromise<void>) | undefined | undefined;
watch?: import("../config.js").Watch | undefined;
};
type ChainId = 1 | 11155111 | 17000 | 560048 | 56 | 97 | 137 | 80002 | 8453 | 84532 | 42161 | 42170 | 421614 | 59144 | 59141 | 81457 | 168587773 | 10 | 11155420 | 43114 | 43113 | 199 | 1029 | 42220 | 11142220 | 25 | 252 | 2522 | 100 | 5000 | 5003 | 43521 | 1284 | 1285 | 1287 | 204 | 5611 | 534352 | 534351 | 167000 | 167012 | 324 | 300 | 50 | 51 | 33139 | 33111 | 480 | 4801 | 50104 | 531050104 | 146 | 14601 | 130 | 1301 | 2741 | 11124 | 80094 | 80069 | 1923 | 1924 | 10143 | 999 | 747474 | 737373 | 1329 | 1328;
export {};
//# sourceMappingURL=etherscan.d.ts.map