@gitmyabi/aethusdc 1.0.0

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.
@@ -0,0 +1,463 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * InitializableImmutableAdminUpgradeabilityProxy_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const InitializableImmutableAdminUpgradeabilityProxy_jsonAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "address",
14
+ "name": "admin",
15
+ "type": "address"
16
+ }
17
+ ],
18
+ "stateMutability": "nonpayable",
19
+ "type": "constructor"
20
+ },
21
+ {
22
+ "anonymous": false,
23
+ "inputs": [
24
+ {
25
+ "indexed": true,
26
+ "internalType": "address",
27
+ "name": "implementation",
28
+ "type": "address"
29
+ }
30
+ ],
31
+ "name": "Upgraded",
32
+ "type": "event"
33
+ },
34
+ {
35
+ "stateMutability": "payable",
36
+ "type": "fallback"
37
+ },
38
+ {
39
+ "inputs": [],
40
+ "name": "admin",
41
+ "outputs": [
42
+ {
43
+ "internalType": "address",
44
+ "name": "",
45
+ "type": "address"
46
+ }
47
+ ],
48
+ "stateMutability": "nonpayable",
49
+ "type": "function"
50
+ },
51
+ {
52
+ "inputs": [],
53
+ "name": "implementation",
54
+ "outputs": [
55
+ {
56
+ "internalType": "address",
57
+ "name": "",
58
+ "type": "address"
59
+ }
60
+ ],
61
+ "stateMutability": "nonpayable",
62
+ "type": "function"
63
+ },
64
+ {
65
+ "inputs": [
66
+ {
67
+ "internalType": "address",
68
+ "name": "_logic",
69
+ "type": "address"
70
+ },
71
+ {
72
+ "internalType": "bytes",
73
+ "name": "_data",
74
+ "type": "bytes"
75
+ }
76
+ ],
77
+ "name": "initialize",
78
+ "outputs": [],
79
+ "stateMutability": "payable",
80
+ "type": "function"
81
+ },
82
+ {
83
+ "inputs": [
84
+ {
85
+ "internalType": "address",
86
+ "name": "newImplementation",
87
+ "type": "address"
88
+ }
89
+ ],
90
+ "name": "upgradeTo",
91
+ "outputs": [],
92
+ "stateMutability": "nonpayable",
93
+ "type": "function"
94
+ },
95
+ {
96
+ "inputs": [
97
+ {
98
+ "internalType": "address",
99
+ "name": "newImplementation",
100
+ "type": "address"
101
+ },
102
+ {
103
+ "internalType": "bytes",
104
+ "name": "data",
105
+ "type": "bytes"
106
+ }
107
+ ],
108
+ "name": "upgradeToAndCall",
109
+ "outputs": [],
110
+ "stateMutability": "payable",
111
+ "type": "function"
112
+ }
113
+ ] as const satisfies Abi;
114
+
115
+ /**
116
+ * Type-safe ABI for InitializableImmutableAdminUpgradeabilityProxy_json
117
+ */
118
+ export type InitializableImmutableAdminUpgradeabilityProxy_jsonAbi = typeof InitializableImmutableAdminUpgradeabilityProxy_jsonAbi;
119
+
120
+ /**
121
+ * Contract instance type for InitializableImmutableAdminUpgradeabilityProxy_json
122
+ */
123
+ // Use any for contract type to avoid complex viem type issues
124
+ // The runtime behavior is type-safe through viem's ABI typing
125
+ export type InitializableImmutableAdminUpgradeabilityProxy_jsonContract = any;
126
+
127
+ /**
128
+ * InitializableImmutableAdminUpgradeabilityProxy_json Contract Class
129
+ *
130
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
131
+ *
132
+ * @example
133
+ * ```typescript
134
+ * import { createPublicClient, createWalletClient, http } from 'viem';
135
+ * import { mainnet } from 'viem/chains';
136
+ * import { InitializableImmutableAdminUpgradeabilityProxy_json } from 'InitializableImmutableAdminUpgradeabilityProxy_json';
137
+ *
138
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
139
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
140
+ *
141
+ * const contract = new InitializableImmutableAdminUpgradeabilityProxy_json('0x...', { publicClient, walletClient });
142
+ *
143
+ * // Read functions
144
+ * const result = await contract.balanceOf('0x...');
145
+ *
146
+ * // Write functions
147
+ * const hash = await contract.transfer('0x...', 1000n);
148
+ *
149
+ * // Simulate transactions (dry-run)
150
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
151
+ * console.log('Gas estimate:', simulation.request.gas);
152
+ *
153
+ * // Watch events
154
+ * const unwatch = contract.watch.Transfer((event) => {
155
+ * console.log('Transfer event:', event);
156
+ * });
157
+ * ```
158
+ */
159
+ export class InitializableImmutableAdminUpgradeabilityProxy_json {
160
+ private contract: InitializableImmutableAdminUpgradeabilityProxy_jsonContract;
161
+ private contractAddress: Address;
162
+ private publicClient: PublicClient;
163
+
164
+ constructor(
165
+ address: Address,
166
+ clients: {
167
+ publicClient: PublicClient;
168
+ walletClient?: WalletClient;
169
+ }
170
+ ) {
171
+ this.contractAddress = address;
172
+ this.publicClient = clients.publicClient;
173
+ this.contract = getContract({
174
+ address,
175
+ abi: InitializableImmutableAdminUpgradeabilityProxy_jsonAbi,
176
+ client: {
177
+ public: clients.publicClient,
178
+ wallet: clients.walletClient,
179
+ },
180
+ });
181
+ }
182
+
183
+ /**
184
+ * Get the contract address
185
+ */
186
+ get address(): Address {
187
+ return this.contractAddress;
188
+ }
189
+
190
+ /**
191
+ * Get the underlying viem contract instance
192
+ */
193
+ getContract(): InitializableImmutableAdminUpgradeabilityProxy_jsonContract {
194
+ return this.contract;
195
+ }
196
+
197
+ // No read functions
198
+
199
+ /**
200
+ * admin
201
+ * nonpayable
202
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
203
+ */
204
+ async admin(options?: {
205
+ accessList?: import('viem').AccessList;
206
+ authorizationList?: import('viem').AuthorizationList;
207
+ chain?: import('viem').Chain | null;
208
+ dataSuffix?: `0x${string}`;
209
+ gas?: bigint;
210
+ gasPrice?: bigint;
211
+ maxFeePerGas?: bigint;
212
+ maxPriorityFeePerGas?: bigint;
213
+ nonce?: number;
214
+ value?: bigint;
215
+ }): Promise<`0x${string}`> {
216
+ if (!this.contract.write) {
217
+ throw new Error('Wallet client is required for write operations');
218
+ }
219
+ return this.contract.write.admin(options) as Promise<`0x${string}`>;
220
+ }
221
+
222
+ /**
223
+ * implementation
224
+ * nonpayable
225
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
226
+ */
227
+ async implementation(options?: {
228
+ accessList?: import('viem').AccessList;
229
+ authorizationList?: import('viem').AuthorizationList;
230
+ chain?: import('viem').Chain | null;
231
+ dataSuffix?: `0x${string}`;
232
+ gas?: bigint;
233
+ gasPrice?: bigint;
234
+ maxFeePerGas?: bigint;
235
+ maxPriorityFeePerGas?: bigint;
236
+ nonce?: number;
237
+ value?: bigint;
238
+ }): Promise<`0x${string}`> {
239
+ if (!this.contract.write) {
240
+ throw new Error('Wallet client is required for write operations');
241
+ }
242
+ return this.contract.write.implementation(options) as Promise<`0x${string}`>;
243
+ }
244
+
245
+ /**
246
+ * initialize
247
+ * payable
248
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
249
+ */
250
+ async initialize(_logic: `0x${string}`, _data: `0x${string}`, options?: {
251
+ accessList?: import('viem').AccessList;
252
+ authorizationList?: import('viem').AuthorizationList;
253
+ chain?: import('viem').Chain | null;
254
+ dataSuffix?: `0x${string}`;
255
+ gas?: bigint;
256
+ gasPrice?: bigint;
257
+ maxFeePerGas?: bigint;
258
+ maxPriorityFeePerGas?: bigint;
259
+ nonce?: number;
260
+ value?: bigint;
261
+ }): Promise<`0x${string}`> {
262
+ if (!this.contract.write) {
263
+ throw new Error('Wallet client is required for write operations');
264
+ }
265
+ return this.contract.write.initialize([_logic, _data] as const, options) as Promise<`0x${string}`>;
266
+ }
267
+
268
+ /**
269
+ * upgradeTo
270
+ * nonpayable
271
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
272
+ */
273
+ async upgradeTo(newImplementation: `0x${string}`, options?: {
274
+ accessList?: import('viem').AccessList;
275
+ authorizationList?: import('viem').AuthorizationList;
276
+ chain?: import('viem').Chain | null;
277
+ dataSuffix?: `0x${string}`;
278
+ gas?: bigint;
279
+ gasPrice?: bigint;
280
+ maxFeePerGas?: bigint;
281
+ maxPriorityFeePerGas?: bigint;
282
+ nonce?: number;
283
+ value?: bigint;
284
+ }): Promise<`0x${string}`> {
285
+ if (!this.contract.write) {
286
+ throw new Error('Wallet client is required for write operations');
287
+ }
288
+ return this.contract.write.upgradeTo([newImplementation] as const, options) as Promise<`0x${string}`>;
289
+ }
290
+
291
+ /**
292
+ * upgradeToAndCall
293
+ * payable
294
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
295
+ */
296
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
297
+ accessList?: import('viem').AccessList;
298
+ authorizationList?: import('viem').AuthorizationList;
299
+ chain?: import('viem').Chain | null;
300
+ dataSuffix?: `0x${string}`;
301
+ gas?: bigint;
302
+ gasPrice?: bigint;
303
+ maxFeePerGas?: bigint;
304
+ maxPriorityFeePerGas?: bigint;
305
+ nonce?: number;
306
+ value?: bigint;
307
+ }): Promise<`0x${string}`> {
308
+ if (!this.contract.write) {
309
+ throw new Error('Wallet client is required for write operations');
310
+ }
311
+ return this.contract.write.upgradeToAndCall([newImplementation, data] as const, options) as Promise<`0x${string}`>;
312
+ }
313
+
314
+
315
+
316
+ /**
317
+ * Simulate contract write operations (dry-run without sending transaction)
318
+ *
319
+ * @example
320
+ * const result = await contract.simulate.transfer('0x...', 1000n);
321
+ * console.log('Gas estimate:', result.request.gas);
322
+ * console.log('Would succeed:', result.result);
323
+ */
324
+ get simulate() {
325
+ const contract = this.contract;
326
+ if (!contract.simulate) {
327
+ throw new Error('Public client is required for simulation');
328
+ }
329
+ return {
330
+ /**
331
+ * Simulate admin
332
+ * Returns gas estimate and result without sending transaction
333
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
334
+ */
335
+ async admin(options?: {
336
+ accessList?: import('viem').AccessList;
337
+ authorizationList?: import('viem').AuthorizationList;
338
+ chain?: import('viem').Chain | null;
339
+ dataSuffix?: `0x${string}`;
340
+ gas?: bigint;
341
+ gasPrice?: bigint;
342
+ maxFeePerGas?: bigint;
343
+ maxPriorityFeePerGas?: bigint;
344
+ nonce?: number;
345
+ value?: bigint;
346
+ }): Promise<`0x${string}`> {
347
+ return contract.simulate.admin(options) as Promise<`0x${string}`>;
348
+ },
349
+ /**
350
+ * Simulate implementation
351
+ * Returns gas estimate and result without sending transaction
352
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
353
+ */
354
+ async implementation(options?: {
355
+ accessList?: import('viem').AccessList;
356
+ authorizationList?: import('viem').AuthorizationList;
357
+ chain?: import('viem').Chain | null;
358
+ dataSuffix?: `0x${string}`;
359
+ gas?: bigint;
360
+ gasPrice?: bigint;
361
+ maxFeePerGas?: bigint;
362
+ maxPriorityFeePerGas?: bigint;
363
+ nonce?: number;
364
+ value?: bigint;
365
+ }): Promise<`0x${string}`> {
366
+ return contract.simulate.implementation(options) as Promise<`0x${string}`>;
367
+ },
368
+ /**
369
+ * Simulate initialize
370
+ * Returns gas estimate and result without sending transaction
371
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
372
+ */
373
+ async initialize(_logic: `0x${string}`, _data: `0x${string}`, options?: {
374
+ accessList?: import('viem').AccessList;
375
+ authorizationList?: import('viem').AuthorizationList;
376
+ chain?: import('viem').Chain | null;
377
+ dataSuffix?: `0x${string}`;
378
+ gas?: bigint;
379
+ gasPrice?: bigint;
380
+ maxFeePerGas?: bigint;
381
+ maxPriorityFeePerGas?: bigint;
382
+ nonce?: number;
383
+ value?: bigint;
384
+ }): Promise<void> {
385
+ return contract.simulate.initialize([_logic, _data] as const, options) as Promise<void>;
386
+ },
387
+ /**
388
+ * Simulate upgradeTo
389
+ * Returns gas estimate and result without sending transaction
390
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
391
+ */
392
+ async upgradeTo(newImplementation: `0x${string}`, options?: {
393
+ accessList?: import('viem').AccessList;
394
+ authorizationList?: import('viem').AuthorizationList;
395
+ chain?: import('viem').Chain | null;
396
+ dataSuffix?: `0x${string}`;
397
+ gas?: bigint;
398
+ gasPrice?: bigint;
399
+ maxFeePerGas?: bigint;
400
+ maxPriorityFeePerGas?: bigint;
401
+ nonce?: number;
402
+ value?: bigint;
403
+ }): Promise<void> {
404
+ return contract.simulate.upgradeTo([newImplementation] as const, options) as Promise<void>;
405
+ },
406
+ /**
407
+ * Simulate upgradeToAndCall
408
+ * Returns gas estimate and result without sending transaction
409
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
410
+ */
411
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
412
+ accessList?: import('viem').AccessList;
413
+ authorizationList?: import('viem').AuthorizationList;
414
+ chain?: import('viem').Chain | null;
415
+ dataSuffix?: `0x${string}`;
416
+ gas?: bigint;
417
+ gasPrice?: bigint;
418
+ maxFeePerGas?: bigint;
419
+ maxPriorityFeePerGas?: bigint;
420
+ nonce?: number;
421
+ value?: bigint;
422
+ }): Promise<void> {
423
+ return contract.simulate.upgradeToAndCall([newImplementation, data] as const, options) as Promise<void>;
424
+ }
425
+ };
426
+ }
427
+
428
+ /**
429
+ * Watch contract events
430
+ *
431
+ * @example
432
+ * // Watch all Transfer events
433
+ * const unwatch = contract.watch.Transfer((event) => {
434
+ * console.log('Transfer:', event);
435
+ * });
436
+ *
437
+ * // Stop watching
438
+ * unwatch();
439
+ */
440
+ get watch() {
441
+ return {
442
+ /**
443
+ * Watch Upgraded events
444
+ * @param callback Function to call when event is emitted
445
+ * @param filter Optional filter for indexed parameters
446
+ * @returns Unwatch function to stop listening
447
+ */
448
+ Upgraded: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation: `0x${string}` }) => {
449
+ return this.publicClient.watchContractEvent({
450
+ address: this.contractAddress,
451
+ abi: InitializableImmutableAdminUpgradeabilityProxy_jsonAbi,
452
+ eventName: 'Upgraded',
453
+ args: filter,
454
+ onLogs: (logs: any[]) => {
455
+ logs.forEach((log: any) => {
456
+ callback(log.args as any);
457
+ });
458
+ },
459
+ }) as () => void;
460
+ }
461
+ };
462
+ }
463
+ }
@@ -0,0 +1,4 @@
1
+ export { InitializableImmutableAdminUpgradeabilityProxy_jsonAbi, InitializableImmutableAdminUpgradeabilityProxy_json } from './InitializableImmutableAdminUpgradeabilityProxy_json';
2
+ export type { InitializableImmutableAdminUpgradeabilityProxy_jsonAbi as InitializableImmutableAdminUpgradeabilityProxy_jsonAbiType, InitializableImmutableAdminUpgradeabilityProxy_jsonContract } from './InitializableImmutableAdminUpgradeabilityProxy_json';
3
+ export { ATokenInstance_jsonAbi, ATokenInstance_json } from './ATokenInstance_json';
4
+ export type { ATokenInstance_jsonAbi as ATokenInstance_jsonAbiType, ATokenInstance_jsonContract } from './ATokenInstance_json';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ATokenInstance_json = exports.ATokenInstance_jsonAbi = exports.InitializableImmutableAdminUpgradeabilityProxy_json = exports.InitializableImmutableAdminUpgradeabilityProxy_jsonAbi = void 0;
4
+ // Auto-generated exports for all contracts
5
+ var InitializableImmutableAdminUpgradeabilityProxy_json_1 = require("./InitializableImmutableAdminUpgradeabilityProxy_json");
6
+ Object.defineProperty(exports, "InitializableImmutableAdminUpgradeabilityProxy_jsonAbi", { enumerable: true, get: function () { return InitializableImmutableAdminUpgradeabilityProxy_json_1.InitializableImmutableAdminUpgradeabilityProxy_jsonAbi; } });
7
+ Object.defineProperty(exports, "InitializableImmutableAdminUpgradeabilityProxy_json", { enumerable: true, get: function () { return InitializableImmutableAdminUpgradeabilityProxy_json_1.InitializableImmutableAdminUpgradeabilityProxy_json; } });
8
+ var ATokenInstance_json_1 = require("./ATokenInstance_json");
9
+ Object.defineProperty(exports, "ATokenInstance_jsonAbi", { enumerable: true, get: function () { return ATokenInstance_json_1.ATokenInstance_jsonAbi; } });
10
+ Object.defineProperty(exports, "ATokenInstance_json", { enumerable: true, get: function () { return ATokenInstance_json_1.ATokenInstance_json; } });
@@ -0,0 +1,5 @@
1
+ // Auto-generated exports for all contracts
2
+ export { InitializableImmutableAdminUpgradeabilityProxy_jsonAbi, InitializableImmutableAdminUpgradeabilityProxy_json } from './InitializableImmutableAdminUpgradeabilityProxy_json';
3
+ export type { InitializableImmutableAdminUpgradeabilityProxy_jsonAbi as InitializableImmutableAdminUpgradeabilityProxy_jsonAbiType, InitializableImmutableAdminUpgradeabilityProxy_jsonContract } from './InitializableImmutableAdminUpgradeabilityProxy_json';
4
+ export { ATokenInstance_jsonAbi, ATokenInstance_json } from './ATokenInstance_json';
5
+ export type { ATokenInstance_jsonAbi as ATokenInstance_jsonAbiType, ATokenInstance_jsonContract } from './ATokenInstance_json';
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './contracts';
package/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // Auto-generated TypeScript type bindings
3
+ // This file exports all generated contract types
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ __exportStar(require("./contracts"), exports);
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@gitmyabi/aethusdc",
3
+ "version": "1.0.0",
4
+ "description": "Auto-generated TypeScript type bindings for aEthUSDC (build etherscan-aethusdc-98c23e9d-1785268364561, commit 7caf338, branch etherscan)",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./index.js",
10
+ "require": "./index.js",
11
+ "types": "./index.d.ts"
12
+ },
13
+ "./contracts": {
14
+ "import": "./contracts/index.js",
15
+ "require": "./contracts/index.js",
16
+ "types": "./contracts/index.d.ts"
17
+ }
18
+ },
19
+ "files": [
20
+ "index.js",
21
+ "index.d.ts",
22
+ "contracts"
23
+ ],
24
+ "keywords": [
25
+ "ethereum",
26
+ "smart-contracts",
27
+ "viem",
28
+ "wagmi",
29
+ "typescript",
30
+ "abi",
31
+ "ethers-v6"
32
+ ],
33
+ "license": "MIT",
34
+ "dependencies": {
35
+ "viem": "^2.0.0"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/etherscan/aethusdc"
40
+ },
41
+ "branch": "etherscan",
42
+ "shortHash": "7caf338"
43
+ }