Show / Hide Table of Contents

Class SubmitSugar

Inheritance
object
SubmitSugar
Namespace: Xrpl.Sugar
Assembly: Xrpl.dll
Syntax
public static class SubmitSugar

Methods

| Edit this page View Source

GetLastLedgerSequence(object)

checks if there is a LastLedgerSequence as a part of the transaction

Declaration
public static uint? GetLastLedgerSequence(object transaction)
Parameters
Type Name Description
object transaction

tx

Returns
Type Description
uint?
| Edit this page View Source

GetSignedTx(IXrplClient, Dictionary<string, object>, bool, XrplWallet?, CancellationToken, bool)

Initializes a transaction for a submit request

Declaration
public static Task<(string txBlob, Dictionary<string, object> tx)> GetSignedTx(this IXrplClient client, Dictionary<string, object> transaction, bool autofill = false, XrplWallet? wallet = null, CancellationToken cancellationToken = default, bool sponsorPreCheck = true)
Parameters
Type Name Description
IXrplClient client

A Client.

Dictionary<string, object> transaction

A transaction to autofill, sign and encode.

bool autofill

If true, autofill a transaction.

XrplWallet wallet

A wallet to sign a transaction. It must be provided when submitting an unsigned transaction.

CancellationToken cancellationToken
bool sponsorPreCheck
Returns
Type Description
Task<(string txBlob, Dictionary<string, object> tx)>

The signed transaction blob and the transaction it was built from.

| Edit this page View Source

IsAccountDelete(object)

checks if the transaction is an AccountDelete transaction

Declaration
public static bool IsAccountDelete(object transaction)
Parameters
Type Name Description
object transaction

tx

Returns
Type Description
bool
| Edit this page View Source

IsSigned(object)

Declaration
public static bool IsSigned(object transaction)
Parameters
Type Name Description
object transaction
Returns
Type Description
bool
| Edit this page View Source

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

Submits a signed/unsigned transaction.
Steps performed on a transaction:
1.
Autofill.
2.
Sign and Encode.
3.
Submit.

