forked from crypto-chassis/ccapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainProgram.cs
22 lines (22 loc) · 863 Bytes
/
MainProgram.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class MainProgram {
class MyEventHandler : ccapi.EventHandler {
public override bool ProcessEvent(ccapi.Event event_, ccapi.Session session) {
System.Console.WriteLine(string.Format("Received an event:\n{0}", event_.ToStringPretty(2, 2)));
return true;
}
}
static void Main(string[] args) {
var eventHandler = new MyEventHandler();
var option = new ccapi.SessionOptions();
var config = new ccapi.SessionConfigs();
var session = new ccapi.Session(option, config, eventHandler);
var request = new ccapi.Request(ccapi.Request.Operation.GET_RECENT_TRADES, "okx", "BTC-USDT");
var param = new ccapi.MapStringString();
param.Add("LIMIT", "1");
request.AppendParam(param);
session.SendRequest(request);
System.Threading.Thread.Sleep(10000);
session.Stop();
System.Console.WriteLine("Bye");
}
}