(
action: string,
options: Record<string, string | boolean>,
common: CommandCommonOptions & { help?: boolean }
)
| 162 | } |
| 163 | |
| 164 | function parseMarketCommand( |
| 165 | action: string, |
| 166 | options: Record<string, string | boolean>, |
| 167 | common: CommandCommonOptions & { help?: boolean } |
| 168 | ): ParsedCliCommand { |
| 169 | assertAllowedOptions(options, new Set([...GLOBAL_OPTION_NAMES, "levels", "interval", "limit"])); |
| 170 | if (action === "ticker") return { kind: "market-ticker", ...common }; |
| 171 | if (action === "depth") { |
| 172 | const levels = readNumberOption(options, ["levels"]); |
| 173 | return { kind: "market-depth", levels, ...common }; |
| 174 | } |
| 175 | if (action === "kline") { |
| 176 | const interval = requireStringOption(options, ["interval"], "Missing required option --interval"); |
| 177 | const limit = readNumberOption(options, ["limit"]); |
| 178 | return { kind: "market-kline", interval, limit, ...common }; |
| 179 | } |
| 180 | throw new CommandParseError(`Unsupported market action '${action}'`); |
| 181 | } |
| 182 | |
| 183 | function parseAccountCommand( |
| 184 | action: string, |
no test coverage detected