#ifndef BITCOIN_OUTPUTTYPE_H
#define BITCOIN_OUTPUTTYPE_H
#include <addresstype.h>
#include <script/signingprovider.h>
#include <array>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
enum class OutputType {
LEGACY,
P2SH_SEGWIT,
BECH32,
BECH32M,
UNKNOWN,
};
static constexpr auto OUTPUT_TYPES = std::array{
OutputType::LEGACY,
OutputType::P2SH_SEGWIT,
OutputType::BECH32,
OutputType::BECH32M,
};
std::optional<OutputType> ParseOutputType(std::string_view str);
const std::string& FormatOutputType(OutputType type);
std::string FormatAllOutputTypes();
CTxDestination AddAndGetDestinationForScript(FlatSigningProvider& keystore, const CScript& script, OutputType);
std::optional<OutputType> OutputTypeFromDestination(const CTxDestination& dest);
#endif