Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRunConfig.cs
More file actions
Latest commit
57 lines (47 loc) · 1.57 KB
/
Copy pathRunConfig.cs
File metadata and controls
57 lines (47 loc) · 1.57 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
usingSystem;
usingCommandLine;
namespaceGateApiDemo
{
publicclassRunConfig
{
publicRunConfig()
{
}
publicRunConfig(stringkey,stringsecret,stringurl)
{
this.ApiKey=key;
this.ApiSecret=secret;
this.HostUsed=url;
}
[Option('k',"key",Required=true,HelpText="Gate APIv4 key")]
publicstringApiKey{get;set;}
[Option('s',"secret",Required=true,HelpText="Gate APIv4 secret")]
publicstringApiSecret{get;set;}
privatestring_hostUsed;
[Option('u',"url",Required=false,HelpText="Optional API base url used")]
publicstringHostUsed
{
get{return_hostUsed;}
privateset
{
_hostUsed=value;
if(string.IsNullOrWhiteSpace(_hostUsed))
{
_hostUsed="https://api.gateio.ws/api/v4";
}
if(!_hostUsed.StartsWith("http"))
{
_hostUsed="https://"+_hostUsed;
}
if(!_hostUsed.EndsWith("/api/v4"))
{
_hostUsed+="/api/v4";
}
UseTestNet="fx-api-testnet.gateio.ws".Equals(newUri(_hostUsed).Host);
}
}
publicboolUseTestNet{get;privateset;}
[Value(0,Required=true,HelpText="Demo to run. Available demos: spot, margin, or futures")]
publicstringDemo{get;set;}
}
}