Replies: 2 comments 1 reply
-
Update: I ended up implementing my 1st proposed solution in hardhat-packager@1.1.0. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Interesting problem. I wonder what if there would be an optional glob pattern for typechain plugin ie. rather than generate typings for all artifacts just generate it to these files. Would this help in integration? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My hardhat-packager plugin builds upon
@typechain/hardhat
to prepare theartifacts
and thetypechain
folders for registry deployment. What it does is to delete all files unrelated to an allowlist of contracts, specified by the user.I want to add support for TypeChain factories, but I noticed that you aggregate the augmentations for the
getContractFactory
function in one file calledhardhat.d.ts
. This is problematic for me because I would have to edit this file and remove all augmentations that don't refer to the allowlisted contracts.On my end, I can think of two solutions:
hardhat.d.ts
file, but include the bespoke factories from thefactories
folder.hardhat.d.ts
file as it is, with the downside of the user seeing augmentations for contracts not part of the deployed package (e.g. test contracts).On your end, I can think of two other solutions:
getContractFactory
function in the bespoke contract declaration file.Re 2nd solution, taking my solidity-template as an example, you would add something like this in the
typechain/Greeter.d.ts
file:Beta Was this translation helpful? Give feedback.
All reactions