20#include <xrpl/basics/contract.h>
21#include <xrpl/json/json_errors.h>
22#include <xrpl/json/json_value.h>
23#include <xrpl/protocol/AccountID.h>
24#include <xrpl/protocol/Issue.h>
25#include <xrpl/protocol/UintTypes.h>
26#include <xrpl/protocol/jss.h>
99 Throw<std::runtime_error>(
100 "issueFromJson can only be specified with an 'object' Json value");
103 if (v.
isMember(jss::mpt_issuance_id))
105 Throw<std::runtime_error>(
106 "issueFromJson, Issue should not have mpt_issuance_id");
115 "issueFromJson currency must be a string Json value");
121 Throw<Json::error>(
"issueFromJson currency must be a valid currency");
128 Throw<Json::error>(
"Issue, XRP should not have issuer");
135 Throw<Json::error>(
"issueFromJson issuer must be a string Json value");
137 auto const issuer = parseBase58<AccountID>(issStr.
asString());
141 Throw<Json::error>(
"issueFromJson issuer must be a valid account");
144 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(char const *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.