@gitmyabi/usdt 1.0.21 → 1.0.23

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-90dc93ae-1787183602217`
5
+ - **Build ID**: `etherscan-usdt-1a28bfeb-1787846228650`
6
6
  - **Build Number**: 1
7
- - **Commit**: `71fdab2`
7
+ - **Commit**: `29ddb69`
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.21
15
+ npm install @gitmyabi/usdt@1.0.23
16
16
  ```
17
17
 
18
18
  ## Usage
@@ -0,0 +1,510 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * StandardERC20_json ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const StandardERC20_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 internalType: "uint256";
22
+ readonly name: "initialBalance_";
23
+ readonly type: "uint256";
24
+ }, {
25
+ readonly internalType: "bytes";
26
+ readonly name: "signature_";
27
+ readonly type: "bytes";
28
+ }, {
29
+ readonly internalType: "address payable";
30
+ readonly name: "feeReceiver_";
31
+ readonly type: "address";
32
+ }];
33
+ readonly stateMutability: "payable";
34
+ readonly type: "constructor";
35
+ }, {
36
+ readonly inputs: readonly [{
37
+ readonly internalType: "address";
38
+ readonly name: "spender";
39
+ readonly type: "address";
40
+ }, {
41
+ readonly internalType: "uint256";
42
+ readonly name: "allowance";
43
+ readonly type: "uint256";
44
+ }, {
45
+ readonly internalType: "uint256";
46
+ readonly name: "needed";
47
+ readonly type: "uint256";
48
+ }];
49
+ readonly name: "ERC20InsufficientAllowance";
50
+ readonly type: "error";
51
+ }, {
52
+ readonly inputs: readonly [{
53
+ readonly internalType: "address";
54
+ readonly name: "sender";
55
+ readonly type: "address";
56
+ }, {
57
+ readonly internalType: "uint256";
58
+ readonly name: "balance";
59
+ readonly type: "uint256";
60
+ }, {
61
+ readonly internalType: "uint256";
62
+ readonly name: "needed";
63
+ readonly type: "uint256";
64
+ }];
65
+ readonly name: "ERC20InsufficientBalance";
66
+ readonly type: "error";
67
+ }, {
68
+ readonly inputs: readonly [{
69
+ readonly internalType: "address";
70
+ readonly name: "approver";
71
+ readonly type: "address";
72
+ }];
73
+ readonly name: "ERC20InvalidApprover";
74
+ readonly type: "error";
75
+ }, {
76
+ readonly inputs: readonly [{
77
+ readonly internalType: "address";
78
+ readonly name: "receiver";
79
+ readonly type: "address";
80
+ }];
81
+ readonly name: "ERC20InvalidReceiver";
82
+ readonly type: "error";
83
+ }, {
84
+ readonly inputs: readonly [{
85
+ readonly internalType: "address";
86
+ readonly name: "sender";
87
+ readonly type: "address";
88
+ }];
89
+ readonly name: "ERC20InvalidSender";
90
+ readonly type: "error";
91
+ }, {
92
+ readonly inputs: readonly [{
93
+ readonly internalType: "address";
94
+ readonly name: "spender";
95
+ readonly type: "address";
96
+ }];
97
+ readonly name: "ERC20InvalidSpender";
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 internalType: "address";
142
+ readonly name: "owner";
143
+ readonly type: "address";
144
+ }, {
145
+ readonly internalType: "address";
146
+ readonly name: "spender";
147
+ readonly type: "address";
148
+ }];
149
+ readonly name: "allowance";
150
+ readonly outputs: readonly [{
151
+ readonly internalType: "uint256";
152
+ readonly name: "";
153
+ readonly type: "uint256";
154
+ }];
155
+ readonly stateMutability: "view";
156
+ readonly type: "function";
157
+ }, {
158
+ readonly inputs: readonly [{
159
+ readonly internalType: "address";
160
+ readonly name: "spender";
161
+ readonly type: "address";
162
+ }, {
163
+ readonly internalType: "uint256";
164
+ readonly name: "value";
165
+ readonly type: "uint256";
166
+ }];
167
+ readonly name: "approve";
168
+ readonly outputs: readonly [{
169
+ readonly internalType: "bool";
170
+ readonly name: "";
171
+ readonly type: "bool";
172
+ }];
173
+ readonly stateMutability: "nonpayable";
174
+ readonly type: "function";
175
+ }, {
176
+ readonly inputs: readonly [{
177
+ readonly internalType: "address";
178
+ readonly name: "account";
179
+ readonly type: "address";
180
+ }];
181
+ readonly name: "balanceOf";
182
+ readonly outputs: readonly [{
183
+ readonly internalType: "uint256";
184
+ readonly name: "";
185
+ readonly type: "uint256";
186
+ }];
187
+ readonly stateMutability: "view";
188
+ readonly type: "function";
189
+ }, {
190
+ readonly inputs: readonly [];
191
+ readonly name: "decimals";
192
+ readonly outputs: readonly [{
193
+ readonly internalType: "uint8";
194
+ readonly name: "";
195
+ readonly type: "uint8";
196
+ }];
197
+ readonly stateMutability: "view";
198
+ readonly type: "function";
199
+ }, {
200
+ readonly inputs: readonly [];
201
+ readonly name: "name";
202
+ readonly outputs: readonly [{
203
+ readonly internalType: "string";
204
+ readonly name: "";
205
+ readonly type: "string";
206
+ }];
207
+ readonly stateMutability: "view";
208
+ readonly type: "function";
209
+ }, {
210
+ readonly inputs: readonly [];
211
+ readonly name: "symbol";
212
+ readonly outputs: readonly [{
213
+ readonly internalType: "string";
214
+ readonly name: "";
215
+ readonly type: "string";
216
+ }];
217
+ readonly stateMutability: "view";
218
+ readonly type: "function";
219
+ }, {
220
+ readonly inputs: readonly [];
221
+ readonly name: "totalSupply";
222
+ readonly outputs: readonly [{
223
+ readonly internalType: "uint256";
224
+ readonly name: "";
225
+ readonly type: "uint256";
226
+ }];
227
+ readonly stateMutability: "view";
228
+ readonly type: "function";
229
+ }, {
230
+ readonly inputs: readonly [{
231
+ readonly internalType: "address";
232
+ readonly name: "to";
233
+ readonly type: "address";
234
+ }, {
235
+ readonly internalType: "uint256";
236
+ readonly name: "value";
237
+ readonly type: "uint256";
238
+ }];
239
+ readonly name: "transfer";
240
+ readonly outputs: readonly [{
241
+ readonly internalType: "bool";
242
+ readonly name: "";
243
+ readonly type: "bool";
244
+ }];
245
+ readonly stateMutability: "nonpayable";
246
+ readonly type: "function";
247
+ }, {
248
+ readonly inputs: readonly [{
249
+ readonly internalType: "address";
250
+ readonly name: "from";
251
+ readonly type: "address";
252
+ }, {
253
+ readonly internalType: "address";
254
+ readonly name: "to";
255
+ readonly type: "address";
256
+ }, {
257
+ readonly internalType: "uint256";
258
+ readonly name: "value";
259
+ readonly type: "uint256";
260
+ }];
261
+ readonly name: "transferFrom";
262
+ readonly outputs: readonly [{
263
+ readonly internalType: "bool";
264
+ readonly name: "";
265
+ readonly type: "bool";
266
+ }];
267
+ readonly stateMutability: "nonpayable";
268
+ readonly type: "function";
269
+ }];
270
+ /**
271
+ * Type-safe ABI for StandardERC20_json
272
+ */
273
+ export type StandardERC20_jsonAbi = typeof StandardERC20_jsonAbi;
274
+ /**
275
+ * Contract instance type for StandardERC20_json
276
+ */
277
+ export type StandardERC20_jsonContract = any;
278
+ /**
279
+ * StandardERC20_json Contract Class
280
+ *
281
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
282
+ *
283
+ * @example
284
+ * ```typescript
285
+ * import { createPublicClient, createWalletClient, http } from 'viem';
286
+ * import { mainnet } from 'viem/chains';
287
+ * import { StandardERC20_json } from 'StandardERC20_json';
288
+ *
289
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
290
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
291
+ *
292
+ * const contract = new StandardERC20_json('0x...', { publicClient, walletClient });
293
+ *
294
+ * // Read functions
295
+ * const result = await contract.balanceOf('0x...');
296
+ *
297
+ * // Write functions
298
+ * const hash = await contract.transfer('0x...', 1000n);
299
+ *
300
+ * // Simulate transactions (dry-run)
301
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
302
+ * console.log('Gas estimate:', simulation.request.gas);
303
+ *
304
+ * // Watch events
305
+ * const unwatch = contract.watch.Transfer((event) => {
306
+ * console.log('Transfer event:', event);
307
+ * });
308
+ * ```
309
+ */
310
+ export declare class StandardERC20_json {
311
+ private contract;
312
+ private contractAddress;
313
+ private publicClient;
314
+ constructor(address: Address, clients: {
315
+ publicClient: PublicClient;
316
+ walletClient?: WalletClient;
317
+ });
318
+ /**
319
+ * Get the contract address
320
+ */
321
+ get address(): Address;
322
+ /**
323
+ * Get the underlying viem contract instance
324
+ */
325
+ getContract(): StandardERC20_jsonContract;
326
+ /**
327
+ * allowance
328
+ * view
329
+ */
330
+ allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint>;
331
+ /**
332
+ * balanceOf
333
+ * view
334
+ */
335
+ balanceOf(account: `0x${string}`): Promise<bigint>;
336
+ /**
337
+ * decimals
338
+ * view
339
+ */
340
+ decimals(): Promise<bigint>;
341
+ /**
342
+ * name
343
+ * view
344
+ */
345
+ name(): Promise<string>;
346
+ /**
347
+ * symbol
348
+ * view
349
+ */
350
+ symbol(): Promise<string>;
351
+ /**
352
+ * totalSupply
353
+ * view
354
+ */
355
+ totalSupply(): Promise<bigint>;
356
+ /**
357
+ * approve
358
+ * nonpayable
359
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
360
+ */
361
+ approve(spender: `0x${string}`, value: bigint, options?: {
362
+ accessList?: import('viem').AccessList;
363
+ authorizationList?: import('viem').AuthorizationList;
364
+ chain?: import('viem').Chain | null;
365
+ dataSuffix?: `0x${string}`;
366
+ gas?: bigint;
367
+ gasPrice?: bigint;
368
+ maxFeePerGas?: bigint;
369
+ maxPriorityFeePerGas?: bigint;
370
+ nonce?: number;
371
+ value?: bigint;
372
+ }): Promise<`0x${string}`>;
373
+ /**
374
+ * transfer
375
+ * nonpayable
376
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
377
+ */
378
+ transfer(to: `0x${string}`, value: bigint, options?: {
379
+ accessList?: import('viem').AccessList;
380
+ authorizationList?: import('viem').AuthorizationList;
381
+ chain?: import('viem').Chain | null;
382
+ dataSuffix?: `0x${string}`;
383
+ gas?: bigint;
384
+ gasPrice?: bigint;
385
+ maxFeePerGas?: bigint;
386
+ maxPriorityFeePerGas?: bigint;
387
+ nonce?: number;
388
+ value?: bigint;
389
+ }): Promise<`0x${string}`>;
390
+ /**
391
+ * transferFrom
392
+ * nonpayable
393
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
394
+ */
395
+ transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
396
+ accessList?: import('viem').AccessList;
397
+ authorizationList?: import('viem').AuthorizationList;
398
+ chain?: import('viem').Chain | null;
399
+ dataSuffix?: `0x${string}`;
400
+ gas?: bigint;
401
+ gasPrice?: bigint;
402
+ maxFeePerGas?: bigint;
403
+ maxPriorityFeePerGas?: bigint;
404
+ nonce?: number;
405
+ value?: bigint;
406
+ }): Promise<`0x${string}`>;
407
+ /**
408
+ * Simulate contract write operations (dry-run without sending transaction)
409
+ *
410
+ * @example
411
+ * const result = await contract.simulate.transfer('0x...', 1000n);
412
+ * console.log('Gas estimate:', result.request.gas);
413
+ * console.log('Would succeed:', result.result);
414
+ */
415
+ get simulate(): {
416
+ /**
417
+ * Simulate approve
418
+ * Returns gas estimate and result without sending transaction
419
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
420
+ */
421
+ approve(spender: `0x${string}`, value: bigint, options?: {
422
+ accessList?: import("viem").AccessList;
423
+ authorizationList?: import("viem").AuthorizationList;
424
+ chain?: import("viem").Chain | null;
425
+ dataSuffix?: `0x${string}`;
426
+ gas?: bigint;
427
+ gasPrice?: bigint;
428
+ maxFeePerGas?: bigint;
429
+ maxPriorityFeePerGas?: bigint;
430
+ nonce?: number;
431
+ value?: bigint;
432
+ }): Promise<boolean>;
433
+ /**
434
+ * Simulate transfer
435
+ * Returns gas estimate and result without sending transaction
436
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
437
+ */
438
+ transfer(to: `0x${string}`, value: bigint, options?: {
439
+ accessList?: import("viem").AccessList;
440
+ authorizationList?: import("viem").AuthorizationList;
441
+ chain?: import("viem").Chain | null;
442
+ dataSuffix?: `0x${string}`;
443
+ gas?: bigint;
444
+ gasPrice?: bigint;
445
+ maxFeePerGas?: bigint;
446
+ maxPriorityFeePerGas?: bigint;
447
+ nonce?: number;
448
+ value?: bigint;
449
+ }): Promise<boolean>;
450
+ /**
451
+ * Simulate transferFrom
452
+ * Returns gas estimate and result without sending transaction
453
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
454
+ */
455
+ transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
456
+ accessList?: import("viem").AccessList;
457
+ authorizationList?: import("viem").AuthorizationList;
458
+ chain?: import("viem").Chain | null;
459
+ dataSuffix?: `0x${string}`;
460
+ gas?: bigint;
461
+ gasPrice?: bigint;
462
+ maxFeePerGas?: bigint;
463
+ maxPriorityFeePerGas?: bigint;
464
+ nonce?: number;
465
+ value?: bigint;
466
+ }): Promise<boolean>;
467
+ };
468
+ /**
469
+ * Watch contract events
470
+ *
471
+ * @example
472
+ * // Watch all Transfer events
473
+ * const unwatch = contract.watch.Transfer((event) => {
474
+ * console.log('Transfer:', event);
475
+ * });
476
+ *
477
+ * // Stop watching
478
+ * unwatch();
479
+ */
480
+ get watch(): {
481
+ /**
482
+ * Watch Approval events
483
+ * @param callback Function to call when event is emitted
484
+ * @param filter Optional filter for indexed parameters
485
+ * @returns Unwatch function to stop listening
486
+ */
487
+ Approval: (callback: (event: {
488
+ owner: `0x${string}`;
489
+ spender: `0x${string}`;
490
+ value: bigint;
491
+ }) => void, filter?: {
492
+ owner: `0x${string}`;
493
+ spender: `0x${string}`;
494
+ }) => () => void;
495
+ /**
496
+ * Watch Transfer events
497
+ * @param callback Function to call when event is emitted
498
+ * @param filter Optional filter for indexed parameters
499
+ * @returns Unwatch function to stop listening
500
+ */
501
+ Transfer: (callback: (event: {
502
+ from: `0x${string}`;
503
+ to: `0x${string}`;
504
+ value: bigint;
505
+ }) => void, filter?: {
506
+ from: `0x${string}`;
507
+ to: `0x${string}`;
508
+ }) => () => void;
509
+ };
510
+ }