Enhancing SDK Transparency, Maintainability, and Developer Experience #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces significant improvements to the SDK’s error handling, logging, code structure, and documentation, aiming to deliver a more intuitive and transparent experience for developers integrating with the Supra blockchain.
Changes Made
Refactored Code Structure
- Introduced dedicated AccountService, TransactionService, and RequestService classes for clearer separation of concerns and improved maintainability.
- Added a clean interface for the SupraClient
- Added a clean request handler for making request and handling various errors
- Extracted utility functions (e.g., address normalization, sleeping, and type argument parsing) into a utils/helpers.ts module.
Streamlined Logging
- Introduced a built-in Logger with configurable log levels and a customizable ILogTransport. So you can pas your own logger, and use the transport to log elsewhere for example within your application
- Ensured consistent logging for all network requests, responses, and errors to facilitate easier debugging.
Documentation & Developer Experience
- Overhauled the README.md for improved clarity and detailed usage instructions.
- Added a comprehensive example demonstrating initialization, transaction simulation, and logging setup.
- Introduced vitest tests
Backward Compatibility
- Maintained the public API of ISupraClient while streamlining internal error handling and logging.
- Users upgrading to this version will experience clearer error messages and enhanced logs without requiring changes to their existing code.
Why Merge?
These updates make the SDK more transparent, maintainable, and developer-friendly by:
1. Improving error visibility and clarity.
2. Simplifying code structure for easier maintenance and extension.
3. Providing better logging and debugging tools for developers.
Next Steps
1. Review for consistency and adherence to code standards.
2. Address feedback regarding further refactoring or interface changes.
3. Upon approval, merge to release an improved SDK to users.
4. Add correct return types instead of
Breaking change:
This PR significantly enhances the development experience, making it easier and more reliable for developers to build with the Supra blockchain SDK.
Team Jinchuriki out!

Feel free to mail me at [email protected]