Struct XrplQuality
rippled's Quality: the exchange rate of an offer, in / out, in the 64-bit
encoding the ledger sorts order books by - the exponent plus 100 in the top byte, the
16-digit mantissa below it.
Namespace: Xrpl.Amounts
Assembly: Xrpl.dll
Syntax
public readonly struct XrplQuality
Constructors
|
Edit this page
View Source
XrplQuality(ulong)
A quality from its 64-bit encoding.
Declaration
public XrplQuality(ulong value)
Parameters
| Type |
Name |
Description |
| ulong |
value |
|
Properties
|
Edit this page
View Source
Rate
The rate in / out the encoding holds (Quality::rate()); zero for the
zero quality.
Declaration
public XrplNumber Rate { get; }
Property Value
|
Edit this page
View Source
Value
The 64-bit encoding. Zero is the quality of an offer that gives nothing.
Declaration
public ulong Value { get; }
Property Value
Methods
|
Edit this page
View Source
CeilIn(XrplAmount, XrplAmount, XrplAmount, LedgerRules)
Declaration
public (XrplAmount In, XrplAmount Out) CeilIn(XrplAmount @in, XrplAmount @out, XrplAmount limit, LedgerRules rules = null)
Parameters
Returns
|
Edit this page
View Source
CeilInStrict(XrplAmount, XrplAmount, XrplAmount, bool, LedgerRules)
Declaration
public (XrplAmount In, XrplAmount Out) CeilInStrict(XrplAmount @in, XrplAmount @out, XrplAmount limit, bool roundUp, LedgerRules rules = null)
Parameters
Returns
|
Edit this page
View Source
CeilOut(XrplAmount, XrplAmount, XrplAmount, LedgerRules)
Declaration
public (XrplAmount In, XrplAmount Out) CeilOut(XrplAmount @in, XrplAmount @out, XrplAmount limit, LedgerRules rules = null)
Parameters
Returns
|
Edit this page
View Source
CeilOutStrict(XrplAmount, XrplAmount, XrplAmount, bool, LedgerRules)
Declaration
public (XrplAmount In, XrplAmount Out) CeilOutStrict(XrplAmount @in, XrplAmount @out, XrplAmount limit, bool roundUp, LedgerRules rules = null)
Parameters
Returns
|
Edit this page
View Source
CompareTo(XrplQuality)
Orders qualities from worse to better: a better quality compares greater.
Declaration
public int CompareTo(XrplQuality other)
Parameters
Returns
|
Edit this page
View Source
Equals(object)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
The object to compare with the current instance.
|
Returns
| Type |
Description |
| bool |
true if obj and this instance are the same type and represent the same value; otherwise, false.
|
Overrides
System.ValueType.Equals(object)
|
Edit this page
View Source
Equals(XrplQuality)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(XrplQuality other)
Parameters
| Type |
Name |
Description |
| XrplQuality |
other |
An object to compare with this object.
|
Returns
| Type |
Description |
| bool |
true if the current object is equal to the other parameter; otherwise, false.
|
|
Edit this page
View Source
FromAmounts(XrplAmount, XrplAmount, LedgerRules)
The quality of an offer that takes in and gives out
(Quality(Amounts), getRate(out, in)).
Declaration
public static XrplQuality FromAmounts(XrplAmount @in, XrplAmount @out, LedgerRules rules = null)
Parameters
Returns
|
Edit this page
View Source
FromBookDirectory(string)
The quality an order book directory is sorted by: the last 16 hex digits of its index,
the BookDirectory of an offer. rippled crosses an offer at this quality, set
when the offer was placed, not at the ratio of what the offer has left.
Declaration
public static XrplQuality FromBookDirectory(string bookDirectory)
Parameters
| Type |
Name |
Description |
| string |
bookDirectory |
|
Returns
Exceptions
| Type |
Condition |
| FormatException |
The text is not a 64-character hex index.
|
|
Edit this page
View Source
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| int |
A 32-bit signed integer that is the hash code for this instance.
|
Overrides
System.ValueType.GetHashCode()
|
Edit this page
View Source
Round(int)
Quality::round: the quality with its mantissa rounded up, to a worse quality, to
digits significant digits - the rounding a tick size applies to an offer.
Declaration
public XrplQuality Round(int digits)
Parameters
| Type |
Name |
Description |
| int |
digits |
The significant digits to keep, 1 to 16; 16 leaves the quality as it is.
|
Returns
Exceptions
| Type |
Condition |
| ArgumentOutOfRangeException |
digits is outside 1 to 16.
|
|
Edit this page
View Source
ToString()
The encoding in hex, as rippled logs it.
Declaration
public override string ToString()
Returns
Overrides
System.ValueType.ToString()
|
Edit this page
View Source
WithinRelativeDistance(XrplQuality, XrplQuality, XrplNumber, LedgerRules)
Whether two qualities are within a relative distance of each other, as rippled's
withinRelativeDistance(Quality, Quality, Number) decides it from their rates.
Declaration
public static bool WithinRelativeDistance(XrplQuality calculated, XrplQuality requested, XrplNumber distance, LedgerRules rules = null)
Parameters
Returns
Operators
|
Edit this page
View Source
operator ==(XrplQuality, XrplQuality)
Declaration
public static bool operator ==(XrplQuality left, XrplQuality right)
Parameters
Returns
|
Edit this page
View Source
operator >(XrplQuality, XrplQuality)
left is the better quality.
Declaration
public static bool operator >(XrplQuality left, XrplQuality right)
Parameters
Returns
|
Edit this page
View Source
operator >=(XrplQuality, XrplQuality)
Declaration
public static bool operator >=(XrplQuality left, XrplQuality right)
Parameters
Returns
|
Edit this page
View Source
operator !=(XrplQuality, XrplQuality)
Declaration
public static bool operator !=(XrplQuality left, XrplQuality right)
Parameters
Returns
|
Edit this page
View Source
operator <(XrplQuality, XrplQuality)
left is the worse quality.
Declaration
public static bool operator <(XrplQuality left, XrplQuality right)
Parameters
Returns
|
Edit this page
View Source
operator <=(XrplQuality, XrplQuality)
Declaration
public static bool operator <=(XrplQuality left, XrplQuality right)
Parameters
Returns