@eth-proxy/codegen
TypeScript icon, indicating that this package has built-in type declarations

0.7.23 • Public • Published

EthProxy codegen

Typescript code generator for EthProxy Client and Truffle-contract. Transforms truffle contracts artifacts to type declarations.

Install

npm install --save-dev @eth-proxy/codegen

OR

yarn add @eth-proxy/codegen --dev --exact

Instructions

Provide path to folder with your contracts JSON artifacts and output where ganerated file should be stored.

If you are using truffle-contract, provide additional flag --target=truffle

Example output for EthProxy Client (./example/output/eth-proxy/contracts.ts)

Example output for truffle-contract (./example/output/truffle/contracts.ts)

Execute generation with

npx codegen {{ options - check API section }}

Options

Output - Required

  • Flag: --output
  • Aliases: --o
  • Default: NONE
  • Expects: path where generated contracts should be saved, path should include file name and extension.

Example: --o="src/contracts.ts"

Contract Directory - Required

  • Flag: --contractsDir
  • Aliases: --cDir
  • Default: NONE
  • Expects: path to folder with all truffle artifacts as json files.

Example: --cDir="../example/contracts"

Target

  • Flag: --target
  • Aliases: --t
  • Default: eth-proxy
  • Options: eth-proxy, truffle
  • Expects: target name, see supported targets in options.

Example: --t=truffle

Example:

Truffle:

npx codegen --o=\"src/contracts.ts\" --cDir=\"build/contracts\" --t=truffle

Eth Proxy Client:

npx codegen --o=\"src/contracts.ts\" --cDir=\"build/contracts\"

Development

Generating example code

npm run gen:truffle
npm run gen:eth-proxy

Readme

Keywords

none

Package Sidebar

Install

npm i @eth-proxy/codegen

Weekly Downloads

1

Version

0.7.23

License

none

Unpacked Size

57.4 kB

Total Files

96

Last publish

Collaborators

  • biern
  • eth-proxy-ci
  • kruligh
  • motykadaw
  • olaf89
  • piotr.gasiorowski
  • stpoa