Send a user operation
User operations are the ERC-4337 counterpart to traditional blockchain transactions. They incorporate significant enhancements that improve user experience and provide greater flexibility in account management and transaction execution.
Viem's Account Abstraction API allows a developer to specify an array of Calls
that will be executed as a user operation via Viem's sendUserOperation
method.
The MetaMask Delegation Toolkit encodes and executes the provided calls.
User operations are not directly sent to the network. Instead, they are sent to a bundler, which validates, optimizes, and aggregates them before network submission. See Viem's Bundler Client for details on how to interact with the bundler.
If a user operation is sent from a MetaMask smart account that has not been deployed, the toolkit configures the user operation to automatically deploy the account.