@gitmyabi/usdc 1.0.3 → 1.0.4
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 +3 -3
- package/contracts/{StandardERC20_json.d.ts → USDCoin_json.d.ts} +27 -119
- package/contracts/{StandardERC20_json.js → USDCoin_json.js} +35 -157
- package/contracts/{StandardERC20_json.ts → USDCoin_json.ts} +39 -161
- package/contracts/index.d.ts +2 -2
- package/contracts/index.js +4 -4
- package/contracts/index.ts +2 -2
- package/package.json +3 -3
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-82739e7d-1790865370934`
|
|
6
6
|
- **Build Number**: 1
|
|
7
|
-
- **Commit**: `
|
|
7
|
+
- **Commit**: `401acf6`
|
|
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.4
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
@@ -1,105 +1,13 @@
|
|
|
1
1
|
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* USDCoin_json ABI
|
|
4
4
|
*
|
|
5
5
|
* This ABI is typed using viem's type system for full type safety.
|
|
6
6
|
*/
|
|
7
|
-
export declare const
|
|
8
|
-
readonly inputs: readonly [
|
|
9
|
-
|
|
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";
|
|
7
|
+
export declare const USDCoin_jsonAbi: readonly [{
|
|
8
|
+
readonly inputs: readonly [];
|
|
9
|
+
readonly stateMutability: "nonpayable";
|
|
38
10
|
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
11
|
}, {
|
|
104
12
|
readonly anonymous: false;
|
|
105
13
|
readonly inputs: readonly [{
|
|
@@ -143,11 +51,11 @@ export declare const StandardERC20_jsonAbi: readonly [{
|
|
|
143
51
|
}, {
|
|
144
52
|
readonly inputs: readonly [{
|
|
145
53
|
readonly internalType: "address";
|
|
146
|
-
readonly name: "
|
|
54
|
+
readonly name: "";
|
|
147
55
|
readonly type: "address";
|
|
148
56
|
}, {
|
|
149
57
|
readonly internalType: "address";
|
|
150
|
-
readonly name: "
|
|
58
|
+
readonly name: "";
|
|
151
59
|
readonly type: "address";
|
|
152
60
|
}];
|
|
153
61
|
readonly name: "allowance";
|
|
@@ -165,7 +73,7 @@ export declare const StandardERC20_jsonAbi: readonly [{
|
|
|
165
73
|
readonly type: "address";
|
|
166
74
|
}, {
|
|
167
75
|
readonly internalType: "uint256";
|
|
168
|
-
readonly name: "
|
|
76
|
+
readonly name: "amount";
|
|
169
77
|
readonly type: "uint256";
|
|
170
78
|
}];
|
|
171
79
|
readonly name: "approve";
|
|
@@ -179,7 +87,7 @@ export declare const StandardERC20_jsonAbi: readonly [{
|
|
|
179
87
|
}, {
|
|
180
88
|
readonly inputs: readonly [{
|
|
181
89
|
readonly internalType: "address";
|
|
182
|
-
readonly name: "
|
|
90
|
+
readonly name: "";
|
|
183
91
|
readonly type: "address";
|
|
184
92
|
}];
|
|
185
93
|
readonly name: "balanceOf";
|
|
@@ -237,7 +145,7 @@ export declare const StandardERC20_jsonAbi: readonly [{
|
|
|
237
145
|
readonly type: "address";
|
|
238
146
|
}, {
|
|
239
147
|
readonly internalType: "uint256";
|
|
240
|
-
readonly name: "
|
|
148
|
+
readonly name: "amount";
|
|
241
149
|
readonly type: "uint256";
|
|
242
150
|
}];
|
|
243
151
|
readonly name: "transfer";
|
|
@@ -259,7 +167,7 @@ export declare const StandardERC20_jsonAbi: readonly [{
|
|
|
259
167
|
readonly type: "address";
|
|
260
168
|
}, {
|
|
261
169
|
readonly internalType: "uint256";
|
|
262
|
-
readonly name: "
|
|
170
|
+
readonly name: "amount";
|
|
263
171
|
readonly type: "uint256";
|
|
264
172
|
}];
|
|
265
173
|
readonly name: "transferFrom";
|
|
@@ -272,15 +180,15 @@ export declare const StandardERC20_jsonAbi: readonly [{
|
|
|
272
180
|
readonly type: "function";
|
|
273
181
|
}];
|
|
274
182
|
/**
|
|
275
|
-
* Type-safe ABI for
|
|
183
|
+
* Type-safe ABI for USDCoin_json
|
|
276
184
|
*/
|
|
277
|
-
export type
|
|
185
|
+
export type USDCoin_jsonAbi = typeof USDCoin_jsonAbi;
|
|
278
186
|
/**
|
|
279
|
-
* Contract instance type for
|
|
187
|
+
* Contract instance type for USDCoin_json
|
|
280
188
|
*/
|
|
281
|
-
export type
|
|
189
|
+
export type USDCoin_jsonContract = any;
|
|
282
190
|
/**
|
|
283
|
-
*
|
|
191
|
+
* USDCoin_json Contract Class
|
|
284
192
|
*
|
|
285
193
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
286
194
|
*
|
|
@@ -288,12 +196,12 @@ export type StandardERC20_jsonContract = any;
|
|
|
288
196
|
* ```typescript
|
|
289
197
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
290
198
|
* import { mainnet } from 'viem/chains';
|
|
291
|
-
* import {
|
|
199
|
+
* import { USDCoin_json } from 'USDCoin_json';
|
|
292
200
|
*
|
|
293
201
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
294
202
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
295
203
|
*
|
|
296
|
-
* const contract = new
|
|
204
|
+
* const contract = new USDCoin_json('0x...', { publicClient, walletClient });
|
|
297
205
|
*
|
|
298
206
|
* // Read functions
|
|
299
207
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -311,7 +219,7 @@ export type StandardERC20_jsonContract = any;
|
|
|
311
219
|
* });
|
|
312
220
|
* ```
|
|
313
221
|
*/
|
|
314
|
-
export declare class
|
|
222
|
+
export declare class USDCoin_json {
|
|
315
223
|
private contract;
|
|
316
224
|
private contractAddress;
|
|
317
225
|
private publicClient;
|
|
@@ -326,17 +234,17 @@ export declare class StandardERC20_json {
|
|
|
326
234
|
/**
|
|
327
235
|
* Get the underlying viem contract instance
|
|
328
236
|
*/
|
|
329
|
-
getContract():
|
|
237
|
+
getContract(): USDCoin_jsonContract;
|
|
330
238
|
/**
|
|
331
239
|
* allowance
|
|
332
240
|
* view
|
|
333
241
|
*/
|
|
334
|
-
allowance(
|
|
242
|
+
allowance(arg0: `0x${string}`, arg1: `0x${string}`): Promise<bigint>;
|
|
335
243
|
/**
|
|
336
244
|
* balanceOf
|
|
337
245
|
* view
|
|
338
246
|
*/
|
|
339
|
-
balanceOf(
|
|
247
|
+
balanceOf(arg0: `0x${string}`): Promise<bigint>;
|
|
340
248
|
/**
|
|
341
249
|
* decimals
|
|
342
250
|
* view
|
|
@@ -362,7 +270,7 @@ export declare class StandardERC20_json {
|
|
|
362
270
|
* nonpayable
|
|
363
271
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
364
272
|
*/
|
|
365
|
-
approve(spender: `0x${string}`,
|
|
273
|
+
approve(spender: `0x${string}`, amount: bigint, options?: {
|
|
366
274
|
accessList?: import('viem').AccessList;
|
|
367
275
|
authorizationList?: import('viem').AuthorizationList;
|
|
368
276
|
chain?: import('viem').Chain | null;
|
|
@@ -379,7 +287,7 @@ export declare class StandardERC20_json {
|
|
|
379
287
|
* nonpayable
|
|
380
288
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
381
289
|
*/
|
|
382
|
-
transfer(to: `0x${string}`,
|
|
290
|
+
transfer(to: `0x${string}`, amount: bigint, options?: {
|
|
383
291
|
accessList?: import('viem').AccessList;
|
|
384
292
|
authorizationList?: import('viem').AuthorizationList;
|
|
385
293
|
chain?: import('viem').Chain | null;
|
|
@@ -396,7 +304,7 @@ export declare class StandardERC20_json {
|
|
|
396
304
|
* nonpayable
|
|
397
305
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
398
306
|
*/
|
|
399
|
-
transferFrom(from: `0x${string}`, to: `0x${string}`,
|
|
307
|
+
transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
|
|
400
308
|
accessList?: import('viem').AccessList;
|
|
401
309
|
authorizationList?: import('viem').AuthorizationList;
|
|
402
310
|
chain?: import('viem').Chain | null;
|
|
@@ -422,7 +330,7 @@ export declare class StandardERC20_json {
|
|
|
422
330
|
* Returns gas estimate and result without sending transaction
|
|
423
331
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
424
332
|
*/
|
|
425
|
-
approve(spender: `0x${string}`,
|
|
333
|
+
approve(spender: `0x${string}`, amount: bigint, options?: {
|
|
426
334
|
accessList?: import("viem").AccessList;
|
|
427
335
|
authorizationList?: import("viem").AuthorizationList;
|
|
428
336
|
chain?: import("viem").Chain | null;
|
|
@@ -439,7 +347,7 @@ export declare class StandardERC20_json {
|
|
|
439
347
|
* Returns gas estimate and result without sending transaction
|
|
440
348
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
441
349
|
*/
|
|
442
|
-
transfer(to: `0x${string}`,
|
|
350
|
+
transfer(to: `0x${string}`, amount: bigint, options?: {
|
|
443
351
|
accessList?: import("viem").AccessList;
|
|
444
352
|
authorizationList?: import("viem").AuthorizationList;
|
|
445
353
|
chain?: import("viem").Chain | null;
|
|
@@ -456,7 +364,7 @@ export declare class StandardERC20_json {
|
|
|
456
364
|
* Returns gas estimate and result without sending transaction
|
|
457
365
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
458
366
|
*/
|
|
459
|
-
transferFrom(from: `0x${string}`, to: `0x${string}`,
|
|
367
|
+
transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
|
|
460
368
|
accessList?: import("viem").AccessList;
|
|
461
369
|
authorizationList?: import("viem").AuthorizationList;
|
|
462
370
|
chain?: import("viem").Chain | null;
|
|
@@ -1,140 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.USDCoin_json = exports.USDCoin_jsonAbi = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* USDCoin_json ABI
|
|
7
7
|
*
|
|
8
8
|
* This ABI is typed using viem's type system for full type safety.
|
|
9
9
|
*/
|
|
10
|
-
exports.
|
|
10
|
+
exports.USDCoin_jsonAbi = [
|
|
11
11
|
{
|
|
12
|
-
"inputs": [
|
|
13
|
-
|
|
14
|
-
"internalType": "string",
|
|
15
|
-
"name": "name_",
|
|
16
|
-
"type": "string"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"internalType": "string",
|
|
20
|
-
"name": "symbol_",
|
|
21
|
-
"type": "string"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"internalType": "uint8",
|
|
25
|
-
"name": "decimals_",
|
|
26
|
-
"type": "uint8"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"internalType": "uint256",
|
|
30
|
-
"name": "initialBalance_",
|
|
31
|
-
"type": "uint256"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"internalType": "address",
|
|
35
|
-
"name": "initialOwner_",
|
|
36
|
-
"type": "address"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"internalType": "bytes",
|
|
40
|
-
"name": "signature_",
|
|
41
|
-
"type": "bytes"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"internalType": "address payable",
|
|
45
|
-
"name": "feeReceiver_",
|
|
46
|
-
"type": "address"
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
"stateMutability": "payable",
|
|
12
|
+
"inputs": [],
|
|
13
|
+
"stateMutability": "nonpayable",
|
|
50
14
|
"type": "constructor"
|
|
51
15
|
},
|
|
52
|
-
{
|
|
53
|
-
"inputs": [
|
|
54
|
-
{
|
|
55
|
-
"internalType": "address",
|
|
56
|
-
"name": "spender",
|
|
57
|
-
"type": "address"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"internalType": "uint256",
|
|
61
|
-
"name": "allowance",
|
|
62
|
-
"type": "uint256"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"internalType": "uint256",
|
|
66
|
-
"name": "needed",
|
|
67
|
-
"type": "uint256"
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"name": "ERC20InsufficientAllowance",
|
|
71
|
-
"type": "error"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"inputs": [
|
|
75
|
-
{
|
|
76
|
-
"internalType": "address",
|
|
77
|
-
"name": "sender",
|
|
78
|
-
"type": "address"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"internalType": "uint256",
|
|
82
|
-
"name": "balance",
|
|
83
|
-
"type": "uint256"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"internalType": "uint256",
|
|
87
|
-
"name": "needed",
|
|
88
|
-
"type": "uint256"
|
|
89
|
-
}
|
|
90
|
-
],
|
|
91
|
-
"name": "ERC20InsufficientBalance",
|
|
92
|
-
"type": "error"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"inputs": [
|
|
96
|
-
{
|
|
97
|
-
"internalType": "address",
|
|
98
|
-
"name": "approver",
|
|
99
|
-
"type": "address"
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
"name": "ERC20InvalidApprover",
|
|
103
|
-
"type": "error"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"inputs": [
|
|
107
|
-
{
|
|
108
|
-
"internalType": "address",
|
|
109
|
-
"name": "receiver",
|
|
110
|
-
"type": "address"
|
|
111
|
-
}
|
|
112
|
-
],
|
|
113
|
-
"name": "ERC20InvalidReceiver",
|
|
114
|
-
"type": "error"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"inputs": [
|
|
118
|
-
{
|
|
119
|
-
"internalType": "address",
|
|
120
|
-
"name": "sender",
|
|
121
|
-
"type": "address"
|
|
122
|
-
}
|
|
123
|
-
],
|
|
124
|
-
"name": "ERC20InvalidSender",
|
|
125
|
-
"type": "error"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"inputs": [
|
|
129
|
-
{
|
|
130
|
-
"internalType": "address",
|
|
131
|
-
"name": "spender",
|
|
132
|
-
"type": "address"
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
"name": "ERC20InvalidSpender",
|
|
136
|
-
"type": "error"
|
|
137
|
-
},
|
|
138
16
|
{
|
|
139
17
|
"anonymous": false,
|
|
140
18
|
"inputs": [
|
|
@@ -189,12 +67,12 @@ exports.StandardERC20_jsonAbi = [
|
|
|
189
67
|
"inputs": [
|
|
190
68
|
{
|
|
191
69
|
"internalType": "address",
|
|
192
|
-
"name": "
|
|
70
|
+
"name": "",
|
|
193
71
|
"type": "address"
|
|
194
72
|
},
|
|
195
73
|
{
|
|
196
74
|
"internalType": "address",
|
|
197
|
-
"name": "
|
|
75
|
+
"name": "",
|
|
198
76
|
"type": "address"
|
|
199
77
|
}
|
|
200
78
|
],
|
|
@@ -218,7 +96,7 @@ exports.StandardERC20_jsonAbi = [
|
|
|
218
96
|
},
|
|
219
97
|
{
|
|
220
98
|
"internalType": "uint256",
|
|
221
|
-
"name": "
|
|
99
|
+
"name": "amount",
|
|
222
100
|
"type": "uint256"
|
|
223
101
|
}
|
|
224
102
|
],
|
|
@@ -237,7 +115,7 @@ exports.StandardERC20_jsonAbi = [
|
|
|
237
115
|
"inputs": [
|
|
238
116
|
{
|
|
239
117
|
"internalType": "address",
|
|
240
|
-
"name": "
|
|
118
|
+
"name": "",
|
|
241
119
|
"type": "address"
|
|
242
120
|
}
|
|
243
121
|
],
|
|
@@ -313,7 +191,7 @@ exports.StandardERC20_jsonAbi = [
|
|
|
313
191
|
},
|
|
314
192
|
{
|
|
315
193
|
"internalType": "uint256",
|
|
316
|
-
"name": "
|
|
194
|
+
"name": "amount",
|
|
317
195
|
"type": "uint256"
|
|
318
196
|
}
|
|
319
197
|
],
|
|
@@ -342,7 +220,7 @@ exports.StandardERC20_jsonAbi = [
|
|
|
342
220
|
},
|
|
343
221
|
{
|
|
344
222
|
"internalType": "uint256",
|
|
345
|
-
"name": "
|
|
223
|
+
"name": "amount",
|
|
346
224
|
"type": "uint256"
|
|
347
225
|
}
|
|
348
226
|
],
|
|
@@ -359,7 +237,7 @@ exports.StandardERC20_jsonAbi = [
|
|
|
359
237
|
}
|
|
360
238
|
];
|
|
361
239
|
/**
|
|
362
|
-
*
|
|
240
|
+
* USDCoin_json Contract Class
|
|
363
241
|
*
|
|
364
242
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
365
243
|
*
|
|
@@ -367,12 +245,12 @@ exports.StandardERC20_jsonAbi = [
|
|
|
367
245
|
* ```typescript
|
|
368
246
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
369
247
|
* import { mainnet } from 'viem/chains';
|
|
370
|
-
* import {
|
|
248
|
+
* import { USDCoin_json } from 'USDCoin_json';
|
|
371
249
|
*
|
|
372
250
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
373
251
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
374
252
|
*
|
|
375
|
-
* const contract = new
|
|
253
|
+
* const contract = new USDCoin_json('0x...', { publicClient, walletClient });
|
|
376
254
|
*
|
|
377
255
|
* // Read functions
|
|
378
256
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -390,13 +268,13 @@ exports.StandardERC20_jsonAbi = [
|
|
|
390
268
|
* });
|
|
391
269
|
* ```
|
|
392
270
|
*/
|
|
393
|
-
class
|
|
271
|
+
class USDCoin_json {
|
|
394
272
|
constructor(address, clients) {
|
|
395
273
|
this.contractAddress = address;
|
|
396
274
|
this.publicClient = clients.publicClient;
|
|
397
275
|
this.contract = (0, viem_1.getContract)({
|
|
398
276
|
address,
|
|
399
|
-
abi: exports.
|
|
277
|
+
abi: exports.USDCoin_jsonAbi,
|
|
400
278
|
client: {
|
|
401
279
|
public: clients.publicClient,
|
|
402
280
|
wallet: clients.walletClient,
|
|
@@ -419,15 +297,15 @@ class StandardERC20_json {
|
|
|
419
297
|
* allowance
|
|
420
298
|
* view
|
|
421
299
|
*/
|
|
422
|
-
async allowance(
|
|
423
|
-
return this.contract.read.allowance([
|
|
300
|
+
async allowance(arg0, arg1) {
|
|
301
|
+
return this.contract.read.allowance([arg0, arg1]);
|
|
424
302
|
}
|
|
425
303
|
/**
|
|
426
304
|
* balanceOf
|
|
427
305
|
* view
|
|
428
306
|
*/
|
|
429
|
-
async balanceOf(
|
|
430
|
-
return this.contract.read.balanceOf([
|
|
307
|
+
async balanceOf(arg0) {
|
|
308
|
+
return this.contract.read.balanceOf([arg0]);
|
|
431
309
|
}
|
|
432
310
|
/**
|
|
433
311
|
* decimals
|
|
@@ -462,33 +340,33 @@ class StandardERC20_json {
|
|
|
462
340
|
* nonpayable
|
|
463
341
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
464
342
|
*/
|
|
465
|
-
async approve(spender,
|
|
343
|
+
async approve(spender, amount, options) {
|
|
466
344
|
if (!this.contract.write) {
|
|
467
345
|
throw new Error('Wallet client is required for write operations');
|
|
468
346
|
}
|
|
469
|
-
return this.contract.write.approve([spender,
|
|
347
|
+
return this.contract.write.approve([spender, amount], options);
|
|
470
348
|
}
|
|
471
349
|
/**
|
|
472
350
|
* transfer
|
|
473
351
|
* nonpayable
|
|
474
352
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
475
353
|
*/
|
|
476
|
-
async transfer(to,
|
|
354
|
+
async transfer(to, amount, options) {
|
|
477
355
|
if (!this.contract.write) {
|
|
478
356
|
throw new Error('Wallet client is required for write operations');
|
|
479
357
|
}
|
|
480
|
-
return this.contract.write.transfer([to,
|
|
358
|
+
return this.contract.write.transfer([to, amount], options);
|
|
481
359
|
}
|
|
482
360
|
/**
|
|
483
361
|
* transferFrom
|
|
484
362
|
* nonpayable
|
|
485
363
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
486
364
|
*/
|
|
487
|
-
async transferFrom(from, to,
|
|
365
|
+
async transferFrom(from, to, amount, options) {
|
|
488
366
|
if (!this.contract.write) {
|
|
489
367
|
throw new Error('Wallet client is required for write operations');
|
|
490
368
|
}
|
|
491
|
-
return this.contract.write.transferFrom([from, to,
|
|
369
|
+
return this.contract.write.transferFrom([from, to, amount], options);
|
|
492
370
|
}
|
|
493
371
|
/**
|
|
494
372
|
* Simulate contract write operations (dry-run without sending transaction)
|
|
@@ -509,24 +387,24 @@ class StandardERC20_json {
|
|
|
509
387
|
* Returns gas estimate and result without sending transaction
|
|
510
388
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
511
389
|
*/
|
|
512
|
-
async approve(spender,
|
|
513
|
-
return contract.simulate.approve([spender,
|
|
390
|
+
async approve(spender, amount, options) {
|
|
391
|
+
return contract.simulate.approve([spender, amount], options);
|
|
514
392
|
},
|
|
515
393
|
/**
|
|
516
394
|
* Simulate transfer
|
|
517
395
|
* Returns gas estimate and result without sending transaction
|
|
518
396
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
519
397
|
*/
|
|
520
|
-
async transfer(to,
|
|
521
|
-
return contract.simulate.transfer([to,
|
|
398
|
+
async transfer(to, amount, options) {
|
|
399
|
+
return contract.simulate.transfer([to, amount], options);
|
|
522
400
|
},
|
|
523
401
|
/**
|
|
524
402
|
* Simulate transferFrom
|
|
525
403
|
* Returns gas estimate and result without sending transaction
|
|
526
404
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
527
405
|
*/
|
|
528
|
-
async transferFrom(from, to,
|
|
529
|
-
return contract.simulate.transferFrom([from, to,
|
|
406
|
+
async transferFrom(from, to, amount, options) {
|
|
407
|
+
return contract.simulate.transferFrom([from, to, amount], options);
|
|
530
408
|
}
|
|
531
409
|
};
|
|
532
410
|
}
|
|
@@ -553,7 +431,7 @@ class StandardERC20_json {
|
|
|
553
431
|
Approval: (callback, filter) => {
|
|
554
432
|
return this.publicClient.watchContractEvent({
|
|
555
433
|
address: this.contractAddress,
|
|
556
|
-
abi: exports.
|
|
434
|
+
abi: exports.USDCoin_jsonAbi,
|
|
557
435
|
eventName: 'Approval',
|
|
558
436
|
args: filter,
|
|
559
437
|
onLogs: (logs) => {
|
|
@@ -572,7 +450,7 @@ class StandardERC20_json {
|
|
|
572
450
|
Transfer: (callback, filter) => {
|
|
573
451
|
return this.publicClient.watchContractEvent({
|
|
574
452
|
address: this.contractAddress,
|
|
575
|
-
abi: exports.
|
|
453
|
+
abi: exports.USDCoin_jsonAbi,
|
|
576
454
|
eventName: 'Transfer',
|
|
577
455
|
args: filter,
|
|
578
456
|
onLogs: (logs) => {
|
|
@@ -585,4 +463,4 @@ class StandardERC20_json {
|
|
|
585
463
|
};
|
|
586
464
|
}
|
|
587
465
|
}
|
|
588
|
-
exports.
|
|
466
|
+
exports.USDCoin_json = USDCoin_json;
|
|
@@ -2,138 +2,16 @@ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType }
|
|
|
2
2
|
import { getContract } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* USDCoin_json 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 USDCoin_jsonAbi = [
|
|
10
10
|
{
|
|
11
|
-
"inputs": [
|
|
12
|
-
|
|
13
|
-
"internalType": "string",
|
|
14
|
-
"name": "name_",
|
|
15
|
-
"type": "string"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"internalType": "string",
|
|
19
|
-
"name": "symbol_",
|
|
20
|
-
"type": "string"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"internalType": "uint8",
|
|
24
|
-
"name": "decimals_",
|
|
25
|
-
"type": "uint8"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"internalType": "uint256",
|
|
29
|
-
"name": "initialBalance_",
|
|
30
|
-
"type": "uint256"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"internalType": "address",
|
|
34
|
-
"name": "initialOwner_",
|
|
35
|
-
"type": "address"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"internalType": "bytes",
|
|
39
|
-
"name": "signature_",
|
|
40
|
-
"type": "bytes"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"internalType": "address payable",
|
|
44
|
-
"name": "feeReceiver_",
|
|
45
|
-
"type": "address"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
"stateMutability": "payable",
|
|
11
|
+
"inputs": [],
|
|
12
|
+
"stateMutability": "nonpayable",
|
|
49
13
|
"type": "constructor"
|
|
50
14
|
},
|
|
51
|
-
{
|
|
52
|
-
"inputs": [
|
|
53
|
-
{
|
|
54
|
-
"internalType": "address",
|
|
55
|
-
"name": "spender",
|
|
56
|
-
"type": "address"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"internalType": "uint256",
|
|
60
|
-
"name": "allowance",
|
|
61
|
-
"type": "uint256"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"internalType": "uint256",
|
|
65
|
-
"name": "needed",
|
|
66
|
-
"type": "uint256"
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
"name": "ERC20InsufficientAllowance",
|
|
70
|
-
"type": "error"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"inputs": [
|
|
74
|
-
{
|
|
75
|
-
"internalType": "address",
|
|
76
|
-
"name": "sender",
|
|
77
|
-
"type": "address"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"internalType": "uint256",
|
|
81
|
-
"name": "balance",
|
|
82
|
-
"type": "uint256"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"internalType": "uint256",
|
|
86
|
-
"name": "needed",
|
|
87
|
-
"type": "uint256"
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
"name": "ERC20InsufficientBalance",
|
|
91
|
-
"type": "error"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"inputs": [
|
|
95
|
-
{
|
|
96
|
-
"internalType": "address",
|
|
97
|
-
"name": "approver",
|
|
98
|
-
"type": "address"
|
|
99
|
-
}
|
|
100
|
-
],
|
|
101
|
-
"name": "ERC20InvalidApprover",
|
|
102
|
-
"type": "error"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"inputs": [
|
|
106
|
-
{
|
|
107
|
-
"internalType": "address",
|
|
108
|
-
"name": "receiver",
|
|
109
|
-
"type": "address"
|
|
110
|
-
}
|
|
111
|
-
],
|
|
112
|
-
"name": "ERC20InvalidReceiver",
|
|
113
|
-
"type": "error"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"inputs": [
|
|
117
|
-
{
|
|
118
|
-
"internalType": "address",
|
|
119
|
-
"name": "sender",
|
|
120
|
-
"type": "address"
|
|
121
|
-
}
|
|
122
|
-
],
|
|
123
|
-
"name": "ERC20InvalidSender",
|
|
124
|
-
"type": "error"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"inputs": [
|
|
128
|
-
{
|
|
129
|
-
"internalType": "address",
|
|
130
|
-
"name": "spender",
|
|
131
|
-
"type": "address"
|
|
132
|
-
}
|
|
133
|
-
],
|
|
134
|
-
"name": "ERC20InvalidSpender",
|
|
135
|
-
"type": "error"
|
|
136
|
-
},
|
|
137
15
|
{
|
|
138
16
|
"anonymous": false,
|
|
139
17
|
"inputs": [
|
|
@@ -188,12 +66,12 @@ export const StandardERC20_jsonAbi = [
|
|
|
188
66
|
"inputs": [
|
|
189
67
|
{
|
|
190
68
|
"internalType": "address",
|
|
191
|
-
"name": "
|
|
69
|
+
"name": "",
|
|
192
70
|
"type": "address"
|
|
193
71
|
},
|
|
194
72
|
{
|
|
195
73
|
"internalType": "address",
|
|
196
|
-
"name": "
|
|
74
|
+
"name": "",
|
|
197
75
|
"type": "address"
|
|
198
76
|
}
|
|
199
77
|
],
|
|
@@ -217,7 +95,7 @@ export const StandardERC20_jsonAbi = [
|
|
|
217
95
|
},
|
|
218
96
|
{
|
|
219
97
|
"internalType": "uint256",
|
|
220
|
-
"name": "
|
|
98
|
+
"name": "amount",
|
|
221
99
|
"type": "uint256"
|
|
222
100
|
}
|
|
223
101
|
],
|
|
@@ -236,7 +114,7 @@ export const StandardERC20_jsonAbi = [
|
|
|
236
114
|
"inputs": [
|
|
237
115
|
{
|
|
238
116
|
"internalType": "address",
|
|
239
|
-
"name": "
|
|
117
|
+
"name": "",
|
|
240
118
|
"type": "address"
|
|
241
119
|
}
|
|
242
120
|
],
|
|
@@ -312,7 +190,7 @@ export const StandardERC20_jsonAbi = [
|
|
|
312
190
|
},
|
|
313
191
|
{
|
|
314
192
|
"internalType": "uint256",
|
|
315
|
-
"name": "
|
|
193
|
+
"name": "amount",
|
|
316
194
|
"type": "uint256"
|
|
317
195
|
}
|
|
318
196
|
],
|
|
@@ -341,7 +219,7 @@ export const StandardERC20_jsonAbi = [
|
|
|
341
219
|
},
|
|
342
220
|
{
|
|
343
221
|
"internalType": "uint256",
|
|
344
|
-
"name": "
|
|
222
|
+
"name": "amount",
|
|
345
223
|
"type": "uint256"
|
|
346
224
|
}
|
|
347
225
|
],
|
|
@@ -359,19 +237,19 @@ export const StandardERC20_jsonAbi = [
|
|
|
359
237
|
] as const satisfies Abi;
|
|
360
238
|
|
|
361
239
|
/**
|
|
362
|
-
* Type-safe ABI for
|
|
240
|
+
* Type-safe ABI for USDCoin_json
|
|
363
241
|
*/
|
|
364
|
-
export type
|
|
242
|
+
export type USDCoin_jsonAbi = typeof USDCoin_jsonAbi;
|
|
365
243
|
|
|
366
244
|
/**
|
|
367
|
-
* Contract instance type for
|
|
245
|
+
* Contract instance type for USDCoin_json
|
|
368
246
|
*/
|
|
369
247
|
// Use any for contract type to avoid complex viem type issues
|
|
370
248
|
// The runtime behavior is type-safe through viem's ABI typing
|
|
371
|
-
export type
|
|
249
|
+
export type USDCoin_jsonContract = any;
|
|
372
250
|
|
|
373
251
|
/**
|
|
374
|
-
*
|
|
252
|
+
* USDCoin_json Contract Class
|
|
375
253
|
*
|
|
376
254
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
377
255
|
*
|
|
@@ -379,12 +257,12 @@ export type StandardERC20_jsonContract = any;
|
|
|
379
257
|
* ```typescript
|
|
380
258
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
381
259
|
* import { mainnet } from 'viem/chains';
|
|
382
|
-
* import {
|
|
260
|
+
* import { USDCoin_json } from 'USDCoin_json';
|
|
383
261
|
*
|
|
384
262
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
385
263
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
386
264
|
*
|
|
387
|
-
* const contract = new
|
|
265
|
+
* const contract = new USDCoin_json('0x...', { publicClient, walletClient });
|
|
388
266
|
*
|
|
389
267
|
* // Read functions
|
|
390
268
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -402,8 +280,8 @@ export type StandardERC20_jsonContract = any;
|
|
|
402
280
|
* });
|
|
403
281
|
* ```
|
|
404
282
|
*/
|
|
405
|
-
export class
|
|
406
|
-
private contract:
|
|
283
|
+
export class USDCoin_json {
|
|
284
|
+
private contract: USDCoin_jsonContract;
|
|
407
285
|
private contractAddress: Address;
|
|
408
286
|
private publicClient: PublicClient;
|
|
409
287
|
|
|
@@ -418,7 +296,7 @@ export class StandardERC20_json {
|
|
|
418
296
|
this.publicClient = clients.publicClient;
|
|
419
297
|
this.contract = getContract({
|
|
420
298
|
address,
|
|
421
|
-
abi:
|
|
299
|
+
abi: USDCoin_jsonAbi,
|
|
422
300
|
client: {
|
|
423
301
|
public: clients.publicClient,
|
|
424
302
|
wallet: clients.walletClient,
|
|
@@ -436,7 +314,7 @@ export class StandardERC20_json {
|
|
|
436
314
|
/**
|
|
437
315
|
* Get the underlying viem contract instance
|
|
438
316
|
*/
|
|
439
|
-
getContract():
|
|
317
|
+
getContract(): USDCoin_jsonContract {
|
|
440
318
|
return this.contract;
|
|
441
319
|
}
|
|
442
320
|
|
|
@@ -444,16 +322,16 @@ export class StandardERC20_json {
|
|
|
444
322
|
* allowance
|
|
445
323
|
* view
|
|
446
324
|
*/
|
|
447
|
-
async allowance(
|
|
448
|
-
return this.contract.read.allowance([
|
|
325
|
+
async allowance(arg0: `0x${string}`, arg1: `0x${string}`): Promise<bigint> {
|
|
326
|
+
return this.contract.read.allowance([arg0, arg1] as const) as Promise<bigint>;
|
|
449
327
|
}
|
|
450
328
|
|
|
451
329
|
/**
|
|
452
330
|
* balanceOf
|
|
453
331
|
* view
|
|
454
332
|
*/
|
|
455
|
-
async balanceOf(
|
|
456
|
-
return this.contract.read.balanceOf([
|
|
333
|
+
async balanceOf(arg0: `0x${string}`): Promise<bigint> {
|
|
334
|
+
return this.contract.read.balanceOf([arg0] as const) as Promise<bigint>;
|
|
457
335
|
}
|
|
458
336
|
|
|
459
337
|
/**
|
|
@@ -493,7 +371,7 @@ export class StandardERC20_json {
|
|
|
493
371
|
* nonpayable
|
|
494
372
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
495
373
|
*/
|
|
496
|
-
async approve(spender: `0x${string}`,
|
|
374
|
+
async approve(spender: `0x${string}`, amount: bigint, options?: {
|
|
497
375
|
accessList?: import('viem').AccessList;
|
|
498
376
|
authorizationList?: import('viem').AuthorizationList;
|
|
499
377
|
chain?: import('viem').Chain | null;
|
|
@@ -508,7 +386,7 @@ export class StandardERC20_json {
|
|
|
508
386
|
if (!this.contract.write) {
|
|
509
387
|
throw new Error('Wallet client is required for write operations');
|
|
510
388
|
}
|
|
511
|
-
return this.contract.write.approve([spender,
|
|
389
|
+
return this.contract.write.approve([spender, amount] as const, options) as Promise<`0x${string}`>;
|
|
512
390
|
}
|
|
513
391
|
|
|
514
392
|
/**
|
|
@@ -516,7 +394,7 @@ export class StandardERC20_json {
|
|
|
516
394
|
* nonpayable
|
|
517
395
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
518
396
|
*/
|
|
519
|
-
async transfer(to: `0x${string}`,
|
|
397
|
+
async transfer(to: `0x${string}`, amount: bigint, options?: {
|
|
520
398
|
accessList?: import('viem').AccessList;
|
|
521
399
|
authorizationList?: import('viem').AuthorizationList;
|
|
522
400
|
chain?: import('viem').Chain | null;
|
|
@@ -531,7 +409,7 @@ export class StandardERC20_json {
|
|
|
531
409
|
if (!this.contract.write) {
|
|
532
410
|
throw new Error('Wallet client is required for write operations');
|
|
533
411
|
}
|
|
534
|
-
return this.contract.write.transfer([to,
|
|
412
|
+
return this.contract.write.transfer([to, amount] as const, options) as Promise<`0x${string}`>;
|
|
535
413
|
}
|
|
536
414
|
|
|
537
415
|
/**
|
|
@@ -539,7 +417,7 @@ export class StandardERC20_json {
|
|
|
539
417
|
* nonpayable
|
|
540
418
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
541
419
|
*/
|
|
542
|
-
async transferFrom(from: `0x${string}`, to: `0x${string}`,
|
|
420
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
|
|
543
421
|
accessList?: import('viem').AccessList;
|
|
544
422
|
authorizationList?: import('viem').AuthorizationList;
|
|
545
423
|
chain?: import('viem').Chain | null;
|
|
@@ -554,7 +432,7 @@ export class StandardERC20_json {
|
|
|
554
432
|
if (!this.contract.write) {
|
|
555
433
|
throw new Error('Wallet client is required for write operations');
|
|
556
434
|
}
|
|
557
|
-
return this.contract.write.transferFrom([from, to,
|
|
435
|
+
return this.contract.write.transferFrom([from, to, amount] as const, options) as Promise<`0x${string}`>;
|
|
558
436
|
}
|
|
559
437
|
|
|
560
438
|
|
|
@@ -578,7 +456,7 @@ export class StandardERC20_json {
|
|
|
578
456
|
* Returns gas estimate and result without sending transaction
|
|
579
457
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
580
458
|
*/
|
|
581
|
-
async approve(spender: `0x${string}`,
|
|
459
|
+
async approve(spender: `0x${string}`, amount: bigint, options?: {
|
|
582
460
|
accessList?: import('viem').AccessList;
|
|
583
461
|
authorizationList?: import('viem').AuthorizationList;
|
|
584
462
|
chain?: import('viem').Chain | null;
|
|
@@ -590,14 +468,14 @@ export class StandardERC20_json {
|
|
|
590
468
|
nonce?: number;
|
|
591
469
|
value?: bigint;
|
|
592
470
|
}): Promise<boolean> {
|
|
593
|
-
return contract.simulate.approve([spender,
|
|
471
|
+
return contract.simulate.approve([spender, amount] as const, options) as Promise<boolean>;
|
|
594
472
|
},
|
|
595
473
|
/**
|
|
596
474
|
* Simulate transfer
|
|
597
475
|
* Returns gas estimate and result without sending transaction
|
|
598
476
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
599
477
|
*/
|
|
600
|
-
async transfer(to: `0x${string}`,
|
|
478
|
+
async transfer(to: `0x${string}`, amount: bigint, options?: {
|
|
601
479
|
accessList?: import('viem').AccessList;
|
|
602
480
|
authorizationList?: import('viem').AuthorizationList;
|
|
603
481
|
chain?: import('viem').Chain | null;
|
|
@@ -609,14 +487,14 @@ export class StandardERC20_json {
|
|
|
609
487
|
nonce?: number;
|
|
610
488
|
value?: bigint;
|
|
611
489
|
}): Promise<boolean> {
|
|
612
|
-
return contract.simulate.transfer([to,
|
|
490
|
+
return contract.simulate.transfer([to, amount] as const, options) as Promise<boolean>;
|
|
613
491
|
},
|
|
614
492
|
/**
|
|
615
493
|
* Simulate transferFrom
|
|
616
494
|
* Returns gas estimate and result without sending transaction
|
|
617
495
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
618
496
|
*/
|
|
619
|
-
async transferFrom(from: `0x${string}`, to: `0x${string}`,
|
|
497
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
|
|
620
498
|
accessList?: import('viem').AccessList;
|
|
621
499
|
authorizationList?: import('viem').AuthorizationList;
|
|
622
500
|
chain?: import('viem').Chain | null;
|
|
@@ -628,7 +506,7 @@ export class StandardERC20_json {
|
|
|
628
506
|
nonce?: number;
|
|
629
507
|
value?: bigint;
|
|
630
508
|
}): Promise<boolean> {
|
|
631
|
-
return contract.simulate.transferFrom([from, to,
|
|
509
|
+
return contract.simulate.transferFrom([from, to, amount] as const, options) as Promise<boolean>;
|
|
632
510
|
}
|
|
633
511
|
};
|
|
634
512
|
}
|
|
@@ -656,7 +534,7 @@ export class StandardERC20_json {
|
|
|
656
534
|
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
|
|
657
535
|
return this.publicClient.watchContractEvent({
|
|
658
536
|
address: this.contractAddress,
|
|
659
|
-
abi:
|
|
537
|
+
abi: USDCoin_jsonAbi,
|
|
660
538
|
eventName: 'Approval',
|
|
661
539
|
args: filter,
|
|
662
540
|
onLogs: (logs: any[]) => {
|
|
@@ -675,7 +553,7 @@ export class StandardERC20_json {
|
|
|
675
553
|
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
|
|
676
554
|
return this.publicClient.watchContractEvent({
|
|
677
555
|
address: this.contractAddress,
|
|
678
|
-
abi:
|
|
556
|
+
abi: USDCoin_jsonAbi,
|
|
679
557
|
eventName: 'Transfer',
|
|
680
558
|
args: filter,
|
|
681
559
|
onLogs: (logs: any[]) => {
|
package/contracts/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { USDCoin_jsonAbi, USDCoin_json } from './USDCoin_json';
|
|
2
|
+
export type { USDCoin_jsonAbi as USDCoin_jsonAbiType, USDCoin_jsonContract } from './USDCoin_json';
|
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.USDCoin_json = exports.USDCoin_jsonAbi = void 0;
|
|
4
4
|
// Auto-generated exports for all contracts
|
|
5
|
-
var
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
Object.defineProperty(exports, "
|
|
5
|
+
var USDCoin_json_1 = require("./USDCoin_json");
|
|
6
|
+
Object.defineProperty(exports, "USDCoin_jsonAbi", { enumerable: true, get: function () { return USDCoin_json_1.USDCoin_jsonAbi; } });
|
|
7
|
+
Object.defineProperty(exports, "USDCoin_json", { enumerable: true, get: function () { return USDCoin_json_1.USDCoin_json; } });
|
package/contracts/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Auto-generated exports for all contracts
|
|
2
|
-
export {
|
|
3
|
-
export type {
|
|
2
|
+
export { USDCoin_jsonAbi, USDCoin_json } from './USDCoin_json';
|
|
3
|
+
export type { USDCoin_jsonAbi as USDCoin_jsonAbiType, USDCoin_jsonContract } from './USDCoin_json';
|
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.4",
|
|
4
|
+
"description": "Auto-generated TypeScript type bindings for USDC (build etherscan-usdc-82739e7d-1790865370934, commit 401acf6, branch etherscan)",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"url": "https://github.com/etherscan/usdc"
|
|
40
40
|
},
|
|
41
41
|
"branch": "etherscan",
|
|
42
|
-
"shortHash": "
|
|
42
|
+
"shortHash": "401acf6"
|
|
43
43
|
}
|