Skip to content

Commit 1ac745b

Browse files
committed
reformat and prepare for 5.2.4 release
1 parent 04912e0 commit 1ac745b

File tree

76 files changed

+1085
-1088
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1085
-1088
lines changed

CONTRIBUTORS

Lines changed: 241 additions & 224 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ Add the following dependencies in your pom.xml file. You will need at least xcha
166166
<dependency>
167167
<groupId>org.knowm.xchange</groupId>
168168
<artifactId>xchange-core</artifactId>
169-
<version>5.2.3</version>
169+
<version>5.2.4</version>
170170
</dependency>
171171
<dependency>
172172
<groupId>org.knowm.xchange</groupId>
173173
<artifactId>xchange-XYZ</artifactId>
174-
<version>5.2.3</version>
174+
<version>5.2.4</version>
175175
</dependency>
176176
```
177177

@@ -181,7 +181,7 @@ If it is available for your exchange, you may also want to use the streaming API
181181
<dependency>
182182
<groupId>org.knowm.xchange</groupId>
183183
<artifactId>xchange-stream-XYZ</artifactId>
184-
<version>5.2.3</version>
184+
<version>5.2.4</version>
185185
</dependency>
186186
```
187187

@@ -203,7 +203,7 @@ For snapshots, add the following repository to your pom.xml file.
203203

204204
The current snapshot version is:
205205

206-
5.2.4-SNAPSHOT
206+
5.2.5-SNAPSHOT
207207

208208
## Building with Maven
209209

xchange-binance/src/main/java/org/knowm/xchange/binance/BinanceExchange.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package org.knowm.xchange.binance;
22

3+
import static org.knowm.xchange.binance.dto.ExchangeType.SPOT;
4+
5+
import java.util.Map;
36
import org.apache.commons.lang3.ObjectUtils;
47
import org.knowm.xchange.BaseExchange;
58
import org.knowm.xchange.Exchange;
@@ -17,10 +20,6 @@
1720
import org.knowm.xchange.utils.AuthUtils;
1821
import si.mazi.rescu.SynchronizedValueFactory;
1922

20-
import java.util.Map;
21-
22-
import static org.knowm.xchange.binance.dto.ExchangeType.SPOT;
23-
2423
public class BinanceExchange extends BaseExchange implements Exchange {
2524

2625
public static String EXCHANGE_TYPE = "Exchange_Type";
@@ -96,10 +95,10 @@ public boolean isFuturesEnabled() {
9695
exchangeSpecification.getExchangeSpecificParametersItem(EXCHANGE_TYPE));
9796
}
9897

99-
public boolean isSpotEnabled() {
100-
return ExchangeType.SPOT.equals(
101-
exchangeSpecification.getExchangeSpecificParametersItem(EXCHANGE_TYPE));
102-
}
98+
public boolean isSpotEnabled() {
99+
return ExchangeType.SPOT.equals(
100+
exchangeSpecification.getExchangeSpecificParametersItem(EXCHANGE_TYPE));
101+
}
103102

