executeBatch static method
- {required EthereumAddress walletAddress,
- required List<
EthereumAddress> recipients, - List<
EtherAmount> ? amounts, - List<
Uint8List> ? innerCalls}
Generates the calldata for a batched user operation.
walletAddress
: The address of the wallet.recipients
: A list of addresses to send the transaction.amounts
: A list of amounts to send alongside.innerCalls
: A list of calldata of the inner calls.
Returns the Uint8List of the calldata.
Implementation
static Uint8List executeBatch(
{required EthereumAddress walletAddress,
required List<EthereumAddress> recipients,
List<EtherAmount>? amounts,
List<Uint8List>? innerCalls}) {
final params = [
recipients,
amounts ?? [],
innerCalls ?? [],
];
if (innerCalls == null || innerCalls.isEmpty) {
require(amounts != null && amounts.isNotEmpty, "malformed batch request");
}
return encodeFunctionCall(
'executeBatch',
walletAddress,
ContractAbis.get('executeBatch'),
params,
);
}