โ† All skills
Tencent SkillHub ยท Developer Tools

MetaMask Smart Accounts KIt

Web3 development using MetaMask Smart Accounts Kit. Use when the user wants to build dApps with ERC-4337 smart accounts, send user operations, batch transactions, configure signers (EOA, passkey, multisig), implement gas abstraction with paymasters, create delegations, or request advanced permissions (ERC-7715). Supports Viem integration, multiple signer types (Dynamic, Web3Auth, Wagmi), gasless transactions, and the Delegation Framework.

skill openclawclawhub Free
0 Downloads
0 Stars
0 Installs
0 Score
High Signal

Web3 development using MetaMask Smart Accounts Kit. Use when the user wants to build dApps with ERC-4337 smart accounts, send user operations, batch transactions, configure signers (EOA, passkey, multisig), implement gas abstraction with paymasters, create delegations, or request advanced permissions (ERC-7715). Supports Viem integration, multiple signer types (Dynamic, Web3Auth, Wagmi), gasless transactions, and the Delegation Framework.

โฌ‡ 0 downloads โ˜… 0 stars Unverified but indexed

Install for OpenClaw

Quick setup
  1. Download the package from Yavira.
  2. Extract the archive and review SKILL.md first.
  3. Import or place the package into your OpenClaw setup.

Requirements

Target platform
OpenClaw
Install method
Manual import
Extraction
Extract archive
Prerequisites
OpenClaw
Primary doc
SKILL.md

Package facts

Download mode
Yavira redirect
Package format
ZIP package
Source platform
Tencent SkillHub
What's included
SKILL.md, references/advanced-permissions.md, references/delegations.md, references/smart-accounts.md

Validation

  • Use the Yavira download entry.
  • Review SKILL.md after the package is downloaded.
  • Confirm the extracted package contains the expected setup assets.

Install with your agent

Agent handoff

Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.

  1. Download the package from Yavira.
  2. Extract it into a folder your agent can access.
  3. Paste one of the prompts below and point your agent at the extracted folder.
New install

I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.

Upgrade existing

I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.

Trust & source

Release facts

Source
Tencent SkillHub
Verification
Indexed source record
Version
1.0.0

Documentation

ClawHub primary doc Primary doc: SKILL.md 34 sections Open source page

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 - Account creation, implementations, signers Delegations Reference - Delegation lifecycle, scopes, caveats Advanced Permissions Reference - ERC-7715 permissions via MetaMask

Package Installation

npm install @metamask/smart-accounts-kit@0.3.0 For custom caveat enforcers: forge install metamask/delegation-framework@v1.3.0

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

Create Smart Account

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 }, })

Create Delegation