Declaration
public static Task<Submit> Submit(this IXrplClient client, Dictionary<string, object> transaction, bool autofill = true, bool failHard = false, XrplWallet wallet = null, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

A Client.

Dictionary<string, object> transaction

A transaction to autofill, sign and encode, and submit.

bool autofill

If true, autofill a transaction.

bool failHard

If true, and the transaction fails locally, do not retry or relay the transaction to other servers.

XrplWallet wallet

A wallet to sign a transaction. It must be provided when submitting an unsigned transaction.

CancellationToken cancellationToken
Returns
Type Description
Task<Submit>

A promise that contains SubmitResponse

| Edit this page View Source

SubmitAndWait(IXrplClient, Dictionary<string, object>, XrplWallet, bool, bool, CancellationToken)

Asynchronously submits a transaction and verifies that it has been included in a validated ledger(or has errored/will not be included for some reason). See[Reliable Transaction Submission] (https://xrpl.org/reliable-transaction-submission.html).

Declaration
public static Task<TransactionSummary> SubmitAndWait(this IXrplClient client, Dictionary<string, object> transaction, XrplWallet wallet = null, bool autofill = true, bool failHard = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

A Client.

Dictionary<string, object> transaction

A transaction to autofill, sign and encode, and submit.

XrplWallet wallet

A wallet to sign a transaction. It must be provided when submitting an unsigned transaction.

bool autofill

If true, autofill a transaction.

bool failHard

If true, and the transaction fails locally, do not retry or relay the transaction to other servers.

CancellationToken cancellationToken
Returns
Type Description
Task<TransactionSummary>

A promise that contains TxResponse, that will return when the transaction has been validated.

Remarks

The outcomes, and what each means for submitting again, are those of SubmitRequestAndWait(IXrplClient, object, bool, CancellationToken).

| Edit this page View Source

SubmitAndWait(IXrplClient, ITransactionRequest, XrplWallet, bool, bool, CancellationToken)

Asynchronously submits a transaction and verifies that it has been included in a validated ledger(or has errored/will not be included for some reason). See[Reliable Transaction Submission] (https://xrpl.org/reliable-transaction-submission.html).

Declaration
public static Task<TransactionSummary> SubmitAndWait(this IXrplClient client, ITransactionRequest transaction, XrplWallet wallet = null, bool autofill = true, bool failHard = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

A Client.

ITransactionRequest transaction

A transaction to autofill, sign and encode, and submit.

XrplWallet wallet

A wallet to sign a transaction. It must be provided when submitting an unsigned transaction.

bool autofill

If true, autofill a transaction.

bool failHard

If true, and the transaction fails locally, do not retry or relay the transaction to other servers.

CancellationToken cancellationToken
Returns
Type Description
Task<TransactionSummary>

A promise that contains TxResponse, that will return when the transaction has been validated.

Remarks

The outcomes, and what each means for submitting again, are those of SubmitRequestAndWait(IXrplClient, object, bool, CancellationToken).

| Edit this page View Source

SubmitAndWaitSponsored(IXrplClient, Dictionary<string, object>, XrplWallet, XrplWallet, bool, bool, CancellationToken)

Submits a sponsored transaction with both keys available locally (the V1 flow in one call): autofills, prepares, co-signs with the sponsee and the sponsor, submits and waits for the final outcome.

Declaration
public static Task<TransactionSummary> SubmitAndWaitSponsored(this IXrplClient client, Dictionary<string, object> transaction, XrplWallet sponseeWallet, XrplWallet sponsorWallet, bool autofill = true, bool failHard = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

A Client.

Dictionary<string, object> transaction

A transaction carrying Sponsor/SponsorFlags.

XrplWallet sponseeWallet

The submitting account's wallet.

XrplWallet sponsorWallet

The sponsor's wallet (must match tx.Sponsor).

bool autofill

If true, autofill the transaction.

bool failHard

If true, do not retry or relay on local failure.

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

SubmitAndWaitSponsored(IXrplClient, ITransactionRequest, XrplWallet, XrplWallet, bool, bool, CancellationToken)

Submits a sponsored transaction with both keys available locally (the V1 flow in one call).

Declaration
public static Task<TransactionSummary> SubmitAndWaitSponsored(this IXrplClient client, ITransactionRequest transaction, XrplWallet sponseeWallet, XrplWallet sponsorWallet, bool autofill = true, bool failHard = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client
ITransactionRequest transaction
XrplWallet sponseeWallet
XrplWallet sponsorWallet
bool autofill
bool failHard
CancellationToken cancellationToken
Returns
Type Description
Task<TransactionSummary>
| Edit this page View Source

SubmitMulti(IXrplClient, Dictionary<string, object>, IEnumerable<XrplWallet>, bool, bool, CancellationToken)

Encodes and submits a signed transaction.

Declaration
public static Task<Submit> SubmitMulti(this IXrplClient client, Dictionary<string, object> tx, IEnumerable<XrplWallet> wallets, bool autofill = true, bool failHard = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

A Client.

Dictionary<string, object> tx

transaction for submit

IEnumerable<XrplWallet> wallets

wallets for signer

bool autofill

autofill transaction missed fields

bool failHard

If true, and the transaction fails locally, do not retry or relay the transaction to other servers.

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

SubmitMulti(IXrplClient, ITransactionRequest, IEnumerable<XrplWallet>, bool, bool, CancellationToken)

Encodes and submits a signed transaction.

Declaration
public static Task<Submit> SubmitMulti(this IXrplClient client, ITransactionRequest tx, IEnumerable<XrplWallet> wallets, bool autofill = true, bool failHard = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

A Client.

ITransactionRequest tx

transaction for submit

IEnumerable<XrplWallet> wallets

wallets for signer

bool autofill

autofill transaction missed fields

bool failHard

If true, and the transaction fails locally, do not retry or relay the transaction to other servers.

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

SubmitMultiBatch(IXrplClient, Dictionary<string, object>, IEnumerable<XrplWallet>, bool, bool, CancellationToken)

Encodes and submits a Batch signed transaction.

Declaration
public static Task<Submit> SubmitMultiBatch(this IXrplClient client, Dictionary<string, object> txJson, IEnumerable<XrplWallet> wallets, bool autofill = true, bool failHard = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

A Client.

Dictionary<string, object> txJson

transaction for submit

IEnumerable<XrplWallet> wallets

wallets for signer

bool autofill

autofill transaction missed fields

bool failHard

If true, and the transaction fails locally, do not retry or relay the transaction to other servers.

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

SubmitMultiBatch(IXrplClient, Batch, IEnumerable<XrplWallet>, bool, bool, CancellationToken)

Encodes and submits a Batch signed transaction.

Declaration
public static Task<Submit> SubmitMultiBatch(this IXrplClient client, Batch tx, IEnumerable<XrplWallet> wallets, bool autofill = true, bool failHard = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

A Client.

Batch tx

transaction for submit

IEnumerable<XrplWallet> wallets

wallets for signer

bool autofill

autofill transaction missed fields

bool failHard

If true, and the transaction fails locally, do not retry or relay the transaction to other servers.

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

SubmitRequest(IXrplClient, object, bool, CancellationToken)

Encodes and submits a signed transaction.

Declaration
public static Task<Submit> SubmitRequest(this IXrplClient client, object signedTransaction, bool failHard, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

A Client.

object signedTransaction

signed Transaction

bool failHard

If true, and the transaction fails locally, do not retry or relay the transaction to other servers.

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

SubmitRequestAndWait(IXrplClient, object, bool, CancellationToken)

Submits a signed transaction and waits until it is in a validated ledger or will never be.

Declaration
public static Task<TransactionSummary> SubmitRequestAndWait(this IXrplClient client, object signedTransaction, bool failHard, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client
object signedTransaction
bool failHard
CancellationToken cancellationToken
Returns
Type Description
Task<TransactionSummary>
Remarks

Outcomes, and what each means for submitting again:

  • a TransactionSummary: validated with tesSUCCESS;
  • TransactionFailedException: final failure, applied with a tec (ReachedLedger) or refused by the node;
  • TransactionExpiredException: never applied, a replacement is safe;
  • TransactionOutcomeUnknownException: possibly applied, find out with WaitForTransactionOutcome(IXrplClient, string, uint, uint, CancellationToken) before sending a replacement. Any failure of the submit request other than an error answer from the node ends here, with the cause inside;
  • an error answer to the submit request (RippledException), or any failure before it - autofill, signing, reading the validated ledger: nothing was submitted.

A cancelled cancellationToken raises System.OperationCanceledException. Once the submit request is sent it is a TransactionWaitCanceledException, whose Hash, LastLedgerSequence and MinLedger resume the wait with WaitForTransactionOutcome(IXrplClient, string, uint, uint, CancellationToken).

| Edit this page View Source

WaitForTransactionOutcome(IXrplClient, string, uint, uint, CancellationToken)

Waits for a transaction that was already submitted until it is in a validated ledger or will never be, without submitting it again.

Declaration
public static Task<TransactionSummary> WaitForTransactionOutcome(this IXrplClient client, string txHash, uint lastLedgerSequence, uint minLedger, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

A Client.

string txHash

The transaction's hash.

uint lastLedgerSequence

The transaction's LastLedgerSequence.

uint minLedger

The ledger validated before the transaction was first submitted.

CancellationToken cancellationToken

Stops waiting.

Returns
Type Description
Task<TransactionSummary>
Remarks

For a transaction whose submission was interrupted - a crash, a timeout, a TransactionOutcomeUnknownException. The outcomes are those of SubmitRequestAndWait(IXrplClient, object, bool, CancellationToken). A TransactionExpiredException needs a server that holds every ledger from minLedger to lastLedgerSequence.

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