SDK v2 #146
ipapandinas
started this conversation in
Ideas
SDK v2
#146
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thesis
Ternoa-js SDK v1 handles the main features proposed by the Ternoa chain. This first version was born after the launch of the Ternoa Mainnet in April 2022. The design answered an initial need but presents some weaknesses today:
The v2 aims to extend the first version proposing the easiest tool to build web3 projects on top of Substrate-based chains. This vision can be splitted into two aproachs:
Ternoa will be used as a model by integrating all the NFT-centric features of the Ternoa blockchain. In the future other projects can contribute by adding new cases to abstract.
However with this vision exposed, the project name can no longer be attached directly to Ternoa as it aims to cover a wider scope of chains. A future name as to be define, suggestions are warm welcomed.
Thought pattern
🏛 Project architecture
The architecture design will reflect the splitted vision; a natural approach of scoped registries emerges:
The folder structure will follow from an OOP approach with mother classes and clients.
first structure for @XXX/core
first structure for @XXX/aaa
🧬 Dynamic typing & chain parameters validation
Typing in ternoa-js v1 is full of assumptions and does not cover complex types. The version 2 will be dynamic and resilient to runtime upgrades to ensure the best compatibility across chains. Projects like CAPI tackles theses problems by suggesting a dynamic way to port chain Rust types to Typescript using FRAME metadatas.
🪄 Clients
The @XXX/core project comes with several clients to provide the best flexibility to users.
The main client allows a user to initialize an api instance on any custom chain only when needed. The goal is to ensure the best user experience and wait time for applications (e.g. good for SEO).
The signing client will support major wallet providers such as Wallet Connect, Talisman, the polkadot extension and more.
The ipfs client makes IPFS uploads on any custom node simple with only one line of code.
🥋 Code of conduct
The version 2 lays the foundations of rules to deliver a quality product. It comes with: general & functional rules and definition of ready, definition of done, definition of valid.
📲 Ensure the best package compatibility: migration to mjs module
📚 Examples + documentation
Next
This post is an entry door to discuss design choices together. Feel free to suggest any ideas below, contributions are warm welcomed.
Beta Was this translation helpful? Give feedback.
All reactions