20 #include <ripple/protocol/Issue.h>
22 #include <ripple/json/json_errors.h>
23 #include <ripple/protocol/AccountID.h>
24 #include <ripple/protocol/UintTypes.h>
25 #include <ripple/protocol/jss.h>
82 Throw<std::runtime_error>(
83 "issueFromJson can only be specified with an 'object' Json value");
92 "issueFromJson currency must be a string Json value");
98 Throw<Json::error>(
"issueFromJson currency must be a valid currency");
105 Throw<Json::error>(
"Issue, XRP should not have issuer");
112 Throw<Json::error>(
"issueFromJson issuer must be a string Json value");
114 auto const issuer = parseBase58<AccountID>(issStr.
asString());
118 Throw<Json::error>(
"issueFromJson issuer must be a valid account");
121 return Issue{currency, *issuer};
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...
bool to_currency(Currency ¤cy, std::string const &code)
Tries to convert a string to a Currency, returns true on success.
A currency issued by an account.
Currency const & noCurrency()
A placeholder for empty currencies.
bool isConsistent(Book const &book)
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
bool isNull() const
isNull() tests to see if this field is null.
std::ostream & operator<<(std::ostream &os, TOffer< TIn, TOut > const &offer)
std::string getText() const
bool isXRP(AccountID const &c)
Issue issueFromJson(Json::Value const &v)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Json::Value to_json(Issue const &is)
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
AccountID const & noAccount()
A placeholder for empty accounts.
std::string asString() const
Returns the unquoted string value.