Class AssetPriceConverter
Converts AssetPrice values between numeric and hexadecimal string representation. When writing, converts ulong to lowercase hex string without leading zeros. When reading, accepts both hex strings and numeric values.
Inheritance
object
JsonConverter
JsonConverter<object>
AssetPriceConverter
Namespace: Xrpl.Client.Json.Converters
Assembly: Xrpl.dll
Syntax
public sealed class AssetPriceConverter : JsonConverter<object>
Methods
| Edit this page View SourceRead(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads an AssetPrice value from JSON, accepting both hex strings and integers.
Returns ulong for numeric/hex input, null for null.
Declaration
public override object Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonReader | reader | |
| Type | typeToConvert | |
| JsonSerializerOptions | options |
Returns
| Type | Description |
|---|---|
| object |
Overrides
System.Text.Json.Serialization.JsonConverter<object>.Read(ref System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions)
|
Edit this page
View Source
Write(Utf8JsonWriter, object, JsonSerializerOptions)
Writes an AssetPrice value to JSON as a lowercase hexadecimal string.
Declaration
public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonWriter | writer | |
| object | value | |
| JsonSerializerOptions | options |
Overrides
System.Text.Json.Serialization.JsonConverter<object>.Write(System.Text.Json.Utf8JsonWriter, object, System.Text.Json.JsonSerializerOptions)