createApplicationDeleteTransaction method

Future<ApplicationBaseTransaction> createApplicationDeleteTransaction({
  1. required Address sender,
  2. required int applicationId,
  3. List<Uint8List>? arguments,
  4. List<Address>? accounts,
  5. List<int>? foreignApps,
  6. List<int>? foreignAssets,
  7. List<AppBoxReference>? appBoxReferences,
  8. String? note,
  9. TransactionParams? suggestedParams,
})

Create a new ApplicationBaseTransaction.

@param sender The sender of the transaction. @param applicationId The id of the application to delete.

@returns The constructed application delete transaction.

Implementation

Future<ApplicationBaseTransaction> createApplicationDeleteTransaction({
  required Address sender,
  required int applicationId,
  List<Uint8List>? arguments,
  List<Address>? accounts,
  List<int>? foreignApps,
  List<int>? foreignAssets,
  List<AppBoxReference>? appBoxReferences,
  String? note,
  TransactionParams? suggestedParams,
}) async {
  // Fetch the suggested transaction params
  final params = suggestedParams ?? (await getSuggestedTransactionParams());

  // Create the transaction
  final tx = await (ApplicationDeleteTransactionBuilder()
        ..sender = sender
        ..applicationId = applicationId
        ..arguments = arguments
        ..accounts = accounts
        ..foreignApps = foreignApps
        ..foreignAssets = foreignAssets
        ..appBoxReferences = appBoxReferences
        ..noteText = note
        ..suggestedParams = params)
      .build();

  return tx;
}