20#ifndef RIPPLE_PROTOCOL_ASSET_H_INCLUDED
21#define RIPPLE_PROTOCOL_ASSET_H_INCLUDED
23#include <xrpl/basics/Number.h>
24#include <xrpl/basics/base_uint.h>
25#include <xrpl/protocol/Issue.h>
26#include <xrpl/protocol/MPTIssue.h>
33template <
typename TIss>
76 template <Val
idIssueType TIss>
80 template <Val
idIssueType TIss>
84 template <Val
idIssueType TIss>
103 return holds<Issue>() && get<Issue>().native();
106 friend constexpr bool
112 friend constexpr bool
118 friend constexpr bool
130template <Val
idIssueType TIss>
137template <Val
idIssueType TIss>
142 Throw<std::logic_error>(
"Asset is not a requested issue");
146template <Val
idIssueType TIss>
151 Throw<std::logic_error>(
"Asset is not a requested issue");
165 [&]<
typename TLhs,
typename TRhs>(
166 TLhs
const& issLhs, TRhs
const& issRhs) {
168 return issLhs == issRhs;
181 TLhs
const& lhs_, TRhs
const& rhs_) {
186 return std::weak_ordering::greater;
188 return std::weak_ordering::less;
204 [&]<
typename TLhs,
typename TRhs>(
205 TLhs
const& issLhs, TRhs
const& issRhs) {
208 return issLhs.currency == issRhs.currency;
212 return issLhs.getMptID() == issRhs.getMptID();
STAmount operator()(Number const &) const
Asset(MPTIssue const &mptIssue)
Asset(Issue const &issue)
Conversions to Asset are implicit and conversions to specific issue type are explicit.
void setJson(Json::Value &jv) const
Asset(MPTID const &issuanceID)
constexpr value_type const & value() 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.
constexpr TIss const & get() const
AccountID const & getIssuer() const
constexpr bool holds() const
std::string getText() const
friend constexpr bool operator==(Asset const &lhs, Asset const &rhs)
A currency issued by an account.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr bool equalTokens(Asset const &lhs, Asset const &rhs)
bool isXRP(AccountID const &c)
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)
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)