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