Skip to content

typechain-polkadot 0.1.0

Install from the command line:
Learn more about npm packages
$ npm install @supercolony-net/typechain-polkadot@0.1.0
Install via package.json:
"@supercolony-net/typechain-polkadot": "0.1.0"

About this version

alt typechain-logo

Version 0.0.12

When a smart contract is being written, front-end developer receives file representation of it in the format called Application Binary Interface (ABI). One ABI per each contract, new ABI for every update of a contract.

Information about how to interact with a contract (methods names, arguments & returns types etc.) is included in this ABI file. It is not human-readable enough, so extraction of that information becomes a challenge. Guessing is not an option and we need to have correct type definitions for each contract in TypeScript. They can be generated automatically by a script, taking a list of ABIs as an input, giving usable TS type definitions and even runtime code as its output.

Given, that a front-end developer needs to do this with every contracts update, such tool would save a lot of time and prevent mistakes of misusing smart contracts.


Usage

In your project install this package:

npm i -D @supercolony-net/typechain-polkadot

Now you can use it to generate TS definitions & runtime code for your ABIs.

Given, that you've put input files in path/to/input folder, and want generated code to land in path/to/output folder, run the following command:

npx @supercolony-net/typechain-polkadot --in path/to/input --out path/to/output

Referer to tech docs and about section for more information. For usage examples in TypeScript, please, refer to this repo: https://github.com/Supercolony-net/typechain-polkadot_example


Made with ❤️ by Supercolony

Details


Assets

  • typechain-polkadot-0.1.0-npm.tgz

Download activity

  • Total downloads 2
  • Last 30 days 0
  • Last week 0
  • Today 0