3#include <test/jtx/Account.h>
4#include <test/jtx/tags.h>
6#include <xrpl/basics/Number.h>
7#include <xrpl/basics/contract.h>
8#include <xrpl/json/json_value.h>
9#include <xrpl/protocol/AccountID.h>
10#include <xrpl/protocol/Asset.h>
11#include <xrpl/protocol/Concepts.h>
12#include <xrpl/protocol/Indexes.h>
13#include <xrpl/protocol/Issue.h>
14#include <xrpl/protocol/MPTIssue.h>
15#include <xrpl/protocol/STAmount.h>
16#include <xrpl/protocol/STBase.h>
17#include <xrpl/protocol/UintTypes.h>
18#include <xrpl/protocol/XRPAmount.h>
101 :
amount_((v > 0) ? v : -v, v < 0)
175 template <
typename A>
176 requires std::convertible_to<A, Asset>
185 [[nodiscard]]
Asset const&
201 template <std::
integral T>
234 template <Val
idIssueType TIss>
238 return asset_.holds<TIss>();
317 if (
double(d) / c != v)
322 if (
double(d) / c != v)
359template <
class Integer>
567 operator()(T v)
const
A currency issued by an account.
Number is a floating point type that can represent a wide range of values.
static RoundingMode getround()
Immutable cryptographic account descriptor.
AccountID id() const
Returns the Account ID.
Converts to IOU Issue or STAmount.
IOU(Account account, xrpl::Currency const ¤cy)
PrettyAmount operator()(T v) const
None operator()(NoneT) const
Returns None-of-Issue.
friend BookSpec operator~(IOU const &iou)
Converts to MPT Issue or STAmount.
operator xrpl::MPTIssue() const
Implicit conversion to MPTIssue or asset.
friend BookSpec operator~(MPT const &mpt)
xrpl::MPTIssue mptIssue() const
Explicit conversion to MPTIssue or asset.
PrettyAmount operator()(detail::EpsilonMultiple) const
MPT(AccountID const &account, std::int32_t seq=0)
PrettyAmount operator()(EpsilonT) const
xrpl::MPTID const & mpt() const
MPT(std::string n, xrpl::MPTID const &issuanceID)
operator xrpl::Asset() const
None operator()(NoneT) const
Returns None-of-Issue.
static EpsilonT const kEpsilon
constexpr XRPAmount kJtxDropsPerXrp
XrpT const XRP
Converts to XRP Issue or STAmount.
std::ostream & operator<<(std::ostream &os, PrettyAmount const &amount)
AnyT const kAny
Returns an amount representing "any issuer".
bool operator==(Account const &lhs, Account const &rhs) noexcept
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
constexpr XRPAmount
Convert XRP to drops (integral types).
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
T get(Section const §ion, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
int scale(Number const &number, Asset const &asset)
Get the scale of a Number for a given asset.
BaseUInt< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
STAmount amountFromString(Asset const &asset, std::string const &amount)
Currency const & xrpCurrency()
XRP currency.
json::Value toJson(Asset const &asset)
BaseUInt< 192 > MPTID
MPTID is a 192-bit value representing MPT Issuance ID, which is a concatenation of a 32-bit sequence ...
MPTID makeMptID(std::uint32_t const sequence, AccountID const &account)
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
AccountID const & xrpAccount()
Compute AccountID from public key.
XRPL_NO_SANITIZE_ADDRESS void Throw(Args &&... args)
Amount specifier with an option for any issuer.
AnyAmount(AnyAmount const &)=default
AnyAmount(STAmount amount)
void to(AccountID const &id)
AnyAmount & operator=(AnyAmount const &)=default
AnyAmount(STAmount amount, AnyT const *)
AnyAmount operator()(STAmount const &sta) const
BookSpec(xrpl::Asset const &asset)
detail::EpsilonMultiple operator()(std::size_t n) const
Represents an XRP, IOU, or MPT quantity This customizes the string conversion and supports XRP conver...
PrettyAmount(STAmount amount, std::string name)
std::string const & name() const
PrettyAmount(PrettyAmount const &)=default
STAmount const & value() const
PrettyAmount(XRPAmount v)
drops
PrettyAmount & operator=(PrettyAmount const &)=default
PrettyAsset(A const &asset, std::uint32_t scale=1)
PrettyAsset(Asset const &asset, std::uint32_t scale=1)
None operator()(NoneT) const
PrettyAmount operator()(Number v, Number::RoundingMode rounding=Number::getround()) const
Asset const & raw() const
PrettyAmount operator()(T v, Number::RoundingMode rounding=Number::getround()) const
PrettyAmount operator()(double v) const
PrettyAmount operator()(Number v) const
Returns an amount of XRP as PrettyAmount, which is trivially convertible to STAmount.
None operator()(NoneT) const
Returns None-of-XRP.
friend BookSpec operator~(XrpT const &)
PrettyAmount operator()(T v) const
Returns an amount of XRP as PrettyAmount, which is trivially convertible to STAmount.