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

Stan notifications at github.com
Tue Jan 25 22:31:53 CET 2022


@ghubstan commented on this pull request.



> +                    var isMyOffer = coreApi.isMyOffer(tradeModel.getOffer());
+                    var isBsqSwapTrade = tradeModel instanceof BsqSwapTrade;
+                    var numConfirmations = isBsqSwapTrade
+                            ? coreApi.getTransactionConfirmations(((BsqSwapTrade) tradeModel).getTxId())
+                            : 0;
+                    var closingStatus = category.equals(OPEN)
+                            ? "Pending"
+                            : coreApi.getClosedTradeStateAsString(tradeModel);
+                    return isBsqSwapTrade
+                            ? toTradeInfo((BsqSwapTrade) tradeModel, role, isMyOffer, numConfirmations, closingStatus)
+                            : toTradeInfo(tradeModel, role, isMyOffer, closingStatus);
+                })
+                .collect(Collectors.toList());
+
+        // Add canceled OpenOffers to returned closed trades list.
+        Optional<List<OpenOffer>> canceledOpenOffers = category.equals(CLOSED)

This is consistent with the UI, which shows  `OpenOffer` instances with state == `CANCELED` in the Trade History view.  The UI categorizes them as "Canceled" trades.

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

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


More information about the bisq-github mailing list