Show / Hide Table of Contents

Interface IXrplClient

Namespace: Xrpl.Client
Assembly: Xrpl.dll
Syntax
public interface IXrplClient

Properties

| Edit this page View Source

DroppedStreamMessages

How many stream messages were discarded because handlers fell behind.

Declaration
long DroppedStreamMessages { get; }
Property Value
Type Description
long
Remarks

Non-zero means events reached this client and never reached its handlers. The queue in front of them is bounded (StreamMessageQueueCapacity) and drops the oldest when full, so a slow handler costs events instead of stalling the socket - silently, until something reads this. A consumer building state from the stream should treat any increase as a signal that its state has drifted.

Defaulted, like SetNetworkId(uint?): forwarding to connection is the only implementation that means anything, and an observational member is a poor reason to break every external implementer of this interface.

| Edit this page View Source

FallbackDispatchedStreamMessages

How many stream frames were dispatched outside the queue, without its ordering or its capacity bound.

Declaration
long FallbackDispatchedStreamMessages { get; }
Property Value
Type Description
long
Remarks

Frames take that path when the background processor is not up yet, when it has been stopped, or when the channel refuses a write. The first of those is a real window on every connect: the processor starts at the end of OnceOpen, after the OnConnected callback, so a handler subscribing there can be reached before the queue exists. This counts how often that happened.

Defaulted, like SetNetworkId(uint?): forwarding to connection is the only implementation that means anything, and an observational member is a poor reason to break every external implementer of this interface.

| Edit this page View Source

StaleSessionFramesDropped

How many stream frames were discarded because they came from a connection this client had already left.

Declaration
long StaleSessionFramesDropped { get; }
Property Value
Type Description
long
Remarks

A socket being retired keeps delivering until its graceful close finishes, so a few frames can arrive after a reconnect or ChangeServer has moved on. Delivering them would be wrong rather than merely late: after a change of network they describe a different chain entirely. A non-zero value here is therefore normal right after a reconnect and says nothing about handler speed - that is DroppedStreamMessages, and the two are counted apart on purpose.

Defaulted, like SetNetworkId(uint?): forwarding to connection is the only implementation that means anything, and an observational member is a poor reason to break every external implementer of this interface.

| Edit this page View Source

connection

The socket this client speaks over.

Declaration
Connection connection { get; }
Property Value
Type Description
Connection
Remarks

Read-only: replacing it would leave every handler registered through the events below attached to the old object, and the stream would go quiet with nothing to show for it. ChangeServer is how a caller moves to another server - it swaps the session inside this object rather than the object itself, so subscriptions survive.

| Edit this page View Source

feeCushion

Declaration
double feeCushion { get; set; }
Property Value
Type Description
double
| Edit this page View Source

maxFeeXRP

Declaration
string maxFeeXRP { get; set; }
Property Value
Type Description
string
| Edit this page View Source

networkID

Declaration
uint? networkID { get; set; }
Property Value
Type Description
uint?

Methods

| Edit this page View Source

AccountChannels(AccountChannelsRequest, CancellationToken)

The account_channels method returns information about an account's Payment Channels. This includes only channels where the specified account is the channel's source, not the destination.

