Module SDK

A TypeScript library for using Smart Account Modules in Applications
The Module SDK allows you to:
- Easily install and uninstall modules for any ERC-7579 account
- Interact with and use modules using a simple and consistent API
- Can be used alongside existing account SDKs such as permissionless, Biconomy, Zerodev and many more
- Use existing modules, such as:
- ECDSA Validator - Use ECDSA signatures to control an account
- Webauthn Validator - Use webauthn/passkeys to control an account
- MFA Validator - Set up multi-factor authentication for an account
- Scheduled Transfers - Schedule transfers to occur at a future time with an optional interval
- Scheduled Orders - Schedule swap orders to occur at a future time with an optional interval
In-depth documentation is available at docs.rhinestone.wtf.
Installation
Install viem as a peer dependency and then install the Module SDK:
npm install viem @rhinestone/module-sdk
pnpm install viem @rhinestone/module-sdk
yarn add viem @rhinestone/module-sdk
bun install viem @rhinestone/module-sdk
Quick Start
import {
installModule,
getModule,
getAccount,
getClient,
getMFAValidator,
} from '@rhinestone/module-sdk'
const client = getClient(network)
const module = getModule({
module: moduleAddress,
data: initData,
type: moduleType,
})
const mfaModule = getMFAValidator({
type: 'mfa-validator',
data: {
threshold: 2,
methods: ['webauthn', 'passkey'],
},
})
const account = getAccount({
address: '0x123...',
type: 'erc7579-implementation',
})
const actions = await installModule({
client,
account,
module,
})
accountSDK.execute(actions)
Features
Contributing
For feature or change requests, feel free to open a PR, start a discussion or get in touch with us.
For guidance on how to create PRs, see the CONTRIBUTING guide.
Using this repo
To install dependencies, run:
pnpm install
To build the sdk, run:
pnpm build
To run tests, run:
pnpm test
Authors ✨