diff --git a/packages/ethers/package.json b/packages/ethers/package.json index fb1410d..31d94e4 100644 --- a/packages/ethers/package.json +++ b/packages/ethers/package.json @@ -5,6 +5,7 @@ "description": "Hardhat Vechain Ethers Plugin", "repository": "github:vechainfoundation/hardhat-plugins", "author": "Electi Consulting LTD", + "main": "dist/index.js", "keywords": [ "thor", "vechain", diff --git a/packages/ethers/src/index.ts b/packages/ethers/src/index.ts index 123e20a..255d2ce 100644 --- a/packages/ethers/src/index.ts +++ b/packages/ethers/src/index.ts @@ -44,11 +44,11 @@ const modified = (provider: ConnexProviderWrapper) => { } extendEnvironment(hre => { - if (hre.vechain === undefined) { + if (!hre.network.name.includes("vechain")) { throw new VechainHardhatPluginError("vechain-ethers plugin requires hardhat-vechain"); } hre.ethers = lazyObject(() => { - if (hre.vechain === undefined) { + if (!hre.network.name.includes("vechain")) { throw new VechainHardhatPluginError("@vechain/hardhat-ethers expects @vechain/hardhat-vechain"); } diff --git a/packages/web3/package.json b/packages/web3/package.json index 9072c5c..75dc078 100644 --- a/packages/web3/package.json +++ b/packages/web3/package.json @@ -5,6 +5,7 @@ "description": "Hardhat Vechain Web3 Plugin", "repository": "github:vechainfoundation/hardhat-plugins", "author": "Electi Consulting LTD", + "main": "dist/index.js", "keywords": [ "thor", "vechain", diff --git a/packages/web3/src/index.ts b/packages/web3/src/index.ts index 5f32859..018c126 100644 --- a/packages/web3/src/index.ts +++ b/packages/web3/src/index.ts @@ -5,7 +5,7 @@ import { VechainHardhatPluginError } from "@vechain/hardhat-vechain"; import "./type-extensions"; extendEnvironment(hre => { - if (hre.vechain === undefined) { + if (!hre.network.name.includes("vechain")) { throw new VechainHardhatPluginError("vechain-web3 plugin requires hardhat-vechain"); } hre.Web3 = lazyFunction(() => require("web3"));