@gitmyabi/arm-weth-steth 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,501 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * Proxy_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const Proxy_jsonAbi = [
10
+ {
11
+ "anonymous": false,
12
+ "inputs": [
13
+ {
14
+ "indexed": false,
15
+ "internalType": "address",
16
+ "name": "previousAdmin",
17
+ "type": "address"
18
+ },
19
+ {
20
+ "indexed": false,
21
+ "internalType": "address",
22
+ "name": "newAdmin",
23
+ "type": "address"
24
+ }
25
+ ],
26
+ "name": "AdminChanged",
27
+ "type": "event"
28
+ },
29
+ {
30
+ "anonymous": false,
31
+ "inputs": [
32
+ {
33
+ "indexed": true,
34
+ "internalType": "address",
35
+ "name": "implementation",
36
+ "type": "address"
37
+ }
38
+ ],
39
+ "name": "Upgraded",
40
+ "type": "event"
41
+ },
42
+ {
43
+ "stateMutability": "payable",
44
+ "type": "fallback"
45
+ },
46
+ {
47
+ "inputs": [],
48
+ "name": "admin",
49
+ "outputs": [
50
+ {
51
+ "internalType": "address",
52
+ "name": "",
53
+ "type": "address"
54
+ }
55
+ ],
56
+ "stateMutability": "view",
57
+ "type": "function"
58
+ },
59
+ {
60
+ "inputs": [],
61
+ "name": "implementation",
62
+ "outputs": [
63
+ {
64
+ "internalType": "address",
65
+ "name": "",
66
+ "type": "address"
67
+ }
68
+ ],
69
+ "stateMutability": "view",
70
+ "type": "function"
71
+ },
72
+ {
73
+ "inputs": [
74
+ {
75
+ "internalType": "address",
76
+ "name": "_logic",
77
+ "type": "address"
78
+ },
79
+ {
80
+ "internalType": "address",
81
+ "name": "_initOwner",
82
+ "type": "address"
83
+ },
84
+ {
85
+ "internalType": "bytes",
86
+ "name": "_data",
87
+ "type": "bytes"
88
+ }
89
+ ],
90
+ "name": "initialize",
91
+ "outputs": [],
92
+ "stateMutability": "payable",
93
+ "type": "function"
94
+ },
95
+ {
96
+ "inputs": [],
97
+ "name": "owner",
98
+ "outputs": [
99
+ {
100
+ "internalType": "address",
101
+ "name": "",
102
+ "type": "address"
103
+ }
104
+ ],
105
+ "stateMutability": "view",
106
+ "type": "function"
107
+ },
108
+ {
109
+ "inputs": [
110
+ {
111
+ "internalType": "address",
112
+ "name": "newOwner",
113
+ "type": "address"
114
+ }
115
+ ],
116
+ "name": "setOwner",
117
+ "outputs": [],
118
+ "stateMutability": "nonpayable",
119
+ "type": "function"
120
+ },
121
+ {
122
+ "inputs": [
123
+ {
124
+ "internalType": "address",
125
+ "name": "newImplementation",
126
+ "type": "address"
127
+ }
128
+ ],
129
+ "name": "upgradeTo",
130
+ "outputs": [],
131
+ "stateMutability": "nonpayable",
132
+ "type": "function"
133
+ },
134
+ {
135
+ "inputs": [
136
+ {
137
+ "internalType": "address",
138
+ "name": "newImplementation",
139
+ "type": "address"
140
+ },
141
+ {
142
+ "internalType": "bytes",
143
+ "name": "data",
144
+ "type": "bytes"
145
+ }
146
+ ],
147
+ "name": "upgradeToAndCall",
148
+ "outputs": [],
149
+ "stateMutability": "payable",
150
+ "type": "function"
151
+ }
152
+ ] as const satisfies Abi;
153
+
154
+ /**
155
+ * Type-safe ABI for Proxy_json
156
+ */
157
+ export type Proxy_jsonAbi = typeof Proxy_jsonAbi;
158
+
159
+ /**
160
+ * Contract instance type for Proxy_json
161
+ */
162
+ // Use any for contract type to avoid complex viem type issues
163
+ // The runtime behavior is type-safe through viem's ABI typing
164
+ export type Proxy_jsonContract = any;
165
+
166
+ /**
167
+ * Proxy_json Contract Class
168
+ *
169
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
170
+ *
171
+ * @example
172
+ * ```typescript
173
+ * import { createPublicClient, createWalletClient, http } from 'viem';
174
+ * import { mainnet } from 'viem/chains';
175
+ * import { Proxy_json } from 'Proxy_json';
176
+ *
177
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
178
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
179
+ *
180
+ * const contract = new Proxy_json('0x...', { publicClient, walletClient });
181
+ *
182
+ * // Read functions
183
+ * const result = await contract.balanceOf('0x...');
184
+ *
185
+ * // Write functions
186
+ * const hash = await contract.transfer('0x...', 1000n);
187
+ *
188
+ * // Simulate transactions (dry-run)
189
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
190
+ * console.log('Gas estimate:', simulation.request.gas);
191
+ *
192
+ * // Watch events
193
+ * const unwatch = contract.watch.Transfer((event) => {
194
+ * console.log('Transfer event:', event);
195
+ * });
196
+ * ```
197
+ */
198
+ export class Proxy_json {
199
+ private contract: Proxy_jsonContract;
200
+ private contractAddress: Address;
201
+ private publicClient: PublicClient;
202
+
203
+ constructor(
204
+ address: Address,
205
+ clients: {
206
+ publicClient: PublicClient;
207
+ walletClient?: WalletClient;
208
+ }
209
+ ) {
210
+ this.contractAddress = address;
211
+ this.publicClient = clients.publicClient;
212
+ this.contract = getContract({
213
+ address,
214
+ abi: Proxy_jsonAbi,
215
+ client: {
216
+ public: clients.publicClient,
217
+ wallet: clients.walletClient,
218
+ },
219
+ });
220
+ }
221
+
222
+ /**
223
+ * Get the contract address
224
+ */
225
+ get address(): Address {
226
+ return this.contractAddress;
227
+ }
228
+
229
+ /**
230
+ * Get the underlying viem contract instance
231
+ */
232
+ getContract(): Proxy_jsonContract {
233
+ return this.contract;
234
+ }
235
+
236
+ /**
237
+ * admin
238
+ * view
239
+ */
240
+ async admin(): Promise<`0x${string}`> {
241
+ return this.contract.read.admin() as Promise<`0x${string}`>;
242
+ }
243
+
244
+ /**
245
+ * implementation
246
+ * view
247
+ */
248
+ async implementation(): Promise<`0x${string}`> {
249
+ return this.contract.read.implementation() as Promise<`0x${string}`>;
250
+ }
251
+
252
+ /**
253
+ * owner
254
+ * view
255
+ */
256
+ async owner(): Promise<`0x${string}`> {
257
+ return this.contract.read.owner() as Promise<`0x${string}`>;
258
+ }
259
+
260
+ /**
261
+ * initialize
262
+ * payable
263
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
264
+ */
265
+ async initialize(_logic: `0x${string}`, _initOwner: `0x${string}`, _data: `0x${string}`, options?: {
266
+ accessList?: import('viem').AccessList;
267
+ authorizationList?: import('viem').AuthorizationList;
268
+ chain?: import('viem').Chain | null;
269
+ dataSuffix?: `0x${string}`;
270
+ gas?: bigint;
271
+ gasPrice?: bigint;
272
+ maxFeePerGas?: bigint;
273
+ maxPriorityFeePerGas?: bigint;
274
+ nonce?: number;
275
+ value?: bigint;
276
+ }): Promise<`0x${string}`> {
277
+ if (!this.contract.write) {
278
+ throw new Error('Wallet client is required for write operations');
279
+ }
280
+ return this.contract.write.initialize([_logic, _initOwner, _data] as const, options) as Promise<`0x${string}`>;
281
+ }
282
+
283
+ /**
284
+ * setOwner
285
+ * nonpayable
286
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
287
+ */
288
+ async setOwner(newOwner: `0x${string}`, options?: {
289
+ accessList?: import('viem').AccessList;
290
+ authorizationList?: import('viem').AuthorizationList;
291
+ chain?: import('viem').Chain | null;
292
+ dataSuffix?: `0x${string}`;
293
+ gas?: bigint;
294
+ gasPrice?: bigint;
295
+ maxFeePerGas?: bigint;
296
+ maxPriorityFeePerGas?: bigint;
297
+ nonce?: number;
298
+ value?: bigint;
299
+ }): Promise<`0x${string}`> {
300
+ if (!this.contract.write) {
301
+ throw new Error('Wallet client is required for write operations');
302
+ }
303
+ return this.contract.write.setOwner([newOwner] as const, options) as Promise<`0x${string}`>;
304
+ }
305
+
306
+ /**
307
+ * upgradeTo
308
+ * nonpayable
309
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
310
+ */
311
+ async upgradeTo(newImplementation: `0x${string}`, options?: {
312
+ accessList?: import('viem').AccessList;
313
+ authorizationList?: import('viem').AuthorizationList;
314
+ chain?: import('viem').Chain | null;
315
+ dataSuffix?: `0x${string}`;
316
+ gas?: bigint;
317
+ gasPrice?: bigint;
318
+ maxFeePerGas?: bigint;
319
+ maxPriorityFeePerGas?: bigint;
320
+ nonce?: number;
321
+ value?: bigint;
322
+ }): Promise<`0x${string}`> {
323
+ if (!this.contract.write) {
324
+ throw new Error('Wallet client is required for write operations');
325
+ }
326
+ return this.contract.write.upgradeTo([newImplementation] as const, options) as Promise<`0x${string}`>;
327
+ }
328
+
329
+ /**
330
+ * upgradeToAndCall
331
+ * payable
332
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
333
+ */
334
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
335
+ accessList?: import('viem').AccessList;
336
+ authorizationList?: import('viem').AuthorizationList;
337
+ chain?: import('viem').Chain | null;
338
+ dataSuffix?: `0x${string}`;
339
+ gas?: bigint;
340
+ gasPrice?: bigint;
341
+ maxFeePerGas?: bigint;
342
+ maxPriorityFeePerGas?: bigint;
343
+ nonce?: number;
344
+ value?: bigint;
345
+ }): Promise<`0x${string}`> {
346
+ if (!this.contract.write) {
347
+ throw new Error('Wallet client is required for write operations');
348
+ }
349
+ return this.contract.write.upgradeToAndCall([newImplementation, data] as const, options) as Promise<`0x${string}`>;
350
+ }
351
+
352
+
353
+
354
+ /**
355
+ * Simulate contract write operations (dry-run without sending transaction)
356
+ *
357
+ * @example
358
+ * const result = await contract.simulate.transfer('0x...', 1000n);
359
+ * console.log('Gas estimate:', result.request.gas);
360
+ * console.log('Would succeed:', result.result);
361
+ */
362
+ get simulate() {
363
+ const contract = this.contract;
364
+ if (!contract.simulate) {
365
+ throw new Error('Public client is required for simulation');
366
+ }
367
+ return {
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}`, _initOwner: `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, _initOwner, _data] as const, options) as Promise<void>;
386
+ },
387
+ /**
388
+ * Simulate setOwner
389
+ * Returns gas estimate and result without sending transaction
390
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
391
+ */
392
+ async setOwner(newOwner: `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.setOwner([newOwner] as const, options) as Promise<void>;
405
+ },
406
+ /**
407
+ * Simulate upgradeTo
408
+ * Returns gas estimate and result without sending transaction
409
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
410
+ */
411
+ async upgradeTo(newImplementation: `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.upgradeTo([newImplementation] as const, options) as Promise<void>;
424
+ },
425
+ /**
426
+ * Simulate upgradeToAndCall
427
+ * Returns gas estimate and result without sending transaction
428
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
429
+ */
430
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
431
+ accessList?: import('viem').AccessList;
432
+ authorizationList?: import('viem').AuthorizationList;
433
+ chain?: import('viem').Chain | null;
434
+ dataSuffix?: `0x${string}`;
435
+ gas?: bigint;
436
+ gasPrice?: bigint;
437
+ maxFeePerGas?: bigint;
438
+ maxPriorityFeePerGas?: bigint;
439
+ nonce?: number;
440
+ value?: bigint;
441
+ }): Promise<void> {
442
+ return contract.simulate.upgradeToAndCall([newImplementation, data] as const, options) as Promise<void>;
443
+ }
444
+ };
445
+ }
446
+
447
+ /**
448
+ * Watch contract events
449
+ *
450
+ * @example
451
+ * // Watch all Transfer events
452
+ * const unwatch = contract.watch.Transfer((event) => {
453
+ * console.log('Transfer:', event);
454
+ * });
455
+ *
456
+ * // Stop watching
457
+ * unwatch();
458
+ */
459
+ get watch() {
460
+ return {
461
+ /**
462
+ * Watch AdminChanged events
463
+ * @param callback Function to call when event is emitted
464
+ * @param filter Optional filter for indexed parameters
465
+ * @returns Unwatch function to stop listening
466
+ */
467
+ AdminChanged: (callback: (event: { previousAdmin: `0x${string}`; newAdmin: `0x${string}` }) => void) => {
468
+ return this.publicClient.watchContractEvent({
469
+ address: this.contractAddress,
470
+ abi: Proxy_jsonAbi,
471
+ eventName: 'AdminChanged',
472
+
473
+ onLogs: (logs: any[]) => {
474
+ logs.forEach((log: any) => {
475
+ callback(log.args as any);
476
+ });
477
+ },
478
+ }) as () => void;
479
+ },
480
+ /**
481
+ * Watch Upgraded events
482
+ * @param callback Function to call when event is emitted
483
+ * @param filter Optional filter for indexed parameters
484
+ * @returns Unwatch function to stop listening
485
+ */
486
+ Upgraded: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation: `0x${string}` }) => {
487
+ return this.publicClient.watchContractEvent({
488
+ address: this.contractAddress,
489
+ abi: Proxy_jsonAbi,
490
+ eventName: 'Upgraded',
491
+ args: filter,
492
+ onLogs: (logs: any[]) => {
493
+ logs.forEach((log: any) => {
494
+ callback(log.args as any);
495
+ });
496
+ },
497
+ }) as () => void;
498
+ }
499
+ };
500
+ }
501
+ }
@@ -0,0 +1,4 @@
1
+ export { Proxy_jsonAbi, Proxy_json } from './Proxy_json';
2
+ export type { Proxy_jsonAbi as Proxy_jsonAbiType, Proxy_jsonContract } from './Proxy_json';
3
+ export { LidoARM_jsonAbi, LidoARM_json } from './LidoARM_json';
4
+ export type { LidoARM_jsonAbi as LidoARM_jsonAbiType, LidoARM_jsonContract } from './LidoARM_json';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LidoARM_json = exports.LidoARM_jsonAbi = exports.Proxy_json = exports.Proxy_jsonAbi = void 0;
4
+ // Auto-generated exports for all contracts
5
+ var Proxy_json_1 = require("./Proxy_json");
6
+ Object.defineProperty(exports, "Proxy_jsonAbi", { enumerable: true, get: function () { return Proxy_json_1.Proxy_jsonAbi; } });
7
+ Object.defineProperty(exports, "Proxy_json", { enumerable: true, get: function () { return Proxy_json_1.Proxy_json; } });
8
+ var LidoARM_json_1 = require("./LidoARM_json");
9
+ Object.defineProperty(exports, "LidoARM_jsonAbi", { enumerable: true, get: function () { return LidoARM_json_1.LidoARM_jsonAbi; } });
10
+ Object.defineProperty(exports, "LidoARM_json", { enumerable: true, get: function () { return LidoARM_json_1.LidoARM_json; } });
@@ -0,0 +1,5 @@
1
+ // Auto-generated exports for all contracts
2
+ export { Proxy_jsonAbi, Proxy_json } from './Proxy_json';
3
+ export type { Proxy_jsonAbi as Proxy_jsonAbiType, Proxy_jsonContract } from './Proxy_json';
4
+ export { LidoARM_jsonAbi, LidoARM_json } from './LidoARM_json';
5
+ export type { LidoARM_jsonAbi as LidoARM_jsonAbiType, LidoARM_jsonContract } from './LidoARM_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/arm-weth-steth",
3
+ "version": "1.0.0",
4
+ "description": "Auto-generated TypeScript type bindings for ARM-WETH-stETH (build etherscan-arm-weth-steth-85b78aca-1790450506634, commit dacbaa7, 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/arm-weth-steth"
40
+ },
41
+ "branch": "etherscan",
42
+ "shortHash": "dacbaa7"
43
+ }