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

Feat: abiwan integration for TS validation based on ABI #696

Merged
merged 5 commits into from
Aug 16, 2023

Conversation

haroune-mohammedi
Copy link
Contributor

@haroune-mohammedi haroune-mohammedi commented Jul 24, 2023

Motivation and Resolution

  • Enhance Developer experience by providing type information when interacting with Starknet using starknet.js
  • Get errors on compile instead of execution which increases the developer productivity

Usage related changes

  • Users can now benefit from type information inferred automatically from their ABIs, they just need to use a TypedContract<Abi> instead of Contract by calling typed(abi) function on their contracts

Development related changes

No changes

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Linked the issues which this PR resolves
  • Documented the changes in code (API docs will be generated automatically)
  • Updated the tests
  • All tests are passing

@netlify
Copy link

netlify bot commented Jul 24, 2023

Deploy Preview for starknetjs ready!

Name Link
🔨 Latest commit 8361081
🔍 Latest deploy log https://app.netlify.com/sites/starknetjs/deploys/64dc90050406860008923286
😎 Deploy Preview https://deploy-preview-696--starknetjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@haroune-mohammedi
Copy link
Contributor Author

Related to keep-starknet-strange/abi-wan-kanabi#30

@haroune-mohammedi haroune-mohammedi marked this pull request as ready for review July 26, 2023 11:28
package.json Outdated Show resolved Hide resolved
@ivpavici ivpavici linked an issue Jul 28, 2023 that may be closed by this pull request
Copy link
Collaborator

@tabaktoni tabaktoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Couple of small issues to deal with:

  • It would be nice to export tAbi from mocks/TAbi.ts and import into tests.
  • I think we can skip of execution of all test in _typed.test as we just need to check typing system and not execution and runtime (mark all tests with xtest and skip beforeAll, or create a general skip rule)

@haroune-mohammedi
Copy link
Contributor Author

Closes #140

@ivpavici ivpavici merged commit f8b4201 into starknet-io:develop Aug 16, 2023
8 checks passed
@github-actions
Copy link

🎉 This PR is included in version 5.19.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Contract methods TS validation based on ABI
3 participants