Declaration
Task<XrplResponse<AccountChannels>> AccountChannels(AccountChannelsRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
AccountChannelsRequest request

An AccountChannelsRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<AccountChannels>>

An AccountChannels response.

| Edit this page View Source

AccountCurrencies(AccountCurrenciesRequest, CancellationToken)

The account_currencies command retrieves a list of currencies that an account can send or receive, based on its trust lines.

Declaration
Task<XrplResponse<AccountCurrencies>> AccountCurrencies(AccountCurrenciesRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
AccountCurrenciesRequest request

An AccountCurrenciesRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<AccountCurrencies>>

An AccountCurrencies response.

| Edit this page View Source

AccountInfo(AccountInfoRequest, CancellationToken)

The account_info command retrieves information about an account, its activity, and its XRP balance.

Declaration
Task<XrplResponse<AccountInfo>> AccountInfo(AccountInfoRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
AccountInfoRequest request

An AccountInfoRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<AccountInfo>>

An AccountInfo response.

| Edit this page View Source

AccountLines(AccountLinesRequest, CancellationToken)

The account_lines method returns information about an account's trust lines, including balances in all non-XRP currencies and assets.

Declaration
Task<XrplResponse<AccountLines>> AccountLines(AccountLinesRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
AccountLinesRequest request

An AccountLinesRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<AccountLines>>

An AccountLines response.

| Edit this page View Source

AccountNFTs(AccountNFTsRequest, CancellationToken)

The account_nfts method returns a list of NFToken objects for the specified account.

Declaration
Task<XrplResponse<AccountNFTs>> AccountNFTs(AccountNFTsRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
AccountNFTsRequest request

An AccountNFTsRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<AccountNFTs>>

An AccountNFTs response.

| Edit this page View Source

AccountObjects(AccountObjectsRequest, CancellationToken)

The AccountObjects command returns the raw ledger format for all objects owned by an account. For a higher-level view of an account's trust lines and balances, see AccountLines instead.

Declaration
Task<XrplResponse<AccountObjects>> AccountObjects(AccountObjectsRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
AccountObjectsRequest request

An AccountObjectsRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<AccountObjects>>

An AccountObjects response.

| Edit this page View Source

AccountOffers(AccountOffersRequest, CancellationToken)

The account_offers method retrieves a list of offers made by a given account that are outstanding as of a particular ledger version

Declaration
Task<XrplResponse<AccountOffers>> AccountOffers(AccountOffersRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
AccountOffersRequest request

An AccountOffersRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<AccountOffers>>

An AccountOffers response.

| Edit this page View Source

AccountTransactions(AccountTransactionsRequest, CancellationToken)

The account_tx method retrieves a list of transactions that involved the specified account

Declaration
Task<XrplResponse<AccountTransactions>> AccountTransactions(AccountTransactionsRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
AccountTransactionsRequest request

An AccountTransactionsRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<AccountTransactions>>

An AccountTransactions response.

| Edit this page View Source

AmmInfo(AMMInfoRequest, CancellationToken)

The amm_info method gets information about an Automated Market Maker (AMM) instance.

Declaration
Task<XrplResponse<AMMInfoResponse>> AmmInfo(AMMInfoRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
AMMInfoRequest request

An AMMInfoRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<AMMInfoResponse>>

An AMMInfoResponse response.

| Edit this page View Source

AnyRequest(BaseRequest, CancellationToken)

Declaration
Task<XrplResponse<object>> AnyRequest(BaseRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
BaseRequest request
CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<object>>
| Edit this page View Source

Autofill(Dictionary<string, object>, int?, CancellationToken)

Autofills fields in a transaction. This will set Sequence, Fee, lastLedgerSequence according to the current state of the server this Client is connected to. It also converts all X-Addresses to classic addresses and flags interfaces into numbers.

Declaration
Task<Dictionary<string, object>> Autofill(Dictionary<string, object> tx, int? signersCount = null, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Dictionary<string, object> tx

A {@link Transaction} in JSON format

int? signersCount

The expected number of signers for this transaction. Only used for multisigned transactions.

CancellationToken cancellationToken
Returns
Type Description
Task<Dictionary<string, object>>

The autofilled transaction.

| Edit this page View Source

Autofill<T>(T, int?, CancellationToken)

Autofills fields in a transaction. This will set Sequence, Fee, lastLedgerSequence according to the current state of the server this Client is connected to. It also converts all X-Addresses to classic addresses and flags interfaces into numbers.

Declaration
Task<T> Autofill<T>(T tx, int? signersCount = null, CancellationToken cancellationToken = default) where T : ITransactionRequest
Parameters
Type Name Description
T tx

A {@link Transaction} in JSON format

int? signersCount

The expected number of signers for this transaction. Only used for multisigned transactions.

CancellationToken cancellationToken
Returns
Type Description
Task<T>

The autofilled transaction.

Type Parameters
Name Description
T
| Edit this page View Source

BookOffers(BookOffersRequest, CancellationToken)

The book_offers method retrieves a list of offers, also known as the order book , between two currencies

Declaration
Task<XrplResponse<BookOffers>> BookOffers(BookOffersRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
BookOffersRequest request

An BookOffersRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<BookOffers>>

An BookOffers response.

| Edit this page View Source

ChangeServer(string, ClientOptions?, CancellationToken)

Moves the client to another server: retires the current session, connects to server and reads its network id.

Declaration
Task ChangeServer(string server, XrplClient.ClientOptions? options = null, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string server

The WebSocket URL of the server to move to.

XrplClient.ClientOptions options

Options for the new connection; null keeps the current ones.

CancellationToken cancellationToken

Cancels the wait for the new connection.

Returns
Type Description
Task
Remarks

The switch is announced through OnSessionEnded with ServerChanged before the new connection is opened; the subscriptions held against the old connection do not follow the client.

A later Disconnect(), Connect(CancellationToken) or ChangeServer - from another thread, or from a handler this call runs - takes the connection over, and this call stops where it is: NotConnectedException when a Disconnect() won, because the client is down; System.OperationCanceledException when anything else won, because the client is connecting, or connected, somewhere this call did not ask for. The old session is retired either way.

| Edit this page View Source

ChannelAuthorize(ChannelAuthorizeRequest, CancellationToken)

The channel_authorize method creates a signature that can be used to redeem a specific amount of XRP from a payment channel.

Declaration
Task<XrplResponse<ChannelAuthorizeResponse>> ChannelAuthorize(ChannelAuthorizeRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ChannelAuthorizeRequest request

A ChannelAuthorizeRequest.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
Task<XrplResponse<ChannelAuthorizeResponse>>

A ChannelAuthorizeResponse containing the signature.

| Edit this page View Source

ChannelVerify(ChannelVerifyRequest, CancellationToken)

The channel_verify method checks the validity of a signature that can be used to redeem a specific amount of XRP from a payment channel.

Declaration
Task<XrplResponse<ChannelVerifyResponse>> ChannelVerify(ChannelVerifyRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ChannelVerifyRequest request

A ChannelVerifyRequest.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
Task<XrplResponse<ChannelVerifyResponse>>

A ChannelVerifyResponse indicating whether the signature is valid.

| Edit this page View Source

Connect(CancellationToken)

Connects to the server and reads the network id from it.

Declaration
Task Connect(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

Cancels the wait for a connection.

Returns
Type Description
Task
Remarks

Returns when the client is connected and that second step has completed. A consumer OnConnected handler that fails and works on the next attempt does not reach the caller: the client rebuilds the connection itself, and reporting that as a failed connect would be reporting something that did not happen.

Throws NotConnectedException when the client gave up - a handler that fails every time, or a server that never comes up - and when a Disconnect() issued while this call was connecting won: the client is down, and this call did not connect it. System.OperationCanceledException means what it says and nothing else: the caller's own cancellationToken was cancelled. A ChangeServer issued meanwhile does not fail this call - it returns once the client is connected, wherever that switch took it.

| Edit this page View Source

DepositAuthorized(DepositAuthorizedRequest, CancellationToken)

The deposit_authorized command indicates whether one account is authorized to send payments directly to another. https://xrpl.org/deposit_authorized.html

Declaration
Task<XrplResponse<DepositAuthorized>> DepositAuthorized(DepositAuthorizedRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
DepositAuthorizedRequest request

A DepositAuthorizedRequest.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
Task<XrplResponse<DepositAuthorized>>

A DepositAuthorized(DepositAuthorizedRequest, CancellationToken) response.

| Edit this page View Source

Disconnect()

Disconnect from server

Declaration
Task Disconnect()
Returns
Type Description
Task
| Edit this page View Source

DisconnectAndWaitAsync(TimeSpan, CancellationToken)

Disconnects and waits for the WebSocket to be fully closed and cleaned up.

Declaration
Task DisconnectAndWaitAsync(TimeSpan timeout, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TimeSpan timeout

Maximum time to wait for cleanup.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
Task
| Edit this page View Source

EnsureClassicAddress(string)

Declaration
string EnsureClassicAddress(string address)
Parameters
Type Name Description
string address
Returns
Type Description
string
| Edit this page View Source

Fee(CancellationToken)

The fee command reports the current state of the open-ledger requirements for the transaction cost.

Declaration
Task<XrplResponse<Fee>> Fee(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<Fee>>

An Fee response.

| Edit this page View Source

GRequest<T, R>(R, CancellationToken)

Declaration
Task<XrplResponse<T>> GRequest<T, R>(R request, CancellationToken cancellationToken = default) where R : BaseRequest
Parameters
Type Name Description
R request
CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<T>>
Type Parameters
Name Description
T
R
| Edit this page View Source

GatewayBalances(GatewayBalancesRequest, CancellationToken)

The gateway_balances command calculates the total balances issued by a given account, optionally excluding amounts held by operational addresses.

Declaration
Task<XrplResponse<GatewayBalancesResponse>> GatewayBalances(GatewayBalancesRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
GatewayBalancesRequest request

An GatewayBalancesRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<GatewayBalancesResponse>>

An GatewayBalancesResponse response.

| Edit this page View Source

GetLedgerIndex(CancellationToken)

Declaration
Task<uint> GetLedgerIndex(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<uint>
| Edit this page View Source

GetXrpBalance(string, CancellationToken)

Declaration
Task<string> GetXrpBalance(string address, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string address
CancellationToken cancellationToken
Returns
Type Description
Task<string>
| Edit this page View Source

IsConnected()

if the websocket is connected

Declaration
bool IsConnected()
Returns
Type Description
bool
| Edit this page View Source

Ledger(LedgerRequest, CancellationToken)

The ledger_request command tells server to fetch a specific ledger version from its connected peers. This only works if one of the server's immediately-connected peers has that ledger. You may need to run the command several times to completely fetch a ledger

Declaration
Task<XrplResponse<LOLedger>> Ledger(LedgerRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
LedgerRequest request

An LedgerRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<LOLedger>>

An LOLedger response.

| Edit this page View Source

LedgerClosed(LedgerClosedRequest, CancellationToken)

The ledger_closed method returns the unique identifiers of the most recently closed ledger.

Declaration
Task<XrplResponse<LOBaseLedger>> LedgerClosed(LedgerClosedRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
LedgerClosedRequest request

An LedgerClosedRequest response.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<LOBaseLedger>>

An LOBaseLedger response.

| Edit this page View Source

LedgerCurrent(LedgerCurrentRequest, CancellationToken)

The ledger_current method returns the unique identifiers of the current in-progress ledger.
This command is mostly useful for testing, because the ledger returned is still in flux.

Declaration
Task<XrplResponse<LOLedgerCurrentIndex>> LedgerCurrent(LedgerCurrentRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
LedgerCurrentRequest request

An LedgerCurrentRequest response.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<LOLedgerCurrentIndex>>

An LOLedgerCurrentIndex response.

| Edit this page View Source

LedgerData(LedgerDataRequest, CancellationToken)

The ledger_data method retrieves contents of the specified ledger. You can iterate through several calls to retrieve the entire contents of a single ledger version.

Declaration
Task<XrplResponse<LOLedgerData>> LedgerData(LedgerDataRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
LedgerDataRequest request

An LedgerDataRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<LOLedgerData>>

An LOLedgerData response.

| Edit this page View Source

LedgerEntry(LedgerEntryRequest, CancellationToken)

The ledger_entry method returns a single ledger object from the XRP Ledger in its raw format.
See ledger format for information on the different types of objects you can retrieve.

Declaration
Task<XrplResponse<LedgerEntryResponse>> LedgerEntry(LedgerEntryRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
LedgerEntryRequest request

An LedgerEntryRequest response.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<LedgerEntryResponse>>

An LedgerEntryResponse response.

| Edit this page View Source

NFTBuyOffers(NFTBuyOffersRequest, CancellationToken)

The nft_buy_offers method returns a list of buy offers for a given NFToken object.

Declaration
Task<XrplResponse<NFTBuyOffers>> NFTBuyOffers(NFTBuyOffersRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
NFTBuyOffersRequest request

An NFTBuyOffersRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<NFTBuyOffers>>

An NFTBuyOffers response.

| Edit this page View Source

NFTHistory(NFTHistoryRequest, CancellationToken)

The nft_history method returns the transactions that touched an NFToken.

Declaration
Task<XrplResponse<NFTHistory>> NFTHistory(NFTHistoryRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
NFTHistoryRequest request

An NFTHistoryRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<NFTHistory>>

An NFTHistory response.

Remarks

A Clio method, paginated the way account_tx is: keep passing Marker back until an answer comes without one.

| Edit this page View Source

NFTInfo(NFTInfoRequest, CancellationToken)

The nft_info method says who owns an NFToken and what it was minted with.

Declaration
Task<XrplResponse<NFTInfo>> NFTInfo(NFTInfoRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
NFTInfoRequest request

An NFTInfoRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<NFTInfo>>

An NFTInfo response.

Remarks

A Clio method: a plain rippled node answers unknownCmd, which arrives as an ordinary node error so a caller can catch it and fall back. There is no substitute for it on rippled - an owner cannot be read out of NFTSellOffers(NFTSellOffersRequest, CancellationToken), because a sale leaves the seller's offers in the ledger and the new owner usually has none.

| Edit this page View Source

NFTSellOffers(NFTSellOffersRequest, CancellationToken)

The nft_sell_offers method returns a list of sell offers for a given NFToken object

Declaration
Task<XrplResponse<NFTSellOffers>> NFTSellOffers(NFTSellOffersRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
NFTSellOffersRequest request

An NFTSellOffersRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<NFTSellOffers>>

An NFTSellOffers response.

| Edit this page View Source

NoRippleCheck(NoRippleCheckRequest, CancellationToken)

The noripple_check command provides a quick way to check the status of the Default Ripple field for an account and the No Ripple flag of its trust lines, compared with the recommended settings

Declaration
Task<XrplResponse<NoRippleCheck>> NoRippleCheck(NoRippleCheckRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
NoRippleCheckRequest request
CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<NoRippleCheck>>

An NoRippleCheckRequest response.

| Edit this page View Source

PathFind(PathFindCreateRequest, CancellationToken)

The path_find create sub-command creates an ongoing request to find possible paths along which a payment transaction could be made.
WebSocket API only.
After the initial response, the server sends asynchronous follow-ups via the OnPathFind event.

Declaration
Task<XrplResponse<PathFindResponse>> PathFind(PathFindCreateRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
PathFindCreateRequest request

A PathFindCreateRequest.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
Task<XrplResponse<PathFindResponse>>

A PathFindResponse with initial path alternatives.

| Edit this page View Source

PathFindClose(PathFindCloseRequest, CancellationToken)

The path_find close sub-command instructs the server to stop sending information about the current open pathfinding request.

Declaration
Task<XrplResponse<PathFindResponse>> PathFindClose(PathFindCloseRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
PathFindCloseRequest request

A PathFindCloseRequest.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
Task<XrplResponse<PathFindResponse>>

A PathFindResponse.

| Edit this page View Source

PathFindStatus(PathFindStatusRequest, CancellationToken)

The path_find status sub-command requests an immediate update about the client's currently-open pathfinding request.

Declaration
Task<XrplResponse<PathFindResponse>> PathFindStatus(PathFindStatusRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
PathFindStatusRequest request

A PathFindStatusRequest.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
Task<XrplResponse<PathFindResponse>>

A PathFindResponse.

| Edit this page View Source

Ping(CancellationToken)

The ping command returns an acknowledgement, so that clients can test the connection status and latency

Declaration
Task<XrplResponse<object>> Ping(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<object>>
| Edit this page View Source

Random(CancellationToken)

The random command provides a random number to be used as a source of entropy for random number generation by clients.
https://xrpl.org/random.html#random

Declaration
Task<XrplResponse<object>> Random(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<object>>
| Edit this page View Source

Request(Dictionary<string, object>, CancellationToken)

Declaration
Task<XrplResponse<Dictionary<string, object>>> Request(Dictionary<string, object> request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Dictionary<string, object> request
CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<Dictionary<string, object>>>
| Edit this page View Source

RipplePathFind(RipplePathFindRequest, CancellationToken)

The ripple_path_find method is a simplified version of the path_find method that provides a single response with a payment path you can use right away.
Available in both WebSocket and JSON-RPC APIs.

Declaration
Task<XrplResponse<RipplePathFindResponse>> RipplePathFind(RipplePathFindRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
RipplePathFindRequest request

A RipplePathFindRequest.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
Task<XrplResponse<RipplePathFindResponse>>

A RipplePathFindResponse.

| Edit this page View Source

ServerDefinitions(ServerDefinitionsRequest, CancellationToken)

The server_definitions method retrieves the definition enums used by the server.

Declaration
Task<XrplResponse<ServerDefinitionsResponse>> ServerDefinitions(ServerDefinitionsRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ServerDefinitionsRequest request

A ServerDefinitionsRequest.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
Task<XrplResponse<ServerDefinitionsResponse>>

A ServerDefinitionsResponse.

| Edit this page View Source

ServerFeatures(string, CancellationToken)

The feature command returns information about amendments this server knows about,
including whether they are enabled and if the server knows how to apply the amendments.

This is the non-admin version of the feature admin command.
It follows the same formatting as the admin command, but hides potentially sensitive data.

Declaration
Task<XrplResponse<ServerFeatures>> ServerFeatures(string feature = null, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string feature

(Optional) The unique ID of an amendment, as hexadecimal;
or the short name of the amendment.
If provided, limits the response to one amendment. Otherwise, the response lists all amendments.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<ServerFeatures>>

A ServerFeatures(string, CancellationToken) response. Feature and their states

| Edit this page View Source

ServerInfo(ServerInfoRequest, CancellationToken)

The server_info command asks the server for a human-readable version of various information about the rippled server being queried.

Declaration
Task<XrplResponse<ServerInfo>> ServerInfo(ServerInfoRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ServerInfoRequest request

An ServerInfoRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<ServerInfo>>

A ServerInfo(ServerInfoRequest, CancellationToken) response.

| Edit this page View Source

ServerState(ServerStateRequest, CancellationToken)

The server_state command asks the server for a human-readable version of various information about the rippled server being queried.

Declaration
Task<XrplResponse<ServerState>> ServerState(ServerStateRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ServerStateRequest request

An ServerStateRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<ServerState>>

A ServerState(ServerStateRequest, CancellationToken) response.

| Edit this page View Source

SetNetworkId(uint?)

Set network id for transactions, required in network where Id > 1024

Declaration
void SetNetworkId(uint? networkId)
Parameters
Type Name Description
uint? networkId

network id

| Edit this page View Source

Simulate(SimulateRequest, CancellationToken)

The simulate method executes a dry run of any transaction type, enabling you to preview the results and metadata of a transaction without committing them to the XRP Ledger.
Since this command never submits a transaction to the network, it doesn't incur any fees.
Expects a response in the form of a SimulateRequest .

Declaration
Task<XrplResponse<SimulateResponse>> Simulate(SimulateRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SimulateRequest request
CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<SimulateResponse>>
| Edit this page View Source

Submit(Dictionary<string, object>, XrplWallet, bool, bool, CancellationToken)

Submits a transaction to the XRP Ledger for processing.

Declaration
Task<Submit> Submit(Dictionary<string, object> tx, XrplWallet wallet, bool autoFill = true, bool failHard = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Dictionary<string, object> tx

Transaction in JSON format with an array of Signers.
To be successful, the weights of the signatures must be equal or higher than the quorum of the SignerList.

XrplWallet wallet

wallet

bool autoFill

use autofill for tx

bool failHard

yse fail hard

CancellationToken cancellationToken
Returns
Type Description
Task<Submit>

An Submit response.

| Edit this page View Source

Submit(ITransactionRequest, XrplWallet, bool, bool, CancellationToken)

Submits a transaction to the XRP Ledger for processing.

Declaration
Task<Submit> Submit(ITransactionRequest tx, XrplWallet wallet, bool autoFill = true, bool failHard = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ITransactionRequest tx

Transaction.
To be successful, the weights of the signatures must be equal or higher than the quorum of the SignerList.

XrplWallet wallet

wallet

bool autoFill

use autofill for tx

bool failHard

yse fail hard

CancellationToken cancellationToken
Returns
Type Description
Task<Submit>

An Submit response.

| Edit this page View Source

Subscribe(SubscribeRequest, CancellationToken)

The subscribe method requests periodic notifications from the server when certain events happen.

Declaration
Task<XrplResponse<object>> Subscribe(SubscribeRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SubscribeRequest request

An SubscribeRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<object>>
| Edit this page View Source

TransactionEntry(TransactionEntryRequest, CancellationToken)

The transaction_entry method retrieves information on a single transaction from a specific ledger version.

Declaration
Task<XrplResponse<TransactionEntryResponse>> TransactionEntry(TransactionEntryRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TransactionEntryRequest request

A TransactionEntryRequest.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
Task<XrplResponse<TransactionEntryResponse>>

A TransactionEntryResponse.

| Edit this page View Source

TxV1(TxRequest, CancellationToken)

The tx method retrieves information on a single transaction, by its identifying hash, using the API v1 wire shape: the transaction's own fields (Account, Amount, TransactionType, ...) sit at the top level of TransactionResponse, alongside meta.

Declaration
Task<XrplResponse<TransactionResponse>> TxV1(TxRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TxRequest request

An TxRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<TransactionResponse>>

An TransactionResponse response.

Remarks

Always requests API v1 regardless of ApiVersion — this is the one place in the SDK where the choice of method, not a setting, decides the protocol version. It cannot honor ApiVersion instead: TransactionResponse has no field for API v2's tx_json, so handing it a v2 payload would lose the transaction wholesale rather than just its field names. Use TxV2(TxRequest, CancellationToken) for the v2 shape.

| Edit this page View Source

TxV2(TxRequest, CancellationToken)

The tx method retrieves information on a single transaction, by its identifying hash, using the API v2 wire shape: Transaction (from tx_json) and Meta sit side by side, as rippled's v2 response actually sends them.

Declaration
Task<XrplResponse<TransactionSummary>> TxV2(TxRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TxRequest request
CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<TransactionSummary>>
Remarks

Always requests API v2 regardless of ApiVersion — like TxV1(TxRequest, CancellationToken), the choice of method decides the protocol version here, not the client setting. Use TxV1(TxRequest, CancellationToken) for the v1 shape.

| Edit this page View Source

Unsubscribe(UnsubscribeRequest, CancellationToken)

The unsubscribe command tells the server to stop sending messages for a particular subscription or set of subscriptions.

Declaration
Task<XrplResponse<object>> Unsubscribe(UnsubscribeRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
UnsubscribeRequest request

An UnsubscribeRequest request.

CancellationToken cancellationToken
Returns
Type Description
Task<XrplResponse<object>>
| Edit this page View Source

Url()

the url

Declaration
string Url()
Returns
Type Description
string
| Edit this page View Source

VaultInfo(VaultInfoRequest, CancellationToken)

The vault_info method retrieves information about a vault.

Declaration
Task<XrplResponse<VaultInfoResponse>> VaultInfo(VaultInfoRequest request, CancellationToken cancellationToken = default)
Parameters
Type Name Description
VaultInfoRequest request

A VaultInfoRequest.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
Task<XrplResponse<VaultInfoResponse>>

A VaultInfoResponse.

| Edit this page View Source

WaitForConnectionOutcomeAsync(TimeSpan?, CancellationToken)

How a wait for the connection ended.

Declaration
Task<ConnectionWaitOutcome> WaitForConnectionOutcomeAsync(TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TimeSpan? timeout
CancellationToken cancellationToken
Returns
Type Description
Task<ConnectionWaitOutcome>
Remarks

The same events NotConnectedException and its subtypes report, for callers who would rather read an answer than catch one: "it did not come back in time" is something a caller has to act on, not an exceptional event.

A bool would fold "timed out", "gave up" and "nothing is running" into one false, which is the confusion this whole family of types exists to remove. Two things stay exceptions: cancellation through the caller's own token, which is the .NET convention, and an invalid timeout, which is a mistake by the caller rather than an outcome of the connection.

Events

| Edit this page View Source

OnBookChanges

bookChanges stream event.

Declaration
event OnBookChanges OnBookChanges
Event Type
Type Description
OnBookChanges
| Edit this page View Source

OnConnected

The socket finished connecting.

Declaration
event OnConnected OnConnected
Event Type
Type Description
OnConnected
| Edit this page View Source

OnConnectionStatus

Connection state transitions, for diagnostics.

Declaration
event Action<ConnectionStatusInfo> OnConnectionStatus
Event Type
Type Description
Action<ConnectionStatusInfo>
| Edit this page View Source

OnConsensusPhase

consensusPhase stream event.

Declaration
event OnConsensusPhase OnConsensusPhase
Event Type
Type Description
OnConsensusPhase
| Edit this page View Source

OnDisconnect

The socket closed.

Declaration
event OnDisconnect OnDisconnect
Event Type
Type Description
OnDisconnect
| Edit this page View Source

OnError

Node error reported over the socket.

Declaration
event OnError OnError
Event Type
Type Description
OnError
| Edit this page View Source

OnLedgerClosed

ledgerClosed stream event.

Declaration
event OnLedgerClosed OnLedgerClosed
Event Type
Type Description
OnLedgerClosed
| Edit this page View Source

OnManifestReceived

manifestReceived stream event.

Declaration
event OnManifestReceived OnManifestReceived
Event Type
Type Description
OnManifestReceived
| Edit this page View Source

OnPathFind

path_find follow-up.

Declaration
event OnPathFind OnPathFind
Event Type
Type Description
OnPathFind
| Edit this page View Source

OnPeerStatusChange

peerStatusChange stream event.

Declaration
event OnPeerStatusChange OnPeerStatusChange
Event Type
Type Description
OnPeerStatusChange
| Edit this page View Source

OnPing

Keep-alive round trip completed.

Declaration
event OnPing OnPing
Event Type
Type Description
OnPing
| Edit this page View Source

OnServerStatus

serverStatus stream event.

Declaration
event OnServerStatus OnServerStatus
Event Type
Type Description
OnServerStatus
| Edit this page View Source

OnServerWarning

Server warnings attached to a response envelope.

Declaration
event OnServerWarning OnServerWarning
Event Type
Type Description
OnServerWarning
| Edit this page View Source

OnSessionEnded

The connection that carried the subscriptions has ended - by any route.

Declaration
event OnSessionEnded OnSessionEnded
Event Type
Type Description
OnSessionEnded
Remarks

Subscriptions live on the node against one connection. When that connection goes, so do they, and a consumer has to resubscribe. Knowing when to is the hard part, because the connection can end in three different ways and until this event only the first was announced:

  • the socket closes on its own, or the caller closes it with Disconnect - OnDisconnect fires;
  • a ping timeout or a network drop makes the SDK retire the session and reconnect at once - only a RestoringConnection status went out;
  • ChangeServer retires the session to move to another server - nothing went out at all, and the client reported Connected throughout, so a consumer had no way to notice its stream had gone quiet for good.

This event fires exactly once per session in all three cases, which makes it the single thing to subscribe to in order to know that a resubscribe is due. OnDisconnect keeps its own meaning - a socket closed - and still fires alongside it where it always did.

It reports a loss, not a readiness: on a server switch and on a fast reconnect it fires before the replacement connection is open, so the handler cannot resubscribe from where it stands. Note that the subscriptions are gone and send them again from OnConnected - which is also why the loss is announced first, so a consumer is never told to resubscribe after it has already seen the new connection come up.

Handlers are awaited before the SDK carries on, so a slow one holds up the very reconnect or server switch it is reporting. Keep the work short.

It does not fire for a connection attempt that never succeeded: there was no session, and so no subscription, to lose. It does fire when the client is disposed, since System.IDisposable.Dispose() closes the connection - and, because that close is not awaited, possibly after Dispose has returned. A handler that touches the client should be detached before disposing it.

| Edit this page View Source

OnTransaction

transaction stream event - the one a wallet renders for signing.

Declaration
event OnTransaction OnTransaction
Event Type
Type Description
OnTransaction
| Edit this page View Source

OnValidationReceived

validationReceived stream event.

Declaration
event OnValidationReceived OnValidationReceived
Event Type
Type Description
OnValidationReceived
| Edit this page View Source

OnWarning

Node warning reported over the socket.

Declaration
event OnWarning OnWarning
Event Type
Type Description
OnWarning

Extension Methods

BatchNormalizer.NormalizeBatchTransaction(IXrplClient, Dictionary<string, object>, CancellationToken)
AutofillSugar.Autofill(IXrplClient, Dictionary<string, object>, int?, CancellationToken)
AutofillSugar.CalculateFeePerTransactionType(IXrplClient, Dictionary<string, object>, int, CancellationToken)
AutofillSugar.CheckAccountDeleteBlockers(IXrplClient, Dictionary<string, object>, CancellationToken)
AutofillSugar.FetchReserveFee(IXrplClient, CancellationToken)
AutofillSugar.SetLatestValidatedLedgerSequence(IXrplClient, Dictionary<string, object>, CancellationToken)
AutofillSugar.SetNextValidSequenceNumber(IXrplClient, Dictionary<string, object>, CancellationToken)
BalancesSugar.GetBalances(IXrplClient, string, GetBalancesOptions, CancellationToken)
BalancesSugar.GetXrpBalance(IXrplClient, string, string, LedgerIndex, CancellationToken)
BalancesSugar.GetXrpFreeBalance(IXrplClient, string, string?, LedgerIndex?, CancellationToken)
ComposeSugar.ComposeSignatures(IXrplClient, IEnumerable<string>, CancellationToken)
DomainAccessSugar.GetDomainAccess(IXrplClient, string, string, CancellationToken)
GetFeeXrpSugar.GetFeeXrp(IXrplClient, double?, CancellationToken)
GetLedgerSugar.GetLedgerIndex(IXrplClient, CancellationToken)
GetOrderBookSugar.GetOrderbook(IXrplClient, TakerAmount, TakerAmount, uint, int, string, string, CancellationToken)
SubmitSugar.GetSignedTx(IXrplClient, Dictionary<string, object>, bool, XrplWallet?, CancellationToken, bool)
SubmitSugar.Submit(IXrplClient, Dictionary<string, object>, bool, bool, XrplWallet, CancellationToken)
SubmitSugar.SubmitAndWait(IXrplClient, Dictionary<string, object>, XrplWallet, bool, bool, CancellationToken)
SubmitSugar.SubmitAndWait(IXrplClient, ITransactionRequest, XrplWallet, bool, bool, CancellationToken)
SubmitSugar.SubmitAndWaitSponsored(IXrplClient, Dictionary<string, object>, XrplWallet, XrplWallet, bool, bool, CancellationToken)
SubmitSugar.SubmitAndWaitSponsored(IXrplClient, ITransactionRequest, XrplWallet, XrplWallet, bool, bool, CancellationToken)
SubmitSugar.SubmitMulti(IXrplClient, Dictionary<string, object>, IEnumerable<XrplWallet>, bool, bool, CancellationToken)
SubmitSugar.SubmitMulti(IXrplClient, ITransactionRequest, IEnumerable<XrplWallet>, bool, bool, CancellationToken)
SubmitSugar.SubmitMultiBatch(IXrplClient, Dictionary<string, object>, IEnumerable<XrplWallet>, bool, bool, CancellationToken)
SubmitSugar.SubmitMultiBatch(IXrplClient, Batch, IEnumerable<XrplWallet>, bool, bool, CancellationToken)
SubmitSugar.SubmitRequest(IXrplClient, object, bool, CancellationToken)
SubmitSugar.SubmitRequestAndWait(IXrplClient, object, bool, CancellationToken)
WalletSugar.FundWallet(IXrplClient, XrplWallet?, string?)
WalletSugar.FundWallet(IXrplClient, XrplWallet?, string?, CancellationToken)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX