sendUserOperation method

Asynchronously sends a user operation after signing it and obtaining the required signatures.

Parameters:

  • op: The UserOperation to be signed and sent.
  • id: Optional identifier (credential Id) when using a passkey signer Defaults to null.

Returns: A Future that completes with a UserOperationResponse containing information about the executed operation.

Example:

// when using passkey signer, the credentialId idenfies the credential that is associated with the account.
var response = await sendUserOperation(myUserOperation, id: 'credentialId'); // index is effectively ignored even if provided

Implementation

@override
Future<UserOperationResponse> sendUserOperation(UserOperation op) =>
    prepareUserOperation(op)
        .then(signUserOperation)
        .then(sendSignedUserOperation);