Show / Hide Table of Contents

Class BalancesSugar

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

Methods

| Edit this page View Source

FormatBalances(IEnumerable<TrustLine>)

Declaration
public static IEnumerable<Balance> FormatBalances(this IEnumerable<TrustLine> trustlines)
Parameters
Type Name Description
IEnumerable<TrustLine> trustlines
Returns
Type Description
IEnumerable<Balance>
| Edit this page View Source

GetBalances(IXrplClient, string, GetBalancesOptions, CancellationToken)

Declaration
public static Task<List<Balance>> GetBalances(this IXrplClient client, string address, GetBalancesOptions options = null, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

Client.

string address
GetBalancesOptions options
CancellationToken cancellationToken
Returns
Type Description
Task<List<Balance>>
| Edit this page View Source

GetXrpBalance(IXrplClient, string, string, LedgerIndex, CancellationToken)

Get the XRP balance for an account.

Declaration
public static Task<string> GetXrpBalance(this IXrplClient client, string address, string ledgerHash = null, LedgerIndex lederIndex = null, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

Client.

string address

Address of the account to retrieve XRP balance.

string ledgerHash

Retrieve the account balances at the ledger with a given ledger_hash.

LedgerIndex lederIndex

Retrieve the account balances at a given ledgerIndex.

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

GetXrpFreeBalance(IXrplClient, string, string?, LedgerIndex?, CancellationToken)

Retrieves the available (free) XRP balance for the specified account address, accounting for network reserve requirements.

Declaration
public static Task<decimal> GetXrpFreeBalance(this IXrplClient client, string address, string? ledgerHash = null, LedgerIndex? lederIndex = null, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IXrplClient client

Client.

string address

The XRP Ledger account address for which to retrieve the free balance. Must be a valid account address.

string ledgerHash

The hash of the ledger to query. If null, the method uses the ledger specified by 'lederIndex' or the latest validated ledger.

LedgerIndex lederIndex

The ledger index to query. If null, the latest validated ledger is used.

CancellationToken cancellationToken
Returns
Type Description
Task<decimal>

A decimal value representing the amount of XRP that is available for spending or transfer from the specified account, after subtracting the account and owner reserve requirements.

Remarks

The free balance is calculated by subtracting the XRP Ledger's required account and owner reserves from the account's total balance. This value represents the amount of XRP that can be sent or withdrawn. The method queries the latest validated ledger by default unless a specific ledger hash or index is provided.

| Edit this page View Source

Map(TrustLine)

Declaration
public static Balance Map(this TrustLine trustline)
Parameters
Type Name Description
TrustLine trustline
Returns
Type Description
Balance
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX