(String[] args)
| 15 | public class FetchMarkets { |
| 16 | |
| 17 | public static void main(String[] args) { |
| 18 | String filterType = args.length > 0 ? args[0] : null; // "spot", "swap", "future", "option" |
| 19 | |
| 20 | if (filterType != null) System.out.println("Filter: " + filterType); |
| 21 | System.out.println(); |
| 22 | |
| 23 | Binance exchange = new Binance(); |
| 24 | |
| 25 | Map<String, MarketInterface> markets = exchange.loadMarkets(false); |
| 26 | |
| 27 | System.out.printf("%-16s %-8s %-6s %-8s %-12s %-14s %-14s%n", |
| 28 | "Symbol", "Type", "Active", "Base", "Quote", "Price Prec", "Amount Prec"); |
| 29 | System.out.println("-".repeat(82)); |
| 30 | |
| 31 | int count = 0; |
| 32 | for (MarketInterface m : markets.values()) { |
| 33 | // Apply type filter if specified |
| 34 | if (filterType != null && !filterType.equals(m.type)) continue; |
| 35 | |
| 36 | // Show first 30 markets to keep output manageable |
| 37 | if (++count > 30) { |
| 38 | System.out.println("... (showing first 30 of " + markets.size() + " markets)"); |
| 39 | break; |
| 40 | } |
| 41 | |
| 42 | System.out.printf("%-16s %-8s %-6s %-8s %-12s %-14s %-14s%n", |
| 43 | m.symbol, |
| 44 | m.type, |
| 45 | m.active, |
| 46 | m.base, |
| 47 | m.quote, |
| 48 | m.precision != null ? m.precision.price : "n/a", |
| 49 | m.precision != null ? m.precision.amount : "n/a"); |
| 50 | } |
| 51 | |
| 52 | System.out.println("\nTotal markets loaded: " + markets.size()); |
| 53 | } |
| 54 | } |
nothing calls this directly
no test coverage detected