@gitmyabi/usdc 1.0.2 → 1.0.3

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