@gitmyabi/usdc 1.0.3 → 1.0.5
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 +4 -4
- package/contracts/{StandardERC20_json.d.ts → StandardERC20.d.ts} +16 -20
- package/contracts/{StandardERC20_json.js → StandardERC20.js} +12 -17
- package/contracts/{StandardERC20_json.ts → StandardERC20.ts} +20 -25
- package/contracts/index.d.ts +2 -2
- package/contracts/index.js +4 -4
- package/contracts/index.ts +2 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Auto-generated TypeScript type bindings for **USDC**
|
|
4
4
|
|
|
5
|
-
- **Build ID**: `etherscan-usdc-
|
|
5
|
+
- **Build ID**: `etherscan-usdc-6881f254-1794254763226`
|
|
6
6
|
- **Build Number**: 1
|
|
7
|
-
- **Commit**: `
|
|
7
|
+
- **Commit**: `89dd576`
|
|
8
8
|
- **Branch**: `etherscan`
|
|
9
9
|
- **Target**: `ethers-v6`
|
|
10
10
|
- **Contracts**: 1
|
|
@@ -12,7 +12,7 @@ Auto-generated TypeScript type bindings for **USDC**
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
npm install @gitmyabi/usdc@1.0.
|
|
15
|
+
npm install @gitmyabi/usdc@1.0.5
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
@@ -105,4 +105,4 @@ This package includes type bindings for 1 contract(s) generated from ABI artifac
|
|
|
105
105
|
|
|
106
106
|
## License
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
Apache License 2.0
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* StandardERC20 ABI
|
|
4
4
|
*
|
|
5
5
|
* This ABI is typed using viem's type system for full type safety.
|
|
6
6
|
*/
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const StandardERC20Abi: readonly [{
|
|
8
8
|
readonly inputs: readonly [{
|
|
9
9
|
readonly internalType: "string";
|
|
10
10
|
readonly name: "name_";
|
|
@@ -21,10 +21,6 @@ export declare const StandardERC20_jsonAbi: readonly [{
|
|
|
21
21
|
readonly internalType: "uint256";
|
|
22
22
|
readonly name: "initialBalance_";
|
|
23
23
|
readonly type: "uint256";
|
|
24
|
-
}, {
|
|
25
|
-
readonly internalType: "address";
|
|
26
|
-
readonly name: "initialOwner_";
|
|
27
|
-
readonly type: "address";
|
|
28
24
|
}, {
|
|
29
25
|
readonly internalType: "bytes";
|
|
30
26
|
readonly name: "signature_";
|
|
@@ -272,15 +268,15 @@ export declare const StandardERC20_jsonAbi: readonly [{
|
|
|
272
268
|
readonly type: "function";
|
|
273
269
|
}];
|
|
274
270
|
/**
|
|
275
|
-
* Type-safe ABI for
|
|
271
|
+
* Type-safe ABI for StandardERC20
|
|
276
272
|
*/
|
|
277
|
-
export type
|
|
273
|
+
export type StandardERC20Abi = typeof StandardERC20Abi;
|
|
278
274
|
/**
|
|
279
|
-
* Contract instance type for
|
|
275
|
+
* Contract instance type for StandardERC20
|
|
280
276
|
*/
|
|
281
|
-
export type
|
|
277
|
+
export type StandardERC20Contract = any;
|
|
282
278
|
/**
|
|
283
|
-
*
|
|
279
|
+
* StandardERC20 Contract Class
|
|
284
280
|
*
|
|
285
281
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
286
282
|
*
|
|
@@ -288,12 +284,12 @@ export type StandardERC20_jsonContract = any;
|
|
|
288
284
|
* ```typescript
|
|
289
285
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
290
286
|
* import { mainnet } from 'viem/chains';
|
|
291
|
-
* import {
|
|
287
|
+
* import { StandardERC20 } from 'StandardERC20';
|
|
292
288
|
*
|
|
293
289
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
294
290
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
295
291
|
*
|
|
296
|
-
* const contract = new
|
|
292
|
+
* const contract = new StandardERC20('0x...', { publicClient, walletClient });
|
|
297
293
|
*
|
|
298
294
|
* // Read functions
|
|
299
295
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -311,7 +307,7 @@ export type StandardERC20_jsonContract = any;
|
|
|
311
307
|
* });
|
|
312
308
|
* ```
|
|
313
309
|
*/
|
|
314
|
-
export declare class
|
|
310
|
+
export declare class StandardERC20 {
|
|
315
311
|
private contract;
|
|
316
312
|
private contractAddress;
|
|
317
313
|
private publicClient;
|
|
@@ -324,9 +320,9 @@ export declare class StandardERC20_json {
|
|
|
324
320
|
*/
|
|
325
321
|
get address(): Address;
|
|
326
322
|
/**
|
|
327
|
-
* Get the underlying viem contract instance
|
|
323
|
+
* Get the underlying viem contract instance.
|
|
328
324
|
*/
|
|
329
|
-
getContract():
|
|
325
|
+
getContract(): StandardERC20Contract;
|
|
330
326
|
/**
|
|
331
327
|
* allowance
|
|
332
328
|
* view
|
|
@@ -493,8 +489,8 @@ export declare class StandardERC20_json {
|
|
|
493
489
|
spender: `0x${string}`;
|
|
494
490
|
value: bigint;
|
|
495
491
|
}) => void, filter?: {
|
|
496
|
-
owner
|
|
497
|
-
spender
|
|
492
|
+
owner?: `0x${string}` | `0x${string}`[] | null;
|
|
493
|
+
spender?: `0x${string}` | `0x${string}`[] | null;
|
|
498
494
|
}) => () => void;
|
|
499
495
|
/**
|
|
500
496
|
* Watch Transfer events
|
|
@@ -507,8 +503,8 @@ export declare class StandardERC20_json {
|
|
|
507
503
|
to: `0x${string}`;
|
|
508
504
|
value: bigint;
|
|
509
505
|
}) => void, filter?: {
|
|
510
|
-
from
|
|
511
|
-
to
|
|
506
|
+
from?: `0x${string}` | `0x${string}`[] | null;
|
|
507
|
+
to?: `0x${string}` | `0x${string}`[] | null;
|
|
512
508
|
}) => () => void;
|
|
513
509
|
};
|
|
514
510
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.StandardERC20 = exports.StandardERC20Abi = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* StandardERC20 ABI
|
|
7
7
|
*
|
|
8
8
|
* This ABI is typed using viem's type system for full type safety.
|
|
9
9
|
*/
|
|
10
|
-
exports.
|
|
10
|
+
exports.StandardERC20Abi = [
|
|
11
11
|
{
|
|
12
12
|
"inputs": [
|
|
13
13
|
{
|
|
@@ -30,11 +30,6 @@ exports.StandardERC20_jsonAbi = [
|
|
|
30
30
|
"name": "initialBalance_",
|
|
31
31
|
"type": "uint256"
|
|
32
32
|
},
|
|
33
|
-
{
|
|
34
|
-
"internalType": "address",
|
|
35
|
-
"name": "initialOwner_",
|
|
36
|
-
"type": "address"
|
|
37
|
-
},
|
|
38
33
|
{
|
|
39
34
|
"internalType": "bytes",
|
|
40
35
|
"name": "signature_",
|
|
@@ -359,7 +354,7 @@ exports.StandardERC20_jsonAbi = [
|
|
|
359
354
|
}
|
|
360
355
|
];
|
|
361
356
|
/**
|
|
362
|
-
*
|
|
357
|
+
* StandardERC20 Contract Class
|
|
363
358
|
*
|
|
364
359
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
365
360
|
*
|
|
@@ -367,12 +362,12 @@ exports.StandardERC20_jsonAbi = [
|
|
|
367
362
|
* ```typescript
|
|
368
363
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
369
364
|
* import { mainnet } from 'viem/chains';
|
|
370
|
-
* import {
|
|
365
|
+
* import { StandardERC20 } from 'StandardERC20';
|
|
371
366
|
*
|
|
372
367
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
373
368
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
374
369
|
*
|
|
375
|
-
* const contract = new
|
|
370
|
+
* const contract = new StandardERC20('0x...', { publicClient, walletClient });
|
|
376
371
|
*
|
|
377
372
|
* // Read functions
|
|
378
373
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -390,13 +385,13 @@ exports.StandardERC20_jsonAbi = [
|
|
|
390
385
|
* });
|
|
391
386
|
* ```
|
|
392
387
|
*/
|
|
393
|
-
class
|
|
388
|
+
class StandardERC20 {
|
|
394
389
|
constructor(address, clients) {
|
|
395
390
|
this.contractAddress = address;
|
|
396
391
|
this.publicClient = clients.publicClient;
|
|
397
392
|
this.contract = (0, viem_1.getContract)({
|
|
398
393
|
address,
|
|
399
|
-
abi: exports.
|
|
394
|
+
abi: exports.StandardERC20Abi,
|
|
400
395
|
client: {
|
|
401
396
|
public: clients.publicClient,
|
|
402
397
|
wallet: clients.walletClient,
|
|
@@ -410,7 +405,7 @@ class StandardERC20_json {
|
|
|
410
405
|
return this.contractAddress;
|
|
411
406
|
}
|
|
412
407
|
/**
|
|
413
|
-
* Get the underlying viem contract instance
|
|
408
|
+
* Get the underlying viem contract instance.
|
|
414
409
|
*/
|
|
415
410
|
getContract() {
|
|
416
411
|
return this.contract;
|
|
@@ -553,7 +548,7 @@ class StandardERC20_json {
|
|
|
553
548
|
Approval: (callback, filter) => {
|
|
554
549
|
return this.publicClient.watchContractEvent({
|
|
555
550
|
address: this.contractAddress,
|
|
556
|
-
abi: exports.
|
|
551
|
+
abi: exports.StandardERC20Abi,
|
|
557
552
|
eventName: 'Approval',
|
|
558
553
|
args: filter,
|
|
559
554
|
onLogs: (logs) => {
|
|
@@ -572,7 +567,7 @@ class StandardERC20_json {
|
|
|
572
567
|
Transfer: (callback, filter) => {
|
|
573
568
|
return this.publicClient.watchContractEvent({
|
|
574
569
|
address: this.contractAddress,
|
|
575
|
-
abi: exports.
|
|
570
|
+
abi: exports.StandardERC20Abi,
|
|
576
571
|
eventName: 'Transfer',
|
|
577
572
|
args: filter,
|
|
578
573
|
onLogs: (logs) => {
|
|
@@ -585,4 +580,4 @@ class StandardERC20_json {
|
|
|
585
580
|
};
|
|
586
581
|
}
|
|
587
582
|
}
|
|
588
|
-
exports.
|
|
583
|
+
exports.StandardERC20 = StandardERC20;
|
|
@@ -2,11 +2,11 @@ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType }
|
|
|
2
2
|
import { getContract } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* StandardERC20 ABI
|
|
6
6
|
*
|
|
7
7
|
* This ABI is typed using viem's type system for full type safety.
|
|
8
8
|
*/
|
|
9
|
-
export const
|
|
9
|
+
export const StandardERC20Abi = [
|
|
10
10
|
{
|
|
11
11
|
"inputs": [
|
|
12
12
|
{
|
|
@@ -29,11 +29,6 @@ export const StandardERC20_jsonAbi = [
|
|
|
29
29
|
"name": "initialBalance_",
|
|
30
30
|
"type": "uint256"
|
|
31
31
|
},
|
|
32
|
-
{
|
|
33
|
-
"internalType": "address",
|
|
34
|
-
"name": "initialOwner_",
|
|
35
|
-
"type": "address"
|
|
36
|
-
},
|
|
37
32
|
{
|
|
38
33
|
"internalType": "bytes",
|
|
39
34
|
"name": "signature_",
|
|
@@ -359,19 +354,19 @@ export const StandardERC20_jsonAbi = [
|
|
|
359
354
|
] as const satisfies Abi;
|
|
360
355
|
|
|
361
356
|
/**
|
|
362
|
-
* Type-safe ABI for
|
|
357
|
+
* Type-safe ABI for StandardERC20
|
|
363
358
|
*/
|
|
364
|
-
export type
|
|
359
|
+
export type StandardERC20Abi = typeof StandardERC20Abi;
|
|
365
360
|
|
|
366
361
|
/**
|
|
367
|
-
* Contract instance type for
|
|
362
|
+
* Contract instance type for StandardERC20
|
|
368
363
|
*/
|
|
369
364
|
// Use any for contract type to avoid complex viem type issues
|
|
370
365
|
// The runtime behavior is type-safe through viem's ABI typing
|
|
371
|
-
export type
|
|
366
|
+
export type StandardERC20Contract = any;
|
|
372
367
|
|
|
373
368
|
/**
|
|
374
|
-
*
|
|
369
|
+
* StandardERC20 Contract Class
|
|
375
370
|
*
|
|
376
371
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
377
372
|
*
|
|
@@ -379,12 +374,12 @@ export type StandardERC20_jsonContract = any;
|
|
|
379
374
|
* ```typescript
|
|
380
375
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
381
376
|
* import { mainnet } from 'viem/chains';
|
|
382
|
-
* import {
|
|
377
|
+
* import { StandardERC20 } from 'StandardERC20';
|
|
383
378
|
*
|
|
384
379
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
385
380
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
386
381
|
*
|
|
387
|
-
* const contract = new
|
|
382
|
+
* const contract = new StandardERC20('0x...', { publicClient, walletClient });
|
|
388
383
|
*
|
|
389
384
|
* // Read functions
|
|
390
385
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -402,8 +397,8 @@ export type StandardERC20_jsonContract = any;
|
|
|
402
397
|
* });
|
|
403
398
|
* ```
|
|
404
399
|
*/
|
|
405
|
-
export class
|
|
406
|
-
private contract:
|
|
400
|
+
export class StandardERC20 {
|
|
401
|
+
private contract: StandardERC20Contract;
|
|
407
402
|
private contractAddress: Address;
|
|
408
403
|
private publicClient: PublicClient;
|
|
409
404
|
|
|
@@ -418,7 +413,7 @@ export class StandardERC20_json {
|
|
|
418
413
|
this.publicClient = clients.publicClient;
|
|
419
414
|
this.contract = getContract({
|
|
420
415
|
address,
|
|
421
|
-
abi:
|
|
416
|
+
abi: StandardERC20Abi,
|
|
422
417
|
client: {
|
|
423
418
|
public: clients.publicClient,
|
|
424
419
|
wallet: clients.walletClient,
|
|
@@ -434,9 +429,9 @@ export class StandardERC20_json {
|
|
|
434
429
|
}
|
|
435
430
|
|
|
436
431
|
/**
|
|
437
|
-
* Get the underlying viem contract instance
|
|
432
|
+
* Get the underlying viem contract instance.
|
|
438
433
|
*/
|
|
439
|
-
getContract():
|
|
434
|
+
getContract(): StandardERC20Contract {
|
|
440
435
|
return this.contract;
|
|
441
436
|
}
|
|
442
437
|
|
|
@@ -653,12 +648,12 @@ export class StandardERC20_json {
|
|
|
653
648
|
* @param filter Optional filter for indexed parameters
|
|
654
649
|
* @returns Unwatch function to stop listening
|
|
655
650
|
*/
|
|
656
|
-
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner
|
|
651
|
+
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner?: `0x${string}` | `0x${string}`[] | null; spender?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
657
652
|
return this.publicClient.watchContractEvent({
|
|
658
653
|
address: this.contractAddress,
|
|
659
|
-
abi:
|
|
654
|
+
abi: StandardERC20Abi,
|
|
660
655
|
eventName: 'Approval',
|
|
661
|
-
args: filter,
|
|
656
|
+
args: filter as any,
|
|
662
657
|
onLogs: (logs: any[]) => {
|
|
663
658
|
logs.forEach((log: any) => {
|
|
664
659
|
callback(log.args as any);
|
|
@@ -672,12 +667,12 @@ export class StandardERC20_json {
|
|
|
672
667
|
* @param filter Optional filter for indexed parameters
|
|
673
668
|
* @returns Unwatch function to stop listening
|
|
674
669
|
*/
|
|
675
|
-
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from
|
|
670
|
+
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from?: `0x${string}` | `0x${string}`[] | null; to?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
676
671
|
return this.publicClient.watchContractEvent({
|
|
677
672
|
address: this.contractAddress,
|
|
678
|
-
abi:
|
|
673
|
+
abi: StandardERC20Abi,
|
|
679
674
|
eventName: 'Transfer',
|
|
680
|
-
args: filter,
|
|
675
|
+
args: filter as any,
|
|
681
676
|
onLogs: (logs: any[]) => {
|
|
682
677
|
logs.forEach((log: any) => {
|
|
683
678
|
callback(log.args as any);
|
package/contracts/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { StandardERC20Abi, StandardERC20 } from './StandardERC20';
|
|
2
|
+
export type { StandardERC20Abi as StandardERC20AbiType, StandardERC20Contract } from './StandardERC20';
|
package/contracts/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.StandardERC20 = exports.StandardERC20Abi = void 0;
|
|
4
4
|
// Auto-generated exports for all contracts
|
|
5
|
-
var
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
Object.defineProperty(exports, "
|
|
5
|
+
var StandardERC20_1 = require("./StandardERC20");
|
|
6
|
+
Object.defineProperty(exports, "StandardERC20Abi", { enumerable: true, get: function () { return StandardERC20_1.StandardERC20Abi; } });
|
|
7
|
+
Object.defineProperty(exports, "StandardERC20", { enumerable: true, get: function () { return StandardERC20_1.StandardERC20; } });
|
package/contracts/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Auto-generated exports for all contracts
|
|
2
|
-
export {
|
|
3
|
-
export type {
|
|
2
|
+
export { StandardERC20Abi, StandardERC20 } from './StandardERC20';
|
|
3
|
+
export type { StandardERC20Abi as StandardERC20AbiType, StandardERC20Contract } from './StandardERC20';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitmyabi/usdc",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Auto-generated TypeScript type bindings for USDC (build etherscan-usdc-
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "Auto-generated TypeScript type bindings for USDC (build etherscan-usdc-6881f254-1794254763226, commit 89dd576, branch etherscan)",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"abi",
|
|
31
31
|
"ethers-v6"
|
|
32
32
|
],
|
|
33
|
-
"license": "
|
|
33
|
+
"license": "Apache-2.0",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"viem": "^2.0.0"
|
|
36
36
|
},
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"url": "https://github.com/etherscan/usdc"
|
|
40
40
|
},
|
|
41
41
|
"branch": "etherscan",
|
|
42
|
-
"shortHash": "
|
|
42
|
+
"shortHash": "89dd576"
|
|
43
43
|
}
|