import { createDelegation } from '@metamask/smart-accounts-kit' import { parseUnits } from 'viem' const delegation = createDelegation({ to: delegateAddress, from: delegatorSmartAccount.address, environment: delegatorSmartAccount.environment, scope: { type: 'erc20TransferAmount', tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', maxAmount: parseUnits('10', 6), }, caveats: [ { type: 'timestamp', afterThreshold: now, beforeThreshold: expiry }, { type: 'limitedCalls', limit: 5 }, ], })

Sign Delegation

const signature = await smartAccount.signDelegation({ delegation }) const signedDelegation = { ...delegation, signature }

Redeem Delegation

import { createExecution, ExecutionMode } from '@metamask/smart-accounts-kit' import { DelegationManager } from '@metamask/smart-accounts-kit/contracts' import { encodeFunctionData, erc20Abi } from 'viem' const callData = encodeFunctionData({ abi: erc20Abi, args: [recipient, parseUnits('1', 6)], functionName: 'transfer', }) const execution = createExecution({ target: tokenAddress, callData }) const redeemCalldata = DelegationManager.encode.redeemDelegations({ delegations: [[signedDelegation]], modes: [ExecutionMode.SingleDefault], executions: [[execution]], }) // Via smart account const userOpHash = await bundlerClient.sendUserOperation({ account: delegateSmartAccount, calls: [{ to: delegateSmartAccount.address, data: redeemCalldata }], }) // Via EOA const txHash = await delegateWalletClient.sendTransaction({ to: environment.DelegationManager, data: redeemCalldata, })

Request Advanced Permissions

import { erc7715ProviderActions } from '@metamask/smart-accounts-kit/actions' const walletClient = createWalletClient({ transport: custom(window.ethereum), }).extend(erc7715ProviderActions()) const grantedPermissions = await walletClient.requestExecutionPermissions([ { chainId: chain.id, expiry: now + 604800, signer: { type: 'account', data: { address: sessionAccount.address }, }, permission: { type: 'erc20-token-periodic', data: { tokenAddress, periodAmount: parseUnits('10', 6), periodDuration: 86400, justification: 'Transfer 10 USDC daily', }, }, isAdjustmentAllowed: true, }, ])

Redeem Advanced Permissions

// Smart account import { erc7710BundlerActions } from '@metamask/smart-accounts-kit/actions' const bundlerClient = createBundlerClient({ client: publicClient, transport: http(bundlerUrl), }).extend(erc7710BundlerActions()) const permissionsContext = grantedPermissions[0].context const delegationManager = grantedPermissions[0].signerMeta.delegationManager const userOpHash = await bundlerClient.sendUserOperationWithDelegation({ publicClient, account: sessionAccount, calls: [ { to: tokenAddress, data: calldata, permissionsContext, delegationManager, }, ], }) // EOA import { erc7710WalletActions } from '@metamask/smart-accounts-kit/actions' const walletClient = createWalletClient({ account: sessionAccount, chain, transport: http(), }).extend(erc7710WalletActions()) const txHash = await walletClient.sendTransactionWithDelegation({ to: tokenAddress, data: calldata, permissionsContext, delegationManager, })

Smart Accounts

toMetaMaskSmartAccount() - Create smart account aggregateSignature() - Combine multisig signatures signDelegation() - Sign delegation signUserOperation() - Sign user operation signMessage() / signTypedData() - Standard signing

Delegations

createDelegation() - Create delegation with delegate createOpenDelegation() - Create open delegation createCaveatBuilder() - Build caveats array createExecution() - Create execution struct redeemDelegations() - Encode redemption calldata signDelegation() - Sign with private key getSmartAccountsEnvironment() - Resolve environment deploySmartAccountsEnvironment() - Deploy contracts overrideDeployedEnvironment() - Override environment

Advanced Permissions

erc7715ProviderActions() - Wallet client extension for requesting requestExecutionPermissions() - Request permissions erc7710BundlerActions() - Bundler client extension sendUserOperationWithDelegation() - Redeem with smart account erc7710WalletActions() - Wallet client extension sendTransactionWithDelegation() - Redeem with EOA

ERC-20 Token Permissions

Permission TypeDescriptionerc20-token-periodicPer-period limit that resets at each perioderc20-token-streamingLinear streaming with amountPerSecond rate

Native Token Permissions

Permission TypeDescriptionnative-token-periodicPer-period ETH limit that resetsnative-token-streamingLinear ETH streaming with amountPerSecond rate

Spending Limits

ScopeDescriptionerc20TransferAmountFixed ERC-20 limiterc20PeriodTransferPer-period ERC-20 limiterc20StreamingLinear streaming ERC-20nativeTokenTransferAmountFixed native token limitnativeTokenPeriodTransferPer-period native token limitnativeTokenStreamingLinear streaming nativeerc721TransferERC-721 (NFT) transfer

Function Calls

ScopeDescriptionfunctionCallSpecific methods/addresses allowedownershipTransferOwnership transfers only

Target & Method

allowedTargets - Limit callable addresses allowedMethods - Limit callable methods allowedCalldata - Validate specific calldata exactCalldata / exactCalldataBatch - Exact calldata match exactExecution / exactExecutionBatch - Exact execution match

Value & Token

valueLte - Limit native token value erc20TransferAmount - Limit ERC-20 amount erc20BalanceChange - Validate ERC-20 balance change erc721Transfer / erc721BalanceChange - ERC-721 restrictions erc1155BalanceChange - ERC-1155 validation

Time & Frequency

timestamp - Valid time range (seconds) blockNumber - Valid block range limitedCalls - Limit redemption count erc20PeriodTransfer / erc20Streaming - Time-based ERC-20 nativeTokenPeriodTransfer / nativeTokenStreaming - Time-based native

Security & State

redeemer - Limit redemption to specific addresses id - One-time delegation with ID nonce - Bulk revocation via nonce deployed - Auto-deploy contract ownershipTransfer - Ownership transfer only nativeTokenPayment - Require payment nativeBalanceChange - Validate native balance multiTokenPeriod - Multi-token period limits

Execution Modes

ModeChainsProcessingOn FailureSingleDefaultOneSequentialRevertSingleTryOneSequentialContinueBatchDefaultMultipleInterleavedRevertBatchTryMultipleInterleavedContinue

Core

ContractAddressEntryPoint0x0000000071727De22E5E9d8BAf0edAc6f37da032SimpleFactory0x69Aa2f9fe1572F1B640E1bbc512f5c3a734fc77cDelegationManager0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3MultiSigDeleGatorImpl0x56a9EdB16a0105eb5a4C54f4C062e2868844f3A7HybridDeleGatorImpl0x48dBe696A4D990079e039489bA2053B36E8FFEC4

Always Required

Always use caveats - Never create unrestricted delegations Deploy delegator first - Account must be deployed before redeeming Check smart account status - ERC-7715 requires user has smart account

Behavior

Caveats are cumulative - In delegation chains, restrictions stack Function call default - v0.3.0 defaults to NO native token (use valueLte) Batch mode caveat - No compatible caveat enforcers available

Requirements

ERC-7715 requirements - MetaMask Flask 13.5.0+, smart account Multisig threshold - Need at least threshold signers 7702 upgrade - Stateless7702 requires EIP-7702 upgrade first

Pattern 1: ERC-20 with Time Limit

const delegation = createDelegation({ to: delegate, from: delegator, environment, scope: { type: 'erc20TransferAmount', tokenAddress, maxAmount: parseUnits('100', 6), }, caveats: [ { type: 'timestamp', afterThreshold: now, beforeThreshold: expiry }, { type: 'limitedCalls', limit: 10 }, { type: 'redeemer', redeemers: [delegate] }, ], })

Pattern 2: Function Call with Value

const delegation = createDelegation({ to: delegate, from: delegator, environment, scope: { type: 'functionCall', targets: [contractAddress], selectors: ['transfer(address,uint256)'], valueLte: { maxValue: parseEther('0.1') }, }, caveats: [{ type: 'allowedMethods', selectors: ['transfer(address,uint256)'] }], })

Pattern 3: Periodic Native Token

const delegation = createDelegation({ to: delegate, from: delegator, environment, scope: { type: 'nativeTokenPeriodTransfer', periodAmount: parseEther('0.01'), periodDuration: 86400, startDate: now, }, })

Pattern 4: Redelegation Chain

// Alice โ†’ Bob (100 USDC) const aliceToBob = createDelegation({ to: bob, from: alice, environment, scope: { type: 'erc20TransferAmount', tokenAddress, maxAmount: parseUnits('100', 6) }, }) // Bob โ†’ Carol (50 USDC, subset of authority) const bobToCarol = createDelegation({ to: carol, from: bob, environment, scope: { type: 'erc20TransferAmount', tokenAddress, maxAmount: parseUnits('50', 6) }, parentDelegation: aliceToBob, caveats: [{ type: 'timestamp', afterThreshold: now, beforeThreshold: expiry }], })

Troubleshooting Quick Fixes

IssueSolutionAccount not deployedUse bundlerClient.sendUserOperation() to deployInvalid signatureVerify chain ID, delegation manager, signer permissionsCaveat enforcer revertedCheck caveat parameters match execution, verify orderRedemption failedCheck delegator balance, calldata validity, target contractsERC-7715 not workingUpgrade to Flask 13.5.0+, ensure user has smart accountPermission deniedHandle gracefully, provide manual fallbackThreshold not metAdd more signers for multisig7702 not workingConfirm EOA upgraded via EIP-7702 first

Resources

NPM: @metamask/smart-accounts-kit Contracts: metamask/delegation-framework@v1.3.0 ERC Standards: ERC-4337, ERC-7710, ERC-7715, ERC-7579 MetaMask Flask: https://metamask.io/flask

Version Info

Toolkit: 0.3.0 Delegation Framework: 1.3.0 Breaking Change: Function call scope defaults to no native token transfer For detailed documentation, see the reference files in the /references directory.

Category context

Code helpers, APIs, CLIs, browser automation, testing, and developer operations.

Source: Tencent SkillHub

Largest current source with strong distribution and engagement signals.

Package contents

Included in package
4 Docs
  • SKILL.md Primary doc
  • references/advanced-permissions.md Docs
  • references/delegations.md Docs
  • references/smart-accounts.md Docs