getAccountCurrencies method

Future<Map<String, dynamic>> getAccountCurrencies(
  1. String address, {
  2. bool strict = false,
  3. String? ledgerHash,
  4. XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated,
})

This request retrieves a list of currencies that an account can send or receive, based on its trust lines. This is not a thoroughly confirmed list, but it can be used to populate user interfaces. See account_currencies

Implementation

Future<Map<String, dynamic>> getAccountCurrencies(
  String address, {
  bool strict = false,
  String? ledgerHash,
  XRPLLedgerIndex? ledgerIndex = XRPLLedgerIndex.validated,
}) async {
  final Map<String, dynamic> configParams = {};
  _createRpcConfig(configParams, "account", address);
  _createRpcConfig(configParams, "strict", strict);
  _createRpcConfig(configParams, "ledger_index", ledgerIndex?.value);
  _createRpcConfig(configParams, "ledger_hash", ledgerHash);
  final response = await makeCustomCall<Map<String, dynamic>>(
      "account_currencies", [configParams]);
  return response;
}