You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/base-account/reference/core/capabilities/datacallback.mdx
+26-19Lines changed: 26 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,6 @@ Your callback API will receive a POST request with the following structure:
111
111
data: string;
112
112
}[];
113
113
chainId: string;
114
-
version: string;
115
114
capabilities: {
116
115
dataCallback: {
117
116
requestedInfo: {
@@ -151,22 +150,23 @@ Your callback API must respond with one of two formats:
151
150
152
151
### 1. Success Response
153
152
154
-
Return the calls the user will end up submitting. They can be the same calls or new ones, but they must be present. You can change all capabilities (e.g. switching Paymaster if calls happen on a different chain) except the data callback capability, which must remain present.
153
+
Return the calls the user will end up submitting wrapped in a `request` object. They can be the same calls or new ones, but they must be present. You can change all capabilities (e.g. switching Paymaster if calls happen on a different chain) except the data callback capability, which must remain present.
155
154
156
155
```typescript
157
156
{
158
-
calls: {
159
-
to: string;
160
-
data: string;
161
-
}[];
162
-
chainId: string;
163
-
version: string;
164
-
capabilities: {
165
-
dataCallback: {
166
-
// Original or updated dataCallback capability
157
+
request: {
158
+
calls: {
159
+
to: string;
160
+
data: string;
161
+
}[];
162
+
chainId: string;
163
+
capabilities: {
164
+
dataCallback: {
165
+
// Original or updated dataCallback capability
166
+
};
167
+
// Other capabilities can be changed as needed
167
168
};
168
-
// Other capabilities can be changed as needed
169
-
};
169
+
}
170
170
}
171
171
```
172
172
@@ -234,13 +234,20 @@ export async function POST(request: Request) {
234
234
returnResponse.json({ errors });
235
235
}
236
236
237
-
// Success - return original calls
238
-
returnResponse.json({
239
-
calls: requestData.calls,
240
-
chainId: requestData.chainId,
241
-
version: requestData.version,
242
-
capabilities: requestData.capabilities
237
+
// Success - return the request data wrapped in a request object
238
+
// The wallet expects the response to contain the original or modified calls
239
+
returnResponse.json({
240
+
request: requestData
243
241
});
242
+
243
+
// Alternative: Explicitly enumerate fields if needed
0 commit comments