Show / Hide Table of Contents

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
object
Currency
Namespace: Xrpl.Models.Common
Assembly: Xrpl.dll
Syntax
public class Currency

Constructors

| Edit this page View Source

Currency()

base constructor.

Declaration
public Currency()

Properties

| Edit this page View Source

CurrencyCode

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
| Edit this page View Source

CurrencyValidName

Readable currency name

Declaration
[JsonIgnore]
public string CurrencyValidName { get; }
Property Value
Type Description
string
| Edit this page View Source

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
| Edit this page View Source

MPTokenIssuanceID

The ID of the MPT to authorize.

Declaration
[JsonPropertyName("mpt_issuance_id")]
public string MPTokenIssuanceID { get; set; }
Property Value
Type Description
string
| Edit this page View Source

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
| Edit this page View Source

ValueAsNumber

decimal currency amount (drops for XRP)

Declaration
[JsonIgnore]
public decimal ValueAsNumber { get; set; }
Property Value
Type Description
decimal
| Edit this page View Source

ValueAsXrp

XRP token amount (non drops value)

Declaration
[JsonIgnore]
public decimal? ValueAsXrp { get; set; }
Property Value
Type Description
decimal?

Methods

| Edit this page View Source

Equals(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
object.Equals(object)
| Edit this page View Source

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
object.ToString()

Operators

| Edit this page View Source

operator ==(Currency?, Currency?)

Declaration
public static bool operator ==(Currency? left, Currency? right)
Parameters
Type Name Description
Currency left
Currency right
Returns
Type Description
bool
| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

operator !=(Currency?, Currency?)

Declaration
public static bool operator !=(Currency? left, Currency? right)
Parameters
Type Name Description
Currency left
Currency right
Returns
Type Description
bool

Extension Methods

CurrencyExtensions.GetValue(Currency, int?)
CurrencyExtensions.IsLpToken(Currency)
CurrencyExtensions.IsMPTToken(Currency)
CurrencyExtensions.IsNFT14D(Currency)
CurrencyExtensions.IsXrp(Currency)
CurrencyExtensions.ToIssued(Currency)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX