-
Notifications
You must be signed in to change notification settings - Fork 740
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
0.11.2/redeclare ts #660
0.11.2/redeclare ts #660
Conversation
✅ Deploy Preview for starknetjs canceled.
|
@tabaktoni I didn't succeed to import in my test script the exports of utils/contract and utils/provider. |
Added missing utils exports. I would be happiest to set all utils under the utils module and auto-export all, so that usage would be like this: import 'utils' from 'starknet'
utils.num... But this would be a huge refactor to everyone. Maybe something to do in v6. |
🎉 This PR is included in version 5.14.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 5.14.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Motivation and Resolution
Fix #588
Usage related changes
Because of cairo0 back compatibility, we left formatting to be compressed program in response class, so it needs to be decompressed for declare and also typecast to legacy.
An example of redeclare cairo0 without a helper will be:
Redeclare cairo0 contract helper:
contractClassResponseToLegacyCompiledContract();
Example Cairo0 redeclare:
https://github.com/0xs34n/starknet.js/blob/a5b628fb0248a5c8caddc985cf93b6d53a69bf04/__tests__/account.test.ts#L75
Example Cairo1 redeclare:
https://github.com/0xs34n/starknet.js/blob/a5b628fb0248a5c8caddc985cf93b6d53a69bf04/__tests__/cairo1.test.ts#L60
Checklist: