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

Stan notifications at github.com
Tue Jan 25 23:30:04 CET 2022


@ghubstan commented on this pull request.



> @@ -72,6 +78,22 @@ public TradeInfo getTrade(String tradeId) {
         return grpcStubs.tradesService.getTrade(request).getTrade();
     }
 
+    public List<TradeInfo> getOpenTrades() {
+        var request = GetTradesRequest.newBuilder()
+                .build();
+        return grpcStubs.tradesService.getTrades(request).getTradesList();
+    }
+
+    public List<TradeInfo> getTradeHistory(GetTradesRequest.Category category) {
+        if (!category.equals(CLOSED) && !category.equals(FAILED))

>> Why not two methods: getClosedTrades and getFailedTrades or single method that handles all 3 categories?
Every answer I can think of is splitting hairs, just like this question. ;-)

>> Do we need category validation at this level?
I think so.  It may seem redundant because the CLI validates the category param, but this is here for bots.

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

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


More information about the bisq-github mailing list