@account-kit/wallet-client 0.1.0-alpha.2 → 0.1.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/esm/capabilities/index.d.ts +5 -2
  2. package/dist/esm/capabilities/index.js +1 -1
  3. package/dist/esm/capabilities/index.js.map +1 -1
  4. package/dist/esm/capabilities/overrides.js +8 -8
  5. package/dist/esm/capabilities/overrides.js.map +1 -1
  6. package/dist/esm/capabilities/permissions/index.d.ts +10 -3
  7. package/dist/esm/capabilities/permissions/index.js +11 -2
  8. package/dist/esm/capabilities/permissions/index.js.map +1 -1
  9. package/dist/esm/capabilities/permissions/mav2.d.ts +2 -2
  10. package/dist/esm/capabilities/permissions/mav2.js +9 -1
  11. package/dist/esm/capabilities/permissions/mav2.js.map +1 -1
  12. package/dist/esm/client/actions/grantPermissions.d.ts +57 -3
  13. package/dist/esm/client/actions/grantPermissions.js +1 -0
  14. package/dist/esm/client/actions/grantPermissions.js.map +1 -1
  15. package/dist/esm/client/actions/requestAccount.js +2 -2
  16. package/dist/esm/client/actions/requestAccount.js.map +1 -1
  17. package/dist/esm/client/actions/signSignatureRequest.d.ts +4 -1
  18. package/dist/esm/client/actions/signSignatureRequest.js +22 -1
  19. package/dist/esm/client/actions/signSignatureRequest.js.map +1 -1
  20. package/dist/esm/client/client.e2e-test.js +13 -19
  21. package/dist/esm/client/client.e2e-test.js.map +1 -1
  22. package/dist/esm/client/index.js +1 -1
  23. package/dist/esm/client/index.js.map +1 -1
  24. package/dist/esm/isomorphic/actions/createSession.js +25 -7
  25. package/dist/esm/isomorphic/actions/createSession.js.map +1 -1
  26. package/dist/esm/isomorphic/actions/prepareCalls.js +35 -12
  27. package/dist/esm/isomorphic/actions/prepareCalls.js.map +1 -1
  28. package/dist/esm/isomorphic/actions/sendPreparedCalls.js +26 -6
  29. package/dist/esm/isomorphic/actions/sendPreparedCalls.js.map +1 -1
  30. package/dist/esm/isomorphic/client.d.ts +11 -5
  31. package/dist/esm/isomorphic/utils/7702.d.ts +11 -0
  32. package/dist/esm/isomorphic/utils/7702.js +26 -0
  33. package/dist/esm/isomorphic/utils/7702.js.map +1 -0
  34. package/dist/esm/isomorphic/utils/createAccount.d.ts +2 -1
  35. package/dist/esm/isomorphic/utils/createAccount.js +30 -5
  36. package/dist/esm/isomorphic/utils/createAccount.js.map +1 -1
  37. package/dist/esm/isomorphic/utils/createDummySigner.js +3 -3
  38. package/dist/esm/isomorphic/utils/createDummySigner.js.map +1 -1
  39. package/dist/esm/isomorphic/utils/parsePermissionsContext.d.ts +2 -1
  40. package/dist/esm/isomorphic/utils/parsePermissionsContext.js +17 -5
  41. package/dist/esm/isomorphic/utils/parsePermissionsContext.js.map +1 -1
  42. package/dist/esm/local/client.js +2 -1
  43. package/dist/esm/local/client.js.map +1 -1
  44. package/dist/esm/remote/client.js +6 -2
  45. package/dist/esm/remote/client.js.map +1 -1
  46. package/dist/esm/rpc/examples.d.ts +230 -0
  47. package/dist/esm/rpc/examples.js +314 -0
  48. package/dist/esm/rpc/examples.js.map +1 -0
  49. package/dist/esm/rpc/request.d.ts +48 -17
  50. package/dist/esm/rpc/request.js +53 -14
  51. package/dist/esm/rpc/request.js.map +1 -1
  52. package/dist/esm/rpc/schema.d.ts +42 -11
  53. package/dist/esm/schemas.d.ts +29 -7
  54. package/dist/esm/schemas.js +120 -38
  55. package/dist/esm/schemas.js.map +1 -1
  56. package/dist/types/capabilities/index.d.ts +5 -2
  57. package/dist/types/capabilities/index.d.ts.map +1 -1
  58. package/dist/types/capabilities/overrides.d.ts.map +1 -1
  59. package/dist/types/capabilities/permissions/index.d.ts +10 -3
  60. package/dist/types/capabilities/permissions/index.d.ts.map +1 -1
  61. package/dist/types/capabilities/permissions/mav2.d.ts +2 -2
  62. package/dist/types/capabilities/permissions/mav2.d.ts.map +1 -1
  63. package/dist/types/client/actions/grantPermissions.d.ts +57 -3
  64. package/dist/types/client/actions/grantPermissions.d.ts.map +1 -1
  65. package/dist/types/client/actions/requestAccount.d.ts.map +1 -1
  66. package/dist/types/client/actions/signSignatureRequest.d.ts +4 -1
  67. package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -1
  68. package/dist/types/isomorphic/actions/createSession.d.ts.map +1 -1
  69. package/dist/types/isomorphic/actions/prepareCalls.d.ts.map +1 -1
  70. package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts.map +1 -1
  71. package/dist/types/isomorphic/client.d.ts +11 -5
  72. package/dist/types/isomorphic/client.d.ts.map +1 -1
  73. package/dist/types/isomorphic/utils/7702.d.ts +12 -0
  74. package/dist/types/isomorphic/utils/7702.d.ts.map +1 -0
  75. package/dist/types/isomorphic/utils/createAccount.d.ts +2 -1
  76. package/dist/types/isomorphic/utils/createAccount.d.ts.map +1 -1
  77. package/dist/types/isomorphic/utils/createDummySigner.d.ts.map +1 -1
  78. package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts +2 -1
  79. package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts.map +1 -1
  80. package/dist/types/remote/client.d.ts.map +1 -1
  81. package/dist/types/rpc/examples.d.ts +231 -0
  82. package/dist/types/rpc/examples.d.ts.map +1 -0
  83. package/dist/types/rpc/request.d.ts +48 -17
  84. package/dist/types/rpc/request.d.ts.map +1 -1
  85. package/dist/types/rpc/schema.d.ts +42 -11
  86. package/dist/types/rpc/schema.d.ts.map +1 -1
  87. package/dist/types/schemas.d.ts +29 -7
  88. package/dist/types/schemas.d.ts.map +1 -1
  89. package/package.json +2 -2
  90. package/src/capabilities/index.ts +5 -8
  91. package/src/capabilities/overrides.ts +23 -8
  92. package/src/capabilities/permissions/index.ts +21 -5
  93. package/src/capabilities/permissions/mav2.ts +12 -2
  94. package/src/client/actions/grantPermissions.ts +57 -3
  95. package/src/client/actions/requestAccount.ts +2 -3
  96. package/src/client/actions/signSignatureRequest.ts +31 -3
  97. package/src/client/client.e2e-test.ts +14 -21
  98. package/src/client/index.ts +1 -1
  99. package/src/isomorphic/actions/createSession.ts +28 -7
  100. package/src/isomorphic/actions/prepareCalls.ts +38 -11
  101. package/src/isomorphic/actions/sendPreparedCalls.ts +47 -20
  102. package/src/isomorphic/utils/7702.ts +58 -0
  103. package/src/isomorphic/utils/createAccount.ts +38 -6
  104. package/src/isomorphic/utils/createDummySigner.ts +3 -2
  105. package/src/isomorphic/utils/parsePermissionsContext.ts +23 -7
  106. package/src/local/client.ts +2 -3
  107. package/src/remote/client.ts +12 -2
  108. package/src/rpc/examples.ts +343 -0
  109. package/src/rpc/request.ts +75 -26
  110. package/src/schemas.ts +218 -87
