Show / Hide Table of Contents

Class OracleBlobConverter

Converts an OracleBlob (Oracle Provider, AssetClass, URI) to and from the hex string rippled uses for a Blob field.

Inheritance
object
JsonConverter
JsonConverter<OracleBlob>
OracleBlobConverter
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 Source

Read(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
System.Text.Json.Serialization.JsonConverter<Xrpl.Models.Common.OracleBlob>.Read(ref System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions)
Exceptions
Type Condition
JsonException

The value is not a string, or not an even-length hex string.

| Edit this page View Source

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
Overrides
JsonConverter<OracleBlob>.Write(Utf8JsonWriter, OracleBlob, JsonSerializerOptions)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX