From 579edeb44ca3caf6af2827a5629b4206674e5479 Mon Sep 17 00:00:00 2001 From: Justin Carter Date: Sat, 2 Nov 2019 06:27:45 +0100 Subject: [PATCH] Fix OffersQuery structure --- src/main/java/bisq/markets/api/GraphQLQuery.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/bisq/markets/api/GraphQLQuery.java b/src/main/java/bisq/markets/api/GraphQLQuery.java index ed499eb..c668f69 100644 --- a/src/main/java/bisq/markets/api/GraphQLQuery.java +++ b/src/main/java/bisq/markets/api/GraphQLQuery.java @@ -114,7 +114,7 @@ public int compareTo(OpenOffer o) { "amount: formattedAmount price: formattedPrice " + "volume: formattedVolume payment_method: paymentMethodId " + "offer_fee_txid: offerFeeTxId } "; - private static final String offersQuery = "query Offers($market: MarketPair, $direction: Direction)" + + private static final String offersQuery = "query Offers($market: MarketPair!, $direction: Direction)" + "{ offers(market: $market, direction: $direction) { " + "buys " + offerFields + "sells " + offerFields + " } }"; @@ -128,7 +128,10 @@ public int compareTo(OpenOffer o) { @Override public Object translateResponse(String response) { GraphQLResponse>> offers = gson.fromJson(response,new TypeToken>>>(){}.getType()); - return offers.getData(); + Map> buysAndSells = offers.getData(); + Map>> ret = new HashMap<>(); + ret.put(variables.get("market"), buysAndSells); + return ret; } }