sendTransaction method

  1. @override
Future<UserOperationResponse> sendTransaction(
  1. EthereumAddress to,
  2. Uint8List encodedFunctionData,
  3. {EtherAmount? amount}
)
override

Sends a transaction to the wallet contract.

  • to: The address of the recipient.
  • encodedFunctionData: The calldata to send.
  • amount: The amount to send (optional).

Returns the UserOperationResponse of the transaction.

Implementation

@override
Future<UserOperationResponse> sendTransaction(
    EthereumAddress to, Uint8List encodedFunctionData,
    {EtherAmount? amount}) async {
  require(_walletAddress != null, 'Wallet not deployed');
  return sendUserOperation(buildUserOperation(
      callData: Contract.execute(_walletAddress!,
          to: to, amount: amount, innerCallData: encodedFunctionData)));
}