Modular Account • Getting started
It is easy to get started with Modular Account! We will show you two different ways using Alchemy Infra or 3rd party infra.
Install packages
Prerequisites
- minimum Typescript version of 5
- pin viem to 2.20.0 (
yarn add [email protected]
)
Installation
First, install the @account-kit/smart-contracts
package.
With Alchemy Infra
Then you can do the following:
Address calculation
For Modular Account, the address of the smart account will be calculated as a combination of the owners and the salt. You will get the same smart account address each time you supply the same owners
, the signer(s) used to create the account for the first time. You can also optionally supply salt
if you want a different address for the same owners
param (the default salt is 0n
).
If you want to use a signer to connect to an account whose address does not map to the contract-generated address, you can supply the accountAddress
to connect with the account of interest. In that case, the signer
address is not used for address calculation, but only for signing the operation.
With 3rd-party infra
If you’re using a 3rd-party for infra, we also expose a client that you can use to interact with Modular Account using other RPC providers.
Next, if you want to use a different signer
with a smart account signer, check out choosing a signer. Otherwise, if you are ready to get on-chain, go to send user operations.