{"_id":"@0xgabi/hardhat-typechain","_rev":"1-b359104a7d59efa4116bd6037d69a392","name":"@0xgabi/hardhat-typechain","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@0xgabi/hardhat-typechain","version":"0.1.0","description":"Hardhat TypeScript plugin boilerplate","repository":{"type":"git","url":"git+https://github.com/rhlsthrm/hardhat-typechain.git"},"author":{"name":"Rahul Sethuram"},"license":"MIT","main":"dist/src/index.js","types":"dist/src/index.d.ts","keywords":["ethereum","smart-contracts","hardhat","hardhat-plugin","buidler","buidler-plugin"],"scripts":{"lint:fix":"prettier --write 'src/**/*.{js,ts}' 'test/**/*.{js,ts}' && tslint --fix --config tslint.json --project tsconfig.json","lint":"tslint --config tslint.json --project tsconfig.json","test":"mocha --exit --recursive 'test/**/*.test.ts'","build":"tsc","watch":"tsc -w"},"devDependencies":{"@typechain/ethers-v5":"^4.0.0","@typechain/truffle-v5":"^2.0.2","@typechain/web3-v1":"^1.0.0","@types/chai":"^4.2.14","@types/fs-extra":"^9.0.2","@types/mocha":"^8.0.3","@types/node":"^14.14.2","@types/rimraf":"^3.0.0","chai":"^4.2.0","dotenv":"^8.2.0","ethers":"^5.0.19","fs-extra":"^9.0.1","hardhat":"^2.0.1","mocha":"^8.2.0","prettier":"^2.1.2","source-map-support":"^0.5.19","ts-generator":"^0.1.1","ts-node":"^9.0.0","tslint":"^6.1.2","tslint-config-prettier":"^1.18.0","tslint-plugin-prettier":"^2.3.0","typechain":"^3.0.0","typescript":"^4.0.3"},"peerDependencies":{"hardhat":"^2.0.1","ts-generator":"^0.1.1","typechain":"^3.0.0"},"gitHead":"a1634ff094c814f33d7ed9b5fde88ed77a333d7c","bugs":{"url":"https://github.com/rhlsthrm/hardhat-typechain/issues"},"homepage":"https://github.com/rhlsthrm/hardhat-typechain#readme","_id":"@0xgabi/hardhat-typechain@0.1.0","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-HnXo7WTmtm/lMCysNabQySD8XS5E7kEFlyi/ub4wbj3Py+cuVhjI55tsbuXvnBpStVG25tNRVcU6fOMSW+domA==","shasum":"04f3507360d02ae1e7db8a66214eb40facd08a0a","tarball":"https://registry.npmjs.org/@0xgabi/hardhat-typechain/-/hardhat-typechain-0.1.0.tgz","fileCount":7,"unpackedSize":9317,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrBjFCRA9TVsSAnZWagAAepMP/1QZWhrUucHS6I0nXC/0\nhbmCk9VNa4RtlXV0xT88V2fXLLIzgd70qtHhqwUZ37kx6wwfWDpl/gXekm/m\nFijhNhPOZZrjXwKhKLr1t647HzCzhjgUdsd4cNuGmJ9J52AtaQ2LhfAtmf5C\nT26Ec1y5O5J1SV9YtUApXSD7v7ytP5+/8b5d+sWSQgnvnEY3s8uc9kf/+8C+\nvVA7t7Fg7hEKyjTlpP67GVy4lYSBXTd6TYMyJ93A8C+gv6XEyP0fOCLaE0fF\nGgljdw23aBxD61PuP7BJNtzCDYiEYAZXJ31crlexotfdYAyqHtHYvQftiEMN\nmgD7Aik+vT4Adlq29B1v3cpTr1EBjDQpRbwcCmbGKqiNvwl73600lCrtUzTY\nFQ4Mmz/WrqTtiS5bM1MWBFVag2wd8FUWMYrARSxpMA+uuSlIQDSL2T49MoDa\ngEgIFE6pqEUbAQvVEq0fEDWAc5ppEjET99Xb0X+7ctJP8F38+x4Uvzl0Lm0B\nT8OWXGX7ImVJ5LeUw8Bs4EWbe2qST9RTFykr7/UkQJsHaoCGbakD6W18lEG3\nZdqew4Fz3yyVRxSC/va0FqrgU8NvZ3nLcYULPsDoWJgvvpulItlvIqt1psKj\nwQ2/5gnGmECeM/wit76ZjMfFFh7LTb6Ca9qjI59hEtshwKeJPQHOVJOlxCyh\n/+B/\r\n=u12b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZVRmIEidzNQkl/XLwsz7IABj0hIRyRmrS/0ljg5YOwAIgDEEsqYZyEEWUoGvrohRV0s6TdYGW8SYNhWLJHd7pn4E="}]},"_npmUser":{"name":"gabrielg","email":"gabrielpk.18@gmail.com"},"directories":{},"maintainers":[{"name":"gabrielg","email":"gabrielpk.18@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hardhat-typechain_0.1.0_1605114052771_0.23362562393593622"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-11T17:00:52.320Z","0.1.0":"2020-11-11T17:00:52.894Z","modified":"2022-04-04T10:29:01.286Z"},"maintainers":[{"name":"gabrielg","email":"gabrielpk.18@gmail.com"}],"description":"Hardhat TypeScript plugin boilerplate","homepage":"https://github.com/rhlsthrm/hardhat-typechain#readme","keywords":["ethereum","smart-contracts","hardhat","hardhat-plugin","buidler","buidler-plugin"],"repository":{"type":"git","url":"git+https://github.com/rhlsthrm/hardhat-typechain.git"},"author":{"name":"Rahul Sethuram"},"bugs":{"url":"https://github.com/rhlsthrm/hardhat-typechain/issues"},"license":"MIT","readme":"# hardhat-typechain\n\n_Zero-config Typechain support_\n\n_Updated for Hardhat!_\n\n_Now supports Ethers v5 and Truffle v5!_\n\n_Updated for TypeChain v3!_\n\nAdd [Typechain](https://www.github.com/ethereum-ts/TypeChain) tasks to your hardhat project!\n\n## What\n\n[TypeChain](https://www.github.com/ethereum-ts/TypeChain) gives you Typescript bindings for your smart contracts. Now, your tests and frontend code can be typesafe and magically autocomplete smart contract function names!\n\n## Installation\n\n```bash\nnpm i hardhat-typechain typechain ts-generator\n# choose plugin for required target, only need to install one of these\nnpm i @typechain/ethers-v5 @typechain/truffle-v5 @typechain/web3-v1\n```\n\nAnd add the following statement to your `hardhat.config.js`:\n\n```js\nrequire(\"hardhat-typechain\");\n```\n\nOr, if you are using TypeScript, add this to your `hardhat.config.ts`:\n\n```js\nimport \"hardhat-typechain\";\n```\n\n## Zero Config Usage\n\nRun the _compile_ task as normal, and Typechain artifacts will automatically be generated in a root directory called `typechain`. Further configuration options are detailed below.\n\n## Tasks\n\nThis plugin overrides the _compile_ task and automatically generates new Typechain artifacts on each compilation.\n\nThere is an optional flag `--no-typechain` which can be passed in to skip Typechain compilation.\n\nThis plugin adds the _typechain_ task to hardhat:\n\n```\nGenerate Typechain typings for compiled contracts\n```\n\n## Configuration\n\nThis plugin extends the `hardhatConfig` optional `typechain` object. The object contains two fields, `outDir` and `target`. `outDir` is the output directory of the artifacts that TypeChain creates (defaults to `typechain`). `target` is one of the targets specified by the TypeChain [docs](https://github.com/ethereum-ts/TypeChain#cli) (defaults to `ethers`).\n\nThis is an example of how to set it:\n\n```js\nmodule.exports = {\n  typechain: {\n    outDir: \"src/types\",\n    target: \"ethers-v5\",\n  },\n};\n```\n\n## Usage\n\n`npx hardhat compile` - Compiles and generates Typescript typings for your contracts.\n\nExample Waffle + Ethers test that uses typedefs for contracts:\n\n```ts\nimport { ethers, waffle } from \"@nomiclabs/hardhat\";\nimport chai from \"chai\";\nimport { Wallet } from \"ethers\";\n\nimport CounterArtifact from \"../artifacts/Counter.json\";\nimport { Counter } from \"../typechain/Counter\";\n\nconst { deployContract } = waffle;\nconst { expect } = chai;\n\ndescribe(\"Counter\", () => {\n  let counter: Counter;\n\n  beforeEach(async () => {\n    // 1\n    const signers = await ethers.signers();\n\n    // 2\n    counter = (await deployContract(\n      <Wallet>signers[0],\n      CounterArtifact\n    )) as Counter;\n    const initialCount = await counter.getCount();\n\n    // 3\n    expect(initialCount).to.eq(0);\n    expect(counter.address).to.properAddress;\n  });\n\n  // 4\n  describe(\"count up\", async () => {\n    it(\"should count up\", async () => {\n      await counter.countUp();\n      let count = await counter.getCount();\n      expect(count).to.eq(1);\n    });\n  });\n\n  describe(\"count down\", async () => {\n    // 5\n    it(\"should fail\", async () => {\n      await counter.countDown();\n    });\n\n    it(\"should count down\", async () => {\n      await counter.countUp();\n\n      await counter.countDown();\n      const count = await counter.getCount();\n      expect(count).to.eq(0);\n    });\n  });\n});\n```\n\nSee this [starter kit](https://github.com/rhlsthrm/typescript-solidity-dev-starter-kit) for a full example!\n","readmeFilename":"README.md"}