@gitmyabi/dot 1.0.1 → 1.0.2

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