getSubaddressLabel function

String getSubaddressLabel(
  1. int accountIndex,
  2. int addressIndex
)

Implementation

String getSubaddressLabel(int accountIndex, int addressIndex) {
  final errorBoxPointer = monero_flutter.buildErrorBoxPointer();
  final labelPointer =
      monero_flutter.bindings.get_subaddress_label(accountIndex, addressIndex, errorBoxPointer);

  final label = labelPointer.cast<Utf8>().toDartString();
  calloc.free(labelPointer);

  final errorInfo = monero_flutter.extractErrorInfo(errorBoxPointer);

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

  return label;
}