@dynamic-labs/ethereum-aa 4.10.3 → 4.10.4-preview.1

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 (40) hide show
  1. package/CHANGELOG.md +15 -4
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +11 -9
  5. package/src/AccountAbstractionConnector.cjs +75 -0
  6. package/src/AccountAbstractionConnector.d.ts +56 -0
  7. package/src/AccountAbstractionConnector.js +71 -0
  8. package/src/ZKsync/client.cjs +31 -0
  9. package/src/ZKsync/client.d.ts +25 -0
  10. package/src/ZKsync/client.js +27 -0
  11. package/src/ZKsync/ecdsaAccount.cjs +32 -0
  12. package/src/ZKsync/ecdsaAccount.d.ts +13 -0
  13. package/src/ZKsync/ecdsaAccount.js +28 -0
  14. package/src/ZKsync/getEip712Domain.cjs +62 -0
  15. package/src/ZKsync/getEip712Domain.d.ts +2 -0
  16. package/src/ZKsync/getEip712Domain.js +58 -0
  17. package/src/ZKsync/session.cjs +1218 -0
  18. package/src/ZKsync/session.d.ts +904 -0
  19. package/src/ZKsync/session.js +1211 -0
  20. package/src/ZKsync/types.cjs +52 -0
  21. package/src/ZKsync/types.d.ts +9 -0
  22. package/src/ZKsync/types.js +48 -0
  23. package/src/ZKsync/walletActions.cjs +93 -0
  24. package/src/ZKsync/walletActions.d.ts +15 -0
  25. package/src/ZKsync/walletActions.js +87 -0
  26. package/src/ZKsyncConnector.cjs +536 -0
  27. package/src/ZKsyncConnector.d.ts +24923 -0
  28. package/src/ZKsyncConnector.js +532 -0
  29. package/src/ZeroDevConnector.cjs +17 -13
  30. package/src/ZeroDevConnector.d.ts +17 -16
  31. package/src/ZeroDevConnector.js +18 -14
  32. package/src/index.cjs +11 -0
  33. package/src/index.d.ts +2 -0
  34. package/src/index.js +10 -1
  35. package/src/utils/abi.cjs +88 -0
  36. package/src/utils/abi.d.ts +102 -0
  37. package/src/utils/abi.js +84 -0
  38. package/src/utils/isZKsyncConnector.cjs +8 -0
  39. package/src/utils/isZKsyncConnector.d.ts +3 -0
  40. package/src/utils/isZKsyncConnector.js +4 -0
