This repository has been archived by the owner on Jan 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EzBtcClient.PublicApi.cs
66 lines (63 loc) · 2.12 KB
/
EzBtcClient.PublicApi.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
using EzBtc.Api.Models;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace EzBtc.Api
{
public partial class EzBtcClient
{
/// <summary>
/// Get current trading information.
/// </summary>
/// <param name="pair">The currency pair to return the ticker for (optional).</param>
/// <returns>
/// Trading information from the specified <paramref name="pair"/>.
/// </returns>
public async Task<Ticker> GetTickerAsync(string pair = "xbtcad")
{
return await QueryPublicAsync<Ticker>(
"ticker",
new Dictionary<string, string>(1)
{
["pair"] = pair
}
);
}
/// <summary>
/// Get open orders.
/// </summary>
/// <param name="pair">The currency pair to return the order book for (optional).</param>
/// <returns>
/// A list of <c>Bids</c> and <c>Asks</c> each containing the top 50 <see cref="OrderBookEntry"/>s
/// sorted by <c>Rate</c> (descending for bid, ascending for ask).
/// </returns>
public async Task<OrderBook> GetOrderBookAsync(string pair = "xbtcad")
{
return await QueryPublicAsync<OrderBook>(
"order-book",
new Dictionary<string, string>(1)
{
["pair"] = pair
}
);
}
/// <summary>
/// Get completed trades.
/// </summary>
/// <param name="pair">The currency pair to return the ticker for (optional).</param>
/// <returns>
/// A list of the last 50 completed trades, sorted by the most recent trade first.
/// </returns>
public async Task<Transaction[]> GetTransactionsAsync(string pair = "xbtcad")
{
return await QueryPublicAsync<Transaction[]>(
"transactions",
new Dictionary<string, string>(1)
{
["pair"] = pair
}
);
}
}
}