|
xrpld
|
Tracks order books in the ledger. More...
#include <OrderBookDB.h>

Public Member Functions | |
| virtual | ~OrderBookDB ()=default |
| virtual void | setup (std::shared_ptr< ReadView const > const &ledger)=0 |
| Initialize or update the order book database with a new ledger. | |
| virtual void | addOrderBook (Book const &book)=0 |
| Add an order book to track. | |
| 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 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. | |
Tracks order books in the ledger.
This interface provides access to order book information, including:
The order book database is updated as ledgers are accepted and provides efficient lookup of order book information for pathfinding and client subscriptions.
Definition at line 28 of file OrderBookDB.h.
|
virtualdefault |
|
pure virtual |
Initialize or update the order book database with a new ledger.
This method should be called when a new ledger is accepted to update the order book database with the current state of all order books.
| ledger | The ledger to scan for order books |
Implemented in xrpl::OrderBookDBImpl.
|
pure virtual |
Add an order book to track.
| book | The order book to add |
Implemented in xrpl::OrderBookDBImpl.
|
pure virtual |
Get all order books that want a specific issue.
Returns a list of all order books where the taker pays the specified issue. This is useful for pathfinding to find all possible next hops from a given currency.
| asset | The asset to search for |
| domain | Optional domain restriction for the order book |
Implemented in xrpl::OrderBookDBImpl.
|
pure virtual |
Get the count of order books that want a specific issue.
| asset | The asset to search for |
| domain | Optional domain restriction for the order book |
Implemented in xrpl::OrderBookDBImpl.
|
pure virtual |
Check if an order book to XRP exists for the given issue.
| asset | The asset to check |
| domain | Optional domain restriction for the order book |
Implemented in xrpl::OrderBookDBImpl.