Serve single and batch CLOB order books over HTTP

This commit is contained in:
2026-12-03 07:52:06 +08:00
parent 5892772671
commit 5dde2cd28e
11 changed files with 452 additions and 11 deletions
+8
View File
@@ -119,6 +119,14 @@ impl Exchange {
Ok(())
}
/// Read requested outcome books in one consistent database and resident-book snapshot.
pub fn public_books(&mut self, tokens: &[String]) -> Result<Vec<Value>> {
let tx = expiry::transaction(&self.db, TransactionBehavior::Deferred)?;
let books = book_snapshot::read_many(&tx, &mut self.books, tokens)?;
tx.commit()?;
Ok(books)
}
pub fn market_stream_page(&mut self, market: &str, after: Option<i64>) -> Result<MarketPage> {
let tx = expiry::transaction(&self.db, TransactionBehavior::Deferred)?;
let page = market_stream::page(&tx, &mut self.books, market, after)?;