Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tripolskypetr/wallet-manager/llms.txt
Use this file to discover all available pages before exploring further.
fetchOrders returns a unified, time-sorted list of recent orders for a symbol, merging pending open orders (status NEW) with completed trade history (status FILLED or CANCELED). The result gives a complete picture of recent activity on a symbol without requiring separate calls to the open-orders and trade-history endpoints. Results are cached for 10 minutes per (symbol, limit) key to avoid hammering the Binance rate limits during repeated inspection.
Signature
Parameters
Binance trading pair symbol, e.g.
"SOLUSDT".Maximum number of completed (FILLED / CANCELED) orders to retrieve from the trade history endpoint. Defaults to
25. Open orders (NEW) are always included in addition to this count and are prepended to the result.Return value
Promise<IOrderData[]> — an array sorted newest-first, combining open orders and completed trade history.
A single order record.
How the result is assembled
The function combines two sources:- Completed orders — fetched via
binance.trades(symbol, { limit }), deduplicated byorderId, sorted newest-first, then enriched withstatus,origQty, andexecutedQtyfrombinance.orderStatus(). - Open orders — fetched via
binance.openOrders(symbol), sorted newest-first, mapped to the sameIOrderDatashape.
[...pendingOrders, ...finishedOrders] — open orders always appear first, followed by the completed history.
Caching
WalletPrivateService.fetchOrders is wrapped with ttl from functools-kit:
- TTL: 10 minutes (
600_000ms) per(symbol, limit)cache key. - The cache is invalidated by any
commit*call, becauseWalletPublicServicecallswalletPrivateService.clear()in itsfinallyblock after every commit operation. - A GC sweep runs every 30 seconds to evict expired entries from memory.
Usage example
The
limit parameter controls how many orders are fetched from the trade history endpoint, not the total result count. Open orders (NEW) are always appended on top, so the actual array length may exceed limit if you have many pending orders on the symbol.