Class OracleCurrencyConverter
Converts Oracle currency identifiers (BaseAsset/QuoteAsset) following XRPL Currency rules: standard codes are exactly three characters as plain strings; nonstandard codes use 40-character hex (see Currency formats). Serialization matches CurrencyToHex(string).
Inheritance
object
JsonConverter
JsonConverter<string>
OracleCurrencyConverter
Namespace: Xrpl.Client.Json.Converters
Assembly: Xrpl.dll
Syntax
public sealed class OracleCurrencyConverter : JsonConverter<string>
Methods
| Edit this page View SourceRead(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads an Oracle currency from JSON, accepting both hex strings and plain currency codes.
Declaration
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonReader | reader | |
| Type | typeToConvert | |
| JsonSerializerOptions | options |
Returns
| Type | Description |
|---|---|
| string |
Overrides
System.Text.Json.Serialization.JsonConverter<string>.Read(ref System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions)
|
Edit this page
View Source
Write(Utf8JsonWriter, string, JsonSerializerOptions)
Writes an Oracle currency using the same rules as CurrencyToHex(string).
Declaration
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonWriter | writer | |
| string | value | |
| JsonSerializerOptions | options |
Overrides
System.Text.Json.Serialization.JsonConverter<string>.Write(System.Text.Json.Utf8JsonWriter, string, System.Text.Json.JsonSerializerOptions)