@gitmyabi/trustedexecutionrouterhorizonkeystonevantage 1.0.0

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.
@@ -0,0 +1,816 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+
5
+ /**
6
+ * TrustedExecutionRouterHorizonKeystoneVantage.Call struct type
7
+ */
8
+ export type TrustedExecutionRouterHorizonKeystoneVantage_Call = {
9
+ target: `0x${string}`;
10
+ allowFailure: boolean;
11
+ callData: `0x${string}`;
12
+ };
13
+
14
+ /**
15
+ * TrustedExecutionRouterHorizonKeystoneVantage.Result struct type
16
+ */
17
+ export type TrustedExecutionRouterHorizonKeystoneVantage_Result = {
18
+ success: boolean;
19
+ returnData: `0x${string}`;
20
+ };
21
+ /**
22
+ * TrustedExecutionRouterHorizonKeystoneVantage_json ABI
23
+ *
24
+ * This ABI is typed using viem's type system for full type safety.
25
+ */
26
+ export const TrustedExecutionRouterHorizonKeystoneVantage_jsonAbi = [
27
+ {
28
+ "anonymous": false,
29
+ "inputs": [
30
+ {
31
+ "indexed": true,
32
+ "internalType": "address",
33
+ "name": "caller",
34
+ "type": "address"
35
+ },
36
+ {
37
+ "indexed": false,
38
+ "internalType": "bool",
39
+ "name": "isAllowed",
40
+ "type": "bool"
41
+ }
42
+ ],
43
+ "name": "AllowedCallerChanged",
44
+ "type": "event"
45
+ },
46
+ {
47
+ "anonymous": false,
48
+ "inputs": [
49
+ {
50
+ "indexed": true,
51
+ "internalType": "address",
52
+ "name": "previousOwner",
53
+ "type": "address"
54
+ },
55
+ {
56
+ "indexed": true,
57
+ "internalType": "address",
58
+ "name": "newOwner",
59
+ "type": "address"
60
+ }
61
+ ],
62
+ "name": "OwnershipTransferred",
63
+ "type": "event"
64
+ },
65
+ {
66
+ "inputs": [
67
+ {
68
+ "internalType": "address",
69
+ "name": "caller",
70
+ "type": "address"
71
+ }
72
+ ],
73
+ "name": "addAllowedCaller",
74
+ "outputs": [],
75
+ "stateMutability": "nonpayable",
76
+ "type": "function"
77
+ },
78
+ {
79
+ "inputs": [
80
+ {
81
+ "internalType": "uint256",
82
+ "name": "blockNumber",
83
+ "type": "uint256"
84
+ }
85
+ ],
86
+ "name": "getBlockHash",
87
+ "outputs": [
88
+ {
89
+ "internalType": "bytes32",
90
+ "name": "blockHash",
91
+ "type": "bytes32"
92
+ }
93
+ ],
94
+ "stateMutability": "view",
95
+ "type": "function"
96
+ },
97
+ {
98
+ "inputs": [],
99
+ "name": "getBlockNumber",
100
+ "outputs": [
101
+ {
102
+ "internalType": "uint256",
103
+ "name": "blockNumber",
104
+ "type": "uint256"
105
+ }
106
+ ],
107
+ "stateMutability": "view",
108
+ "type": "function"
109
+ },
110
+ {
111
+ "inputs": [],
112
+ "name": "getChainId",
113
+ "outputs": [
114
+ {
115
+ "internalType": "uint256",
116
+ "name": "chainid",
117
+ "type": "uint256"
118
+ }
119
+ ],
120
+ "stateMutability": "view",
121
+ "type": "function"
122
+ },
123
+ {
124
+ "inputs": [],
125
+ "name": "getCurrentBlockTimestamp",
126
+ "outputs": [
127
+ {
128
+ "internalType": "uint256",
129
+ "name": "timestamp",
130
+ "type": "uint256"
131
+ }
132
+ ],
133
+ "stateMutability": "view",
134
+ "type": "function"
135
+ },
136
+ {
137
+ "inputs": [
138
+ {
139
+ "internalType": "address",
140
+ "name": "addr",
141
+ "type": "address"
142
+ }
143
+ ],
144
+ "name": "getEthBalance",
145
+ "outputs": [
146
+ {
147
+ "internalType": "uint256",
148
+ "name": "balance",
149
+ "type": "uint256"
150
+ }
151
+ ],
152
+ "stateMutability": "view",
153
+ "type": "function"
154
+ },
155
+ {
156
+ "inputs": [
157
+ {
158
+ "internalType": "address",
159
+ "name": "caller",
160
+ "type": "address"
161
+ }
162
+ ],
163
+ "name": "isAllowed",
164
+ "outputs": [
165
+ {
166
+ "internalType": "bool",
167
+ "name": "",
168
+ "type": "bool"
169
+ }
170
+ ],
171
+ "stateMutability": "view",
172
+ "type": "function"
173
+ },
174
+ {
175
+ "inputs": [
176
+ {
177
+ "components": [
178
+ {
179
+ "internalType": "address",
180
+ "name": "target",
181
+ "type": "address"
182
+ },
183
+ {
184
+ "internalType": "bool",
185
+ "name": "allowFailure",
186
+ "type": "bool"
187
+ },
188
+ {
189
+ "internalType": "bytes",
190
+ "name": "callData",
191
+ "type": "bytes"
192
+ }
193
+ ],
194
+ "internalType": "struct TrustedExecutionRouterHorizonKeystoneVantage.Call[]",
195
+ "name": "calls",
196
+ "type": "tuple[]"
197
+ }
198
+ ],
199
+ "name": "multicall",
200
+ "outputs": [
201
+ {
202
+ "components": [
203
+ {
204
+ "internalType": "bool",
205
+ "name": "success",
206
+ "type": "bool"
207
+ },
208
+ {
209
+ "internalType": "bytes",
210
+ "name": "returnData",
211
+ "type": "bytes"
212
+ }
213
+ ],
214
+ "internalType": "struct TrustedExecutionRouterHorizonKeystoneVantage.Result[]",
215
+ "name": "returnData",
216
+ "type": "tuple[]"
217
+ }
218
+ ],
219
+ "stateMutability": "payable",
220
+ "type": "function"
221
+ },
222
+ {
223
+ "inputs": [],
224
+ "name": "owner",
225
+ "outputs": [
226
+ {
227
+ "internalType": "address",
228
+ "name": "",
229
+ "type": "address"
230
+ }
231
+ ],
232
+ "stateMutability": "view",
233
+ "type": "function"
234
+ },
235
+ {
236
+ "inputs": [],
237
+ "name": "relayContextHorizonKeystoneVantage",
238
+ "outputs": [
239
+ {
240
+ "internalType": "bytes32",
241
+ "name": "profile",
242
+ "type": "bytes32"
243
+ }
244
+ ],
245
+ "stateMutability": "pure",
246
+ "type": "function"
247
+ },
248
+ {
249
+ "inputs": [
250
+ {
251
+ "internalType": "address",
252
+ "name": "caller",
253
+ "type": "address"
254
+ }
255
+ ],
256
+ "name": "removeAllowedCaller",
257
+ "outputs": [],
258
+ "stateMutability": "nonpayable",
259
+ "type": "function"
260
+ },
261
+ {
262
+ "inputs": [],
263
+ "name": "renounceOwnership",
264
+ "outputs": [],
265
+ "stateMutability": "nonpayable",
266
+ "type": "function"
267
+ },
268
+ {
269
+ "inputs": [
270
+ {
271
+ "internalType": "address",
272
+ "name": "newOwner",
273
+ "type": "address"
274
+ }
275
+ ],
276
+ "name": "transferOwnership",
277
+ "outputs": [],
278
+ "stateMutability": "nonpayable",
279
+ "type": "function"
280
+ },
281
+ {
282
+ "inputs": [],
283
+ "name": "withdrawETH",
284
+ "outputs": [],
285
+ "stateMutability": "nonpayable",
286
+ "type": "function"
287
+ },
288
+ {
289
+ "inputs": [
290
+ {
291
+ "internalType": "address",
292
+ "name": "tokenAddress",
293
+ "type": "address"
294
+ }
295
+ ],
296
+ "name": "withdrawTokens",
297
+ "outputs": [],
298
+ "stateMutability": "nonpayable",
299
+ "type": "function"
300
+ }
301
+ ] as const satisfies Abi;
302
+
303
+ /**
304
+ * Type-safe ABI for TrustedExecutionRouterHorizonKeystoneVantage_json
305
+ */
306
+ export type TrustedExecutionRouterHorizonKeystoneVantage_jsonAbi = typeof TrustedExecutionRouterHorizonKeystoneVantage_jsonAbi;
307
+
308
+ /**
309
+ * Contract instance type for TrustedExecutionRouterHorizonKeystoneVantage_json
310
+ */
311
+ // Use any for contract type to avoid complex viem type issues
312
+ // The runtime behavior is type-safe through viem's ABI typing
313
+ export type TrustedExecutionRouterHorizonKeystoneVantage_jsonContract = any;
314
+
315
+ /**
316
+ * TrustedExecutionRouterHorizonKeystoneVantage_json Contract Class
317
+ *
318
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
319
+ *
320
+ * @example
321
+ * ```typescript
322
+ * import { createPublicClient, createWalletClient, http } from 'viem';
323
+ * import { mainnet } from 'viem/chains';
324
+ * import { TrustedExecutionRouterHorizonKeystoneVantage_json } from 'TrustedExecutionRouterHorizonKeystoneVantage_json';
325
+ *
326
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
327
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
328
+ *
329
+ * const contract = new TrustedExecutionRouterHorizonKeystoneVantage_json('0x...', { publicClient, walletClient });
330
+ *
331
+ * // Read functions
332
+ * const result = await contract.balanceOf('0x...');
333
+ *
334
+ * // Write functions
335
+ * const hash = await contract.transfer('0x...', 1000n);
336
+ *
337
+ * // Simulate transactions (dry-run)
338
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
339
+ * console.log('Gas estimate:', simulation.request.gas);
340
+ *
341
+ * // Watch events
342
+ * const unwatch = contract.watch.Transfer((event) => {
343
+ * console.log('Transfer event:', event);
344
+ * });
345
+ * ```
346
+ */
347
+ export class TrustedExecutionRouterHorizonKeystoneVantage_json {
348
+ private contract: TrustedExecutionRouterHorizonKeystoneVantage_jsonContract;
349
+ private contractAddress: Address;
350
+ private publicClient: PublicClient;
351
+
352
+ constructor(
353
+ address: Address,
354
+ clients: {
355
+ publicClient: PublicClient;
356
+ walletClient?: WalletClient;
357
+ }
358
+ ) {
359
+ this.contractAddress = address;
360
+ this.publicClient = clients.publicClient;
361
+ this.contract = getContract({
362
+ address,
363
+ abi: TrustedExecutionRouterHorizonKeystoneVantage_jsonAbi,
364
+ client: {
365
+ public: clients.publicClient,
366
+ wallet: clients.walletClient,
367
+ },
368
+ });
369
+ }
370
+
371
+ /**
372
+ * Get the contract address
373
+ */
374
+ get address(): Address {
375
+ return this.contractAddress;
376
+ }
377
+
378
+ /**
379
+ * Get the underlying viem contract instance
380
+ */
381
+ getContract(): TrustedExecutionRouterHorizonKeystoneVantage_jsonContract {
382
+ return this.contract;
383
+ }
384
+
385
+ /**
386
+ * getBlockHash
387
+ * view
388
+ */
389
+ async getBlockHash(blockNumber: bigint): Promise<`0x${string}`> {
390
+ return this.contract.read.getBlockHash([blockNumber] as const) as Promise<`0x${string}`>;
391
+ }
392
+
393
+ /**
394
+ * getBlockNumber
395
+ * view
396
+ */
397
+ async getBlockNumber(): Promise<bigint> {
398
+ return this.contract.read.getBlockNumber() as Promise<bigint>;
399
+ }
400
+
401
+ /**
402
+ * getChainId
403
+ * view
404
+ */
405
+ async getChainId(): Promise<bigint> {
406
+ return this.contract.read.getChainId() as Promise<bigint>;
407
+ }
408
+
409
+ /**
410
+ * getCurrentBlockTimestamp
411
+ * view
412
+ */
413
+ async getCurrentBlockTimestamp(): Promise<bigint> {
414
+ return this.contract.read.getCurrentBlockTimestamp() as Promise<bigint>;
415
+ }
416
+
417
+ /**
418
+ * getEthBalance
419
+ * view
420
+ */
421
+ async getEthBalance(addr: `0x${string}`): Promise<bigint> {
422
+ return this.contract.read.getEthBalance([addr] as const) as Promise<bigint>;
423
+ }
424
+
425
+ /**
426
+ * isAllowed
427
+ * view
428
+ */
429
+ async isAllowed(caller: `0x${string}`): Promise<boolean> {
430
+ return this.contract.read.isAllowed([caller] as const) as Promise<boolean>;
431
+ }
432
+
433
+ /**
434
+ * owner
435
+ * view
436
+ */
437
+ async owner(): Promise<`0x${string}`> {
438
+ return this.contract.read.owner() as Promise<`0x${string}`>;
439
+ }
440
+
441
+ /**
442
+ * relayContextHorizonKeystoneVantage
443
+ * pure
444
+ */
445
+ async relayContextHorizonKeystoneVantage(): Promise<`0x${string}`> {
446
+ return this.contract.read.relayContextHorizonKeystoneVantage() as Promise<`0x${string}`>;
447
+ }
448
+
449
+ /**
450
+ * addAllowedCaller
451
+ * nonpayable
452
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
453
+ */
454
+ async addAllowedCaller(caller: `0x${string}`, options?: {
455
+ accessList?: import('viem').AccessList;
456
+ authorizationList?: import('viem').AuthorizationList;
457
+ chain?: import('viem').Chain | null;
458
+ dataSuffix?: `0x${string}`;
459
+ gas?: bigint;
460
+ gasPrice?: bigint;
461
+ maxFeePerGas?: bigint;
462
+ maxPriorityFeePerGas?: bigint;
463
+ nonce?: number;
464
+ value?: bigint;
465
+ }): Promise<`0x${string}`> {
466
+ if (!this.contract.write) {
467
+ throw new Error('Wallet client is required for write operations');
468
+ }
469
+ return this.contract.write.addAllowedCaller([caller] as const, options) as Promise<`0x${string}`>;
470
+ }
471
+
472
+ /**
473
+ * multicall
474
+ * payable
475
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
476
+ */
477
+ async multicall(calls: TrustedExecutionRouterHorizonKeystoneVantage_Call[], options?: {
478
+ accessList?: import('viem').AccessList;
479
+ authorizationList?: import('viem').AuthorizationList;
480
+ chain?: import('viem').Chain | null;
481
+ dataSuffix?: `0x${string}`;
482
+ gas?: bigint;
483
+ gasPrice?: bigint;
484
+ maxFeePerGas?: bigint;
485
+ maxPriorityFeePerGas?: bigint;
486
+ nonce?: number;
487
+ value?: bigint;
488
+ }): Promise<`0x${string}`> {
489
+ if (!this.contract.write) {
490
+ throw new Error('Wallet client is required for write operations');
491
+ }
492
+ return this.contract.write.multicall([calls] as const, options) as Promise<`0x${string}`>;
493
+ }
494
+
495
+ /**
496
+ * removeAllowedCaller
497
+ * nonpayable
498
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
499
+ */
500
+ async removeAllowedCaller(caller: `0x${string}`, options?: {
501
+ accessList?: import('viem').AccessList;
502
+ authorizationList?: import('viem').AuthorizationList;
503
+ chain?: import('viem').Chain | null;
504
+ dataSuffix?: `0x${string}`;
505
+ gas?: bigint;
506
+ gasPrice?: bigint;
507
+ maxFeePerGas?: bigint;
508
+ maxPriorityFeePerGas?: bigint;
509
+ nonce?: number;
510
+ value?: bigint;
511
+ }): Promise<`0x${string}`> {
512
+ if (!this.contract.write) {
513
+ throw new Error('Wallet client is required for write operations');
514
+ }
515
+ return this.contract.write.removeAllowedCaller([caller] as const, options) as Promise<`0x${string}`>;
516
+ }
517
+
518
+ /**
519
+ * renounceOwnership
520
+ * nonpayable
521
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
522
+ */
523
+ async renounceOwnership(options?: {
524
+ accessList?: import('viem').AccessList;
525
+ authorizationList?: import('viem').AuthorizationList;
526
+ chain?: import('viem').Chain | null;
527
+ dataSuffix?: `0x${string}`;
528
+ gas?: bigint;
529
+ gasPrice?: bigint;
530
+ maxFeePerGas?: bigint;
531
+ maxPriorityFeePerGas?: bigint;
532
+ nonce?: number;
533
+ value?: bigint;
534
+ }): Promise<`0x${string}`> {
535
+ if (!this.contract.write) {
536
+ throw new Error('Wallet client is required for write operations');
537
+ }
538
+ return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
539
+ }
540
+
541
+ /**
542
+ * transferOwnership
543
+ * nonpayable
544
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
545
+ */
546
+ async transferOwnership(newOwner: `0x${string}`, options?: {
547
+ accessList?: import('viem').AccessList;
548
+ authorizationList?: import('viem').AuthorizationList;
549
+ chain?: import('viem').Chain | null;
550
+ dataSuffix?: `0x${string}`;
551
+ gas?: bigint;
552
+ gasPrice?: bigint;
553
+ maxFeePerGas?: bigint;
554
+ maxPriorityFeePerGas?: bigint;
555
+ nonce?: number;
556
+ value?: bigint;
557
+ }): Promise<`0x${string}`> {
558
+ if (!this.contract.write) {
559
+ throw new Error('Wallet client is required for write operations');
560
+ }
561
+ return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
562
+ }
563
+
564
+ /**
565
+ * withdrawETH
566
+ * nonpayable
567
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
568
+ */
569
+ async withdrawETH(options?: {
570
+ accessList?: import('viem').AccessList;
571
+ authorizationList?: import('viem').AuthorizationList;
572
+ chain?: import('viem').Chain | null;
573
+ dataSuffix?: `0x${string}`;
574
+ gas?: bigint;
575
+ gasPrice?: bigint;
576
+ maxFeePerGas?: bigint;
577
+ maxPriorityFeePerGas?: bigint;
578
+ nonce?: number;
579
+ value?: bigint;
580
+ }): Promise<`0x${string}`> {
581
+ if (!this.contract.write) {
582
+ throw new Error('Wallet client is required for write operations');
583
+ }
584
+ return this.contract.write.withdrawETH(options) as Promise<`0x${string}`>;
585
+ }
586
+
587
+ /**
588
+ * withdrawTokens
589
+ * nonpayable
590
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
591
+ */
592
+ async withdrawTokens(tokenAddress: `0x${string}`, options?: {
593
+ accessList?: import('viem').AccessList;
594
+ authorizationList?: import('viem').AuthorizationList;
595
+ chain?: import('viem').Chain | null;
596
+ dataSuffix?: `0x${string}`;
597
+ gas?: bigint;
598
+ gasPrice?: bigint;
599
+ maxFeePerGas?: bigint;
600
+ maxPriorityFeePerGas?: bigint;
601
+ nonce?: number;
602
+ value?: bigint;
603
+ }): Promise<`0x${string}`> {
604
+ if (!this.contract.write) {
605
+ throw new Error('Wallet client is required for write operations');
606
+ }
607
+ return this.contract.write.withdrawTokens([tokenAddress] as const, options) as Promise<`0x${string}`>;
608
+ }
609
+
610
+
611
+
612
+ /**
613
+ * Simulate contract write operations (dry-run without sending transaction)
614
+ *
615
+ * @example
616
+ * const result = await contract.simulate.transfer('0x...', 1000n);
617
+ * console.log('Gas estimate:', result.request.gas);
618
+ * console.log('Would succeed:', result.result);
619
+ */
620
+ get simulate() {
621
+ const contract = this.contract;
622
+ if (!contract.simulate) {
623
+ throw new Error('Public client is required for simulation');
624
+ }
625
+ return {
626
+ /**
627
+ * Simulate addAllowedCaller
628
+ * Returns gas estimate and result without sending transaction
629
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
630
+ */
631
+ async addAllowedCaller(caller: `0x${string}`, options?: {
632
+ accessList?: import('viem').AccessList;
633
+ authorizationList?: import('viem').AuthorizationList;
634
+ chain?: import('viem').Chain | null;
635
+ dataSuffix?: `0x${string}`;
636
+ gas?: bigint;
637
+ gasPrice?: bigint;
638
+ maxFeePerGas?: bigint;
639
+ maxPriorityFeePerGas?: bigint;
640
+ nonce?: number;
641
+ value?: bigint;
642
+ }): Promise<void> {
643
+ return contract.simulate.addAllowedCaller([caller] as const, options) as Promise<void>;
644
+ },
645
+ /**
646
+ * Simulate multicall
647
+ * Returns gas estimate and result without sending transaction
648
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
649
+ */
650
+ async multicall(calls: TrustedExecutionRouterHorizonKeystoneVantage_Call[], options?: {
651
+ accessList?: import('viem').AccessList;
652
+ authorizationList?: import('viem').AuthorizationList;
653
+ chain?: import('viem').Chain | null;
654
+ dataSuffix?: `0x${string}`;
655
+ gas?: bigint;
656
+ gasPrice?: bigint;
657
+ maxFeePerGas?: bigint;
658
+ maxPriorityFeePerGas?: bigint;
659
+ nonce?: number;
660
+ value?: bigint;
661
+ }): Promise<TrustedExecutionRouterHorizonKeystoneVantage_Result[]> {
662
+ return contract.simulate.multicall([calls] as const, options) as Promise<TrustedExecutionRouterHorizonKeystoneVantage_Result[]>;
663
+ },
664
+ /**
665
+ * Simulate removeAllowedCaller
666
+ * Returns gas estimate and result without sending transaction
667
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
668
+ */
669
+ async removeAllowedCaller(caller: `0x${string}`, options?: {
670
+ accessList?: import('viem').AccessList;
671
+ authorizationList?: import('viem').AuthorizationList;
672
+ chain?: import('viem').Chain | null;
673
+ dataSuffix?: `0x${string}`;
674
+ gas?: bigint;
675
+ gasPrice?: bigint;
676
+ maxFeePerGas?: bigint;
677
+ maxPriorityFeePerGas?: bigint;
678
+ nonce?: number;
679
+ value?: bigint;
680
+ }): Promise<void> {
681
+ return contract.simulate.removeAllowedCaller([caller] as const, options) as Promise<void>;
682
+ },
683
+ /**
684
+ * Simulate renounceOwnership
685
+ * Returns gas estimate and result without sending transaction
686
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
687
+ */
688
+ async renounceOwnership(options?: {
689
+ accessList?: import('viem').AccessList;
690
+ authorizationList?: import('viem').AuthorizationList;
691
+ chain?: import('viem').Chain | null;
692
+ dataSuffix?: `0x${string}`;
693
+ gas?: bigint;
694
+ gasPrice?: bigint;
695
+ maxFeePerGas?: bigint;
696
+ maxPriorityFeePerGas?: bigint;
697
+ nonce?: number;
698
+ value?: bigint;
699
+ }): Promise<void> {
700
+ return contract.simulate.renounceOwnership(options) as Promise<void>;
701
+ },
702
+ /**
703
+ * Simulate transferOwnership
704
+ * Returns gas estimate and result without sending transaction
705
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
706
+ */
707
+ async transferOwnership(newOwner: `0x${string}`, options?: {
708
+ accessList?: import('viem').AccessList;
709
+ authorizationList?: import('viem').AuthorizationList;
710
+ chain?: import('viem').Chain | null;
711
+ dataSuffix?: `0x${string}`;
712
+ gas?: bigint;
713
+ gasPrice?: bigint;
714
+ maxFeePerGas?: bigint;
715
+ maxPriorityFeePerGas?: bigint;
716
+ nonce?: number;
717
+ value?: bigint;
718
+ }): Promise<void> {
719
+ return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
720
+ },
721
+ /**
722
+ * Simulate withdrawETH
723
+ * Returns gas estimate and result without sending transaction
724
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
725
+ */
726
+ async withdrawETH(options?: {
727
+ accessList?: import('viem').AccessList;
728
+ authorizationList?: import('viem').AuthorizationList;
729
+ chain?: import('viem').Chain | null;
730
+ dataSuffix?: `0x${string}`;
731
+ gas?: bigint;
732
+ gasPrice?: bigint;
733
+ maxFeePerGas?: bigint;
734
+ maxPriorityFeePerGas?: bigint;
735
+ nonce?: number;
736
+ value?: bigint;
737
+ }): Promise<void> {
738
+ return contract.simulate.withdrawETH(options) as Promise<void>;
739
+ },
740
+ /**
741
+ * Simulate withdrawTokens
742
+ * Returns gas estimate and result without sending transaction
743
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
744
+ */
745
+ async withdrawTokens(tokenAddress: `0x${string}`, options?: {
746
+ accessList?: import('viem').AccessList;
747
+ authorizationList?: import('viem').AuthorizationList;
748
+ chain?: import('viem').Chain | null;
749
+ dataSuffix?: `0x${string}`;
750
+ gas?: bigint;
751
+ gasPrice?: bigint;
752
+ maxFeePerGas?: bigint;
753
+ maxPriorityFeePerGas?: bigint;
754
+ nonce?: number;
755
+ value?: bigint;
756
+ }): Promise<void> {
757
+ return contract.simulate.withdrawTokens([tokenAddress] as const, options) as Promise<void>;
758
+ }
759
+ };
760
+ }
761
+
762
+ /**
763
+ * Watch contract events
764
+ *
765
+ * @example
766
+ * // Watch all Transfer events
767
+ * const unwatch = contract.watch.Transfer((event) => {
768
+ * console.log('Transfer:', event);
769
+ * });
770
+ *
771
+ * // Stop watching
772
+ * unwatch();
773
+ */
774
+ get watch() {
775
+ return {
776
+ /**
777
+ * Watch AllowedCallerChanged events
778
+ * @param callback Function to call when event is emitted
779
+ * @param filter Optional filter for indexed parameters
780
+ * @returns Unwatch function to stop listening
781
+ */
782
+ AllowedCallerChanged: (callback: (event: { caller: `0x${string}`; isAllowed: boolean }) => void, filter?: { caller: `0x${string}` }) => {
783
+ return this.publicClient.watchContractEvent({
784
+ address: this.contractAddress,
785
+ abi: TrustedExecutionRouterHorizonKeystoneVantage_jsonAbi,
786
+ eventName: 'AllowedCallerChanged',
787
+ args: filter,
788
+ onLogs: (logs: any[]) => {
789
+ logs.forEach((log: any) => {
790
+ callback(log.args as any);
791
+ });
792
+ },
793
+ }) as () => void;
794
+ },
795
+ /**
796
+ * Watch OwnershipTransferred events
797
+ * @param callback Function to call when event is emitted
798
+ * @param filter Optional filter for indexed parameters
799
+ * @returns Unwatch function to stop listening
800
+ */
801
+ OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => {
802
+ return this.publicClient.watchContractEvent({
803
+ address: this.contractAddress,
804
+ abi: TrustedExecutionRouterHorizonKeystoneVantage_jsonAbi,
805
+ eventName: 'OwnershipTransferred',
806
+ args: filter,
807
+ onLogs: (logs: any[]) => {
808
+ logs.forEach((log: any) => {
809
+ callback(log.args as any);
810
+ });
811
+ },
812
+ }) as () => void;
813
+ }
814
+ };
815
+ }
816
+ }