Skip to content

Commit 1ef80ba

Browse files
author
方佳
committed
Merge branch 'main_merge_260613_001' into 'main'
feat: Add support for Webull ZA、EU,Update proeprty trailing_limit_price See merge request webull/webull-openapi-java-sdk!35
2 parents fa2f789 + 0554ee4 commit 1ef80ba

14 files changed

Lines changed: 67 additions & 69 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Webull OpenAPI Java SDK
22

3-
Note: This is the new version of the Webull SDK, currently applicable only to Webull Hong Kong, Webull US, Webull JP, Webull SG, Webull TH, Webull AU, Webull MY, Webull UK, Webull BR, or Webull MX customers.
3+
Note: This is the new version of the Webull SDK, currently applicable only to Webull Hong Kong, Webull US, Webull JP, Webull SG, Webull TH, Webull AU, Webull MY, Webull UK, Webull BR, Webull MX, Webull ZA, or Webull EU customers.
44

55
Webull OpenAPI aims to provide quantitative trading investors with convenient, fast and secure services. Webull aims to help every quant traders achieve flexible and changeable trading or market strategies.
66

@@ -30,6 +30,8 @@ Subscription to real-time information: Subscribe to order status changes, market
3030
| Webull UK | https://www.webull-uk.com/open-api-management |
3131
| Webull BR | https://www.webull.com.br/open-api-management |
3232
| Webull MX | https://www.webull.com.mx/open-api-management |
33+
| Webull ZA | https://www.webull.co.za/open-api-management |
34+
| Webull EU | https://www.webull.eu/open-api-management |
3335

3436
- Requires JDK 8 and above.
3537

@@ -57,3 +59,5 @@ The bottom layer of Webull OpenAPI provides three protocols, HTTP / GRPC / MQTT,
5759
| Webull UK | https://developer.webull-uk.com/apis/docs |
5860
| Webull BR | https://developer.webull.com.br/apis/docs |
5961
| Webull MX | https://developer.webull.com.mx/apis/docs |
62+
| Webull ZA | https://developer.webull.co.za/apis/docs |
63+
| Webull EU | https://developer.webull.eu/apis/docs |

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<groupId>com.webull.openapi</groupId>
2222
<artifactId>webull-openapi-java-sdk-parent</artifactId>
2323
<packaging>pom</packaging>
24-
<version>1.1.12</version>
24+
<version>1.1.13</version>
2525

2626
<name>webull-openapi-java-sdk-parent</name>
2727
<url>https://github.com/webull-inc/webull-openapi-java-sdk/</url>

‎webull-openapi-java-sdk-samples/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>com.webull.openapi</groupId>
2121
<artifactId>webull-openapi-java-sdk-parent</artifactId>
22-
<version>1.1.12</version>
22+
<version>1.1.13</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

