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