Class AggregatePriceAssetConverter
Writes the base_asset / quote_asset of a get_aggregate_price request in the form
rippled displays the stored currency in (to_string(Currency)).
Inheritance
Namespace: Xrpl.Client.Json.Converters
Assembly: Xrpl.dll
Syntax
public sealed class AggregatePriceAssetConverter : JsonConverter<string>
Remarks
rippled finds a price by comparing the request string with the display form of the stored
PriceData.BaseAsset / QuoteAsset, as text. Any other spelling of the same currency
parses, yet matches nothing, and the request fails with objectNotFound. The display form is:
XRP for the zero currency, the three characters for a code holding only an ISO-style code,
and uppercase hex for anything else. A longer name is encoded as OracleCurrencyConverter
encodes it for OracleSet, so the name written into an oracle finds that oracle's price.
Methods
| Edit this page View SourceRead(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads the code as the node gives it.
Declaration
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonReader | reader | |
| Type | typeToConvert | |
| JsonSerializerOptions | options |
Returns
| Type | Description |
|---|---|
| string |
Overrides
ToDisplayForm(string)
The form rippled displays code in once it is stored as a currency.
Declaration
public static string ToDisplayForm(string code)
Parameters
| Type | Name | Description |
|---|---|---|
| string | code |
Returns
| Type | Description |
|---|---|
| string |
Exceptions
| Type | Condition |
|---|---|
| JsonException | The code is not printable ASCII or does not fit in 160 bits. |
Write(Utf8JsonWriter, string, JsonSerializerOptions)
Writes the code in rippled's display form.
Declaration
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonWriter | writer | |
| string | value | |
| JsonSerializerOptions | options |
Overrides
Exceptions
| Type | Condition |
|---|---|
| JsonException | The code is not printable ASCII or does not fit in 160 bits. |