20#include <xrpl/protocol/Issue.h>
22#include <xrpl/json/json_errors.h>
23#include <xrpl/protocol/AccountID.h>
24#include <xrpl/protocol/UintTypes.h>
25#include <xrpl/protocol/jss.h>
94 Throw<std::runtime_error>(
95 "issueFromJson can only be specified with an 'object' Json value");
98 if (v.
isMember(jss::mpt_issuance_id))
100 Throw<std::runtime_error>(
101 "issueFromJson, Issue should not have mpt_issuance_id");
110 "issueFromJson currency must be a string Json value");
116 Throw<Json::error>(
"issueFromJson currency must be a valid currency");
123 Throw<Json::error>(
"Issue, XRP should not have issuer");
130 Throw<Json::error>(
"issueFromJson issuer must be a string Json value");
132 auto const issuer = parseBase58<AccountID>(issStr.
asString());
136 Throw<Json::error>(
"issueFromJson issuer must be a valid account");
139 return Issue{currency, *issuer};
std::string asString() const
Returns the unquoted string value.
bool isNull() const
isNull() tests to see if this field is null.
bool isMember(const char *key) const
Return true if the object has a member named key.
A currency issued by an account.
std::string getText() const
void setJson(Json::Value &jv) const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
AccountID const & noAccount()
A placeholder for empty accounts.
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...
bool isConsistent(Book const &book)
bool isXRP(AccountID const &c)
Currency const & noCurrency()
A placeholder for empty currencies.
std::ostream & operator<<(std::ostream &out, base_uint< Bits, Tag > const &u)
Json::Value to_json(Asset const &asset)
Issue issueFromJson(Json::Value const &v)
std::string to_string(base_uint< Bits, Tag > const &a)
bool to_currency(Currency &, std::string const &)
Tries to convert a string to a Currency, returns true on success.