-
-
Notifications
You must be signed in to change notification settings - Fork 371
Expand file tree
/
Copy pathMarketSymbolsOption.cs
More file actions
37 lines (32 loc) · 777 Bytes
/
MarketSymbolsOption.cs
File metadata and controls
37 lines (32 loc) · 777 Bytes
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
using System;
using System.Threading.Tasks;
using CommandLine;
using ExchangeSharpConsole.Options.Interfaces;
namespace ExchangeSharpConsole.Options
{
[Verb(
"market-symbols",
HelpText = "Shows all the market symbols (currency pairs) for the selected exchange."
)]
public class MarketSymbolsOption : BaseOption, IOptionPerExchange
{
public override async Task RunCommand()
{
using var api = await GetExchangeInstanceAsync(ExchangeName);
try
{
var marketSymbols = await api.GetMarketSymbolsAsync();
foreach (var marketSymbol in marketSymbols)
{
Console.WriteLine(marketSymbol);
}
WaitInteractively();
}
catch (Exception ex)
{
Console.Error.WriteLine(ex);
}
}
public string ExchangeName { get; set; }
}
}