Skip to content

Commit d2914d1

Browse files
author
方佳
committed
Merge branch 'main_merge_2605111' into 'main'
feat:add sg region and fix data api See merge request webull/webull-openapi-java-sdk!29
2 parents 2184439 + 63b6f27 commit d2914d1

10 files changed

Lines changed: 31 additions & 25 deletions

File tree

‎README.md‎

Lines changed: 6 additions & 4 deletions
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, or Webull JP customers.
3+
Note: This is the new version of the Webull SDK, currently applicable only to Webull Hong Kong, Webull US, or Webull JP, or Webull SG 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

@@ -18,11 +18,12 @@ Subscription to real-time information: Subscribe to order status changes, market
1818

1919
- Please first generate the app key and app secret on the Webull official website.
2020

21-
| Broker | Link |
22-
|-----------|-------------------------------------------------|
23-
| Webull HK | https://www.webull.hk/open-api |
21+
| Broker | Link |
22+
|-----------|------------------------------------------------|
23+
| Webull HK | https://www.webull.hk/open-api |
2424
| Webull US | https://www.webull.com/center#openApiManagement |
2525
| Webull JP | https://www.webull.co.jp/center/openapi/manage |
26+
| Webull SG | https://www.webull.com.sg/open-api-management|
2627

2728
- Requires JDK 8 and above.
2829

@@ -43,3 +44,4 @@ The bottom layer of Webull OpenAPI provides three protocols, HTTP / GRPC / MQTT,
4344
| Webull HK | https://developer.webull.hk/apis/docs |
4445
| Webull US | https://developer.webull.com/apis/docs |
4546
| Webull JP | https://developer.webull.co.jp/apis/docs |
47+
| Webull SG | https://developer.webull.com.sg/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.7</version>
24+
<version>1.1.8</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.7</version>
22+
<version>1.1.8</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

‎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.7</version>
10+
<version>1.1.8</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
@@ -21,15 +21,15 @@ public enum ApiModule {
2121
/**
2222
* api
2323
*/
24-
API(DefaultHost.API_US, DefaultHost.API_HK, DefaultHost.API_JP),
24+
API(DefaultHost.API_US, DefaultHost.API_HK, DefaultHost.API_JP,DefaultHost.API_SG),
2525
/**
2626
* quotes api
2727
*/
28-
QUOTES(DefaultHost.QUOTES_US, DefaultHost.QUOTES_HK, DefaultHost.QUOTES_JP),
28+
QUOTES(DefaultHost.QUOTES_US, DefaultHost.QUOTES_HK, DefaultHost.QUOTES_JP,DefaultHost.QUOTES_SG),
2929
/**
3030
* events api
3131
*/
32-
EVENTS(DefaultHost.EVENTS_US, DefaultHost.EVENTS_HK, DefaultHost.EVENTS_JP),
32+
EVENTS(DefaultHost.EVENTS_US, DefaultHost.EVENTS_HK, DefaultHost.EVENTS_JP,DefaultHost.EVENTS_SG),
3333
;
3434

3535
private final EnumMap<Region, String> hosts;

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ private DefaultHost() {}
2828
public static final String EVENTS_HK = "events-api.webull.hk";
2929

3030
public static final String API_JP = "api.webull.co.jp";
31-
public static final String QUOTES_JP = "";
31+
public static final String QUOTES_JP = "data-api.webull.co.jp";
3232
public static final String EVENTS_JP = "events-api.webull.co.jp";
3333

34+
public static final String API_SG = "api.webull.com.sg";
35+
public static final String QUOTES_SG = "data-api.webull.com.sg";
36+
public static final String EVENTS_SG = "events-api.webull.com.sg";
37+
3438
public static final String API_HK_SANDBOX = "api.sandbox.webull.hk";
3539
public static final String EVENTS_HK_SANDBOX = "events-api.sandbox.webull.hk";
3640

‎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;
22+
us, hk, jp,sg;
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.7";
27+
private static final String DEFAULT_APPLICATION_VERSION = "1.1.8";
2828

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

‎webull-openapi-java-sdk/src/main/java/com/webull/openapi/data/quotes/api/subsribe/MarketStreamingClient.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void subscribe(String sessionId, Set<String> symbols, String category, Se
6464
Assert.notBlank(ArgNames.CATEGORY, category);
6565
Assert.notEmpty(ArgNames.SUBTYPES, subTypes);
6666

67-
HttpRequest request = new HttpRequest("/market-data/streaming/subscribe", Versions.V2, HttpMethod.POST);
67+
HttpRequest request = new HttpRequest("/openapi/market-data/streaming/subscribe", Versions.V2, HttpMethod.POST);
6868
Map<String, Object> params = new HashMap<>();
6969
params.put(ArgNames.SESSION_ID, sessionId);
7070
params.put(ArgNames.SYMBOLS, symbols);
@@ -86,7 +86,7 @@ public void unsubscribe(String sessionId, Set<String> symbols, String category,
8686

8787
Assert.notBlank(ArgNames.SESSION_ID, sessionId);
8888

89-
HttpRequest request = new HttpRequest("/market-data/streaming/unsubscribe", Versions.V2, HttpMethod.POST);
89+
HttpRequest request = new HttpRequest("/openapi/market-data/streaming/unsubscribe", Versions.V2, HttpMethod.POST);
9090
Map<String, Object> params = new HashMap<>();
9191
params.put(ArgNames.SESSION_ID, sessionId);
9292

‎webull-openapi-java-sdk/src/main/java/com/webull/openapi/trade/http/ITradeV3Client.java‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
public interface ITradeV3Client {
1010

1111
/**
12-
* This interface is currently supported only for Webull HK, Webull US, and Webull JP.
12+
* This interface is currently supported only for Webull HK, Webull US, Webull SG, and Webull JP.
1313
* Support for other regions will be available in future updates.
1414
*/
1515
List<Account> listAccount();
1616

1717
/**
18-
* This interface is currently supported only for Webull HK, Webull US, and Webull JP.
18+
* This interface is currently supported only for Webull HK, Webull US, Webull SG,and Webull JP.
1919
* Support for other regions will be available in future updates.
2020
*/
2121
AccountBalanceInfo balanceAccount(String accountId);
2222

2323
/**
24-
* This interface is currently supported only for Webull HK, Webull US, and Webull JP.
24+
* This interface is currently supported only for Webull HK, Webull US,Webull SG, and Webull JP.
2525
* Support for other regions will be available in future updates.
2626
*/
2727
List<AccountPositionsInfo> positionsAccount(String accountId);
@@ -33,13 +33,13 @@ public interface ITradeV3Client {
3333
List<AccountPositionDetailsInfo> positionDetailsAccount(String accountId, String instrumentId, Integer pageSize, String lastId);
3434

3535
/**
36-
* This interface is currently supported only for Webull HK, Webull US, and Webull JP.
36+
* This interface is currently supported only for Webull HK, Webull US,Webull SG, and Webull JP.
3737
* Support for other regions will be available in future updates.
3838
*/
3939
PreviewOrderResponse previewOrder(String accountId, TradeOrder tradeOrder);
4040

4141
/**
42-
* This interface is currently supported only for Webull HK, Webull US, and Webull JP.
42+
* This interface is currently supported only for Webull HK, Webull US,Webull SG, and Webull JP.
4343
* Support for other regions will be available in future updates.
4444
*/
4545
TradeOrderResponse placeOrder(String accountId, TradeOrder tradeOrder);
@@ -51,32 +51,32 @@ public interface ITradeV3Client {
5151
TradeBatchPlaceResponse batchPlaceOrder(String accountId, TradeOrder tradeOrder);
5252

5353
/**
54-
* This interface is currently supported only for Webull HK, Webull US, and Webull JP.
54+
* This interface is currently supported only for Webull HK, Webull US, Webull SG,and Webull JP.
5555
* Support for other regions will be available in future updates.
5656
*/
5757
TradeOrderResponse replaceOrder(String accountId, TradeOrder tradeOrder);
5858

5959
/**
60-
* This interface is currently supported only for Webull HK, Webull US, and Webull JP.
60+
* This interface is currently supported only for Webull HK, Webull US,Webull SG, and Webull JP.
6161
* Support for other regions will be available in future updates.
6262
*/
6363
TradeOrderResponse cancelOrder(String accountId, TradeOrder tradeOrder);
6464

6565
/**
66-
* This interface is currently supported only for Webull HK, Webull US, and Webull JP.
66+
* This interface is currently supported only for Webull HK, Webull US, Webull SG,and Webull JP.
6767
* Support for other regions will be available in future updates.
6868
*/
6969
List<OrderHistory> listOrders(String accountId, Integer pageSize, String startDate, String endDate,
7070
String lastClientOrderId);
7171

7272
/**
73-
* This interface is currently supported only for Webull HK, Webull US, and Webull JP.
73+
* This interface is currently supported only for Webull HK, Webull US,Webull SG, and Webull JP.
7474
* Support for other regions will be available in future updates.
7575
*/
7676
List<OrderHistory> openOrders(String accountId, Integer pageSize, String lastClientOrderId);
7777

7878
/**
79-
* This interface is currently supported only for Webull HK, Webull US, and Webull JP.
79+
* This interface is currently supported only for Webull HK, Webull US,Webull SG, and Webull JP.
8080
* Support for other regions will be available in future updates.
8181
*/
8282
OrderHistory getOrderDetails(String accountId, String clientOrderId);

0 commit comments

Comments
 (0)