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