pathFind method

Future<Map<String, dynamic>> pathFind(
  1. PathFindSubcommand subcommand,
  2. String sourceAccount,
  3. String destinationAccount,
  4. XRP destinationAmount, {
  5. List<List<PathStep>>? paths,
  6. XRP? sendMax,
})

Implementation

Future<Map<String, dynamic>> pathFind(
  PathFindSubcommand subcommand,
  String sourceAccount,
  String destinationAccount,
  XRP destinationAmount, {
  List<List<PathStep>>? paths,
  XRP? sendMax,
}) async {
  final Map<String, dynamic> configParams = {};
  createRpcConfig(configParams, "subcommand", subcommand.value);
  createRpcConfig(configParams, "source_account", sourceAccount);
  createRpcConfig(configParams, "destination_account", destinationAccount);
  createRpcConfig(
      configParams, "destination_amount", destinationAmount.toJson());
  createRpcConfig(configParams, "send_max", sendMax?.toJson());
  createRpcConfig(configParams, "paths",
      paths?.map((e) => e.map((e) => e.toJson()).toList()).toList());
  final response =
      await makeCustomCall<Map<String, dynamic>>("path_find", [configParams]);
  return response;
}