Skip to content

Commit 3950d4d

Browse files
author
ricci
committed
2.1.0 feat(new and update futures enpoints)
1 parent 77437fa commit 3950d4d

10 files changed

Lines changed: 420 additions & 4 deletions

CHANGELOG.md

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

5+
6+
### v2.1.0 Release
7+
#### New Features
8+
- New
9+
- `/contract/private/submit-tp-sl-order`
10+
- `/contract/private/modify-plan-order`
11+
- `/contract/private/modify-preset-plan-order`
12+
- `/contract/private/modify-tp-sl-order`
13+
- Updated
14+
- `contract/private/cancel-order` Add new request field **client_order_id**
15+
- `/contract/private/cancel-plan-order` Add new request field **client_order_id**
16+
- `/contract/private/current-plan-order` Add new request field **plan_type**
17+
18+
---
19+
520
### v2.0.1 Release
621
#### Improvements
722
- Updated examples in the readme file

SECURITY.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Security Policy
2+
3+
4+
## Reporting a Vulnerability
5+
6+
We encourage responsible disclosure of security issues to BitMart and please email reports about any security issues you find to security@bitmart.com.
7+
8+
9+
After the security team receives your email, they will communicate with you in time. The security team will work to keep you informed of an issue fix.
10+
11+
In order to reproduce and identify the issue, please include the following information along with your email:
12+
13+
* The details of the vulnerability including how to reproduce it. Try to attach a PoC.
14+
* The attack scenario and what an attacker might be able to achieve with this issue.
15+
* Whether this vulnerability has been made public. If it is, please attach details.
16+
* Mark the vulnerability from BitMart sdk.

