Add event-sourced wallet and transaction tracking system
Wallets table with 7 seeded wallets, events table for three transaction types (bank_to_exchange, exchange_to_wallet, wallet_to_wallet). Balances computed from event credits/debits in sats. REST endpoints for CRUD. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
[integrant.core :as ig]
|
||||
[pmagnus.btcdata.frankfurter.rates :as rates]
|
||||
[pmagnus.btcdata.web.controllers.health :as health]
|
||||
[pmagnus.btcdata.web.controllers.transactions :as tx]
|
||||
[pmagnus.btcdata.web.middleware.exception :as exception]
|
||||
[pmagnus.btcdata.web.middleware.formats :as formats]
|
||||
[reitit.coercion.malli :as malli]
|
||||
@@ -161,7 +162,17 @@
|
||||
["/strike/ws"
|
||||
{:get (fn [req] (ws-strike-handler opts req))
|
||||
:no-doc true
|
||||
:middleware []}]])
|
||||
:middleware []}]
|
||||
["/wallets"
|
||||
{:get (fn [req] (tx/list-wallets opts req))
|
||||
:post (fn [req] (tx/create-wallet! opts req))}]
|
||||
["/wallets/balances"
|
||||
{:get (fn [req] (tx/get-wallet-balances opts req))}]
|
||||
["/wallets/:id/events"
|
||||
{:get (fn [req] (tx/get-wallet-events opts req))}]
|
||||
["/events"
|
||||
{:get (fn [req] (tx/list-events opts req))
|
||||
:post (fn [req] (tx/create-event! opts req))}]])
|
||||
|
||||
(defn route-data [opts]
|
||||
(merge
|
||||
|
||||
Reference in New Issue
Block a user