XRPL Amount Models

An Amount is an object specifying a currency, a quantity of that currency, and the counterparty (issuer) on the trustline that holds the value. For XRP, there is no counterparty.

class xrpl.models.amounts.IssuedCurrencyAmount(*args: List[Any], **kwargs: Dict[str, Any])

Bases: xrpl.models.currencies.issued_currency.IssuedCurrency

Specifies an amount in an issued currency.

See https://xrpl.org/currency-formats.html#issued-currency-amounts.

value: str = <object object>

This field is required.

xrpl.models.amounts.is_issued_currency(amount: Union[xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount, str])bool

Returns whether amount is an issued currency value, as opposed to an XRP value.

Parameters

amount – The Amount object whose type is being checked.

Returns

Whether the amount is an issued currency value.

xrpl.models.amounts.is_xrp(amount: Union[xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount, str])bool

Returns whether amount is an XRP value, as opposed to an issued currency.

Parameters

amount – The Amount object whose type is being checked.

Returns

Whether the amount is an XRP value.

xrpl.models.amounts.Amount

The central part of internal API.

This represents a generic version of type ‘origin’ with type arguments ‘params’. There are two kind of these aliases: user defined and special. The special ones are wrappers around builtin collections and ABCs in collections.abc. These must have ‘name’ always set. If ‘inst’ is False, then the alias can’t be instantiated, this is used by e.g. typing.List and typing.Dict.

alias of Union[xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount, str]