3#include <xrpl/basics/Number.h>
4#include <xrpl/basics/base_uint.h>
5#include <xrpl/protocol/Issue.h>
6#include <xrpl/protocol/MPTIssue.h>
13template <
typename TIss>
54 template <Val
idIssueType TIss>
58 template <Val
idIssueType TIss>
62 template <Val
idIssueType TIss>
84 return issue.native();
97 return issue.native();
104 friend constexpr bool
110 friend constexpr bool
116 friend constexpr bool
128template <Val
idIssueType TIss>
135template <Val
idIssueType TIss>
140 Throw<std::logic_error>(
"Asset is not a requested issue");
144template <Val
idIssueType TIss>
149 Throw<std::logic_error>(
"Asset is not a requested issue");
163 [&]<
typename TLhs,
typename TRhs>(TLhs
const& issLhs, TRhs
const& issRhs) {
165 return issLhs == issRhs;
181 return std::weak_ordering::greater;
183 return std::weak_ordering::less;
199 [&]<
typename TLhs,
typename TRhs>(TLhs
const& issLhs, TRhs
const& issRhs) {
201 return issLhs.currency == issRhs.currency;
203 return issLhs.getMptID() == issRhs.getMptID();
constexpr TIss const & get() const
STAmount operator()(Number const &) const
std::string getText() const
Asset(Issue const &issue)
Conversions to Asset are implicit and conversions to specific issue type are explicit.
AccountID const & getIssuer() const
friend constexpr std::weak_ordering operator<=>(Asset const &lhs, Asset const &rhs)
friend constexpr bool equalTokens(Asset const &lhs, Asset const &rhs)
Return true if both assets refer to the same currency (regardless of issuer) or MPT issuance.
void setJson(Json::Value &jv) const
Asset(MPTID const &issuanceID)
constexpr bool holds() const
Asset(MPTIssue const &mptIssue)
friend constexpr bool operator==(Asset const &lhs, Asset const &rhs)
constexpr value_type const & value() const
A currency issued by an account.
Number is a floating point type that can represent a wide range of values.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool isXRP(AccountID const &c)
bool validJSONAsset(Json::Value const &jv)
std::string to_string(base_uint< Bits, Tag > const &a)
constexpr bool operator==(base_uint< Bits, Tag > const &lhs, base_uint< Bits, Tag > const &rhs)
constexpr std::strong_ordering operator<=>(base_uint< Bits, Tag > const &lhs, base_uint< Bits, Tag > const &rhs)
Asset assetFromJson(Json::Value const &jv)
Json::Value to_json(Asset const &asset)
constexpr bool equalTokens(Asset const &lhs, Asset const &rhs)