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