Class LenientXrplNumberConverter
Reads an XRPL Number field of a model that comes from a node - a ledger entry or a transaction response - so that a value this version cannot read costs that field, not the object around it.
Namespace: Xrpl.Client.Json.Converters
Assembly: Xrpl.dll
Syntax
public sealed class LenientXrplNumberConverter : JsonConverter<XrplNumber?>
Remarks
A node newer than this SDK may write a Number this version refuses (a wider mantissa, say). The
strict XrplNumberJsonConverter would fail the whole entry, and with it an
account_objects page or a transaction. Here the field reads as null instead; the
node's text is still in the response's Raw. Writing is the same as the strict converter.
Properties
| Edit this page View SourceHandleNull
Gets a value that indicates whether null should be passed to the converter on serialization, and whether System.Text.Json.JsonTokenType.Null should be passed on deserialization.
Declaration
public override bool HandleNull { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
Methods
| Edit this page View SourceRead(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type System.Nullable.
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 |
|---|---|
| Nullable | The converted value. |
Overrides
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. |
| Nullable | value | The value to convert to JSON. |
| JsonSerializerOptions | options | An object that specifies serialization options to use. |