1#include <xrpl/basics/contract.h>
2#include <xrpl/json/json_value.h>
3#include <xrpl/protocol/SField.h>
4#include <xrpl/protocol/STBase.h>
5#include <xrpl/protocol/STCurrency.h>
6#include <xrpl/protocol/Serializer.h>
7#include <xrpl/protocol/UintTypes.h>
27 :
STBase{name}, currency_{currency}
59 return v && (*v == *
this);
83 return emplace(n, buf, std::move(*
this));
91 Throw<std::runtime_error>(
92 "currencyFromJson currency must be a string Json value");
98 Throw<std::runtime_error>(
99 "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 isEquivalent(STBase const &t) const override
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
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 &.