diff --git a/packages/common/src/hardhat/tasks/artifacts.ts b/packages/common/src/hardhat/tasks/artifacts.ts index ed819bd5d0..41f73f0d71 100644 --- a/packages/common/src/hardhat/tasks/artifacts.ts +++ b/packages/common/src/hardhat/tasks/artifacts.ts @@ -132,11 +132,16 @@ task("generate-contracts-frontend", "Generate typescipt for the contracts-fronte if ( fs.existsSync(`typechain/${packageName}/ethers/${contractName}.d.ts`) || fs.existsSync(`typechain/${packageName}/ethers/${contractName}.ts`) - ) + ) { + fs.appendFileSync( + out, + `export * as ${contractName}EthersTypes from "../typechain/${packageName}/ethers/${contractName}";\n` + ); fs.appendFileSync( out, `export type { ${contractName} as ${contractName}Ethers } from "../typechain/${packageName}/ethers";\n` ); + } }); artifacts.forEach(({ contractName, packageName }) => { @@ -225,11 +230,16 @@ task("generate-contracts-node", "Generate typescipt for the contracts-node packa if ( fs.existsSync(`typechain/${packageName}/ethers/${contractName}.d.ts`) || fs.existsSync(`typechain/${packageName}/ethers/${contractName}.ts`) - ) + ) { + fs.appendFileSync( + out, + `export * as ${contractName}EthersTypes from "../typechain/${packageName}/ethers/${contractName}";\n` + ); fs.appendFileSync( out, `export type { ${contractName} as ${contractName}Ethers } from "../typechain/${packageName}/ethers";\n` ); + } }); artifacts.forEach(({ contractName, packageName }) => {