RFC: Improve amount handling #200
Labels
enhancement
New feature or request
investigate
Every issue that requires further investigation
REST
An issue only appearing when using the REST interface
v0.6.0-beta
Milestone
Currently the handling of sats amounts is not clear. Sometimes the value has to be given as msat and sometimes as whole sats.
My proposal would be that each endpoint taking an amount as parameter requires an Amount object instead of an integer:
When giving this parameter, only one of the fields must be set. When the user provides an amount in sat or btc, the endpoint converts it to to the appropriate and passes it to the implementation. The parameter would be passed as
{"msat": 345678000}
Alternative approach would be to pass it as a string:
Of course this means that clients must be changed to support this, but currently we only have the WebUI as a user, so it should be fine.
A similar model will be used when the API returns an amount value.
The text was updated successfully, but these errors were encountered: