File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ using CommandLine ;
2
+ using ExchangeSharpConsole . Options . Interfaces ;
3
+ using Newtonsoft . Json ;
4
+ using System ;
5
+ using System . Threading . Tasks ;
6
+
7
+ namespace ExchangeSharpConsole . Options
8
+ {
9
+ [ Verb ( "currencies" , HelpText = "Gets a list of currencies available on the exchange" ) ]
10
+ public class CurrenciesOption : BaseOption , IOptionPerExchange
11
+ {
12
+ public string ExchangeName { get ; set ; }
13
+
14
+ public override async Task RunCommand ( )
15
+ {
16
+ using var api = GetExchangeInstance ( ExchangeName ) ;
17
+
18
+ Authenticate ( api ) ;
19
+
20
+ var currencies = await api . GetCurrenciesAsync ( ) ;
21
+
22
+ foreach ( var c in currencies )
23
+ {
24
+ Console . WriteLine ( $ "{ c . Key } : { c . Value . FullName } , { c . Value . AltName } ") ;
25
+ }
26
+ }
27
+ }
28
+ }
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ public partial class Program
18
18
typeof ( CancelOrderOption ) ,
19
19
typeof ( CandlesOption ) ,
20
20
typeof ( ConvertOption ) ,
21
+ typeof ( CurrenciesOption ) ,
21
22
typeof ( ExampleOption ) ,
22
23
typeof ( ExportOption ) ,
23
24
typeof ( InteractiveOption ) ,
You can’t perform that action at this time.
0 commit comments