Skip to content

Commit 23678f3

Browse files
committed
docs: add params and model docs
1 parent ac584d9 commit 23678f3

File tree

86 files changed

+4922
-1313
lines changed

Some content is hidden

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

86 files changed

+4922
-1313
lines changed

pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@
8080
<groupId>org.apache.maven.plugins</groupId>
8181
<artifactId>maven-javadoc-plugin</artifactId>
8282
<version>3.5.0</version>
83+
<configuration>
84+
<excludePackageNames>com.cryptomarket.sdk.requests</excludePackageNames>
85+
</configuration>
8386
<executions>
8487
<execution>
8588
<id>attach-javadocs</id>
@@ -165,4 +168,4 @@
165168
<maven.compiler.target>17</maven.compiler.target>
166169
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
167170
</properties>
168-
</project>
171+
</project>

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

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

3+
/**
4+
* Account type
5+
*/
36
public enum AccountType {
7+
/** Account type wallet */
48
WALLET("wallet"),
9+
/** Account type spot */
510
SPOT("spot");
611

712
private final String label;
@@ -10,6 +15,7 @@ private AccountType(String label) {
1015
this.label = label;
1116
}
1217

18+
@Override
1319
public String toString() {
1420
return label;
1521
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22

33
import com.squareup.moshi.Json;
44

5+
/** Contingency type */
56
public enum ContingencyType {
7+
/** Contingency type all or none */
68
@Json(name = "allOrNone")
79
ALL_OR_NONE("allOrNone"),
10+
/** Contingency type one cancel other */
811
@Json(name = "oneCancelOther")
912
ONE_CANCEL_OTHER("oneCancelOther"),
13+
/** Contingency type one trigger other */
1014
@Json(name = "oneTriggerOther")
1115
ONE_TRIGGER_OTHER("oneTriggerOther"),
16+
/** Contingency type one trigger one cancel other */
1217
@Json(name = "oneTriggerOneCancelOther")
1318
ONE_TRIGGER_ONE_CANCEL_OTHER("oneTriggerOneCancelOther");
1419

@@ -18,6 +23,7 @@ private ContingencyType(String label) {
1823
this.label = label;
1924
}
2025

26+
@Override
2127
public String toString() {
2228
return label;
2329
}

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

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

3+
/** Orderbook depth */
34
public enum Depth {
5+
/** 5 prices of depth */
46
_5("D5"),
7+
/** 10 prices of depth */
58
_10("D10"),
9+
/** 20 prices of depth */
610
_20("D20");
711

812
private final String label;
@@ -11,6 +15,7 @@ private Depth(String label) {
1115
this.label = label;
1216
}
1317

18+
@Override
1419
public String toString() {
1520
return label;
1621
}
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
package com.cryptomarket.params;
22

3+
/** Identify user by */
34
public enum IdentifyBy {
4-
EMAIL("email"),
5-
USERNAME("username");
5+
/** Identify by email */
6+
EMAIL("email"),
7+
/** Identify by username */
8+
USERNAME("username");
69

7-
private final String label;
10+
private final String label;
811

9-
private IdentifyBy(String label) {
10-
this.label = label;
11-
}
12+
private IdentifyBy(String label) {
13+
this.label = label;
14+
}
1215

13-
public String toString() {
14-
return label;
15-
}
16-
}
16+
@Override
17+
public String toString() {
18+
return label;
19+
}
20+
}
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package com.cryptomarket.params;
22

3+
/** Notification type of a websocket subscription */
34
public enum NotificationType {
5+
/** Snapshot notification type */
46
SNAPSHOT("snapshot"),
7+
/** Update notification type */
58
UPDATE("update"),
9+
/** Data notification type */
610
DATA("data"),
11+
/** Type used to signal parse erroors */
712
PARSE_ERROR("error");
813

914
private final String label;
@@ -12,24 +17,29 @@ private NotificationType(String label) {
1217
this.label = label;
1318
}
1419

20+
@Override
1521
public String toString() {
1622
return label;
1723
}
1824

25+
/** True if it is snapshot */
1926
public boolean isSnapshot() {
2027
return this == NotificationType.SNAPSHOT;
2128
}
2229

30+
/** True if it is update */
2331
public boolean isUpdate() {
2432
return this == NotificationType.UPDATE;
2533
}
2634

35+
/** True if it is data */
2736
public boolean isData() {
2837
return this == NotificationType.DATA;
2938
}
3039

40+
/** True if it is a type of error */
3141
public boolean isError() {
3242
return this == NotificationType.PARSE_ERROR;
3343
}
3444

35-
}
45+
}

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

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

3+
/** Order book speed */
34
public enum OBSpeed {
5+
/** Speed of 100 miliseconds */
46
_100_MILISECONDS("100ms"),
7+
/** Speed of 500 miliseconds */
58
_500_MILISECONDS("500ms"),
9+
/** Speed of 1000 miliseconds */
610
_1000_MILISECONDS("1000ms");
711

812
private final String label;
@@ -11,6 +15,7 @@ private OBSpeed(String label) {
1115
this.label = label;
1216
}
1317

18+
@Override
1419
public String toString() {
1520
return label;
1621
}

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

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.squareup.moshi.Json;
44

5+
/** Order builder, used in order requests. used as a method chain */
56
@SuppressWarnings("unused")
67
public class OrderBuilder {
78
@Json(name = "client_order_id")
@@ -33,66 +34,144 @@ public class OrderBuilder {
3334
@Json(name = "make_rate")
3435
private String makeRate;
3536

37+
/**
38+
* Sets the client order id of the order
39+
*
40+
* @param clientOrderId The client order id of the order
41+
* @return The order builder
42+
*/
3643
public OrderBuilder clientOrderId(String clientOrderId) {
3744
this.clientOrderId = clientOrderId;
3845
return this;
3946
}
4047

48+
/**
49+
* Sets the symbol of the order
50+
*
51+
* @param symbol The symbol of the order
52+
* @return The order builder
53+
*/
4154
public OrderBuilder symbol(String symbol) {
4255
this.symbol = symbol;
4356
return this;
4457
}
4558

59+
/**
60+
* Sets the side of the order
61+
*
62+
* @param side The side of the order
63+
* @return The order builder
64+
*/
4665
public OrderBuilder side(Side side) {
4766
this.side = side;
4867
return this;
4968
}
5069

70+
/**
71+
* Sets the type of the order
72+
*
73+
* @param type The type of the order
74+
* @return The order builder
75+
*/
5176
public OrderBuilder orderType(OrderType type) {
5277
this.type = type;
5378
return this;
5479
}
5580

81+
/**
82+
* Sets the time in force of the order
83+
*
84+
* @param timeInForce The time in force of the order
85+
* @return The order builder
86+
*/
5687
public OrderBuilder timeInForce(TimeInForce timeInForce) {
5788
this.timeInForce = timeInForce;
5889
return this;
5990
}
6091

61-
public OrderBuilder quantity(String quanity) {
62-
this.quantity = quanity;
92+
/**
93+
* Sets the quantity of the order
94+
*
95+
* @param quantity The quantity of the order
96+
* @return The order builder
97+
*/
98+
public OrderBuilder quantity(String quantity) {
99+
this.quantity = quantity;
63100
return this;
64101
}
65102

103+
/**
104+
* Sets the price of the order
105+
*
106+
* @param price The price of the order
107+
* @return The order builder
108+
*/
66109
public OrderBuilder price(String price) {
67110
this.price = price;
68111
return this;
69112
}
70113

114+
/**
115+
* Sets the stop price of the order
116+
*
117+
* @param stopPrice The stop price of the order
118+
* @return The order builder
119+
*/
71120
public OrderBuilder stopPrice(String stopPrice) {
72121
this.stopPrice = stopPrice;
73122
return this;
74123
}
75124

125+
/**
126+
* Sets the expire time of the order
127+
*
128+
* @param expireTime The expire time of the order
129+
* @return The order builder
130+
*/
76131
public OrderBuilder expireTime(String expireTime) {
77132
this.expireTime = expireTime;
78133
return this;
79134
}
80135

136+
/**
137+
* Sets the strict validate of the order
138+
*
139+
* @param strictValidate The strict validate of the order
140+
* @return The order builder
141+
*/
81142
public OrderBuilder strictValidate(Boolean strictValidate) {
82143
this.strictValidate = strictValidate;
83144
return this;
84145
}
85146

147+
/**
148+
* Sets the post only of the order
149+
*
150+
* @param postOnly The post only of the order
151+
* @return The order builder
152+
*/
86153
public OrderBuilder postOnly(Boolean postOnly) {
87154
this.postOnly = postOnly;
88155
return this;
89156
}
90157

158+
/**
159+
* Sets the take rate of the order
160+
*
161+
* @param takeRate The take rate of the order
162+
* @return The order builder
163+
*/
91164
public OrderBuilder takeRate(String takeRate) {
92165
this.takeRate = takeRate;
93166
return this;
94167
}
95168

169+
/**
170+
* Sets the make rate of the order
171+
*
172+
* @param makeRate The make rate of the order
173+
* @return The order builder
174+
*/
96175
public OrderBuilder makeRate(String makeRate) {
97176
this.makeRate = makeRate;
98177
return this;

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

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

3+
/** Status of an order */
34
public enum OrderStatus {
45

6+
/** New order */
57
NEW("new"),
8+
/** Suspended order */
69
SUSPENDED("suspended"),
10+
/** Partially filled order */
711
PARTIALLY_FILLED("partiallyFilled"),
12+
/** Fully filled order */
813
FILLED("filled"),
14+
/** Canceled order */
915
CANCELED("canceled"),
16+
/** Expired order */
1017
EXPIRED("expired");
1118

1219
private final String label;
@@ -15,6 +22,7 @@ private OrderStatus(String label) {
1522
this.label = label;
1623
}
1724

25+
@Override
1826
public String toString() {
1927
return label;
2028
}

0 commit comments

Comments
 (0)