19 static const std::map<FeeReason, std::string> fee_reason_strings = {
30 auto reason_string = fee_reason_strings.find(reason);
32 if (reason_string == fee_reason_strings.end())
return "Unknown";
34 return reason_string->second;
37 const std::vector<std::pair<std::string, FeeEstimateMode>>&
FeeModeMap()
39 static const std::vector<std::pair<std::string, FeeEstimateMode>> FEE_MODES = {
47 std::string
FeeModes(
const std::string& delimiter)
49 return Join(
FeeModeMap(), delimiter, [&](
const std::pair<std::string, FeeEstimateMode>& i) {
return i.first; });
54 return "Invalid estimate_mode parameter, must be one of: \"" +
FeeModes(
"\", \"") +
"\"";
59 auto searchkey =
ToUpper(mode_string);
61 if (
ToUpper(pair.first) == searchkey) {
62 fee_estimate_mode = pair.second;
@ CONSERVATIVE
Force estimateSmartFee to use conservative estimates.
@ UNSET
Use default settings based on other criteria.
@ ECONOMICAL
Force estimateSmartFee to use non-conservative estimates.
auto Join(const C &container, const S &separator, UnaryOp unary_op)
Join all container items.
const std::vector< std::pair< std::string, FeeEstimateMode > > & FeeModeMap()
std::string FeeModes(const std::string &delimiter)
std::string InvalidEstimateModeErrorMessage()
bool FeeModeFromString(const std::string &mode_string, FeeEstimateMode &fee_estimate_mode)
std::string StringForFeeReason(FeeReason reason)
std::string ToUpper(std::string_view str)
Returns the uppercase equivalent of the given string.