Skip to content

Commit 030b812

Browse files
Update Advanced Permissions actions
Updates Advanced Permissions action to match the new ERC-7715 spec.
1 parent 9b6dff5 commit 030b812

5 files changed

Lines changed: 23 additions & 65 deletions

File tree

smart-accounts-kit/guides/advanced-permissions/create-redelegation.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,9 @@ const expiry = currentTime + 604800;
4848
const grantedPermissions = await walletClient.requestExecutionPermissions([{
4949
chainId: chain.id,
5050
expiry,
51-
signer: {
52-
type: "account",
53-
data: {
54-
// The requested permissions will be granted to the
55-
// session account.
56-
address: sessionAccount.address,
57-
},
58-
},
51+
// The requested permissions will granted to the
52+
// session account.
53+
to: sessionAccount.address,
5954
permission: {
6055
type: "erc20-token-periodic",
6156
data: {

smart-accounts-kit/guides/advanced-permissions/execute-on-metamask-users-behalf.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,9 @@ const tokenAddress = "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238";
163163
const grantedPermissions = await walletClient.requestExecutionPermissions([{
164164
chainId: chain.id,
165165
expiry,
166-
signer: {
167-
type: "account",
168-
data: {
169-
// The requested permissions will granted to the
170-
// session account.
171-
address: sessionAccount.address,
172-
},
173-
},
166+
// The requested permissions will granted to the
167+
// session account.
168+
to: sessionAccount.address,
174169
permission: {
175170
type: "erc20-token-periodic",
176171
data: {

smart-accounts-kit/guides/advanced-permissions/use-permissions/erc20-token.md

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,9 @@ const tokenAddress = "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238";
4545
const grantedPermissions = await walletClient.requestExecutionPermissions([{
4646
chainId: chain.id,
4747
expiry,
48-
signer: {
49-
type: "account",
50-
data: {
51-
// Session account created as a prerequisite.
52-
//
53-
// The requested permissions will granted to the
54-
// session account.
55-
address: sessionAccountAddress,
56-
},
57-
},
48+
// The requested permissions will granted to the
49+
// session account.
50+
to: sessionAccount.address,
5851
permission: {
5952
type: "erc20-token-periodic",
6053
data: {
@@ -115,16 +108,9 @@ const tokenAddress = "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238";
115108
const grantedPermissions = await walletClient.requestExecutionPermissions([{
116109
chainId: chain.id,
117110
expiry,
118-
signer: {
119-
type: "account",
120-
data: {
121-
// Session account created as a prerequisite.
122-
//
123-
// The requested permissions will granted to the
124-
// session account.
125-
address: sessionAccountAddress,
126-
},
127-
},
111+
// The requested permissions will granted to the
112+
// session account.
113+
to: sessionAccount.address,
128114
permission: {
129115
type: "erc20-token-stream",
130116
data: {

smart-accounts-kit/guides/advanced-permissions/use-permissions/native-token.md

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,9 @@ const expiry = currentTime + 604800;
4242
const grantedPermissions = await walletClient.requestExecutionPermissions([{
4343
chainId: chain.id,
4444
expiry,
45-
signer: {
46-
type: "account",
47-
data: {
48-
// Session account created as a prerequisite.
49-
//
50-
// The requested permissions will granted to the
51-
// session account.
52-
address: sessionAccountAddress,
53-
},
54-
},
45+
// The requested permissions will granted to the
46+
// session account.
47+
to: sessionAccount.address,
5548
permission: {
5649
type: "native-token-periodic",
5750
data: {
@@ -109,16 +102,9 @@ const expiry = currentTime + 604800;
109102
const grantedPermissions = await walletClient.requestExecutionPermissions([{
110103
chainId: chain.id,
111104
expiry,
112-
signer: {
113-
type: "account",
114-
data: {
115-
// Session account created as a prerequisite.
116-
//
117-
// The requested permissions will granted to the
118-
// session account.
119-
address: sessionAccountAddress,
120-
},
121-
},
105+
// The requested permissions will granted to the
106+
// session account.
107+
to: sessionAccount.address,
122108
permission: {
123109
type: "native-token-stream",
124110
data: {

smart-accounts-kit/reference/advanced-permissions/wallet-client.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ To use `requestExecutionPermissions`, the Viem Wallet Client must be extended wi
2525
| Name | Type | Required | Description |
2626
| ---- | ---- | -------- | ----------- |
2727
| `chainId` | `number` | Yes | The chain ID on which the permission is being requested. |
28-
| `address` | `Address` | No | Address of the wallet to which the permission is being requested. |
28+
| `from` | `Address` | No | Address of the wallet to which the permission is being requested. |
2929
| `expiry` | `number` | Yes | The timestamp (in seconds) by which the permission must expire. |
3030
| `permission` | `SupportedPermissionParams` | Yes | The permission to be requested. The toolkit supports multiple [Advanced Permissions types](permissions.md). |
31-
| `signer` | `SignerParam` | Yes | The account to which the permission will be assigned. |
31+
| `to` | `Address` | Yes | The account to which the permission will be assigned. |
3232
| `isAdjustmentAllowed` | `boolean` | Yes | Defines whether the user is allowed to modify the requested permission. |
3333

3434
### Example
@@ -47,13 +47,9 @@ const expiry = currentTime + 604800;
4747
const grantedPermissions = await walletClient.requestExecutionPermissions([{
4848
chainId: chain.id,
4949
expiry,
50-
signer: {
51-
type: "account",
52-
data: {
53-
// The requested permissions will granted to the address.
54-
address: "0x0955fFD7b83e5493a8c1FD5dC87e2CF37Eacc44a",
55-
},
56-
},
50+
// The requested permissions will granted to the
51+
// session account.
52+
to: sessionAccount.address,
5753
permission: {
5854
type: "erc20-token-periodic",
5955
data: {

0 commit comments

Comments
 (0)