## Quick Reference
This skill file provides quick access to the MetaMask Smart Accounts Kit v0.3.0. For detailed information, refer to the specific reference files.
**📚 Detailed References:**
- [Smart Accounts Reference](./references/smart-accounts.md) - Account creation, implementations, signers
- [Delegations Reference](./references/delegations.md) - Delegation lifecycle, scopes, caveats
- [Advanced Permissions Reference](./references/advanced-permissions.md) - ERC-7715 permissions via MetaMask
## Package Installation
```bash
npm install @metamask/smart-accounts-kit@0.3.0
```
For custom caveat enforcers:
```bash
forge install metamask/delegation-framework@v1.3.0
```
## Core Concepts Summary
### 1. Smart Accounts (ERC-4337)
Three implementation types:
- **Hybrid** (`Implementation.Hybrid`) - EOA + passkey signers
- **Multisig** (`Implementation.MultiSig`) - Multiple signers with threshold
- **Stateless7702** (`Implementation.Stateless7702`) - EIP-7702 upgraded EOA
### 2. Delegation Framework (ERC-7710)
Grant permissions from delegator to delegate:
- **Scopes** - Initial authority (spending limits, function calls)
- **Caveats** - Restrictions enforced by smart contracts
- **Types** - Root, open root, redelegation, open redelegation
- **Lifecycle** - Create → Sign → Store → Redeem
### 3. Advanced Permissions (ERC-7715)
Request permissions via MetaMask extension:
- Human-readable UI confirmations
- ERC-20 and native token permissions
- Requires MetaMask Flask 13.5.0+
- User must have smart account
## Quick Code Examples
### Create Smart Account
```typescript
import { Implementation, toMetaMaskSmartAccount } from '@metamask/smart-accounts-kit'
import { privateKeyToAccount } from 'viem/accounts'
const account = privateKeyToAccount('0x...')
const smartAccount = await toMetaMaskSmartAccount({
client: publicClient,
implementation: Implementation.Hybrid,
deployParams: [account.address, [], [], []],
deploySalt: '0x',
signer: { account },
})
`...
{ copied = true; setTimeout(() => copied = false, 2000) })"
class="absolute right-3 top-3 rounded-lg bg-slate-700 px-3 py-1.5 text-xs font-bold text-slate-200 hover:bg-slate-600 transition"
x-text="copied ? '已复制' : '复制'">