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