Smart Contract Account
The SmartContractAccount
interface within Account Kit is the client-side definition of an on-chain smart contract implementation.
This interface is an extension of viem
's Account
interface, and provides a way to interact with smart contract accounts in a type-safe manner.
Within Account Kit, implementations for Light Account and Modular Account are exported from @account-kit/smart-contracts
. These implementations handle the logic for generating the deployment data, encoding
single and batch UO execution, and signing of messages, typed data, and UOs.
Smart Contract Accounts are rarely used on their own, and are typically passed in to Smart Account Client implementations. When using either the React or Core libraries, the connection of an account and a client are handled for you.
Custom accounts
It's also possible to use a custom account when using the Infra library.
Within @aa-sdk/core
, a method toSmartContractAccount
is provided so you can create an instance of your Smart Contract Account.