@gitmyabi/give 0.0.0-stage → 1.0.1

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