{"bin":{"typechain":"./dist/cli/cli.js"},"bugs":{"url":"https://github.com/ethereum-ts/Typechain/issues"},"dist":{"shasum":"3b933eeb996be623cbb1c9aba1f38130afec585e","tarball":"https://registry.npmjs.org/typechain/-/typechain-1.0.0-beta.2.tgz","fileCount":38,"integrity":"sha512-hD/PJNE8sG1IGfDUTCPtjG7ZyMZOhTcacimSe1B6Xa4rN0ly9l8ElRLVOilKPoAU8n+3h93OkJU301hWd2Tkyg==","signatures":[{"sig":"MEYCIQD5m2GFhTksl8yfdALApLf/ttEE7681V2FYlglyG3LJEwIhAPSzXhDUaKk3EgGbRh7GqQUu7chy085XLY6HSMmbDdFn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":54782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkw0oCRA9TVsSAnZWagAAfwIQAIZB6Ikp3zjoUwR3jZWv\nVc+reHKTaxqKmGigZJeHcHxxlPw6xma7cGcCRLtNhlI1foJ+utl6frgmjlZG\nfg3FBK+A7FoobdkPEnJpfbOp2gDarbMER8elLVQalISFqHKDK75LavYbXRmk\nRd5fEuuSolkyjKmbEPid1FkYfDrTqSow2ta5OszE7/pwAVz/c3mX2jJtKXpN\nFBEkBtuJ7HEyEPYUf2u25ayHY+am+BIJdbnViPDPgL0c6s/vZ+7+rFOaw9aW\nJAYF+gxzX4sl3656vOu5tW36aKOd2jzD9kdR/lsXWvAAfsxkucaxaLVgbW+j\n7fs2fOwj4Jh3bvg9nUiF+N5XADY/0AqYW7vcI7AbFaUPC0ekRZRWfYKxySog\nl5q3GmvY17j7V7FoJT9rZON2CIOH7B0PVDK2BnL3jjTEzh23hcu99WHXzlEa\nfrWHMS0qxUYHWvw0FXqmQHvb7LKuyuFajui3HWEu6wgpEeoAeXaBpIa3cRHj\nfUF1K1BXL8+Fr6cR042H72RgL2KVgr19HU4izTgCMWIbDw6BO1jsgnXMB6su\nAajjdcrw/pmEYtbo5F9XHxWWKgCg0H4504d18xH92JQymh/PLoobUa/kJde0\npowAAmOj0UI+yOKBat08R65oD99PYnD4yR7U3QIFGZntH6kMIt7nErWW9OgV\nc8TZ\r\n=s0ZQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","name":"typechain","readme":"<p align=\"center\">\n  <img src=\"https://github.com/Neufund/TypeChain/blob/d82f3cc644a11e22ca8e42505c16f035e2f2555d/docs/images/typechain-logo.png?raw=true\" width=\"300\" alt=\"TypeChain\">\n  <h3 align=\"center\">TypeChain</h3>\n  <p align=\"center\">🔌 Typescript bindings for Ethereum smartcontracts</p>\n\n  <p align=\"center\">\n    <a href=\"https://circleci.com/gh/ethereum-ts/TypeChain\"><img alt=\"Build Status\" src=\"https://circleci.com/gh/ethereum-ts/TypeChain/tree/master.svg?style=svg\"></a>\n    <a href=\"https://coveralls.io/github/ethereum-ts/TypeChain?branch=master\"><img alt=\"Coverage\" src=\"https://coveralls.io/repos/github/ethereum-ts/TypeChain/badge.svg?branch=master\"></a>\n    <img alt=\"Downloads\" src=\"https://img.shields.io/npm/dm/typechain.svg\">\n    <a href=\"https://github.com/prettier/prettier\"><img alt=\"Prettier\" src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg\"></a>\n    <a href=\"/package.json\"><img alt=\"Software License\" src=\"https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\"></a>\n  </p>\n\n  <p align=\"center\">\n    <a href=\"https://blog.neufund.org/introducing-typechain-typescript-bindings-for-ethereum-smart-contracts-839fc2becf22\">Medium post</a> | <a href=\"https://www.youtube.com/watch?v=9x6AkShGkwU\">DappCon Video</a>\n  </p>\n\n  <p align=\"center\">\n    Contributed with: <br/>\n    <img src=\"https://github.com/Neufund/TypeChain/blob/6d358df7b2da6b62d56f9935f1666b17b93176f0/docs/images/neufund-logo.png?raw=true\" width=\"100\" alt=\"Neufund\">\n  </p>\n</p>\n\n## Features ⚡\n\n- static typing - you will never call not existing method again\n- IDE support - works with any IDE supporting Typescript\n- works with multiple libraries - use `truffle`,`Web3.js 1.0`, `ethers.js`, `Web3.js 0.20.x`\n- frictionless - works with simple, JSON ABI files as well as with Truffle style ABIs\n\n## Installation\n\n```bash\nnpm install --save-dev typechain\n```\n\nYou will also need to install desired target for example `typechain-target-ethers`.\n\n## Packages 📦\n\n| Package                                                          | Version                                                                                                                     | Description        |\n| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------ |\n| [`typechain`](/packages/core)                                    | [![npm](https://img.shields.io/npm/v/typechain.svg)](https://www.npmjs.com/package/typechain)                               | Core package       |\n| [`typechain-target-ethers`](/packages/typechain-target-ethers)   | [![npm](https://img.shields.io/npm/v/typechain-target-ethers.svg)](https://www.npmjs.com/package/typechain-target-ethers)   | Ethers support     |\n| [`typechain-target-truffle`](/packages/typechain-target-truffle) | [![npm](https://img.shields.io/npm/v/typechain-target-truffle.svg)](https://www.npmjs.com/package/typechain-target-truffle) | Truffle support    |\n| [`typechain-target-web3-1`](/packages/typechain-target-web3-1)   | [![npm](https://img.shields.io/npm/v/typechain-target-web3-1.svg)](https://www.npmjs.com/package/typechain-target-web3-1)   | Web3 1.x.x support |\n\n## Usage\n\n### CLI\n\n```\ntypechain --target=(truffle|web3-1|truffle|absolute-path-to-target) [glob]\n```\n\n- `glob` - pattern that will be used to find ABIs, remember about adding quotes: `typechain \"**/*.json\"`\n- `--target` - `truffle`, `web3-1.0.0`, `ethers` or `legacy`\n- `--outDir` - put all generated files to a specific dir\n\nTypechain always will rewrite existing files. You should not commit them. Read more in FAQ section.\n\nExample:\n\n```\ntypechain --target --outDir app/contracts './node_modules/neufund-contracts/build/contracts/*.json'\n```\n\n### ts-generator unified config\n\nTypechain is a plugin to [ts-generator](https://github.com/krzkaczor/ts-generator) meaning that you can as well create unified config.\n\n`ts-generator.json` file:\n\n```\n[\n  {\n    \"generator\": \"typechain\",\n    \"files\": \"./build/**/*.json\",\n    \"target\": \"truffle\"\n  }\n]\n```\n\nthen just run `ts-generator` (you need to have `ts-generator` installed in your project).\n\nThis can be a great way to run more code generation plugins (css modules types, graphql types etc. ) at the same time.\n\n## Demo 🏎️\n\n![Demo](https://media.giphy.com/media/3oFzmqgHxrPZFhBst2/giphy.gif)\n\n[Example usage](https://github.com/Neufund/commit.neufund.org/pull/331/files)\n\n## Getting started 📚\n\n### Motivation\n\nInteracting with blockchain in Javascript is a pain. Web3 interface is sluggish and when using it\nwith Typescript it gets even worse. Often, you can't be sure what given method call will\nactually do without looking at ABI file. TypeChain is here to solve these problems (as long as you\nuse Typescript).\n\n### How does it work?\n\nTypeChain is code generator - provide ABI file and you will get Typescript class with flexible\ninterface for interacting with blockchain. Depending on the target parameter it can generate typings for\ntruffle, web3 1.0.0 or web3 0.20.x (legacy target).\n\n### Step by step guide\n\nInstall typechain with `yarn add --dev typechain`.\n\nRun `typechain --target=your_target` (you might need to make sure that it's available in your path if you installed it\nonly locally), it will automatically find all `.abi` files in your project and generate Typescript\nclasses based on them. You can specify your glob pattern: `typechain --target=your_target \"**/*.abi.json\"`.\n`node_modules` are always ignored. We recommend git ignoring these generated files and making typechain part of your build process.\n\nThat's it! Now, just import contract bindings as any other file `import { MyAwesomeContract } from './contracts/MyAwesomeContract'` and start interacting with it. We use named exports because of\n[this](https://blog.neufund.org/why-we-have-banned-default-exports-and-you-should-do-the-same-d51fdc2cf2ad).\n\n## Targets 🎯\n\n### Truffle\n\nTruffle target is great when you use truffle contracts already. Check out [truffle-typechain-example](https://github.com/ethereum-ts/truffle-typechain-example) for more details. It require installing [typings](https://www.npmjs.com/package/truffle-typings) for truffle library itself.\n\nNow you can simply use your contracts as you did before and get full type safety, yay!\n\n### Web3-1.0.0\n\nGenerates typings for contracts compatible with latest Web3.js version. Typings for library itself are now part of `Web3 1.0.0` library so nothing additional is needed. For now it needs explicit cast as shown [here](https://github.com/krzkaczor/TypeChain/pull/88/files#diff-540a9b8840419be93ddb8d4b53325637R8), this will be fixed after improving official typings.\n\n### Ethers.js\n\nUse `ethers` target to generate wrappers for [ethers.js](https://github.com/ethers-io/ethers.js/) lib.\n\n### Legacy (Web3 0.2.x)\n\nThis was default and only target for typechain 0.2.x. It requires `Web3.js 0.20.x` to be installed in your project and it generates promise based wrappers. It's nice upgrade comparing to raw callbacks but in the near future Typechain will support `Web3js 1.0` target.\n\n## FAQ 🤔\n\n### Q: Should I commit generated files to my repository?\n\nA: _NO_ — we believe that no generated files should go to git repository. You should git ignore them\nand make `typechain` run automatically for example in post install hook in package.json:\n\n```\n\"postinstall\":\"typechain\"\n```\n\nWhen you update ABI, just regenerate files with TypeChain and Typescript compiler will find any\nbreaking changes for you.\n\n### Q: How do I customize generated classes? (legacy target only)\n\nA: You can create your own class that extends generated one and adds additional methods etc.\n\nCurrently we discuss various ideas around extendibility including APIs files (adding semantics to\nABIs for covering popular cases like working with dates) or using user-defined templates for\ngenerated code.\n\n### Q: Generated files won't match current codestyle of my project :(\n\nA: We will automatically format generated classes with `prettier` to match your coding preferences (just make sure to use `.prettierrc` file).\n\nFurthermore, we will silent tslint for generated files with `/* tslint:disable */` comments.\n\n### Usage as API\n\nYou may want to use `ts-generator` api to kick off whole process by api:\n\n```typescript\nimport { tsGen } from \"ts-generator\";\nimport { Typechain } from \"typechain\";\n\nasync function main() {\n  await tsGen(\n    { cwd },\n    new Typechain({ cwd, rawConfig: { files: \"your-glob-here\", outDir: \"optional out dir path\" } }),\n  );\n}\n```\n\n### Running tests\n\n```\nyarn        # install all dependencies\nyarn test   # runs tests + linting\n```\n\n### Debugging 🐞\n\n```sh\nDEBUG=typechain typechain\n```\n\n# Licence\n\nKrzysztof Kaczor (krzkaczor) MIT | [Github](https://github.com/krzkaczor) | [Twitter](https://twitter.com/krzkaczor)\n","license":"MIT","scripts":{"build":"rm -rf ./dist && cp -R '../../dist/core/lib' ./dist/ && chmod +x ./dist/cli/cli.js && cp ../../README.md ."},"_npmUser":{"name":"krzkaczor","email":"chris@kaczor.io"},"homepage":"https://github.com/ethereum-ts/Typechain#readme","keywords":["ethereum","typescript","bindings","smartcontract","blockchain"],"repository":{"url":"git+https://github.com/ethereum-ts/Typechain.git","type":"git"},"_npmVersion":"6.4.1","description":"🔌 TypeScript bindings for Ethereum smartcontracts","directories":{},"maintainers":[{"name":"krzkaczor","email":"krzkaczor@gmail.com"}],"_nodeVersion":"8.14.0","dependencies":{"debug":"^3.0.1","lodash":"^4.17.15","fs-extra":"^7.0.0","ts-generator":"^0.0.8","command-line-args":"^4.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.1.2","glob":"^7.1.2","ethers":"^4.0.7","truffle":"^4.1.14","bluebird":"^3.5.1","coveralls":"^3.0.2","@types/chai":"^4.0.6","@types/glob":"^5.0.35","@types/node":"^8.0.25","ganache-cli":"^6.1.8","@types/debug":"^0.0.30","@types/mocha":"^2.2.44","bignumber.js":"^5.0.0","@types/lodash":"^4.14.139","@types/bluebird":"^3.5.18","@types/fs-extra":"^5.0.4","@types/prettier":"^1.13.2","truffle-typings":"^1.0.4","chai-as-promised":"^7.1.1","@types/bignumber.js":"^5.0.0","@types/chai-as-promised":"^7.1.0","@types/command-line-args":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/typechain_1.0.0-beta.2_1569918247457_0.606510408336681","host":"s3://npm-registry-packages"},"_id":"typechain@1.0.0-beta.2","version":"1.0.0-beta.2"}