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