@@ -0,0 +1,343 @@
1
+ const PrepareCalls = [
2
+ {
3
+ name: "wallet_prepareCalls example",
4
+ params: [
5
+ {
6
+ name: "Request",
7
+ value: [
8
+ {
9
+ calls: [
10
+ {
11
+ to: "0x1234567890123456789012345678901234567890",
12
+ data: "0x",
13
+ },
14
+ ],
15
+ from: "0xa363219d7C0b8673df17529D469Db9eFF0f35D2A",
16
+ chainId: "0x01",
17
+ capabilities: {
18
+ paymasterService: {
19
+ policyId: "11111111-2222-3333-4444-555555555555",
20
+ },
21
+ },
22
+ },
23
+ ],
24
+ },
25
+ ],
26
+ result: {
27
+ name: "Response",
28
+ value: {
29
+ type: "user-operation-v070",
30
+ data: {
31
+ sender: "0xa363219d7C0b8673df17529D469Db9eFF0f35D2A",
32
+ nonce: "0x10000000000000000",
33
+ callData:
34
+ "0x34fcd5be0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
35
+ paymaster: "0x3f222Df6aB18C1E10d0Ec136503c3B0dfd929048",
36
+ paymasterData:
37
+ "0x0000000000000000682d7e7c9fa6f71c28c31141a11ac9eb2bdbe898ddbd42a4f7085f8bb3380ba75dd9231a386e24fe5a84777217c907391e983b5b0f78a4a9d0fd1c8631dd22c10e106b461c",
38
+ paymasterPostOpGasLimit: "0x0",
39
+ paymasterVerificationGasLimit: "0x74d3",
40
+ maxPriorityFeePerGas: "0x60e4b0",
41
+ maxFeePerGas: "0x1bf52290",
42
+ callGasLimit: "0x2bb8",
43
+ verificationGasLimit: "0xc845",
44
+ preVerificationGas: "0x14b74",
45
+ },
46
+ chainId: "0x66eee",
47
+ signatureRequest: {
48
+ type: "personal_sign",
49
+ data: {
50
+ raw: "0xc69e468aa6fafb5c7298c02841e76f976b433018266af39a5807bc29ea9ad392",
51
+ },
52
+ },
53
+ },
54
+ },
55
+ },
56
+ ] as const;
57
+
58
+ const SendPreparedCalls = [
59
+ {
60
+ name: "wallet_sendPreparedCalls example",
61
+ params: [
62
+ {
63
+ name: "Request",
64
+ value: [
65
+ {
66
+ type: "user-operation-v070",
67
+ data: {
68
+ sender: "0xa363219d7C0b8673df17529D469Db9eFF0f35D2A",
69
+ nonce: "0x10000000000000000",
70
+ callData:
71
+ "0x34fcd5be0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
72
+ paymaster: "0x3f222Df6aB18C1E10d0Ec136503c3B0dfd929048",
73
+ paymasterData:
74
+ "0x0000000000000000682d7e7c9fa6f71c28c31141a11ac9eb2bdbe898ddbd42a4f7085f8bb3380ba75dd9231a386e24fe5a84777217c907391e983b5b0f78a4a9d0fd1c8631dd22c10e106b461c",
75
+ paymasterPostOpGasLimit: "0x0",
76
+ paymasterVerificationGasLimit: "0x74d3",
77
+ maxPriorityFeePerGas: "0x60e4b0",
78
+ maxFeePerGas: "0x1bf52290",
79
+ callGasLimit: "0x2bb8",
80
+ verificationGasLimit: "0xc845",
81
+ preVerificationGas: "0x14b74",
82
+ },
83
+ chainId: "0x66eee",
84
+ signature: {
85
+ type: "ecdsa",
86
+ signature:
87
+ "0xb1a055089b1ba8387ed435f2bd0afe7ff69f22b928cdfdea1b5323c64d6af387164de3fa6febf031b544de46a84d6fb7f084b9798ddfaba820950c257139a7321b",
88
+ },
89
+ },
90
+ ],
91
+ },
92
+ ],
93
+ result: {
94
+ name: "Response",
95
+ value: {
96
+ preparedCallIds: [
97
+ "0x0000000000000000000000000000000000000000000000000000000000066eeec69e468aa6fafb5c7298c02841e76f976b433018266af39a5807bc29ea9ad392",
98
+ ],
99
+ },
100
+ },
101
+ },
102
+ ] as const;
103
+
104
+ const RequestAccount = [
105
+ {
106
+ name: "wallet_requestAccount example",
107
+ params: [
108
+ {
109
+ name: "Request",
110
+ value: [
111
+ {
112
+ signerAddress: "0xa363219d7C0b8673df17529D469Db9eFF0f35D2A",
113
+ },
114
+ ],
115
+ },
116
+ ],
117
+ result: {
118
+ name: "Response",
119
+ value: {
120
+ accountAddress: "0xa363219d7C0b8673df17529D469Db9eFF0f35D2A",
121
+ id: "3061cc5f-1f96-48a9-ab45-41faad2dd23b",
122
+ },
123
+ },
124
+ },
125
+ ] as const;
126
+
127
+ const CreateAccount = [
128
+ {
129
+ name: "wallet_createAccount example",
130
+ params: [
131
+ {
132
+ name: "Request",
133
+ value: [
134
+ {
135
+ signerAddress: "0xa363219d7C0b8673df17529D469Db9eFF0f35D2A",
136
+ creationOption: {
137
+ salt: "0x10",
138
+ },
139
+ },
140
+ ],
141
+ },
142
+ ],
143
+ result: {
144
+ name: "Response",
145
+ value: {
146
+ accountAddress: "0xa363219d7C0b8673df17529D469Db9eFF0f35D2A",
147
+ id: "3061cc5f-1f96-48a9-ab45-41faad2dd23b",
148
+ },
149
+ },
150
+ },
151
+ ] as const;
152
+
153
+ const ListAccounts = [
154
+ {
155
+ name: "wallet_listAccounts example",
156
+ params: [
157
+ {
158
+ name: "Request",
159
+ value: [
160
+ {
161
+ signerAddress: "0x6275B53E98D07c729108A177207634eA22F5A748",
162
+ },
163
+ ],
164
+ },
165
+ ],
166
+ result: {
167
+ name: "Response",
168
+ value: {
169
+ accounts: [
170
+ {
171
+ accountAddress: "0xafdABa1E09e82F780721963eba39bA9e6d9FE4d2",
172
+ id: "3d8b3315-4aa1-4c67-8c82-20221e8dbf16",
173
+ },
174
+ ],
175
+ meta: {
176
+ totalCount: 1,
177
+ after: null,
178
+ },
179
+ },
180
+ },
181
+ },
182
+ ] as const;
183
+
184
+ const CreateSession = [
185
+ {
186
+ name: "wallet_createSession example",
187
+ params: [
188
+ {
189
+ name: "Request",
190
+ value: [
191
+ {
192
+ account: "0xafdABa1E09e82F780721963eba39bA9e6d9FE4d2",
193
+ chainId: "0x01",
194
+ key: {
195
+ publicKey: "0x647bbf38CD0E116d1672405aE17a775572a84e03",
196
+ type: "secp256k1",
197
+ },
198
+ permissions: [
199
+ {
200
+ type: "root",
201
+ },
202
+ ],
203
+ expiry: 1747969653,
204
+ },
205
+ ],
206
+ },
207
+ ],
208
+ result: {
209
+ name: "Response",
210
+ value: {
211
+ sessionId: "0xcd8b2d07a6fa76f1e8a5eaa8f3a7883c",
212
+ signatureRequest: {
213
+ type: "eth_signTypedData_v4",
214
+ data: {
215
+ domain: {
216
+ chainId: 1,
217
+ verifyingContract: "0xafdABa1E09e82F780721963eba39bA9e6d9FE4d2",
218
+ },
219
+ types: {
220
+ DeferredAction: [
221
+ {
222
+ name: "nonce",
223
+ type: "uint256",
224
+ },
225
+ {
226
+ name: "deadline",
227
+ type: "uint48",
228
+ },
229
+ {
230
+ name: "call",
231
+ type: "bytes",
232
+ },
233
+ ],
234
+ },
235
+ primaryType: "DeferredAction",
236
+ message: {
237
+ nonce: "0x1030000000000000000",
238
+ deadline: 1747969653,
239
+ call: "0x1bbf564c00000000000099DE0BF6fA90dEB851E2A2df7d83000000010500000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000647bbf38cd0e116d1672405ae17a775572a84e0300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000007900000000000082B8e2012be914dFA4f62A0573eA0000000101000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000682fe675000000000000000000000000000000000000000000000000000000000000000000000000000000",
240
+ },
241
+ },
242
+ },
243
+ },
244
+ },
245
+ },
246
+ ] as const;
247
+
248
+ const GetCallsStatus = [
249
+ {
250
+ name: "wallet_getCallsStatus example",
251
+ params: [
252
+ {
253
+ name: "Request",
254
+ value: [
255
+ "0x0000000000000000000000000000000000000000000000000000000000066eee1057eff9529142aa3b74adcaacfce5b99a09d80c9f2e38e35ea1f27535e61477",
256
+ ],
257
+ },
258
+ ],
259
+ result: {
260
+ name: "Response",
261
+ value: {
262
+ id: "0x0000000000000000000000000000000000000000000000000000000000066eee1057eff9529142aa3b74adcaacfce5b99a09d80c9f2e38e35ea1f27535e61477",
263
+ chainId: "0x66eee",
264
+ atomic: true,
265
+ status: 200,
266
+ receipts: [
267
+ {
268
+ status: "0x1",
269
+ blockHash:
270
+ "0x7c6f2f548c0ad4434dfb64f49a810bc795dadcd4cbec948bf8d4ae81a10fed5e",
271
+ blockNumber: "0x8ba5f79",
272
+ gasUsed: "0x33c65",
273
+ transactionHash:
274
+ "0x8ec28074a461102e4dbe43cb4aa9fed3e8c1274f1f1b0d5f6a0919ce7e20f517",
275
+ logs: [
276
+ {
277
+ address: "0x00000000000017c61b5bee81050ec8efc9c6fecd",
278
+ data: "0x0000000000000000000000000000000000000000000000000000000000000000",
279
+ topics: [
280
+ "0xd32049610f0cd3babd266cf338d726cc8c34c8ff97356c0f33c13fa59962ac92",
281
+ "0x000000000000000000000000f13223cca0ae9786dd91dffe1f4e834c71ccdc2d",
282
+ "0x0000000000000000000000003f3503e682bf27330f9e5065043d47207e609e7d",
283
+ ],
284
+ },
285
+ {
286
+ address: "0x0000000071727de22e5e9d8baf0edac6f37da032",
287
+ data: "0x00000000000000000000000000000000000017c61b5bee81050ec8efc9c6fecd0000000000000000000000002cc0c7981d846b9f2a16276556f6e8cb52bfb633",
288
+ topics: [
289
+ "0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d",
290
+ "0x1057eff9529142aa3b74adcaacfce5b99a09d80c9f2e38e35ea1f27535e61477",
291
+ "0x000000000000000000000000f13223cca0ae9786dd91dffe1f4e834c71ccdc2d",
292
+ ],
293
+ },
294
+ {
295
+ address: "0x0000000071727de22e5e9d8baf0edac6f37da032",
296
+ data: "0x",
297
+ topics: [
298
+ "0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972",
299
+ ],
300
+ },
301
+ {
302
+ address: "0x0000000071727de22e5e9d8baf0edac6f37da032",
303
+ data: "0x00000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000014ba6c2cd4f0000000000000000000000000000000000000000000000000000000000003451d",
304
+ topics: [
305
+ "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f",
306
+ "0x1057eff9529142aa3b74adcaacfce5b99a09d80c9f2e38e35ea1f27535e61477",
307
+ "0x000000000000000000000000f13223cca0ae9786dd91dffe1f4e834c71ccdc2d",
308
+ "0x0000000000000000000000002cc0c7981d846b9f2a16276556f6e8cb52bfb633",
309
+ ],
310
+ },
311
+ ],
312
+ },
313
+ ],
314
+ },
315
+ },
316
+ },
317
+ ] as const;
318
+
319
+ type Example = readonly [
320
+ {
321
+ name: string;
322
+ params: readonly [
323
+ {
324
+ name: "Request";
325
+ value: readonly [unknown];
326
+ },
327
+ ];
328
+ result: {
329
+ name: "Response";
330
+ value: unknown;
331
+ };
332
+ },
333
+ ];
334
+
335
+ export const Examples = {
336
+ PrepareCalls,
337
+ SendPreparedCalls,
338
+ RequestAccount,
339
+ CreateAccount,
340
+ ListAccounts,
341
+ CreateSession,
342
+ GetCallsStatus,
343
+ } satisfies Record<string, Example>;
@@ -3,11 +3,13 @@ import { Capabilities } from "../capabilities/index.js";
3
3
  import {
4
4
  PermissionsContext,
5
5
  PermissionsData,
6
+ RemotePermission,
6
7
  } from "../capabilities/permissions/index.js";
