Class OracleBlobConverter
Converts an OracleBlob (Oracle Provider, AssetClass, URI)
to and from the hex string rippled uses for a Blob field.
Namespace: Xrpl.Client.Json.Converters
Assembly: Xrpl.dll
Syntax
public sealed class OracleBlobConverter : JsonConverter<OracleBlob>
Remarks
Reading keeps the bytes whatever they are, so writing gives back exactly the bytes read.
Reading is also total for anything the node sends: these fields are not constrained by
rippled, and refusing one oracle's bytes threw out of the converter and took the whole
response with it - one third-party oracle in a ledger_data page from devnet made
the page unreadable. A value that is not hex is refused, as rippled refuses it, rather than
taken as text: taking it as text is what signed bytes other than the ones received.
Methods
| Edit this page View SourceRead(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads the hex string of a Blob field.
Declaration
public override OracleBlob Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonReader | reader | |
| Type | typeToConvert | |
| JsonSerializerOptions | options |
Returns
| Type | Description |
|---|---|
| OracleBlob |
Overrides
Exceptions
| Type | Condition |
|---|---|
| JsonException | The value is not a string, or not an even-length hex string. |
Write(Utf8JsonWriter, OracleBlob, JsonSerializerOptions)
Writes the bytes as UPPERCASE hex, as rippled writes a Blob field (strHex).
Declaration
public override void Write(Utf8JsonWriter writer, OracleBlob value, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonWriter | writer | |
| OracleBlob | value | |
| JsonSerializerOptions | options |