createApplicationCallTransaction method

Future<ApplicationBaseTransaction> createApplicationCallTransaction({
  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. OnCompletion onCompletion = OnCompletion.NO_OP_OC,
  10. TransactionParams? suggestedParams,
})

Create a new ApplicationBaseTransaction.

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

@returns The constructed application call transaction.

Implementation

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

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

  return tx;
}