3#include <xrpl/basics/Number.h>
4#include <xrpl/protocol/Asset.h>
5#include <xrpl/protocol/Issue.h>
6#include <xrpl/protocol/STAmount.h>
7#include <xrpl/protocol/UintTypes.h>
9#include <helpers/Account.h>
44 XRPL_ASSERT(!
isXRP(
currency_),
"IOU: currency code must not resolve to XRP");
54 XRPL_ASSERT(!
isXRP(
currency_),
"IOU: currency code must not resolve to XRP");
A currency issued by an account.
Number is a floating point type that can represent a wide range of values.
Asset asset() const
Get the Asset.
STAmount amount(Number const &value) const
Create an STAmount of this IOU from a Number.
AccountID const & issuer() const
Get the issuer account ID.
Currency const & currency() const
Get the currency.
STAmount amount(T value) const
Create an STAmount of this IOU.
IOU(Currency currency, Account const &issuer)
Construct an IOU from a Currency and issuing account.
IOU(std::string_view currencyCode, Account const &issuer)
Construct an IOU from a currency code and issuing account.
Issue issue() const
Get the Issue (currency + issuer pair).
Immutable cryptographic account descriptor.
bool isXRP(AccountID const &c)
BaseUInt< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
STAmount amountFromString(Asset const &asset, std::string const &amount)
bool toCurrency(Currency &, std::string const &)
Tries to convert a string to a Currency, returns true on success.
std::string to_string(BaseUInt< Bits, Tag > const &a)
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.