fundAccount method

Future<List<String>> fundAccount(
  1. String address,
  2. String amount, {
  3. int timeoutSecs = 20,
})

Implementation

Future<List<String>> fundAccount(String address, String amount, {int timeoutSecs = 20}) async {
  final params = { "address": HexString.ensure(address).noPrefix(), "amount": amount };
  final response = await http.post("$endpoint/mint", queryParameters: params);

  final futures = <Future<void>>[];
  for (var txhash in response.data) {
       futures.add(aptosClient.waitForTransaction(txhash, timeoutSecs: timeoutSecs));
  }

  await Future.wait(futures);
  return response.data.cast<String>();
}