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