Skip to content

Commit 80c8656

Browse files
release docs for Smart Accounts Kit v0.3.0
1 parent 563e74d commit 80c8656

Some content is hidden

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

54 files changed

+8907
-5
lines changed

docusaurus.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const config = {
216216
sidebarCollapsed: false,
217217
includeCurrentVersion: true,
218218
// Set to the latest release.
219-
lastVersion: '0.2.0',
219+
lastVersion: '0.3.0',
220220
versions: {
221221
// Defaults to the ./docs folder.
222222
// Using "development" instead of "next" as path.
@@ -225,8 +225,8 @@ const config = {
225225
path: 'development',
226226
},
227227
// The latest release.
228-
'0.2.0': {
229-
label: 'latest (0.2.0)',
228+
'0.3.0': {
229+
label: 'latest (0.3.0)',
230230
},
231231
},
232232
},
87.3 KB
Loading
792 KB
Loading
864 KB
Loading
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
sidebar_label: 0.1.0
3+
description: MetaMask Smart Accounts Kit v0.1.0 changelog
4+
---
5+
6+
# What's new in v0.1.0?
7+
8+
:::warning Breaking changes
9+
10+
The ⚠️ symbol denotes potentially breaking API changes. As per the [semantic versioning specification](https://semver.org/#spec-item-4), from v1.0.0 onward, breaking changes will be released only in major version bumps.
11+
12+
:::
13+
14+
### ⚠️ Package name
15+
16+
- Updates the package name from `@metamask/delegation-toolkit` to `@metamask/smart-accounts-kit`. This change does not impact the entrypoints.
17+
18+
```typescript
19+
// remove-next-line
20+
- import { } from '@metamask/delegation-toolkit'
21+
// add-next-line
22+
+ import { } from '@metamask/smart-accounts-kit'
23+
24+
// Contracts entrypoint
25+
// remove-next-line
26+
- import { } from '@metamask/delegation-toolkit/contracts'
27+
// add-next-line
28+
+ import { } from '@metamask/smart-accounts-kit/contracts'
29+
30+
// Utils entrypoint
31+
// remove-next-line
32+
- import { } from '@metamask/delegation-toolkit/utils'
33+
// add-next-line
34+
+ import { } from '@metamask/smart-accounts-kit/utils'
35+
36+
// Actions entrypoint
37+
// remove-next-line
38+
- import { } from '@metamask/delegation-toolkit/actions'
39+
// add-next-line
40+
+ import { } from '@metamask/smart-accounts-kit/actions'
41+
```
42+
43+
### ⚠️ Advanced Permissions actions
44+
45+
- Advanced Permissions related actions have been moved out of the `/experimental` to `/actions` entrypoint.
46+
47+
```typescript
48+
// remove-next-line
49+
- import { erc7715ProviderActions } from '@metamask/delegation-toolkit/experimental'
50+
// add-next-line
51+
+ import { erc7715ProviderActions } from '@metamask/smart-accounts-kit/actions'
52+
```
53+
54+
### ⚠️ Toolkit environment
55+
56+
- Renames the `DeleGatorEnvironment` type to `SmartAccountsEnvironment`.
57+
- Renames the `getDeleGatorEnvironment` function to `getSmartAccountsEnvironment`.
58+
59+
```typescript
60+
// remove-next-line
61+
- import { getDeleGatorEnvironment, DeleGatorEnvironment } from '@metamask/delegation-toolkit'
62+
// add-next-line
63+
+ import { getSmartAccountsEnvironment, SmartAccountsEnvironment } from '@metamask/smart-accounts-kit'
64+
```
65+
66+
## Contract addresses
67+
68+
The following are the contract addresses for the
69+
[Delegation Framework version 1.3.0](https://github.com/MetaMask/delegation-framework/blob/v1.3.0/documents/Deployments.md),
70+
as used by this version of the toolkit.
71+
72+
### Delegation Framework
73+
74+
| Contract | Address |
75+
|----------|---------|
76+
| EntryPoint | `0x0000000071727De22E5E9d8BAf0edAc6f37da032` |
77+
| SimpleFactory | `0x69Aa2f9fe1572F1B640E1bbc512f5c3a734fc77c` |
78+
| DelegationManager | `0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3` |
79+
| MultiSigDeleGatorImpl | `0x56a9EdB16a0105eb5a4C54f4C062e2868844f3A7` |
80+
| HybridDeleGatorImpl | `0x48dBe696A4D990079e039489bA2053B36E8FFEC4` |
81+
82+
### Caveat enforcers
83+
84+
| Enforcer | Address |
85+
|----------|---------|
86+
| AllowedCalldataEnforcer | `0xc2b0d624c1c4319760C96503BA27C347F3260f55` |
87+
| AllowedMethodsEnforcer | `0x2c21fD0Cb9DC8445CB3fb0DC5E7Bb0Aca01842B5` |
88+
| AllowedTargetsEnforcer | `0x7F20f61b1f09b08D970938F6fa563634d65c4EeB` |
89+
| ArgsEqualityCheckEnforcer | `0x44B8C6ae3C304213c3e298495e12497Ed3E56E41` |
90+
| BlockNumberEnforcer | `0x5d9818dF0AE3f66e9c3D0c5029DAF99d1823ca6c` |
91+
| DeployedEnforcer | `0x24ff2AA430D53a8CD6788018E902E098083dcCd2` |
92+
| ERC20BalanceChangeEnforcer | `0xcdF6aB796408598Cea671d79506d7D48E97a5437` |
93+
| ERC20TransferAmountEnforcer | `0xf100b0819427117EcF76Ed94B358B1A5b5C6D2Fc` |
94+
| ERC20PeriodTransferEnforcer| `0x474e3Ae7E169e940607cC624Da8A15Eb120139aB` |
95+
| ERC20StreamingEnforcer | `0x56c97aE02f233B29fa03502Ecc0457266d9be00e` |
96+
| ERC721BalanceChangeEnforcer | `0x8aFdf96eDBbe7e1eD3f5Cd89C7E084841e12A09e` |
97+
| ERC721TransferEnforcer | `0x3790e6B7233f779b09DA74C72b6e94813925b9aF` |
98+
| ERC1155BalanceChangeEnforcer | `0x63c322732695cAFbbD488Fc6937A0A7B66fC001A` |
99+
| ExactCalldataBatchEnforcer | `0x982FD5C86BBF425d7d1451f974192d4525113DfD` |
100+
| ExactCalldataEnforcer | `0x99F2e9bF15ce5eC84685604836F71aB835DBBdED` |
101+
| ExactExecutionBatchEnforcer | `0x1e141e455d08721Dd5BCDA1BaA6Ea5633Afd5017` |
102+
| ExactExecutionEnforcer | `0x146713078D39eCC1F5338309c28405ccf85Abfbb` |
103+
| IdEnforcer | `0xC8B5D93463c893401094cc70e66A206fb5987997` |
104+
| LimitedCallsEnforcer | `0x04658B29F6b82ed55274221a06Fc97D318E25416` |
105+
| MultiTokenPeriodEnforcer | `0xFB2f1a9BD76d3701B730E5d69C3219D42D80eBb7` |
106+
| NonceEnforcer | `0xDE4f2FAC4B3D87A1d9953Ca5FC09FCa7F366254f` |
107+
| NativeBalanceChangeEnforcer | `0xbD7B277507723490Cd50b12EaaFe87C616be6880` |
108+
| NativeTokenPaymentEnforcer | `0x4803a326ddED6dDBc60e659e5ed12d85c7582811` |
109+
| NativeTokenTransferAmountEnforcer | `0xF71af580b9c3078fbc2BBF16FbB8EEd82b330320` |
110+
| NativeTokenStreamingEnforcer | `0xD10b97905a320b13a0608f7E9cC506b56747df19` |
111+
| NativeTokenPeriodTransferEnforcer | `0x9BC0FAf4Aca5AE429F4c06aEEaC517520CB16BD9` |
112+
| OwnershipTransferEnforcer | `0x7EEf9734E7092032B5C56310Eb9BbD1f4A524681` |
113+
| RedeemerEnforcer | `0xE144b0b2618071B4E56f746313528a669c7E65c5` |
114+
| SpecificActionERC20TransferBatchEnforcer | `0x00e0251aaA263dfE3B3541B758A82D1CBA1c3B6D` |
115+
| TimestampEnforcer | `0x1046bb45C8d673d4ea75321280DB34899413c069` |
116+
| ValueLteEnforcer | `0x92Bf12322527cAA612fd31a0e810472BBB106A8F` |
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
---
2+
sidebar_label: Delegation Toolkit (0.13.0)
3+
description: MetaMask Delegation Toolkit v0.13.0 changelog
4+
---
5+
6+
# What's new in v0.13.0?
7+
8+
:::warning Breaking changes
9+
10+
The ⚠️ symbol denotes potentially breaking API changes. As per the [semantic versioning specification](https://semver.org/#spec-item-4), from v1.0.0 onward, breaking changes will be released only in major version bumps.
11+
12+
:::
13+
14+
## Breaking changes
15+
16+
### ⚠️ `createDelegation`
17+
18+
- The function now accepts the following mandatory parameters:
19+
- `scope`: The scope of the delegation that defines the initial authority. See [how to use delegation scope](../guides/delegation/use-delegation-scopes/index.md).
20+
- `environment`: The environment used by the toolkit to define contract addresses for interacting with the Delegation Framework contracts.
21+
- The `caveats` parameter is now optional (previously mandatory) and is used to constrain the initial authority
22+
configured via the `scope`.
23+
- You no longer need to use `CaveatBuilder` to create caveats, you can now use a declarative format to define them.
24+
25+
```typescript
26+
import { createDelegation, getDelegatorEnvironment } from "@metamask/delegation-toolkit";
27+
import { sepolia } from "viem/chains";
28+
29+
const environment = getDelegatorEnvironment(sepolia.id);
30+
31+
// remove-start
32+
- const caveatBuilder = createCaveatBuilder(environment);
33+
- const caveats = caveatBuilder.addCaveat("limitedCalls", 1);
34+
// remove-end
35+
36+
// add-start
37+
+ const caveats = [{
38+
+ type: "limitedCalls",
39+
+ limit: 1,
40+
+ }]
41+
// add-end
42+
43+
const delegation = createDelegation({
44+
// add-start
45+
+ scope: {
46+
+ type: "nativeTokenTransferAmount",
47+
+ maxAmount: 1000000000000000n,
48+
+ }
49+
// add-end
50+
to: "DELEGATE_ADDRESS",
51+
from: "DELEGATOR_ADDRESS",
52+
// add-next-line
53+
+ environment,
54+
caveats,
55+
})
56+
```
57+
58+
### ⚠️ `createOpenDelegation`
59+
60+
- The function now accepts the following mandatory parameters:
61+
- `scope`: The scope of the delegation that defines the initial authority. See [how to use delegation scope](../guides/delegation/use-delegation-scopes/index.md).
62+
- `environment`: The environment used by the toolkit to define contract addresses for interacting with the Delegation Framework contracts.
63+
- The `caveats` parameter is now optional (previously mandatory) and is used to constrain the initial authority
64+
configured via the `scope`.
65+
- You no longer need to use `CaveatBuilder` to create caveats, you can now use a declarative format to define them.
66+
67+
```typescript
68+
import { createOpenDelegation, getDelegatorEnvironment } from "@metamask/delegation-toolkit";
69+
import { sepolia } from "viem/chains";
70+
71+
const environment = getDelegatorEnvironment(sepolia.id);
72+
73+
// remove-start
74+
- const caveatBuilder = createCaveatBuilder(environment);
75+
- const caveats = caveatBuilder.addCaveat("limitedCalls", 1);
76+
// remove-end
77+
78+
// add-start
79+
+ const caveats = [{
80+
+ type: "limitedCalls",
81+
+ limit: 1,
82+
+ }]
83+
// add-end
84+
85+
const delegation = createOpenDelegation({
86+
// add-start
87+
+ scope: {
88+
+ type: "nativeTokenTransferAmount",
89+
+ maxAmount: 1000000000000000n,
90+
+ }
91+
// add-end
92+
from: "DELEGATOR_ADDRESS",
93+
// add-next-line
94+
+ environment,
95+
caveats,
96+
})
97+
```
98+
99+
### ⚠️ `toMetaMaskSmartAccount`
100+
101+
The `signatory` parameter has been renamed to `signer` for more clarity when creating `MetaMaskSmartAccount` instances.
102+
103+
```typescript
104+
const smartAccount = await toMetaMaskSmartAccount({
105+
client: publicClient,
106+
implementation: Implementation.Hybrid,
107+
deployParams: [account.address, [], [], []],
108+
deploySalt: "0x",
109+
// remove-next-line
110+
- signatory: { account: account },
111+
// add-next-line
112+
+ signer: { account: account },
113+
});
114+
```
115+
116+
### ⚠️ `createCaveatBuilder`
117+
118+
The function has been moved from root to the utils export.
119+
120+
```typescript
121+
// remove-next-line
122+
- import { createCaveatBuilder } from "@metamask/delegation-toolkit";
123+
// add-next-line
124+
+ import { createCaveatBuilder } from "@metamask/delegation-toolkit/utils";
125+
```
126+
127+
### ⚠️ Execution modes
128+
129+
Individual constants like `SINGLE_DEFAULT_MODE` have been replaced with the `ExecutionMode` enum.
130+
131+
```typescript
132+
import { DelegationManager } from "@metamask/delegation-toolkit/contracts";
133+
// add-next-line
134+
+ import { ExecutionMode } from "@metamask/delegation-toolkit";
135+
136+
const data = DelegationManager.encode.redeemDelegations({
137+
delegations: [[delegation]],
138+
// remove-next-line
139+
- modes: [SINGLE_DEFAULT_MODE],
140+
// add-next-line
141+
+ modes: [ExecutionMode.SingleDefault],
142+
executions: [[execution]],
143+
});
144+
```
145+
146+
## Enhancements
147+
148+
- New `CaveatEnforcerClient` has been added to check the delegation state. See [how to check delegation state](../guides/delegation/check-delegation-state.md) to retrieve remaining balance for spend limit caveat enforcers.
149+
150+
## Contract addresses
151+
152+
The following are the contract addresses for the
153+
[Delegation Framework version 1.3.0](https://github.com/MetaMask/delegation-framework/blob/v1.3.0/documents/Deployments.md),
154+
as used by this version of the toolkit.
155+
156+
### Delegation Framework
157+
158+
| Contract | Address |
159+
|----------|---------|
160+
| EntryPoint | `0x0000000071727De22E5E9d8BAf0edAc6f37da032` |
161+
| SimpleFactory | `0x69Aa2f9fe1572F1B640E1bbc512f5c3a734fc77c` |
162+
| DelegationManager | `0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3` |
163+
| MultiSigDeleGatorImpl | `0x56a9EdB16a0105eb5a4C54f4C062e2868844f3A7` |
164+
| HybridDeleGatorImpl | `0x48dBe696A4D990079e039489bA2053B36E8FFEC4` |
165+
166+
### Caveat enforcers
167+
168+
| Enforcer | Address |
169+
|----------|---------|
170+
| AllowedCalldataEnforcer | `0xc2b0d624c1c4319760C96503BA27C347F3260f55` |
171+
| AllowedMethodsEnforcer | `0x2c21fD0Cb9DC8445CB3fb0DC5E7Bb0Aca01842B5` |
172+
| AllowedTargetsEnforcer | `0x7F20f61b1f09b08D970938F6fa563634d65c4EeB` |
173+
| ArgsEqualityCheckEnforcer | `0x44B8C6ae3C304213c3e298495e12497Ed3E56E41` |
174+
| BlockNumberEnforcer | `0x5d9818dF0AE3f66e9c3D0c5029DAF99d1823ca6c` |
175+
| DeployedEnforcer | `0x24ff2AA430D53a8CD6788018E902E098083dcCd2` |
176+
| ERC20BalanceChangeEnforcer | `0xcdF6aB796408598Cea671d79506d7D48E97a5437` |
177+
| ERC20TransferAmountEnforcer | `0xf100b0819427117EcF76Ed94B358B1A5b5C6D2Fc` |
178+
| ERC20PeriodTransferEnforcer| `0x474e3Ae7E169e940607cC624Da8A15Eb120139aB` |
179+
| ERC20StreamingEnforcer | `0x56c97aE02f233B29fa03502Ecc0457266d9be00e` |
180+
| ERC721BalanceChangeEnforcer | `0x8aFdf96eDBbe7e1eD3f5Cd89C7E084841e12A09e` |
181+
| ERC721TransferEnforcer | `0x3790e6B7233f779b09DA74C72b6e94813925b9aF` |
182+
| ERC1155BalanceChangeEnforcer | `0x63c322732695cAFbbD488Fc6937A0A7B66fC001A` |
183+
| ExactCalldataBatchEnforcer | `0x982FD5C86BBF425d7d1451f974192d4525113DfD` |
184+
| ExactCalldataEnforcer | `0x99F2e9bF15ce5eC84685604836F71aB835DBBdED` |
185+
| ExactExecutionBatchEnforcer | `0x1e141e455d08721Dd5BCDA1BaA6Ea5633Afd5017` |
186+
| ExactExecutionEnforcer | `0x146713078D39eCC1F5338309c28405ccf85Abfbb` |
187+
| IdEnforcer | `0xC8B5D93463c893401094cc70e66A206fb5987997` |
188+
| LimitedCallsEnforcer | `0x04658B29F6b82ed55274221a06Fc97D318E25416` |
189+
| MultiTokenPeriodEnforcer | `0xFB2f1a9BD76d3701B730E5d69C3219D42D80eBb7` |
190+
| NonceEnforcer | `0xDE4f2FAC4B3D87A1d9953Ca5FC09FCa7F366254f` |
191+
| NativeBalanceChangeEnforcer | `0xbD7B277507723490Cd50b12EaaFe87C616be6880` |
192+
| NativeTokenPaymentEnforcer | `0x4803a326ddED6dDBc60e659e5ed12d85c7582811` |
193+
| NativeTokenTransferAmountEnforcer | `0xF71af580b9c3078fbc2BBF16FbB8EEd82b330320` |
194+
| NativeTokenStreamingEnforcer | `0xD10b97905a320b13a0608f7E9cC506b56747df19` |
195+
| NativeTokenPeriodTransferEnforcer | `0x9BC0FAf4Aca5AE429F4c06aEEaC517520CB16BD9` |
196+
| OwnershipTransferEnforcer | `0x7EEf9734E7092032B5C56310Eb9BbD1f4A524681` |
197+
| RedeemerEnforcer | `0xE144b0b2618071B4E56f746313528a669c7E65c5` |
198+
| SpecificActionERC20TransferBatchEnforcer | `0x00e0251aaA263dfE3B3541B758A82D1CBA1c3B6D` |
199+
| TimestampEnforcer | `0x1046bb45C8d673d4ea75321280DB34899413c069` |
200+
| ValueLteEnforcer | `0x92Bf12322527cAA612fd31a0e810472BBB106A8F` |

0 commit comments

Comments
 (0)