@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.
- package/README.md +108 -0
- package/contracts/ATokenInstance_json.d.ts +1571 -0
- package/contracts/ATokenInstance_json.js +1672 -0
- package/contracts/ATokenInstance_json.ts +2042 -0
- package/contracts/InitializableImmutableAdminUpgradeabilityProxy_json.d.ts +348 -0
- package/contracts/InitializableImmutableAdminUpgradeabilityProxy_json.js +320 -0
- package/contracts/InitializableImmutableAdminUpgradeabilityProxy_json.ts +463 -0
- package/contracts/index.d.ts +4 -0
- package/contracts/index.js +10 -0
- package/contracts/index.ts +5 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +43 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* InitializableImmutableAdminUpgradeabilityProxy_json ABI
|
|
4
|
+
*
|
|
5
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
6
|
+
*/
|
|
7
|
+
export declare const InitializableImmutableAdminUpgradeabilityProxy_jsonAbi: readonly [{
|
|
8
|
+
readonly inputs: readonly [{
|
|
9
|
+
readonly internalType: "address";
|
|
10
|
+
readonly name: "admin";
|
|
11
|
+
readonly type: "address";
|
|
12
|
+
}];
|
|
13
|
+
readonly stateMutability: "nonpayable";
|
|
14
|
+
readonly type: "constructor";
|
|
15
|
+
}, {
|
|
16
|
+
readonly anonymous: false;
|
|
17
|
+
readonly inputs: readonly [{
|
|
18
|
+
readonly indexed: true;
|
|
19
|
+
readonly internalType: "address";
|
|
20
|
+
readonly name: "implementation";
|
|
21
|
+
readonly type: "address";
|
|
22
|
+
}];
|
|
23
|
+
readonly name: "Upgraded";
|
|
24
|
+
readonly type: "event";
|
|
25
|
+
}, {
|
|
26
|
+
readonly stateMutability: "payable";
|
|
27
|
+
readonly type: "fallback";
|
|
28
|
+
}, {
|
|
29
|
+
readonly inputs: readonly [];
|
|
30
|
+
readonly name: "admin";
|
|
31
|
+
readonly outputs: readonly [{
|
|
32
|
+
readonly internalType: "address";
|
|
33
|
+
readonly name: "";
|
|
34
|
+
readonly type: "address";
|
|
35
|
+
}];
|
|
36
|
+
readonly stateMutability: "nonpayable";
|
|
37
|
+
readonly type: "function";
|
|
38
|
+
}, {
|
|
39
|
+
readonly inputs: readonly [];
|
|
40
|
+
readonly name: "implementation";
|
|
41
|
+
readonly outputs: readonly [{
|
|
42
|
+
readonly internalType: "address";
|
|
43
|
+
readonly name: "";
|
|
44
|
+
readonly type: "address";
|
|
45
|
+
}];
|
|
46
|
+
readonly stateMutability: "nonpayable";
|
|
47
|
+
readonly type: "function";
|
|
48
|
+
}, {
|
|
49
|
+
readonly inputs: readonly [{
|
|
50
|
+
readonly internalType: "address";
|
|
51
|
+
readonly name: "_logic";
|
|
52
|
+
readonly type: "address";
|
|
53
|
+
}, {
|
|
54
|
+
readonly internalType: "bytes";
|
|
55
|
+
readonly name: "_data";
|
|
56
|
+
readonly type: "bytes";
|
|
57
|
+
}];
|
|
58
|
+
readonly name: "initialize";
|
|
59
|
+
readonly outputs: readonly [];
|
|
60
|
+
readonly stateMutability: "payable";
|
|
61
|
+
readonly type: "function";
|
|
62
|
+
}, {
|
|
63
|
+
readonly inputs: readonly [{
|
|
64
|
+
readonly internalType: "address";
|
|
65
|
+
readonly name: "newImplementation";
|
|
66
|
+
readonly type: "address";
|
|
67
|
+
}];
|
|
68
|
+
readonly name: "upgradeTo";
|
|
69
|
+
readonly outputs: readonly [];
|
|
70
|
+
readonly stateMutability: "nonpayable";
|
|
71
|
+
readonly type: "function";
|
|
72
|
+
}, {
|
|
73
|
+
readonly inputs: readonly [{
|
|
74
|
+
readonly internalType: "address";
|
|
75
|
+
readonly name: "newImplementation";
|
|
76
|
+
readonly type: "address";
|
|
77
|
+
}, {
|
|
78
|
+
readonly internalType: "bytes";
|
|
79
|
+
readonly name: "data";
|
|
80
|
+
readonly type: "bytes";
|
|
81
|
+
}];
|
|
82
|
+
readonly name: "upgradeToAndCall";
|
|
83
|
+
readonly outputs: readonly [];
|
|
84
|
+
readonly stateMutability: "payable";
|
|
85
|
+
readonly type: "function";
|
|
86
|
+
}];
|
|
87
|
+
/**
|
|
88
|
+
* Type-safe ABI for InitializableImmutableAdminUpgradeabilityProxy_json
|
|
89
|
+
*/
|
|
90
|
+
export type InitializableImmutableAdminUpgradeabilityProxy_jsonAbi = typeof InitializableImmutableAdminUpgradeabilityProxy_jsonAbi;
|
|
91
|
+
/**
|
|
92
|
+
* Contract instance type for InitializableImmutableAdminUpgradeabilityProxy_json
|
|
93
|
+
*/
|
|
94
|
+
export type InitializableImmutableAdminUpgradeabilityProxy_jsonContract = any;
|
|
95
|
+
/**
|
|
96
|
+
* InitializableImmutableAdminUpgradeabilityProxy_json Contract Class
|
|
97
|
+
*
|
|
98
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
103
|
+
* import { mainnet } from 'viem/chains';
|
|
104
|
+
* import { InitializableImmutableAdminUpgradeabilityProxy_json } from 'InitializableImmutableAdminUpgradeabilityProxy_json';
|
|
105
|
+
*
|
|
106
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
107
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
108
|
+
*
|
|
109
|
+
* const contract = new InitializableImmutableAdminUpgradeabilityProxy_json('0x...', { publicClient, walletClient });
|
|
110
|
+
*
|
|
111
|
+
* // Read functions
|
|
112
|
+
* const result = await contract.balanceOf('0x...');
|
|
113
|
+
*
|
|
114
|
+
* // Write functions
|
|
115
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
116
|
+
*
|
|
117
|
+
* // Simulate transactions (dry-run)
|
|
118
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
119
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
120
|
+
*
|
|
121
|
+
* // Watch events
|
|
122
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
123
|
+
* console.log('Transfer event:', event);
|
|
124
|
+
* });
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
export declare class InitializableImmutableAdminUpgradeabilityProxy_json {
|
|
128
|
+
private contract;
|
|
129
|
+
private contractAddress;
|
|
130
|
+
private publicClient;
|
|
131
|
+
constructor(address: Address, clients: {
|
|
132
|
+
publicClient: PublicClient;
|
|
133
|
+
walletClient?: WalletClient;
|
|
134
|
+
});
|
|
135
|
+
/**
|
|
136
|
+
* Get the contract address
|
|
137
|
+
*/
|
|
138
|
+
get address(): Address;
|
|
139
|
+
/**
|
|
140
|
+
* Get the underlying viem contract instance
|
|
141
|
+
*/
|
|
142
|
+
getContract(): InitializableImmutableAdminUpgradeabilityProxy_jsonContract;
|
|
143
|
+
/**
|
|
144
|
+
* admin
|
|
145
|
+
* nonpayable
|
|
146
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
147
|
+
*/
|
|
148
|
+
admin(options?: {
|
|
149
|
+
accessList?: import('viem').AccessList;
|
|
150
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
151
|
+
chain?: import('viem').Chain | null;
|
|
152
|
+
dataSuffix?: `0x${string}`;
|
|
153
|
+
gas?: bigint;
|
|
154
|
+
gasPrice?: bigint;
|
|
155
|
+
maxFeePerGas?: bigint;
|
|
156
|
+
maxPriorityFeePerGas?: bigint;
|
|
157
|
+
nonce?: number;
|
|
158
|
+
value?: bigint;
|
|
159
|
+
}): Promise<`0x${string}`>;
|
|
160
|
+
/**
|
|
161
|
+
* implementation
|
|
162
|
+
* nonpayable
|
|
163
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
164
|
+
*/
|
|
165
|
+
implementation(options?: {
|
|
166
|
+
accessList?: import('viem').AccessList;
|
|
167
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
168
|
+
chain?: import('viem').Chain | null;
|
|
169
|
+
dataSuffix?: `0x${string}`;
|
|
170
|
+
gas?: bigint;
|
|
171
|
+
gasPrice?: bigint;
|
|
172
|
+
maxFeePerGas?: bigint;
|
|
173
|
+
maxPriorityFeePerGas?: bigint;
|
|
174
|
+
nonce?: number;
|
|
175
|
+
value?: bigint;
|
|
176
|
+
}): Promise<`0x${string}`>;
|
|
177
|
+
/**
|
|
178
|
+
* initialize
|
|
179
|
+
* payable
|
|
180
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
181
|
+
*/
|
|
182
|
+
initialize(_logic: `0x${string}`, _data: `0x${string}`, options?: {
|
|
183
|
+
accessList?: import('viem').AccessList;
|
|
184
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
185
|
+
chain?: import('viem').Chain | null;
|
|
186
|
+
dataSuffix?: `0x${string}`;
|
|
187
|
+
gas?: bigint;
|
|
188
|
+
gasPrice?: bigint;
|
|
189
|
+
maxFeePerGas?: bigint;
|
|
190
|
+
maxPriorityFeePerGas?: bigint;
|
|
191
|
+
nonce?: number;
|
|
192
|
+
value?: bigint;
|
|
193
|
+
}): Promise<`0x${string}`>;
|
|
194
|
+
/**
|
|
195
|
+
* upgradeTo
|
|
196
|
+
* nonpayable
|
|
197
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
198
|
+
*/
|
|
199
|
+
upgradeTo(newImplementation: `0x${string}`, options?: {
|
|
200
|
+
accessList?: import('viem').AccessList;
|
|
201
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
202
|
+
chain?: import('viem').Chain | null;
|
|
203
|
+
dataSuffix?: `0x${string}`;
|
|
204
|
+
gas?: bigint;
|
|
205
|
+
gasPrice?: bigint;
|
|
206
|
+
maxFeePerGas?: bigint;
|
|
207
|
+
maxPriorityFeePerGas?: bigint;
|
|
208
|
+
nonce?: number;
|
|
209
|
+
value?: bigint;
|
|
210
|
+
}): Promise<`0x${string}`>;
|
|
211
|
+
/**
|
|
212
|
+
* upgradeToAndCall
|
|
213
|
+
* payable
|
|
214
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
215
|
+
*/
|
|
216
|
+
upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
|
|
217
|
+
accessList?: import('viem').AccessList;
|
|
218
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
219
|
+
chain?: import('viem').Chain | null;
|
|
220
|
+
dataSuffix?: `0x${string}`;
|
|
221
|
+
gas?: bigint;
|
|
222
|
+
gasPrice?: bigint;
|
|
223
|
+
maxFeePerGas?: bigint;
|
|
224
|
+
maxPriorityFeePerGas?: bigint;
|
|
225
|
+
nonce?: number;
|
|
226
|
+
value?: bigint;
|
|
227
|
+
}): Promise<`0x${string}`>;
|
|
228
|
+
/**
|
|
229
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
233
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
234
|
+
* console.log('Would succeed:', result.result);
|
|
235
|
+
*/
|
|
236
|
+
get simulate(): {
|
|
237
|
+
/**
|
|
238
|
+
* Simulate admin
|
|
239
|
+
* Returns gas estimate and result without sending transaction
|
|
240
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
241
|
+
*/
|
|
242
|
+
admin(options?: {
|
|
243
|
+
accessList?: import("viem").AccessList;
|
|
244
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
245
|
+
chain?: import("viem").Chain | null;
|
|
246
|
+
dataSuffix?: `0x${string}`;
|
|
247
|
+
gas?: bigint;
|
|
248
|
+
gasPrice?: bigint;
|
|
249
|
+
maxFeePerGas?: bigint;
|
|
250
|
+
maxPriorityFeePerGas?: bigint;
|
|
251
|
+
nonce?: number;
|
|
252
|
+
value?: bigint;
|
|
253
|
+
}): Promise<`0x${string}`>;
|
|
254
|
+
/**
|
|
255
|
+
* Simulate implementation
|
|
256
|
+
* Returns gas estimate and result without sending transaction
|
|
257
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
258
|
+
*/
|
|
259
|
+
implementation(options?: {
|
|
260
|
+
accessList?: import("viem").AccessList;
|
|
261
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
262
|
+
chain?: import("viem").Chain | null;
|
|
263
|
+
dataSuffix?: `0x${string}`;
|
|
264
|
+
gas?: bigint;
|
|
265
|
+
gasPrice?: bigint;
|
|
266
|
+
maxFeePerGas?: bigint;
|
|
267
|
+
maxPriorityFeePerGas?: bigint;
|
|
268
|
+
nonce?: number;
|
|
269
|
+
value?: bigint;
|
|
270
|
+
}): Promise<`0x${string}`>;
|
|
271
|
+
/**
|
|
272
|
+
* Simulate initialize
|
|
273
|
+
* Returns gas estimate and result without sending transaction
|
|
274
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
275
|
+
*/
|
|
276
|
+
initialize(_logic: `0x${string}`, _data: `0x${string}`, options?: {
|
|
277
|
+
accessList?: import("viem").AccessList;
|
|
278
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
279
|
+
chain?: import("viem").Chain | null;
|
|
280
|
+
dataSuffix?: `0x${string}`;
|
|
281
|
+
gas?: bigint;
|
|
282
|
+
gasPrice?: bigint;
|
|
283
|
+
maxFeePerGas?: bigint;
|
|
284
|
+
maxPriorityFeePerGas?: bigint;
|
|
285
|
+
nonce?: number;
|
|
286
|
+
value?: bigint;
|
|
287
|
+
}): Promise<void>;
|
|
288
|
+
/**
|
|
289
|
+
* Simulate upgradeTo
|
|
290
|
+
* Returns gas estimate and result without sending transaction
|
|
291
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
292
|
+
*/
|
|
293
|
+
upgradeTo(newImplementation: `0x${string}`, options?: {
|
|
294
|
+
accessList?: import("viem").AccessList;
|
|
295
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
296
|
+
chain?: import("viem").Chain | null;
|
|
297
|
+
dataSuffix?: `0x${string}`;
|
|
298
|
+
gas?: bigint;
|
|
299
|
+
gasPrice?: bigint;
|
|
300
|
+
maxFeePerGas?: bigint;
|
|
301
|
+
maxPriorityFeePerGas?: bigint;
|
|
302
|
+
nonce?: number;
|
|
303
|
+
value?: bigint;
|
|
304
|
+
}): Promise<void>;
|
|
305
|
+
/**
|
|
306
|
+
* Simulate upgradeToAndCall
|
|
307
|
+
* Returns gas estimate and result without sending transaction
|
|
308
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
309
|
+
*/
|
|
310
|
+
upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
|
|
311
|
+
accessList?: import("viem").AccessList;
|
|
312
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
313
|
+
chain?: import("viem").Chain | null;
|
|
314
|
+
dataSuffix?: `0x${string}`;
|
|
315
|
+
gas?: bigint;
|
|
316
|
+
gasPrice?: bigint;
|
|
317
|
+
maxFeePerGas?: bigint;
|
|
318
|
+
maxPriorityFeePerGas?: bigint;
|
|
319
|
+
nonce?: number;
|
|
320
|
+
value?: bigint;
|
|
321
|
+
}): Promise<void>;
|
|
322
|
+
};
|
|
323
|
+
/**
|
|
324
|
+
* Watch contract events
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* // Watch all Transfer events
|
|
328
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
329
|
+
* console.log('Transfer:', event);
|
|
330
|
+
* });
|
|
331
|
+
*
|
|
332
|
+
* // Stop watching
|
|
333
|
+
* unwatch();
|
|
334
|
+
*/
|
|
335
|
+
get watch(): {
|
|
336
|
+
/**
|
|
337
|
+
* Watch Upgraded events
|
|
338
|
+
* @param callback Function to call when event is emitted
|
|
339
|
+
* @param filter Optional filter for indexed parameters
|
|
340
|
+
* @returns Unwatch function to stop listening
|
|
341
|
+
*/
|
|
342
|
+
Upgraded: (callback: (event: {
|
|
343
|
+
implementation: `0x${string}`;
|
|
344
|
+
}) => void, filter?: {
|
|
345
|
+
implementation: `0x${string}`;
|
|
346
|
+
}) => () => void;
|
|
347
|
+
};
|
|
348
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InitializableImmutableAdminUpgradeabilityProxy_json = exports.InitializableImmutableAdminUpgradeabilityProxy_jsonAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* InitializableImmutableAdminUpgradeabilityProxy_json ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.InitializableImmutableAdminUpgradeabilityProxy_jsonAbi = [
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "address",
|
|
15
|
+
"name": "admin",
|
|
16
|
+
"type": "address"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"stateMutability": "nonpayable",
|
|
20
|
+
"type": "constructor"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"anonymous": false,
|
|
24
|
+
"inputs": [
|
|
25
|
+
{
|
|
26
|
+
"indexed": true,
|
|
27
|
+
"internalType": "address",
|
|
28
|
+
"name": "implementation",
|
|
29
|
+
"type": "address"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"name": "Upgraded",
|
|
33
|
+
"type": "event"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"stateMutability": "payable",
|
|
37
|
+
"type": "fallback"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"inputs": [],
|
|
41
|
+
"name": "admin",
|
|
42
|
+
"outputs": [
|
|
43
|
+
{
|
|
44
|
+
"internalType": "address",
|
|
45
|
+
"name": "",
|
|
46
|
+
"type": "address"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"stateMutability": "nonpayable",
|
|
50
|
+
"type": "function"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"inputs": [],
|
|
54
|
+
"name": "implementation",
|
|
55
|
+
"outputs": [
|
|
56
|
+
{
|
|
57
|
+
"internalType": "address",
|
|
58
|
+
"name": "",
|
|
59
|
+
"type": "address"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"stateMutability": "nonpayable",
|
|
63
|
+
"type": "function"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"inputs": [
|
|
67
|
+
{
|
|
68
|
+
"internalType": "address",
|
|
69
|
+
"name": "_logic",
|
|
70
|
+
"type": "address"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"internalType": "bytes",
|
|
74
|
+
"name": "_data",
|
|
75
|
+
"type": "bytes"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"name": "initialize",
|
|
79
|
+
"outputs": [],
|
|
80
|
+
"stateMutability": "payable",
|
|
81
|
+
"type": "function"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"inputs": [
|
|
85
|
+
{
|
|
86
|
+
"internalType": "address",
|
|
87
|
+
"name": "newImplementation",
|
|
88
|
+
"type": "address"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"name": "upgradeTo",
|
|
92
|
+
"outputs": [],
|
|
93
|
+
"stateMutability": "nonpayable",
|
|
94
|
+
"type": "function"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"inputs": [
|
|
98
|
+
{
|
|
99
|
+
"internalType": "address",
|
|
100
|
+
"name": "newImplementation",
|
|
101
|
+
"type": "address"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"internalType": "bytes",
|
|
105
|
+
"name": "data",
|
|
106
|
+
"type": "bytes"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"name": "upgradeToAndCall",
|
|
110
|
+
"outputs": [],
|
|
111
|
+
"stateMutability": "payable",
|
|
112
|
+
"type": "function"
|
|
113
|
+
}
|
|
114
|
+
];
|
|
115
|
+
/**
|
|
116
|
+
* InitializableImmutableAdminUpgradeabilityProxy_json Contract Class
|
|
117
|
+
*
|
|
118
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
123
|
+
* import { mainnet } from 'viem/chains';
|
|
124
|
+
* import { InitializableImmutableAdminUpgradeabilityProxy_json } from 'InitializableImmutableAdminUpgradeabilityProxy_json';
|
|
125
|
+
*
|
|
126
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
127
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
128
|
+
*
|
|
129
|
+
* const contract = new InitializableImmutableAdminUpgradeabilityProxy_json('0x...', { publicClient, walletClient });
|
|
130
|
+
*
|
|
131
|
+
* // Read functions
|
|
132
|
+
* const result = await contract.balanceOf('0x...');
|
|
133
|
+
*
|
|
134
|
+
* // Write functions
|
|
135
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
136
|
+
*
|
|
137
|
+
* // Simulate transactions (dry-run)
|
|
138
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
139
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
140
|
+
*
|
|
141
|
+
* // Watch events
|
|
142
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
143
|
+
* console.log('Transfer event:', event);
|
|
144
|
+
* });
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
class InitializableImmutableAdminUpgradeabilityProxy_json {
|
|
148
|
+
constructor(address, clients) {
|
|
149
|
+
this.contractAddress = address;
|
|
150
|
+
this.publicClient = clients.publicClient;
|
|
151
|
+
this.contract = (0, viem_1.getContract)({
|
|
152
|
+
address,
|
|
153
|
+
abi: exports.InitializableImmutableAdminUpgradeabilityProxy_jsonAbi,
|
|
154
|
+
client: {
|
|
155
|
+
public: clients.publicClient,
|
|
156
|
+
wallet: clients.walletClient,
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Get the contract address
|
|
162
|
+
*/
|
|
163
|
+
get address() {
|
|
164
|
+
return this.contractAddress;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get the underlying viem contract instance
|
|
168
|
+
*/
|
|
169
|
+
getContract() {
|
|
170
|
+
return this.contract;
|
|
171
|
+
}
|
|
172
|
+
// No read functions
|
|
173
|
+
/**
|
|
174
|
+
* admin
|
|
175
|
+
* nonpayable
|
|
176
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
177
|
+
*/
|
|
178
|
+
async admin(options) {
|
|
179
|
+
if (!this.contract.write) {
|
|
180
|
+
throw new Error('Wallet client is required for write operations');
|
|
181
|
+
}
|
|
182
|
+
return this.contract.write.admin(options);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* implementation
|
|
186
|
+
* nonpayable
|
|
187
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
188
|
+
*/
|
|
189
|
+
async implementation(options) {
|
|
190
|
+
if (!this.contract.write) {
|
|
191
|
+
throw new Error('Wallet client is required for write operations');
|
|
192
|
+
}
|
|
193
|
+
return this.contract.write.implementation(options);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* initialize
|
|
197
|
+
* payable
|
|
198
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
199
|
+
*/
|
|
200
|
+
async initialize(_logic, _data, options) {
|
|
201
|
+
if (!this.contract.write) {
|
|
202
|
+
throw new Error('Wallet client is required for write operations');
|
|
203
|
+
}
|
|
204
|
+
return this.contract.write.initialize([_logic, _data], options);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* upgradeTo
|
|
208
|
+
* nonpayable
|
|
209
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
210
|
+
*/
|
|
211
|
+
async upgradeTo(newImplementation, options) {
|
|
212
|
+
if (!this.contract.write) {
|
|
213
|
+
throw new Error('Wallet client is required for write operations');
|
|
214
|
+
}
|
|
215
|
+
return this.contract.write.upgradeTo([newImplementation], options);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* upgradeToAndCall
|
|
219
|
+
* payable
|
|
220
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
221
|
+
*/
|
|
222
|
+
async upgradeToAndCall(newImplementation, data, options) {
|
|
223
|
+
if (!this.contract.write) {
|
|
224
|
+
throw new Error('Wallet client is required for write operations');
|
|
225
|
+
}
|
|
226
|
+
return this.contract.write.upgradeToAndCall([newImplementation, data], options);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
233
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
234
|
+
* console.log('Would succeed:', result.result);
|
|
235
|
+
*/
|
|
236
|
+
get simulate() {
|
|
237
|
+
const contract = this.contract;
|
|
238
|
+
if (!contract.simulate) {
|
|
239
|
+
throw new Error('Public client is required for simulation');
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
/**
|
|
243
|
+
* Simulate admin
|
|
244
|
+
* Returns gas estimate and result without sending transaction
|
|
245
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
246
|
+
*/
|
|
247
|
+
async admin(options) {
|
|
248
|
+
return contract.simulate.admin(options);
|
|
249
|
+
},
|
|
250
|
+
/**
|
|
251
|
+
* Simulate implementation
|
|
252
|
+
* Returns gas estimate and result without sending transaction
|
|
253
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
254
|
+
*/
|
|
255
|
+
async implementation(options) {
|
|
256
|
+
return contract.simulate.implementation(options);
|
|
257
|
+
},
|
|
258
|
+
/**
|
|
259
|
+
* Simulate initialize
|
|
260
|
+
* Returns gas estimate and result without sending transaction
|
|
261
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
262
|
+
*/
|
|
263
|
+
async initialize(_logic, _data, options) {
|
|
264
|
+
return contract.simulate.initialize([_logic, _data], options);
|
|
265
|
+
},
|
|
266
|
+
/**
|
|
267
|
+
* Simulate upgradeTo
|
|
268
|
+
* Returns gas estimate and result without sending transaction
|
|
269
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
270
|
+
*/
|
|
271
|
+
async upgradeTo(newImplementation, options) {
|
|
272
|
+
return contract.simulate.upgradeTo([newImplementation], options);
|
|
273
|
+
},
|
|
274
|
+
/**
|
|
275
|
+
* Simulate upgradeToAndCall
|
|
276
|
+
* Returns gas estimate and result without sending transaction
|
|
277
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
278
|
+
*/
|
|
279
|
+
async upgradeToAndCall(newImplementation, data, options) {
|
|
280
|
+
return contract.simulate.upgradeToAndCall([newImplementation, data], options);
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Watch contract events
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* // Watch all Transfer events
|
|
289
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
290
|
+
* console.log('Transfer:', event);
|
|
291
|
+
* });
|
|
292
|
+
*
|
|
293
|
+
* // Stop watching
|
|
294
|
+
* unwatch();
|
|
295
|
+
*/
|
|
296
|
+
get watch() {
|
|
297
|
+
return {
|
|
298
|
+
/**
|
|
299
|
+
* Watch Upgraded events
|
|
300
|
+
* @param callback Function to call when event is emitted
|
|
301
|
+
* @param filter Optional filter for indexed parameters
|
|
302
|
+
* @returns Unwatch function to stop listening
|
|
303
|
+
*/
|
|
304
|
+
Upgraded: (callback, filter) => {
|
|
305
|
+
return this.publicClient.watchContractEvent({
|
|
306
|
+
address: this.contractAddress,
|
|
307
|
+
abi: exports.InitializableImmutableAdminUpgradeabilityProxy_jsonAbi,
|
|
308
|
+
eventName: 'Upgraded',
|
|
309
|
+
args: filter,
|
|
310
|
+
onLogs: (logs) => {
|
|
311
|
+
logs.forEach((log) => {
|
|
312
|
+
callback(log.args);
|
|
313
|
+
});
|
|
314
|
+
},
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
exports.InitializableImmutableAdminUpgradeabilityProxy_json = InitializableImmutableAdminUpgradeabilityProxy_json;
|