From dd6f84e3d96abbcd9f0ab582e7487cba0b29ba95 Mon Sep 17 00:00:00 2001 From: Matt Rice Date: Fri, 9 Jun 2023 15:48:21 -0400 Subject: [PATCH 1/2] fix: add ethers types to contracts-node and contracts-frontend --- packages/common/src/hardhat/tasks/artifacts.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/common/src/hardhat/tasks/artifacts.ts b/packages/common/src/hardhat/tasks/artifacts.ts index ed819bd5d0..196d8b53bc 100644 --- a/packages/common/src/hardhat/tasks/artifacts.ts +++ b/packages/common/src/hardhat/tasks/artifacts.ts @@ -225,11 +225,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 }) => { From 972010f95082824bf340c19d156092ad5c888371 Mon Sep 17 00:00:00 2001 From: Matt Rice Date: Fri, 9 Jun 2023 15:51:02 -0400 Subject: [PATCH 2/2] WIP Signed-off-by: Matt Rice --- packages/common/src/hardhat/tasks/artifacts.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/common/src/hardhat/tasks/artifacts.ts b/packages/common/src/hardhat/tasks/artifacts.ts index 196d8b53bc..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 }) => {