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