Skip to content

Commit af0fda4

Browse files
committed
feat: api-v3
1 parent 39ac767 commit af0fda4

File tree

106 files changed

+9914
-6250
lines changed

Some content is hidden

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

106 files changed

+9914
-6250
lines changed

README.md

Lines changed: 150 additions & 233 deletions
Large diffs are not rendered by default.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.cryptomarket.params;
2+
3+
public enum AccountType {
4+
WALLET("wallet"),
5+
SPOT("spot");
6+
7+
private final String label;
8+
9+
private AccountType(String label) {
10+
this.label = label;
11+
}
12+
13+
public String toString() {
14+
return label;
15+
}
16+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
package com.cryptomarket.params;
2+
3+
public class ArgNames {
4+
public static final String CURRENCIES = "currencies";
5+
public static final String CURRENCY = "currency";
6+
public static final String SYMBOLS = "symbols";
7+
public static final String SYMBOL = "symbol";
8+
public static final String FROM = "from";
9+
public static final String TILL = "till";
10+
public static final String LIMIT = "limit";
11+
public static final String OFFSET = "offset";
12+
public static final String SORT = "sort";
13+
public static final String BY = "by";
14+
public static final String TO = "to";
15+
public static final String SINCE = "since";
16+
public static final String UNTIL = "until";
17+
public static final String PERIOD = "period";
18+
public static final String SIDE = "side";
19+
public static final String QUANTITY = "quantity";
20+
public static final String CLIENT_ORDER_ID = "client_order_id";
21+
public static final String ORDER_TYPE = "type";
22+
public static final String PRICE = "price";
23+
public static final String STOP_PRICE = "stop_price";
24+
public static final String TIME_IN_FORCE = "time_in_force";
25+
public static final String EXPIRE_TIME = "expire_time";
26+
public static final String STRICT_VALIDATE = "strict_validate";
27+
public static final String POST_ONLY = "post_only";
28+
public static final String TAKE_RATE = "take_rate";
29+
public static final String MAKE_RATE = "make_rate";
30+
public static final String NEW_CLIENT_ORDER_ID = "new_client_order_id";
31+
public static final String ADDRESS = "address";
32+
public static final String AMOUNT = "amount";
33+
public static final String PAYMENT_ID = "payment_id";
34+
public static final String INCLUDE_FEE = "include_fee";
35+
public static final String AUTO_COMMIT = "auto_commit";
36+
public static final String USE_OFFCHAIN = "use_offchain";
37+
public static final String PUBLIC_COMMENT = "public_comment";
38+
public static final String SOURCE = "source";
39+
public static final String DESTINATION = "destination";
40+
public static final String TYPES = "types";
41+
public static final String SUBTYPES = "subtypes";
42+
public static final String STATUSES = "statuses";
43+
public static final String TRANSACTION_IDS = "transaction_ids";
44+
public static final String ID_FROM = "id_from";
45+
public static final String ID_TILL = "id_till";
46+
public static final String SHOW_SENDERS = "show_senders";
47+
public static final String BASE_CURRENCY = "base_currency";
48+
public static final String ACTIVE_AT = "active_at";
49+
public static final String TRANSACTION_ID = "transaction_id";
50+
public static final String ACTIVE = "active";
51+
public static final String VOLUME = "volume";
52+
public static final String FROM_CURRENCY = "from_currency";
53+
public static final String TO_CURRENCY = "to_currency";
54+
public static final String TRANSFER_BY = "by";
55+
public static final String IDENTIFIER = "identifier";
56+
public static final String ORDER_ID = "order_id";
57+
public static final String ORDER_LIST_ID = "order_list_id";
58+
public static final String CONTINGENCY_TYPE = "contingency_type";
59+
public static final String ORDERS = "orders";
60+
public static final String SUB_ACCOUNT_IDS = "sub_account_ids";
61+
public static final String DEPOSIT_ADDRESS_GENERATION_ENABLED = "deposit_address_generation_enabled";
62+
public static final String WITHDRAW_ENABLED = "withdraw_enabled";
63+
public static final String CREATED_AT = "created_at";
64+
public static final String UPDATED_AT = "updated_at";
65+
public static final String DESCRIPTION = "description";
66+
public static final String SUB_ACCOUNT_ID = "sub_account_id";
67+
public static final String TRANSFER_TYPE = "type";
68+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.cryptomarket.params;
2+
3+
public enum ContingencyType {
4+
ALL_OR_NONE("allOrNone"),
5+
ONE_CANCEL_OTHER("oneCancelOther"),
6+
ONE_TRIGGER_ONE_CANCEL_OTHER("oneTriggerOneCancelOther");
7+
8+
private final String label;
9+
10+
private ContingencyType(String label) {
11+
this.label = label;
12+
}
13+
14+
public String toString() {
15+
return label;
16+
}
17+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.cryptomarket.params;
2+
3+
public enum Depth {
4+
_5("D5"),
5+
_10("D10"),
6+
_20("D20");
7+
8+
private final String label;
9+
10+
private Depth(String label) {
11+
this.label = label;
12+
}
13+
14+
public String toString() {
15+
return label;
16+
}
17+
18+
}

src/main/java/com/cryptomarket/params/TransferBy.java renamed to src/main/java/com/cryptomarket/params/IdentifyBy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package com.cryptomarket.params;
22

3-
public enum TransferBy {
3+
public enum IdentifyBy {
44
EMAIL("email"),
55
USERNAME("username");
66

77
private final String label;
88

9-
private TransferBy(String label) {
9+
private IdentifyBy(String label) {
1010
this.label = label;
1111
}
1212

src/main/java/com/cryptomarket/params/Margin.java

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.cryptomarket.params;
2+
3+
public enum NotificationType {
4+
SNAPSHOT("snapshot"),
5+
UPDATE("update"),
6+
DATA("data");
7+
8+
private final String label;
9+
10+
private NotificationType(String label) {
11+
this.label = label;
12+
}
13+
14+
public String toString() {
15+
return label;
16+
}
17+
18+
public boolean isSnapshot() {
19+
return this == NotificationType.SNAPSHOT;
20+
}
21+
22+
public boolean isUpdate() {
23+
return this == NotificationType.UPDATE;
24+
}
25+
26+
public boolean isData() {
27+
return this == NotificationType.DATA;
28+
}
29+
30+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.cryptomarket.params;
2+
3+
public enum OBSpeed {
4+
_100_MILISECONDS("100ms"),
5+
_500_MILISECONDS("500ms"),
6+
_1000_MILISECONDS("1000ms");
7+
8+
private final String label;
9+
10+
private OBSpeed(String label) {
11+
this.label = label;
12+
}
13+
14+
public String toString() {
15+
return label;
16+
}
17+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
package com.cryptomarket.params;
2+
3+
import java.util.List;
4+
import java.util.Map;
5+
6+
import com.cryptomarket.sdk.exceptions.CryptomarketArgumentException;
7+
8+
public class OrderBuilder {
9+
ParamsBuilder paramsBuilder = new ParamsBuilder();
10+
11+
public OrderBuilder checkRequired(List<String> requiredParams) throws CryptomarketArgumentException {
12+
paramsBuilder.checkRequired(requiredParams);
13+
return this;
14+
}
15+
public OrderBuilder clientOrderID(String clientOrderID) {
16+
paramsBuilder.clientOrderID(clientOrderID);
17+
return this;
18+
}
19+
20+
public OrderBuilder symbol(String symbol) {
21+
paramsBuilder.symbol(symbol);
22+
return this;
23+
}
24+
25+
public OrderBuilder side(Side side) {
26+
paramsBuilder.side(side);
27+
return this;
28+
}
29+
30+
public OrderBuilder orderType(OrderType orderType) {
31+
paramsBuilder.orderType(orderType);
32+
return this;
33+
}
34+
35+
public OrderBuilder timeInForce(TimeInForce timeInForce) {
36+
paramsBuilder.timeInForce(timeInForce);
37+
return this;
38+
}
39+
40+
public OrderBuilder quantity(String quantity) {
41+
paramsBuilder.quantity(quantity);
42+
return this;
43+
}
44+
45+
public OrderBuilder price(String price) {
46+
paramsBuilder.price(price);
47+
return this;
48+
}
49+
50+
public OrderBuilder stopPrice(String stpoPrice) {
51+
paramsBuilder.stopPrice(stpoPrice);
52+
return this;
53+
}
54+
55+
public OrderBuilder expireTime(String expireTime) {
56+
paramsBuilder.expireTime(expireTime);
57+
return this;
58+
}
59+
60+
public OrderBuilder strictValidate(Boolean strictValidate) {
61+
paramsBuilder.strictValidate(strictValidate);
62+
return this;
63+
}
64+
65+
public OrderBuilder postOnly(Boolean postOnly) {
66+
paramsBuilder.postOnly(postOnly);
67+
return this;
68+
}
69+
70+
public OrderBuilder takeRate(String takeRate) {
71+
paramsBuilder.takeRate(takeRate);
72+
return this;
73+
}
74+
75+
public OrderBuilder makeRate(String makeRate) {
76+
paramsBuilder.makeRate(makeRate);
77+
return this;
78+
}
79+
80+
public Map<String, Object> buildObjectMap() {
81+
return paramsBuilder.buildObjectMap();
82+
}
83+
84+
public Map<String, String> build() {
85+
return paramsBuilder.build();
86+
}
87+
}

0 commit comments

Comments
 (0)