[bisq-network/bisq] Add API 'gettrades' method (PR #5976)

Stan notifications at github.com
Tue Jan 25 22:52:56 CET 2022


@ghubstan commented on this pull request.



> @@ -273,15 +289,33 @@ Trade getTrade(String tradeId) {
                 ));
     }
 
+    List<Trade> getOpenTrades() {
+        coreWalletsService.verifyWalletsAreAvailable();
+        coreWalletsService.verifyEncryptedWalletIsUnlocked();
+        return tradeManager.getTrades();
+    }
+
+    List<TradeModel> getTradeHistory(GetTradesRequest.Category category) {
+        coreWalletsService.verifyWalletsAreAvailable();
+        coreWalletsService.verifyEncryptedWalletIsUnlocked();
+        if (category.equals(CLOSED)) {
+            var closedTrades = closedTradableManager.getClosedTrades().stream()
+                    .map(t -> (TradeModel) t)
+                    .collect(Collectors.toList());
+            closedTrades.addAll(bsqSwapTradeManager.getBsqSwapTrades());

If I call `getConfirmedBsqSwapTrades` here, before the first confirmation, `gettrades --category=closed` will not display the executed trade.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5976#discussion_r792150236
You are receiving this because you are subscribed to this thread.

Message ID: <bisq-network/bisq/pull/5976/review/862906185 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20220125/b735a921/attachment.htm>


More information about the bisq-github mailing list