diff options
| author | Kostya <mail@sartin.in> | 2026-10-11 12:20:47 +0300 |
|---|---|---|
| committer | Kostya <mail@sartin.in> | 2026-10-11 12:21:10 +0300 |
| commit | cf13d4608acfb2d81ec0056717e561bb40f991a2 (patch) | |
| tree | d12b0eaed413e8e17200a6bcb3a6fc6370960044 /src | |
| parent | 1cb67cec8951553fdb5969d947e49f2288f3847f (diff) | |
| download | guess-market-cf13d4608acfb2d81ec0056717e561bb40f991a2.tar.gz guess-market-cf13d4608acfb2d81ec0056717e561bb40f991a2.tar.xz guess-market-cf13d4608acfb2d81ec0056717e561bb40f991a2.zip | |
server: add account, deposit and user directory endpoints
Give each logged-in user their own account view and a view of
everyone else, as the spec asks:
- GET /api/user/account returns the caller's balance, blocked flag and
every ledger row (trades, fees, payouts, deposits).
- POST /api/user/deposit (form field "amount") tops the account up
through AccountContext.deposit, so its validation and DEPOSIT ledger
entry are the same as in the engine. Bad amounts get 400.
- GET /api/users lists every account with its name, balance and
whether it makes any market, the three facts the spec requires about
other users, plus whether it is logged in right now, which the login
registry already knows. Accounts outlive their sessions, so the list
includes users who are currently logged out.
A test drives two clients through a whole market: one deposits,
uploads and opens an event, the other deposits and buys, the first
resolves it, and the winner's balance rises by exactly one per winning
share.
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions