Skip to content

Commit e0aed7a

Browse files
author
方佳
committed
Merge branch 'main_merge_1026' into 'main'
feat: support Webull JP See merge request webull/openapi-java-sdk!3
2 parents 769afe1 + c36e28f commit e0aed7a

41 files changed

Lines changed: 1444 additions & 54 deletions

File tree

Some content is hidden

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

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-java-sdk</artifactId>
2323
<packaging>pom</packaging>
24-
<version>0.2.6</version>
24+
<version>0.2.7</version>
2525

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

webull-java-sdk-core/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-java-sdk</artifactId>
22-
<version>0.2.6</version>
22+
<version>0.2.7</version>
2323
</parent>
2424

2525
<modelVersion>4.0.0</modelVersion>

webull-java-sdk-core/src/main/java/com/webull/openapi/auth/composer/DefaultSignatureComposer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private static String buildSignString(Map<String, String> signParams, String uri
7878
signString = signString + PARAMS_JOIN + payload;
7979
}
8080
try {
81-
return URLEncoder.encode(signString, StandardCharsets.UTF_8.toString());
81+
return URLEncoder.encode(signString, StandardCharsets.UTF_8.toString()).replaceAll("\\+", "%20");
8282
} catch (UnsupportedEncodingException e) {
8383
throw new ClientException(ErrorCode.NOT_SUPPORT, e);
8484
}

webull-java-sdk-core/src/main/java/com/webull/openapi/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),
24+
API(DefaultHost.API_US, DefaultHost.API_HK, DefaultHost.API_JP),
2525
/**
2626
* quotes api
2727
*/
28-
QUOTES(DefaultHost.QUOTES_US, DefaultHost.QUOTES_HK),
28+
QUOTES(DefaultHost.QUOTES_US, DefaultHost.QUOTES_HK, DefaultHost.QUOTES_JP),
2929
/**
3030
* events api
3131
*/
32-
EVENTS(DefaultHost.EVENTS_US, DefaultHost.EVENTS_HK);
32+
EVENTS(DefaultHost.EVENTS_US, DefaultHost.EVENTS_HK, DefaultHost.EVENTS_JP);
3333

3434
private final EnumMap<Region, String> hosts;
3535

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ private DefaultHost() {}
2626
public static final String API_HK = "api.webull.hk";
2727
public static final String QUOTES_HK = "quotes-api.webull.hk";
2828
public static final String EVENTS_HK = "events-api.webull.hk";
29+
30+
public static final String API_JP = "api.webull.co.jp";
31+
public static final String QUOTES_JP = "";
32+
public static final String EVENTS_JP = "events-api.webull.co.jp";
2933
}

webull-java-sdk-core/src/main/java/com/webull/openapi/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;
22+
us, hk, jp;
2323

2424
public static Optional<Region> of(String name) {
2525
for (Region region : Region.values()) {
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright 2022 Webull
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webull.openapi.common.dict;
17+
18+
public enum EventSource {
19+
20+
/**
21+
* IHS
22+
*/
23+
IHS,
24+
25+
/**
26+
* EDI
27+
*/
28+
EDI,
29+
30+
/**
31+
* ICE
32+
*/
33+
ICE,
34+
35+
/**
36+
* Webull artificial
37+
*/
38+
WEBULL_ARTIFICIAL,
39+
40+
/**
41+
* OTC official web
42+
*/
43+
OTC_OFFICIAL_WEB,
44+
45+
/**
46+
* CCASS
47+
*/
48+
SOURCE,
49+
50+
/**
51+
* Webull auditor
52+
*/
53+
WEBULL_AUDITOR,
54+
55+
/**
56+
* JYDB
57+
*/
58+
SOURCE_NAME_JY_DB,
59+
60+
/**
61+
* Other
62+
*/
63+
WEB
64+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2022 Webull
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webull.openapi.common.dict;
17+
18+
public enum EventStatus {
19+
20+
/**
21+
* Valid
22+
*/
23+
I,
24+
25+
/**
26+
* Valid
27+
*/
28+
U,
29+
30+
/**
31+
* Cancellation,invalid
32+
*/
33+
C,
34+
35+
/**
36+
* Deletion,invalid
37+
*/
38+
D
39+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2022 Webull
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webull.openapi.common.dict;
17+
18+
public enum EventType {
19+
20+
Reverse_Stock_Split("301"),
21+
22+
Stock_Split("302");
23+
24+
private final String code;
25+
26+
EventType(String code) {
27+
this.code = code;
28+
}
29+
30+
public String getCode() {
31+
return code;
32+
}
33+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2022 Webull
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webull.openapi.common.dict;
17+
18+
public enum MarginType {
19+
20+
/**
21+
* The customer's open position needs to be closed on the same day.
22+
* That's the intraday margin.
23+
*/
24+
ONE_DAY,
25+
26+
/**
27+
* Customers can open positions overnight using unlimited margin.
28+
*/
29+
INDEFINITE
30+
}

0 commit comments

Comments
 (0)