Skip to content

Configuration

The midl field in your Hardhat config enables integration with the MIDL Hardhat plugin. Below is the configuration reference:

Options

OptionTypeDescription
pathstring (optional)Path to deployments directory
networksRecord<string, NetworkConfig>Network configurations (see below)

NetworkConfig

OptionTypeDescription
mnemonicstringMnemonic phrase for wallet
privateKeysstring[]Array of private keys (WIF or hex)
connectorFactoryfunctionCustom connector factory
paymentAddressTypeAddressType (optional)Address type for payment account
confirmationsRequirednumber (optional)EVM confirmations required
btcConfirmationsRequirednumber (optional)BTC confirmations required
networkstring | BitcoinNetwork (optional)Bitcoin network or name
hardhatNetworkstring (optional)Name of the Hardhat network to use
providerFactory() => AbstractProvider (optional)Custom BTC data provider factory
runesProviderFactory() => AbstractRunesProvider (optional)Custom runes data provider factory
defaultPurposeAddressPurpose (optional)Default purpose for wallet

NOTE

Provide exactly one of mnemonic, privateKeys, or connectorFactory.

Example

ts
import { AddressPurpose } from "@midl/core";

export default {
  midl: {
    path: "deployments",
    networks: {
      default: {
        mnemonic: "test test test ...",
        confirmationsRequired: 5,
        btcConfirmationsRequired: 1,
        network: "regtest",
        hardhatNetwork: "regtest",
        defaultPurpose: AddressPurpose.Payment
      },
    },
  },
};

See the API Reference for more details on usage.

Released under the MIT License