‎webull-openapi-java-sdk-samples/src/main/java/com/webull/openapi/samples/trade/TradeClientV3.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ private static void runTrailingStopLossLimitComboOrderExample(com.webull.openapi
769769
trailingStopLossLimitOrderItem.setOrderType(OrderType.TRAILING_STOP_LOSS_LIMIT.name());
770770
trailingStopLossLimitOrderItem.setQuantity("200");
771771
trailingStopLossLimitOrderItem.setTrailingStopStep("0.1");
772-
trailingStopLossLimitOrderItem.setTrailingLimitPrice("580");
772+
trailingStopLossLimitOrderItem.setTrailingLimitPriceOffset("580");
773773
trailingStopLossLimitOrderItem.setTrailingType(TrailingType.PERCENTAGE.name());
774774
trailingStopLossLimitOrderItem.setSupportTradingSession("CORE");
775775
trailingStopLossLimitOrderItem.setSide(OrderSide.BUY.name());
@@ -793,7 +793,7 @@ private static void runTrailingStopLossLimitComboOrderExample(com.webull.openapi
793793
replaceStopLossOrderItem.setStopPrice("560.77");
794794
replaceStopLossOrderItem.setQuantity("200");
795795
replaceStopLossOrderItem.setTrailingStopStep("0.15");
796-
replaceStopLossOrderItem.setTrailingLimitPrice("581");
796+
replaceStopLossOrderItem.setTrailingLimitPriceOffset("581");
797797
replaceStopLossOrderItem.setTrailingType(TrailingType.PERCENTAGE.name());
798798
replaceStopLossOrderItem.setTriggerPriceType(TriggerPriceTypes.PRICE.name());
799799
replaceStopLossOrders.add(replaceStopLossOrderItem);

‎webull-openapi-java-sdk/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.webull.openapi</groupId>
99
<artifactId>webull-openapi-java-sdk-parent</artifactId>
10-
<version>1.1.12</version>
10+
<version>1.1.13</version>
1111
</parent>
1212

1313
<artifactId>webull-openapi-java-sdk</artifactId>

‎webull-openapi-java-sdk/src/main/java/com/webull/openapi/core/common/ApiModule.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ public enum ApiModule {
2323
*/
2424
API(DefaultHost.API_US, DefaultHost.API_HK, DefaultHost.API_JP, DefaultHost.API_SG,
2525
DefaultHost.API_TH, DefaultHost.API_AU, DefaultHost.API_MY, DefaultHost.API_UK,
26-
DefaultHost.API_BR, DefaultHost.API_MX),
26+
DefaultHost.API_BR, DefaultHost.API_MX, DefaultHost.API_ZA, DefaultHost.API_EU),
2727
/**
2828
* quotes api
2929
*/
3030
QUOTES(DefaultHost.QUOTES_US, DefaultHost.QUOTES_HK, DefaultHost.QUOTES_JP, DefaultHost.QUOTES_SG,
3131
DefaultHost.QUOTES_TH, DefaultHost.QUOTES_AU, DefaultHost.QUOTES_MY, DefaultHost.QUOTES_UK,
32-
DefaultHost.QUOTES_BR, DefaultHost.QUOTES_MX),
32+
DefaultHost.QUOTES_BR, DefaultHost.QUOTES_MX, DefaultHost.QUOTES_ZA, DefaultHost.QUOTES_EU),
3333
/**
3434
* events api
3535
*/
3636
EVENTS(DefaultHost.EVENTS_US, DefaultHost.EVENTS_HK, DefaultHost.EVENTS_JP, DefaultHost.EVENTS_SG,
3737
DefaultHost.EVENTS_TH, DefaultHost.EVENTS_AU, DefaultHost.EVENTS_MY, DefaultHost.EVENTS_UK,
38-
DefaultHost.EVENTS_BR, DefaultHost.EVENTS_MX),
38+
DefaultHost.EVENTS_BR, DefaultHost.EVENTS_MX, DefaultHost.EVENTS_ZA, DefaultHost.EVENTS_EU),
3939
;
4040

4141
private final EnumMap<Region, String> hosts;

‎webull-openapi-java-sdk/src/main/java/com/webull/openapi/core/common/DefaultHost.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ private DefaultHost() {}
5959
public static final String QUOTES_MX = "data-api.webull.com";
6060
public static final String EVENTS_MX = "events-api.webull.com";
6161

62+
public static final String API_ZA = "api.webull.com.au";
63+
public static final String QUOTES_ZA = "data-api.webull.com.au";
64+
public static final String EVENTS_ZA = "events-api.webull.com.au";
65+
66+
public static final String API_EU = "api.webull.eu";
67+
public static final String QUOTES_EU = "data-api.webull.eu";
68+
public static final String EVENTS_EU = "events-api.webull.eu";
69+
6270
public static final String API_HK_SANDBOX = "api.sandbox.webull.hk";
6371
public static final String EVENTS_HK_SANDBOX = "events-api.sandbox.webull.hk";
6472

