Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generated types through polkadot/typegen #3000

Closed
0oM4R opened this issue Jun 23, 2024 · 7 comments
Closed

Use generated types through polkadot/typegen #3000

0oM4R opened this issue Jun 23, 2024 · 7 comments
Assignees
Labels
tfchain_client type_feature New feature or request
Milestone

Comments

@0oM4R
Copy link
Contributor

0oM4R commented Jun 23, 2024

Which package/s are you suggesting this feature for?

tfchain_client

Is your feature request related to a problem? Please describe

This should provide a better development experience, and may provide a better way to handle chain errors

Describe the solution you'd like

https://polkadot.js.org/docs/api/examples/promise/typegen/

@0oM4R 0oM4R added the type_feature New feature or request label Jun 23, 2024
@0oM4R 0oM4R changed the title Use generated types through `plkadot/typegen Use generated types through plkadot/typegen Jun 23, 2024
@0oM4R 0oM4R changed the title Use generated types through plkadot/typegen Use generated types through polkadot/typegen Jun 23, 2024
@AhmedHanafy725 AhmedHanafy725 added this to the 2.6.0 milestone Jun 23, 2024
@0oM4R 0oM4R moved this to In Progress in 3.15.x Jun 23, 2024
@0oM4R
Copy link
Contributor Author

0oM4R commented Jun 23, 2024

issue update: facing conflict issue as the compiler get the types from nodemodules not from interfaces|
image

@0oM4R
Copy link
Contributor Author

0oM4R commented Jun 24, 2024

@0oM4R
Copy link
Contributor Author

0oM4R commented Jun 24, 2024

@0oM4R
Copy link
Contributor Author

0oM4R commented Jun 24, 2024

@0oM4R
Copy link
Contributor Author

0oM4R commented Jun 24, 2024

issue update: facing conflict issue as the compiler get the types from nodemodules not from interfaces| image

this issue got resolved by updating tsconfig files :

"@polkadot/api/augment": ["src/interfaces/augment-api.ts"] ----> "@polkadot/api-augment*": ["src/interfaces/chain/augment-api.ts"]

docs says that we should keep that line as its, but after updating it, build works very fine, and now I'm able to use our chain types

@0oM4R
Copy link
Contributor Author

0oM4R commented Jun 24, 2024

Issue update :

  • work completed :
    • generated types and included it in tfchain client
    • fixed build issue and ignore types from aumgent node moduels
    • add script to fetch meta and adjust generated types to pass the ts build
  • WIP
    • create documentation about generating types and how to use it

@0oM4R
Copy link
Contributor Author

0oM4R commented Jun 25, 2024

Documentation is ready, just want to test the effect of the changes on the generated types

@0oM4R 0oM4R moved this from In Progress to Pending Review in 3.15.x Jun 26, 2024
@0oM4R 0oM4R moved this from Pending Review to In Verification in 3.15.x Jul 2, 2024
@github-project-automation github-project-automation bot moved this from In Verification to Done in 3.15.x Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tfchain_client type_feature New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants