Skip to content

Commit 5267356

Browse files
Merge branch '2.7.0' into 'master'
2.7.0 Feat(new and update finance endpoints) See merge request exchange/code/sdk/bitmart-java-sdk-api!30
2 parents 84a9ed0 + 32ea967 commit 5267356

21 files changed

Lines changed: 982 additions & 2 deletions

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22
Changelog
33
=========================
44

5+
### v2.7.0 Release
6+
#### New Features
7+
- New
8+
- `/newearn/cloud/v1/earn` Get Savings (Earn) Account Holdings (KEYED)
9+
- `/newearn/cloud/v1/saving/product` Get Flexible Savings Product List (KEYED)
10+
- `/newearn/cloud/v1/saving/subscribe` Subscribe Flexible Savings (SIGNED)
11+
- `/newearn/cloud/v1/saving/redeem` Redeem Flexible Savings (SIGNED)
12+
- `/newearn/cloud/v1/saving/earn` Get Flexible Savings Holdings (KEYED)
13+
- `/newearn/cloud/v1/saving/record` Get Flexible Savings Records (KEYED)
14+
- `/newearn/cloud/v1/saving/fixed/product` Get Fixed Savings Product List (KEYED)
15+
- `/newearn/cloud/v1/saving/fixed/subscribe` Subscribe Fixed Savings (SIGNED)
16+
- `/newearn/cloud/v1/saving/fixed/earn` Get Fixed Savings Holdings (KEYED)
17+
- `/newearn/cloud/v1/saving/fixed/record` Get Fixed Savings Records (KEYED)
18+
- `/newearn/cloud/v1/saving/fixed/redeem` Early-Redeem Fixed Savings (SIGNED)
19+
- `/newearn/cloud/v1/saving/fixed/subscribe/operate` Modify Fixed Savings Auto-Renewal (SIGNED)
20+
- `/newearn/cloud/v1/saving/subscribe/batch/operate` Toggle Global Auto-Earn (SIGNED)
21+
- `/newearn/cloud/v1/saving/subscribe/batch` Get Global Auto-Earn Status (KEYED)
22+
- `/newearn/cloud/v1/saving/subscribe/operate` Toggle Flexible Product Auto-Subscribe (SIGNED)
23+
- `/newearn/cloud/v1/saving/subscribe/status` Get Flexible Product Auto-Subscribe Status (KEYED)
24+
25+
---
26+
527
### v2.6.0 Release
628
#### New Features
729
- New

pom.xml

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

77
<groupId>io.github.bitmartexchange</groupId>
88
<artifactId>bitmart-java-sdk-api</artifactId>
9-
<version>2.6.0</version>
9+
<version>2.7.0</version>
1010
<packaging>jar</packaging>
1111
<name>${project.groupId}:${project.artifactId}</name>
1212
<description>A Java SDK specially used to call BitMart OpenAPI</description>

src/main/java/com/bitmart/api/Call.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public final class Call {
2020

2121
private final CloudContext cloudContext;
2222
private final OkHttpClient okHttpClient;
23-
private static final String USER_AGENT = "bitmart-java-sdk-api/2.6.0";
23+
private static final String USER_AGENT = "bitmart-java-sdk-api/2.7.0";
2424

2525
private static OkHttpClient createOkHttpClient(CloudContext cloudContext) {
2626
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.bitmart.api.request.finance.prv;
2+
3+
import com.bitmart.api.request.Auth;
4+
import com.bitmart.api.request.CloudRequest;
5+
import com.bitmart.api.request.Method;
6+
import lombok.Data;
7+
import lombok.EqualsAndHashCode;
8+
import lombok.ToString;
9+
import lombok.experimental.Accessors;
10+
11+
/**
12+
* Finance — query the savings (Earn) account holdings. No request parameters.
13+
*/
14+
@EqualsAndHashCode(callSuper = true)
15+
@Data
16+
@ToString
17+
@Accessors(chain = true)
18+
public class EarnHoldingsRequest extends CloudRequest {
19+
20+
public EarnHoldingsRequest() {
21+
super("/newearn/cloud/v1/earn", Method.GET, Auth.KEYED);
22+
}
23+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.bitmart.api.request.finance.prv;
2+
3+
import com.bitmart.api.annotations.ParamKey;
4+
import com.bitmart.api.request.Auth;
5+
import com.bitmart.api.request.CloudRequest;
6+
import com.bitmart.api.request.Method;
7+
import lombok.Data;
8+
import lombok.EqualsAndHashCode;
9+
import lombok.ToString;
10+
import lombok.experimental.Accessors;
11+
12+
/**
13+
* Finance — query flexible savings holdings
14+
*/
15+
@EqualsAndHashCode(callSuper = true)
16+
@Data
17+
@ToString
18+
@Accessors(chain = true)
19+
public class SavingEarnRequest extends CloudRequest {
20+
21+
/**
22+
* Filter by coin name (e.g. USDT)
23+
*/
24+
@ParamKey("coinName")
25+
private String coinName;
26+
27+
/**
28+
* Filter by product ID
29+
*/
30+
@ParamKey("productId")
31+
private String productId;
32+
33+
/**
34+
* Current page number
35+
*/
36+
@ParamKey(value = "currentPage", required = true)
37+
private Integer currentPage;
38+
39+
/**
40+
* Records per page, max 100
41+
*/
42+
@ParamKey(value = "sizePage", required = true)
43+
private Integer sizePage;
44+
45+
public SavingEarnRequest() {
46+
super("/newearn/cloud/v1/saving/earn", Method.GET, Auth.KEYED);
47+
}
48+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.bitmart.api.request.finance.prv;
2+
3+
import com.bitmart.api.annotations.ParamKey;
4+
import com.bitmart.api.request.Auth;
5+
import com.bitmart.api.request.CloudRequest;
6+
import com.bitmart.api.request.Method;
7+
import lombok.Data;
8+
import lombok.EqualsAndHashCode;
9+
import lombok.ToString;
10+
import lombok.experimental.Accessors;
11+
12+
/**
13+
* Finance — query fixed savings holdings
14+
*/
15+
@EqualsAndHashCode(callSuper = true)
16+
@Data
17+
@ToString
18+
@Accessors(chain = true)
19+
public class SavingFixedEarnRequest extends CloudRequest {
20+
21+
/**
22+
* Coin name
23+
*/
24+
@ParamKey("coinName")
25+
private String coinName;
26+
27+
/**
28+
* Product ID
29+
*/
30+
@ParamKey("productId")
31+
private String productId;
32+
33+
/**
34+
* Current page number, default 1
35+
*/
36+
@ParamKey(value = "currentPage", required = true)
37+
private Integer currentPage;
38+
39+
/**
40+
* Page size, default 1, max 100
41+
*/
42+
@ParamKey(value = "sizePage", required = true)
43+
private Integer sizePage;
44+
45+
public SavingFixedEarnRequest() {
46+
super("/newearn/cloud/v1/saving/fixed/earn", Method.GET, Auth.KEYED);
47+
}
48+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.bitmart.api.request.finance.prv;
2+
3+
import com.bitmart.api.annotations.ParamKey;
4+
import com.bitmart.api.request.Auth;
5+
import com.bitmart.api.request.CloudRequest;
6+
import com.bitmart.api.request.Method;
7+
import lombok.Data;
8+
import lombok.EqualsAndHashCode;
9+
import lombok.ToString;
10+
import lombok.experimental.Accessors;
11+
12+
/**
13+
* Finance — query the fixed savings product list
14+
*/
15+
@EqualsAndHashCode(callSuper = true)
16+
@Data
17+
@ToString
18+
@Accessors(chain = true)
19+
public class SavingFixedProductRequest extends CloudRequest {
20+
21+
/**
22+
* Coin name
23+
*/
24+
@ParamKey("coinName")
25+
private String coinName;
26+
27+
/**
28+
* Current page number, default 1
29+
*/
30+
@ParamKey(value = "currentPage", required = true)
31+
private Integer currentPage;
32+
33+
/**
34+
* Page size, default 1, max 100
35+
*/
36+
@ParamKey(value = "sizePage", required = true)
37+
private Integer sizePage;
38+
39+
public SavingFixedProductRequest() {
40+
super("/newearn/cloud/v1/saving/fixed/product", Method.GET, Auth.KEYED);
41+
}
42+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package com.bitmart.api.request.finance.prv;
2+
3+
import com.bitmart.api.annotations.ParamKey;
4+
import com.bitmart.api.request.Auth;
5+
import com.bitmart.api.request.CloudRequest;
6+
import com.bitmart.api.request.Method;
7+
import lombok.Data;
8+
import lombok.EqualsAndHashCode;
9+
import lombok.ToString;
10+
import lombok.experimental.Accessors;
11+
12+
/**
13+
* Finance — query fixed savings history records
14+
*/
15+
@EqualsAndHashCode(callSuper = true)
16+
@Data
17+
@ToString
18+
@Accessors(chain = true)
19+
public class SavingFixedRecordRequest extends CloudRequest {
20+
21+
/**
22+
* Record type
23+
* -subscribe
24+
* -redeem
25+
* -interest
26+
*/
27+
@ParamKey(value = "type", required = true)
28+
private String type;
29+
30+
/**
31+
* Start time in milliseconds, (e.g. 1681701557927)
32+
*/
33+
@ParamKey("startTime")
34+
private Long startTime;
35+
36+
/**
37+
* End time in milliseconds, (e.g. 1681701557927)
38+
*/
39+
@ParamKey("endTime")
40+
private Long endTime;
41+
42+
/**
43+
* Coin name
44+
*/
45+
@ParamKey("coinName")
46+
private String coinName;
47+
48+
/**
49+
* Current page number, default 1
50+
*/
51+
@ParamKey(value = "currentPage", required = true)
52+
private Integer currentPage;
53+
54+
/**
55+
* Page size, default 1, max 100
56+
*/
57+
@ParamKey(value = "sizePage", required = true)
58+
private Integer sizePage;
59+
60+
public SavingFixedRecordRequest() {
61+
super("/newearn/cloud/v1/saving/fixed/record", Method.GET, Auth.KEYED);
62+
}
63+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.bitmart.api.request.finance.prv;
2+
3+
import com.bitmart.api.annotations.ParamKey;
4+
import com.bitmart.api.request.Auth;
5+
import com.bitmart.api.request.CloudRequest;
6+
import com.bitmart.api.request.Method;
7+
import lombok.Data;
8+
import lombok.EqualsAndHashCode;
9+
import lombok.ToString;
10+
import lombok.experimental.Accessors;
11+
12+
/**
13+
* Finance — early-redeem a fixed savings product
14+
*/
15+
@EqualsAndHashCode(callSuper = true)
16+
@Data
17+
@ToString
18+
@Accessors(chain = true)
19+
public class SavingFixedRedeemRequest extends CloudRequest {
20+
21+
/**
22+
* Savings order ID
23+
*/
24+
@ParamKey(value = "earnId", required = true)
25+
private String earnId;
26+
27+
/**
28+
* Unique request number, length 20, numeric (0-9), used for idempotency
29+
*/
30+
@ParamKey(value = "requestNo", required = true)
31+
private String requestNo;
32+
33+
public SavingFixedRedeemRequest() {
34+
super("/newearn/cloud/v1/saving/fixed/redeem", Method.POST, Auth.SIGNED);
35+
}
36+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.bitmart.api.request.finance.prv;
2+
3+
import com.bitmart.api.annotations.ParamKey;
4+
import com.bitmart.api.request.Auth;
5+
import com.bitmart.api.request.CloudRequest;
6+
import com.bitmart.api.request.Method;
7+
import lombok.Data;
8+
import lombok.EqualsAndHashCode;
9+
import lombok.ToString;
10+
import lombok.experimental.Accessors;
11+
12+
/**
13+
* Finance — modify the auto-renewal (auto-subscribe) setting of a fixed savings order
14+
*/
15+
@EqualsAndHashCode(callSuper = true)
16+
@Data
17+
@ToString
18+
@Accessors(chain = true)
19+
public class SavingFixedSubscribeOperateRequest extends CloudRequest {
20+
21+
/**
22+
* Savings order ID
23+
*/
24+
@ParamKey(value = "earnId", required = true)
25+
private String earnId;
26+
27+
/**
28+
* Auto-subscribe type
29+
* -OFF
30+
* -REINVEST_FLEXIBLE
31+
* -REINVEST_FIXED
32+
*/
33+
@ParamKey(value = "autoSubscribe", required = true)
34+
private String autoSubscribe;
35+
36+
public SavingFixedSubscribeOperateRequest() {
37+
super("/newearn/cloud/v1/saving/fixed/subscribe/operate", Method.POST, Auth.SIGNED);
38+
}
39+
}

0 commit comments

Comments
 (0)