3#include <xrpl/basics/UnorderedContainers.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/ledger/AcceptedLedgerTx.h>
6#include <xrpl/ledger/ReadView.h>
7#include <xrpl/protocol/Asset.h>
8#include <xrpl/protocol/Book.h>
9#include <xrpl/protocol/UintTypes.h>
A generic endpoint for log messages.
A transaction that is in a closed ledger.
Tracks order books in the ledger.
virtual int getBookSize(Asset const &asset, std::optional< Domain > const &domain=std::nullopt)=0
Get the count of order books that want a specific issue.
virtual bool isBookToXRP(Asset const &asset, std::optional< Domain > const &domain=std::nullopt)=0
Check if an order book to XRP exists for the given issue.
virtual std::vector< Book > getBooksByTakerPays(Asset const &asset, std::optional< Domain > const &domain=std::nullopt)=0
Get all order books that want a specific issue.
virtual void addOrderBook(Book const &book)=0
Add an order book to track.
virtual void setup(std::shared_ptr< ReadView const > const &ledger)=0
Initialize or update the order book database with a new ledger.
virtual ~OrderBookDB()=default
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::unordered_set< Value, Hash, Pred, Allocator > hash_set
hash_set< Book > affectedBooks(AcceptedLedgerTx const &alTx, beast::Journal const &j)
Extract the set of books affected by a transaction.