Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Generate Interface Types #36

Open
3 tasks
stojanov-igor opened this issue Jun 8, 2022 · 0 comments
Open
3 tasks

Generate Interface Types #36

stojanov-igor opened this issue Jun 8, 2022 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@stojanov-igor
Copy link
Member

stojanov-igor commented Jun 8, 2022

We have to extract the Rust types into Typescript types. This is done automatically through a typegen tool.

This is a sample TypeScript project with full source & config on GithHub, that uses @polkadot/typegen 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.

Follow this tutorial to extract interface types instead of hardcoding them: https://github.com/subquery/subql-examples/tree/main/kitty

Definition of Done:

  • Integrate the typegen into our own repository so we can easily generate types in the future
  • Generate the typescript types
  • Consume the typescript types.

Budget: $80

@stojanov-igor stojanov-igor changed the title Error Handling Generate Interface Types Jun 9, 2022
@stojanov-igor stojanov-igor added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Jun 16, 2022
@stojanov-igor stojanov-igor moved this to Todo in front-end Sep 12, 2022
@stojanov-igor stojanov-igor moved this from Todo to In review in front-end Sep 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
Status: In review
Development

No branches or pull requests

2 participants