UNPKG

hardhat

Version:

Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.

147 lines (128 loc) 4.02 kB
import "./builtin-plugin-type-extensions.js"; /** * A configuration variable to be fetched at runtime from * different sources, depending on the user's setup. */ export interface ConfigurationVariable { _type: "ConfigurationVariable"; name: string; format?: string; /** * An optional fallback value, used only when the variable can't be resolved * from any other source (e.g. an environment variable or the keystore). * * By default, the value is resolved from the environment variable first, then * any plugin source (like hardhat-keystore), and finally this default. Plugins * can customize this, but the built-in resolver and bundled plugins follow this * order. If none of them provide a value and no default is set, resolving the * variable throws. */ default?: string; } /** * A resolved configuration variable. */ export interface ResolvedConfigurationVariable { _type: "ResolvedConfigurationVariable"; format: string; /** * Returns the raw value of the configuration variable. */ get(): Promise<string>; /** * Returns the value of the configuration variable, after * validating that it's a URL. * * @throws an error if the value is not a URL. */ getUrl(): Promise<string>; /** * Returns the value of the configuration variable interpreted * as a BigInt. * * @throws an error if the value is not a valid BigInt. */ getBigInt(): Promise<bigint>; /** * Returns the value of the configuration variable, validating that is a * valid hex string. Trimming any spaces, and making sure it's lowercase and * that it starts with 0x. */ getHexString(): Promise<string>; } /** * A function that resolves a configuration variable. */ export type ConfigurationVariableResolver = ( variableOrString: ConfigurationVariable | string, ) => ResolvedConfigurationVariable; /** * A sensitive string, which can be provided as a literal * string or as a configuration variable. */ export type SensitiveString = string | ConfigurationVariable; /** * The user's Hardhat configuration, as exported in their * config file. */ export interface HardhatUserConfig { paths?: ProjectPathsUserConfig; } /** * The different paths that conform a Hardhat project. */ export interface ProjectPathsUserConfig { cache?: string; artifacts?: string; tests?: string | TestPathsUserConfig; sources?: string | string[] | SourcePathsUserConfig; } /** * The different paths where the Hardhat project's tests are located. */ /* eslint-disable-next-line @typescript-eslint/no-empty-interface -- This is intended to be used through module augmentation. */ export interface TestPathsUserConfig {} /** * The different paths where the Hardhat project's sources are located. */ /* eslint-disable-next-line @typescript-eslint/no-empty-interface -- This is intended to be used through module augmentation. */ export interface SourcePathsUserConfig {} /** * The resolved Hardhat configuration. */ export interface HardhatConfig { paths: ProjectPathsConfig; } /** * The resolved Hardhat project paths configuration. * * All of the paths in this object are absolute. */ export interface ProjectPathsConfig { root: string; /** * An absolute path to the config file, if a config file was loaded. * * This is only undefined when a HardhatRuntimeEnvironment is created * programmatically. */ config?: string; cache: string; artifacts: string; tests: TestPathsConfig; sources: SourcePathsConfig; } /** * The resolved paths where the Hardhat project's tests are located. */ /* eslint-disable-next-line @typescript-eslint/no-empty-interface -- This is intended to be used through module augmentation. */ export interface TestPathsConfig {} /** * The resolved paths where the Hardhat project's sources are located. */ /* eslint-disable-next-line @typescript-eslint/no-empty-interface -- This is intended to be used through module augmentation. */ export interface SourcePathsConfig {}