20#include <xrpl/protocol/STCurrency.h>
21#include <xrpl/protocol/jss.h>
23#include <xrpl/basics/contract.h>
37 :
STBase{name}, currency_{currency}
69 return v && (*v == *
this);
81 return std::make_unique<STCurrency>(sit, name);
93 return emplace(n, buf, std::move(*
this));
101 Throw<std::runtime_error>(
102 "currencyFromJson currency must be a string Json value");
108 Throw<std::runtime_error>(
109 "currencyFromJson currency must be a valid currency");
std::string asString() const
Returns the unquoted string value.
A type which can be exported to a well known binary format.
static STBase * emplace(std::size_t n, void *buf, T &&val)
bool isDefault() const override
void add(Serializer &s) const override
SerializedTypeID getSType() const override
Json::Value getJson(JsonOptions) const override
std::string getText() const override
bool isEquivalent(const STBase &t) const override
static std::unique_ptr< STCurrency > construct(SerialIter &, SField const &name)
STBase * move(std::size_t n, void *buf) override
STBase * copy(std::size_t n, void *buf) const override
int addBitString(base_uint< Bits, Tag > const &v)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...
bool isXRP(AccountID const &c)
STCurrency currencyFromJson(SField const &name, Json::Value const &v)
Currency const & noCurrency()
A placeholder for empty currencies.
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.
Note, should be treated as flags that can be | and &.