You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As it stands, txwrapper methods are hardcoded and take a lot of boiler plate. This design was initially chose in order to create the easiest possible experience for library users as having the method arguments + documentation hard coded was hypothesized to make users experience easier.
An alternative to hardcoding would be having some dynamic generation.
Some ideas:
Create JSON file with necessary info for methods and read in the info at runtime
Have a script that generates code for the methods based on metadata.
I think the main considerations is that the solution should 1) not degrade runtime performance 2) should not break the existing API and 3) it should be very easy for new users navigate
As it stands, txwrapper methods are hardcoded and take a lot of boiler plate. This design was initially chose in order to create the easiest possible experience for library users as having the method arguments + documentation hard coded was hypothesized to make users experience easier.
An alternative to hardcoding would be having some dynamic generation.
Some ideas:
polkadot-types-from-chain
script that generates interfaces such as: https://github.com/AcalaNetwork/acala.js/blob/master/packages/types/src/interfaces/augment-api-tx.tsI think the main considerations is that the solution should 1) not degrade runtime performance 2) should not break the existing API and 3) it should be very easy for new users navigate
cc @TarikGul
The text was updated successfully, but these errors were encountered: