Tstron by STerliakov - TypeScript Tron SDK

Project Name: TsTron
Project Track: Web3
Team Name: working solo
Team Member(s): sterliakov
Project Goal: Provide blockchain developers with access to more recent technology compared to plain Javascript, allowing new projects to benefit from type checking usage.
Project Info: Submission video
Project Websites: Home page (repository), NPM package, Devpost submission

Project Test Instructions

I’d just put “N/A” here, but let’s expand this: to test my project, do whatever you’d like to do using it! If you were using Javascript SDK before, then you can now start migrating to typescript. Also this project is tested by automated CI pipeline, runs of these actions can be seen in the repo under “Actions” tab. You can pick something from the test suite as a reference.

Project Details

TsTron was developed as a fork of TronWeb Javascript Tron SDK, converted to add type information. I decided not to go *.d.ts-way, because the original library is not actively maintained, and there is enough to improve in implementation. A few bugs were discovered and fixed in TsTron (these fixes will be backported to TronWeb soon). As of writing this, the capabilities of TsTron are exactly the same as capabilities of TronWeb interface, and the overall interface remains very close to the old one. To ensure type correctness, all types for endpoints responses and other data structures are created based on protobuf definitions, which are actually used by API implementations.

I can confidently say that current library state is cleaner than in was - and this was one of my primary goals. Also, in my opinion modern CI&CD pipeline is important for every library and package, so all tests and builds are performed on github and visible to all users.

This project may serve as (hopefully, almost correct) alternative to the non-existent Tron HTTP API documentation, allowing at least to find out what do the endpoints expect and return.

Also, I refactored some existing code, removing some duplications. This reduced the bundle size for 15%.

Project Milestones

My aim for the hackathon period was to create a working implementation that passes all pre-existing tests and compiles successfully, and make it available to the end user as an NPM package.

Future development steps include improving test suite (and the code coverage as a consequence) and adding first-class gRPC endpoints support.

13 Likes

Really welcome developers tools project on Tron!

1 Like

Estaré siguiendo este proyecto a ver cómo le va