diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 00000000000..155ea5478db --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,583 @@ + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 00000000000..79ee123c2b2 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 821b951ff37..36b36c94cd0 100644 --- a/pom.xml +++ b/pom.xml @@ -31,19 +31,19 @@ UTF-8 1.8 - 3.23.1 + 3.24.2 3.12.0 2.14.1 2.1.0 1.7.0 4.13.2 - 1.18.22 + 1.18.26 3.8.2 1.4.5 0.10.2 2.0.6 5.0.0 - 3.19.2 + 4.0.0 true @@ -333,14 +333,6 @@ ${version.qos.logback} - - - org.projectlombok - lombok - ${version.lombok} - provided - - com.auth0 @@ -363,7 +355,7 @@ io.netty netty-all - 4.1.86.Final + 4.1.90.Final @@ -407,6 +399,14 @@ test + + + org.projectlombok + lombok + ${version.lombok} + provided + + @@ -539,13 +539,13 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + 3.0.0 org.apache.maven.plugins maven-failsafe-plugin - 3.0.0-M7 + 3.0.0 diff --git a/xchange-bibox/pom.xml b/xchange-bibox/pom.xml index c6e44d8f323..1a5a12604d3 100644 --- a/xchange-bibox/pom.xml +++ b/xchange-bibox/pom.xml @@ -29,9 +29,6 @@ xchange-core ${project.version} - - org.projectlombok - lombok - - + + diff --git a/xchange-binance/pom.xml b/xchange-binance/pom.xml index 441c7254887..52435ef1f26 100644 --- a/xchange-binance/pom.xml +++ b/xchange-binance/pom.xml @@ -27,10 +27,7 @@ xchange-core ${project.version} - - org.projectlombok - lombok - + com.github.tomakehurst wiremock-jre8 diff --git a/xchange-binance/src/main/java/org/knowm/xchange/binance/BinanceExchange.java b/xchange-binance/src/main/java/org/knowm/xchange/binance/BinanceExchange.java index 1e98fb2075f..64f4d1c0551 100644 --- a/xchange-binance/src/main/java/org/knowm/xchange/binance/BinanceExchange.java +++ b/xchange-binance/src/main/java/org/knowm/xchange/binance/BinanceExchange.java @@ -16,6 +16,7 @@ public class BinanceExchange extends BaseExchange implements Exchange { public static final String SPECIFIC_PARAM_USE_SANDBOX = "Use_Sandbox"; public static final String SPECIFIC_PARAM_USE_FUTURES_SANDBOX = "Use_Sandbox_Futures"; + public static final String SPECIFIC_PARAM_FUTURES_ENABLED = "Futures_Enabled"; private static final String SPOT_URL = "https://api.binance.com"; public static final String FUTURES_URL = "https://fapi.binance.com"; @@ -77,6 +78,11 @@ public boolean isFuturesSandbox(){ exchangeSpecification.getExchangeSpecificParametersItem(SPECIFIC_PARAM_USE_FUTURES_SANDBOX)); } + public boolean isFuturesEnabled(){ + return Boolean.TRUE.equals( + exchangeSpecification.getExchangeSpecificParametersItem(SPECIFIC_PARAM_FUTURES_ENABLED)); + } + public boolean usingSandbox() { return enabledSandbox(exchangeSpecification); } @@ -101,7 +107,9 @@ public void remoteInit() { } } else { exchangeMetaData = BinanceAdapters.adaptExchangeMetaData(marketDataService.getExchangeInfo(), assetDetailMap); - BinanceAdapters.adaptFutureExchangeMetaData(exchangeMetaData, marketDataService.getFutureExchangeInfo()); + if(isFuturesEnabled()){ + BinanceAdapters.adaptFutureExchangeMetaData(exchangeMetaData, marketDataService.getFutureExchangeInfo()); + } } } catch (Exception e) { diff --git a/xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceAccountService.java b/xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceAccountService.java index f73ee801f5f..6aab63f855e 100644 --- a/xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceAccountService.java +++ b/xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceAccountService.java @@ -104,11 +104,12 @@ public AccountInfo getAccountInfo() throws IOException { wallets.add(BinanceAdapters.adaptBinanceSpotWallet(account())); } } else { - BinanceFutureAccountInformation futureAccountInformation = futuresAccount(); + if(exchange.isFuturesEnabled()){ + BinanceFutureAccountInformation futureAccountInformation = futuresAccount(); + wallets.add(BinanceAdapters.adaptBinanceFutureWallet(futureAccountInformation)); + openPositions.addAll(BinanceAdapters.adaptOpenPositions(futureAccountInformation.getPositions())); + } wallets.add(BinanceAdapters.adaptBinanceSpotWallet(account())); - wallets.add(BinanceAdapters.adaptBinanceFutureWallet(futureAccountInformation)); - openPositions.addAll(BinanceAdapters.adaptOpenPositions(futureAccountInformation.getPositions())); - } return new AccountInfo( exchange.getExchangeSpecification().getUserName(), diff --git a/xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceTradeService.java b/xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceTradeService.java index db8c9b2bcc2..357b6d9aef4 100644 --- a/xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceTradeService.java +++ b/xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceTradeService.java @@ -139,7 +139,7 @@ private String placeOrderAllProducts( order.hasFlag( org.knowm.xchange.binance.dto.trade.BinanceOrderFlags.REDUCE_ONLY), limitPrice, - getClientOrderId(order), + order.getUserReference(), stopPrice, false, null, @@ -157,7 +157,7 @@ private String placeOrderAllProducts( order.getOriginalAmount(), quoteOrderQty, limitPrice, - getClientOrderId(order), + order.getUserReference(), stopPrice, trailingDelta, null, @@ -193,7 +193,7 @@ public void placeTestOrder( order.getOriginalAmount(), quoteOrderQty, limitPrice, - getClientOrderId(order), + order.getUserReference(), stopPrice, trailingDelta, null); @@ -202,20 +202,6 @@ public void placeTestOrder( } } - private String getClientOrderId(Order order) { - - String clientOrderId = null; - for (IOrderFlags flags : order.getOrderFlags()) { - if (flags instanceof BinanceOrderFlags) { - BinanceOrderFlags bof = (BinanceOrderFlags) flags; - if (clientOrderId == null) { - clientOrderId = bof.getClientId(); - } - } - } - return clientOrderId; - } - @Override public boolean cancelOrder(CancelOrderParams params) throws IOException { try { diff --git a/xchange-binance/src/test/resources/logback.xml b/xchange-binance/src/test/resources/logback.xml index 5809b573500..8c86d2fa1c3 100644 --- a/xchange-binance/src/test/resources/logback.xml +++ b/xchange-binance/src/test/resources/logback.xml @@ -11,7 +11,7 @@ - + diff --git a/xchange-bitbay/pom.xml b/xchange-bitbay/pom.xml index 07281f77f8f..1b444f27c9d 100644 --- a/xchange-bitbay/pom.xml +++ b/xchange-bitbay/pom.xml @@ -29,10 +29,6 @@ xchange-core ${project.version} - - org.projectlombok - lombok - diff --git a/xchange-bitcoinde/pom.xml b/xchange-bitcoinde/pom.xml index ea10e065958..5c04b494ff8 100644 --- a/xchange-bitcoinde/pom.xml +++ b/xchange-bitcoinde/pom.xml @@ -30,9 +30,5 @@ ${project.version} - - org.projectlombok - lombok - diff --git a/xchange-bitfinex/pom.xml b/xchange-bitfinex/pom.xml index a80d0449f6e..a31f2fd7ecc 100644 --- a/xchange-bitfinex/pom.xml +++ b/xchange-bitfinex/pom.xml @@ -29,10 +29,7 @@ xchange-core ${project.version} - - org.projectlombok - lombok - + diff --git a/xchange-bitmex/pom.xml b/xchange-bitmex/pom.xml index edd42eb7ef3..4a9b3809b2f 100755 --- a/xchange-bitmex/pom.xml +++ b/xchange-bitmex/pom.xml @@ -35,9 +35,6 @@ com.google.guava guava - - org.projectlombok - lombok - + diff --git a/xchange-bitstamp/pom.xml b/xchange-bitstamp/pom.xml index 1998f2321c5..8e3004aa9cf 100644 --- a/xchange-bitstamp/pom.xml +++ b/xchange-bitstamp/pom.xml @@ -24,12 +24,6 @@ - - org.projectlombok - lombok - provided - - org.knowm.xchange xchange-core diff --git a/xchange-bittrex/pom.xml b/xchange-bittrex/pom.xml index 6540d86bb36..bf13dccc6a2 100644 --- a/xchange-bittrex/pom.xml +++ b/xchange-bittrex/pom.xml @@ -34,10 +34,7 @@ com.github.tomakehurst wiremock-jre8 - - org.projectlombok - lombok - + diff --git a/xchange-blockchain/pom.xml b/xchange-blockchain/pom.xml index 38bcbb09134..6da4d450e4e 100644 --- a/xchange-blockchain/pom.xml +++ b/xchange-blockchain/pom.xml @@ -29,10 +29,7 @@ xchange-core ${project.version} - - org.projectlombok - lombok - + com.github.tomakehurst wiremock-jre8 diff --git a/xchange-bybit/pom.xml b/xchange-bybit/pom.xml index 559ac72ee8d..3a4c4d301dc 100644 --- a/xchange-bybit/pom.xml +++ b/xchange-bybit/pom.xml @@ -25,12 +25,6 @@ - - org.projectlombok - lombok - provided - - org.knowm.xchange xchange-core diff --git a/xchange-coinbase/pom.xml b/xchange-coinbase/pom.xml index 54a995b0761..af39f7f0f78 100644 --- a/xchange-coinbase/pom.xml +++ b/xchange-coinbase/pom.xml @@ -29,10 +29,7 @@ xchange-core ${project.version} - - org.projectlombok - lombok - + diff --git a/xchange-coinbasepro/pom.xml b/xchange-coinbasepro/pom.xml index d8029fdc581..749879296f1 100644 --- a/xchange-coinbasepro/pom.xml +++ b/xchange-coinbasepro/pom.xml @@ -35,11 +35,6 @@ wiremock-jre8 - - org.projectlombok - lombok - - diff --git a/xchange-coincheck/pom.xml b/xchange-coincheck/pom.xml index 07b315a8765..4ce1cfd3e26 100644 --- a/xchange-coincheck/pom.xml +++ b/xchange-coincheck/pom.xml @@ -29,11 +29,6 @@ xchange-core ${project.version} - - org.projectlombok - lombok - 1.18.22 - diff --git a/xchange-core/pom.xml b/xchange-core/pom.xml index 2dee536dd05..1c2fe98a13a 100644 --- a/xchange-core/pom.xml +++ b/xchange-core/pom.xml @@ -56,10 +56,5 @@ test - - org.projectlombok - lombok - - diff --git a/xchange-cryptowatch/pom.xml b/xchange-cryptowatch/pom.xml index e0dba36114f..fce45a676c1 100644 --- a/xchange-cryptowatch/pom.xml +++ b/xchange-cryptowatch/pom.xml @@ -30,11 +30,6 @@ ${project.version} - - org.projectlombok - lombok - - diff --git a/xchange-deribit/pom.xml b/xchange-deribit/pom.xml index c675f113867..b1a13b5df07 100644 --- a/xchange-deribit/pom.xml +++ b/xchange-deribit/pom.xml @@ -30,9 +30,6 @@ xchange-core ${project.version} - - org.projectlombok - lombok - + diff --git a/xchange-dydx/pom.xml b/xchange-dydx/pom.xml index c970a112b35..458d0e761a7 100644 --- a/xchange-dydx/pom.xml +++ b/xchange-dydx/pom.xml @@ -12,11 +12,7 @@ xchange-dydx - - org.projectlombok - lombok - provided - + org.knowm.xchange xchange-core diff --git a/xchange-enigma/pom.xml b/xchange-enigma/pom.xml index 536a30120cb..2963a5d93fc 100644 --- a/xchange-enigma/pom.xml +++ b/xchange-enigma/pom.xml @@ -28,10 +28,6 @@ xchange-core ${project.version} - - org.projectlombok - lombok - compile - + \ No newline at end of file diff --git a/xchange-examples/pom.xml b/xchange-examples/pom.xml index b83acfbc78a..997bf9a00f5 100755 --- a/xchange-examples/pom.xml +++ b/xchange-examples/pom.xml @@ -362,6 +362,7 @@ xchange-deribit ${project.version} + diff --git a/xchange-ftx/pom.xml b/xchange-ftx/pom.xml index d84287ad366..6c1692ff200 100644 --- a/xchange-ftx/pom.xml +++ b/xchange-ftx/pom.xml @@ -24,11 +24,6 @@ ${project.version} - - org.projectlombok - lombok - - \ No newline at end of file diff --git a/xchange-gateio/pom.xml b/xchange-gateio/pom.xml index 7578e8343d7..c1703304be8 100644 --- a/xchange-gateio/pom.xml +++ b/xchange-gateio/pom.xml @@ -36,12 +36,6 @@ test - - org.projectlombok - lombok - provided - - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/xchange-gemini/pom.xml b/xchange-gemini/pom.xml index c49ea50a21d..14b04317fac 100644 --- a/xchange-gemini/pom.xml +++ b/xchange-gemini/pom.xml @@ -33,10 +33,7 @@ com.github.tomakehurst wiremock-jre8 - - org.projectlombok - lombok - + diff --git a/xchange-kraken/pom.xml b/xchange-kraken/pom.xml index e66fb61e2de..45ede20f403 100644 --- a/xchange-kraken/pom.xml +++ b/xchange-kraken/pom.xml @@ -29,10 +29,7 @@ xchange-core ${project.version} - - org.projectlombok - lombok - + com.github.tomakehurst wiremock-jre8 diff --git a/xchange-krakenfutures/pom.xml b/xchange-krakenfutures/pom.xml index 4f00d0f9aff..abf75c4bbe1 100644 --- a/xchange-krakenfutures/pom.xml +++ b/xchange-krakenfutures/pom.xml @@ -29,10 +29,7 @@ xchange-core ${project.version} - - org.projectlombok - lombok - + diff --git a/xchange-kucoin/pom.xml b/xchange-kucoin/pom.xml index 253d0a7c20a..5601fc086e4 100644 --- a/xchange-kucoin/pom.xml +++ b/xchange-kucoin/pom.xml @@ -28,10 +28,7 @@ xchange-core ${project.version} - - org.projectlombok - lombok - + com.google.guava guava diff --git a/xchange-lgo/pom.xml b/xchange-lgo/pom.xml index 21dd723e5a8..22509aecf09 100644 --- a/xchange-lgo/pom.xml +++ b/xchange-lgo/pom.xml @@ -23,11 +23,7 @@ - - org.projectlombok - lombok - provided - + org.knowm.xchange xchange-core diff --git a/xchange-mexc/pom.xml b/xchange-mexc/pom.xml index 64bb9ec9449..ba80e3d2729 100644 --- a/xchange-mexc/pom.xml +++ b/xchange-mexc/pom.xml @@ -25,12 +25,6 @@ - - org.projectlombok - lombok - provided - - org.knowm.xchange xchange-core diff --git a/xchange-okcoin/pom.xml b/xchange-okcoin/pom.xml index d3ee6f79348..2bfb2cf4223 100644 --- a/xchange-okcoin/pom.xml +++ b/xchange-okcoin/pom.xml @@ -28,10 +28,7 @@ xchange-core ${project.version} - - org.projectlombok - lombok - + diff --git a/xchange-okex/pom.xml b/xchange-okex/pom.xml index b3ce7aa8f0b..75244922842 100644 --- a/xchange-okex/pom.xml +++ b/xchange-okex/pom.xml @@ -25,12 +25,6 @@ - - org.projectlombok - lombok - provided - - org.knowm.xchange xchange-core diff --git a/xchange-simulated/pom.xml b/xchange-simulated/pom.xml index 81a98408ef2..a537c2eeb74 100644 --- a/xchange-simulated/pom.xml +++ b/xchange-simulated/pom.xml @@ -32,10 +32,7 @@ com.google.guava guava - - org.projectlombok - lombok - + org.mockito mockito-core diff --git a/xchange-stream-binance/pom.xml b/xchange-stream-binance/pom.xml index 68b04047490..5e1eb990e06 100644 --- a/xchange-stream-binance/pom.xml +++ b/xchange-stream-binance/pom.xml @@ -28,10 +28,7 @@ xchange-binance ${project.parent.version} - - org.projectlombok - lombok - + com.google.guava guava diff --git a/xchange-stream-bitmex/pom.xml b/xchange-stream-bitmex/pom.xml index 11fbf15628a..d41adb8c405 100644 --- a/xchange-stream-bitmex/pom.xml +++ b/xchange-stream-bitmex/pom.xml @@ -22,7 +22,7 @@ maven-surefire-plugin - 3.0.0-M7 + 3.0.0 **/*IT.java @@ -38,7 +38,7 @@ maven-surefire-plugin - 3.0.0-M7 + 3.0.0 **/*IT.java diff --git a/xchange-stream-coincheck/pom.xml b/xchange-stream-coincheck/pom.xml index 0fe36e10b89..4b61813b494 100644 --- a/xchange-stream-coincheck/pom.xml +++ b/xchange-stream-coincheck/pom.xml @@ -32,11 +32,7 @@ org.mockito mockito-core - - org.projectlombok - lombok - 1.18.22 - + diff --git a/xchange-stream-dydx/pom.xml b/xchange-stream-dydx/pom.xml index 2293b980f6e..bc35901c74e 100644 --- a/xchange-stream-dydx/pom.xml +++ b/xchange-stream-dydx/pom.xml @@ -21,11 +21,7 @@ xchange-dydx ${project.parent.version} - - org.projectlombok - lombok - ${version.lombok} - + \ No newline at end of file diff --git a/xchange-stream-gateio/pom.xml b/xchange-stream-gateio/pom.xml index a3eab646462..c182194bf67 100644 --- a/xchange-stream-gateio/pom.xml +++ b/xchange-stream-gateio/pom.xml @@ -21,10 +21,6 @@ xchange-gateio ${project.parent.version} - - org.projectlombok - lombok - ${version.lombok} - + \ No newline at end of file diff --git a/xchange-stream-krakenfutures/pom.xml b/xchange-stream-krakenfutures/pom.xml index a57cf1f7e78..e7f032843d9 100644 --- a/xchange-stream-krakenfutures/pom.xml +++ b/xchange-stream-krakenfutures/pom.xml @@ -24,10 +24,7 @@ ${project.parent.version} compile - - org.projectlombok - lombok - + diff --git a/xchange-stream-kucoin/pom.xml b/xchange-stream-kucoin/pom.xml index 64f9dd498e6..33beba770dd 100644 --- a/xchange-stream-kucoin/pom.xml +++ b/xchange-stream-kucoin/pom.xml @@ -32,9 +32,6 @@ com.google.guava guava - - org.projectlombok - lombok - + \ No newline at end of file diff --git a/xchange-stream-okcoin/pom.xml b/xchange-stream-okcoin/pom.xml index ff8ed4ff017..7f58e7b7054 100644 --- a/xchange-stream-okcoin/pom.xml +++ b/xchange-stream-okcoin/pom.xml @@ -38,12 +38,5 @@ ${project.parent.version} - - - org.projectlombok - lombok - ${version.lombok} - provided - \ No newline at end of file diff --git a/xchange-stream-okex/pom.xml b/xchange-stream-okex/pom.xml index 9b7ec6534ce..a39c5812218 100644 --- a/xchange-stream-okex/pom.xml +++ b/xchange-stream-okex/pom.xml @@ -33,13 +33,6 @@ ${project.parent.version} - - - org.projectlombok - lombok - ${version.lombok} - provided - diff --git a/xchange-tradeogre/pom.xml b/xchange-tradeogre/pom.xml index 2d7fe0448e2..589941b3ad5 100644 --- a/xchange-tradeogre/pom.xml +++ b/xchange-tradeogre/pom.xml @@ -29,12 +29,6 @@ ${project.version} - - org.projectlombok - lombok - compile - -