createScriptTransaction method
Future<AptosRawTransaction>
createScriptTransaction({
- required AptosAddress sender,
- required List<
int> byteCode, - required List<
AptosScriptArguments> arguments, - List<
AptosTypeTag> typeArgs = const [], - AptosApiBuildTransactionParams? params,
Creates a script transaction to execute custom bytecode on the Aptos blockchain.
sender
: The sender's address.byteCode
: The compiled bytecode to execute.arguments
: The script arguments required by the bytecode.typeArgs
(optional): Type arguments for the script, if applicable.params
(optional): Additional transaction settings.
Implementation
Future<AptosRawTransaction> createScriptTransaction({
required AptosAddress sender,
required List<int> byteCode,
required List<AptosScriptArguments<dynamic>> arguments,
List<AptosTypeTag> typeArgs = const [],
AptosApiBuildTransactionParams? params,
}) {
final transactionPayload = AptosTransactionPayloadScript(
script: AptosScript(
arguments: arguments, typeArgs: typeArgs, byteCode: byteCode));
return buildTransaction(
sender: sender, transactionPayload: transactionPayload, params: params);
}