Roadmap
- Re-create the methods of ecash-script still used by monorepo apps in ecash-lib (this diff)
- Deprecate ecash-script
- Move Cashtab's tx parsing functions into ecash-lib, standardize them to be portable
- Implement the now-standardized tx (and app) parsing functions in ecash-herald, so we parse everything in Cashtab and ecash-herald the same
- Implement in explorer (if practical to use the JS lib, should be doable; get Tx[] from chronik in the backend and parse for rendering with JS)
Background
Cashtab has powerful parsing functions for tx history that is useful for wallet devs. This logic should be made standardized and portable. In this way we could have a standard way of updating app parsing.
Right now, ecash-herald and cashtab both have distinct and custom parsing methods. They rely on the comparatively obsolete (compared to ecash-lib) ecash-script lib.
App devs should have a standard way of parsing ecash txs. Ideally, they should not have to do with low-level methods like getStackArray or consumeNextPush. However, we need these building blocks to complete parsing logic (like what we have in Cashtab's parseTx), and we need to recreate them in ecash-lib so that we can deprecate ecash-script without breaking Cashtab or ecash-herald.
So, this is a first step toward the end goal.