src/main/java/com/bitmart/api/request/contract/prv/CancelOrderRequest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,16 @@ public class CancelOrderRequest extends CloudRequest {
2525
/**
2626
* Order ID
2727
*/
28-
@ParamKey(value = "order_id", required = true)
28+
@ParamKey(value = "order_id")
2929
private String orderId;
3030

31+
32+
/**
33+
* Client-defined OrderId
34+
*/
35+
@ParamKey(value = "client_order_id")
36+
private String clientOrderId;
37+
3138
/**
3239
* Applicable for canceling a specific contract order
3340
*/

src/main/java/com/bitmart/api/request/contract/prv/CancelPlanOrderRequest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ public class CancelPlanOrderRequest extends CloudRequest {
2525
/**
2626
* Order ID
2727
*/
28-
@ParamKey(value = "order_id", required = true)
28+
@ParamKey(value = "order_id")
2929
private String orderId;
3030

31+
/**
32+
* Order ID
33+
*/
34+
@ParamKey(value = "client_order_id")
35+
private String clientOrderId;
36+
3137
/**
3238
* Applicable for canceling a specific contract plan order
3339
*/

src/main/java/com/bitmart/api/request/contract/prv/GetAllCurrentPlanOrdersRequest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ public class GetAllCurrentPlanOrdersRequest extends CloudRequest {
3636
@ParamKey("limit")
3737
private Integer limit;
3838

39+
/**
40+
* Plan order type
41+
* -plan
42+
* - profit_loss
43+
* default all
44+
*/
45+
@ParamKey("plan_type")
46+
private String planType;
47+
3948
/**
4049
* Applicable for querying contract all plan orders
4150
*/
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
package com.bitmart.api.request.contract.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+
@EqualsAndHashCode(callSuper = true)
14+
@Data
15+
@ToString
16+
@Accessors(chain = true)
17+
public class ModifyPlanOrderRequest extends CloudRequest {
18+
19+
/**
20+
* Symbol of the contract(like BTCUSDT)
21+
*/
22+
@ParamKey(value = "symbol", required = true)
23+
private String symbol;
24+
25+
/**
26+
* Order ID(order_id or client_order_id must give one)
27+
*/
28+
@ParamKey(value = "order_id")
29+
private String orderId;
30+
31+
/**
32+
* Client order ID(order_id or client_order_id must give one)
33+
*/
34+
@ParamKey(value = "client_order_id")
35+
private String clientOrderId;
36+
37+
/**
38+
* Trigger price
39+
*/
40+
@ParamKey(value = "trigger_price", required = true)
41+
private String triggerPrice;
42+
43+
/**
44+
* Execution price for plan order, mandatory when type = limit
45+
*/
46+
@ParamKey(value = "executive_price")
47+
private String executivePrice;
48+
49+
/**
50+
* Trigger price type
51+
* -1=last_price
52+
* -2=fair_price
53+
*/
54+
@ParamKey(value = "price_type", required = true)
55+
private Integer priceType;
56+
57+
/**
58+
* Order type
59+
* -limit
60+
* -market
61+
*/
62+
@ParamKey(value = "type", required = true)
63+
private String type;
64+
65+
public ModifyPlanOrderRequest() {
66+
super("/contract/private/modify-plan-order", Method.POST, Auth.SIGNED);
67+
}
68+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package com.bitmart.api.request.contract.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+
@EqualsAndHashCode(callSuper = true)
13+
@Data
14+
@ToString
15+
@Accessors(chain = true)
16+
public class ModifyPresetPlanOrderRequest extends CloudRequest {
17+
18+
/**
19+
* Symbol of the contract(like BTCUSDT)
20+
*/
21+
@ParamKey(value = "symbol", required = true)
22+
private String symbol;
23+
24+
/**
25+
* Order ID
26+
*/
27+
@ParamKey(value = "order_id", required = true)
28+
private String orderId;
29+
30+
/**
31+
* Pre-set TP price type
32+
* -1=last_price(default)
33+
* -2=fair_price
34+
*/
35+
@ParamKey(value = "preset_take_profit_price_type")
36+
private Integer presetTakeProfitPriceType;
37+
38+
/**
39+
* Pre-set SL price type
40+
* -1=last_price(default)
41+
* -2=fair_price
42+
*/
43+
@ParamKey(value = "preset_stop_loss_price_type")
44+
private Integer presetStopLossPriceType;
45+
46+
/**
47+
* Pre-set TP price
48+
*/
49+
@ParamKey(value = "preset_take_profit_price")
50+
private String presetTakeProfitPrice;
51+
52+
/**
53+
* Pre-set SL price
54+
*/
55+
@ParamKey(value = "preset_stop_loss_price")
56+
private String presetStopLossPrice;
57+
58+
public ModifyPresetPlanOrderRequest() {
59+
super("/contract/private/modify-preset-plan-order", Method.POST, Auth.SIGNED);
60+
}
61+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package com.bitmart.api.request.contract.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+
@EqualsAndHashCode(callSuper = true)
14+
@Data
15+
@ToString
16+
@Accessors(chain = true)
17+
public class ModifyTpSlOrderRequest extends CloudRequest {
18+
19+
/**
20+
* Symbol of the contract(like BTCUSDT)
21+
*/
22+
@ParamKey(value = "symbol", required = true)
23+
private String symbol;
24+
25+
/**
26+
* Order ID(order_id or client_order_id must give one)
27+
*/
28+
@ParamKey(value = "order_id")
29+
private String orderId;
30+
31+
/**
32+
* Client order ID(order_id or client_order_id must give one)
33+
*/
34+
@ParamKey(value = "client_order_id")
35+
private String clientOrderId;
36+
37+
/**
38+
* Trigger price
39+
*/
40+
@ParamKey(value = "trigger_price", required = true)
41+
private String triggerPrice;
42+
43+
/**
44+
* Execution price for order, mandatory when plan_category = 1
45+
*/
46+
@ParamKey(value = "executive_price")
47+
private String executivePrice;
48+
49+
/**
50+
* Trigger price type
51+
* -1=last_price
52+
* -2=fair_price
53+
*/
54+
@ParamKey(value = "price_type", required = true)
55+
private Integer priceType;
56+
57+
/**
58+
* TP/SL type
59+
* -1=TP/SL
60+
* -2=Position TP/SL
61+
*/
62+
@ParamKey(value = "plan_category")
63+
private Integer planCategory;
64+
65+
66+
/**
67+
* Order type, Position TP/SL default market
68+
* -limit
69+
* -market
70+
*/
71+
@ParamKey(value = "category")
72+
private String category;
73+
74+
75+
76+
public ModifyTpSlOrderRequest() {
77+
super("/contract/private/modify-tp-sl-order", Method.POST, Auth.SIGNED);
78+
}
79+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
package com.bitmart.api.request.contract.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+
@EqualsAndHashCode(callSuper = true)
13+
@Data
14+
@ToString
15+
@Accessors(chain = true)
16+
public class SubmitTpSlOrderRequest extends CloudRequest {
17+
18+
/**
19+
* Symbol of the contract(like BTCUSDT)
20+
*/
21+
@ParamKey(value = "symbol", required = true)
22+
private String symbol;
23+
24+
/**
25+
* Order type
26+
* -take_profit
27+
* -stop_loss
28+
*/
29+
@ParamKey(value = "type", required = true)
30+
private String type;
31+
32+
/**
33+
* Order side
34+
* -2=buy_close_short
35+
* -3=sell_close_long
36+
*/
37+
@ParamKey(value = "side", required = true)
38+
private Integer side;
39+
40+
/**
41+
* Order size (Number of contracts) Default the size of position
42+
*/
43+
@ParamKey(value = "size")
44+
private Integer size;
45+
46+
/**
47+
* Trigger price
48+
*/
49+
@ParamKey(value = "trigger_price", required = true)
50+
private String triggerPrice;
51+
52+
/**
53+
* Execution price
54+
*/
55+
@ParamKey(value = "executive_price", required = true)
56+
private String executivePrice;
57+
58+
/**
59+
* Trigger price type
60+
* -1=last_price
61+
* -2=fair_price
62+
*/
63+
@ParamKey(value = "price_type", required = true)
64+
private Integer priceType;
65+
66+
/**
67+
* TP/SL type
68+
* -1=TP/SL(default)
69+
* -2=Position TP/SL
70+
*/
71+
@ParamKey(value = "plan_category")
72+
private Integer planCategory;
73+
74+
/**
75+
* Client order ID
76+
*/
77+
@ParamKey(value = "client_order_id")
78+
private String clientOrderId;
79+
80+
81+
/**
82+
* Trigger order type, position TP/SL default market
83+
* -limit
84+
* -market
85+
*/
86+
@ParamKey(value = "category")
87+
private String category;
88+
89+
public SubmitTpSlOrderRequest() {
90+
super("/contract/private/submit-tp-sl-order", Method.POST, Auth.SIGNED);
91+
}
92+
}

0 commit comments

Comments
 (0)