{
  "schemaVersion": "1.0",
  "item": {
    "slug": "metamask-smart-accounts-kit",
    "name": "MetaMask Smart Accounts KIt",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/AyushBherwani1998/metamask-smart-accounts-kit",
    "canonicalUrl": "https://clawhub.ai/AyushBherwani1998/metamask-smart-accounts-kit",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/metamask-smart-accounts-kit",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=metamask-smart-accounts-kit",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "references/advanced-permissions.md",
      "references/delegations.md",
      "references/smart-accounts.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "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."
        },
        {
          "label": "Upgrade existing",
          "body": "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."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/metamask-smart-accounts-kit"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/metamask-smart-accounts-kit",
    "agentPageUrl": "https://openagent3.xyz/skills/metamask-smart-accounts-kit/agent",
    "manifestUrl": "https://openagent3.xyz/skills/metamask-smart-accounts-kit/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/metamask-smart-accounts-kit/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "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."
      },
      {
        "label": "Upgrade existing",
        "body": "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."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Quick Reference",
        "body": "This skill file provides quick access to the MetaMask Smart Accounts Kit v0.3.0. For detailed information, refer to the specific reference files.\n\n📚 Detailed References:\n\nSmart Accounts Reference - Account creation, implementations, signers\nDelegations Reference - Delegation lifecycle, scopes, caveats\nAdvanced Permissions Reference - ERC-7715 permissions via MetaMask"
      },
      {
        "title": "Package Installation",
        "body": "npm install @metamask/smart-accounts-kit@0.3.0\n\nFor custom caveat enforcers:\n\nforge install metamask/delegation-framework@v1.3.0"
      },
      {
        "title": "1. Smart Accounts (ERC-4337)",
        "body": "Three implementation types:\n\nHybrid (Implementation.Hybrid) - EOA + passkey signers\nMultisig (Implementation.MultiSig) - Multiple signers with threshold\nStateless7702 (Implementation.Stateless7702) - EIP-7702 upgraded EOA"
      },
      {
        "title": "2. Delegation Framework (ERC-7710)",
        "body": "Grant permissions from delegator to delegate:\n\nScopes - Initial authority (spending limits, function calls)\nCaveats - Restrictions enforced by smart contracts\nTypes - Root, open root, redelegation, open redelegation\nLifecycle - Create → Sign → Store → Redeem"
      },
      {
        "title": "3. Advanced Permissions (ERC-7715)",
        "body": "Request permissions via MetaMask extension:\n\nHuman-readable UI confirmations\nERC-20 and native token permissions\nRequires MetaMask Flask 13.5.0+\nUser must have smart account"
      },
      {
        "title": "Create Smart Account",
        "body": "import { Implementation, toMetaMaskSmartAccount } from '@metamask/smart-accounts-kit'\nimport { privateKeyToAccount } from 'viem/accounts'\n\nconst account = privateKeyToAccount('0x...')\n\nconst smartAccount = await toMetaMaskSmartAccount({\n  client: publicClient,\n  implementation: Implementation.Hybrid,\n  deployParams: [account.address, [], [], []],\n  deploySalt: '0x',\n  signer: { account },\n})"
      },
      {
        "title": "Create Delegation",
        "body": "import { createDelegation } from '@metamask/smart-accounts-kit'\nimport { parseUnits } from 'viem'\n\nconst delegation = createDelegation({\n  to: delegateAddress,\n  from: delegatorSmartAccount.address,\n  environment: delegatorSmartAccount.environment,\n  scope: {\n    type: 'erc20TransferAmount',\n    tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238',\n    maxAmount: parseUnits('10', 6),\n  },\n  caveats: [\n    { type: 'timestamp', afterThreshold: now, beforeThreshold: expiry },\n    { type: 'limitedCalls', limit: 5 },\n  ],\n})"
      },
      {
        "title": "Sign Delegation",
        "body": "const signature = await smartAccount.signDelegation({ delegation })\nconst signedDelegation = { ...delegation, signature }"
      },
      {
        "title": "Redeem Delegation",
        "body": "import { createExecution, ExecutionMode } from '@metamask/smart-accounts-kit'\nimport { DelegationManager } from '@metamask/smart-accounts-kit/contracts'\nimport { encodeFunctionData, erc20Abi } from 'viem'\n\nconst callData = encodeFunctionData({\n  abi: erc20Abi,\n  args: [recipient, parseUnits('1', 6)],\n  functionName: 'transfer',\n})\n\nconst execution = createExecution({ target: tokenAddress, callData })\n\nconst redeemCalldata = DelegationManager.encode.redeemDelegations({\n  delegations: [[signedDelegation]],\n  modes: [ExecutionMode.SingleDefault],\n  executions: [[execution]],\n})\n\n// Via smart account\nconst userOpHash = await bundlerClient.sendUserOperation({\n  account: delegateSmartAccount,\n  calls: [{ to: delegateSmartAccount.address, data: redeemCalldata }],\n})\n\n// Via EOA\nconst txHash = await delegateWalletClient.sendTransaction({\n  to: environment.DelegationManager,\n  data: redeemCalldata,\n})"
      },
      {
        "title": "Request Advanced Permissions",
        "body": "import { erc7715ProviderActions } from '@metamask/smart-accounts-kit/actions'\n\nconst walletClient = createWalletClient({\n  transport: custom(window.ethereum),\n}).extend(erc7715ProviderActions())\n\nconst grantedPermissions = await walletClient.requestExecutionPermissions([\n  {\n    chainId: chain.id,\n    expiry: now + 604800,\n    signer: {\n      type: 'account',\n      data: { address: sessionAccount.address },\n    },\n    permission: {\n      type: 'erc20-token-periodic',\n      data: {\n        tokenAddress,\n        periodAmount: parseUnits('10', 6),\n        periodDuration: 86400,\n        justification: 'Transfer 10 USDC daily',\n      },\n    },\n    isAdjustmentAllowed: true,\n  },\n])"
      },
      {
        "title": "Redeem Advanced Permissions",
        "body": "// Smart account\nimport { erc7710BundlerActions } from '@metamask/smart-accounts-kit/actions'\n\nconst bundlerClient = createBundlerClient({\n  client: publicClient,\n  transport: http(bundlerUrl),\n}).extend(erc7710BundlerActions())\n\nconst permissionsContext = grantedPermissions[0].context\nconst delegationManager = grantedPermissions[0].signerMeta.delegationManager\n\nconst userOpHash = await bundlerClient.sendUserOperationWithDelegation({\n  publicClient,\n  account: sessionAccount,\n  calls: [\n    {\n      to: tokenAddress,\n      data: calldata,\n      permissionsContext,\n      delegationManager,\n    },\n  ],\n})\n\n// EOA\nimport { erc7710WalletActions } from '@metamask/smart-accounts-kit/actions'\n\nconst walletClient = createWalletClient({\n  account: sessionAccount,\n  chain,\n  transport: http(),\n}).extend(erc7710WalletActions())\n\nconst txHash = await walletClient.sendTransactionWithDelegation({\n  to: tokenAddress,\n  data: calldata,\n  permissionsContext,\n  delegationManager,\n})"
      },
      {
        "title": "Smart Accounts",
        "body": "toMetaMaskSmartAccount() - Create smart account\naggregateSignature() - Combine multisig signatures\nsignDelegation() - Sign delegation\nsignUserOperation() - Sign user operation\nsignMessage() / signTypedData() - Standard signing"
      },
      {
        "title": "Delegations",
        "body": "createDelegation() - Create delegation with delegate\ncreateOpenDelegation() - Create open delegation\ncreateCaveatBuilder() - Build caveats array\ncreateExecution() - Create execution struct\nredeemDelegations() - Encode redemption calldata\nsignDelegation() - Sign with private key\ngetSmartAccountsEnvironment() - Resolve environment\ndeploySmartAccountsEnvironment() - Deploy contracts\noverrideDeployedEnvironment() - Override environment"
      },
      {
        "title": "Advanced Permissions",
        "body": "erc7715ProviderActions() - Wallet client extension for requesting\nrequestExecutionPermissions() - Request permissions\nerc7710BundlerActions() - Bundler client extension\nsendUserOperationWithDelegation() - Redeem with smart account\nerc7710WalletActions() - Wallet client extension\nsendTransactionWithDelegation() - Redeem with EOA"
      },
      {
        "title": "ERC-20 Token Permissions",
        "body": "Permission TypeDescriptionerc20-token-periodicPer-period limit that resets at each perioderc20-token-streamingLinear streaming with amountPerSecond rate"
      },
      {
        "title": "Native Token Permissions",
        "body": "Permission TypeDescriptionnative-token-periodicPer-period ETH limit that resetsnative-token-streamingLinear ETH streaming with amountPerSecond rate"
      },
      {
        "title": "Spending Limits",
        "body": "ScopeDescriptionerc20TransferAmountFixed ERC-20 limiterc20PeriodTransferPer-period ERC-20 limiterc20StreamingLinear streaming ERC-20nativeTokenTransferAmountFixed native token limitnativeTokenPeriodTransferPer-period native token limitnativeTokenStreamingLinear streaming nativeerc721TransferERC-721 (NFT) transfer"
      },
      {
        "title": "Function Calls",
        "body": "ScopeDescriptionfunctionCallSpecific methods/addresses allowedownershipTransferOwnership transfers only"
      },
      {
        "title": "Target & Method",
        "body": "allowedTargets - Limit callable addresses\nallowedMethods - Limit callable methods\nallowedCalldata - Validate specific calldata\nexactCalldata / exactCalldataBatch - Exact calldata match\nexactExecution / exactExecutionBatch - Exact execution match"
      },
      {
        "title": "Value & Token",
        "body": "valueLte - Limit native token value\nerc20TransferAmount - Limit ERC-20 amount\nerc20BalanceChange - Validate ERC-20 balance change\nerc721Transfer / erc721BalanceChange - ERC-721 restrictions\nerc1155BalanceChange - ERC-1155 validation"
      },
      {
        "title": "Time & Frequency",
        "body": "timestamp - Valid time range (seconds)\nblockNumber - Valid block range\nlimitedCalls - Limit redemption count\nerc20PeriodTransfer / erc20Streaming - Time-based ERC-20\nnativeTokenPeriodTransfer / nativeTokenStreaming - Time-based native"
      },
      {
        "title": "Security & State",
        "body": "redeemer - Limit redemption to specific addresses\nid - One-time delegation with ID\nnonce - Bulk revocation via nonce\ndeployed - Auto-deploy contract\nownershipTransfer - Ownership transfer only\nnativeTokenPayment - Require payment\nnativeBalanceChange - Validate native balance\nmultiTokenPeriod - Multi-token period limits"
      },
      {
        "title": "Execution Modes",
        "body": "ModeChainsProcessingOn FailureSingleDefaultOneSequentialRevertSingleTryOneSequentialContinueBatchDefaultMultipleInterleavedRevertBatchTryMultipleInterleavedContinue"
      },
      {
        "title": "Core",
        "body": "ContractAddressEntryPoint0x0000000071727De22E5E9d8BAf0edAc6f37da032SimpleFactory0x69Aa2f9fe1572F1B640E1bbc512f5c3a734fc77cDelegationManager0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3MultiSigDeleGatorImpl0x56a9EdB16a0105eb5a4C54f4C062e2868844f3A7HybridDeleGatorImpl0x48dBe696A4D990079e039489bA2053B36E8FFEC4"
      },
      {
        "title": "Always Required",
        "body": "Always use caveats - Never create unrestricted delegations\nDeploy delegator first - Account must be deployed before redeeming\nCheck smart account status - ERC-7715 requires user has smart account"
      },
      {
        "title": "Behavior",
        "body": "Caveats are cumulative - In delegation chains, restrictions stack\nFunction call default - v0.3.0 defaults to NO native token (use valueLte)\nBatch mode caveat - No compatible caveat enforcers available"
      },
      {
        "title": "Requirements",
        "body": "ERC-7715 requirements - MetaMask Flask 13.5.0+, smart account\nMultisig threshold - Need at least threshold signers\n7702 upgrade - Stateless7702 requires EIP-7702 upgrade first"
      },
      {
        "title": "Pattern 1: ERC-20 with Time Limit",
        "body": "const delegation = createDelegation({\n  to: delegate,\n  from: delegator,\n  environment,\n  scope: {\n    type: 'erc20TransferAmount',\n    tokenAddress,\n    maxAmount: parseUnits('100', 6),\n  },\n  caveats: [\n    { type: 'timestamp', afterThreshold: now, beforeThreshold: expiry },\n    { type: 'limitedCalls', limit: 10 },\n    { type: 'redeemer', redeemers: [delegate] },\n  ],\n})"
      },
      {
        "title": "Pattern 2: Function Call with Value",
        "body": "const delegation = createDelegation({\n  to: delegate,\n  from: delegator,\n  environment,\n  scope: {\n    type: 'functionCall',\n    targets: [contractAddress],\n    selectors: ['transfer(address,uint256)'],\n    valueLte: { maxValue: parseEther('0.1') },\n  },\n  caveats: [{ type: 'allowedMethods', selectors: ['transfer(address,uint256)'] }],\n})"
      },
      {
        "title": "Pattern 3: Periodic Native Token",
        "body": "const delegation = createDelegation({\n  to: delegate,\n  from: delegator,\n  environment,\n  scope: {\n    type: 'nativeTokenPeriodTransfer',\n    periodAmount: parseEther('0.01'),\n    periodDuration: 86400,\n    startDate: now,\n  },\n})"
      },
      {
        "title": "Pattern 4: Redelegation Chain",
        "body": "// Alice → Bob (100 USDC)\nconst aliceToBob = createDelegation({\n  to: bob,\n  from: alice,\n  environment,\n  scope: { type: 'erc20TransferAmount', tokenAddress, maxAmount: parseUnits('100', 6) },\n})\n\n// Bob → Carol (50 USDC, subset of authority)\nconst bobToCarol = createDelegation({\n  to: carol,\n  from: bob,\n  environment,\n  scope: { type: 'erc20TransferAmount', tokenAddress, maxAmount: parseUnits('50', 6) },\n  parentDelegation: aliceToBob,\n  caveats: [{ type: 'timestamp', afterThreshold: now, beforeThreshold: expiry }],\n})"
      },
      {
        "title": "Troubleshooting Quick Fixes",
        "body": "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"
      },
      {
        "title": "Resources",
        "body": "NPM: @metamask/smart-accounts-kit\nContracts: metamask/delegation-framework@v1.3.0\nERC Standards: ERC-4337, ERC-7710, ERC-7715, ERC-7579\nMetaMask Flask: https://metamask.io/flask"
      },
      {
        "title": "Version Info",
        "body": "Toolkit: 0.3.0\nDelegation Framework: 1.3.0\nBreaking Change: Function call scope defaults to no native token transfer\n\nFor detailed documentation, see the reference files in the /references directory."
      }
    ],
    "body": "Quick Reference\n\nThis skill file provides quick access to the MetaMask Smart Accounts Kit v0.3.0. For detailed information, refer to the specific reference files.\n\n📚 Detailed References:\n\nSmart Accounts Reference - Account creation, implementations, signers\nDelegations Reference - Delegation lifecycle, scopes, caveats\nAdvanced Permissions Reference - ERC-7715 permissions via MetaMask\nPackage Installation\nnpm install @metamask/smart-accounts-kit@0.3.0\n\n\nFor custom caveat enforcers:\n\nforge install metamask/delegation-framework@v1.3.0\n\nCore Concepts Summary\n1. Smart Accounts (ERC-4337)\n\nThree implementation types:\n\nHybrid (Implementation.Hybrid) - EOA + passkey signers\nMultisig (Implementation.MultiSig) - Multiple signers with threshold\nStateless7702 (Implementation.Stateless7702) - EIP-7702 upgraded EOA\n2. Delegation Framework (ERC-7710)\n\nGrant permissions from delegator to delegate:\n\nScopes - Initial authority (spending limits, function calls)\nCaveats - Restrictions enforced by smart contracts\nTypes - Root, open root, redelegation, open redelegation\nLifecycle - Create → Sign → Store → Redeem\n3. Advanced Permissions (ERC-7715)\n\nRequest permissions via MetaMask extension:\n\nHuman-readable UI confirmations\nERC-20 and native token permissions\nRequires MetaMask Flask 13.5.0+\nUser must have smart account\nQuick Code Examples\nCreate Smart Account\nimport { Implementation, toMetaMaskSmartAccount } from '@metamask/smart-accounts-kit'\nimport { privateKeyToAccount } from 'viem/accounts'\n\nconst account = privateKeyToAccount('0x...')\n\nconst smartAccount = await toMetaMaskSmartAccount({\n  client: publicClient,\n  implementation: Implementation.Hybrid,\n  deployParams: [account.address, [], [], []],\n  deploySalt: '0x',\n  signer: { account },\n})\n\nCreate Delegation\nimport { createDelegation } from '@metamask/smart-accounts-kit'\nimport { parseUnits } from 'viem'\n\nconst delegation = createDelegation({\n  to: delegateAddress,\n  from: delegatorSmartAccount.address,\n  environment: delegatorSmartAccount.environment,\n  scope: {\n    type: 'erc20TransferAmount',\n    tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238',\n    maxAmount: parseUnits('10', 6),\n  },\n  caveats: [\n    { type: 'timestamp', afterThreshold: now, beforeThreshold: expiry },\n    { type: 'limitedCalls', limit: 5 },\n  ],\n})\n\nSign Delegation\nconst signature = await smartAccount.signDelegation({ delegation })\nconst signedDelegation = { ...delegation, signature }\n\nRedeem Delegation\nimport { createExecution, ExecutionMode } from '@metamask/smart-accounts-kit'\nimport { DelegationManager } from '@metamask/smart-accounts-kit/contracts'\nimport { encodeFunctionData, erc20Abi } from 'viem'\n\nconst callData = encodeFunctionData({\n  abi: erc20Abi,\n  args: [recipient, parseUnits('1', 6)],\n  functionName: 'transfer',\n})\n\nconst execution = createExecution({ target: tokenAddress, callData })\n\nconst redeemCalldata = DelegationManager.encode.redeemDelegations({\n  delegations: [[signedDelegation]],\n  modes: [ExecutionMode.SingleDefault],\n  executions: [[execution]],\n})\n\n// Via smart account\nconst userOpHash = await bundlerClient.sendUserOperation({\n  account: delegateSmartAccount,\n  calls: [{ to: delegateSmartAccount.address, data: redeemCalldata }],\n})\n\n// Via EOA\nconst txHash = await delegateWalletClient.sendTransaction({\n  to: environment.DelegationManager,\n  data: redeemCalldata,\n})\n\nRequest Advanced Permissions\nimport { erc7715ProviderActions } from '@metamask/smart-accounts-kit/actions'\n\nconst walletClient = createWalletClient({\n  transport: custom(window.ethereum),\n}).extend(erc7715ProviderActions())\n\nconst grantedPermissions = await walletClient.requestExecutionPermissions([\n  {\n    chainId: chain.id,\n    expiry: now + 604800,\n    signer: {\n      type: 'account',\n      data: { address: sessionAccount.address },\n    },\n    permission: {\n      type: 'erc20-token-periodic',\n      data: {\n        tokenAddress,\n        periodAmount: parseUnits('10', 6),\n        periodDuration: 86400,\n        justification: 'Transfer 10 USDC daily',\n      },\n    },\n    isAdjustmentAllowed: true,\n  },\n])\n\nRedeem Advanced Permissions\n// Smart account\nimport { erc7710BundlerActions } from '@metamask/smart-accounts-kit/actions'\n\nconst bundlerClient = createBundlerClient({\n  client: publicClient,\n  transport: http(bundlerUrl),\n}).extend(erc7710BundlerActions())\n\nconst permissionsContext = grantedPermissions[0].context\nconst delegationManager = grantedPermissions[0].signerMeta.delegationManager\n\nconst userOpHash = await bundlerClient.sendUserOperationWithDelegation({\n  publicClient,\n  account: sessionAccount,\n  calls: [\n    {\n      to: tokenAddress,\n      data: calldata,\n      permissionsContext,\n      delegationManager,\n    },\n  ],\n})\n\n// EOA\nimport { erc7710WalletActions } from '@metamask/smart-accounts-kit/actions'\n\nconst walletClient = createWalletClient({\n  account: sessionAccount,\n  chain,\n  transport: http(),\n}).extend(erc7710WalletActions())\n\nconst txHash = await walletClient.sendTransactionWithDelegation({\n  to: tokenAddress,\n  data: calldata,\n  permissionsContext,\n  delegationManager,\n})\n\nKey API Methods\nSmart Accounts\ntoMetaMaskSmartAccount() - Create smart account\naggregateSignature() - Combine multisig signatures\nsignDelegation() - Sign delegation\nsignUserOperation() - Sign user operation\nsignMessage() / signTypedData() - Standard signing\nDelegations\ncreateDelegation() - Create delegation with delegate\ncreateOpenDelegation() - Create open delegation\ncreateCaveatBuilder() - Build caveats array\ncreateExecution() - Create execution struct\nredeemDelegations() - Encode redemption calldata\nsignDelegation() - Sign with private key\ngetSmartAccountsEnvironment() - Resolve environment\ndeploySmartAccountsEnvironment() - Deploy contracts\noverrideDeployedEnvironment() - Override environment\nAdvanced Permissions\nerc7715ProviderActions() - Wallet client extension for requesting\nrequestExecutionPermissions() - Request permissions\nerc7710BundlerActions() - Bundler client extension\nsendUserOperationWithDelegation() - Redeem with smart account\nerc7710WalletActions() - Wallet client extension\nsendTransactionWithDelegation() - Redeem with EOA\nSupported ERC-7715 Permission Types\nERC-20 Token Permissions\nPermission Type\tDescription\nerc20-token-periodic\tPer-period limit that resets at each period\nerc20-token-streaming\tLinear streaming with amountPerSecond rate\nNative Token Permissions\nPermission Type\tDescription\nnative-token-periodic\tPer-period ETH limit that resets\nnative-token-streaming\tLinear ETH streaming with amountPerSecond rate\nCommon Delegation Scopes\nSpending Limits\nScope\tDescription\nerc20TransferAmount\tFixed ERC-20 limit\nerc20PeriodTransfer\tPer-period ERC-20 limit\nerc20Streaming\tLinear streaming ERC-20\nnativeTokenTransferAmount\tFixed native token limit\nnativeTokenPeriodTransfer\tPer-period native token limit\nnativeTokenStreaming\tLinear streaming native\nerc721Transfer\tERC-721 (NFT) transfer\nFunction Calls\nScope\tDescription\nfunctionCall\tSpecific methods/addresses allowed\nownershipTransfer\tOwnership transfers only\nCommon Caveat Enforcers\nTarget & Method\nallowedTargets - Limit callable addresses\nallowedMethods - Limit callable methods\nallowedCalldata - Validate specific calldata\nexactCalldata / exactCalldataBatch - Exact calldata match\nexactExecution / exactExecutionBatch - Exact execution match\nValue & Token\nvalueLte - Limit native token value\nerc20TransferAmount - Limit ERC-20 amount\nerc20BalanceChange - Validate ERC-20 balance change\nerc721Transfer / erc721BalanceChange - ERC-721 restrictions\nerc1155BalanceChange - ERC-1155 validation\nTime & Frequency\ntimestamp - Valid time range (seconds)\nblockNumber - Valid block range\nlimitedCalls - Limit redemption count\nerc20PeriodTransfer / erc20Streaming - Time-based ERC-20\nnativeTokenPeriodTransfer / nativeTokenStreaming - Time-based native\nSecurity & State\nredeemer - Limit redemption to specific addresses\nid - One-time delegation with ID\nnonce - Bulk revocation via nonce\ndeployed - Auto-deploy contract\nownershipTransfer - Ownership transfer only\nnativeTokenPayment - Require payment\nnativeBalanceChange - Validate native balance\nmultiTokenPeriod - Multi-token period limits\nExecution Modes\nMode\tChains\tProcessing\tOn Failure\nSingleDefault\tOne\tSequential\tRevert\nSingleTry\tOne\tSequential\tContinue\nBatchDefault\tMultiple\tInterleaved\tRevert\nBatchTry\tMultiple\tInterleaved\tContinue\nContract Addresses (v1.3.0)\nCore\nContract\tAddress\nEntryPoint\t0x0000000071727De22E5E9d8BAf0edAc6f37da032\nSimpleFactory\t0x69Aa2f9fe1572F1B640E1bbc512f5c3a734fc77c\nDelegationManager\t0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3\nMultiSigDeleGatorImpl\t0x56a9EdB16a0105eb5a4C54f4C062e2868844f3A7\nHybridDeleGatorImpl\t0x48dBe696A4D990079e039489bA2053B36E8FFEC4\nCritical Rules\nAlways Required\nAlways use caveats - Never create unrestricted delegations\nDeploy delegator first - Account must be deployed before redeeming\nCheck smart account status - ERC-7715 requires user has smart account\nBehavior\nCaveats are cumulative - In delegation chains, restrictions stack\nFunction call default - v0.3.0 defaults to NO native token (use valueLte)\nBatch mode caveat - No compatible caveat enforcers available\nRequirements\nERC-7715 requirements - MetaMask Flask 13.5.0+, smart account\nMultisig threshold - Need at least threshold signers\n7702 upgrade - Stateless7702 requires EIP-7702 upgrade first\nCommon Patterns\nPattern 1: ERC-20 with Time Limit\nconst delegation = createDelegation({\n  to: delegate,\n  from: delegator,\n  environment,\n  scope: {\n    type: 'erc20TransferAmount',\n    tokenAddress,\n    maxAmount: parseUnits('100', 6),\n  },\n  caveats: [\n    { type: 'timestamp', afterThreshold: now, beforeThreshold: expiry },\n    { type: 'limitedCalls', limit: 10 },\n    { type: 'redeemer', redeemers: [delegate] },\n  ],\n})\n\nPattern 2: Function Call with Value\nconst delegation = createDelegation({\n  to: delegate,\n  from: delegator,\n  environment,\n  scope: {\n    type: 'functionCall',\n    targets: [contractAddress],\n    selectors: ['transfer(address,uint256)'],\n    valueLte: { maxValue: parseEther('0.1') },\n  },\n  caveats: [{ type: 'allowedMethods', selectors: ['transfer(address,uint256)'] }],\n})\n\nPattern 3: Periodic Native Token\nconst delegation = createDelegation({\n  to: delegate,\n  from: delegator,\n  environment,\n  scope: {\n    type: 'nativeTokenPeriodTransfer',\n    periodAmount: parseEther('0.01'),\n    periodDuration: 86400,\n    startDate: now,\n  },\n})\n\nPattern 4: Redelegation Chain\n// Alice → Bob (100 USDC)\nconst aliceToBob = createDelegation({\n  to: bob,\n  from: alice,\n  environment,\n  scope: { type: 'erc20TransferAmount', tokenAddress, maxAmount: parseUnits('100', 6) },\n})\n\n// Bob → Carol (50 USDC, subset of authority)\nconst bobToCarol = createDelegation({\n  to: carol,\n  from: bob,\n  environment,\n  scope: { type: 'erc20TransferAmount', tokenAddress, maxAmount: parseUnits('50', 6) },\n  parentDelegation: aliceToBob,\n  caveats: [{ type: 'timestamp', afterThreshold: now, beforeThreshold: expiry }],\n})\n\nTroubleshooting Quick Fixes\nIssue\tSolution\nAccount not deployed\tUse bundlerClient.sendUserOperation() to deploy\nInvalid signature\tVerify chain ID, delegation manager, signer permissions\nCaveat enforcer reverted\tCheck caveat parameters match execution, verify order\nRedemption failed\tCheck delegator balance, calldata validity, target contracts\nERC-7715 not working\tUpgrade to Flask 13.5.0+, ensure user has smart account\nPermission denied\tHandle gracefully, provide manual fallback\nThreshold not met\tAdd more signers for multisig\n7702 not working\tConfirm EOA upgraded via EIP-7702 first\nResources\nNPM: @metamask/smart-accounts-kit\nContracts: metamask/delegation-framework@v1.3.0\nERC Standards: ERC-4337, ERC-7710, ERC-7715, ERC-7579\nMetaMask Flask: https://metamask.io/flask\nVersion Info\nToolkit: 0.3.0\nDelegation Framework: 1.3.0\nBreaking Change: Function call scope defaults to no native token transfer\n\nFor detailed documentation, see the reference files in the /references directory."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/AyushBherwani1998/metamask-smart-accounts-kit",
    "publisherUrl": "https://clawhub.ai/AyushBherwani1998/metamask-smart-accounts-kit",
    "owner": "AyushBherwani1998",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/metamask-smart-accounts-kit",
    "downloadUrl": "https://openagent3.xyz/downloads/metamask-smart-accounts-kit",
    "agentUrl": "https://openagent3.xyz/skills/metamask-smart-accounts-kit/agent",
    "manifestUrl": "https://openagent3.xyz/skills/metamask-smart-accounts-kit/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/metamask-smart-accounts-kit/agent.md"
  }
}