Class Currency
The XRP Ledger has two kinds of digital asset: XRP and tokens.
Both types have high precision, although their formats are different
Inheritance
Namespace: Xrpl.Models.Common
Assembly: Xrpl.dll
Syntax
public class Currency
Constructors
| Edit this page View SourceCurrency()
base constructor.
Declaration
public Currency()
Properties
| Edit this page View SourceCurrencyCode
The standard format for currency codes is a three-character string such as USD.
This is intended for use with ISO 4217 Currency Codes
As a 160-bit hexadecimal string, such as "0158415500000000C1F76FF6ECB0BAC600000000".
The following characters are permitted:
all uppercase and lowercase letters, digits, as well as the symbols ? ! @ # $ % ^ * ( ) { } [ ] | and symbols ampersand, less, greater
Currency codes are case-sensitive.
Declaration
[JsonPropertyName("currency")]
public string CurrencyCode { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
CurrencyValidName
Readable currency name
Declaration
[JsonIgnore]
public string CurrencyValidName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Issuer
Generally, the account that issues this token.
In special cases, this can refer to the account that holds the token instead.
Declaration
[JsonPropertyName("issuer")]
public string Issuer { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
MPTokenIssuanceID
The ID of the MPT to authorize.
Declaration
[JsonPropertyName("mpt_issuance_id")]
public string MPTokenIssuanceID { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Value
Quoted decimal representation of the amount of the token.
This can include scientific notation, such as 1.23e11 meaning 123,000,000,000.
Both e and E may be used.
This can be negative when displaying balances, but negative values are disallowed in other contexts such as specifying how much to send.
Declaration
[JsonPropertyName("value")]
public string Value { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ValueAsNumber
decimal currency amount (drops for XRP)
Declaration
[JsonIgnore]
public decimal ValueAsNumber { get; set; }
Property Value
| Type | Description |
|---|---|
| decimal |
ValueAsXrp
XRP token amount (non drops value)
Declaration
[JsonIgnore]
public decimal? ValueAsXrp { get; set; }
Property Value
| Type | Description |
|---|---|
| decimal? |
Methods
| Edit this page View SourceEquals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object o)
Parameters
| Type | Name | Description |
|---|---|---|
| object | o |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
Operators
| Edit this page View Sourceoperator ==(Currency?, Currency?)
Declaration
public static bool operator ==(Currency? left, Currency? right)
Parameters
| Type | Name | Description |
|---|---|---|
| Currency | left | |
| Currency | right |
Returns
| Type | Description |
|---|---|
| bool |
implicit operator Currency(decimal)
Implicit conversion from decimal → Currency
Declaration
public static implicit operator Currency(decimal value)
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | value | value |
Returns
| Type | Description |
|---|---|
| Currency | currency |
implicit operator Currency(double)
Implicit conversion from double → Currency
Declaration
public static implicit operator Currency(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| double | value | value |
Returns
| Type | Description |
|---|---|
| Currency | currency |
implicit operator Currency(int)
Implicit conversion from int → Currency
Declaration
public static implicit operator Currency(int value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | value | value |
Returns
| Type | Description |
|---|---|
| Currency | currency |
implicit operator Currency(string)
Implicit conversion from string → Currency
Declaration
public static implicit operator Currency(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | value |
Returns
| Type | Description |
|---|---|
| Currency | currency |
implicit operator Currency(uint)
Implicit conversion from uint → Currency
Declaration
public static implicit operator Currency(uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | value | value |
Returns
| Type | Description |
|---|---|
| Currency | currency |
operator !=(Currency?, Currency?)
Declaration
public static bool operator !=(Currency? left, Currency? right)
Parameters
| Type | Name | Description |
|---|---|---|
| Currency | left | |
| Currency | right |
Returns
| Type | Description |
|---|---|
| bool |