getRipplePathFound method

Future<RipplePathFound> getRipplePathFound({
  1. required String sourceAccount,
  2. required String destinationAccount,
  3. required CurrencyAmount destinationAmount,
  4. CurrencyAmount? sendMax,
  5. List<XRPCurrencies>? currencies,
})

Implementation

Future<RipplePathFound> getRipplePathFound(
    {required String sourceAccount,
    required String destinationAccount,
    required CurrencyAmount destinationAmount,
    CurrencyAmount? sendMax,
    List<XRPCurrencies>? currencies}) async {
  final Map<String, dynamic> configParams = {
    "source_account": sourceAccount,
    "destination_account": destinationAccount,
    "destination_amount": destinationAmount.toJson(),
  };
  createRpcConfig(configParams, "send_max", sendMax?.toJson());
  createRpcConfig(configParams, "source_currencies",
      currencies?.map((e) => e.toJson()).toList());

  final response = await makeCustomCall<Map<String, dynamic>>(
      "ripple_path_find", [configParams]);
  print("response $response");
  // return AccountInfo.fromJson(response);
  return RipplePathFound.fromJson(response);
}