‎webull-openapi-java-sdk/src/main/java/com/webull/openapi/core/common/Region.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
public enum Region {
2121

22-
us, hk, jp, sg, th, au, my, uk, br, mx;
22+
us, hk, jp, sg, th, au, my, uk, br, mx, za, eu;
2323

2424
public static Optional<Region> of(String name) {
2525
for (Region region : Region.values()) {

‎webull-openapi-java-sdk/src/main/java/com/webull/openapi/core/config/ProjectReaderHelper.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private ProjectReaderHelper() {
2424

2525
private static final String APPLICATION_VERSION = "application.version";
2626

27-
private static final String DEFAULT_APPLICATION_VERSION = "1.1.12";
27+
private static final String DEFAULT_APPLICATION_VERSION = "1.1.13";
2828

2929
private static final String APPLICATION_NAME = "application.name";
3030

‎webull-openapi-java-sdk/src/main/java/com/webull/openapi/core/http/initializer/ClientInitializer.java‎

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package com.webull.openapi.core.http.initializer;
1717

18-
import com.webull.openapi.core.common.Region;
1918
import com.webull.openapi.core.exception.ClientException;
2019
import com.webull.openapi.core.exception.ErrorCode;
2120
import com.webull.openapi.core.http.HttpApiClient;
@@ -24,10 +23,7 @@
2423
import com.webull.openapi.core.http.initializer.token.TokenManager;
2524
import com.webull.openapi.core.logger.Logger;
2625
import com.webull.openapi.core.logger.LoggerFactory;
27-
import com.webull.openapi.core.utils.StringUtils;
2826

29-
import java.util.ArrayList;
30-
import java.util.List;
3127
import java.util.Objects;
3228

3329
public class ClientInitializer {
@@ -48,14 +44,7 @@ public static void init(HttpApiClient apiClient){
4844
*/
4945
private static void initToken(HttpApiClient apiClient){
5046

51-
List<String> disableConfigRegionIds = new ArrayList<>();
52-
disableConfigRegionIds.add(Region.hk.name());
53-
String regionId = Objects.nonNull(apiClient) && Objects.nonNull(apiClient.getConfig()) ? apiClient.getConfig().getRegionId() : null;
54-
if(disableConfigRegionIds.contains(regionId)){
55-
if(!checkRegionTokenEnable(apiClient)){
56-
return;
57-
}
58-
}else if(!checkTokenEnable(apiClient)){
47+
if(!checkTokenEnable(apiClient)){
5948
return;
6049
}
6150

@@ -65,35 +54,6 @@ private static void initToken(HttpApiClient apiClient){
6554

6655
}
6756

68-
/**
69-
* Check whether token checking is enabled in the specified region
70-
* @param apiClient
71-
* @return
72-
*/
73-
private static boolean checkRegionTokenEnable(HttpApiClient apiClient){
74-
if(Objects.isNull(apiClient)){
75-
logger.warn("CheckRegionTokenEnable apiClient is null return false");
76-
return false;
77-
}
78-
79-
if(Objects.isNull(apiClient.getConfig())){
80-
logger.warn("CheckRegionTokenEnable apiConfig is null return false");
81-
return false;
82-
}
83-
84-
if(StringUtils.isBlank(apiClient.getConfig().getRegionId())){
85-
logger.warn("CheckRegionTokenEnable regionId is blank return false");
86-
return false;
87-
}
88-
89-
List<String> enableRegionIds = new ArrayList<>();
90-
enableRegionIds.add(Region.hk.name());
91-
92-
boolean result = enableRegionIds.contains(apiClient.getConfig().getRegionId());
93-
logger.info("CheckRegionTokenEnable result is {}, enable regionIds is {}.", result, enableRegionIds);
94-
return result;
95-
}
96-
9757
/**
9858
* Check whether token checking is enabled
9959
* @param apiClient

0 commit comments

Comments
 (0)