getAddress function

String getAddress({
  1. int accountIndex = 0,
  2. int addressIndex = 0,
})

Implementation

String getAddress({int accountIndex = 0, int addressIndex = 0}) {
  final errorBoxPointer = monero_flutter.buildErrorBoxPointer();
  final addressPointer =
      monero_flutter.bindings.get_address(accountIndex, addressIndex, errorBoxPointer);

  final address = addressPointer.cast<Utf8>().toDartString();
  calloc.free(addressPointer);

  final errorInfo = monero_flutter.extractErrorInfo(errorBoxPointer);

  if (0 != errorInfo.code) {
    throw Exception(errorInfo.getErrorMessage());
  }

  return address;
}