@gitmyabi/publx 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/PUBLX_json.d.ts +819 -0
- package/contracts/PUBLX_json.js +856 -0
- package/contracts/PUBLX_json.ts +1101 -0
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +7 -0
- package/contracts/index.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +43 -0
|
@@ -0,0 +1,819 @@
|
|
|
1
|
+
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* PUBLX_json ABI
|
|
4
|
+
*
|
|
5
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PUBLX_jsonAbi: readonly [{
|
|
8
|
+
readonly constant: true;
|
|
9
|
+
readonly inputs: readonly [];
|
|
10
|
+
readonly name: "name";
|
|
11
|
+
readonly outputs: readonly [{
|
|
12
|
+
readonly name: "";
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
}];
|
|
15
|
+
readonly payable: false;
|
|
16
|
+
readonly stateMutability: "view";
|
|
17
|
+
readonly type: "function";
|
|
18
|
+
}, {
|
|
19
|
+
readonly constant: false;
|
|
20
|
+
readonly inputs: readonly [{
|
|
21
|
+
readonly name: "spender";
|
|
22
|
+
readonly type: "address";
|
|
23
|
+
}, {
|
|
24
|
+
readonly name: "value";
|
|
25
|
+
readonly type: "uint256";
|
|
26
|
+
}];
|
|
27
|
+
readonly name: "approve";
|
|
28
|
+
readonly outputs: readonly [{
|
|
29
|
+
readonly name: "";
|
|
30
|
+
readonly type: "bool";
|
|
31
|
+
}];
|
|
32
|
+
readonly payable: false;
|
|
33
|
+
readonly stateMutability: "nonpayable";
|
|
34
|
+
readonly type: "function";
|
|
35
|
+
}, {
|
|
36
|
+
readonly constant: true;
|
|
37
|
+
readonly inputs: readonly [];
|
|
38
|
+
readonly name: "totalSupply";
|
|
39
|
+
readonly outputs: readonly [{
|
|
40
|
+
readonly name: "";
|
|
41
|
+
readonly type: "uint256";
|
|
42
|
+
}];
|
|
43
|
+
readonly payable: false;
|
|
44
|
+
readonly stateMutability: "view";
|
|
45
|
+
readonly type: "function";
|
|
46
|
+
}, {
|
|
47
|
+
readonly constant: false;
|
|
48
|
+
readonly inputs: readonly [{
|
|
49
|
+
readonly name: "from";
|
|
50
|
+
readonly type: "address";
|
|
51
|
+
}, {
|
|
52
|
+
readonly name: "to";
|
|
53
|
+
readonly type: "address";
|
|
54
|
+
}, {
|
|
55
|
+
readonly name: "value";
|
|
56
|
+
readonly type: "uint256";
|
|
57
|
+
}];
|
|
58
|
+
readonly name: "transferFrom";
|
|
59
|
+
readonly outputs: readonly [{
|
|
60
|
+
readonly name: "";
|
|
61
|
+
readonly type: "bool";
|
|
62
|
+
}];
|
|
63
|
+
readonly payable: false;
|
|
64
|
+
readonly stateMutability: "nonpayable";
|
|
65
|
+
readonly type: "function";
|
|
66
|
+
}, {
|
|
67
|
+
readonly constant: true;
|
|
68
|
+
readonly inputs: readonly [];
|
|
69
|
+
readonly name: "INITIAL_SUPPLY";
|
|
70
|
+
readonly outputs: readonly [{
|
|
71
|
+
readonly name: "";
|
|
72
|
+
readonly type: "uint256";
|
|
73
|
+
}];
|
|
74
|
+
readonly payable: false;
|
|
75
|
+
readonly stateMutability: "view";
|
|
76
|
+
readonly type: "function";
|
|
77
|
+
}, {
|
|
78
|
+
readonly constant: true;
|
|
79
|
+
readonly inputs: readonly [];
|
|
80
|
+
readonly name: "decimals";
|
|
81
|
+
readonly outputs: readonly [{
|
|
82
|
+
readonly name: "";
|
|
83
|
+
readonly type: "uint8";
|
|
84
|
+
}];
|
|
85
|
+
readonly payable: false;
|
|
86
|
+
readonly stateMutability: "view";
|
|
87
|
+
readonly type: "function";
|
|
88
|
+
}, {
|
|
89
|
+
readonly constant: false;
|
|
90
|
+
readonly inputs: readonly [{
|
|
91
|
+
readonly name: "spender";
|
|
92
|
+
readonly type: "address";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "addedValue";
|
|
95
|
+
readonly type: "uint256";
|
|
96
|
+
}];
|
|
97
|
+
readonly name: "increaseAllowance";
|
|
98
|
+
readonly outputs: readonly [{
|
|
99
|
+
readonly name: "success";
|
|
100
|
+
readonly type: "bool";
|
|
101
|
+
}];
|
|
102
|
+
readonly payable: false;
|
|
103
|
+
readonly stateMutability: "nonpayable";
|
|
104
|
+
readonly type: "function";
|
|
105
|
+
}, {
|
|
106
|
+
readonly constant: false;
|
|
107
|
+
readonly inputs: readonly [];
|
|
108
|
+
readonly name: "unpause";
|
|
109
|
+
readonly outputs: readonly [];
|
|
110
|
+
readonly payable: false;
|
|
111
|
+
readonly stateMutability: "nonpayable";
|
|
112
|
+
readonly type: "function";
|
|
113
|
+
}, {
|
|
114
|
+
readonly constant: true;
|
|
115
|
+
readonly inputs: readonly [{
|
|
116
|
+
readonly name: "account";
|
|
117
|
+
readonly type: "address";
|
|
118
|
+
}];
|
|
119
|
+
readonly name: "isPauser";
|
|
120
|
+
readonly outputs: readonly [{
|
|
121
|
+
readonly name: "";
|
|
122
|
+
readonly type: "bool";
|
|
123
|
+
}];
|
|
124
|
+
readonly payable: false;
|
|
125
|
+
readonly stateMutability: "view";
|
|
126
|
+
readonly type: "function";
|
|
127
|
+
}, {
|
|
128
|
+
readonly constant: true;
|
|
129
|
+
readonly inputs: readonly [];
|
|
130
|
+
readonly name: "paused";
|
|
131
|
+
readonly outputs: readonly [{
|
|
132
|
+
readonly name: "";
|
|
133
|
+
readonly type: "bool";
|
|
134
|
+
}];
|
|
135
|
+
readonly payable: false;
|
|
136
|
+
readonly stateMutability: "view";
|
|
137
|
+
readonly type: "function";
|
|
138
|
+
}, {
|
|
139
|
+
readonly constant: false;
|
|
140
|
+
readonly inputs: readonly [];
|
|
141
|
+
readonly name: "renouncePauser";
|
|
142
|
+
readonly outputs: readonly [];
|
|
143
|
+
readonly payable: false;
|
|
144
|
+
readonly stateMutability: "nonpayable";
|
|
145
|
+
readonly type: "function";
|
|
146
|
+
}, {
|
|
147
|
+
readonly constant: true;
|
|
148
|
+
readonly inputs: readonly [{
|
|
149
|
+
readonly name: "owner";
|
|
150
|
+
readonly type: "address";
|
|
151
|
+
}];
|
|
152
|
+
readonly name: "balanceOf";
|
|
153
|
+
readonly outputs: readonly [{
|
|
154
|
+
readonly name: "";
|
|
155
|
+
readonly type: "uint256";
|
|
156
|
+
}];
|
|
157
|
+
readonly payable: false;
|
|
158
|
+
readonly stateMutability: "view";
|
|
159
|
+
readonly type: "function";
|
|
160
|
+
}, {
|
|
161
|
+
readonly constant: false;
|
|
162
|
+
readonly inputs: readonly [{
|
|
163
|
+
readonly name: "account";
|
|
164
|
+
readonly type: "address";
|
|
165
|
+
}];
|
|
166
|
+
readonly name: "addPauser";
|
|
167
|
+
readonly outputs: readonly [];
|
|
168
|
+
readonly payable: false;
|
|
169
|
+
readonly stateMutability: "nonpayable";
|
|
170
|
+
readonly type: "function";
|
|
171
|
+
}, {
|
|
172
|
+
readonly constant: false;
|
|
173
|
+
readonly inputs: readonly [];
|
|
174
|
+
readonly name: "pause";
|
|
175
|
+
readonly outputs: readonly [];
|
|
176
|
+
readonly payable: false;
|
|
177
|
+
readonly stateMutability: "nonpayable";
|
|
178
|
+
readonly type: "function";
|
|
179
|
+
}, {
|
|
180
|
+
readonly constant: true;
|
|
181
|
+
readonly inputs: readonly [];
|
|
182
|
+
readonly name: "symbol";
|
|
183
|
+
readonly outputs: readonly [{
|
|
184
|
+
readonly name: "";
|
|
185
|
+
readonly type: "string";
|
|
186
|
+
}];
|
|
187
|
+
readonly payable: false;
|
|
188
|
+
readonly stateMutability: "view";
|
|
189
|
+
readonly type: "function";
|
|
190
|
+
}, {
|
|
191
|
+
readonly constant: false;
|
|
192
|
+
readonly inputs: readonly [{
|
|
193
|
+
readonly name: "spender";
|
|
194
|
+
readonly type: "address";
|
|
195
|
+
}, {
|
|
196
|
+
readonly name: "subtractedValue";
|
|
197
|
+
readonly type: "uint256";
|
|
198
|
+
}];
|
|
199
|
+
readonly name: "decreaseAllowance";
|
|
200
|
+
readonly outputs: readonly [{
|
|
201
|
+
readonly name: "success";
|
|
202
|
+
readonly type: "bool";
|
|
203
|
+
}];
|
|
204
|
+
readonly payable: false;
|
|
205
|
+
readonly stateMutability: "nonpayable";
|
|
206
|
+
readonly type: "function";
|
|
207
|
+
}, {
|
|
208
|
+
readonly constant: false;
|
|
209
|
+
readonly inputs: readonly [{
|
|
210
|
+
readonly name: "to";
|
|
211
|
+
readonly type: "address";
|
|
212
|
+
}, {
|
|
213
|
+
readonly name: "value";
|
|
214
|
+
readonly type: "uint256";
|
|
215
|
+
}];
|
|
216
|
+
readonly name: "transfer";
|
|
217
|
+
readonly outputs: readonly [{
|
|
218
|
+
readonly name: "";
|
|
219
|
+
readonly type: "bool";
|
|
220
|
+
}];
|
|
221
|
+
readonly payable: false;
|
|
222
|
+
readonly stateMutability: "nonpayable";
|
|
223
|
+
readonly type: "function";
|
|
224
|
+
}, {
|
|
225
|
+
readonly constant: true;
|
|
226
|
+
readonly inputs: readonly [{
|
|
227
|
+
readonly name: "owner";
|
|
228
|
+
readonly type: "address";
|
|
229
|
+
}, {
|
|
230
|
+
readonly name: "spender";
|
|
231
|
+
readonly type: "address";
|
|
232
|
+
}];
|
|
233
|
+
readonly name: "allowance";
|
|
234
|
+
readonly outputs: readonly [{
|
|
235
|
+
readonly name: "";
|
|
236
|
+
readonly type: "uint256";
|
|
237
|
+
}];
|
|
238
|
+
readonly payable: false;
|
|
239
|
+
readonly stateMutability: "view";
|
|
240
|
+
readonly type: "function";
|
|
241
|
+
}, {
|
|
242
|
+
readonly inputs: readonly [{
|
|
243
|
+
readonly name: "reserveAddress";
|
|
244
|
+
readonly type: "address";
|
|
245
|
+
}];
|
|
246
|
+
readonly payable: false;
|
|
247
|
+
readonly stateMutability: "nonpayable";
|
|
248
|
+
readonly type: "constructor";
|
|
249
|
+
}, {
|
|
250
|
+
readonly anonymous: false;
|
|
251
|
+
readonly inputs: readonly [{
|
|
252
|
+
readonly indexed: false;
|
|
253
|
+
readonly name: "account";
|
|
254
|
+
readonly type: "address";
|
|
255
|
+
}];
|
|
256
|
+
readonly name: "Paused";
|
|
257
|
+
readonly type: "event";
|
|
258
|
+
}, {
|
|
259
|
+
readonly anonymous: false;
|
|
260
|
+
readonly inputs: readonly [{
|
|
261
|
+
readonly indexed: false;
|
|
262
|
+
readonly name: "account";
|
|
263
|
+
readonly type: "address";
|
|
264
|
+
}];
|
|
265
|
+
readonly name: "Unpaused";
|
|
266
|
+
readonly type: "event";
|
|
267
|
+
}, {
|
|
268
|
+
readonly anonymous: false;
|
|
269
|
+
readonly inputs: readonly [{
|
|
270
|
+
readonly indexed: true;
|
|
271
|
+
readonly name: "account";
|
|
272
|
+
readonly type: "address";
|
|
273
|
+
}];
|
|
274
|
+
readonly name: "PauserAdded";
|
|
275
|
+
readonly type: "event";
|
|
276
|
+
}, {
|
|
277
|
+
readonly anonymous: false;
|
|
278
|
+
readonly inputs: readonly [{
|
|
279
|
+
readonly indexed: true;
|
|
280
|
+
readonly name: "account";
|
|
281
|
+
readonly type: "address";
|
|
282
|
+
}];
|
|
283
|
+
readonly name: "PauserRemoved";
|
|
284
|
+
readonly type: "event";
|
|
285
|
+
}, {
|
|
286
|
+
readonly anonymous: false;
|
|
287
|
+
readonly inputs: readonly [{
|
|
288
|
+
readonly indexed: true;
|
|
289
|
+
readonly name: "from";
|
|
290
|
+
readonly type: "address";
|
|
291
|
+
}, {
|
|
292
|
+
readonly indexed: true;
|
|
293
|
+
readonly name: "to";
|
|
294
|
+
readonly type: "address";
|
|
295
|
+
}, {
|
|
296
|
+
readonly indexed: false;
|
|
297
|
+
readonly name: "value";
|
|
298
|
+
readonly type: "uint256";
|
|
299
|
+
}];
|
|
300
|
+
readonly name: "Transfer";
|
|
301
|
+
readonly type: "event";
|
|
302
|
+
}, {
|
|
303
|
+
readonly anonymous: false;
|
|
304
|
+
readonly inputs: readonly [{
|
|
305
|
+
readonly indexed: true;
|
|
306
|
+
readonly name: "owner";
|
|
307
|
+
readonly type: "address";
|
|
308
|
+
}, {
|
|
309
|
+
readonly indexed: true;
|
|
310
|
+
readonly name: "spender";
|
|
311
|
+
readonly type: "address";
|
|
312
|
+
}, {
|
|
313
|
+
readonly indexed: false;
|
|
314
|
+
readonly name: "value";
|
|
315
|
+
readonly type: "uint256";
|
|
316
|
+
}];
|
|
317
|
+
readonly name: "Approval";
|
|
318
|
+
readonly type: "event";
|
|
319
|
+
}];
|
|
320
|
+
/**
|
|
321
|
+
* Type-safe ABI for PUBLX_json
|
|
322
|
+
*/
|
|
323
|
+
export type PUBLX_jsonAbi = typeof PUBLX_jsonAbi;
|
|
324
|
+
/**
|
|
325
|
+
* Contract instance type for PUBLX_json
|
|
326
|
+
*/
|
|
327
|
+
export type PUBLX_jsonContract = any;
|
|
328
|
+
/**
|
|
329
|
+
* PUBLX_json Contract Class
|
|
330
|
+
*
|
|
331
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* ```typescript
|
|
335
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
336
|
+
* import { mainnet } from 'viem/chains';
|
|
337
|
+
* import { PUBLX_json } from 'PUBLX_json';
|
|
338
|
+
*
|
|
339
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
340
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
341
|
+
*
|
|
342
|
+
* const contract = new PUBLX_json('0x...', { publicClient, walletClient });
|
|
343
|
+
*
|
|
344
|
+
* // Read functions
|
|
345
|
+
* const result = await contract.balanceOf('0x...');
|
|
346
|
+
*
|
|
347
|
+
* // Write functions
|
|
348
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
349
|
+
*
|
|
350
|
+
* // Simulate transactions (dry-run)
|
|
351
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
352
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
353
|
+
*
|
|
354
|
+
* // Watch events
|
|
355
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
356
|
+
* console.log('Transfer event:', event);
|
|
357
|
+
* });
|
|
358
|
+
* ```
|
|
359
|
+
*/
|
|
360
|
+
export declare class PUBLX_json {
|
|
361
|
+
private contract;
|
|
362
|
+
private contractAddress;
|
|
363
|
+
private publicClient;
|
|
364
|
+
constructor(address: Address, clients: {
|
|
365
|
+
publicClient: PublicClient;
|
|
366
|
+
walletClient?: WalletClient;
|
|
367
|
+
});
|
|
368
|
+
/**
|
|
369
|
+
* Get the contract address
|
|
370
|
+
*/
|
|
371
|
+
get address(): Address;
|
|
372
|
+
/**
|
|
373
|
+
* Get the underlying viem contract instance
|
|
374
|
+
*/
|
|
375
|
+
getContract(): PUBLX_jsonContract;
|
|
376
|
+
/**
|
|
377
|
+
* name
|
|
378
|
+
* view
|
|
379
|
+
*/
|
|
380
|
+
name(): Promise<string>;
|
|
381
|
+
/**
|
|
382
|
+
* totalSupply
|
|
383
|
+
* view
|
|
384
|
+
*/
|
|
385
|
+
totalSupply(): Promise<bigint>;
|
|
386
|
+
/**
|
|
387
|
+
* INITIAL_SUPPLY
|
|
388
|
+
* view
|
|
389
|
+
*/
|
|
390
|
+
INITIAL_SUPPLY(): Promise<bigint>;
|
|
391
|
+
/**
|
|
392
|
+
* decimals
|
|
393
|
+
* view
|
|
394
|
+
*/
|
|
395
|
+
decimals(): Promise<bigint>;
|
|
396
|
+
/**
|
|
397
|
+
* isPauser
|
|
398
|
+
* view
|
|
399
|
+
*/
|
|
400
|
+
isPauser(account: `0x${string}`): Promise<boolean>;
|
|
401
|
+
/**
|
|
402
|
+
* paused
|
|
403
|
+
* view
|
|
404
|
+
*/
|
|
405
|
+
paused(): Promise<boolean>;
|
|
406
|
+
/**
|
|
407
|
+
* balanceOf
|
|
408
|
+
* view
|
|
409
|
+
*/
|
|
410
|
+
balanceOf(owner: `0x${string}`): Promise<bigint>;
|
|
411
|
+
/**
|
|
412
|
+
* symbol
|
|
413
|
+
* view
|
|
414
|
+
*/
|
|
415
|
+
symbol(): Promise<string>;
|
|
416
|
+
/**
|
|
417
|
+
* allowance
|
|
418
|
+
* view
|
|
419
|
+
*/
|
|
420
|
+
allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint>;
|
|
421
|
+
/**
|
|
422
|
+
* approve
|
|
423
|
+
* nonpayable
|
|
424
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
425
|
+
*/
|
|
426
|
+
approve(spender: `0x${string}`, value: bigint, options?: {
|
|
427
|
+
accessList?: import('viem').AccessList;
|
|
428
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
429
|
+
chain?: import('viem').Chain | null;
|
|
430
|
+
dataSuffix?: `0x${string}`;
|
|
431
|
+
gas?: bigint;
|
|
432
|
+
gasPrice?: bigint;
|
|
433
|
+
maxFeePerGas?: bigint;
|
|
434
|
+
maxPriorityFeePerGas?: bigint;
|
|
435
|
+
nonce?: number;
|
|
436
|
+
value?: bigint;
|
|
437
|
+
}): Promise<`0x${string}`>;
|
|
438
|
+
/**
|
|
439
|
+
* transferFrom
|
|
440
|
+
* nonpayable
|
|
441
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
442
|
+
*/
|
|
443
|
+
transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
|
|
444
|
+
accessList?: import('viem').AccessList;
|
|
445
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
446
|
+
chain?: import('viem').Chain | null;
|
|
447
|
+
dataSuffix?: `0x${string}`;
|
|
448
|
+
gas?: bigint;
|
|
449
|
+
gasPrice?: bigint;
|
|
450
|
+
maxFeePerGas?: bigint;
|
|
451
|
+
maxPriorityFeePerGas?: bigint;
|
|
452
|
+
nonce?: number;
|
|
453
|
+
value?: bigint;
|
|
454
|
+
}): Promise<`0x${string}`>;
|
|
455
|
+
/**
|
|
456
|
+
* increaseAllowance
|
|
457
|
+
* nonpayable
|
|
458
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
459
|
+
*/
|
|
460
|
+
increaseAllowance(spender: `0x${string}`, addedValue: bigint, 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<`0x${string}`>;
|
|
472
|
+
/**
|
|
473
|
+
* unpause
|
|
474
|
+
* nonpayable
|
|
475
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
476
|
+
*/
|
|
477
|
+
unpause(options?: {
|
|
478
|
+
accessList?: import('viem').AccessList;
|
|
479
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
480
|
+
chain?: import('viem').Chain | null;
|
|
481
|
+
dataSuffix?: `0x${string}`;
|
|
482
|
+
gas?: bigint;
|
|
483
|
+
gasPrice?: bigint;
|
|
484
|
+
maxFeePerGas?: bigint;
|
|
485
|
+
maxPriorityFeePerGas?: bigint;
|
|
486
|
+
nonce?: number;
|
|
487
|
+
value?: bigint;
|
|
488
|
+
}): Promise<`0x${string}`>;
|
|
489
|
+
/**
|
|
490
|
+
* renouncePauser
|
|
491
|
+
* nonpayable
|
|
492
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
493
|
+
*/
|
|
494
|
+
renouncePauser(options?: {
|
|
495
|
+
accessList?: import('viem').AccessList;
|
|
496
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
497
|
+
chain?: import('viem').Chain | null;
|
|
498
|
+
dataSuffix?: `0x${string}`;
|
|
499
|
+
gas?: bigint;
|
|
500
|
+
gasPrice?: bigint;
|
|
501
|
+
maxFeePerGas?: bigint;
|
|
502
|
+
maxPriorityFeePerGas?: bigint;
|
|
503
|
+
nonce?: number;
|
|
504
|
+
value?: bigint;
|
|
505
|
+
}): Promise<`0x${string}`>;
|
|
506
|
+
/**
|
|
507
|
+
* addPauser
|
|
508
|
+
* nonpayable
|
|
509
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
510
|
+
*/
|
|
511
|
+
addPauser(account: `0x${string}`, options?: {
|
|
512
|
+
accessList?: import('viem').AccessList;
|
|
513
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
514
|
+
chain?: import('viem').Chain | null;
|
|
515
|
+
dataSuffix?: `0x${string}`;
|
|
516
|
+
gas?: bigint;
|
|
517
|
+
gasPrice?: bigint;
|
|
518
|
+
maxFeePerGas?: bigint;
|
|
519
|
+
maxPriorityFeePerGas?: bigint;
|
|
520
|
+
nonce?: number;
|
|
521
|
+
value?: bigint;
|
|
522
|
+
}): Promise<`0x${string}`>;
|
|
523
|
+
/**
|
|
524
|
+
* pause
|
|
525
|
+
* nonpayable
|
|
526
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
527
|
+
*/
|
|
528
|
+
pause(options?: {
|
|
529
|
+
accessList?: import('viem').AccessList;
|
|
530
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
531
|
+
chain?: import('viem').Chain | null;
|
|
532
|
+
dataSuffix?: `0x${string}`;
|
|
533
|
+
gas?: bigint;
|
|
534
|
+
gasPrice?: bigint;
|
|
535
|
+
maxFeePerGas?: bigint;
|
|
536
|
+
maxPriorityFeePerGas?: bigint;
|
|
537
|
+
nonce?: number;
|
|
538
|
+
value?: bigint;
|
|
539
|
+
}): Promise<`0x${string}`>;
|
|
540
|
+
/**
|
|
541
|
+
* decreaseAllowance
|
|
542
|
+
* nonpayable
|
|
543
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
544
|
+
*/
|
|
545
|
+
decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
546
|
+
accessList?: import('viem').AccessList;
|
|
547
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
548
|
+
chain?: import('viem').Chain | null;
|
|
549
|
+
dataSuffix?: `0x${string}`;
|
|
550
|
+
gas?: bigint;
|
|
551
|
+
gasPrice?: bigint;
|
|
552
|
+
maxFeePerGas?: bigint;
|
|
553
|
+
maxPriorityFeePerGas?: bigint;
|
|
554
|
+
nonce?: number;
|
|
555
|
+
value?: bigint;
|
|
556
|
+
}): Promise<`0x${string}`>;
|
|
557
|
+
/**
|
|
558
|
+
* transfer
|
|
559
|
+
* nonpayable
|
|
560
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
561
|
+
*/
|
|
562
|
+
transfer(to: `0x${string}`, value: bigint, options?: {
|
|
563
|
+
accessList?: import('viem').AccessList;
|
|
564
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
565
|
+
chain?: import('viem').Chain | null;
|
|
566
|
+
dataSuffix?: `0x${string}`;
|
|
567
|
+
gas?: bigint;
|
|
568
|
+
gasPrice?: bigint;
|
|
569
|
+
maxFeePerGas?: bigint;
|
|
570
|
+
maxPriorityFeePerGas?: bigint;
|
|
571
|
+
nonce?: number;
|
|
572
|
+
value?: bigint;
|
|
573
|
+
}): Promise<`0x${string}`>;
|
|
574
|
+
/**
|
|
575
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
576
|
+
*
|
|
577
|
+
* @example
|
|
578
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
579
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
580
|
+
* console.log('Would succeed:', result.result);
|
|
581
|
+
*/
|
|
582
|
+
get simulate(): {
|
|
583
|
+
/**
|
|
584
|
+
* Simulate approve
|
|
585
|
+
* Returns gas estimate and result without sending transaction
|
|
586
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
587
|
+
*/
|
|
588
|
+
approve(spender: `0x${string}`, value: bigint, options?: {
|
|
589
|
+
accessList?: import("viem").AccessList;
|
|
590
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
591
|
+
chain?: import("viem").Chain | null;
|
|
592
|
+
dataSuffix?: `0x${string}`;
|
|
593
|
+
gas?: bigint;
|
|
594
|
+
gasPrice?: bigint;
|
|
595
|
+
maxFeePerGas?: bigint;
|
|
596
|
+
maxPriorityFeePerGas?: bigint;
|
|
597
|
+
nonce?: number;
|
|
598
|
+
value?: bigint;
|
|
599
|
+
}): Promise<boolean>;
|
|
600
|
+
/**
|
|
601
|
+
* Simulate transferFrom
|
|
602
|
+
* Returns gas estimate and result without sending transaction
|
|
603
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
604
|
+
*/
|
|
605
|
+
transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
|
|
606
|
+
accessList?: import("viem").AccessList;
|
|
607
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
608
|
+
chain?: import("viem").Chain | null;
|
|
609
|
+
dataSuffix?: `0x${string}`;
|
|
610
|
+
gas?: bigint;
|
|
611
|
+
gasPrice?: bigint;
|
|
612
|
+
maxFeePerGas?: bigint;
|
|
613
|
+
maxPriorityFeePerGas?: bigint;
|
|
614
|
+
nonce?: number;
|
|
615
|
+
value?: bigint;
|
|
616
|
+
}): Promise<boolean>;
|
|
617
|
+
/**
|
|
618
|
+
* Simulate increaseAllowance
|
|
619
|
+
* Returns gas estimate and result without sending transaction
|
|
620
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
621
|
+
*/
|
|
622
|
+
increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
623
|
+
accessList?: import("viem").AccessList;
|
|
624
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
625
|
+
chain?: import("viem").Chain | null;
|
|
626
|
+
dataSuffix?: `0x${string}`;
|
|
627
|
+
gas?: bigint;
|
|
628
|
+
gasPrice?: bigint;
|
|
629
|
+
maxFeePerGas?: bigint;
|
|
630
|
+
maxPriorityFeePerGas?: bigint;
|
|
631
|
+
nonce?: number;
|
|
632
|
+
value?: bigint;
|
|
633
|
+
}): Promise<boolean>;
|
|
634
|
+
/**
|
|
635
|
+
* Simulate unpause
|
|
636
|
+
* Returns gas estimate and result without sending transaction
|
|
637
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
638
|
+
*/
|
|
639
|
+
unpause(options?: {
|
|
640
|
+
accessList?: import("viem").AccessList;
|
|
641
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
642
|
+
chain?: import("viem").Chain | null;
|
|
643
|
+
dataSuffix?: `0x${string}`;
|
|
644
|
+
gas?: bigint;
|
|
645
|
+
gasPrice?: bigint;
|
|
646
|
+
maxFeePerGas?: bigint;
|
|
647
|
+
maxPriorityFeePerGas?: bigint;
|
|
648
|
+
nonce?: number;
|
|
649
|
+
value?: bigint;
|
|
650
|
+
}): Promise<void>;
|
|
651
|
+
/**
|
|
652
|
+
* Simulate renouncePauser
|
|
653
|
+
* Returns gas estimate and result without sending transaction
|
|
654
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
655
|
+
*/
|
|
656
|
+
renouncePauser(options?: {
|
|
657
|
+
accessList?: import("viem").AccessList;
|
|
658
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
659
|
+
chain?: import("viem").Chain | null;
|
|
660
|
+
dataSuffix?: `0x${string}`;
|
|
661
|
+
gas?: bigint;
|
|
662
|
+
gasPrice?: bigint;
|
|
663
|
+
maxFeePerGas?: bigint;
|
|
664
|
+
maxPriorityFeePerGas?: bigint;
|
|
665
|
+
nonce?: number;
|
|
666
|
+
value?: bigint;
|
|
667
|
+
}): Promise<void>;
|
|
668
|
+
/**
|
|
669
|
+
* Simulate addPauser
|
|
670
|
+
* Returns gas estimate and result without sending transaction
|
|
671
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
672
|
+
*/
|
|
673
|
+
addPauser(account: `0x${string}`, options?: {
|
|
674
|
+
accessList?: import("viem").AccessList;
|
|
675
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
676
|
+
chain?: import("viem").Chain | null;
|
|
677
|
+
dataSuffix?: `0x${string}`;
|
|
678
|
+
gas?: bigint;
|
|
679
|
+
gasPrice?: bigint;
|
|
680
|
+
maxFeePerGas?: bigint;
|
|
681
|
+
maxPriorityFeePerGas?: bigint;
|
|
682
|
+
nonce?: number;
|
|
683
|
+
value?: bigint;
|
|
684
|
+
}): Promise<void>;
|
|
685
|
+
/**
|
|
686
|
+
* Simulate pause
|
|
687
|
+
* Returns gas estimate and result without sending transaction
|
|
688
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
689
|
+
*/
|
|
690
|
+
pause(options?: {
|
|
691
|
+
accessList?: import("viem").AccessList;
|
|
692
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
693
|
+
chain?: import("viem").Chain | null;
|
|
694
|
+
dataSuffix?: `0x${string}`;
|
|
695
|
+
gas?: bigint;
|
|
696
|
+
gasPrice?: bigint;
|
|
697
|
+
maxFeePerGas?: bigint;
|
|
698
|
+
maxPriorityFeePerGas?: bigint;
|
|
699
|
+
nonce?: number;
|
|
700
|
+
value?: bigint;
|
|
701
|
+
}): Promise<void>;
|
|
702
|
+
/**
|
|
703
|
+
* Simulate decreaseAllowance
|
|
704
|
+
* Returns gas estimate and result without sending transaction
|
|
705
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
706
|
+
*/
|
|
707
|
+
decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
708
|
+
accessList?: import("viem").AccessList;
|
|
709
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
710
|
+
chain?: import("viem").Chain | null;
|
|
711
|
+
dataSuffix?: `0x${string}`;
|
|
712
|
+
gas?: bigint;
|
|
713
|
+
gasPrice?: bigint;
|
|
714
|
+
maxFeePerGas?: bigint;
|
|
715
|
+
maxPriorityFeePerGas?: bigint;
|
|
716
|
+
nonce?: number;
|
|
717
|
+
value?: bigint;
|
|
718
|
+
}): Promise<boolean>;
|
|
719
|
+
/**
|
|
720
|
+
* Simulate transfer
|
|
721
|
+
* Returns gas estimate and result without sending transaction
|
|
722
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
723
|
+
*/
|
|
724
|
+
transfer(to: `0x${string}`, value: bigint, options?: {
|
|
725
|
+
accessList?: import("viem").AccessList;
|
|
726
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
727
|
+
chain?: import("viem").Chain | null;
|
|
728
|
+
dataSuffix?: `0x${string}`;
|
|
729
|
+
gas?: bigint;
|
|
730
|
+
gasPrice?: bigint;
|
|
731
|
+
maxFeePerGas?: bigint;
|
|
732
|
+
maxPriorityFeePerGas?: bigint;
|
|
733
|
+
nonce?: number;
|
|
734
|
+
value?: bigint;
|
|
735
|
+
}): Promise<boolean>;
|
|
736
|
+
};
|
|
737
|
+
/**
|
|
738
|
+
* Watch contract events
|
|
739
|
+
*
|
|
740
|
+
* @example
|
|
741
|
+
* // Watch all Transfer events
|
|
742
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
743
|
+
* console.log('Transfer:', event);
|
|
744
|
+
* });
|
|
745
|
+
*
|
|
746
|
+
* // Stop watching
|
|
747
|
+
* unwatch();
|
|
748
|
+
*/
|
|
749
|
+
get watch(): {
|
|
750
|
+
/**
|
|
751
|
+
* Watch Paused events
|
|
752
|
+
* @param callback Function to call when event is emitted
|
|
753
|
+
* @param filter Optional filter for indexed parameters
|
|
754
|
+
* @returns Unwatch function to stop listening
|
|
755
|
+
*/
|
|
756
|
+
Paused: (callback: (event: {
|
|
757
|
+
account: `0x${string}`;
|
|
758
|
+
}) => void) => () => void;
|
|
759
|
+
/**
|
|
760
|
+
* Watch Unpaused events
|
|
761
|
+
* @param callback Function to call when event is emitted
|
|
762
|
+
* @param filter Optional filter for indexed parameters
|
|
763
|
+
* @returns Unwatch function to stop listening
|
|
764
|
+
*/
|
|
765
|
+
Unpaused: (callback: (event: {
|
|
766
|
+
account: `0x${string}`;
|
|
767
|
+
}) => void) => () => void;
|
|
768
|
+
/**
|
|
769
|
+
* Watch PauserAdded events
|
|
770
|
+
* @param callback Function to call when event is emitted
|
|
771
|
+
* @param filter Optional filter for indexed parameters
|
|
772
|
+
* @returns Unwatch function to stop listening
|
|
773
|
+
*/
|
|
774
|
+
PauserAdded: (callback: (event: {
|
|
775
|
+
account: `0x${string}`;
|
|
776
|
+
}) => void, filter?: {
|
|
777
|
+
account: `0x${string}`;
|
|
778
|
+
}) => () => void;
|
|
779
|
+
/**
|
|
780
|
+
* Watch PauserRemoved events
|
|
781
|
+
* @param callback Function to call when event is emitted
|
|
782
|
+
* @param filter Optional filter for indexed parameters
|
|
783
|
+
* @returns Unwatch function to stop listening
|
|
784
|
+
*/
|
|
785
|
+
PauserRemoved: (callback: (event: {
|
|
786
|
+
account: `0x${string}`;
|
|
787
|
+
}) => void, filter?: {
|
|
788
|
+
account: `0x${string}`;
|
|
789
|
+
}) => () => void;
|
|
790
|
+
/**
|
|
791
|
+
* Watch Transfer events
|
|
792
|
+
* @param callback Function to call when event is emitted
|
|
793
|
+
* @param filter Optional filter for indexed parameters
|
|
794
|
+
* @returns Unwatch function to stop listening
|
|
795
|
+
*/
|
|
796
|
+
Transfer: (callback: (event: {
|
|
797
|
+
from: `0x${string}`;
|
|
798
|
+
to: `0x${string}`;
|
|
799
|
+
value: bigint;
|
|
800
|
+
}) => void, filter?: {
|
|
801
|
+
from: `0x${string}`;
|
|
802
|
+
to: `0x${string}`;
|
|
803
|
+
}) => () => void;
|
|
804
|
+
/**
|
|
805
|
+
* Watch Approval events
|
|
806
|
+
* @param callback Function to call when event is emitted
|
|
807
|
+
* @param filter Optional filter for indexed parameters
|
|
808
|
+
* @returns Unwatch function to stop listening
|
|
809
|
+
*/
|
|
810
|
+
Approval: (callback: (event: {
|
|
811
|
+
owner: `0x${string}`;
|
|
812
|
+
spender: `0x${string}`;
|
|
813
|
+
value: bigint;
|
|
814
|
+
}) => void, filter?: {
|
|
815
|
+
owner: `0x${string}`;
|
|
816
|
+
spender: `0x${string}`;
|
|
817
|
+
}) => () => void;
|
|
818
|
+
};
|
|
819
|
+
}
|