| 21 | static const std::string OUTPUT_TYPE_STRING_UNKNOWN = "unknown"; |
| 22 | |
| 23 | std::optional<OutputType> ParseOutputType(std::string_view type) |
| 24 | { |
| 25 | if (type == OUTPUT_TYPE_STRING_LEGACY) { |
| 26 | return OutputType::LEGACY; |
| 27 | } else if (type == OUTPUT_TYPE_STRING_P2SH_SEGWIT) { |
| 28 | return OutputType::P2SH_SEGWIT; |
| 29 | } else if (type == OUTPUT_TYPE_STRING_BECH32) { |
| 30 | return OutputType::BECH32; |
| 31 | } else if (type == OUTPUT_TYPE_STRING_BECH32M) { |
| 32 | return OutputType::BECH32M; |
| 33 | } |
| 34 | return std::nullopt; |
| 35 | } |
| 36 | |
| 37 | const std::string& FormatOutputType(OutputType type) |
| 38 | { |
no outgoing calls