Skip to content

Commit bef3ddc

Browse files
committed
Merge branch 'main' into add-copy-button
2 parents 0e0d6ac + 516abf8 commit bef3ddc

File tree

63 files changed

+671
-534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+671
-534
lines changed

delegation-toolkit/concepts/delegation/caveat-enforcers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ keywords: [caveats, caveat enforcers, delegation]
55

66
# Caveat enforcers
77

8-
The MetaMask Delegation Toolkit provides *caveat enforcers*, which are smart contracts that implement rules and restrictions (*caveats*) on delegations.
8+
The Smart Accounts Kit provides *caveat enforcers*, which are smart contracts that implement rules and restrictions (*caveats*) on delegations.
99
They serve as the underlying mechanism that enables conditional execution within the [Delegation Framework](./index.md#delegation-framework).
1010

1111
A caveat enforcer acts as a gate that validates whether a delegation can be used for a particular execution. When a delegate attempts to execute an action on behalf of a delegator, each caveat enforcer specified in the delegation evaluates whether the execution meets its defined criteria.
@@ -119,7 +119,7 @@ This "all-or-nothing" approach ensures that delegations only execute exactly as
119119

120120
## Caveat builder
121121

122-
While caveat enforcers operate at the smart contract level, most developers interact with them through the `CaveatBuilder` interface in the MetaMask Delegation Toolkit.
122+
While caveat enforcers operate at the smart contract level, most developers interact with them through the `CaveatBuilder` interface in the Smart Accounts Kit.
123123

124124
The `CaveatBuilder` provides a developer-friendly TypeScript API that:
125125

@@ -152,7 +152,7 @@ When designing delegations with caveats, consider these best practices:
152152

153153
## Available caveat enforcers
154154

155-
The Delegation Toolkit provides [out-of-the-box caveat enforcers](../../reference/delegation/caveats.md)
155+
The Smart Accounts Kit provides [out-of-the-box caveat enforcers](../../reference/delegation/caveats.md)
156156
for common restriction patterns, including:
157157

158158
- Limiting target addresses and methods.

delegation-toolkit/concepts/delegation/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Learn about delegation, the delegation lifecycle, and the Delegation Framework.
33
toc_max_heading_level: 2
4-
keywords: [delegation toolkit, delegation, delegator, delegate, delegation framework]
4+
keywords: [smart accounts kit, delegation, delegator, delegate, delegation framework]
55
---
66

77
import Tabs from "@theme/Tabs";
@@ -14,7 +14,7 @@ or externally owned account (EOA) to perform specific executions on its behalf.
1414
The account that grants the permission is called the *delegator account*, while the account that receives the permission
1515
is called the *delegate account*.
1616

17-
The MetaMask Delegation Toolkit follows the [ERC-7710](https://eips.ethereum.org/EIPS/eip-7710) standard for smart contract delegation.
17+
The Smart Accounts Kit follows the [ERC-7710](https://eips.ethereum.org/EIPS/eip-7710) standard for smart contract delegation.
1818
In addition, users can use [caveat enforcers](caveat-enforcers.md) to apply rules and restrictions to delegations.
1919
For example: Alice delegates the ability to spend her USDC to Bob, limiting the amount to 100 USDC.
2020

@@ -65,7 +65,7 @@ You can create the following delegation types:
6565

6666
## Delegation Framework
6767

68-
The MetaMask Delegation Toolkit includes the Delegation Framework, which is a
68+
The Smart Accounts Kit includes the Delegation Framework, which is a
6969
[set of comprehensively audited smart contracts](https://github.com/MetaMask/delegation-framework) that
7070
collectively handle delegator account creation, the delegation lifecycle,
7171
and caveat enforcement.
@@ -152,7 +152,7 @@ sequenceDiagram
152152
## Execution modes
153153

154154
When redeeming a delegation using [`redeemDelegations`](../../reference/delegation/index.md#redeemdelegations), you must pass an execution mode for each delegation chain you pass to the method.
155-
The Delegation Toolkit supports the following execution modes, based on [ERC-7579](https://erc7579.com/):
155+
The Smart Accounts Kit supports the following execution modes, based on [ERC-7579](https://erc7579.com/):
156156

157157
| Execution mode | Number of delegation chains passed to `redeemDelegations` | Processing method | Does user operation continue execution if redemption reverts? |
158158
|--|--|--|--|

delegation-toolkit/concepts/erc7715.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ keywords: [ERC-7715, 7715, permissions, wallet, smart account]
55

66
# ERC-7715 permissions
77

8-
The Delegation Toolkit supports [ERC-7715](https://eips.ethereum.org/EIPS/eip-7715), which lets you request fine-grained permissions from a MetaMask user to execute transactions on their behalf.
8+
The Smart Accounts Kit supports [ERC-7715](https://eips.ethereum.org/EIPS/eip-7715), which lets you request fine-grained permissions from a MetaMask user to execute transactions on their behalf.
99
For example, a user can grant your dapp permission to spend 10 USDC per day to buy ETH over the course of a month.
1010
Once the permission is granted, your dapp can use the allocated 10 USDC each day to purchase ETH directly from the MetaMask user's account.
1111

@@ -23,7 +23,7 @@ Dapps can use this method to request a wallet to grant the dapp permission to ex
2323
`wallet_grantPermissions` requires a `signer` parameter, which identifies the entity requesting or managing the permission.
2424
Common signer implementations include wallet signers, single key and multisig signers, and account signers.
2525

26-
The Delegation Toolkit supports multiple types of signers, but [an account signer is used in this documentation's examples](../guides/erc7715/execute-on-metamask-users-behalf.md) as a common implementation.
26+
The Smart Accounts Kit supports multiple types of signers, but [an account signer is used in this documentation's examples](../guides/erc7715/execute-on-metamask-users-behalf.md) as a common implementation.
2727
With an account signer, a session account is created and used for the single purpose of requesting and redeeming ERC-7715 permissions, and does not contain tokens.
2828
The session account can be granted with permissions and redeem them as specified in [ERC-7710](https://eips.ethereum.org/EIPS/eip-7710).
2929
The session account can be a smart account or an externally owned account (EOA).
@@ -56,7 +56,7 @@ The ERC-7715 permissions lifecycle is as follows:
5656
It can be a [smart account](smart-accounts.md) or an externally owned account (EOA).
5757

5858
2. **Request permissions** - Request permissions from the user.
59-
The Delegation Toolkit supports [ERC-20 token permissions](../guides/erc7715/use-permissions/erc20-token.md) and
59+
The Smart Accounts Kit supports [ERC-20 token permissions](../guides/erc7715/use-permissions/erc20-token.md) and
6060
[native token permissions](../guides/erc7715/use-permissions/native-token.md).
6161

6262
4. **Redeem permissions** - Once the permission is granted, the session account can redeem the permission, executing on the user's behalf.

delegation-toolkit/concepts/smart-accounts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ keywords: [MetaMask, smart accounts, account abstraction, ERC-4337]
55

66
# MetaMask Smart Accounts
77

8-
The MetaMask Delegation Toolkit enables you to create and manage MetaMask Smart Accounts.
8+
The Smart Accounts Kit enables you to create and manage *MetaMask Smart Accounts*.
99
MetaMask Smart Accounts are [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart contract accounts
1010
that support programmable account behavior and advanced features such as multi-signature approvals,
1111
automated transaction batching, and custom security policies.
@@ -37,7 +37,7 @@ ERC-4337 introduces the following concepts:
3737

3838
## Smart account implementation types
3939

40-
The MetaMask Delegation Toolkit supports three types of MetaMask Smart Accounts, each offering unique features and use cases.
40+
The toolkit supports three types of MetaMask Smart Accounts, each offering unique features and use cases.
4141

4242
See [Create a smart account](../guides/smart-accounts/create-smart-account.md) to learn how to use these different account types.
4343

delegation-toolkit/experimental/erc-7710-redeem-delegations.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This is an experimental feature and may change in future releases.
1414
[ERC-7710](https://eip.tools/eip/7710) introduces a standard way for MetaMask Smart Accounts to delegate capabilities to other
1515
smart accounts or externally owned accounts (EOAs).
1616

17-
The MetaMask Delegation Toolkit provides two experimental functions, `erc7710BundlerActions()` and `erc7710WalletActions()`, that let
17+
The MetaMask Smart Accounts Kit provides two experimental functions, `erc7710BundlerActions()` and `erc7710WalletActions()`, that let
1818
a caller redeem delegations granted by MetaMask's permissions system.
1919

2020
## Extract relevant data
@@ -128,8 +128,8 @@ import { createPublicClient, http, createBundlerClient } from "viem";
128128
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
129129
import { sepolia as chain } from "viem/chains";
130130
import { createBundlerClient } from "viem/account-abstraction";
131-
import { erc7710BundlerActions } from "@metamask/delegation-toolkit/experimental";
132-
import { toMetaMaskSmartAccount, Implementation } from "@metamask/delegation-toolkit";
131+
import { erc7710BundlerActions } from "@metamask/smart-accounts-kit/experimental";
132+
import { toMetaMaskSmartAccount, Implementation } from "@metamask/smart-accounts-kit";
133133

134134
export const publicClient = createPublicClient({
135135
chain: chain,
@@ -212,7 +212,7 @@ const hash = walletClient.sendTransactionWithDelegation({
212212
import { http, createPublicClient, createWalletClient } from "viem";
213213
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
214214
import { sepolia as chain } from "viem/chains";
215-
import { erc7710WalletActions } from "@metamask/delegation-toolkit/experimental";
215+
import { erc7710WalletActions } from "@metamask/smart-accounts-kit/experimental";
216216

217217
export const publicClient = createPublicClient({
218218
chain,

delegation-toolkit/experimental/erc-7715-request-permissions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ It requires MetaMask Flask 13.5.0 or later, and may change in future releases.
1515
[ERC-7715](https://eip.tools/eip/7715) introduces a standard way for dapps to request permissions from a wallet to execute
1616
transactions on a user's behalf.
1717

18-
The MetaMask Delegation Toolkit provides the experimental actions for ERC-7715 that lets a caller request permissions from MetaMask's permissions system.
18+
The MetaMask Smart Accounts Kit provides the experimental actions for ERC-7715 that lets a caller request permissions from MetaMask's permissions system.
1919

2020
## Request permissions
2121

@@ -63,8 +63,8 @@ const grantedPermissions = await walletClient.grantPermissions([{
6363
import { createWalletClient, custom, createPublicClient, http } from "viem";
6464
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
6565
import { sepolia as chain } from "viem/chains";
66-
import { erc7715ProviderActions } from "@metamask/delegation-toolkit/experimental";
67-
import { toMetaMaskSmartAccount, Implementation } from "@metamask/delegation-toolkit";
66+
import { erc7715ProviderActions } from "@metamask/smart-accounts-kit/experimental";
67+
import { toMetaMaskSmartAccount, Implementation } from "@metamask/smart-accounts-kit";
6868

6969
const publicClient = createPublicClient({
7070
chain: chain,

delegation-toolkit/experimental/store-retrieve-delegations.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Create the `DelegationStorageClient` instance, and configure it using your API k
2929
import {
3030
DelegationStorageClient,
3131
DelegationStorageEnvironment
32-
} from "@metamask/delegation-toolkit/experimental";
32+
} from "@metamask/smart-accounts-kit/experimental";
3333

3434
const delegationStorageClient = new DelegationStorageClient({
3535
apiKey: "<YOUR-API-KEY>",
@@ -62,7 +62,7 @@ const delegationHash = await delegationStorageClient.storeDelegation(delegation)
6262
import {
6363
DelegationStorageClient,
6464
DelegationStorageEnvironment
65-
} from "@metamask/delegation-toolkit/experimental";
65+
} from "@metamask/smart-accounts-kit/experimental";
6666

6767
export const delegationStorageClient = new DelegationStorageClient({
6868
apiKey: "<YOUR-API-KEY>",
@@ -90,7 +90,7 @@ A delegation can be a root delegation, where its `authority` is `0xfffffffffffff
9090

9191
```typescript
9292
import { delegationStorageClient } from "./config.ts";
93-
import { getDelegationHashOffchain } from "@metamask/delegation-toolkit";
93+
import { getDelegationHashOffchain } from "@metamask/smart-accounts-kit";
9494

9595
// Assuming you have the leaf delegation
9696
const delegationHash = getDelegationHashOffchain(leafDelegation);
@@ -107,7 +107,7 @@ const delegationChain: Delegation[] = await delegationStorageClient.getDelegatio
107107
import {
108108
DelegationStorageClient,
109109
DelegationStorageEnvironment
110-
} from "@metamask/delegation-toolkit/experimental";
110+
} from "@metamask/smart-accounts-kit/experimental";
111111

112112
export const delegationStorageClient = new DelegationStorageClient({
113113
apiKey: "<YOUR-API-KEY>",
@@ -158,7 +158,7 @@ const receivedDelegations = await delegationStore.fetchDelegations(
158158
import {
159159
DelegationStorageClient,
160160
DelegationStorageEnvironment
161-
} from "@metamask/delegation-toolkit/experimental";
161+
} from "@metamask/smart-accounts-kit/experimental";
162162

163163
export const delegationStorageClient = new DelegationStorageClient({
164164
apiKey: "<YOUR-API-KEY>",

delegation-toolkit/get-started/install.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
sidebar_label: Install and set up
3-
description: Learn how to install and set up the MetaMask Delegation Toolkit.
4-
keywords: [install, MetaMask, delegation, toolkit, smart, accounts]
3+
description: Learn how to install and set up the MetaMask Smart Accounts Kit.
4+
keywords: [install, MetaMask, delegation, smart accounts kit, smart, accounts]
55
---
66

77
import Tabs from "@theme/Tabs";
88
import TabItem from "@theme/TabItem";
99

10-
# Install and set up the Delegation Toolkit
10+
# Install and set up the Smart Accounts Kit
1111

12-
This page provides instructions to install and set up the MetaMask Delegation Toolkit, enabling you to integrate [MetaMask Smart Accounts](../concepts/smart-accounts.md) into your dapp.
12+
This page provides instructions to install and set up the Smart Accounts Kit, enabling you to create and interact with [MetaMask Smart Accounts](../concepts/smart-accounts.md) into your dapp.
1313

1414
## Prerequisites
1515

@@ -22,12 +22,12 @@ This page provides instructions to install and set up the MetaMask Delegation To
2222

2323
## Steps
2424

25-
### 1. Install the toolkit
25+
### 1. Install the Smart Accounts Kit
2626

27-
Install the [MetaMask Delegation Toolkit](https://www.npmjs.com/package/@metamask/delegation-toolkit):
27+
Install the [Smart Accounts Kit](https://www.npmjs.com/package/@metamask/smart-accounts-kit):
2828

2929
```bash npm2yarn
30-
npm install @metamask/delegation-toolkit
30+
npm install @metamask/smart-accounts-kit
3131
```
3232

3333
### 2. (Optional) Install the contracts
@@ -44,5 +44,5 @@ Add `@metamask/delegation-framework/=lib/metamask/delegation-framework/` in your
4444

4545
### 3. Get started
4646

47-
You're now ready to start using the Delegation Toolkit.
47+
You're now ready to start using the Smart Accounts Kit.
4848
See the [MetaMask Smart Accounts quickstart](smart-account-quickstart/index.md) to walk through a simple example.

delegation-toolkit/get-started/smart-account-quickstart/eip7702.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ abstraction, such as batch transactions, gas sponsorship, and [delegation capabi
1919

2020
## Steps
2121

22-
### 1. Install the toolkit
22+
### 1. Install the Smart Accounts Kit
2323

24-
Install the [MetaMask Delegation Toolkit](https://www.npmjs.com/package/@metamask/delegation-toolkit):
24+
Install the [Smart Accounts Kit](https://www.npmjs.com/package/@metamask/smart-accounts-kit):
2525

2626
```bash npm2yarn
27-
npm install @metamask/delegation-toolkit
27+
npm install @metamask/smart-accounts-kit
2828
```
2929

3030
### 2. Set up a Public Client
@@ -89,11 +89,11 @@ provides a lightweight and secure way to upgrade an EOA to a smart account.
8989
import {
9090
Implementation,
9191
toMetaMaskSmartAccount,
92-
getDeleGatorEnvironment,
93-
} from "@metamask/delegation-toolkit";
92+
getSmartAccountsEnvironment,
93+
} from "@metamask/smart-accounts-kit";
9494
import { privateKeyToAccount } from "viem/accounts";
9595

96-
const environment = getDeleGatorEnvironment(sepolia.id);
96+
const environment = getSmartAccountsEnvironment(sepolia.id);
9797
const contractAddress = environment.implementations.EIP7702StatelessDeleGatorImpl;
9898

9999
const authorization = await walletClient.signAuthorization({
@@ -127,7 +127,7 @@ leveraging the benefits of account abstraction.
127127
import {
128128
Implementation,
129129
toMetaMaskSmartAccount,
130-
} from "@metamask/delegation-toolkit";
130+
} from "@metamask/smart-accounts-kit";
131131

132132
const addresses = await walletClient.getAddresses();
133133
const address = addresses[0];

delegation-toolkit/get-started/smart-account-quickstart/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ You can get started quickly with [MetaMask Smart Accounts](../../concepts/smart-
1616

1717
## Steps
1818

19-
### 1. Install the toolkit
19+
### 1. Install the Smart Accounts Kit
2020

21-
Install the [MetaMask Delegation Toolkit](https://www.npmjs.com/package/@metamask/delegation-toolkit):
21+
Install the [Smart Accounts Kit](https://www.npmjs.com/package/@metamask/smart-accounts-kit):
2222

2323
```bash npm2yarn
24-
npm install @metamask/delegation-toolkit
24+
npm install @metamask/smart-accounts-kit
2525
```
2626

2727
### 2. Set up a Public Client
@@ -59,7 +59,7 @@ This example configures a Hybrid smart account,
5959
which is a flexible smart account implementation that supports both an externally owned account (EOA) owner and any number of passkey (WebAuthn) signers:
6060

6161
```typescript
62-
import { Implementation, toMetaMaskSmartAccount } from "@metamask/delegation-toolkit";
62+
import { Implementation, toMetaMaskSmartAccount } from "@metamask/smart-accounts-kit";
6363
import { privateKeyToAccount } from "viem/accounts";
6464

6565
const account = privateKeyToAccount("0x...");

0 commit comments

Comments
 (0)