How to transfer ownership of a Light Account
Not all smart account implementations support transferring the ownership (e.g. SimpleAccount). However, a number of the accounts in this guide and in Smart Wallets do, including our LightAccount! Let’s see a few different ways we can transfer ownership of an Account (using LightAccount as an example).
Usage
LightAccount exposes the following method which allows the existing owner to transfer ownership to a new owner address:
There a number of ways you can call this method using Smart Wallets.
1. Using transferOwnership client action
Since @alchemy/aa-accounts exports a LightAccount ABI, the above approach makes it easy to transfer ownership. That said, you can also directly call sendUserOperation to execute the ownership transfer. As you will see below, however, it is a bit verbose:
2. Using sendUserOperation
See the LightAccount docs for more details about our `LightAccount implementation.