Class XrplNumberJsonConverter
Reads an XrplNumber from a JSON string or number and writes it as the string rippled writes for the field. Applied to XrplNumber itself, so no registration is needed.
Namespace: Xrpl.BinaryCodec.Numbers
Assembly: Xrpl.BinaryCodec.dll
Syntax
public sealed class XrplNumberJsonConverter : JsonConverter<XrplNumber>
Methods
| Edit this page View SourceRead(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type XrplNumber.
Declaration
public override XrplNumber Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonReader | reader | The reader. |
| Type | typeToConvert | The type to convert. |
| JsonSerializerOptions | options | An object that specifies serialization options to use. |
Returns
| Type | Description |
|---|---|
| XrplNumber | The converted value. |
Overrides
System.Text.Json.Serialization.JsonConverter<Xrpl.BinaryCodec.Numbers.XrplNumber>.Read(ref System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions)
|
Edit this page
View Source
Write(Utf8JsonWriter, XrplNumber, JsonSerializerOptions)
Writes a specified value as JSON.
Declaration
public override void Write(Utf8JsonWriter writer, XrplNumber value, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonWriter | writer | The writer to write to. |
| XrplNumber | value | The value to convert to JSON. |
| JsonSerializerOptions | options | An object that specifies serialization options to use. |