7
8
  import {
8
9
  TypeAddress,
9
10
  TypeBase64UrlEncodedString,
10
11
  TypeCreationOptions,
12
+ TypeEip7702AuthExtendedFields,
11
13
  TypeHex,
12
14
  TypeSerializedInitcode,
13
15
  TypeSignatureRequest,
@@ -15,6 +17,7 @@ import {
15
17
  TypeUserOperationRequest_v7,
16
18
  TypeUuid,
17
19
  } from "../schemas.js";
20
+ import { Examples } from "./examples.js";
18
21
 
19
22
  export const wallet_sendPreparedCalls = Type.Object(
20
23
  {
@@ -23,16 +26,24 @@ export const wallet_sendPreparedCalls = Type.Object(
23
26
  params: Type.Tuple([
24
27
  Type.Object({
25
28
  type: Type.Union([
26
- Type.Literal("user-operation-v060"),
27
- Type.Literal("user-operation-v070"),
29
+ Type.Literal("user-operation-v060", {
30
+ title: "User Operation (Entrypoint v0.6.0)",
31
+ }),
32
+ Type.Literal("user-operation-v070", {
33
+ title: "User Operation (Entrypoint v0.7.0)",
34
+ }),
28
35
  ]),
29
36
  data: Type.Union([
30
- Type.Omit(TypeUserOperationRequest_v6, ["signature"]),
31
- Type.Omit(TypeUserOperationRequest_v7, ["signature"]),
37
+ Type.Omit(TypeUserOperationRequest_v6, ["signature"], {
38
+ title: "Unsigned User Operation (Entrypoint v0.6.0)",
39
+ }),
40
+ Type.Omit(TypeUserOperationRequest_v7, ["signature"], {
41
+ title: "Unsigned User Operation (Entrypoint v0.7.0)",
42
+ }),
32
43
  ]),
33
44
  chainId: TypeHex(),
34
45
  signature: Type.Object({
35
- type: Type.Transform(Type.String())
46
+ type: Type.Transform(Type.Literal("ecdsa"))
36
47
  .Decode((value) => {
37
48
  if (value.toLowerCase() !== "ecdsa") {
38
49
  throw new Error("Invalid signature type, must be 'ecdsa'");
@@ -43,8 +54,13 @@ export const wallet_sendPreparedCalls = Type.Object(
43
54
  .Encode((value) => value),
44
55
  signature: TypeHex(),
45
56
  }),
57
+ signedAuthorization: Type.Optional(TypeEip7702AuthExtendedFields),
46
58
  capabilities: Type.Optional(
47
- Type.Object({ permissions: PermissionsContext }),
59
+ Type.Object({
60
+ permissions: Type.Optional(
61
+ Type.Union([PermissionsContext, RemotePermission]),
62
+ ),
63
+ }),
48
64
  ),
49
65
  }),
50
66
  ]),
@@ -56,6 +72,7 @@ export const wallet_sendPreparedCalls = Type.Object(
56
72
  {
57
73
  description:
58
74
  "This method is used after signing the signatureRequest returned from prepareCalls to submit a user operation",
75
+ examples: Examples.SendPreparedCalls,
59
76
  },
60
77
  );
61
78
 
@@ -80,12 +97,20 @@ export const wallet_prepareCalls = Type.Object(
80
97
  }),
81
98
  ReturnType: Type.Object({
82
99
  type: Type.Union([
83
- Type.Literal("user-operation-v060"),
84
- Type.Literal("user-operation-v070"),
100
+ Type.Literal("user-operation-v060", {
101
+ title: "User Operation (Entrypoint v0.6.0)",
102
+ }),
103
+ Type.Literal("user-operation-v070", {
104
+ title: "User Operation (Entrypoint v0.7.0)",
105
+ }),
85
106
  ]),
86
107
  data: Type.Union([
87
- Type.Omit(TypeUserOperationRequest_v6, ["signature"]),
88
- Type.Omit(TypeUserOperationRequest_v7, ["signature"]),
108
+ Type.Omit(TypeUserOperationRequest_v6, ["signature"], {
109
+ title: "Unsigned User Operation (Entrypoint v0.6.0)",
110
+ }),
111
+ Type.Omit(TypeUserOperationRequest_v7, ["signature"], {
112
+ title: "Unsigned User Operation (Entrypoint v0.7.0)",
113
+ }),
89
114
  ]),
90
115
  chainId: TypeHex(),
91
116
  signatureRequest: TypeSignatureRequest,
@@ -94,6 +119,7 @@ export const wallet_prepareCalls = Type.Object(
94
119
  {
95
120
  description:
96
121
  "This method is used to prepare a user operation for submission. It will return a built user operation and a signature request which needs to be signed by the user before submitting to wallet_sendPreparedCalls",
122
+ examples: Examples.PrepareCalls,
97
123
  },
98
124
  );
99
125
 
@@ -103,20 +129,30 @@ export const wallet_requestAccount = Type.Object(
103
129
  method: Type.Literal("wallet_requestAccount"),
104
130
  params: Type.Tuple([
105
131
  Type.Union([
106
- Type.Object({
107
- signerAddress: TypeAddress,
108
- id: Type.Optional(TypeUuid),
109
- creationHint: TypeCreationOptions,
110
- includeCounterfactualInfo: Type.Optional(
111
- Type.Boolean({ default: false }),
112
- ),
113
- }),
114
- Type.Object({
115
- accountAddress: TypeAddress,
116
- includeCounterfactualInfo: Type.Optional(
117
- Type.Boolean({ default: false }),
118
- ),
119
- }),
132
+ Type.Object(
133
+ {
134
+ signerAddress: TypeAddress,
135
+ id: Type.Optional(TypeUuid),
136
+ creationHint: TypeCreationOptions,
137
+ includeCounterfactualInfo: Type.Optional(
138
+ Type.Boolean({ default: false }),
139
+ ),
140
+ },
141
+ {
142
+ title: "Using signer address",
143
+ },
144
+ ),
145
+ Type.Object(
146
+ {
147
+ accountAddress: TypeAddress,
148
+ includeCounterfactualInfo: Type.Optional(
149
+ Type.Boolean({ default: false }),
150
+ ),
151
+ },
152
+ {
153
+ title: "Using smart contract account address",
154
+ },
155
+ ),
120
156
  ]),
121
157
  ]),
122
158
  }),
@@ -124,10 +160,12 @@ export const wallet_requestAccount = Type.Object(
124
160
  accountAddress: TypeAddress,
125
161
  id: TypeUuid,
126
162
  counterfactualInfo: Type.Optional(TypeSerializedInitcode),
163
+ delegation: Type.Optional(TypeAddress),
127
164
  }),
128
165
  },
129
166
  {
130
167
  description: `This method is used to get the smart account address and relevant info for a given signer. If an account does not already exist for a given signer, this method will create one before returning the counterfactual address.`,
168
+ examples: Examples.RequestAccount,
131
169
  },
132
170
  );
133
171
 
@@ -150,6 +188,7 @@ export const wallet_createAccount = Type.Object(
150
188
  },
151
189
  {
152
190
  description: `This method is used to create a smart account for a given signer. This method is primarly used to import existing accounts. For most cases, you should use wallet_requestAccount instead.`,
191
+ examples: Examples.CreateAccount,
153
192
  },
154
193
  );
155
194
 
@@ -175,7 +214,7 @@ export const wallet_listAccounts = Type.Object(
175
214
  }),
176
215
  ),
177
216
  meta: Type.Object({
178
- totalCount: Type.Number(),
217
+ totalCount: Type.Integer(),
179
218
  after: Type.Union([TypeBase64UrlEncodedString, Type.Null()]),
180
219
  }),
181
220
  }),
