UNPKG

@nomiclabs/buidler

Version:

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

77 lines 3.1 kB
import { BuidlerArguments, BuidlerRuntimeEnvironment, EnvironmentExtender, EthereumProvider, ExperimentalBuidlerEVMMessageTraceHook, Network, ResolvedBuidlerConfig, RunTaskFunction, TasksMap } from "../../types"; export declare class Environment implements BuidlerRuntimeEnvironment { readonly config: ResolvedBuidlerConfig; readonly buidlerArguments: BuidlerArguments; readonly tasks: TasksMap; private static readonly _BLACKLISTED_PROPERTIES; /** * An EIP1193 Ethereum provider. */ ethereum: EthereumProvider; network: Network; private readonly _extenders; /** * Initializes the Buidler Runtime Environment and the given * extender functions. * * @remarks The extenders' execution order is given by the order * of the requires in the buidler's config file and its plugins. * * @param config The buidler's config object. * @param buidlerArguments The parsed buidler's arguments. * @param tasks A map of tasks. * @param extenders A list of extenders. */ constructor(config: ResolvedBuidlerConfig, buidlerArguments: BuidlerArguments, tasks: TasksMap, extenders?: EnvironmentExtender[], experimentalBuidlerEVMMessageTraceHooks?: ExperimentalBuidlerEVMMessageTraceHook[]); /** * Executes the task with the given name. * * @param name The task's name. * @param taskArguments A map of task's arguments. * * @throws a BDLR303 if there aren't any defined tasks with the given name. * @returns a promise with the task's execution result. */ readonly run: RunTaskFunction; /** * Injects the properties of `this` (the Buidler Runtime Environment) into the global scope. * * @param blacklist a list of property names that won't be injected. * * @returns a function that restores the previous environment. */ injectToGlobal(blacklist?: string[]): () => void; private _runTaskDefinition; /** * Check that task arguments are within TaskDefinition defined params constraints. * Also, populate missing, non-mandatory arguments with default param values (if any). * * @private * @throws BuidlerError if any of the following are true: * > a required argument is missing * > an argument's value's type doesn't match the defined param type * * @param taskDefinition * @param taskArguments * @returns resolvedTaskArguments */ private _resolveValidTaskArguments; /** * Resolves an argument according to a ParamDefinition rules. * * @param paramDefinition * @param argumentValue * @private */ private _resolveArgument; /** * Checks if value is valid for the specified param definition. * * @param paramDefinition {ParamDefinition} - the param definition for validation * @param argumentValue - the value to be validated * @private * @throws BDLR301 if value is not valid for the param type */ private _checkTypeValidation; } //# sourceMappingURL=runtime-environment.d.ts.map