Skip to content

Commit 9915b95

Browse files
resolve review comments
1 parent fdbf318 commit 9915b95

3 files changed

Lines changed: 14 additions & 20 deletions

File tree

smart-accounts-kit/guides/x402/buyer/advanced-permissions.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Access an x402-protected API data using Advanced Permissions with a fixed allowance.
2+
description: Pay for an x402-protected API data using Advanced Permissions with a fixed allowance.
33
sidebar_label: Advanced Permissions
44
keywords:
55
[x402, ERC-7715, ERC-7710, advanced permissions, redeemers, allowance, session account, buyer]
@@ -22,11 +22,9 @@ to pay for a specific x402-protected resource.
2222

2323
### 1. Set up a Wallet Client
2424

25-
Set up a Wallet Client using Viem's [`createWalletClient`](https://viem.sh/docs/clients/wallet) function. This client will
26-
help you interact with MetaMask.
25+
Set up a Wallet Client using Viem's [`createWalletClient`](https://viem.sh/docs/clients/wallet) function. Use this client to interact with MetaMask.
2726

28-
Then, extend the Wallet Client functionality using `erc7715ProviderActions`.
29-
These actions enable you to request <GlossaryTerm term="Advanced Permissions" /> from the user.
27+
Extend the Wallet Client with `erc7715ProviderActions` to enable <GlossaryTerm term="Advanced Permissions" /> requests.
3028

3129
```typescript
3230
import { createWalletClient, custom } from 'viem'
@@ -41,7 +39,8 @@ const walletClient = createWalletClient({
4139

4240
Set up a session account. The requested permissions are granted to the session account, which is responsible for making x402 API calls.
4341

44-
The session account can be either a smart account or an EOA. This examples uses EOA as a session account.
42+
The session account can be either a <GlossaryTerm term="MetaMask smart account">smart account</GlossaryTerm> or an <GlossaryTerm term="Externally owned account (EOA)">EOA</GlossaryTerm>.
43+
This example uses an EOA as the session account.
4544

4645
```typescript
4746
import { privateKeyToAccount } from 'viem/accounts'

smart-accounts-kit/guides/x402/buyer/delegations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Access x402-protected API data using delegation.
2+
description: Pay for an x402-protected API data using delegation.
33
sidebar_label: Delegations
44
keywords: [x402, ERC-7710, delegation, smart account, facilitator, buyer, API]
55
---

smart-accounts-kit/guides/x402/buyer/recurring-payments.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ In this guide, you set up recurring x402 payments by requesting an ERC-20 period
2424
<GlossaryTerm term="Advanced Permissions" /> permission from a user.
2525

2626
For example, a user gives your agent permission to spend up to 10 USDC per week.
27-
Later, when the agent needs access to an x402 endpoint, it checks the price, uses the permission the user
28-
already gave it, and pays.
27+
Later, when the agent calls an x402 endpoint, it checks the price, uses the granted permission, and pays.
2928

3029
## Prerequisites
3130

@@ -35,11 +34,9 @@ already gave it, and pays.
3534

3635
### 1. Set up a Wallet Client
3736

38-
Set up a Wallet Client using Viem's [`createWalletClient`](https://viem.sh/docs/clients/wallet) function.
39-
This client will help you interact with MetaMask.
37+
Set up a Wallet Client using Viem's [`createWalletClient`](https://viem.sh/docs/clients/wallet) function. Use this client to interact with MetaMask.
4038

41-
Then, extend the Wallet Client functionality using `erc7715ProviderActions`.
42-
These actions enable you to request <GlossaryTerm term="Advanced Permissions" /> from the user.
39+
Extend the Wallet Client with `erc7715ProviderActions` to enable <GlossaryTerm term="Advanced Permissions" /> requests.
4340

4441
```typescript
4542
import { createWalletClient, custom } from 'viem'
@@ -52,10 +49,8 @@ const walletClient = createWalletClient({
5249

5350
### 2. Set up an agent account
5451

55-
Set up an agent account. The requested permissions are granted to this account, which allows the agent
56-
to make x402 API calls on behalf of the user.
57-
58-
The agent account can be either a smart account or an EOA. This example uses an EOA as an agent account.
52+
The session account can be either a <GlossaryTerm term="MetaMask smart account">smart account</GlossaryTerm> or an <GlossaryTerm term="Externally owned account (EOA)">EOA</GlossaryTerm>.
53+
This example uses an EOA as the session account.
5954

6055
```typescript
6156
import { privateKeyToAccount } from 'viem/accounts'
@@ -105,8 +100,8 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([
105100

106101
### 4. Get payment requirements
107102

108-
Once your agent has been granted permission, when it wants to access an x402-protected endpoint, it
109-
calls the endpoint without a payment header to request payment terms.
103+
Call the x402-protected endpoint without a payment header to request payment terms
104+
after your agent has been granted permission.
110105

111106
The server returns `402` with the payment terms (`PAYMENT-REQUIRED`) in the response, which agent can use to
112107
build the payment payload.
@@ -222,7 +217,7 @@ export const sessionAccountWalletClient = createWalletClient({
222217
</TabItem>
223218
</Tabs>
224219

225-
### 6. Make the payment payload
220+
### 6. Create the payment payload
226221

227222
For each protected API call, create a payment payload with the redelegated permission context.
228223

0 commit comments

Comments
 (0)