messages.h raw
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-present The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6 //! @file common/messages.h is a home for simple string functions returning
7 //! descriptive messages that are used in RPC and GUI interfaces or log
8 //! messages, and are called in different parts of the codebase across
9 //! node/wallet/gui boundaries.
10
11 #ifndef BITCOIN_COMMON_MESSAGES_H
12 #define BITCOIN_COMMON_MESSAGES_H
13
14 #include <string>
15 #include <string_view>
16
17 struct bilingual_str;
18
19 enum class FeeEstimateMode;
20 enum class FeeReason;
21 namespace node {
22 enum class TransactionError;
23 } // namespace node
24
25 namespace common {
26 enum class PSBTError;
27 bool FeeModeFromString(std::string_view mode_string, FeeEstimateMode& fee_estimate_mode);
28 std::string StringForFeeReason(FeeReason reason);
29 std::string FeeModes(const std::string& delimiter);
30 std::string FeeModeInfo(std::pair<std::string, FeeEstimateMode>& mode);
31 std::string FeeModesDetail(std::string default_info);
32 std::string InvalidEstimateModeErrorMessage();
33 bilingual_str PSBTErrorString(PSBTError error);
34 bilingual_str TransactionErrorString(node::TransactionError error);
35 bilingual_str ResolveErrMsg(const std::string& optname, const std::string& strBind);
36 bilingual_str InvalidPortErrMsg(const std::string& optname, const std::string& strPort);
37 bilingual_str AmountHighWarn(const std::string& optname);
38 bilingual_str AmountErrMsg(const std::string& optname, const std::string& strValue);
39 } // namespace common
40
41 #endif // BITCOIN_COMMON_MESSAGES_H
42