Skip to content

Commit ce0e3e0

Browse files
Merge branch 'main' into feat/update-auto-redeem-shared-composer
2 parents 82b35a4 + 46ad99f commit ce0e3e0

File tree

1 file changed

+14
-28
lines changed

1 file changed

+14
-28
lines changed

docs/fxrp/token-interactions/03-x402-payments.mdx

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,34 +42,20 @@ The x402 implementation consists of four components:
4242

4343
## EIP-3009 Payment Flow
4444

45-
```
46-
┌─────────┐ 1. Request Resource ┌─────────────┐
47-
│ Agent │ ─────────────────────────────▶│ Server │
48-
│ │ ◀───────────────────────────── │ │
49-
│ │ 2. 402 + Payment Req │ │
50-
│ │ │ │
51-
│ │ 3. Sign EIP-712 Auth │ │
52-
│ │ (off-chain signature) │ │
53-
│ │ │ │
54-
│ │ 4. Request + X-Payment │ │
55-
│ │ ─────────────────────────────▶│ │
56-
│ │ ┌───────────┴─────────────┤
57-
│ │ 5. settlePayment() │
58-
│ │ │ │
59-
│ │ ▼ │
60-
│ │ ┌─────────────┐ │
61-
│ │ │ Facilitator │ │
62-
│ │ └──────┬──────┘ │
63-
│ │ │ │
64-
│ │ 6. transferWithAuthorization │
65-
│ │ │ │
66-
│ │ ▼ │
67-
│ │ ┌─────────────┐ │
68-
│ │ │ MockUSDT0 │ │
69-
│ │ └─────────────┘ │
70-
│ │ │ │
71-
│ │ ◀───────────────────────────── │ │
72-
└─────────┘ 7. 200 OK + Resource └─────────────┘
45+
```mermaid
46+
sequenceDiagram
47+
participant Agent
48+
participant Server
49+
participant Facilitator
50+
participant MockUSDT0
51+
52+
Agent->>Server: 1. Request Resource
53+
Server-->>Agent: 2. 402 + Payment Req
54+
Agent->>Agent: 3. Sign EIP-712 Auth<br/>(off-chain signature)
55+
Agent->>Server: 4. Request + X-Payment header
56+
Server->>Facilitator: 5. settlePayment()
57+
Facilitator->>MockUSDT0: 6. transferWithAuthorization()
58+
Server-->>Agent: 7. 200 OK + Resource
7359
```
7460

7561
The flow works as follows:

0 commit comments

Comments
 (0)