104103
public boolean isPortfolioMarginEnabled() {
105104
return ExchangeType.PORTFOLIO_MARGIN.equals(

xchange-binance/src/main/java/org/knowm/xchange/binance/BinanceResilience.java

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package org.knowm.xchange.binance;
22

33
import io.github.resilience4j.ratelimiter.RateLimiterConfig;
4-
import org.knowm.xchange.client.ResilienceRegistries;
5-
64
import java.time.Duration;
5+
import org.knowm.xchange.client.ResilienceRegistries;
76

87
public final class BinanceResilience {
98

@@ -39,22 +38,22 @@ public static ResilienceRegistries createRegistries() {
3938
.limitRefreshPeriod(Duration.ofSeconds(1))
4039
.limitForPeriod(10)
4140
.build());
42-
registries
43-
.rateLimiters()
44-
.rateLimiter(
45-
ORDERS_PER_10_SECONDS_RATE_LIMITER,
46-
RateLimiterConfig.from(registries.rateLimiters().getDefaultConfig())
47-
.limitRefreshPeriod(Duration.ofSeconds(10))
48-
.limitForPeriod(100)
49-
.build());
50-
registries
51-
.rateLimiters()
52-
.rateLimiter(
53-
ORDERS_PER_DAY_RATE_LIMITER,
54-
RateLimiterConfig.from(registries.rateLimiters().getDefaultConfig())
55-
.limitRefreshPeriod(Duration.ofSeconds(1))
56-
.limitForPeriod(200000)
57-
.build());
41+
registries
42+
.rateLimiters()
43+
.rateLimiter(
44+
ORDERS_PER_10_SECONDS_RATE_LIMITER,
45+
RateLimiterConfig.from(registries.rateLimiters().getDefaultConfig())
46+
.limitRefreshPeriod(Duration.ofSeconds(10))
47+
.limitForPeriod(100)
48+
.build());
49+
registries
50+
.rateLimiters()
51+
.rateLimiter(
52+
ORDERS_PER_DAY_RATE_LIMITER,
53+
RateLimiterConfig.from(registries.rateLimiters().getDefaultConfig())
54+
.limitRefreshPeriod(Duration.ofSeconds(1))
55+
.limitForPeriod(200000)
56+
.build());
5857
registries
5958
.rateLimiters()
6059
.rateLimiter(

xchange-binance/src/test/java/org/knowm/xchange/binance/AbstractResilienceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package org.knowm.xchange.binance;
22

3+
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
4+
35
import com.github.tomakehurst.wiremock.junit.WireMockRule;
46
import org.junit.Rule;
57
import org.knowm.xchange.ExchangeFactory;
68
import org.knowm.xchange.ExchangeSpecification;
79

8-
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
9-
1010
public class AbstractResilienceTest {
1111

1212
@Rule public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort());

xchange-binance/src/test/java/org/knowm/xchange/binance/service/trade/TradeServiceResilienceTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
package org.knowm.xchange.binance.service.trade;
22

3+
import static com.github.tomakehurst.wiremock.client.WireMock.*;
4+
import static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED;
5+
import static org.assertj.core.api.Assertions.assertThat;
6+
import static org.assertj.core.api.Assertions.catchThrowable;
7+
8+
import java.io.IOException;
39
import org.junit.Test;
410
import org.knowm.xchange.binance.AbstractResilienceTest;
511
import org.knowm.xchange.binance.BinanceAdapters;
@@ -10,13 +16,6 @@
1016
import org.knowm.xchange.service.trade.params.orders.OpenOrdersParamInstrument;
1117
import org.knowm.xchange.service.trade.params.orders.OpenOrdersParams;
1218

13-
import java.io.IOException;
14-
15-
import static com.github.tomakehurst.wiremock.client.WireMock.*;
16-
import static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED;
17-
import static org.assertj.core.api.Assertions.assertThat;
18-
import static org.assertj.core.api.Assertions.catchThrowable;
19-
2019
public class TradeServiceResilienceTest extends AbstractResilienceTest {
2120

2221
@Test

xchange-bybit/src/main/java/org/knowm/xchange/bybit/BybitResilience.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public class BybitResilience {
4242
public static final String BATCH_ORDER_CANCEL_SPOT_RATE_LIMITER = "batchOrderCancelSpot";
4343
public static final String BATCH_ORDER_CANCEL_OPTION_LIMITER = "batchOrderCancelOption";
4444

45-
4645
// /v5/position/set-leverage
4746
public static final String POSITION_SET_LEVERAGE_INVERSE_RATE_LIMITER =
4847
"positionSetLeverageInverse";

xchange-bybit/src/main/java/org/knowm/xchange/bybit/dto/trade/BybitCancelOrderParams.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public BybitCancelOrderParams(Instrument instrument, String orderId, String user
1818
this.userReference = userReference;
1919
}
2020

21-
2221
@Override
2322
public String toString() {
2423
return "BybitCancelOrderParams{"

xchange-bybit/src/test/java/org/knowm/xchange/bybit/BybitAdaptersTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ public void testConvertToInstrument() {
5656
.isEqualTo(new FuturesContract("ETH/USDC/PERP"));
5757
assertThat(convertBybitSymbolToInstrument("ETH-02FEB24", BybitCategory.LINEAR))
5858
.isEqualTo(new FuturesContract("ETH/USDC/02FEB24"));
59-
assertThat(
60-
convertBybitSymbolToInstrument("ETHUSDT-02FEB24", BybitCategory.LINEAR))
59+
assertThat(convertBybitSymbolToInstrument("ETHUSDT-02FEB24", BybitCategory.LINEAR))
6160
.isEqualTo(new FuturesContract("ETH/USDT/02FEB24"));
6261
assertThat(convertBybitSymbolToInstrument("ETHUSDH24", BybitCategory.INVERSE))
6362
.isEqualTo(new FuturesContract("ETH/USD/H24"));

0 commit comments

Comments
 (0)