UNPKG

@ganache/ethereum-options

Version:
171 lines 5.47 kB
import { Data, Quantity } from "@ganache/utils"; import { Address } from "@ganache/ethereum-address"; import { Definitions } from "@ganache/options"; export type MinerConfig = { options: { /** * Sets the `blockTime` in seconds for automatic mining. A blockTime of `0` * (default) enables "instamine mode", where new executable transactions * will be mined instantly. * * Using the `blockTime` option is discouraged unless you have tests which * require a specific mining interval. * * @defaultValue 0 // "instamine mode" */ blockTime: { type: number; hasDefault: true; legacy: { /** * @deprecated Use miner.blockTime instead */ blockTime: number; }; }; /** * The amount of time, in seconds, to add to the `timestamp` of each new * block header. * * By default the value is `"clock"`, which uses your system clock time as * the timestamp for each block. * * @defaultValue "clock" */ timestampIncrement: { type: "clock" | Quantity; rawType: "clock" | string | number | bigint; hasDefault: true; cliType: string; }; /** * Sets the default gas price in WEI for transactions if not otherwise specified. * * @defaultValue 2_000_000 */ defaultGasPrice: { type: Quantity; rawType: string | number | bigint; hasDefault: true; legacy: { /** * @deprecated Use miner.gasPrice instead */ gasPrice: string | number | bigint; }; cliType: string; }; /** * Sets the block difficulty; value is always 0 after the merge hardfork * * @defaultValue 1 */ difficulty: { type: Quantity; rawType: string | number | bigint; hasDefault: true; cliType: string; }; /** * Sets the block gas limit in WEI. * * @defaultValue 30_000_000 */ blockGasLimit: { type: Quantity; rawType: string | number | bigint; hasDefault: true; legacy: { /** * @deprecated Use miner.blockGasLimit instead */ gasLimit: string | number | bigint; }; cliType: string; }; /** * Sets the default transaction gas limit in WEI. Set to `"estimate"` to * use an estimate (slows down transaction execution by 40%+). * * @defaultValue 90_000 */ defaultTransactionGasLimit: { type: Quantity; rawType: "estimate" | string | number | bigint; hasDefault: true; cliType: string; }; /** * Sets the transaction gas limit in WEI for `eth_call` and * `eth_estimateGas` calls. * * @defaultValue 50_000_000 */ callGasLimit: { type: Quantity; rawType: string | number | bigint; hasDefault: true; legacy: { /** * @deprecated Use miner.callGasLimit instead */ callGasLimit: string | number | bigint; }; cliType: string; }; /** * Set the instamine mode to either "eager" (default) or "strict". * * In "eager" mode a transaction will be included in a block before * its hash is returned to the caller. * * In "strict" mode a transaction's hash is returned to the caller before * the transaction is included in a block. * `instamine` has no effect if `blockTime` is *not* `0` (the default). * * @defaultValue "eager" */ instamine: { type: "eager" | "strict"; hasDefault: true; legacy: { instamine: "eager" | "strict"; }; }; /** * Sets the address where mining rewards will go. * * * `{string}` hex-encoded address * * `{number}` index of the account returned by `eth_getAccounts` * * @defaultValue "0x0000000000000000000000000000000000000000" */ coinbase: { rawType: string | number; type: Address | number; hasDefault: true; cliType: string; }; /** * Set the extraData block header field a miner can include. * * @defaultValue "" */ extraData: { rawType: string; type: Data; hasDefault: true; }; /** * Minimum price bump percentage needed to replace a transaction that already exists in the transaction pool. * * @defaultValue "" */ priceBump: { type: bigint; rawType: string | number | bigint; hasDefault: true; cliType: string; }; }; }; export declare const MinerOptions: Definitions<MinerConfig>; //# sourceMappingURL=miner-options.d.ts.map