getAccountSequence static method
This asynchronous function retrieves the account sequence number for a given address from an XRPL server.
Implementation
static Future<int> getAccountSequence(XRPLRpc client, String address) async {
/// Fetch account information for the specified address.
final accountInfo = await client.request(
RPCAccountInfo(account: address, ledgerIndex: XRPLLedgerIndex.current));
/// Extract the account sequence number from the account information.
final int sequence = accountInfo.accountData.sequence;
/// Return the retrieved account sequence number.
return sequence;
}