Show / Hide Table of Contents

Struct XrplResponse<T>

A response from a node: the typed projection of its result, and the bytes that projection was made from.

Namespace: Xrpl.Client
Assembly: Xrpl.dll
Syntax
public readonly struct XrplResponse<T>
Type Parameters
Name Description
T
Remarks

The pair exists because the projection is lossy in both directions and cannot be turned back into what arrived: members the model does not know are dropped, and non-nullable CLR properties re-serialize as zeros the node never sent. Anything that has to show or verify what a node actually said — a wallet rendering a transaction for signing — reads Raw; everything else reads Result.

There is deliberately no implicit conversion to T. Measured against this codebase it would carry fewer than half the call sites — those with an explicit type; the ones using var break regardless — leaving a partial compatibility that is harder to migrate than a clean break, and it would hide that Raw exists at all.

Constructors

| Edit this page View Source

XrplResponse(T, RawJson, uint?, string, string, IReadOnlyList<RippleResponseWarning>, bool)

Pairs a typed result with the envelope it was read from.

Declaration
public XrplResponse(T result, RawJson raw, uint? apiVersion, string status, string warning, IReadOnlyList<RippleResponseWarning> warnings, bool forwarded)
Parameters
Type Name Description
T result
RawJson raw
uint? apiVersion
string status
string warning
IReadOnlyList<RippleResponseWarning> warnings
bool forwarded

Properties

| Edit this page View Source

ApiVersion

The API version the node answered on, when it reported one.

Declaration
public uint? ApiVersion { get; }
Property Value
Type Description
uint?
| Edit this page View Source

Forwarded

True when a Reporting Mode server forwarded this request to a P2P server and back.

Declaration
public bool Forwarded { get; }
Property Value
Type Description
bool
| Edit this page View Source

HasNextPage

True when the node reported a marker, meaning more pages follow.

Declaration
public bool HasNextPage { get; }
Property Value
Type Description
bool
Remarks

The extension on BaseResponse is no longer reachable from here — a caller holds this type now, not the envelope — and paging is the case this whole change was made for.

| Edit this page View Source

Raw

The result member exactly as the node sent it. Empty when the response carried none.

Declaration
public RawJson Raw { get; }
Property Value
Type Description
RawJson
| Edit this page View Source

Result

The result member, projected onto the requested type.

Declaration
public T Result { get; }
Property Value
Type Description
T
| Edit this page View Source

Status

"success", or "error" if the request caused one.

Declaration
public string Status { get; }
Property Value
Type Description
string
Remarks

A separate member for the same reason Warning is: status sits beside result in the envelope, not inside it, so it is not reachable through Raw — Raw is a slice of result alone.

| Edit this page View Source

Warning

The node's rate-limit signal, when it sent one — the literal "load", meaning this client is approaching the threshold at which the server will disconnect it.

Declaration
public string Warning { get; }
Property Value
Type Description
string
Remarks

A separate member from Warnings because rippled reports it separately, and it is not reachable through Raw either: that is the result member, while this lives in the envelope around it.

| Edit this page View Source

Warnings

Warnings the node attached to this response. Never null.

Declaration
public IReadOnlyList<RippleResponseWarning> Warnings { get; }
Property Value
Type Description
IReadOnlyList<RippleResponseWarning>
Remarks

rippled attaches these under load and on a reporting-mode server. Before this type they did not reach the caller at all — the envelope was unwrapped and discarded.

Methods

| Edit this page View Source

Deconstruct(out T, out RawJson)

Lets a caller take both halves at once: var (info, raw) = await client.AccountInfo(request).

Declaration
public void Deconstruct(out T result, out RawJson raw)
Parameters
Type Name Description
T result
RawJson raw
Remarks

The call sites that broke hardest on this change are the ones using var, and this is what makes them a one-line edit rather than a restructure.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX