# impetus-typegen

> impetus typegen

Latest version **1.3.0** (published 2023-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install impetus-typegen
pnpm add impetus-typegen
yarn add impetus-typegen
bun add impetus-typegen
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2023-03-15 |
| First published | 2023-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 439.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | dnt-team |
| Maintainers | developer_impetus |
| Keywords | impetus |

## Links

- npm: https://www.npmjs.com/package/impetus-typegen
- Repository: https://github.com/dnt-team/impetus-typegen
- Issues: https://github.com/dnt-team/impetus-typegen/issues
- npm.io page: https://npm.io/package/impetus-typegen

## Recent versions

- 1.3.0 (latest) — 2023-03-15
- 1.2.1 — 2023-03-15

## README

# Impetus-typegen

This is the lib used for users who want to connect to the Impetus Substrate chain. Based on `@polkadot/typegen` to to generate type definitions that can be used to decorate the @polkadot/api. It uses both types defined for the specific chain as well as the chain metadata to generate TypeScript interfaces. This means that interfaces such as api.query._, api.tx._ and api.consts.\* will be decorated based on chain-specific information, instead of an un-augmented catch-all definition.

## Development

### Installation

Install dependencies with npm:

```bash
npm install impetus-typegen
```

### Usage

For simple usage, we have added the `src/index.ts` file that show how the metadata and types actually decorate the API. In addition, we also have setup instructions included here.

```
import 'impetus-typegen';
```

Then you can query some information from impetus chain, e.g: We can simple index data of first round impetus:

```
export async function indexRoundInfo(): Promise<void> {
  let roundInfo = await api.query.luckyNumber.lottery(0);
  const { start, minPrice, rate } = roundInfo.unwrap();

  console.log(`Round 0 start at ${start} with min price for buy ${minPrice}. We can easy win with rate ${rate}`);
}
```

Start your source and enjoy.
Just a really simple walk-through to customizing the API TypeScript definitions for impetus chain.
Please reach out us at https://github.com/dnt-team/impetus-typegen if you have any question

---
_Source: https://npm.io/package/impetus-typegen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
