Class LoanPaymentOutcome
What a LoanPay did, read from its metadata - of a validated transaction, or of a
simulate run (PreviewLoanPay(IXrplClient, LoanPay, CancellationToken)).
Inheritance
Namespace: Xrpl.Sugar
Assembly: Xrpl.dll
Syntax
public sealed class LoanPaymentOutcome
Remarks
Amounts are in the loan asset's own unit - drops for XRP - as the Loan fields are.
The split comes from where the money went, not from the protocol's formulas: the vault
receives principal and interest, the broker the rest (management, service, late and
close fees).
Properties
| Edit this page View SourceAsset
The loan asset.
Declaration
public Common.IssuedCurrency Asset { get; init; }
Property Value
| Type | Description |
|---|---|
| Common.IssuedCurrency |
InterestToVault
Interest the vault received: PaidToVault less PrincipalPaid.
Declaration
public decimal InterestToVault { get; }
Property Value
| Type | Description |
|---|---|
| decimal |
IsPaidOff
Whether no payment remains.
Declaration
public bool IsPaidOff { get; }
Property Value
| Type | Description |
|---|---|
| bool |
LoanAfter
The Loan as the transaction left it.
Declaration
public LOLoan LoanAfter { get; init; }
Property Value
| Type | Description |
|---|---|
| LOLoan |
LoanId
The paid loan's ledger index.
Declaration
public string LoanId { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
PaidToBroker
What the broker received: TotalPaid less PaidToVault.
Declaration
public decimal PaidToBroker { get; }
Property Value
| Type | Description |
|---|---|
| decimal |
PaidToVault
What the vault received: principal and interest.
Declaration
public decimal PaidToVault { get; init; }
Property Value
| Type | Description |
|---|---|
| decimal |
PaymentsMade
Payments the transaction settled: the drop in PaymentRemaining.
Declaration
public uint PaymentsMade { get; init; }
Property Value
| Type | Description |
|---|---|
| uint |
PrincipalPaid
The drop in PrincipalOutstanding.
Declaration
public decimal PrincipalPaid { get; init; }
Property Value
| Type | Description |
|---|---|
| decimal |
TotalPaid
What left the payer's balance, the transaction fee excluded.
Declaration
public decimal TotalPaid { get; init; }
Property Value
| Type | Description |
|---|---|
| decimal |
Methods
| Edit this page View SourceFromMetadata(ILoanPay, ITransactionMetadata)
Reads the outcome of transaction from its metadata.
Declaration
public static LoanPaymentOutcome FromMetadata(ILoanPay transaction, ITransactionMetadata metadata)
Parameters
| Type | Name | Description |
|---|---|---|
| ILoanPay | transaction | |
| ITransactionMetadata | metadata |
Returns
| Type | Description |
|---|---|
| LoanPaymentOutcome |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The metadata does not modify the transaction's |