waves
waves copied to clipboard
Currency amount representation in the frontend and APIs
trafficstars
At the moment the UI deals with some currency amounts in BTC rather than SAT.
I'd recommend to introduce currency amount classes where the actual value is always in the smallest denomination (e.g. sats) and the class handles conversion for e.g. display. That class can then be part of the state.
Initially, we have a small implementation overhead, but in the long run I expect this to make the code more robust, testable and understandable (at the moment it is very hard to understand what a number value actually represents).