@gitmyabi/asf 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,677 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * AsfToken_json ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const AsfToken_jsonAbi: readonly [{
8
+ readonly inputs: readonly [];
9
+ readonly stateMutability: "nonpayable";
10
+ readonly type: "constructor";
11
+ }, {
12
+ readonly inputs: readonly [{
13
+ readonly internalType: "address";
14
+ readonly name: "spender";
15
+ readonly type: "address";
16
+ }, {
17
+ readonly internalType: "uint256";
18
+ readonly name: "allowance";
19
+ readonly type: "uint256";
20
+ }, {
21
+ readonly internalType: "uint256";
22
+ readonly name: "needed";
23
+ readonly type: "uint256";
24
+ }];
25
+ readonly name: "ERC20InsufficientAllowance";
26
+ readonly type: "error";
27
+ }, {
28
+ readonly inputs: readonly [{
29
+ readonly internalType: "address";
30
+ readonly name: "sender";
31
+ readonly type: "address";
32
+ }, {
33
+ readonly internalType: "uint256";
34
+ readonly name: "balance";
35
+ readonly type: "uint256";
36
+ }, {
37
+ readonly internalType: "uint256";
38
+ readonly name: "needed";
39
+ readonly type: "uint256";
40
+ }];
41
+ readonly name: "ERC20InsufficientBalance";
42
+ readonly type: "error";
43
+ }, {
44
+ readonly inputs: readonly [{
45
+ readonly internalType: "address";
46
+ readonly name: "approver";
47
+ readonly type: "address";
48
+ }];
49
+ readonly name: "ERC20InvalidApprover";
50
+ readonly type: "error";
51
+ }, {
52
+ readonly inputs: readonly [{
53
+ readonly internalType: "address";
54
+ readonly name: "receiver";
55
+ readonly type: "address";
56
+ }];
57
+ readonly name: "ERC20InvalidReceiver";
58
+ readonly type: "error";
59
+ }, {
60
+ readonly inputs: readonly [{
61
+ readonly internalType: "address";
62
+ readonly name: "sender";
63
+ readonly type: "address";
64
+ }];
65
+ readonly name: "ERC20InvalidSender";
66
+ readonly type: "error";
67
+ }, {
68
+ readonly inputs: readonly [{
69
+ readonly internalType: "address";
70
+ readonly name: "spender";
71
+ readonly type: "address";
72
+ }];
73
+ readonly name: "ERC20InvalidSpender";
74
+ readonly type: "error";
75
+ }, {
76
+ readonly inputs: readonly [{
77
+ readonly internalType: "address";
78
+ readonly name: "owner";
79
+ readonly type: "address";
80
+ }];
81
+ readonly name: "OwnableInvalidOwner";
82
+ readonly type: "error";
83
+ }, {
84
+ readonly inputs: readonly [{
85
+ readonly internalType: "address";
86
+ readonly name: "account";
87
+ readonly type: "address";
88
+ }];
89
+ readonly name: "OwnableUnauthorizedAccount";
90
+ readonly type: "error";
91
+ }, {
92
+ readonly anonymous: false;
93
+ readonly inputs: readonly [{
94
+ readonly indexed: true;
95
+ readonly internalType: "address";
96
+ readonly name: "owner";
97
+ readonly type: "address";
98
+ }, {
99
+ readonly indexed: true;
100
+ readonly internalType: "address";
101
+ readonly name: "spender";
102
+ readonly type: "address";
103
+ }, {
104
+ readonly indexed: false;
105
+ readonly internalType: "uint256";
106
+ readonly name: "value";
107
+ readonly type: "uint256";
108
+ }];
109
+ readonly name: "Approval";
110
+ readonly type: "event";
111
+ }, {
112
+ readonly anonymous: false;
113
+ readonly inputs: readonly [{
114
+ readonly indexed: true;
115
+ readonly internalType: "address";
116
+ readonly name: "previousOwner";
117
+ readonly type: "address";
118
+ }, {
119
+ readonly indexed: true;
120
+ readonly internalType: "address";
121
+ readonly name: "newOwner";
122
+ readonly type: "address";
123
+ }];
124
+ readonly name: "OwnershipTransferred";
125
+ readonly type: "event";
126
+ }, {
127
+ readonly anonymous: false;
128
+ readonly inputs: readonly [{
129
+ readonly indexed: true;
130
+ readonly internalType: "address";
131
+ readonly name: "from";
132
+ readonly type: "address";
133
+ }, {
134
+ readonly indexed: true;
135
+ readonly internalType: "address";
136
+ readonly name: "to";
137
+ readonly type: "address";
138
+ }, {
139
+ readonly indexed: false;
140
+ readonly internalType: "uint256";
141
+ readonly name: "value";
142
+ readonly type: "uint256";
143
+ }];
144
+ readonly name: "Transfer";
145
+ readonly type: "event";
146
+ }, {
147
+ readonly inputs: readonly [{
148
+ readonly internalType: "address";
149
+ readonly name: "owner";
150
+ readonly type: "address";
151
+ }, {
152
+ readonly internalType: "address";
153
+ readonly name: "spender";
154
+ readonly type: "address";
155
+ }];
156
+ readonly name: "allowance";
157
+ readonly outputs: readonly [{
158
+ readonly internalType: "uint256";
159
+ readonly name: "";
160
+ readonly type: "uint256";
161
+ }];
162
+ readonly stateMutability: "view";
163
+ readonly type: "function";
164
+ }, {
165
+ readonly inputs: readonly [{
166
+ readonly internalType: "address";
167
+ readonly name: "spender";
168
+ readonly type: "address";
169
+ }, {
170
+ readonly internalType: "uint256";
171
+ readonly name: "value";
172
+ readonly type: "uint256";
173
+ }];
174
+ readonly name: "approve";
175
+ readonly outputs: readonly [{
176
+ readonly internalType: "bool";
177
+ readonly name: "";
178
+ readonly type: "bool";
179
+ }];
180
+ readonly stateMutability: "nonpayable";
181
+ readonly type: "function";
182
+ }, {
183
+ readonly inputs: readonly [{
184
+ readonly internalType: "address";
185
+ readonly name: "account";
186
+ readonly type: "address";
187
+ }];
188
+ readonly name: "balanceOf";
189
+ readonly outputs: readonly [{
190
+ readonly internalType: "uint256";
191
+ readonly name: "";
192
+ readonly type: "uint256";
193
+ }];
194
+ readonly stateMutability: "view";
195
+ readonly type: "function";
196
+ }, {
197
+ readonly inputs: readonly [];
198
+ readonly name: "decimals";
199
+ readonly outputs: readonly [{
200
+ readonly internalType: "uint8";
201
+ readonly name: "";
202
+ readonly type: "uint8";
203
+ }];
204
+ readonly stateMutability: "view";
205
+ readonly type: "function";
206
+ }, {
207
+ readonly inputs: readonly [{
208
+ readonly internalType: "address";
209
+ readonly name: "_to";
210
+ readonly type: "address";
211
+ }, {
212
+ readonly internalType: "uint256";
213
+ readonly name: "_amount";
214
+ readonly type: "uint256";
215
+ }];
216
+ readonly name: "mint";
217
+ readonly outputs: readonly [];
218
+ readonly stateMutability: "nonpayable";
219
+ readonly type: "function";
220
+ }, {
221
+ readonly inputs: readonly [];
222
+ readonly name: "name";
223
+ readonly outputs: readonly [{
224
+ readonly internalType: "string";
225
+ readonly name: "";
226
+ readonly type: "string";
227
+ }];
228
+ readonly stateMutability: "view";
229
+ readonly type: "function";
230
+ }, {
231
+ readonly inputs: readonly [];
232
+ readonly name: "owner";
233
+ readonly outputs: readonly [{
234
+ readonly internalType: "address";
235
+ readonly name: "";
236
+ readonly type: "address";
237
+ }];
238
+ readonly stateMutability: "view";
239
+ readonly type: "function";
240
+ }, {
241
+ readonly inputs: readonly [];
242
+ readonly name: "renounceOwnership";
243
+ readonly outputs: readonly [];
244
+ readonly stateMutability: "nonpayable";
245
+ readonly type: "function";
246
+ }, {
247
+ readonly inputs: readonly [];
248
+ readonly name: "symbol";
249
+ readonly outputs: readonly [{
250
+ readonly internalType: "string";
251
+ readonly name: "";
252
+ readonly type: "string";
253
+ }];
254
+ readonly stateMutability: "view";
255
+ readonly type: "function";
256
+ }, {
257
+ readonly inputs: readonly [];
258
+ readonly name: "totalSupply";
259
+ readonly outputs: readonly [{
260
+ readonly internalType: "uint256";
261
+ readonly name: "";
262
+ readonly type: "uint256";
263
+ }];
264
+ readonly stateMutability: "view";
265
+ readonly type: "function";
266
+ }, {
267
+ readonly inputs: readonly [{
268
+ readonly internalType: "address";
269
+ readonly name: "to";
270
+ readonly type: "address";
271
+ }, {
272
+ readonly internalType: "uint256";
273
+ readonly name: "value";
274
+ readonly type: "uint256";
275
+ }];
276
+ readonly name: "transfer";
277
+ readonly outputs: readonly [{
278
+ readonly internalType: "bool";
279
+ readonly name: "";
280
+ readonly type: "bool";
281
+ }];
282
+ readonly stateMutability: "nonpayable";
283
+ readonly type: "function";
284
+ }, {
285
+ readonly inputs: readonly [{
286
+ readonly internalType: "address";
287
+ readonly name: "from";
288
+ readonly type: "address";
289
+ }, {
290
+ readonly internalType: "address";
291
+ readonly name: "to";
292
+ readonly type: "address";
293
+ }, {
294
+ readonly internalType: "uint256";
295
+ readonly name: "value";
296
+ readonly type: "uint256";
297
+ }];
298
+ readonly name: "transferFrom";
299
+ readonly outputs: readonly [{
300
+ readonly internalType: "bool";
301
+ readonly name: "";
302
+ readonly type: "bool";
303
+ }];
304
+ readonly stateMutability: "nonpayable";
305
+ readonly type: "function";
306
+ }, {
307
+ readonly inputs: readonly [{
308
+ readonly internalType: "address";
309
+ readonly name: "newOwner";
310
+ readonly type: "address";
311
+ }];
312
+ readonly name: "transferOwnership";
313
+ readonly outputs: readonly [];
314
+ readonly stateMutability: "nonpayable";
315
+ readonly type: "function";
316
+ }];
317
+ /**
318
+ * Type-safe ABI for AsfToken_json
319
+ */
320
+ export type AsfToken_jsonAbi = typeof AsfToken_jsonAbi;
321
+ /**
322
+ * Contract instance type for AsfToken_json
323
+ */
324
+ export type AsfToken_jsonContract = any;
325
+ /**
326
+ * AsfToken_json Contract Class
327
+ *
328
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
329
+ *
330
+ * @example
331
+ * ```typescript
332
+ * import { createPublicClient, createWalletClient, http } from 'viem';
333
+ * import { mainnet } from 'viem/chains';
334
+ * import { AsfToken_json } from 'AsfToken_json';
335
+ *
336
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
337
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
338
+ *
339
+ * const contract = new AsfToken_json('0x...', { publicClient, walletClient });
340
+ *
341
+ * // Read functions
342
+ * const result = await contract.balanceOf('0x...');
343
+ *
344
+ * // Write functions
345
+ * const hash = await contract.transfer('0x...', 1000n);
346
+ *
347
+ * // Simulate transactions (dry-run)
348
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
349
+ * console.log('Gas estimate:', simulation.request.gas);
350
+ *
351
+ * // Watch events
352
+ * const unwatch = contract.watch.Transfer((event) => {
353
+ * console.log('Transfer event:', event);
354
+ * });
355
+ * ```
356
+ */
357
+ export declare class AsfToken_json {
358
+ private contract;
359
+ private contractAddress;
360
+ private publicClient;
361
+ constructor(address: Address, clients: {
362
+ publicClient: PublicClient;
363
+ walletClient?: WalletClient;
364
+ });
365
+ /**
366
+ * Get the contract address
367
+ */
368
+ get address(): Address;
369
+ /**
370
+ * Get the underlying viem contract instance
371
+ */
372
+ getContract(): AsfToken_jsonContract;
373
+ /**
374
+ * allowance
375
+ * view
376
+ */
377
+ allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint>;
378
+ /**
379
+ * balanceOf
380
+ * view
381
+ */
382
+ balanceOf(account: `0x${string}`): Promise<bigint>;
383
+ /**
384
+ * decimals
385
+ * view
386
+ */
387
+ decimals(): Promise<bigint>;
388
+ /**
389
+ * name
390
+ * view
391
+ */
392
+ name(): Promise<string>;
393
+ /**
394
+ * owner
395
+ * view
396
+ */
397
+ owner(): Promise<`0x${string}`>;
398
+ /**
399
+ * symbol
400
+ * view
401
+ */
402
+ symbol(): Promise<string>;
403
+ /**
404
+ * totalSupply
405
+ * view
406
+ */
407
+ totalSupply(): Promise<bigint>;
408
+ /**
409
+ * approve
410
+ * nonpayable
411
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
412
+ */
413
+ approve(spender: `0x${string}`, value: bigint, options?: {
414
+ accessList?: import('viem').AccessList;
415
+ authorizationList?: import('viem').AuthorizationList;
416
+ chain?: import('viem').Chain | null;
417
+ dataSuffix?: `0x${string}`;
418
+ gas?: bigint;
419
+ gasPrice?: bigint;
420
+ maxFeePerGas?: bigint;
421
+ maxPriorityFeePerGas?: bigint;
422
+ nonce?: number;
423
+ value?: bigint;
424
+ }): Promise<`0x${string}`>;
425
+ /**
426
+ * mint
427
+ * nonpayable
428
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
429
+ */
430
+ mint(_to: `0x${string}`, _amount: bigint, options?: {
431
+ accessList?: import('viem').AccessList;
432
+ authorizationList?: import('viem').AuthorizationList;
433
+ chain?: import('viem').Chain | null;
434
+ dataSuffix?: `0x${string}`;
435
+ gas?: bigint;
436
+ gasPrice?: bigint;
437
+ maxFeePerGas?: bigint;
438
+ maxPriorityFeePerGas?: bigint;
439
+ nonce?: number;
440
+ value?: bigint;
441
+ }): Promise<`0x${string}`>;
442
+ /**
443
+ * renounceOwnership
444
+ * nonpayable
445
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
446
+ */
447
+ renounceOwnership(options?: {
448
+ accessList?: import('viem').AccessList;
449
+ authorizationList?: import('viem').AuthorizationList;
450
+ chain?: import('viem').Chain | null;
451
+ dataSuffix?: `0x${string}`;
452
+ gas?: bigint;
453
+ gasPrice?: bigint;
454
+ maxFeePerGas?: bigint;
455
+ maxPriorityFeePerGas?: bigint;
456
+ nonce?: number;
457
+ value?: bigint;
458
+ }): Promise<`0x${string}`>;
459
+ /**
460
+ * transfer
461
+ * nonpayable
462
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
463
+ */
464
+ transfer(to: `0x${string}`, value: bigint, options?: {
465
+ accessList?: import('viem').AccessList;
466
+ authorizationList?: import('viem').AuthorizationList;
467
+ chain?: import('viem').Chain | null;
468
+ dataSuffix?: `0x${string}`;
469
+ gas?: bigint;
470
+ gasPrice?: bigint;
471
+ maxFeePerGas?: bigint;
472
+ maxPriorityFeePerGas?: bigint;
473
+ nonce?: number;
474
+ value?: bigint;
475
+ }): Promise<`0x${string}`>;
476
+ /**
477
+ * transferFrom
478
+ * nonpayable
479
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
480
+ */
481
+ transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
482
+ accessList?: import('viem').AccessList;
483
+ authorizationList?: import('viem').AuthorizationList;
484
+ chain?: import('viem').Chain | null;
485
+ dataSuffix?: `0x${string}`;
486
+ gas?: bigint;
487
+ gasPrice?: bigint;
488
+ maxFeePerGas?: bigint;
489
+ maxPriorityFeePerGas?: bigint;
490
+ nonce?: number;
491
+ value?: bigint;
492
+ }): Promise<`0x${string}`>;
493
+ /**
494
+ * transferOwnership
495
+ * nonpayable
496
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
497
+ */
498
+ transferOwnership(newOwner: `0x${string}`, options?: {
499
+ accessList?: import('viem').AccessList;
500
+ authorizationList?: import('viem').AuthorizationList;
501
+ chain?: import('viem').Chain | null;
502
+ dataSuffix?: `0x${string}`;
503
+ gas?: bigint;
504
+ gasPrice?: bigint;
505
+ maxFeePerGas?: bigint;
506
+ maxPriorityFeePerGas?: bigint;
507
+ nonce?: number;
508
+ value?: bigint;
509
+ }): Promise<`0x${string}`>;
510
+ /**
511
+ * Simulate contract write operations (dry-run without sending transaction)
512
+ *
513
+ * @example
514
+ * const result = await contract.simulate.transfer('0x...', 1000n);
515
+ * console.log('Gas estimate:', result.request.gas);
516
+ * console.log('Would succeed:', result.result);
517
+ */
518
+ get simulate(): {
519
+ /**
520
+ * Simulate approve
521
+ * Returns gas estimate and result without sending transaction
522
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
523
+ */
524
+ approve(spender: `0x${string}`, value: bigint, options?: {
525
+ accessList?: import("viem").AccessList;
526
+ authorizationList?: import("viem").AuthorizationList;
527
+ chain?: import("viem").Chain | null;
528
+ dataSuffix?: `0x${string}`;
529
+ gas?: bigint;
530
+ gasPrice?: bigint;
531
+ maxFeePerGas?: bigint;
532
+ maxPriorityFeePerGas?: bigint;
533
+ nonce?: number;
534
+ value?: bigint;
535
+ }): Promise<boolean>;
536
+ /**
537
+ * Simulate mint
538
+ * Returns gas estimate and result without sending transaction
539
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
540
+ */
541
+ mint(_to: `0x${string}`, _amount: bigint, options?: {
542
+ accessList?: import("viem").AccessList;
543
+ authorizationList?: import("viem").AuthorizationList;
544
+ chain?: import("viem").Chain | null;
545
+ dataSuffix?: `0x${string}`;
546
+ gas?: bigint;
547
+ gasPrice?: bigint;
548
+ maxFeePerGas?: bigint;
549
+ maxPriorityFeePerGas?: bigint;
550
+ nonce?: number;
551
+ value?: bigint;
552
+ }): Promise<void>;
553
+ /**
554
+ * Simulate renounceOwnership
555
+ * Returns gas estimate and result without sending transaction
556
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
557
+ */
558
+ renounceOwnership(options?: {
559
+ accessList?: import("viem").AccessList;
560
+ authorizationList?: import("viem").AuthorizationList;
561
+ chain?: import("viem").Chain | null;
562
+ dataSuffix?: `0x${string}`;
563
+ gas?: bigint;
564
+ gasPrice?: bigint;
565
+ maxFeePerGas?: bigint;
566
+ maxPriorityFeePerGas?: bigint;
567
+ nonce?: number;
568
+ value?: bigint;
569
+ }): Promise<void>;
570
+ /**
571
+ * Simulate transfer
572
+ * Returns gas estimate and result without sending transaction
573
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
574
+ */
575
+ transfer(to: `0x${string}`, value: bigint, options?: {
576
+ accessList?: import("viem").AccessList;
577
+ authorizationList?: import("viem").AuthorizationList;
578
+ chain?: import("viem").Chain | null;
579
+ dataSuffix?: `0x${string}`;
580
+ gas?: bigint;
581
+ gasPrice?: bigint;
582
+ maxFeePerGas?: bigint;
583
+ maxPriorityFeePerGas?: bigint;
584
+ nonce?: number;
585
+ value?: bigint;
586
+ }): Promise<boolean>;
587
+ /**
588
+ * Simulate transferFrom
589
+ * Returns gas estimate and result without sending transaction
590
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
591
+ */
592
+ transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, 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<boolean>;
604
+ /**
605
+ * Simulate transferOwnership
606
+ * Returns gas estimate and result without sending transaction
607
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
608
+ */
609
+ transferOwnership(newOwner: `0x${string}`, options?: {
610
+ accessList?: import("viem").AccessList;
611
+ authorizationList?: import("viem").AuthorizationList;
612
+ chain?: import("viem").Chain | null;
613
+ dataSuffix?: `0x${string}`;
614
+ gas?: bigint;
615
+ gasPrice?: bigint;
616
+ maxFeePerGas?: bigint;
617
+ maxPriorityFeePerGas?: bigint;
618
+ nonce?: number;
619
+ value?: bigint;
620
+ }): Promise<void>;
621
+ };
622
+ /**
623
+ * Watch contract events
624
+ *
625
+ * @example
626
+ * // Watch all Transfer events
627
+ * const unwatch = contract.watch.Transfer((event) => {
628
+ * console.log('Transfer:', event);
629
+ * });
630
+ *
631
+ * // Stop watching
632
+ * unwatch();
633
+ */
634
+ get watch(): {
635
+ /**
636
+ * Watch Approval events
637
+ * @param callback Function to call when event is emitted
638
+ * @param filter Optional filter for indexed parameters
639
+ * @returns Unwatch function to stop listening
640
+ */
641
+ Approval: (callback: (event: {
642
+ owner: `0x${string}`;
643
+ spender: `0x${string}`;
644
+ value: bigint;
645
+ }) => void, filter?: {
646
+ owner: `0x${string}`;
647
+ spender: `0x${string}`;
648
+ }) => () => void;
649
+ /**
650
+ * Watch OwnershipTransferred events
651
+ * @param callback Function to call when event is emitted
652
+ * @param filter Optional filter for indexed parameters
653
+ * @returns Unwatch function to stop listening
654
+ */
655
+ OwnershipTransferred: (callback: (event: {
656
+ previousOwner: `0x${string}`;
657
+ newOwner: `0x${string}`;
658
+ }) => void, filter?: {
659
+ previousOwner: `0x${string}`;
660
+ newOwner: `0x${string}`;
661
+ }) => () => void;
662
+ /**
663
+ * Watch Transfer events
664
+ * @param callback Function to call when event is emitted
665
+ * @param filter Optional filter for indexed parameters
666
+ * @returns Unwatch function to stop listening
667
+ */
668
+ Transfer: (callback: (event: {
669
+ from: `0x${string}`;
670
+ to: `0x${string}`;
671
+ value: bigint;
672
+ }) => void, filter?: {
673
+ from: `0x${string}`;
674
+ to: `0x${string}`;
675
+ }) => () => void;
676
+ };
677
+ }