@@ -183,6 +222,7 @@ export const wallet_listAccounts = Type.Object(
183
222
  {
184
223
  description:
185
224
  "This method is used to list all smart accounts for a given signer.",
225
+ examples: Examples.ListAccounts,
186
226
  },
187
227
  );
188
228
 
@@ -193,7 +233,9 @@ export const wallet_createSession = Type.Object(
193
233
  params: Type.Tuple([
194
234
  Type.Intersect([
195
235
  PermissionsData,
196
- Type.Object({ account: TypeAddress }),
236
+ Type.Object({
237
+ account: TypeAddress,
238
+ }),
197
239
  ]),
198
240
  ]),
199
241
  }),
@@ -205,6 +247,7 @@ export const wallet_createSession = Type.Object(
205
247
  {
206
248
  description:
207
249
  "This method is used to create a session for a given address with specified permissions.",
250
+ examples: Examples.CreateSession,
208
251
  },
209
252
  );
210
253
 
@@ -224,22 +267,27 @@ export const wallet_getCallsStatus = Type.Object(
224
267
  atomic: Type.Boolean(),
225
268
  status: Type.Union([
226
269
  Type.Literal(100, {
270
+ title: "Pending",
227
271
  description:
228
272
  "Batch has been received by the wallet but has not completed execution onchain",
229
273
  }),
230
274
  Type.Literal(200, {
275
+ title: "Confirmed",
231
276
  description:
232
277
  "Batch has been included onchain without reverts, receipts array contains info of all calls",
233
278
  }),
234
279
  Type.Literal(400, {
280
+ title: "Offchain Failure",
235
281
  description:
236
282
  "Batch has not been included onchain and wallet will not retry",
237
283
  }),
238
284
  Type.Literal(500, {
285
+ title: "Onchain Failure",
239
286
  description:
240
287
  "Batch reverted *completely* and only changes related to gas charge may have been included onchain",
241
288
  }),
242
289
  Type.Literal(600, {
290
+ title: "Partial Onchain Failure",
243
291
  description:
244
292
  "Batch reverted *partially* and some changes related to batch calls may have been included onchain",
245
293
  }),
@@ -269,5 +317,6 @@ export const wallet_getCallsStatus = Type.Object(
269
317
  {
270
318
  description:
271
319
  "This method is used to get the status of calls IDs returned from wallet_sendPreparedCalls.",
320
+ examples: Examples.GetCallsStatus,
272
321
  },
273
322
  );