From 11d40108036433061052933e2a92c5250a3aecc0 Mon Sep 17 00:00:00 2001 From: Jawad Tariq Date: Fri, 1 Mar 2024 18:25:57 -0500 Subject: [PATCH] chore: update README Signed-off-by: Jawad Tariq --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index d802e0c..13384a5 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,38 @@ To build: $ npm run build ``` +## Build contracts with different Typechain target + +To build different Typechain target: + +``` +npx hardhat typechain --typechain-target target +``` + +Where `target` can be `ethers-v6`, `web3-v1`etc. + +*Note: you need to install the appropriate package for the target you want to build for. For example, to build for `web3-v1`, you need to install `@typechain/web3-v1` package.* + +Default target is `ethers-v6` and it is output to `typechain-types/ethers-v6` directory. + +You can specify the target in several ways: +- By setting the `TYPECHAIN_TARGET` environment variable +```bash +export TYPECHAIN_TARGET=web3-v1 +``` +- By setting the `--typechain-target` command line option +```bash +npx hardhat typechain --typechain-target web3-v1 +``` +- By setting the `typechain` field in `hardhat.config.ts` +```typescript +module.exports = { + typechain: { + target: 'web3-v1' + } +} +``` + ## Tests To run the tests: