Skip to content

Commit 99941ac

Browse files
committed
Moving CAIP-25 section to wallet_getCapabilities
1 parent 8ef54b8 commit 99941ac

File tree

5 files changed

+509
-509
lines changed

5 files changed

+509
-509
lines changed

walletkit/android/eip5792.mdx

Lines changed: 105 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,107 @@ Applications can specify that these onchain calls be executed taking advantage o
1414

1515
<AccordionGroup>
1616
<Accordion title="wallet_getCapabilities" defaultOpen>
17+
## Capabilities in CAIP-25 Connection Requests
18+
19+
CAIP-25 defines how capabilities can be expressed in wallet-to-dapp connections. These capabilities control how methods like `wallet_sendCalls` behave.
20+
21+
### Session Properties
22+
23+
In a connection request, dApps can request capabilities through `sessionProperties`. These capabilities can be universal (applying to all chains) or chain-specific:
24+
25+
```json
26+
"sessionProperties": {
27+
"expiry": "2022-12-24T17:07:31+00:00",
28+
"caip154": {
29+
"supported": "true"
30+
},
31+
"flow-control": {
32+
"loose": [],
33+
"strict": [],
34+
"exoticThirdThing": []
35+
},
36+
"atomic": {
37+
"status": "supported"
38+
}
39+
}
40+
```
41+
42+
### Scoped Properties
43+
44+
For chain-specific capabilities, dapps use `scopedProperties`:
45+
46+
```json
47+
"scopedProperties": {
48+
"eip155:8453": {
49+
"paymasterService": {
50+
"supported": true
51+
},
52+
"sessionKeys": {
53+
"supported": true
54+
}
55+
},
56+
"eip155:84532": {
57+
"auxiliaryFunds": {
58+
"supported": true
59+
}
60+
}
61+
}
62+
```
63+
64+
### Wallet Response
65+
66+
The wallet's response should specify the capabilities it supports, in accordance with EIP-5792 and CAIP-25:
67+
68+
```json
69+
"sessionProperties": {
70+
"expiry": "2022-12-24T17:07:31+00:00",
71+
"caip154": {
72+
"supported": "true"
73+
},
74+
"flow-control": {
75+
"loose": ["halt", "continue"],
76+
"strict": ["continue"]
77+
},
78+
"atomic": {
79+
"status": "ready"
80+
}
81+
},
82+
"scopedProperties": {
83+
"eip155:1": {
84+
"atomic": {
85+
"status": "supported"
86+
}
87+
},
88+
"eip155:137": {
89+
"atomic": {
90+
"status": "unsupported"
91+
}
92+
},
93+
"eip155:84532": {
94+
"eip155:83532:0x0910e12C68d02B561a34569E1367c9AAb42bd810": {
95+
"auxiliaryFunds": {
96+
"supported": false
97+
},
98+
"atomic": {
99+
"status": "supported"
100+
}
101+
}
102+
}
103+
}
104+
```
105+
- Capabilities shared across all address in a namespace can be expressed at top-level
106+
- Address-specific capabilities can include exceptions to scope-wide capabilities
107+
108+
### Atomic Capability
109+
110+
According to [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792), the `atomic` capability specifies how the wallet handles batches of transactions. It has three possible values:
111+
112+
- `supported` — The wallet executes calls atomically and contiguously.
113+
- `ready` — The wallet can upgrade to support atomic execution, pending user approval.
114+
- `unsupported` — The wallet provides no atomicity guarantees.
115+
116+
This capability is expressed per chain and is crucial for determining how `wallet_sendCalls` with `atomicRequired: true` will be handled.
117+
17118
### Example
18119
The `wallet_getCapabilities` method is used to request information about what capabilities a wallet supports. Following EIP-5792, here's how it should be implemented:
19120

@@ -30,10 +131,6 @@ Applications can specify that these onchain calls be executed taking advantage o
30131
#### Response
31132
The wallet should return a response following EIP-5792, where capabilities are organized by chain ID:
32133

33-
<Note>
34-
For non-atomic execution, include all transactions in the receipts array, even those that were included on-chain but eventually reverted.
35-
</Note>
36-
37134
```json
38135
{
39136
"id": 1,
@@ -127,6 +224,10 @@ Applications can specify that these onchain calls be executed taking advantage o
127224

128225
### Response Format
129226
The response format for `wallet_getCallsStatus` varies based on the execution method:
227+
228+
<Note>
229+
For non-atomic execution, include all transactions in the receipts array, even those that were included on-chain but eventually reverted.
230+
</Note>
130231

131232
#### For Atomic Execution
132233
```json
@@ -146,107 +247,6 @@ Applications can specify that these onchain calls be executed taking advantage o
146247
</Accordion>
147248
</AccordionGroup>
148249

149-
## Capabilities in CAIP-25 Connection Requests
150-
151-
CAIP-25 defines how capabilities can be expressed in wallet-to-dapp connections. These capabilities control how methods like `wallet_sendCalls` behave.
152-
153-
### Session Properties
154-
155-
In a connection request, dApps can request capabilities through `sessionProperties`. These capabilities can be universal (applying to all chains) or chain-specific:
156-
157-
```json
158-
"sessionProperties": {
159-
"expiry": "2022-12-24T17:07:31+00:00",
160-
"caip154": {
161-
"supported": "true"
162-
},
163-
"flow-control": {
164-
"loose": [],
165-
"strict": [],
166-
"exoticThirdThing": []
167-
},
168-
"atomic": {
169-
"status": "supported"
170-
}
171-
}
172-
```
173-
174-
### Scoped Properties
175-
176-
For chain-specific capabilities, dapps use `scopedProperties`:
177-
178-
```json
179-
"scopedProperties": {
180-
"eip155:8453": {
181-
"paymasterService": {
182-
"supported": true
183-
},
184-
"sessionKeys": {
185-
"supported": true
186-
}
187-
},
188-
"eip155:84532": {
189-
"auxiliaryFunds": {
190-
"supported": true
191-
}
192-
}
193-
}
194-
```
195-
196-
### Wallet Response
197-
198-
The wallet's response should specify the capabilities it supports, in accordance with EIP-5792 and CAIP-25:
199-
200-
```json
201-
"sessionProperties": {
202-
"expiry": "2022-12-24T17:07:31+00:00",
203-
"caip154": {
204-
"supported": "true"
205-
},
206-
"flow-control": {
207-
"loose": ["halt", "continue"],
208-
"strict": ["continue"]
209-
},
210-
"atomic": {
211-
"status": "ready"
212-
}
213-
},
214-
"scopedProperties": {
215-
"eip155:1": {
216-
"atomic": {
217-
"status": "supported"
218-
}
219-
},
220-
"eip155:137": {
221-
"atomic": {
222-
"status": "unsupported"
223-
}
224-
},
225-
"eip155:84532": {
226-
"eip155:83532:0x0910e12C68d02B561a34569E1367c9AAb42bd810": {
227-
"auxiliaryFunds": {
228-
"supported": false
229-
},
230-
"atomic": {
231-
"status": "supported"
232-
}
233-
}
234-
}
235-
}
236-
```
237-
- Capabilities shared across all address in a namespace can be expressed at top-level
238-
- Address-specific capabilities can include exceptions to scope-wide capabilities
239-
240-
### Atomic Capability
241-
242-
According to [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792), the `atomic` capability specifies how the wallet handles batches of transactions. It has three possible values:
243-
244-
- `supported` — The wallet executes calls atomically and contiguously.
245-
- `ready` — The wallet can upgrade to support atomic execution, pending user approval.
246-
- `unsupported` — The wallet provides no atomicity guarantees.
247-
248-
This capability is expressed per chain and is crucial for determining how `wallet_sendCalls` with `atomicRequired: true` will be handled.
249-
250250
## References
251251
- EIP-5792: https://eips.ethereum.org/EIPS/eip-5792#atomicbatch-capability
252252
- CAIP-25 namespaces: https://github.com/ChainAgnostic/namespaces/blob/main/eip155/caip25.md

0 commit comments

Comments
 (0)