How can I add Hardhat to my NPM Package? #6004
TechnicallyWeb3
started this conversation in
General
Replies: 2 comments
-
Was intending this to be more a discussion if what I'm trying to do is possible, but since no one asked, here's the output when running some code using my library:
You can get here by installing:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hardhat 2 assumes on file project structure around the setup of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have written a hardhat project which I would like to deploy as a library.
Within my Hardhat project I can use the wttp.fetch("technicallyweb3.eth") function which relies heavily on hardhat and uses a specific hardhat config to operate.
My goal is to allow people to use npm install wttp-handler, import the default wttp handler and allow devs to use the fetch function as easily as the built-in fetch function without needing to install and configure hardhat. I've already published to wttp-handler but getting all kinds of errors when tying to execute.
Furthermore, my hardhat configuration shouldn't conflict if the parent project has it's own hardhat installation.
I've never tried using hardhat like this before, and don't even know if it's intended to work like this, but when running my library in a js file I get a hardhat structure error.
Has anyone set up this type of static library using hardhat? Any tips for my first go?
The project I'm trying to convert into a library is https://github.com/technicallyweb3/wttp (npm-library branch) and the package is https://www.npmjs.com/package/wttp-handler
Beta Was this translation helpful? Give feedback.
All reactions