Class Currency
Class defining how to encode and decode Currencies
Inheritance
System.Object
Currency
Assembly: Xrpl.BinaryCodec.dll
Syntax
public class Currency : Hash160, ISerializedType
Constructors
|
Improve this Doc
View Source
Currency(Byte[])
Constructs a Currency object
Declaration
public Currency(byte[] buffer)
Parameters
Type |
Name |
Description |
System.Byte[] |
buffer |
bytes buffer
|
Fields
|
Improve this Doc
View Source
IsNative
Test if this amount is in units of Native Currency(XRP)
Declaration
public readonly bool IsNative
Field Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsoCode
ISO code of this currency
Declaration
public readonly string IsoCode
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Xrp
Declaration
public static readonly Currency Xrp
Field Value
Methods
|
Improve this Doc
View Source
EncodeCurrency(String)
The following are static methods, legacy from when there was no
usage of Currency objects, just String with "XRP" ambiguity.
Declaration
public static byte[] EncodeCurrency(string currencyCode)
Parameters
Type |
Name |
Description |
System.String |
currencyCode |
currency code
|
Returns
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
FromJson(JToken)
decode currency from json field
Declaration
public static Currency FromJson(JToken token)
Parameters
Type |
Name |
Description |
JToken |
token |
json field
|
Returns
|
Improve this Doc
View Source
FromParser(BinaryParser, Nullable<Int32>)
Defines how to read a Currency from a BinaryParser
Declaration
public static Currency FromParser(BinaryParser parser, int? hint = null)
Parameters
Type |
Name |
Description |
BinaryParser |
parser |
The binary parser to read Currency
|
System.Nullable<System.Int32> |
hint |
|
Returns
|
Improve this Doc
View Source
FromString(String)
decode currency from string
Declaration
public static Currency FromString(string str)
Parameters
Type |
Name |
Description |
System.String |
str |
string currency code
|
Returns
|
Improve this Doc
View Source
GetCurrencyCodeFromTlcBytes(Byte[], out Boolean)
get currency code from bytes
Declaration
public static string GetCurrencyCodeFromTlcBytes(byte[] bytes, out bool isNative)
Parameters
Type |
Name |
Description |
System.Byte[] |
bytes |
bytes
|
System.Boolean |
isNative |
will true if currency is XRP
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
Operators
|
Improve this Doc
View Source
Division(Currency, AccountId)
Declaration
public static Issue operator /(Currency c, AccountId ac)
Parameters
Returns
|
Improve this Doc
View Source
Implicit(JToken to Currency)
Declaration
public static implicit operator Currency(JToken v)
Parameters
Type |
Name |
Description |
JToken |
v |
|
Returns
|
Improve this Doc
View Source
Implicit(String to Currency)
Declaration
public static implicit operator Currency(string v)
Parameters
Type |
Name |
Description |
System.String |
v |
|
Returns
|
Improve this Doc
View Source
Implicit(Currency to JToken)
Declaration
public static implicit operator JToken(Currency v)
Parameters
Returns
Implements
IEquatable<>