Skip to content

Commit babc3ad

Browse files
author
方佳
committed
Merge branch 'main_merge_250104' into 'main'
feat: Added support for webull JP client v2 API, currently limited to webull jp CASH accounts. See merge request webull/openapi-java-sdk!10
2 parents 5aa77ff + 4607af8 commit babc3ad

File tree

4 files changed

+220
-0
lines changed

4 files changed

+220
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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.trade.api.response;
17+
18+
19+
20+
public class CommonPositionInfo {
21+
22+
/**
23+
* 单腿ID
24+
*/
25+
private String itemId;
26+
27+
28+
/**
29+
* 方向:买为BUY,卖为SELL
30+
*/
31+
private String side;
32+
33+
/**
34+
* 数量
35+
*/
36+
private String quantity;
37+
38+
/**
39+
* symbol
40+
*/
41+
private String symbol;
42+
43+
/**
44+
* 成本价
45+
*/
46+
private String costPrice;
47+
48+
/**
49+
* 持仓盈亏
50+
*/
51+
private String unrealizedProfitLoss;
52+
53+
/**
54+
* 税收类型,非通用,日本地区,枚举类型【GENERAL】
55+
* JP
56+
*/
57+
private String accountTaxType;
58+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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.trade.api.response;
17+
18+
public class JPAccountAssetInfo {
19+
20+
/**
21+
* 币种,取值参考字典值 CurrencyEnum
22+
*/
23+
private String currency;
24+
25+
/**
26+
* 现金余额,币种为currency字段值,单位元,精确到小数点后2位
27+
*/
28+
private String cashBalance;
29+
30+
/**
31+
* unsettledCash,币种为currency字段值,单位元,精确到小数点后2位
32+
*/
33+
private String unsettledCash;
34+
35+
/**
36+
* 购买力,币种为currency字段值,单位元,精确到小数点后2位
37+
*/
38+
private String buyingPower;
39+
40+
/**
41+
* 持仓盈亏
42+
*/
43+
private String unrealizedProfitLoss;
44+
45+
46+
@Override
47+
public String toString() {
48+
return "JPAccountAssetInfo{" +
49+
"currency='" + currency + '\'' +
50+
", cashBalance='" + cashBalance + '\'' +
51+
", unsettledCash='" + unsettledCash + '\'' +
52+
", buyingPower='" + buyingPower + '\'' +
53+
", unrealizedProfitLoss='" + unrealizedProfitLoss + '\'' +
54+
'}';
55+
}
56+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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.trade.api.response;
17+
18+
import java.util.List;
19+
20+
21+
public class JPAccountBalanceInfo{
22+
23+
/**
24+
* 总资产计价币种
25+
*/
26+
private String totalAssetCurrency;
27+
28+
/**
29+
* 现金总额,币种为totalAssetCurrency字段值,单位元。
30+
* totalCashBalance=sum(cashBalance*汇率)
31+
*/
32+
private String totalCashBalance;
33+
34+
/**
35+
* 持仓盈亏
36+
*/
37+
private String totalUnrealizedProfitLoss;
38+
39+
/**
40+
* 资产明细
41+
*/
42+
private List<JPAccountAssetInfo> accountCurrencyAssets;
43+
44+
@Override
45+
public String toString() {
46+
return "JPAccountBalanceInfo{" +
47+
"totalAssetCurrency='" + totalAssetCurrency + '\'' +
48+
", totalCashBalance='" + totalCashBalance + '\'' +
49+
", totalUnrealizedProfitLoss='" + totalUnrealizedProfitLoss + '\'' +
50+
", accountCurrencyAssets=" + accountCurrencyAssets +
51+
'}';
52+
}
53+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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.trade.api.response;
17+
18+
import java.util.List;
19+
20+
21+
public class JPAccountPositionsInfo {
22+
23+
/**
24+
* 持仓id
25+
*/
26+
private String positionId;
27+
28+
29+
/**
30+
* 数量
31+
*/
32+
private String quantity;
33+
34+
/**
35+
* 成本价
36+
*/
37+
private String costPrice;
38+
39+
/**
40+
* 持仓盈亏
41+
*/
42+
private String unrealizedProfitLoss;
43+
44+
/**
45+
* 浮动盈亏率 scale = 4
46+
*/
47+
private String unrealizedProfitLossRate;
48+
49+
/**
50+
* 持仓明细
51+
*/
52+
private List<CommonPositionInfo> items;
53+
}

0 commit comments

Comments
 (0)