@@ -0,0 +1,1211 @@
1
+ 'use client'
2
+ import { __awaiter } from '../../_virtual/_tslib.js';
3
+ import { encodeFunctionData } from 'viem';
4
+ import { sendTransaction, waitForTransactionReceipt } from 'viem/actions';
5
+ import { getGeneralPaymasterInput } from 'viem/zksync';
6
+ import { getTransactionWithPaymasterData } from 'zksync-sso/paymaster';
7
+
8
+ const createSession = (client, args) => __awaiter(void 0, void 0, void 0, function* () {
9
+ var _a, _b, _c;
10
+ const callData = encodeFunctionData({
11
+ abi: SessionKeyValidatorAbi,
12
+ args: [args.sessionConfig],
13
+ functionName: 'createSession',
14
+ });
15
+ const sendTransactionArgs = {
16
+ account: client.account,
17
+ data: callData,
18
+ gas: BigInt(10000000),
19
+ paymaster: (_a = args.paymaster) === null || _a === void 0 ? void 0 : _a.address,
20
+ paymasterInput: ((_b = args.paymaster) === null || _b === void 0 ? void 0 : _b.address)
21
+ ? ((_c = args.paymaster) === null || _c === void 0 ? void 0 : _c.paymasterInput) ||
22
+ getGeneralPaymasterInput({ innerInput: '0x' })
23
+ : undefined,
24
+ to: args.contracts.session, // TODO: Remove when gas estimation is fixed
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
+ };
27
+ const transactionWithPaymasterData = yield getTransactionWithPaymasterData(client.chain.id, client.account.address, sendTransactionArgs, args.paymasterHandler);
28
+ const transactionHash = yield sendTransaction(client, transactionWithPaymasterData);
29
+ if (args.onTransactionSent) {
30
+ args.onTransactionSent(transactionHash);
31
+ }
32
+ const transactionReceipt = yield waitForTransactionReceipt(client, {
33
+ hash: transactionHash,
34
+ });
35
+ if (transactionReceipt.status !== 'success')
36
+ throw new Error('createSession transaction reverted');
37
+ return {
38
+ transactionReceipt,
39
+ };
40
+ });
41
+ const revokeSession = (client, args) => __awaiter(void 0, void 0, void 0, function* () {
42
+ var _d, _e, _f;
43
+ const callData = encodeFunctionData({
44
+ abi: SessionKeyValidatorAbi,
45
+ args: [args.sessionId],
46
+ functionName: 'revokeKey',
47
+ });
48
+ const sendTransactionArgs = {
49
+ account: client.account,
50
+ data: callData,
51
+ gas: BigInt(10000000),
52
+ paymaster: (_d = args.paymaster) === null || _d === void 0 ? void 0 : _d.address,
53
+ paymasterInput: ((_e = args.paymaster) === null || _e === void 0 ? void 0 : _e.address)
54
+ ? ((_f = args.paymaster) === null || _f === void 0 ? void 0 : _f.paymasterInput) ||
55
+ getGeneralPaymasterInput({ innerInput: '0x' })
56
+ : undefined,
57
+ to: args.contracts.session, // TODO: Remove when gas estimation is fixed
58
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
+ };
60
+ const transactionWithPaymasterData = yield getTransactionWithPaymasterData(client.chain.id, client.account.address, sendTransactionArgs, args.paymasterHandler);
61
+ const transactionHash = yield sendTransaction(client, transactionWithPaymasterData);
62
+ if (args.onTransactionSent) {
63
+ args.onTransactionSent(transactionHash);
64
+ }
65
+ const transactionReceipt = yield waitForTransactionReceipt(client, {
66
+ hash: transactionHash,
67
+ });
68
+ if (transactionReceipt.status !== 'success')
69
+ throw new Error('createSession transaction reverted');
70
+ return {
71
+ transactionReceipt,
72
+ };
73
+ });
74
+ const zksyncSsoEcdsaActions = (client) => ({
75
+ createSession: (args) => __awaiter(void 0, void 0, void 0, function* () {
76
+ return yield createSession(client, Object.assign(Object.assign({}, args), { contracts: client.contracts }));
77
+ }),
78
+ revokeSession: (args) => __awaiter(void 0, void 0, void 0, function* () {
79
+ return yield revokeSession(client, Object.assign(Object.assign({}, args), { contracts: client.contracts }));
80
+ }),
81
+ });
82
+ const SessionKeyValidatorAbi = [
83
+ {
84
+ inputs: [
85
+ {
86
+ internalType: 'uint256',
87
+ name: 'value',
88
+ type: 'uint256',
89
+ },
90
+ ],
91
+ name: 'ADDRESS_CAST_OVERFLOW',
92
+ type: 'error',
93
+ },
94
+ {
95
+ inputs: [
96
+ {
97
+ internalType: 'bytes',
98
+ name: 'input',
99
+ type: 'bytes',
100
+ },
101
+ ],
102
+ name: 'INVALID_PAYMASTER_INPUT',
103
+ type: 'error',
104
+ },
105
+ {
106
+ inputs: [
107
+ {
108
+ internalType: 'address',
109
+ name: 'notInitialized',
110
+ type: 'address',
111
+ },
112
+ ],
113
+ name: 'NOT_FROM_INITIALIZED_ACCOUNT',
114
+ type: 'error',
115
+ },
116
+ {
117
+ inputs: [
118
+ {
119
+ internalType: 'uint256',
120
+ name: 'chainId',
121
+ type: 'uint256',
122
+ },
123
+ ],
124
+ name: 'NO_TIMESTAMP_ASSERTER',
125
+ type: 'error',
126
+ },
127
+ {
128
+ inputs: [
129
+ {
130
+ internalType: 'uint256',
131
+ name: 'allowance',
132
+ type: 'uint256',
133
+ },
134
+ {
135
+ internalType: 'uint256',
136
+ name: 'maxAllowance',
137
+ type: 'uint256',
138
+ },
139
+ {
140
+ internalType: 'uint64',
141
+ name: 'period',
142
+ type: 'uint64',
143
+ },
144
+ ],
145
+ name: 'SESSION_ALLOWANCE_EXCEEDED',
146
+ type: 'error',
147
+ },
148
+ {
149
+ inputs: [
150
+ {
151
+ internalType: 'bytes32',
152
+ name: 'sessionHash',
153
+ type: 'bytes32',
154
+ },
155
+ ],
156
+ name: 'SESSION_ALREADY_EXISTS',
157
+ type: 'error',
158
+ },
159
+ {
160
+ inputs: [
161
+ {
162
+ internalType: 'address',
163
+ name: 'target',
164
+ type: 'address',
165
+ },
166
+ {
167
+ internalType: 'bytes4',
168
+ name: 'selector',
169
+ type: 'bytes4',
170
+ },
171
+ ],
172
+ name: 'SESSION_CALL_POLICY_VIOLATED',
173
+ type: 'error',
174
+ },
175
+ {
176
+ inputs: [
177
+ {
178
+ internalType: 'bytes32',
179
+ name: 'param',
180
+ type: 'bytes32',
181
+ },
182
+ {
183
+ internalType: 'bytes32',
184
+ name: 'refValue',
185
+ type: 'bytes32',
186
+ },
187
+ {
188
+ internalType: 'uint8',
189
+ name: 'condition',
190
+ type: 'uint8',
191
+ },
192
+ ],
193
+ name: 'SESSION_CONDITION_FAILED',
194
+ type: 'error',
195
+ },
196
+ {
197
+ inputs: [
198
+ {
199
+ internalType: 'uint256',
200
+ name: 'expiresAt',
201
+ type: 'uint256',
202
+ },
203
+ ],
204
+ name: 'SESSION_EXPIRES_TOO_SOON',
205
+ type: 'error',
206
+ },
207
+ {
208
+ inputs: [
209
+ {
210
+ internalType: 'uint256',
211
+ name: 'actualLength',
212
+ type: 'uint256',
213
+ },
214
+ {
215
+ internalType: 'uint256',
216
+ name: 'expectedMinimumLength',
217
+ type: 'uint256',
218
+ },
219
+ ],
220
+ name: 'SESSION_INVALID_DATA_LENGTH',
221
+ type: 'error',
222
+ },
223
+ {
224
+ inputs: [
225
+ {
226
+ internalType: 'address',
227
+ name: 'recovered',
228
+ type: 'address',
229
+ },
230
+ {
231
+ internalType: 'address',
232
+ name: 'expected',
233
+ type: 'address',
234
+ },
235
+ ],
236
+ name: 'SESSION_INVALID_SIGNER',
237
+ type: 'error',
238
+ },
239
+ {
240
+ inputs: [
241
+ {
242
+ internalType: 'uint256',
243
+ name: 'lifetimeUsage',
244
+ type: 'uint256',
245
+ },
246
+ {
247
+ internalType: 'uint256',
248
+ name: 'maxUsage',
249
+ type: 'uint256',
250
+ },
251
+ ],
252
+ name: 'SESSION_LIFETIME_USAGE_EXCEEDED',
253
+ type: 'error',
254
+ },
255
+ {
256
+ inputs: [
257
+ {
258
+ internalType: 'uint256',
259
+ name: 'usedValue',
260
+ type: 'uint256',
261
+ },
262
+ {
263
+ internalType: 'uint256',
264
+ name: 'maxValuePerUse',
265
+ type: 'uint256',
266
+ },
267
+ ],
268
+ name: 'SESSION_MAX_VALUE_EXCEEDED',
269
+ type: 'error',
270
+ },
271
+ {
272
+ inputs: [],
273
+ name: 'SESSION_NOT_ACTIVE',
274
+ type: 'error',
275
+ },
276
+ {
277
+ inputs: [
278
+ {
279
+ internalType: 'address',
280
+ name: 'target',
281
+ type: 'address',
282
+ },
283
+ ],
284
+ name: 'SESSION_TRANSFER_POLICY_VIOLATED',
285
+ type: 'error',
286
+ },
287
+ {
288
+ inputs: [],
289
+ name: 'SESSION_UNLIMITED_FEES',
290
+ type: 'error',
291
+ },
292
+ {
293
+ inputs: [],
294
+ name: 'SESSION_ZERO_SIGNER',
295
+ type: 'error',
296
+ },
297
+ {
298
+ inputs: [
299
+ {
300
+ internalType: 'uint256',
301
+ name: 'openSessions',
302
+ type: 'uint256',
303
+ },
304
+ ],
305
+ name: 'UNINSTALL_WITH_OPEN_SESSIONS',
306
+ type: 'error',
307
+ },
308
+ {
309
+ anonymous: false,
310
+ inputs: [
311
+ {
312
+ indexed: true,
313
+ internalType: 'address',
314
+ name: 'account',
315
+ type: 'address',
316
+ },
317
+ {
318
+ indexed: true,
319
+ internalType: 'bytes32',
320
+ name: 'sessionHash',
321
+ type: 'bytes32',
322
+ },
323
+ {
324
+ components: [
325
+ {
326
+ internalType: 'address',
327
+ name: 'signer',
328
+ type: 'address',
329
+ },
330
+ {
331
+ internalType: 'uint256',
332
+ name: 'expiresAt',
333
+ type: 'uint256',
334
+ },
335
+ {
336
+ components: [
337
+ {
338
+ internalType: 'enum SessionLib.LimitType',
339
+ name: 'limitType',
340
+ type: 'uint8',
341
+ },
342
+ {
343
+ internalType: 'uint256',
344
+ name: 'limit',
345
+ type: 'uint256',
346
+ },
347
+ {
348
+ internalType: 'uint256',
349
+ name: 'period',
350
+ type: 'uint256',
351
+ },
352
+ ],
353
+ internalType: 'struct SessionLib.UsageLimit',
354
+ name: 'feeLimit',
355
+ type: 'tuple',
356
+ },
357
+ {
358
+ components: [
359
+ {
360
+ internalType: 'address',
361
+ name: 'target',
362
+ type: 'address',
363
+ },
364
+ {
365
+ internalType: 'bytes4',
366
+ name: 'selector',
367
+ type: 'bytes4',
368
+ },
369
+ {
370
+ internalType: 'uint256',
371
+ name: 'maxValuePerUse',
372
+ type: 'uint256',
373
+ },
374
+ {
375
+ components: [
376
+ {
377
+ internalType: 'enum SessionLib.LimitType',
378
+ name: 'limitType',
379
+ type: 'uint8',
380
+ },
381
+ {
382
+ internalType: 'uint256',
383
+ name: 'limit',
384
+ type: 'uint256',
385
+ },
386
+ {
387
+ internalType: 'uint256',
388
+ name: 'period',
389
+ type: 'uint256',
390
+ },
391
+ ],
392
+ internalType: 'struct SessionLib.UsageLimit',
393
+ name: 'valueLimit',
394
+ type: 'tuple',
395
+ },
396
+ {
397
+ components: [
398
+ {
399
+ internalType: 'enum SessionLib.Condition',
400
+ name: 'condition',
401
+ type: 'uint8',
402
+ },
403
+ {
404
+ internalType: 'uint64',
405
+ name: 'index',
406
+ type: 'uint64',
407
+ },
408
+ {
409
+ internalType: 'bytes32',
410
+ name: 'refValue',
411
+ type: 'bytes32',
412
+ },
413
+ {
414
+ components: [
415
+ {
416
+ internalType: 'enum SessionLib.LimitType',
417
+ name: 'limitType',
418
+ type: 'uint8',
419
+ },
420
+ {
421
+ internalType: 'uint256',
422
+ name: 'limit',
423
+ type: 'uint256',
424
+ },
425
+ {
426
+ internalType: 'uint256',
427
+ name: 'period',
428
+ type: 'uint256',
429
+ },
430
+ ],
431
+ internalType: 'struct SessionLib.UsageLimit',
432
+ name: 'limit',
433
+ type: 'tuple',
434
+ },
435
+ ],
436
+ internalType: 'struct SessionLib.Constraint[]',
437
+ name: 'constraints',
438
+ type: 'tuple[]',
439
+ },
440
+ ],
441
+ internalType: 'struct SessionLib.CallSpec[]',
442
+ name: 'callPolicies',
443
+ type: 'tuple[]',
444
+ },
445
+ {
446
+ components: [
447
+ {
448
+ internalType: 'address',
449
+ name: 'target',
450
+ type: 'address',
451
+ },
452
+ {
453
+ internalType: 'uint256',
454
+ name: 'maxValuePerUse',
455
+ type: 'uint256',
456
+ },
457
+ {
458
+ components: [
459
+ {
460
+ internalType: 'enum SessionLib.LimitType',
461
+ name: 'limitType',
462
+ type: 'uint8',
463
+ },
464
+ {
465
+ internalType: 'uint256',
466
+ name: 'limit',
467
+ type: 'uint256',
468
+ },
469
+ {
470
+ internalType: 'uint256',
471
+ name: 'period',
472
+ type: 'uint256',
473
+ },
474
+ ],
475
+ internalType: 'struct SessionLib.UsageLimit',
476
+ name: 'valueLimit',
477
+ type: 'tuple',
478
+ },
479
+ ],
480
+ internalType: 'struct SessionLib.TransferSpec[]',
481
+ name: 'transferPolicies',
482
+ type: 'tuple[]',
483
+ },
484
+ ],
485
+ indexed: false,
486
+ internalType: 'struct SessionLib.SessionSpec',
487
+ name: 'sessionSpec',
488
+ type: 'tuple',
489
+ },
490
+ ],
491
+ name: 'SessionCreated',
492
+ type: 'event',
493
+ },
494
+ {
495
+ anonymous: false,
496
+ inputs: [
497
+ {
498
+ indexed: true,
499
+ internalType: 'address',
500
+ name: 'account',
501
+ type: 'address',
502
+ },
503
+ {
504
+ indexed: true,
505
+ internalType: 'bytes32',
506
+ name: 'sessionHash',
507
+ type: 'bytes32',
508
+ },
509
+ ],
510
+ name: 'SessionRevoked',
511
+ type: 'event',
512
+ },
513
+ {
514
+ inputs: [
515
+ {
516
+ components: [
517
+ {
518
+ internalType: 'address',
519
+ name: 'signer',
520
+ type: 'address',
521
+ },
522
+ {
523
+ internalType: 'uint256',
524
+ name: 'expiresAt',
525
+ type: 'uint256',
526
+ },
527
+ {
528
+ components: [
529
+ {
530
+ internalType: 'enum SessionLib.LimitType',
531
+ name: 'limitType',
532
+ type: 'uint8',
533
+ },
534
+ {
535
+ internalType: 'uint256',
536
+ name: 'limit',
537
+ type: 'uint256',
538
+ },
539
+ {
540
+ internalType: 'uint256',
541
+ name: 'period',
542
+ type: 'uint256',
543
+ },
544
+ ],
545
+ internalType: 'struct SessionLib.UsageLimit',
546
+ name: 'feeLimit',
547
+ type: 'tuple',
548
+ },
549
+ {
550
+ components: [
551
+ {
552
+ internalType: 'address',
553
+ name: 'target',
554
+ type: 'address',
555
+ },
556
+ {
557
+ internalType: 'bytes4',
558
+ name: 'selector',
559
+ type: 'bytes4',
560
+ },
561
+ {
562
+ internalType: 'uint256',
563
+ name: 'maxValuePerUse',
564
+ type: 'uint256',
565
+ },
566
+ {
567
+ components: [
568
+ {
569
+ internalType: 'enum SessionLib.LimitType',
570
+ name: 'limitType',
571
+ type: 'uint8',
572
+ },
573
+ {
574
+ internalType: 'uint256',
575
+ name: 'limit',
576
+ type: 'uint256',
577
+ },
578
+ {
579
+ internalType: 'uint256',
580
+ name: 'period',
581
+ type: 'uint256',
582
+ },
583
+ ],
584
+ internalType: 'struct SessionLib.UsageLimit',
585
+ name: 'valueLimit',
586
+ type: 'tuple',
587
+ },
588
+ {
589
+ components: [
590
+ {
591
+ internalType: 'enum SessionLib.Condition',
592
+ name: 'condition',
593
+ type: 'uint8',
594
+ },
595
+ {
596
+ internalType: 'uint64',
597
+ name: 'index',
598
+ type: 'uint64',
599
+ },
600
+ {
601
+ internalType: 'bytes32',
602
+ name: 'refValue',
603
+ type: 'bytes32',
604
+ },
605
+ {
606
+ components: [
607
+ {
608
+ internalType: 'enum SessionLib.LimitType',
609
+ name: 'limitType',
610
+ type: 'uint8',
611
+ },
612
+ {
613
+ internalType: 'uint256',
614
+ name: 'limit',
615
+ type: 'uint256',
616
+ },
617
+ {
618
+ internalType: 'uint256',
619
+ name: 'period',
620
+ type: 'uint256',
621
+ },
622
+ ],
623
+ internalType: 'struct SessionLib.UsageLimit',
624
+ name: 'limit',
625
+ type: 'tuple',
626
+ },
627
+ ],
628
+ internalType: 'struct SessionLib.Constraint[]',
629
+ name: 'constraints',
630
+ type: 'tuple[]',
631
+ },
632
+ ],
633
+ internalType: 'struct SessionLib.CallSpec[]',
634
+ name: 'callPolicies',
635
+ type: 'tuple[]',
636
+ },
637
+ {
638
+ components: [
639
+ {
640
+ internalType: 'address',
641
+ name: 'target',
642
+ type: 'address',
643
+ },
644
+ {
645
+ internalType: 'uint256',
646
+ name: 'maxValuePerUse',
647
+ type: 'uint256',
648
+ },
649
+ {
650
+ components: [
651
+ {
652
+ internalType: 'enum SessionLib.LimitType',
653
+ name: 'limitType',
654
+ type: 'uint8',
655
+ },
656
+ {
657
+ internalType: 'uint256',
658
+ name: 'limit',
659
+ type: 'uint256',
660
+ },
661
+ {
662
+ internalType: 'uint256',
663
+ name: 'period',
664
+ type: 'uint256',
665
+ },
666
+ ],
667
+ internalType: 'struct SessionLib.UsageLimit',
668
+ name: 'valueLimit',
669
+ type: 'tuple',
670
+ },
671
+ ],
672
+ internalType: 'struct SessionLib.TransferSpec[]',
673
+ name: 'transferPolicies',
674
+ type: 'tuple[]',
675
+ },
676
+ ],
677
+ internalType: 'struct SessionLib.SessionSpec',
678
+ name: 'sessionSpec',
679
+ type: 'tuple',
680
+ },
681
+ ],
682
+ name: 'createSession',
683
+ outputs: [],
684
+ stateMutability: 'nonpayable',
685
+ type: 'function',
686
+ },
687
+ {
688
+ inputs: [
689
+ {
690
+ internalType: 'address',
691
+ name: 'smartAccount',
692
+ type: 'address',
693
+ },
694
+ ],
695
+ name: 'isInitialized',
696
+ outputs: [
697
+ {
698
+ internalType: 'bool',
699
+ name: '',
700
+ type: 'bool',
701
+ },
702
+ ],
703
+ stateMutability: 'view',
704
+ type: 'function',
705
+ },
706
+ {
707
+ inputs: [
708
+ {
709
+ internalType: 'bytes',
710
+ name: 'data',
711
+ type: 'bytes',
712
+ },
713
+ ],
714
+ name: 'onInstall',
715
+ outputs: [],
716
+ stateMutability: 'nonpayable',
717
+ type: 'function',
718
+ },
719
+ {
720
+ inputs: [
721
+ {
722
+ internalType: 'bytes',
723
+ name: 'data',
724
+ type: 'bytes',
725
+ },
726
+ ],
727
+ name: 'onUninstall',
728
+ outputs: [],
729
+ stateMutability: 'nonpayable',
730
+ type: 'function',
731
+ },
732
+ {
733
+ inputs: [
734
+ {
735
+ internalType: 'bytes32',
736
+ name: 'sessionHash',
737
+ type: 'bytes32',
738
+ },
739
+ ],
740
+ name: 'revokeKey',
741
+ outputs: [],
742
+ stateMutability: 'nonpayable',
743
+ type: 'function',
744
+ },
745
+ {
746
+ inputs: [
747
+ {
748
+ internalType: 'bytes32[]',
749
+ name: 'sessionHashes',
750
+ type: 'bytes32[]',
751
+ },
752
+ ],
753
+ name: 'revokeKeys',
754
+ outputs: [],
755
+ stateMutability: 'nonpayable',
756
+ type: 'function',
757
+ },
758
+ {
759
+ inputs: [
760
+ {
761
+ internalType: 'address',
762
+ name: 'account',
763
+ type: 'address',
764
+ },
765
+ {
766
+ components: [
767
+ {
768
+ internalType: 'address',
769
+ name: 'signer',
770
+ type: 'address',
771
+ },
772
+ {
773
+ internalType: 'uint256',
774
+ name: 'expiresAt',
775
+ type: 'uint256',
776
+ },
777
+ {
778
+ components: [
779
+ {
780
+ internalType: 'enum SessionLib.LimitType',
781
+ name: 'limitType',
782
+ type: 'uint8',
783
+ },
784
+ {
785
+ internalType: 'uint256',
786
+ name: 'limit',
787
+ type: 'uint256',
788
+ },
789
+ {
790
+ internalType: 'uint256',
791
+ name: 'period',
792
+ type: 'uint256',
793
+ },
794
+ ],
795
+ internalType: 'struct SessionLib.UsageLimit',
796
+ name: 'feeLimit',
797
+ type: 'tuple',
798
+ },
799
+ {
800
+ components: [
801
+ {
802
+ internalType: 'address',
803
+ name: 'target',
804
+ type: 'address',
805
+ },
806
+ {
807
+ internalType: 'bytes4',
808
+ name: 'selector',
809
+ type: 'bytes4',
810
+ },
811
+ {
812
+ internalType: 'uint256',
813
+ name: 'maxValuePerUse',
814
+ type: 'uint256',
815
+ },
816
+ {
817
+ components: [
818
+ {
819
+ internalType: 'enum SessionLib.LimitType',
820
+ name: 'limitType',
821
+ type: 'uint8',
822
+ },
823
+ {
824
+ internalType: 'uint256',
825
+ name: 'limit',
826
+ type: 'uint256',
827
+ },
828
+ {
829
+ internalType: 'uint256',
830
+ name: 'period',
831
+ type: 'uint256',
832
+ },
833
+ ],
834
+ internalType: 'struct SessionLib.UsageLimit',
835
+ name: 'valueLimit',
836
+ type: 'tuple',
837
+ },
838
+ {
839
+ components: [
840
+ {
841
+ internalType: 'enum SessionLib.Condition',
842
+ name: 'condition',
843
+ type: 'uint8',
844
+ },
845
+ {
846
+ internalType: 'uint64',
847
+ name: 'index',
848
+ type: 'uint64',
849
+ },
850
+ {
851
+ internalType: 'bytes32',
852
+ name: 'refValue',
853
+ type: 'bytes32',
854
+ },
855
+ {
856
+ components: [
857
+ {
858
+ internalType: 'enum SessionLib.LimitType',
859
+ name: 'limitType',
860
+ type: 'uint8',
861
+ },
862
+ {
863
+ internalType: 'uint256',
864
+ name: 'limit',
865
+ type: 'uint256',
866
+ },
867
+ {
868
+ internalType: 'uint256',
869
+ name: 'period',
870
+ type: 'uint256',
871
+ },
872
+ ],
873
+ internalType: 'struct SessionLib.UsageLimit',
874
+ name: 'limit',
875
+ type: 'tuple',
876
+ },
877
+ ],
878
+ internalType: 'struct SessionLib.Constraint[]',
879
+ name: 'constraints',
880
+ type: 'tuple[]',
881
+ },
882
+ ],
883
+ internalType: 'struct SessionLib.CallSpec[]',
884
+ name: 'callPolicies',
885
+ type: 'tuple[]',
886
+ },
887
+ {
888
+ components: [
889
+ {
890
+ internalType: 'address',
891
+ name: 'target',
892
+ type: 'address',
893
+ },
894
+ {
895
+ internalType: 'uint256',
896
+ name: 'maxValuePerUse',
897
+ type: 'uint256',
898
+ },
899
+ {
900
+ components: [
901
+ {
902
+ internalType: 'enum SessionLib.LimitType',
903
+ name: 'limitType',
904
+ type: 'uint8',
905
+ },
906
+ {
907
+ internalType: 'uint256',
908
+ name: 'limit',
909
+ type: 'uint256',
910
+ },
911
+ {
912
+ internalType: 'uint256',
913
+ name: 'period',
914
+ type: 'uint256',
915
+ },
916
+ ],
917
+ internalType: 'struct SessionLib.UsageLimit',
918
+ name: 'valueLimit',
919
+ type: 'tuple',
920
+ },
921
+ ],
922
+ internalType: 'struct SessionLib.TransferSpec[]',
923
+ name: 'transferPolicies',
924
+ type: 'tuple[]',
925
+ },
926
+ ],
927
+ internalType: 'struct SessionLib.SessionSpec',
928
+ name: 'spec',
929
+ type: 'tuple',
930
+ },
931
+ ],
932
+ name: 'sessionState',
933
+ outputs: [
934
+ {
935
+ components: [
936
+ {
937
+ internalType: 'enum SessionLib.Status',
938
+ name: 'status',
939
+ type: 'uint8',
940
+ },
941
+ {
942
+ internalType: 'uint256',
943
+ name: 'feesRemaining',
944
+ type: 'uint256',
945
+ },
946
+ {
947
+ components: [
948
+ {
949
+ internalType: 'uint256',
950
+ name: 'remaining',
951
+ type: 'uint256',
952
+ },
953
+ {
954
+ internalType: 'address',
955
+ name: 'target',
956
+ type: 'address',
957
+ },
958
+ {
959
+ internalType: 'bytes4',
960
+ name: 'selector',
961
+ type: 'bytes4',
962
+ },
963
+ {
964
+ internalType: 'uint256',
965
+ name: 'index',
966
+ type: 'uint256',
967
+ },
968
+ ],
969
+ internalType: 'struct SessionLib.LimitState[]',
970
+ name: 'transferValue',
971
+ type: 'tuple[]',
972
+ },
973
+ {
974
+ components: [
975
+ {
976
+ internalType: 'uint256',
977
+ name: 'remaining',
978
+ type: 'uint256',
979
+ },
980
+ {
981
+ internalType: 'address',
982
+ name: 'target',
983
+ type: 'address',
984
+ },
985
+ {
986
+ internalType: 'bytes4',
987
+ name: 'selector',
988
+ type: 'bytes4',
989
+ },
990
+ {
991
+ internalType: 'uint256',
992
+ name: 'index',
993
+ type: 'uint256',
994
+ },
995
+ ],
996
+ internalType: 'struct SessionLib.LimitState[]',
997
+ name: 'callValue',
998
+ type: 'tuple[]',
999
+ },
1000
+ {
1001
+ components: [
1002
+ {
1003
+ internalType: 'uint256',
1004
+ name: 'remaining',
1005
+ type: 'uint256',
1006
+ },
1007
+ {
1008
+ internalType: 'address',
1009
+ name: 'target',
1010
+ type: 'address',
1011
+ },
1012
+ {
1013
+ internalType: 'bytes4',
1014
+ name: 'selector',
1015
+ type: 'bytes4',
1016
+ },
1017
+ {
1018
+ internalType: 'uint256',
1019
+ name: 'index',
1020
+ type: 'uint256',
1021
+ },
1022
+ ],
1023
+ internalType: 'struct SessionLib.LimitState[]',
1024
+ name: 'callParams',
1025
+ type: 'tuple[]',
1026
+ },
1027
+ ],
1028
+ internalType: 'struct SessionLib.SessionState',
1029
+ name: '',
1030
+ type: 'tuple',
1031
+ },
1032
+ ],
1033
+ stateMutability: 'view',
1034
+ type: 'function',
1035
+ },
1036
+ {
1037
+ inputs: [
1038
+ {
1039
+ internalType: 'address',
1040
+ name: 'account',
1041
+ type: 'address',
1042
+ },
1043
+ {
1044
+ internalType: 'bytes32',
1045
+ name: 'sessionHash',
1046
+ type: 'bytes32',
1047
+ },
1048
+ ],
1049
+ name: 'sessionStatus',
1050
+ outputs: [
1051
+ {
1052
+ internalType: 'enum SessionLib.Status',
1053
+ name: '',
1054
+ type: 'uint8',
1055
+ },
1056
+ ],
1057
+ stateMutability: 'view',
1058
+ type: 'function',
1059
+ },
1060
+ {
1061
+ inputs: [
1062
+ {
1063
+ internalType: 'bytes4',
1064
+ name: 'interfaceId',
1065
+ type: 'bytes4',
1066
+ },
1067
+ ],
1068
+ name: 'supportsInterface',
1069
+ outputs: [
1070
+ {
1071
+ internalType: 'bool',
1072
+ name: '',
1073
+ type: 'bool',
1074
+ },
1075
+ ],
1076
+ stateMutability: 'pure',
1077
+ type: 'function',
1078
+ },
1079
+ {
1080
+ inputs: [
1081
+ {
1082
+ internalType: 'bytes32',
1083
+ name: '',
1084
+ type: 'bytes32',
1085
+ },
1086
+ {
1087
+ internalType: 'bytes',
1088
+ name: '',
1089
+ type: 'bytes',
1090
+ },
1091
+ ],
1092
+ name: 'validateSignature',
1093
+ outputs: [
1094
+ {
1095
+ internalType: 'bool',
1096
+ name: '',
1097
+ type: 'bool',
1098
+ },
1099
+ ],
1100
+ stateMutability: 'pure',
1101
+ type: 'function',
1102
+ },
1103
+ {
1104
+ inputs: [
1105
+ {
1106
+ internalType: 'bytes32',
1107
+ name: 'signedHash',
1108
+ type: 'bytes32',
1109
+ },
1110
+ {
1111
+ components: [
1112
+ {
1113
+ internalType: 'uint256',
1114
+ name: 'txType',
1115
+ type: 'uint256',
1116
+ },
1117
+ {
1118
+ internalType: 'uint256',
1119
+ name: 'from',
1120
+ type: 'uint256',
1121
+ },
1122
+ {
1123
+ internalType: 'uint256',
1124
+ name: 'to',
1125
+ type: 'uint256',
1126
+ },
1127
+ {
1128
+ internalType: 'uint256',
1129
+ name: 'gasLimit',
1130
+ type: 'uint256',
1131
+ },
1132
+ {
1133
+ internalType: 'uint256',
1134
+ name: 'gasPerPubdataByteLimit',
1135
+ type: 'uint256',
1136
+ },
1137
+ {
1138
+ internalType: 'uint256',
1139
+ name: 'maxFeePerGas',
1140
+ type: 'uint256',
1141
+ },
1142
+ {
1143
+ internalType: 'uint256',
1144
+ name: 'maxPriorityFeePerGas',
1145
+ type: 'uint256',
1146
+ },
1147
+ {
1148
+ internalType: 'uint256',
1149
+ name: 'paymaster',
1150
+ type: 'uint256',
1151
+ },
1152
+ {
1153
+ internalType: 'uint256',
1154
+ name: 'nonce',
1155
+ type: 'uint256',
1156
+ },
1157
+ {
1158
+ internalType: 'uint256',
1159
+ name: 'value',
1160
+ type: 'uint256',
1161
+ },
1162
+ {
1163
+ internalType: 'uint256[4]',
1164
+ name: 'reserved',
1165
+ type: 'uint256[4]',
1166
+ },
1167
+ {
1168
+ internalType: 'bytes',
1169
+ name: 'data',
1170
+ type: 'bytes',
1171
+ },
1172
+ {
1173
+ internalType: 'bytes',
1174
+ name: 'signature',
1175
+ type: 'bytes',
1176
+ },
1177
+ {
1178
+ internalType: 'bytes32[]',
1179
+ name: 'factoryDeps',
1180
+ type: 'bytes32[]',
1181
+ },
1182
+ {
1183
+ internalType: 'bytes',
1184
+ name: 'paymasterInput',
1185
+ type: 'bytes',
1186
+ },
1187
+ {
1188
+ internalType: 'bytes',
1189
+ name: 'reservedDynamic',
1190
+ type: 'bytes',
1191
+ },
1192
+ ],
1193
+ internalType: 'struct Transaction',
1194
+ name: 'transaction',
1195
+ type: 'tuple',
1196
+ },
1197
+ ],
1198
+ name: 'validateTransaction',
1199
+ outputs: [
1200
+ {
1201
+ internalType: 'bool',
1202
+ name: '',
1203
+ type: 'bool',
1204
+ },
1205
+ ],
1206
+ stateMutability: 'nonpayable',
1207
+ type: 'function',
1208
+ },
1209
+ ];
1210
+
1211
+ export { SessionKeyValidatorAbi, createSession, revokeSession, zksyncSsoEcdsaActions };