-
Notifications
You must be signed in to change notification settings - Fork 9
/
CryptoWatchClasses.cs
261 lines (231 loc) · 6.12 KB
/
CryptoWatchClasses.cs
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
// Copyright(c) 2017 Stock84-dev
// https://github.com/Stock84-dev/Cryptowatch-API
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Cryptowatch
{
public class SiteInformation
{
public string revision { get; set; }
public string uptime { get; set; }
public string documentation { get; set; }
public string[] indexes { get; set; }
}
/// <summary>
/// An asset can be a crypto or fiat currency.
/// </summary>
public class Assets
{
public int id { get; set; }
public string symbol { get; set; }
public string name { get; set; }
public bool fiat { get; set; }
public string route { get; set; }
}
/// <summary>
/// An asset can be a crypto or fiat currency.
/// </summary>
public class Asset
{
public int id { get; set; }
public string symbol { get; set; }
public string name { get; set; }
public bool fiat { get; set; }
public Markets1 markets { get; set; }
}
/// <summary>
/// A pair of assets. Each pair has a base and a quote. For example, btceur has base btc and quote eur.
/// </summary>
public class Pairs
{
public string symbol { get; set; }
public int id { get; set; }
[JsonProperty("base")]
public Base basePair { get; set; }
[JsonProperty("quote")]
public Quote quotePair { get; set; }
public string route { get; set; }
/// <summary>
/// Not always set.
/// </summary>
public string futuresContractPeriod { get; set; }
}
public class Pair
{
public string symbol { get; set; }
public int id { get; set; }
[JsonProperty("base")]
public Base basePair { get; set; }
[JsonProperty("quote")]
public Quote quotePair { get; set; }
public string route { get; set; }
public Markets[] markets { get; set; }
}
/// <summary>
/// Exchanges are where all the action happens!
/// </summary>
public class Exchanges
{
public string symbol { get; set; }
public string name { get; set; }
public string route { get; set; }
public bool active { get; set; }
}
/// <summary>
/// Exchanges are where all the action happens!
/// </summary>
public class Exchange
{
public string symbol { get; set; }
public string name { get; set; }
public bool active { get; set; }
public Route routes { get; set; }
}
/// <summary>
/// A market is a pair listed on an exchange. For example, pair btceur on exchange kraken is a market.
/// </summary>
public class Markets
{
public int id { get; set; }
public string exchange { get; set; }
public string pair { get; set; }
public bool active { get; set; }
public string route { get; set; }
}
/// <summary>
/// A market is a pair listed on an exchange. For example, pair btceur on exchange kraken is a market.
/// </summary>
public class Market
{
public string exchange { get; set; }
public string pair { get; set; }
public bool active { get; set; }
public Routes routes { get; set; }
}
public class Markets1
{
[JsonProperty("base")]
public Bases[] baseMarket { get; set; }
[JsonProperty("quote")]
public Quotes[] quoteMarket { get; set; }
}
public class Bases
{
public int id { get; set; }
public string exchange { get; set; }
public string pair { get; set; }
public bool active { get; set; }
public string route { get; set; }
}
public class Base
{
public int id { get; set; }
public string route { get; set; }
public string symbol { get; set; }
public string name { get; set; }
public bool fiat { get; set; }
}
public class Quotes
{
public int id { get; set; }
public string exchange { get; set; }
public string pair { get; set; }
public bool active { get; set; }
public string route { get; set; }
}
public class Quote
{
public int id { get; set; }
public string route { get; set; }
public string symbol { get; set; }
public string name { get; set; }
public bool fiat { get; set; }
}
public class Routes
{
public string price { get; set; }
public string summary { get; set; }
public string orderbook { get; set; }
public string trades { get; set; }
public string ohlc { get; set; }
}
public class Route
{
public string markets { get; set; }
}
public class Summary
{
public Price price { get; set; }
public double volume { get; set; }
}
public class Price
{
public double last { get; set; }
public double high { get; set; }
public double low { get; set; }
public Change change { get; set; }
}
public class Change
{
public double percentage { get; set; }
public double absolute { get; set; }
}
public class Trade
{
public int id { get; set; }
public long timestamp { get; set; }
public double price { get; set; }
public double amount { get; set; }
public Trade(int id, long timestamp, double price, double amount)
{
this.id = id;
this.timestamp = timestamp;
this.price = price;
this.amount = amount;
}
}
public class OrderBook
{
public List<Order> bids { get; set; }
public List<Order> asks { get; set; }
public OrderBook()
{
bids = new List<Order>();
asks = new List<Order>();
}
}
public class Order
{
public double price;
public double amount;
public Order(double price, double amount)
{
this.price = price;
this.amount = amount;
}
}
public enum TimeFrame { min1 = 60, min3 = 180, min5 = 300, min15 = 900, min30 = 1800, h1 = 3600, h2 = 7200, h4 = 14400, h6 = 21600, h12 = 43200, d1 = 86400, d3 = 259200, w1 = 604800 }
public class Candlestick
{
public long closeTime;
public double openPrice;
public double highPrice;
public double lowPrice;
public double closePrice;
public double volume;
public Candlestick(long closeTime, double openPrice, double highPrice, double lowPrice, double closePrice, double volume)
{
this.closeTime = closeTime;
this.openPrice = openPrice;
this.highPrice = highPrice;
this.lowPrice = lowPrice;
this.closePrice = closePrice;
this.volume = volume;
}
}
public class Allowance
{
public long cost { get; set; }
public long remaining { get; set; }
}
}