@gitmyabi/fellowshipdutchauction 0.0.0-stage → 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,1455 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+
5
+ /**
6
+ * AuctionStageConfiguration struct type
7
+ */
8
+ export type AuctionStageConfiguration = {
9
+ priceDropPerSlot: bigint;
10
+ endPrice: bigint;
11
+ };
12
+ /**
13
+ * FellowshipDutchAuction ABI
14
+ *
15
+ * This ABI is typed using viem's type system for full type safety.
16
+ */
17
+ export const FellowshipDutchAuctionAbi = [
18
+ {
19
+ "inputs": [
20
+ {
21
+ "internalType": "address",
22
+ "name": "tokenContract_",
23
+ "type": "address"
24
+ },
25
+ {
26
+ "internalType": "uint256",
27
+ "name": "startTime_",
28
+ "type": "uint256"
29
+ },
30
+ {
31
+ "internalType": "uint256",
32
+ "name": "startPrice_",
33
+ "type": "uint256"
34
+ },
35
+ {
36
+ "internalType": "uint256",
37
+ "name": "earlyPriceDrop",
38
+ "type": "uint256"
39
+ },
40
+ {
41
+ "internalType": "uint256",
42
+ "name": "transitionPrice",
43
+ "type": "uint256"
44
+ },
45
+ {
46
+ "internalType": "uint256",
47
+ "name": "latePriceDrop",
48
+ "type": "uint256"
49
+ },
50
+ {
51
+ "internalType": "uint256",
52
+ "name": "restPrice",
53
+ "type": "uint256"
54
+ },
55
+ {
56
+ "internalType": "uint256",
57
+ "name": "earlyAccessDuration_",
58
+ "type": "uint256"
59
+ },
60
+ {
61
+ "internalType": "uint16[]",
62
+ "name": "shufflerConfig",
63
+ "type": "uint16[]"
64
+ }
65
+ ],
66
+ "stateMutability": "nonpayable",
67
+ "type": "constructor"
68
+ },
69
+ {
70
+ "inputs": [],
71
+ "name": "AlreadyStarted",
72
+ "type": "error"
73
+ },
74
+ {
75
+ "inputs": [],
76
+ "name": "ContractIsPaused",
77
+ "type": "error"
78
+ },
79
+ {
80
+ "inputs": [],
81
+ "name": "ContractNotPaused",
82
+ "type": "error"
83
+ },
84
+ {
85
+ "inputs": [],
86
+ "name": "EarlyAccessWithoutPass",
87
+ "type": "error"
88
+ },
89
+ {
90
+ "inputs": [
91
+ {
92
+ "internalType": "uint256",
93
+ "name": "amount",
94
+ "type": "uint256"
95
+ },
96
+ {
97
+ "internalType": "bytes",
98
+ "name": "data",
99
+ "type": "bytes"
100
+ }
101
+ ],
102
+ "name": "FailedWithdraw",
103
+ "type": "error"
104
+ },
105
+ {
106
+ "inputs": [],
107
+ "name": "NotYetStarted",
108
+ "type": "error"
109
+ },
110
+ {
111
+ "inputs": [],
112
+ "name": "SoldOut",
113
+ "type": "error"
114
+ },
115
+ {
116
+ "anonymous": false,
117
+ "inputs": [
118
+ {
119
+ "indexed": true,
120
+ "internalType": "address",
121
+ "name": "previousOwner",
122
+ "type": "address"
123
+ },
124
+ {
125
+ "indexed": true,
126
+ "internalType": "address",
127
+ "name": "newOwner",
128
+ "type": "address"
129
+ }
130
+ ],
131
+ "name": "OwnershipTransferred",
132
+ "type": "event"
133
+ },
134
+ {
135
+ "anonymous": false,
136
+ "inputs": [],
137
+ "name": "Paused",
138
+ "type": "event"
139
+ },
140
+ {
141
+ "anonymous": false,
142
+ "inputs": [
143
+ {
144
+ "indexed": false,
145
+ "internalType": "address",
146
+ "name": "purchaser",
147
+ "type": "address"
148
+ },
149
+ {
150
+ "indexed": false,
151
+ "internalType": "uint256",
152
+ "name": "tokenId",
153
+ "type": "uint256"
154
+ },
155
+ {
156
+ "indexed": false,
157
+ "internalType": "uint256",
158
+ "name": "price",
159
+ "type": "uint256"
160
+ }
161
+ ],
162
+ "name": "Purchase",
163
+ "type": "event"
164
+ },
165
+ {
166
+ "anonymous": false,
167
+ "inputs": [
168
+ {
169
+ "indexed": false,
170
+ "internalType": "address",
171
+ "name": "recipient",
172
+ "type": "address"
173
+ },
174
+ {
175
+ "indexed": false,
176
+ "internalType": "uint256",
177
+ "name": "amount",
178
+ "type": "uint256"
179
+ }
180
+ ],
181
+ "name": "Refund",
182
+ "type": "event"
183
+ },
184
+ {
185
+ "anonymous": false,
186
+ "inputs": [
187
+ {
188
+ "indexed": false,
189
+ "internalType": "address",
190
+ "name": "recipient",
191
+ "type": "address"
192
+ },
193
+ {
194
+ "indexed": false,
195
+ "internalType": "uint256",
196
+ "name": "quantity",
197
+ "type": "uint256"
198
+ },
199
+ {
200
+ "indexed": false,
201
+ "internalType": "uint256",
202
+ "name": "totalReserved",
203
+ "type": "uint256"
204
+ }
205
+ ],
206
+ "name": "Reservation",
207
+ "type": "event"
208
+ },
209
+ {
210
+ "anonymous": false,
211
+ "inputs": [],
212
+ "name": "Unpaused",
213
+ "type": "event"
214
+ },
215
+ {
216
+ "inputs": [
217
+ {
218
+ "internalType": "uint256",
219
+ "name": "",
220
+ "type": "uint256"
221
+ }
222
+ ],
223
+ "name": "auctionStages",
224
+ "outputs": [
225
+ {
226
+ "internalType": "uint256",
227
+ "name": "priceDropPerSlot",
228
+ "type": "uint256"
229
+ },
230
+ {
231
+ "internalType": "uint256",
232
+ "name": "endPrice",
233
+ "type": "uint256"
234
+ },
235
+ {
236
+ "internalType": "uint256",
237
+ "name": "duration",
238
+ "type": "uint256"
239
+ }
240
+ ],
241
+ "stateMutability": "view",
242
+ "type": "function"
243
+ },
244
+ {
245
+ "inputs": [],
246
+ "name": "currentPrice",
247
+ "outputs": [
248
+ {
249
+ "internalType": "uint256",
250
+ "name": "price",
251
+ "type": "uint256"
252
+ }
253
+ ],
254
+ "stateMutability": "view",
255
+ "type": "function"
256
+ },
257
+ {
258
+ "inputs": [
259
+ {
260
+ "internalType": "address",
261
+ "name": "",
262
+ "type": "address"
263
+ }
264
+ ],
265
+ "name": "discountsCount",
266
+ "outputs": [
267
+ {
268
+ "internalType": "uint256",
269
+ "name": "",
270
+ "type": "uint256"
271
+ }
272
+ ],
273
+ "stateMutability": "view",
274
+ "type": "function"
275
+ },
276
+ {
277
+ "inputs": [],
278
+ "name": "earlyAccessDuration",
279
+ "outputs": [
280
+ {
281
+ "internalType": "uint256",
282
+ "name": "",
283
+ "type": "uint256"
284
+ }
285
+ ],
286
+ "stateMutability": "view",
287
+ "type": "function"
288
+ },
289
+ {
290
+ "inputs": [],
291
+ "name": "isPaused",
292
+ "outputs": [
293
+ {
294
+ "internalType": "bool",
295
+ "name": "",
296
+ "type": "bool"
297
+ }
298
+ ],
299
+ "stateMutability": "view",
300
+ "type": "function"
301
+ },
302
+ {
303
+ "inputs": [],
304
+ "name": "isPublic",
305
+ "outputs": [
306
+ {
307
+ "internalType": "bool",
308
+ "name": "",
309
+ "type": "bool"
310
+ }
311
+ ],
312
+ "stateMutability": "view",
313
+ "type": "function"
314
+ },
315
+ {
316
+ "inputs": [],
317
+ "name": "lowestPrice",
318
+ "outputs": [
319
+ {
320
+ "internalType": "uint256",
321
+ "name": "",
322
+ "type": "uint256"
323
+ }
324
+ ],
325
+ "stateMutability": "view",
326
+ "type": "function"
327
+ },
328
+ {
329
+ "inputs": [
330
+ {
331
+ "internalType": "address",
332
+ "name": "",
333
+ "type": "address"
334
+ }
335
+ ],
336
+ "name": "mintCount",
337
+ "outputs": [
338
+ {
339
+ "internalType": "uint256",
340
+ "name": "",
341
+ "type": "uint256"
342
+ }
343
+ ],
344
+ "stateMutability": "view",
345
+ "type": "function"
346
+ },
347
+ {
348
+ "inputs": [],
349
+ "name": "mintLimit",
350
+ "outputs": [
351
+ {
352
+ "internalType": "uint256",
353
+ "name": "",
354
+ "type": "uint256"
355
+ }
356
+ ],
357
+ "stateMutability": "view",
358
+ "type": "function"
359
+ },
360
+ {
361
+ "inputs": [
362
+ {
363
+ "internalType": "uint256",
364
+ "name": "quantity",
365
+ "type": "uint256"
366
+ }
367
+ ],
368
+ "name": "mintMultiple",
369
+ "outputs": [],
370
+ "stateMutability": "payable",
371
+ "type": "function"
372
+ },
373
+ {
374
+ "inputs": [
375
+ {
376
+ "internalType": "address",
377
+ "name": "",
378
+ "type": "address"
379
+ }
380
+ ],
381
+ "name": "mintPayment",
382
+ "outputs": [
383
+ {
384
+ "internalType": "uint256",
385
+ "name": "",
386
+ "type": "uint256"
387
+ }
388
+ ],
389
+ "stateMutability": "view",
390
+ "type": "function"
391
+ },
392
+ {
393
+ "inputs": [],
394
+ "name": "owner",
395
+ "outputs": [
396
+ {
397
+ "internalType": "address",
398
+ "name": "",
399
+ "type": "address"
400
+ }
401
+ ],
402
+ "stateMutability": "view",
403
+ "type": "function"
404
+ },
405
+ {
406
+ "inputs": [],
407
+ "name": "pause",
408
+ "outputs": [],
409
+ "stateMutability": "nonpayable",
410
+ "type": "function"
411
+ },
412
+ {
413
+ "inputs": [],
414
+ "name": "refund",
415
+ "outputs": [
416
+ {
417
+ "internalType": "uint256",
418
+ "name": "",
419
+ "type": "uint256"
420
+ }
421
+ ],
422
+ "stateMutability": "nonpayable",
423
+ "type": "function"
424
+ },
425
+ {
426
+ "inputs": [
427
+ {
428
+ "internalType": "address",
429
+ "name": "minter",
430
+ "type": "address"
431
+ }
432
+ ],
433
+ "name": "refundAvailable",
434
+ "outputs": [
435
+ {
436
+ "internalType": "uint256",
437
+ "name": "",
438
+ "type": "uint256"
439
+ }
440
+ ],
441
+ "stateMutability": "view",
442
+ "type": "function"
443
+ },
444
+ {
445
+ "inputs": [],
446
+ "name": "renounceOwnership",
447
+ "outputs": [],
448
+ "stateMutability": "nonpayable",
449
+ "type": "function"
450
+ },
451
+ {
452
+ "inputs": [
453
+ {
454
+ "internalType": "uint256",
455
+ "name": "duration",
456
+ "type": "uint256"
457
+ }
458
+ ],
459
+ "name": "setEarlyAccessDuration",
460
+ "outputs": [],
461
+ "stateMutability": "nonpayable",
462
+ "type": "function"
463
+ },
464
+ {
465
+ "inputs": [
466
+ {
467
+ "internalType": "address",
468
+ "name": "tokenContract_",
469
+ "type": "address"
470
+ }
471
+ ],
472
+ "name": "setMintable",
473
+ "outputs": [],
474
+ "stateMutability": "nonpayable",
475
+ "type": "function"
476
+ },
477
+ {
478
+ "inputs": [
479
+ {
480
+ "internalType": "uint256",
481
+ "name": "startPrice_",
482
+ "type": "uint256"
483
+ },
484
+ {
485
+ "components": [
486
+ {
487
+ "internalType": "uint256",
488
+ "name": "priceDropPerSlot",
489
+ "type": "uint256"
490
+ },
491
+ {
492
+ "internalType": "uint256",
493
+ "name": "endPrice",
494
+ "type": "uint256"
495
+ }
496
+ ],
497
+ "internalType": "struct AuctionStageConfiguration[]",
498
+ "name": "stages_",
499
+ "type": "tuple[]"
500
+ }
501
+ ],
502
+ "name": "setPricing",
503
+ "outputs": [],
504
+ "stateMutability": "nonpayable",
505
+ "type": "function"
506
+ },
507
+ {
508
+ "inputs": [
509
+ {
510
+ "internalType": "uint256",
511
+ "name": "startTime_",
512
+ "type": "uint256"
513
+ }
514
+ ],
515
+ "name": "setStartTime",
516
+ "outputs": [],
517
+ "stateMutability": "nonpayable",
518
+ "type": "function"
519
+ },
520
+ {
521
+ "inputs": [],
522
+ "name": "startPrice",
523
+ "outputs": [
524
+ {
525
+ "internalType": "uint256",
526
+ "name": "",
527
+ "type": "uint256"
528
+ }
529
+ ],
530
+ "stateMutability": "view",
531
+ "type": "function"
532
+ },
533
+ {
534
+ "inputs": [],
535
+ "name": "startTime",
536
+ "outputs": [
537
+ {
538
+ "internalType": "uint256",
539
+ "name": "",
540
+ "type": "uint256"
541
+ }
542
+ ],
543
+ "stateMutability": "view",
544
+ "type": "function"
545
+ },
546
+ {
547
+ "inputs": [
548
+ {
549
+ "internalType": "bytes4",
550
+ "name": "interfaceId",
551
+ "type": "bytes4"
552
+ }
553
+ ],
554
+ "name": "supportsInterface",
555
+ "outputs": [
556
+ {
557
+ "internalType": "bool",
558
+ "name": "",
559
+ "type": "bool"
560
+ }
561
+ ],
562
+ "stateMutability": "pure",
563
+ "type": "function"
564
+ },
565
+ {
566
+ "inputs": [],
567
+ "name": "tokenContract",
568
+ "outputs": [
569
+ {
570
+ "internalType": "address",
571
+ "name": "",
572
+ "type": "address"
573
+ }
574
+ ],
575
+ "stateMutability": "view",
576
+ "type": "function"
577
+ },
578
+ {
579
+ "inputs": [],
580
+ "name": "totalMintedWithDiscount",
581
+ "outputs": [
582
+ {
583
+ "internalType": "uint256",
584
+ "name": "",
585
+ "type": "uint256"
586
+ }
587
+ ],
588
+ "stateMutability": "view",
589
+ "type": "function"
590
+ },
591
+ {
592
+ "inputs": [
593
+ {
594
+ "internalType": "address",
595
+ "name": "newOwner",
596
+ "type": "address"
597
+ }
598
+ ],
599
+ "name": "transferOwnership",
600
+ "outputs": [],
601
+ "stateMutability": "nonpayable",
602
+ "type": "function"
603
+ },
604
+ {
605
+ "inputs": [],
606
+ "name": "unpause",
607
+ "outputs": [],
608
+ "stateMutability": "nonpayable",
609
+ "type": "function"
610
+ },
611
+ {
612
+ "inputs": [
613
+ {
614
+ "internalType": "address",
615
+ "name": "recipient",
616
+ "type": "address"
617
+ }
618
+ ],
619
+ "name": "withdraw",
620
+ "outputs": [],
621
+ "stateMutability": "nonpayable",
622
+ "type": "function"
623
+ }
624
+ ] as const satisfies Abi;
625
+
626
+ /**
627
+ * Type-safe ABI for FellowshipDutchAuction
628
+ */
629
+ export type FellowshipDutchAuctionAbi = typeof FellowshipDutchAuctionAbi;
630
+
631
+ /**
632
+ * Contract instance type for FellowshipDutchAuction
633
+ */
634
+ // Use any for contract type to avoid complex viem type issues
635
+ // The runtime behavior is type-safe through viem's ABI typing
636
+ export type FellowshipDutchAuctionContract = any;
637
+
638
+ /**
639
+ * FellowshipDutchAuction Contract Class
640
+ *
641
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
642
+ *
643
+ * @example
644
+ * ```typescript
645
+ * import { createPublicClient, createWalletClient, http } from 'viem';
646
+ * import { mainnet } from 'viem/chains';
647
+ * import { FellowshipDutchAuction } from 'FellowshipDutchAuction';
648
+ *
649
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
650
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
651
+ *
652
+ * const contract = new FellowshipDutchAuction('0x...', { publicClient, walletClient });
653
+ *
654
+ * // Read functions
655
+ * const result = await contract.balanceOf('0x...');
656
+ *
657
+ * // Write functions
658
+ * const hash = await contract.transfer('0x...', 1000n);
659
+ *
660
+ * // Simulate transactions (dry-run)
661
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
662
+ * console.log('Gas estimate:', simulation.request.gas);
663
+ *
664
+ * // Watch events
665
+ * const unwatch = contract.watch.Transfer((event) => {
666
+ * console.log('Transfer event:', event);
667
+ * });
668
+ * ```
669
+ */
670
+ export class FellowshipDutchAuction {
671
+ private contract: FellowshipDutchAuctionContract;
672
+ private contractAddress: Address;
673
+ private publicClient: PublicClient;
674
+
675
+ constructor(
676
+ address: Address,
677
+ clients: {
678
+ publicClient: PublicClient;
679
+ walletClient?: WalletClient;
680
+ }
681
+ ) {
682
+ this.contractAddress = address;
683
+ this.publicClient = clients.publicClient;
684
+ this.contract = getContract({
685
+ address,
686
+ abi: FellowshipDutchAuctionAbi,
687
+ client: {
688
+ public: clients.publicClient,
689
+ wallet: clients.walletClient,
690
+ },
691
+ });
692
+ }
693
+
694
+ /**
695
+ * Get the contract address
696
+ */
697
+ get address(): Address {
698
+ return this.contractAddress;
699
+ }
700
+
701
+ /**
702
+ * Get the underlying viem contract instance.
703
+ */
704
+ getContract(): FellowshipDutchAuctionContract {
705
+ return this.contract;
706
+ }
707
+
708
+ /**
709
+ * auctionStages
710
+ * view
711
+ */
712
+ async auctionStages(arg0: bigint): Promise<[bigint, bigint, bigint]> {
713
+ return this.contract.read.auctionStages([arg0] as const) as Promise<[bigint, bigint, bigint]>;
714
+ }
715
+
716
+ /**
717
+ * currentPrice
718
+ * view
719
+ */
720
+ async currentPrice(): Promise<bigint> {
721
+ return this.contract.read.currentPrice() as Promise<bigint>;
722
+ }
723
+
724
+ /**
725
+ * discountsCount
726
+ * view
727
+ */
728
+ async discountsCount(arg0: `0x${string}`): Promise<bigint> {
729
+ return this.contract.read.discountsCount([arg0] as const) as Promise<bigint>;
730
+ }
731
+
732
+ /**
733
+ * earlyAccessDuration
734
+ * view
735
+ */
736
+ async earlyAccessDuration(): Promise<bigint> {
737
+ return this.contract.read.earlyAccessDuration() as Promise<bigint>;
738
+ }
739
+
740
+ /**
741
+ * isPaused
742
+ * view
743
+ */
744
+ async isPaused(): Promise<boolean> {
745
+ return this.contract.read.isPaused() as Promise<boolean>;
746
+ }
747
+
748
+ /**
749
+ * isPublic
750
+ * view
751
+ */
752
+ async isPublic(): Promise<boolean> {
753
+ return this.contract.read.isPublic() as Promise<boolean>;
754
+ }
755
+
756
+ /**
757
+ * lowestPrice
758
+ * view
759
+ */
760
+ async lowestPrice(): Promise<bigint> {
761
+ return this.contract.read.lowestPrice() as Promise<bigint>;
762
+ }
763
+
764
+ /**
765
+ * mintCount
766
+ * view
767
+ */
768
+ async mintCount(arg0: `0x${string}`): Promise<bigint> {
769
+ return this.contract.read.mintCount([arg0] as const) as Promise<bigint>;
770
+ }
771
+
772
+ /**
773
+ * mintLimit
774
+ * view
775
+ */
776
+ async mintLimit(): Promise<bigint> {
777
+ return this.contract.read.mintLimit() as Promise<bigint>;
778
+ }
779
+
780
+ /**
781
+ * mintPayment
782
+ * view
783
+ */
784
+ async mintPayment(arg0: `0x${string}`): Promise<bigint> {
785
+ return this.contract.read.mintPayment([arg0] as const) as Promise<bigint>;
786
+ }
787
+
788
+ /**
789
+ * owner
790
+ * view
791
+ */
792
+ async owner(): Promise<`0x${string}`> {
793
+ return this.contract.read.owner() as Promise<`0x${string}`>;
794
+ }
795
+
796
+ /**
797
+ * refundAvailable
798
+ * view
799
+ */
800
+ async refundAvailable(minter: `0x${string}`): Promise<bigint> {
801
+ return this.contract.read.refundAvailable([minter] as const) as Promise<bigint>;
802
+ }
803
+
804
+ /**
805
+ * startPrice
806
+ * view
807
+ */
808
+ async startPrice(): Promise<bigint> {
809
+ return this.contract.read.startPrice() as Promise<bigint>;
810
+ }
811
+
812
+ /**
813
+ * startTime
814
+ * view
815
+ */
816
+ async startTime(): Promise<bigint> {
817
+ return this.contract.read.startTime() as Promise<bigint>;
818
+ }
819
+
820
+ /**
821
+ * supportsInterface
822
+ * pure
823
+ */
824
+ async supportsInterface(interfaceId: `0x${string}`): Promise<boolean> {
825
+ return this.contract.read.supportsInterface([interfaceId] as const) as Promise<boolean>;
826
+ }
827
+
828
+ /**
829
+ * tokenContract
830
+ * view
831
+ */
832
+ async tokenContract(): Promise<`0x${string}`> {
833
+ return this.contract.read.tokenContract() as Promise<`0x${string}`>;
834
+ }
835
+
836
+ /**
837
+ * totalMintedWithDiscount
838
+ * view
839
+ */
840
+ async totalMintedWithDiscount(): Promise<bigint> {
841
+ return this.contract.read.totalMintedWithDiscount() as Promise<bigint>;
842
+ }
843
+
844
+ /**
845
+ * mintMultiple
846
+ * payable
847
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
848
+ */
849
+ async mintMultiple(quantity: bigint, options?: {
850
+ accessList?: import('viem').AccessList;
851
+ authorizationList?: import('viem').AuthorizationList;
852
+ chain?: import('viem').Chain | null;
853
+ dataSuffix?: `0x${string}`;
854
+ gas?: bigint;
855
+ gasPrice?: bigint;
856
+ maxFeePerGas?: bigint;
857
+ maxPriorityFeePerGas?: bigint;
858
+ nonce?: number;
859
+ value?: bigint;
860
+ }): Promise<`0x${string}`> {
861
+ if (!this.contract.write) {
862
+ throw new Error('Wallet client is required for write operations');
863
+ }
864
+ return this.contract.write.mintMultiple([quantity] as const, options) as Promise<`0x${string}`>;
865
+ }
866
+
867
+ /**
868
+ * pause
869
+ * nonpayable
870
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
871
+ */
872
+ async pause(options?: {
873
+ accessList?: import('viem').AccessList;
874
+ authorizationList?: import('viem').AuthorizationList;
875
+ chain?: import('viem').Chain | null;
876
+ dataSuffix?: `0x${string}`;
877
+ gas?: bigint;
878
+ gasPrice?: bigint;
879
+ maxFeePerGas?: bigint;
880
+ maxPriorityFeePerGas?: bigint;
881
+ nonce?: number;
882
+ value?: bigint;
883
+ }): Promise<`0x${string}`> {
884
+ if (!this.contract.write) {
885
+ throw new Error('Wallet client is required for write operations');
886
+ }
887
+ return this.contract.write.pause(options) as Promise<`0x${string}`>;
888
+ }
889
+
890
+ /**
891
+ * refund
892
+ * nonpayable
893
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
894
+ */
895
+ async refund(options?: {
896
+ accessList?: import('viem').AccessList;
897
+ authorizationList?: import('viem').AuthorizationList;
898
+ chain?: import('viem').Chain | null;
899
+ dataSuffix?: `0x${string}`;
900
+ gas?: bigint;
901
+ gasPrice?: bigint;
902
+ maxFeePerGas?: bigint;
903
+ maxPriorityFeePerGas?: bigint;
904
+ nonce?: number;
905
+ value?: bigint;
906
+ }): Promise<`0x${string}`> {
907
+ if (!this.contract.write) {
908
+ throw new Error('Wallet client is required for write operations');
909
+ }
910
+ return this.contract.write.refund(options) as Promise<`0x${string}`>;
911
+ }
912
+
913
+ /**
914
+ * renounceOwnership
915
+ * nonpayable
916
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
917
+ */
918
+ async renounceOwnership(options?: {
919
+ accessList?: import('viem').AccessList;
920
+ authorizationList?: import('viem').AuthorizationList;
921
+ chain?: import('viem').Chain | null;
922
+ dataSuffix?: `0x${string}`;
923
+ gas?: bigint;
924
+ gasPrice?: bigint;
925
+ maxFeePerGas?: bigint;
926
+ maxPriorityFeePerGas?: bigint;
927
+ nonce?: number;
928
+ value?: bigint;
929
+ }): Promise<`0x${string}`> {
930
+ if (!this.contract.write) {
931
+ throw new Error('Wallet client is required for write operations');
932
+ }
933
+ return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
934
+ }
935
+
936
+ /**
937
+ * setEarlyAccessDuration
938
+ * nonpayable
939
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
940
+ */
941
+ async setEarlyAccessDuration(duration: bigint, options?: {
942
+ accessList?: import('viem').AccessList;
943
+ authorizationList?: import('viem').AuthorizationList;
944
+ chain?: import('viem').Chain | null;
945
+ dataSuffix?: `0x${string}`;
946
+ gas?: bigint;
947
+ gasPrice?: bigint;
948
+ maxFeePerGas?: bigint;
949
+ maxPriorityFeePerGas?: bigint;
950
+ nonce?: number;
951
+ value?: bigint;
952
+ }): Promise<`0x${string}`> {
953
+ if (!this.contract.write) {
954
+ throw new Error('Wallet client is required for write operations');
955
+ }
956
+ return this.contract.write.setEarlyAccessDuration([duration] as const, options) as Promise<`0x${string}`>;
957
+ }
958
+
959
+ /**
960
+ * setMintable
961
+ * nonpayable
962
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
963
+ */
964
+ async setMintable(tokenContract_: `0x${string}`, options?: {
965
+ accessList?: import('viem').AccessList;
966
+ authorizationList?: import('viem').AuthorizationList;
967
+ chain?: import('viem').Chain | null;
968
+ dataSuffix?: `0x${string}`;
969
+ gas?: bigint;
970
+ gasPrice?: bigint;
971
+ maxFeePerGas?: bigint;
972
+ maxPriorityFeePerGas?: bigint;
973
+ nonce?: number;
974
+ value?: bigint;
975
+ }): Promise<`0x${string}`> {
976
+ if (!this.contract.write) {
977
+ throw new Error('Wallet client is required for write operations');
978
+ }
979
+ return this.contract.write.setMintable([tokenContract_] as const, options) as Promise<`0x${string}`>;
980
+ }
981
+
982
+ /**
983
+ * setPricing
984
+ * nonpayable
985
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
986
+ */
987
+ async setPricing(startPrice_: bigint, stages_: AuctionStageConfiguration[], options?: {
988
+ accessList?: import('viem').AccessList;
989
+ authorizationList?: import('viem').AuthorizationList;
990
+ chain?: import('viem').Chain | null;
991
+ dataSuffix?: `0x${string}`;
992
+ gas?: bigint;
993
+ gasPrice?: bigint;
994
+ maxFeePerGas?: bigint;
995
+ maxPriorityFeePerGas?: bigint;
996
+ nonce?: number;
997
+ value?: bigint;
998
+ }): Promise<`0x${string}`> {
999
+ if (!this.contract.write) {
1000
+ throw new Error('Wallet client is required for write operations');
1001
+ }
1002
+ return this.contract.write.setPricing([startPrice_, stages_] as const, options) as Promise<`0x${string}`>;
1003
+ }
1004
+
1005
+ /**
1006
+ * setStartTime
1007
+ * nonpayable
1008
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1009
+ */
1010
+ async setStartTime(startTime_: bigint, options?: {
1011
+ accessList?: import('viem').AccessList;
1012
+ authorizationList?: import('viem').AuthorizationList;
1013
+ chain?: import('viem').Chain | null;
1014
+ dataSuffix?: `0x${string}`;
1015
+ gas?: bigint;
1016
+ gasPrice?: bigint;
1017
+ maxFeePerGas?: bigint;
1018
+ maxPriorityFeePerGas?: bigint;
1019
+ nonce?: number;
1020
+ value?: bigint;
1021
+ }): Promise<`0x${string}`> {
1022
+ if (!this.contract.write) {
1023
+ throw new Error('Wallet client is required for write operations');
1024
+ }
1025
+ return this.contract.write.setStartTime([startTime_] as const, options) as Promise<`0x${string}`>;
1026
+ }
1027
+
1028
+ /**
1029
+ * transferOwnership
1030
+ * nonpayable
1031
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1032
+ */
1033
+ async transferOwnership(newOwner: `0x${string}`, options?: {
1034
+ accessList?: import('viem').AccessList;
1035
+ authorizationList?: import('viem').AuthorizationList;
1036
+ chain?: import('viem').Chain | null;
1037
+ dataSuffix?: `0x${string}`;
1038
+ gas?: bigint;
1039
+ gasPrice?: bigint;
1040
+ maxFeePerGas?: bigint;
1041
+ maxPriorityFeePerGas?: bigint;
1042
+ nonce?: number;
1043
+ value?: bigint;
1044
+ }): Promise<`0x${string}`> {
1045
+ if (!this.contract.write) {
1046
+ throw new Error('Wallet client is required for write operations');
1047
+ }
1048
+ return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
1049
+ }
1050
+
1051
+ /**
1052
+ * unpause
1053
+ * nonpayable
1054
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1055
+ */
1056
+ async unpause(options?: {
1057
+ accessList?: import('viem').AccessList;
1058
+ authorizationList?: import('viem').AuthorizationList;
1059
+ chain?: import('viem').Chain | null;
1060
+ dataSuffix?: `0x${string}`;
1061
+ gas?: bigint;
1062
+ gasPrice?: bigint;
1063
+ maxFeePerGas?: bigint;
1064
+ maxPriorityFeePerGas?: bigint;
1065
+ nonce?: number;
1066
+ value?: bigint;
1067
+ }): Promise<`0x${string}`> {
1068
+ if (!this.contract.write) {
1069
+ throw new Error('Wallet client is required for write operations');
1070
+ }
1071
+ return this.contract.write.unpause(options) as Promise<`0x${string}`>;
1072
+ }
1073
+
1074
+ /**
1075
+ * withdraw
1076
+ * nonpayable
1077
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1078
+ */
1079
+ async withdraw(recipient: `0x${string}`, options?: {
1080
+ accessList?: import('viem').AccessList;
1081
+ authorizationList?: import('viem').AuthorizationList;
1082
+ chain?: import('viem').Chain | null;
1083
+ dataSuffix?: `0x${string}`;
1084
+ gas?: bigint;
1085
+ gasPrice?: bigint;
1086
+ maxFeePerGas?: bigint;
1087
+ maxPriorityFeePerGas?: bigint;
1088
+ nonce?: number;
1089
+ value?: bigint;
1090
+ }): Promise<`0x${string}`> {
1091
+ if (!this.contract.write) {
1092
+ throw new Error('Wallet client is required for write operations');
1093
+ }
1094
+ return this.contract.write.withdraw([recipient] as const, options) as Promise<`0x${string}`>;
1095
+ }
1096
+
1097
+
1098
+
1099
+ /**
1100
+ * Simulate contract write operations (dry-run without sending transaction)
1101
+ *
1102
+ * @example
1103
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1104
+ * console.log('Gas estimate:', result.request.gas);
1105
+ * console.log('Would succeed:', result.result);
1106
+ */
1107
+ get simulate() {
1108
+ const contract = this.contract;
1109
+ if (!contract.simulate) {
1110
+ throw new Error('Public client is required for simulation');
1111
+ }
1112
+ return {
1113
+ /**
1114
+ * Simulate mintMultiple
1115
+ * Returns gas estimate and result without sending transaction
1116
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1117
+ */
1118
+ async mintMultiple(quantity: bigint, options?: {
1119
+ accessList?: import('viem').AccessList;
1120
+ authorizationList?: import('viem').AuthorizationList;
1121
+ chain?: import('viem').Chain | null;
1122
+ dataSuffix?: `0x${string}`;
1123
+ gas?: bigint;
1124
+ gasPrice?: bigint;
1125
+ maxFeePerGas?: bigint;
1126
+ maxPriorityFeePerGas?: bigint;
1127
+ nonce?: number;
1128
+ value?: bigint;
1129
+ }): Promise<void> {
1130
+ return contract.simulate.mintMultiple([quantity] as const, options) as Promise<void>;
1131
+ },
1132
+ /**
1133
+ * Simulate pause
1134
+ * Returns gas estimate and result without sending transaction
1135
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1136
+ */
1137
+ async pause(options?: {
1138
+ accessList?: import('viem').AccessList;
1139
+ authorizationList?: import('viem').AuthorizationList;
1140
+ chain?: import('viem').Chain | null;
1141
+ dataSuffix?: `0x${string}`;
1142
+ gas?: bigint;
1143
+ gasPrice?: bigint;
1144
+ maxFeePerGas?: bigint;
1145
+ maxPriorityFeePerGas?: bigint;
1146
+ nonce?: number;
1147
+ value?: bigint;
1148
+ }): Promise<void> {
1149
+ return contract.simulate.pause(options) as Promise<void>;
1150
+ },
1151
+ /**
1152
+ * Simulate refund
1153
+ * Returns gas estimate and result without sending transaction
1154
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1155
+ */
1156
+ async refund(options?: {
1157
+ accessList?: import('viem').AccessList;
1158
+ authorizationList?: import('viem').AuthorizationList;
1159
+ chain?: import('viem').Chain | null;
1160
+ dataSuffix?: `0x${string}`;
1161
+ gas?: bigint;
1162
+ gasPrice?: bigint;
1163
+ maxFeePerGas?: bigint;
1164
+ maxPriorityFeePerGas?: bigint;
1165
+ nonce?: number;
1166
+ value?: bigint;
1167
+ }): Promise<bigint> {
1168
+ return contract.simulate.refund(options) as Promise<bigint>;
1169
+ },
1170
+ /**
1171
+ * Simulate renounceOwnership
1172
+ * Returns gas estimate and result without sending transaction
1173
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1174
+ */
1175
+ async renounceOwnership(options?: {
1176
+ accessList?: import('viem').AccessList;
1177
+ authorizationList?: import('viem').AuthorizationList;
1178
+ chain?: import('viem').Chain | null;
1179
+ dataSuffix?: `0x${string}`;
1180
+ gas?: bigint;
1181
+ gasPrice?: bigint;
1182
+ maxFeePerGas?: bigint;
1183
+ maxPriorityFeePerGas?: bigint;
1184
+ nonce?: number;
1185
+ value?: bigint;
1186
+ }): Promise<void> {
1187
+ return contract.simulate.renounceOwnership(options) as Promise<void>;
1188
+ },
1189
+ /**
1190
+ * Simulate setEarlyAccessDuration
1191
+ * Returns gas estimate and result without sending transaction
1192
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1193
+ */
1194
+ async setEarlyAccessDuration(duration: bigint, options?: {
1195
+ accessList?: import('viem').AccessList;
1196
+ authorizationList?: import('viem').AuthorizationList;
1197
+ chain?: import('viem').Chain | null;
1198
+ dataSuffix?: `0x${string}`;
1199
+ gas?: bigint;
1200
+ gasPrice?: bigint;
1201
+ maxFeePerGas?: bigint;
1202
+ maxPriorityFeePerGas?: bigint;
1203
+ nonce?: number;
1204
+ value?: bigint;
1205
+ }): Promise<void> {
1206
+ return contract.simulate.setEarlyAccessDuration([duration] as const, options) as Promise<void>;
1207
+ },
1208
+ /**
1209
+ * Simulate setMintable
1210
+ * Returns gas estimate and result without sending transaction
1211
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1212
+ */
1213
+ async setMintable(tokenContract_: `0x${string}`, options?: {
1214
+ accessList?: import('viem').AccessList;
1215
+ authorizationList?: import('viem').AuthorizationList;
1216
+ chain?: import('viem').Chain | null;
1217
+ dataSuffix?: `0x${string}`;
1218
+ gas?: bigint;
1219
+ gasPrice?: bigint;
1220
+ maxFeePerGas?: bigint;
1221
+ maxPriorityFeePerGas?: bigint;
1222
+ nonce?: number;
1223
+ value?: bigint;
1224
+ }): Promise<void> {
1225
+ return contract.simulate.setMintable([tokenContract_] as const, options) as Promise<void>;
1226
+ },
1227
+ /**
1228
+ * Simulate setPricing
1229
+ * Returns gas estimate and result without sending transaction
1230
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1231
+ */
1232
+ async setPricing(startPrice_: bigint, stages_: AuctionStageConfiguration[], options?: {
1233
+ accessList?: import('viem').AccessList;
1234
+ authorizationList?: import('viem').AuthorizationList;
1235
+ chain?: import('viem').Chain | null;
1236
+ dataSuffix?: `0x${string}`;
1237
+ gas?: bigint;
1238
+ gasPrice?: bigint;
1239
+ maxFeePerGas?: bigint;
1240
+ maxPriorityFeePerGas?: bigint;
1241
+ nonce?: number;
1242
+ value?: bigint;
1243
+ }): Promise<void> {
1244
+ return contract.simulate.setPricing([startPrice_, stages_] as const, options) as Promise<void>;
1245
+ },
1246
+ /**
1247
+ * Simulate setStartTime
1248
+ * Returns gas estimate and result without sending transaction
1249
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1250
+ */
1251
+ async setStartTime(startTime_: bigint, options?: {
1252
+ accessList?: import('viem').AccessList;
1253
+ authorizationList?: import('viem').AuthorizationList;
1254
+ chain?: import('viem').Chain | null;
1255
+ dataSuffix?: `0x${string}`;
1256
+ gas?: bigint;
1257
+ gasPrice?: bigint;
1258
+ maxFeePerGas?: bigint;
1259
+ maxPriorityFeePerGas?: bigint;
1260
+ nonce?: number;
1261
+ value?: bigint;
1262
+ }): Promise<void> {
1263
+ return contract.simulate.setStartTime([startTime_] as const, options) as Promise<void>;
1264
+ },
1265
+ /**
1266
+ * Simulate transferOwnership
1267
+ * Returns gas estimate and result without sending transaction
1268
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1269
+ */
1270
+ async transferOwnership(newOwner: `0x${string}`, options?: {
1271
+ accessList?: import('viem').AccessList;
1272
+ authorizationList?: import('viem').AuthorizationList;
1273
+ chain?: import('viem').Chain | null;
1274
+ dataSuffix?: `0x${string}`;
1275
+ gas?: bigint;
1276
+ gasPrice?: bigint;
1277
+ maxFeePerGas?: bigint;
1278
+ maxPriorityFeePerGas?: bigint;
1279
+ nonce?: number;
1280
+ value?: bigint;
1281
+ }): Promise<void> {
1282
+ return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
1283
+ },
1284
+ /**
1285
+ * Simulate unpause
1286
+ * Returns gas estimate and result without sending transaction
1287
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1288
+ */
1289
+ async unpause(options?: {
1290
+ accessList?: import('viem').AccessList;
1291
+ authorizationList?: import('viem').AuthorizationList;
1292
+ chain?: import('viem').Chain | null;
1293
+ dataSuffix?: `0x${string}`;
1294
+ gas?: bigint;
1295
+ gasPrice?: bigint;
1296
+ maxFeePerGas?: bigint;
1297
+ maxPriorityFeePerGas?: bigint;
1298
+ nonce?: number;
1299
+ value?: bigint;
1300
+ }): Promise<void> {
1301
+ return contract.simulate.unpause(options) as Promise<void>;
1302
+ },
1303
+ /**
1304
+ * Simulate withdraw
1305
+ * Returns gas estimate and result without sending transaction
1306
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1307
+ */
1308
+ async withdraw(recipient: `0x${string}`, options?: {
1309
+ accessList?: import('viem').AccessList;
1310
+ authorizationList?: import('viem').AuthorizationList;
1311
+ chain?: import('viem').Chain | null;
1312
+ dataSuffix?: `0x${string}`;
1313
+ gas?: bigint;
1314
+ gasPrice?: bigint;
1315
+ maxFeePerGas?: bigint;
1316
+ maxPriorityFeePerGas?: bigint;
1317
+ nonce?: number;
1318
+ value?: bigint;
1319
+ }): Promise<void> {
1320
+ return contract.simulate.withdraw([recipient] as const, options) as Promise<void>;
1321
+ }
1322
+ };
1323
+ }
1324
+
1325
+ /**
1326
+ * Watch contract events
1327
+ *
1328
+ * @example
1329
+ * // Watch all Transfer events
1330
+ * const unwatch = contract.watch.Transfer((event) => {
1331
+ * console.log('Transfer:', event);
1332
+ * });
1333
+ *
1334
+ * // Stop watching
1335
+ * unwatch();
1336
+ */
1337
+ get watch() {
1338
+ return {
1339
+ /**
1340
+ * Watch OwnershipTransferred events
1341
+ * @param callback Function to call when event is emitted
1342
+ * @param filter Optional filter for indexed parameters
1343
+ * @returns Unwatch function to stop listening
1344
+ */
1345
+ OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner?: `0x${string}` | `0x${string}`[] | null; newOwner?: `0x${string}` | `0x${string}`[] | null }) => {
1346
+ return this.publicClient.watchContractEvent({
1347
+ address: this.contractAddress,
1348
+ abi: FellowshipDutchAuctionAbi,
1349
+ eventName: 'OwnershipTransferred',
1350
+ args: filter as any,
1351
+ onLogs: (logs: any[]) => {
1352
+ logs.forEach((log: any) => {
1353
+ callback(log.args as any);
1354
+ });
1355
+ },
1356
+ }) as () => void;
1357
+ },
1358
+ /**
1359
+ * Watch Paused events
1360
+ * @param callback Function to call when event is emitted
1361
+ * @param filter Optional filter for indexed parameters
1362
+ * @returns Unwatch function to stop listening
1363
+ */
1364
+ Paused: (callback: (event: { }) => void) => {
1365
+ return this.publicClient.watchContractEvent({
1366
+ address: this.contractAddress,
1367
+ abi: FellowshipDutchAuctionAbi,
1368
+ eventName: 'Paused',
1369
+
1370
+ onLogs: (logs: any[]) => {
1371
+ logs.forEach((log: any) => {
1372
+ callback(log.args as any);
1373
+ });
1374
+ },
1375
+ }) as () => void;
1376
+ },
1377
+ /**
1378
+ * Watch Purchase events
1379
+ * @param callback Function to call when event is emitted
1380
+ * @param filter Optional filter for indexed parameters
1381
+ * @returns Unwatch function to stop listening
1382
+ */
1383
+ Purchase: (callback: (event: { purchaser: `0x${string}`; tokenId: bigint; price: bigint }) => void) => {
1384
+ return this.publicClient.watchContractEvent({
1385
+ address: this.contractAddress,
1386
+ abi: FellowshipDutchAuctionAbi,
1387
+ eventName: 'Purchase',
1388
+
1389
+ onLogs: (logs: any[]) => {
1390
+ logs.forEach((log: any) => {
1391
+ callback(log.args as any);
1392
+ });
1393
+ },
1394
+ }) as () => void;
1395
+ },
1396
+ /**
1397
+ * Watch Refund events
1398
+ * @param callback Function to call when event is emitted
1399
+ * @param filter Optional filter for indexed parameters
1400
+ * @returns Unwatch function to stop listening
1401
+ */
1402
+ Refund: (callback: (event: { recipient: `0x${string}`; amount: bigint }) => void) => {
1403
+ return this.publicClient.watchContractEvent({
1404
+ address: this.contractAddress,
1405
+ abi: FellowshipDutchAuctionAbi,
1406
+ eventName: 'Refund',
1407
+
1408
+ onLogs: (logs: any[]) => {
1409
+ logs.forEach((log: any) => {
1410
+ callback(log.args as any);
1411
+ });
1412
+ },
1413
+ }) as () => void;
1414
+ },
1415
+ /**
1416
+ * Watch Reservation events
1417
+ * @param callback Function to call when event is emitted
1418
+ * @param filter Optional filter for indexed parameters
1419
+ * @returns Unwatch function to stop listening
1420
+ */
1421
+ Reservation: (callback: (event: { recipient: `0x${string}`; quantity: bigint; totalReserved: bigint }) => void) => {
1422
+ return this.publicClient.watchContractEvent({
1423
+ address: this.contractAddress,
1424
+ abi: FellowshipDutchAuctionAbi,
1425
+ eventName: 'Reservation',
1426
+
1427
+ onLogs: (logs: any[]) => {
1428
+ logs.forEach((log: any) => {
1429
+ callback(log.args as any);
1430
+ });
1431
+ },
1432
+ }) as () => void;
1433
+ },
1434
+ /**
1435
+ * Watch Unpaused events
1436
+ * @param callback Function to call when event is emitted
1437
+ * @param filter Optional filter for indexed parameters
1438
+ * @returns Unwatch function to stop listening
1439
+ */
1440
+ Unpaused: (callback: (event: { }) => void) => {
1441
+ return this.publicClient.watchContractEvent({
1442
+ address: this.contractAddress,
1443
+ abi: FellowshipDutchAuctionAbi,
1444
+ eventName: 'Unpaused',
1445
+
1446
+ onLogs: (logs: any[]) => {
1447
+ logs.forEach((log: any) => {
1448
+ callback(log.args as any);
1449
+ });
1450
+ },
1451
+ }) as () => void;
1452
+ }
1453
+ };
1454
+ }
1455
+ }