getAccountInfo method

Future<AccountInfo> getAccountInfo(
  1. String address, {
  2. bool queue = false,
  3. bool signersList = false,
  4. bool strict = false,
  5. String? ledgerHash,
  6. XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated,
})

This request retrieves information about an account, its activity, and its XRP balance. All information retrieved is relative to a particular version of the ledger. See account_info

Implementation

Future<AccountInfo> getAccountInfo(String address,
    {bool queue = false,
    bool signersList = false,
    bool strict = false,
    String? ledgerHash,
    XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated}) async {
  final Map<String, dynamic> configParams = {
    "account": XRPAddressUtilities.toClassicAddress(address)
  };
  _createRpcConfig(configParams, "signersList", signersList);
  _createRpcConfig(configParams, "queue", queue);
  _createRpcConfig(configParams, "strict", strict);
  _createRpcConfig(configParams, "ledger_index", ledgerIndex?.value);
  _createRpcConfig(configParams, "ledger_hash", ledgerHash);
  _createRpcConfig(configParams, "signersList", signersList);
  final response = await makeCustomCall<Map<String, dynamic>>(
      "account_info", [configParams]);
  return AccountInfo.fromJson(response);
}