This repository was archived by the owner on Oct 30, 2023. It is now read-only.
forked from joaopsilva/binance-java-api
-
Notifications
You must be signed in to change notification settings - Fork 597
Expand file tree
/
Copy pathSymbolInfo.java
More file actions
executable file
·175 lines (131 loc) · 4.59 KB
/
SymbolInfo.java
File metadata and controls
executable file
·175 lines (131 loc) · 4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
package com.binance.api.client.domain.general;
import com.binance.api.client.constant.BinanceApiConstants;
import com.binance.api.client.domain.OrderType;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Symbol information (base/quote).
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class SymbolInfo {
private String symbol;
private SymbolStatus status;
private String baseAsset;
private Integer baseAssetPrecision;
private String quoteAsset;
private Integer quotePrecision;
private List<OrderType> orderTypes;
private boolean icebergAllowed;
private boolean ocoAllowed;
private boolean quoteOrderQtyMarketAllowed;
private boolean isSpotTradingAllowed;
private boolean isMarginTradingAllowed;
private List<SymbolFilter> filtersList;
private Map<FilterType, SymbolFilter> filtersMap;
public String getSymbol() {
return symbol;
}
public void setSymbol(String symbol) {
this.symbol = symbol;
}
public SymbolStatus getStatus() {
return status;
}
public void setStatus(SymbolStatus status) {
this.status = status;
}
public String getBaseAsset() {
return baseAsset;
}
public void setBaseAsset(String baseAsset) {
this.baseAsset = baseAsset;
}
public Integer getBaseAssetPrecision() {
return baseAssetPrecision;
}
public void setBaseAssetPrecision(Integer baseAssetPrecision) {
this.baseAssetPrecision = baseAssetPrecision;
}
public String getQuoteAsset() {
return quoteAsset;
}
public void setQuoteAsset(String quoteAsset) {
this.quoteAsset = quoteAsset;
}
public Integer getQuotePrecision() {
return quotePrecision;
}
public void setQuotePrecision(Integer quotePrecision) {
this.quotePrecision = quotePrecision;
}
public List<OrderType> getOrderTypes() {
return orderTypes;
}
public void setOrderTypes(List<OrderType> orderTypes) {
this.orderTypes = orderTypes;
}
public boolean isIcebergAllowed() {
return icebergAllowed;
}
public void setIcebergAllowed(boolean icebergAllowed) {
this.icebergAllowed = icebergAllowed;
}
public boolean isOcoAllowed() {
return ocoAllowed;
}
public void setOcoAllowed(boolean ocoAllowed) {
this.ocoAllowed = ocoAllowed;
}
public boolean isQuoteOrderQtyMarketAllowed() {
return quoteOrderQtyMarketAllowed;
}
public void setQuoteOrderQtyMarketAllowed(boolean quoteOrderQtyMarketAllowed) {
this.quoteOrderQtyMarketAllowed = quoteOrderQtyMarketAllowed;
}
public boolean isSpotTradingAllowed() {
return isSpotTradingAllowed;
}
public void setIsSpotTradingAllowed(boolean isSpotTradingAllowed) {
this.isSpotTradingAllowed = isSpotTradingAllowed;
}
public boolean isMarginTradingAllowed() {
return isMarginTradingAllowed;
}
public void setIsMarginTradingAllowed(boolean isMarginTradingAllowed) {
this.isMarginTradingAllowed = isMarginTradingAllowed;
}
public List<SymbolFilter> getFilters() {
return filtersList;
}
public void setFilters(List<SymbolFilter> filters) {
filtersList = filters;
filtersMap = new HashMap<>();
for (SymbolFilter filter : filters) {
filtersMap.put(filter.getFilterType(), filter);
}
}
/**
* @param filterType filter type to filter for.
* @return symbol filter information for the provided filter type.
*/
public SymbolFilter getSymbolFilter(FilterType filterType) {
return filtersMap.get(filterType);
}
@Override
public String toString() {
return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
.append("symbol", symbol)
.append("status", status)
.append("baseAsset", baseAsset)
.append("baseAssetPrecision", baseAssetPrecision)
.append("quoteAsset", quoteAsset)
.append("quotePrecision", quotePrecision)
.append("orderTypes", orderTypes)
.append("icebergAllowed", icebergAllowed)
.append("filters", filtersList)
.toString();
}
}