From dcc0e13e1e2f940ec8cb76cb3c4b53535f56875e Mon Sep 17 00:00:00 2001 From: Amit Prasad Date: Tue, 5 Nov 2024 16:27:47 -0600 Subject: [PATCH] Fix flaky (de)serialization ordering with --- .../bitfinex/v2/dto/account/LedgerEntry.java | 12 ++++++++ .../bitfinex/v2/dto/account/Movement.java | 25 +++++++++++++++++ .../TransferBetweenWalletsResponse.java | 21 ++++++++++++++ .../bitfinex/v2/dto/account/Wallet.java | 10 +++++++ .../v2/dto/marketdata/BitfinexCandle.java | 2 ++ .../dto/marketdata/BitfinexFundingOrder.java | 2 ++ .../marketdata/BitfinexFundingRawOrder.java | 2 ++ .../BitfinexPublicFundingTrade.java | 2 ++ .../dto/marketdata/BitfinexPublicTrade.java | 2 ++ .../v2/dto/marketdata/BitfinexStats.java | 2 ++ .../BitfinexTickerFundingCurrency.java | 20 +++++++++++++ .../BitfinexTickerTraidingPair.java | 14 ++++++++++ .../dto/marketdata/BitfinexTradingOrder.java | 2 ++ .../marketdata/BitfinexTradingRawOrder.java | 2 ++ .../bitfinex/v2/dto/marketdata/Status.java | 27 ++++++++++++++++++ .../bitfinex/v2/dto/trade/ActiveOrder.java | 28 +++++++++++++++++++ .../bitfinex/v2/dto/trade/OrderTrade.java | 14 ++++++++++ .../bitfinex/v2/dto/trade/Position.java | 23 +++++++++++++++ .../xchange/bitfinex/v2/dto/trade/Trade.java | 14 ++++++++++ .../dto/marketdata/BitgetMarketDepthDto.java | 2 ++ .../coinegg/dto/marketdata/CoinEggOrders.java | 3 ++ .../dto/marketdata/CoinexMarketDepth.java | 2 ++ .../dto/marketdata/GateioOrderBook.java | 2 ++ .../v2/dto/marketdata/GeminiCandle.java | 2 ++ .../lgo/dto/marketdata/LgoCandlestick.java | 2 ++ .../v3/dto/marketdata/OkexOrderBookEntry.java | 2 ++ .../BitfinexWebSocketTickerTransaction.java | 5 ++++ .../bitfinex/dto/BitfinexWebSocketTrade.java | 2 ++ .../dto/BitfinexWebsocketUpdateTrade.java | 2 ++ .../bitmex/BitmexStreamingTest.java | 9 ++++-- ...inbaseProWebSocketSubscriptionMessage.java | 4 +-- ...seProWebSocketSubscriptionMessageTest.java | 12 ++++---- .../response/orderbook/OrderBookPayload.java | 2 ++ .../PoloniexWebSocketEventsTransaction.java | 2 ++ .../PoloniexWebSocketTickerTransaction.java | 2 ++ 35 files changed, 269 insertions(+), 10 deletions(-) diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/LedgerEntry.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/LedgerEntry.java index 29b1f595534..6f10279c8c5 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/LedgerEntry.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/LedgerEntry.java @@ -1,12 +1,24 @@ package org.knowm.xchange.bitfinex.v2.dto.account; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.util.Date; import lombok.Data; /** https://docs.bitfinex.com/reference#rest-auth-ledgers */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({ + "id", + "currency", + "placeHolder0", + "timestamp", + "placeHolder1", + "amount", + "balance", + "placeHolder2", + "description" +}) @Data public class LedgerEntry { diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/Movement.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/Movement.java index 1e1f672c863..0837a44178a 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/Movement.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/Movement.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.util.Date; import lombok.Value; @@ -11,6 +12,30 @@ /** https://docs.bitfinex.com/reference#rest-auth-movements */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) @JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "ID", + "CURRENCY", + "CURRENCY_NAME", + "nullField1", + "nullField2", + "MTS_STARTED", + "MTS_UPDATED", + "nullField3", + "nullField4", + "STATUS", + "nullField5", + "nullField6", + "AMOUNT", + "FEES", + "nullField7", + "nullField8", + "DESTINATION_ADDRESS", + "nullField9", + "nullField10", + "nullField11", + "TRANSACTION_ID", + "nullField12" +}) @Value public class Movement { /* Movement identifier */ diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/TransferBetweenWalletsResponse.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/TransferBetweenWalletsResponse.java index 576c637d1a7..2187960dd5a 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/TransferBetweenWalletsResponse.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/TransferBetweenWalletsResponse.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.account; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.util.Date; import lombok.AccessLevel; @@ -9,6 +10,16 @@ /** see https://docs.bitfinex.com/reference#rest-auth-transfer */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({ + "timestamp", + "type", + "messageId", + "placeHolder0", + "transfer", + "code", + "status", + "text" +}) @Value @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) public class TransferBetweenWalletsResponse { @@ -38,6 +49,16 @@ public Date getTimestamp() { } @JsonFormat(shape = JsonFormat.Shape.ARRAY) + @JsonPropertyOrder({ + "timestamp", + "walletFrom", + "walletTo", + "placeHolder0", + "currency", + "currencyTo", + "placeHolder1", + "amount" + }) @Value @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) public static class Transfer { diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/Wallet.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/Wallet.java index 7b92e2b4c2f..c9f8524aaf5 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/Wallet.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/Wallet.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.account; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -8,6 +9,15 @@ /** https://docs.bitfinex.com/reference#rest-auth-wallets */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({ + "walletType", + "currency", + "balance", + "unsettledInterest", + "availableBalance", + "lastChange", + "tradeDetails" +}) @Value @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) public class Wallet { diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexCandle.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexCandle.java index 158fb460c73..79e259f12f5 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexCandle.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexCandle.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.marketdata; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.time.Instant; import java.time.ZoneOffset; import java.time.ZonedDateTime; @@ -12,6 +13,7 @@ * @author cyrus13 * */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"timestamp", "open", "close", "high", "low", "volume"}) @Jacksonized @Data @Builder diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexFundingOrder.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexFundingOrder.java index b2a1afa4d80..b6dec2e48cf 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexFundingOrder.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexFundingOrder.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.marketdata; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -10,6 +11,7 @@ * @see https://docs.bitfinex.com/reference#rest-public-book */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"rate", "period", "count", "amount"}) @Value @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) public class BitfinexFundingOrder { diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexFundingRawOrder.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexFundingRawOrder.java index e1c32d9b71e..be6663f3826 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexFundingRawOrder.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexFundingRawOrder.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.marketdata; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -11,6 +12,7 @@ * of R0) */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"id", "period", "rate", "amount"}) @Value @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) public class BitfinexFundingRawOrder { diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexPublicFundingTrade.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexPublicFundingTrade.java index 7adf275f6b8..20e455de452 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexPublicFundingTrade.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexPublicFundingTrade.java @@ -1,11 +1,13 @@ package org.knowm.xchange.bitfinex.v2.dto.marketdata; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import lombok.Getter; import lombok.ToString; @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"tradeId", "timestamp", "amount", "rate", "period"}) @Getter @ToString public class BitfinexPublicFundingTrade { diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexPublicTrade.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexPublicTrade.java index 4337f448e1b..131d0060321 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexPublicTrade.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexPublicTrade.java @@ -1,10 +1,12 @@ package org.knowm.xchange.bitfinex.v2.dto.marketdata; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import org.knowm.xchange.dto.Order.OrderType; @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"tradeId", "timestamp", "amount", "price"}) public class BitfinexPublicTrade { private long tradeId; diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexStats.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexStats.java index 3176b43b9f9..6e5d9a4a782 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexStats.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexStats.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.marketdata; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.util.Date; import lombok.AccessLevel; @@ -11,6 +12,7 @@ * @see https://docs.bitfinex.com/reference#rest-public-stats1 */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"millisecondTimestamp", "value"}) @Value @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) public class BitfinexStats { diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTickerFundingCurrency.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTickerFundingCurrency.java index fd9ab06bc20..d4e12b4cfd4 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTickerFundingCurrency.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTickerFundingCurrency.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.marketdata; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import lombok.AllArgsConstructor; import lombok.Getter; @@ -12,6 +13,25 @@ @NoArgsConstructor @Getter @ToString +@JsonPropertyOrder({ + "symbol", + "frr", + "bid", + "bidPeriod", + "bidSize", + "ask", + "askPeriod", + "askSize", + "dailyChange", + "dailyChangePerc", + "lastPrice", + "volume", + "high", + "low", + "placeHolder0", + "placeHolder1", + "frrAmountAvailable" +}) public class BitfinexTickerFundingCurrency implements BitfinexTicker { private String symbol; diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTickerTraidingPair.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTickerTraidingPair.java index bc62890d589..4cbc1b63bca 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTickerTraidingPair.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTickerTraidingPair.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.marketdata; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import lombok.AllArgsConstructor; import lombok.Getter; @@ -12,6 +13,19 @@ @NoArgsConstructor @Getter @ToString +@JsonPropertyOrder({ + "symbol", + "bid", + "bidSize", + "ask", + "askSize", + "dailyChange", + "dailyChangePerc", + "lastPrice", + "volume", + "high", + "low" +}) public class BitfinexTickerTraidingPair implements BitfinexTicker { private String symbol; diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTradingOrder.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTradingOrder.java index 02ce45cf1cb..ede83dea366 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTradingOrder.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTradingOrder.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.marketdata; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -10,6 +11,7 @@ * @see https://docs.bitfinex.com/reference#rest-public-book */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"price", "count", "amount"}) @Value @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) public class BitfinexTradingOrder { diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTradingRawOrder.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTradingRawOrder.java index 0a78e169de9..ff336663aa0 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTradingRawOrder.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/BitfinexTradingRawOrder.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.marketdata; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -11,6 +12,7 @@ * of R0) */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"orderId", "price", "amount"}) @Value @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) public class BitfinexTradingRawOrder { diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/Status.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/Status.java index 9dfcdaeb067..2ecc66f14df 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/Status.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/marketdata/Status.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import lombok.Getter; import lombok.Setter; @@ -9,6 +10,32 @@ @JsonFormat(shape = JsonFormat.Shape.ARRAY) @JsonIgnoreProperties(ignoreUnknown = true) +@JsonPropertyOrder({ + "symbol", + "timestamp", + "placeHolder0", + "derivPrice", + "spotPrice", + "placeHolder1", + "insuranceFundBalance", + "placeHolder2", + "nextFundingEvtTimestampMillis", + "nextFundingAccrued", + "nextFundingStep", + "placeHolder4", + "currentFunding", + "placeHolder5", + "placeHolder6", + "markPrice", + "placeHolder7", + "placeHolder8", + "openInterest", + "placeHolder9", + "placeHolder10", + "placeHolder11", + "clampMin", + "clampMax" +}) @Setter @Getter @ToString diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/ActiveOrder.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/ActiveOrder.java index 296292e1378..08572c30c0a 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/ActiveOrder.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/ActiveOrder.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.trade; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.util.Date; import lombok.Getter; @@ -9,6 +10,33 @@ /** https://docs.bitfinex.com/v2/reference#rest-auth-trades-hist */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({ + "id", + "gid", + "cid", + "symbol", + "timestampCreate", + "timestampUpdate", + "amount", + "amountOrig", + "type", + "typePrev", + "placeHolder0", + "placeHolder1", + "flags", + "orderStatus", + "placeHolder2", + "placeHolder3", + "price", + "priceAvg", + "priceTrailing", + "priceAuxLimit", + "placeHolder4", + "placeHolder5", + "placeHolder6", + "hidden", + "placedId" +}) @Setter @Getter @ToString diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/OrderTrade.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/OrderTrade.java index c75dafaacb1..971e12d81ff 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/OrderTrade.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/OrderTrade.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.trade; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.util.Date; import lombok.Getter; @@ -9,6 +10,19 @@ /** https://docs.bitfinex.com/reference#rest-auth-order-trades */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({ + "id", + "symbol", + "timestamp", + "orderId", + "execAmount", + "execPrice", + "placeHolder1", + "placeHolder2", + "maker", + "fee", + "feeCurrency" +}) @Setter @Getter @ToString diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/Position.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/Position.java index 8a310c33ca9..562ede3aeb0 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/Position.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/Position.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.trade; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import lombok.Getter; import lombok.Setter; @@ -8,6 +9,28 @@ /** https://docs.bitfinex.com/v2/reference#rest-auth-positions */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({ + "symbol", + "status", + "amount", + "basePrice", + "marginFunding", + "marginFundingType", + "pl", + "plPercent", + "priceLiq", + "leverage", + "placeHolder0", + "positionId", + "timestampCreate", + "timestampUpdate", + "placeHolder1", + "type", + "placeHolder2", + "collateral", + "collateralMin", + "meta" +}) @Setter @Getter @ToString diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/Trade.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/Trade.java index ec8df5e7d83..84a62bcabb8 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/Trade.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/trade/Trade.java @@ -1,6 +1,7 @@ package org.knowm.xchange.bitfinex.v2.dto.trade; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.util.Date; import lombok.Getter; @@ -9,6 +10,19 @@ /** https://docs.bitfinex.com/v2/reference#rest-auth-trades-hist */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({ + "id", + "symbol", + "timestamp", + "orderId", + "execAmount", + "execPrice", + "orderType", + "orderPrice", + "maker", + "fee", + "feeCurrency" +}) @Setter @Getter @ToString diff --git a/xchange-bitget/src/main/java/org/knowm/xchange/bitget/dto/marketdata/BitgetMarketDepthDto.java b/xchange-bitget/src/main/java/org/knowm/xchange/bitget/dto/marketdata/BitgetMarketDepthDto.java index 733861d1cdd..8b1cbc08144 100644 --- a/xchange-bitget/src/main/java/org/knowm/xchange/bitget/dto/marketdata/BitgetMarketDepthDto.java +++ b/xchange-bitget/src/main/java/org/knowm/xchange/bitget/dto/marketdata/BitgetMarketDepthDto.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.time.Instant; import java.util.List; @@ -27,6 +28,7 @@ public class BitgetMarketDepthDto { @Builder @Jacksonized @JsonFormat(shape = JsonFormat.Shape.ARRAY) + @JsonPropertyOrder({"price", "size"}) public static class PriceSizeEntry { BigDecimal price; diff --git a/xchange-coinegg/src/main/java/org/knowm/xchange/coinegg/dto/marketdata/CoinEggOrders.java b/xchange-coinegg/src/main/java/org/knowm/xchange/coinegg/dto/marketdata/CoinEggOrders.java index 2a746d4794f..7825aafaf5b 100644 --- a/xchange-coinegg/src/main/java/org/knowm/xchange/coinegg/dto/marketdata/CoinEggOrders.java +++ b/xchange-coinegg/src/main/java/org/knowm/xchange/coinegg/dto/marketdata/CoinEggOrders.java @@ -2,6 +2,8 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + import java.math.BigDecimal; public class CoinEggOrders { @@ -24,6 +26,7 @@ public CoinEggOrder[] getBids() { } @JsonFormat(shape = JsonFormat.Shape.ARRAY) + @JsonPropertyOrder({"price", "quantity"}) public static class CoinEggOrder { @JsonProperty() private BigDecimal price; diff --git a/xchange-coinex/src/main/java/org/knowm/xchange/coinex/dto/marketdata/CoinexMarketDepth.java b/xchange-coinex/src/main/java/org/knowm/xchange/coinex/dto/marketdata/CoinexMarketDepth.java index 7895face195..229a5e56800 100644 --- a/xchange-coinex/src/main/java/org/knowm/xchange/coinex/dto/marketdata/CoinexMarketDepth.java +++ b/xchange-coinex/src/main/java/org/knowm/xchange/coinex/dto/marketdata/CoinexMarketDepth.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.math.BigDecimal; import java.time.Instant; @@ -49,6 +50,7 @@ public static class Depth { @Builder @Jacksonized @JsonFormat(shape = JsonFormat.Shape.ARRAY) + @JsonPropertyOrder({"price", "size"}) public static class PriceSizeEntry { BigDecimal price; diff --git a/xchange-gateio-v4/src/main/java/org/knowm/xchange/gateio/dto/marketdata/GateioOrderBook.java b/xchange-gateio-v4/src/main/java/org/knowm/xchange/gateio/dto/marketdata/GateioOrderBook.java index 38e6af6e666..dcad0811716 100644 --- a/xchange-gateio-v4/src/main/java/org/knowm/xchange/gateio/dto/marketdata/GateioOrderBook.java +++ b/xchange-gateio-v4/src/main/java/org/knowm/xchange/gateio/dto/marketdata/GateioOrderBook.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.time.Instant; import java.util.List; @@ -33,6 +34,7 @@ public class GateioOrderBook { @Builder @Jacksonized @JsonFormat(shape = JsonFormat.Shape.ARRAY) + @JsonPropertyOrder({"price", "size"}) public static class PriceSizeEntry { BigDecimal price; diff --git a/xchange-gemini/src/main/java/org/knowm/xchange/gemini/v2/dto/marketdata/GeminiCandle.java b/xchange-gemini/src/main/java/org/knowm/xchange/gemini/v2/dto/marketdata/GeminiCandle.java index 381c0947cd1..52f1a87db1e 100644 --- a/xchange-gemini/src/main/java/org/knowm/xchange/gemini/v2/dto/marketdata/GeminiCandle.java +++ b/xchange-gemini/src/main/java/org/knowm/xchange/gemini/v2/dto/marketdata/GeminiCandle.java @@ -1,11 +1,13 @@ package org.knowm.xchange.gemini.v2.dto.marketdata; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import lombok.Data; /** https://docs.gemini.com/rest-api/#candles */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"time", "open", "high", "low", "close", "volume"}) @Data public class GeminiCandle { private Long time; diff --git a/xchange-lgo/src/main/java/org/knowm/xchange/lgo/dto/marketdata/LgoCandlestick.java b/xchange-lgo/src/main/java/org/knowm/xchange/lgo/dto/marketdata/LgoCandlestick.java index e1d8c898f46..d47ce3ba444 100644 --- a/xchange-lgo/src/main/java/org/knowm/xchange/lgo/dto/marketdata/LgoCandlestick.java +++ b/xchange-lgo/src/main/java/org/knowm/xchange/lgo/dto/marketdata/LgoCandlestick.java @@ -3,10 +3,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.util.Date; @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"time", "low", "high", "open", "close", "volume"}) public class LgoCandlestick { private final Date time; diff --git a/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/v3/dto/marketdata/OkexOrderBookEntry.java b/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/v3/dto/marketdata/OkexOrderBookEntry.java index f84afea20fb..74f91f28329 100644 --- a/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/v3/dto/marketdata/OkexOrderBookEntry.java +++ b/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/v3/dto/marketdata/OkexOrderBookEntry.java @@ -3,11 +3,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import lombok.Data; @Data @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"price", "volume", "numOrdersOnLevel"}) public class OkexOrderBookEntry { private BigDecimal price; diff --git a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/dto/BitfinexWebSocketTickerTransaction.java b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/dto/BitfinexWebSocketTickerTransaction.java index c9d80ea7e14..5f41aa4d602 100644 --- a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/dto/BitfinexWebSocketTickerTransaction.java +++ b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/dto/BitfinexWebSocketTickerTransaction.java @@ -1,11 +1,16 @@ package info.bitrich.xchangestream.bitfinex.dto; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import org.knowm.xchange.bitfinex.v1.dto.marketdata.BitfinexTicker; /** Created by Lukas Zaoralek on 8.11.17. */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({ + "channelId", + "tickerArr" +}) public class BitfinexWebSocketTickerTransaction { public String channelId; diff --git a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/dto/BitfinexWebSocketTrade.java b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/dto/BitfinexWebSocketTrade.java index a60163ad264..7ed17089ce1 100644 --- a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/dto/BitfinexWebSocketTrade.java +++ b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/dto/BitfinexWebSocketTrade.java @@ -1,11 +1,13 @@ package info.bitrich.xchangestream.bitfinex.dto; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import org.knowm.xchange.bitfinex.v1.dto.marketdata.BitfinexTrade; /** Created by Lukas Zaoralek on 7.11.17. */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"tradeId", "timestamp", "amount", "price"}) public class BitfinexWebSocketTrade { public long tradeId; public long timestamp; diff --git a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/dto/BitfinexWebsocketUpdateTrade.java b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/dto/BitfinexWebsocketUpdateTrade.java index eaf10372e84..337ac083163 100644 --- a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/dto/BitfinexWebsocketUpdateTrade.java +++ b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/dto/BitfinexWebsocketUpdateTrade.java @@ -1,10 +1,12 @@ package info.bitrich.xchangestream.bitfinex.dto; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.knowm.xchange.bitfinex.v1.dto.marketdata.BitfinexTrade; /** Created by Lukas Zaoralek on 8.11.17. */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"type", "trade"}) public class BitfinexWebsocketUpdateTrade extends BitfinexWebSocketTradesTransaction { public String type; public BitfinexWebSocketTrade trade; diff --git a/xchange-stream-bitmex/src/test/java/info/bitrich/xchangestream/bitmex/BitmexStreamingTest.java b/xchange-stream-bitmex/src/test/java/info/bitrich/xchangestream/bitmex/BitmexStreamingTest.java index 33856fd1a40..01e5c93a7f4 100644 --- a/xchange-stream-bitmex/src/test/java/info/bitrich/xchangestream/bitmex/BitmexStreamingTest.java +++ b/xchange-stream-bitmex/src/test/java/info/bitrich/xchangestream/bitmex/BitmexStreamingTest.java @@ -1,5 +1,6 @@ package info.bitrich.xchangestream.bitmex; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import org.junit.Assert; import org.junit.Test; @@ -8,12 +9,15 @@ * @author Foat Akhmadeev 13/06/2018 */ public class BitmexStreamingTest { + private final ObjectMapper objectMapper = new ObjectMapper(); + @Test public void shouldGetCorrectSubscribeMessage() throws IOException { BitmexStreamingService service = new BitmexStreamingService("url", "api", "secret"); Assert.assertEquals( - "{\"op\":\"subscribe\",\"args\":[\"name\"]}", service.getSubscribeMessage("name")); + objectMapper.readTree("{\"op\":\"subscribe\",\"args\":[\"name\"]}"), + objectMapper.readTree(service.getSubscribeMessage("name"))); } @Test @@ -21,6 +25,7 @@ public void shouldGetCorrectUnsubscribeMessage() throws IOException { BitmexStreamingService service = new BitmexStreamingService("url", "api", "secret"); Assert.assertEquals( - "{\"op\":\"unsubscribe\",\"args\":[\"name\"]}", service.getUnsubscribeMessage("name")); + objectMapper.readTree("{\"op\":\"unsubscribe\",\"args\":[\"name\"]}"), + objectMapper.readTree(service.getUnsubscribeMessage("name"))); } } diff --git a/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/dto/CoinbaseProWebSocketSubscriptionMessage.java b/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/dto/CoinbaseProWebSocketSubscriptionMessage.java index 10e2ab682b2..37fa1f34315 100644 --- a/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/dto/CoinbaseProWebSocketSubscriptionMessage.java +++ b/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/dto/CoinbaseProWebSocketSubscriptionMessage.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import info.bitrich.xchangestream.core.ProductSubscription; import java.util.ArrayList; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.stream.Stream; @@ -116,7 +116,7 @@ private void generateSubscriptionMessage( CoinbaseProOrderBookMode orderBookMode, CoinbaseProWebsocketAuthData authData) { List channels = new ArrayList<>(3); - Map> pairs = new HashMap<>(3); + Map> pairs = new LinkedHashMap<>(3); pairs.put(orderBookMode.getName(), productSubscription.getOrderBook()); pairs.put("ticker", productSubscription.getTicker()); diff --git a/xchange-stream-coinbasepro/src/test/java/info/bitrich/xchangestream/coinbasepro/dto/CoinbaseProWebSocketSubscriptionMessageTest.java b/xchange-stream-coinbasepro/src/test/java/info/bitrich/xchangestream/coinbasepro/dto/CoinbaseProWebSocketSubscriptionMessageTest.java index c9ff12a3775..f1a39cb99dd 100644 --- a/xchange-stream-coinbasepro/src/test/java/info/bitrich/xchangestream/coinbasepro/dto/CoinbaseProWebSocketSubscriptionMessageTest.java +++ b/xchange-stream-coinbasepro/src/test/java/info/bitrich/xchangestream/coinbasepro/dto/CoinbaseProWebSocketSubscriptionMessageTest.java @@ -30,8 +30,8 @@ public void testWebSocketMessageSerialization() throws JsonProcessingException { String serialized = mapper.writeValueAsString(message); Assert.assertEquals( - "{\"type\":\"subscribe\",\"channels\":[{\"name\":\"matches\",\"product_ids\":[\"BTC-USD\"]},{\"name\":\"ticker\",\"product_ids\":[\"BTC-USD\"]},{\"name\":\"level2\",\"product_ids\":[\"BTC-USD\"]}]}", - serialized); + mapper.readTree("{\"type\":\"subscribe\",\"channels\":[{\"name\":\"level2\",\"product_ids\":[\"BTC-USD\"]},{\"name\":\"ticker\",\"product_ids\":[\"BTC-USD\"]},{\"name\":\"matches\",\"product_ids\":[\"BTC-USD\"]}]}"), + mapper.readTree(serialized)); } @Test @@ -53,8 +53,8 @@ public void testWebSocketMessageSerializationL3Orderbook() throws JsonProcessing String serialized = mapper.writeValueAsString(message); Assert.assertEquals( - "{\"type\":\"subscribe\",\"channels\":[{\"name\":\"matches\",\"product_ids\":[\"BTC-USD\"]},{\"name\":\"ticker\",\"product_ids\":[\"BTC-USD\"]},{\"name\":\"full\",\"product_ids\":[\"BTC-USD\"]}]}", - serialized); + mapper.readTree("{\"type\":\"subscribe\",\"channels\":[{\"product_ids\":[\"BTC-USD\"],\"name\":\"full\"},{\"product_ids\":[\"BTC-USD\"],\"name\":\"ticker\"},{\"product_ids\":[\"BTC-USD\"],\"name\":\"matches\"}]}"), + mapper.readTree(serialized)); } @Test @@ -76,7 +76,7 @@ public void testWebSocketMessageSerializationBatch() throws JsonProcessingExcept String serialized = mapper.writeValueAsString(message); Assert.assertEquals( - "{\"type\":\"subscribe\",\"channels\":[{\"name\":\"matches\",\"product_ids\":[\"BTC-USD\"]},{\"name\":\"level2_batch\",\"product_ids\":[\"BTC-USD\"]},{\"name\":\"ticker\",\"product_ids\":[\"BTC-USD\"]}]}", - serialized); + mapper.readTree("{\"type\":\"subscribe\",\"channels\":[{\"product_ids\":[\"BTC-USD\"],\"name\":\"level2_batch\"},{\"product_ids\":[\"BTC-USD\"],\"name\":\"ticker\"},{\"product_ids\":[\"BTC-USD\"],\"name\":\"matches\"}]}"), + mapper.readTree(serialized)); } } diff --git a/xchange-stream-gateio/src/main/java/info/bitrich/xchangestream/gateio/dto/response/orderbook/OrderBookPayload.java b/xchange-stream-gateio/src/main/java/info/bitrich/xchangestream/gateio/dto/response/orderbook/OrderBookPayload.java index 7407d46315c..b3a3cc6ed33 100644 --- a/xchange-stream-gateio/src/main/java/info/bitrich/xchangestream/gateio/dto/response/orderbook/OrderBookPayload.java +++ b/xchange-stream-gateio/src/main/java/info/bitrich/xchangestream/gateio/dto/response/orderbook/OrderBookPayload.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.math.BigDecimal; import java.time.Instant; @@ -35,6 +36,7 @@ public class OrderBookPayload { @Builder @Jacksonized @JsonFormat(shape = JsonFormat.Shape.ARRAY) + @JsonPropertyOrder({"price", "size"}) public static class PriceSizeEntry { BigDecimal price; diff --git a/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/dto/PoloniexWebSocketEventsTransaction.java b/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/dto/PoloniexWebSocketEventsTransaction.java index 4ba6ae500fc..734f4d28cf3 100644 --- a/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/dto/PoloniexWebSocketEventsTransaction.java +++ b/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/dto/PoloniexWebSocketEventsTransaction.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; @@ -13,6 +14,7 @@ /** Created by Lukas Zaoralek on 11.11.17. */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"channelId", "seqId", "events"}) public class PoloniexWebSocketEventsTransaction { private Long channelId; private Long seqId; diff --git a/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/dto/PoloniexWebSocketTickerTransaction.java b/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/dto/PoloniexWebSocketTickerTransaction.java index 1b03c3439e6..9e305e5404c 100644 --- a/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/dto/PoloniexWebSocketTickerTransaction.java +++ b/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/dto/PoloniexWebSocketTickerTransaction.java @@ -1,6 +1,7 @@ package info.bitrich.xchangestream.poloniex2.dto; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.poloniex.dto.marketdata.PoloniexMarketData; @@ -8,6 +9,7 @@ /** Created by Lukas Zaoralek on 11.11.17. */ @JsonFormat(shape = JsonFormat.Shape.ARRAY) +@JsonPropertyOrder({"channelId", "timestamp", "ticker"}) public class PoloniexWebSocketTickerTransaction { public String channelId; public String timestamp;