Money
Amounts travel as decimal strings in major units; precision is set per ledger.
Wire format
| Surface | Format | Example |
|---|---|---|
| Request | Decimal string, major units | "100.00" |
| Response | Decimal string, major units | "100.00" |
| Storage | Integer minor units | 10000 |
Never send a JSON number. 100.00 as a float can arrive as 99.999…; a string is preserved verbatim.
Validation
| Field | Pattern |
|---|---|
Entry amount |
^\d+\.\d{2,18}$ — positive, 2 to 18 decimals |
min_balance, max_balance |
^-?\d+(?:\.\d+)?$ |
Scientific notation and hex are rejected with 422 VALIDATION_ERROR.
Precision per ledger
| Currency | Storage decimals | Display decimals |
|---|---|---|
| Fiat (USD, EUR, GBP) | 2 | 2 |
| BTC | 8 | 8 |
| ETH | 18 | 9 |
A ledger can override both. Send amounts at the ledger’s storage precision.