@gitmyabi/els 0.0.0-stage → 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.
@@ -0,0 +1,622 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * ELSERC20_json ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const ELSERC20_jsonAbi: readonly [{
8
+ readonly inputs: readonly [{
9
+ readonly internalType: "uint256";
10
+ readonly name: "initialSupply";
11
+ readonly type: "uint256";
12
+ }];
13
+ readonly stateMutability: "nonpayable";
14
+ readonly type: "constructor";
15
+ }, {
16
+ readonly anonymous: false;
17
+ readonly inputs: readonly [{
18
+ readonly indexed: true;
19
+ readonly internalType: "address";
20
+ readonly name: "owner";
21
+ readonly type: "address";
22
+ }, {
23
+ readonly indexed: true;
24
+ readonly internalType: "address";
25
+ readonly name: "spender";
26
+ readonly type: "address";
27
+ }, {
28
+ readonly indexed: false;
29
+ readonly internalType: "uint256";
30
+ readonly name: "value";
31
+ readonly type: "uint256";
32
+ }];
33
+ readonly name: "Approval";
34
+ readonly type: "event";
35
+ }, {
36
+ readonly anonymous: false;
37
+ readonly inputs: readonly [{
38
+ readonly indexed: true;
39
+ readonly internalType: "address";
40
+ readonly name: "from";
41
+ readonly type: "address";
42
+ }, {
43
+ readonly indexed: true;
44
+ readonly internalType: "address";
45
+ readonly name: "to";
46
+ readonly type: "address";
47
+ }, {
48
+ readonly indexed: false;
49
+ readonly internalType: "uint256";
50
+ readonly name: "value";
51
+ readonly type: "uint256";
52
+ }];
53
+ readonly name: "Transfer";
54
+ readonly type: "event";
55
+ }, {
56
+ readonly inputs: readonly [{
57
+ readonly internalType: "address";
58
+ readonly name: "owner";
59
+ readonly type: "address";
60
+ }, {
61
+ readonly internalType: "address";
62
+ readonly name: "spender";
63
+ readonly type: "address";
64
+ }];
65
+ readonly name: "allowance";
66
+ readonly outputs: readonly [{
67
+ readonly internalType: "uint256";
68
+ readonly name: "";
69
+ readonly type: "uint256";
70
+ }];
71
+ readonly stateMutability: "view";
72
+ readonly type: "function";
73
+ }, {
74
+ readonly inputs: readonly [{
75
+ readonly internalType: "address";
76
+ readonly name: "spender";
77
+ readonly type: "address";
78
+ }, {
79
+ readonly internalType: "uint256";
80
+ readonly name: "amount";
81
+ readonly type: "uint256";
82
+ }];
83
+ readonly name: "approve";
84
+ readonly outputs: readonly [{
85
+ readonly internalType: "bool";
86
+ readonly name: "";
87
+ readonly type: "bool";
88
+ }];
89
+ readonly stateMutability: "nonpayable";
90
+ readonly type: "function";
91
+ }, {
92
+ readonly inputs: readonly [{
93
+ readonly internalType: "address";
94
+ readonly name: "account";
95
+ readonly type: "address";
96
+ }];
97
+ readonly name: "balanceOf";
98
+ readonly outputs: readonly [{
99
+ readonly internalType: "uint256";
100
+ readonly name: "";
101
+ readonly type: "uint256";
102
+ }];
103
+ readonly stateMutability: "view";
104
+ readonly type: "function";
105
+ }, {
106
+ readonly inputs: readonly [{
107
+ readonly internalType: "uint256";
108
+ readonly name: "amount";
109
+ readonly type: "uint256";
110
+ }];
111
+ readonly name: "burn";
112
+ readonly outputs: readonly [];
113
+ readonly stateMutability: "nonpayable";
114
+ readonly type: "function";
115
+ }, {
116
+ readonly inputs: readonly [{
117
+ readonly internalType: "address";
118
+ readonly name: "account";
119
+ readonly type: "address";
120
+ }, {
121
+ readonly internalType: "uint256";
122
+ readonly name: "amount";
123
+ readonly type: "uint256";
124
+ }];
125
+ readonly name: "burnFrom";
126
+ readonly outputs: readonly [];
127
+ readonly stateMutability: "nonpayable";
128
+ readonly type: "function";
129
+ }, {
130
+ readonly inputs: readonly [];
131
+ readonly name: "decimals";
132
+ readonly outputs: readonly [{
133
+ readonly internalType: "uint8";
134
+ readonly name: "";
135
+ readonly type: "uint8";
136
+ }];
137
+ readonly stateMutability: "view";
138
+ readonly type: "function";
139
+ }, {
140
+ readonly inputs: readonly [{
141
+ readonly internalType: "address";
142
+ readonly name: "spender";
143
+ readonly type: "address";
144
+ }, {
145
+ readonly internalType: "uint256";
146
+ readonly name: "subtractedValue";
147
+ readonly type: "uint256";
148
+ }];
149
+ readonly name: "decreaseAllowance";
150
+ readonly outputs: readonly [{
151
+ readonly internalType: "bool";
152
+ readonly name: "";
153
+ readonly type: "bool";
154
+ }];
155
+ readonly stateMutability: "nonpayable";
156
+ readonly type: "function";
157
+ }, {
158
+ readonly inputs: readonly [{
159
+ readonly internalType: "address";
160
+ readonly name: "spender";
161
+ readonly type: "address";
162
+ }, {
163
+ readonly internalType: "uint256";
164
+ readonly name: "addedValue";
165
+ readonly type: "uint256";
166
+ }];
167
+ readonly name: "increaseAllowance";
168
+ readonly outputs: readonly [{
169
+ readonly internalType: "bool";
170
+ readonly name: "";
171
+ readonly type: "bool";
172
+ }];
173
+ readonly stateMutability: "nonpayable";
174
+ readonly type: "function";
175
+ }, {
176
+ readonly inputs: readonly [];
177
+ readonly name: "name";
178
+ readonly outputs: readonly [{
179
+ readonly internalType: "string";
180
+ readonly name: "";
181
+ readonly type: "string";
182
+ }];
183
+ readonly stateMutability: "view";
184
+ readonly type: "function";
185
+ }, {
186
+ readonly inputs: readonly [];
187
+ readonly name: "symbol";
188
+ readonly outputs: readonly [{
189
+ readonly internalType: "string";
190
+ readonly name: "";
191
+ readonly type: "string";
192
+ }];
193
+ readonly stateMutability: "view";
194
+ readonly type: "function";
195
+ }, {
196
+ readonly inputs: readonly [];
197
+ readonly name: "totalSupply";
198
+ readonly outputs: readonly [{
199
+ readonly internalType: "uint256";
200
+ readonly name: "";
201
+ readonly type: "uint256";
202
+ }];
203
+ readonly stateMutability: "view";
204
+ readonly type: "function";
205
+ }, {
206
+ readonly inputs: readonly [{
207
+ readonly internalType: "address";
208
+ readonly name: "to";
209
+ readonly type: "address";
210
+ }, {
211
+ readonly internalType: "uint256";
212
+ readonly name: "amount";
213
+ readonly type: "uint256";
214
+ }];
215
+ readonly name: "transfer";
216
+ readonly outputs: readonly [{
217
+ readonly internalType: "bool";
218
+ readonly name: "";
219
+ readonly type: "bool";
220
+ }];
221
+ readonly stateMutability: "nonpayable";
222
+ readonly type: "function";
223
+ }, {
224
+ readonly inputs: readonly [{
225
+ readonly internalType: "address";
226
+ readonly name: "from";
227
+ readonly type: "address";
228
+ }, {
229
+ readonly internalType: "address";
230
+ readonly name: "to";
231
+ readonly type: "address";
232
+ }, {
233
+ readonly internalType: "uint256";
234
+ readonly name: "amount";
235
+ readonly type: "uint256";
236
+ }];
237
+ readonly name: "transferFrom";
238
+ readonly outputs: readonly [{
239
+ readonly internalType: "bool";
240
+ readonly name: "";
241
+ readonly type: "bool";
242
+ }];
243
+ readonly stateMutability: "nonpayable";
244
+ readonly type: "function";
245
+ }];
246
+ /**
247
+ * Type-safe ABI for ELSERC20_json
248
+ */
249
+ export type ELSERC20_jsonAbi = typeof ELSERC20_jsonAbi;
250
+ /**
251
+ * Contract instance type for ELSERC20_json
252
+ */
253
+ export type ELSERC20_jsonContract = any;
254
+ /**
255
+ * ELSERC20_json Contract Class
256
+ *
257
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
258
+ *
259
+ * @example
260
+ * ```typescript
261
+ * import { createPublicClient, createWalletClient, http } from 'viem';
262
+ * import { mainnet } from 'viem/chains';
263
+ * import { ELSERC20_json } from 'ELSERC20_json';
264
+ *
265
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
266
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
267
+ *
268
+ * const contract = new ELSERC20_json('0x...', { publicClient, walletClient });
269
+ *
270
+ * // Read functions
271
+ * const result = await contract.balanceOf('0x...');
272
+ *
273
+ * // Write functions
274
+ * const hash = await contract.transfer('0x...', 1000n);
275
+ *
276
+ * // Simulate transactions (dry-run)
277
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
278
+ * console.log('Gas estimate:', simulation.request.gas);
279
+ *
280
+ * // Watch events
281
+ * const unwatch = contract.watch.Transfer((event) => {
282
+ * console.log('Transfer event:', event);
283
+ * });
284
+ * ```
285
+ */
286
+ export declare class ELSERC20_json {
287
+ private contract;
288
+ private contractAddress;
289
+ private publicClient;
290
+ constructor(address: Address, clients: {
291
+ publicClient: PublicClient;
292
+ walletClient?: WalletClient;
293
+ });
294
+ /**
295
+ * Get the contract address
296
+ */
297
+ get address(): Address;
298
+ /**
299
+ * Get the underlying viem contract instance
300
+ */
301
+ getContract(): ELSERC20_jsonContract;
302
+ /**
303
+ * allowance
304
+ * view
305
+ */
306
+ allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint>;
307
+ /**
308
+ * balanceOf
309
+ * view
310
+ */
311
+ balanceOf(account: `0x${string}`): Promise<bigint>;
312
+ /**
313
+ * decimals
314
+ * view
315
+ */
316
+ decimals(): Promise<bigint>;
317
+ /**
318
+ * name
319
+ * view
320
+ */
321
+ name(): Promise<string>;
322
+ /**
323
+ * symbol
324
+ * view
325
+ */
326
+ symbol(): Promise<string>;
327
+ /**
328
+ * totalSupply
329
+ * view
330
+ */
331
+ totalSupply(): Promise<bigint>;
332
+ /**
333
+ * approve
334
+ * nonpayable
335
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
336
+ */
337
+ approve(spender: `0x${string}`, amount: bigint, 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
+ /**
350
+ * burn
351
+ * nonpayable
352
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
353
+ */
354
+ burn(amount: bigint, options?: {
355
+ accessList?: import('viem').AccessList;
356
+ authorizationList?: import('viem').AuthorizationList;
357
+ chain?: import('viem').Chain | null;
358
+ dataSuffix?: `0x${string}`;
359
+ gas?: bigint;
360
+ gasPrice?: bigint;
361
+ maxFeePerGas?: bigint;
362
+ maxPriorityFeePerGas?: bigint;
363
+ nonce?: number;
364
+ value?: bigint;
365
+ }): Promise<`0x${string}`>;
366
+ /**
367
+ * burnFrom
368
+ * nonpayable
369
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
370
+ */
371
+ burnFrom(account: `0x${string}`, amount: bigint, options?: {
372
+ accessList?: import('viem').AccessList;
373
+ authorizationList?: import('viem').AuthorizationList;
374
+ chain?: import('viem').Chain | null;
375
+ dataSuffix?: `0x${string}`;
376
+ gas?: bigint;
377
+ gasPrice?: bigint;
378
+ maxFeePerGas?: bigint;
379
+ maxPriorityFeePerGas?: bigint;
380
+ nonce?: number;
381
+ value?: bigint;
382
+ }): Promise<`0x${string}`>;
383
+ /**
384
+ * decreaseAllowance
385
+ * nonpayable
386
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
387
+ */
388
+ decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
389
+ accessList?: import('viem').AccessList;
390
+ authorizationList?: import('viem').AuthorizationList;
391
+ chain?: import('viem').Chain | null;
392
+ dataSuffix?: `0x${string}`;
393
+ gas?: bigint;
394
+ gasPrice?: bigint;
395
+ maxFeePerGas?: bigint;
396
+ maxPriorityFeePerGas?: bigint;
397
+ nonce?: number;
398
+ value?: bigint;
399
+ }): Promise<`0x${string}`>;
400
+ /**
401
+ * increaseAllowance
402
+ * nonpayable
403
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
404
+ */
405
+ increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
406
+ accessList?: import('viem').AccessList;
407
+ authorizationList?: import('viem').AuthorizationList;
408
+ chain?: import('viem').Chain | null;
409
+ dataSuffix?: `0x${string}`;
410
+ gas?: bigint;
411
+ gasPrice?: bigint;
412
+ maxFeePerGas?: bigint;
413
+ maxPriorityFeePerGas?: bigint;
414
+ nonce?: number;
415
+ value?: bigint;
416
+ }): Promise<`0x${string}`>;
417
+ /**
418
+ * transfer
419
+ * nonpayable
420
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
421
+ */
422
+ transfer(to: `0x${string}`, amount: bigint, 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<`0x${string}`>;
434
+ /**
435
+ * transferFrom
436
+ * nonpayable
437
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
438
+ */
439
+ transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
440
+ accessList?: import('viem').AccessList;
441
+ authorizationList?: import('viem').AuthorizationList;
442
+ chain?: import('viem').Chain | null;
443
+ dataSuffix?: `0x${string}`;
444
+ gas?: bigint;
445
+ gasPrice?: bigint;
446
+ maxFeePerGas?: bigint;
447
+ maxPriorityFeePerGas?: bigint;
448
+ nonce?: number;
449
+ value?: bigint;
450
+ }): Promise<`0x${string}`>;
451
+ /**
452
+ * Simulate contract write operations (dry-run without sending transaction)
453
+ *
454
+ * @example
455
+ * const result = await contract.simulate.transfer('0x...', 1000n);
456
+ * console.log('Gas estimate:', result.request.gas);
457
+ * console.log('Would succeed:', result.result);
458
+ */
459
+ get simulate(): {
460
+ /**
461
+ * Simulate approve
462
+ * Returns gas estimate and result without sending transaction
463
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
464
+ */
465
+ approve(spender: `0x${string}`, amount: bigint, options?: {
466
+ accessList?: import("viem").AccessList;
467
+ authorizationList?: import("viem").AuthorizationList;
468
+ chain?: import("viem").Chain | null;
469
+ dataSuffix?: `0x${string}`;
470
+ gas?: bigint;
471
+ gasPrice?: bigint;
472
+ maxFeePerGas?: bigint;
473
+ maxPriorityFeePerGas?: bigint;
474
+ nonce?: number;
475
+ value?: bigint;
476
+ }): Promise<boolean>;
477
+ /**
478
+ * Simulate burn
479
+ * Returns gas estimate and result without sending transaction
480
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
481
+ */
482
+ burn(amount: bigint, options?: {
483
+ accessList?: import("viem").AccessList;
484
+ authorizationList?: import("viem").AuthorizationList;
485
+ chain?: import("viem").Chain | null;
486
+ dataSuffix?: `0x${string}`;
487
+ gas?: bigint;
488
+ gasPrice?: bigint;
489
+ maxFeePerGas?: bigint;
490
+ maxPriorityFeePerGas?: bigint;
491
+ nonce?: number;
492
+ value?: bigint;
493
+ }): Promise<void>;
494
+ /**
495
+ * Simulate burnFrom
496
+ * Returns gas estimate and result without sending transaction
497
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
498
+ */
499
+ burnFrom(account: `0x${string}`, amount: bigint, options?: {
500
+ accessList?: import("viem").AccessList;
501
+ authorizationList?: import("viem").AuthorizationList;
502
+ chain?: import("viem").Chain | null;
503
+ dataSuffix?: `0x${string}`;
504
+ gas?: bigint;
505
+ gasPrice?: bigint;
506
+ maxFeePerGas?: bigint;
507
+ maxPriorityFeePerGas?: bigint;
508
+ nonce?: number;
509
+ value?: bigint;
510
+ }): Promise<void>;
511
+ /**
512
+ * Simulate decreaseAllowance
513
+ * Returns gas estimate and result without sending transaction
514
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
515
+ */
516
+ decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
517
+ accessList?: import("viem").AccessList;
518
+ authorizationList?: import("viem").AuthorizationList;
519
+ chain?: import("viem").Chain | null;
520
+ dataSuffix?: `0x${string}`;
521
+ gas?: bigint;
522
+ gasPrice?: bigint;
523
+ maxFeePerGas?: bigint;
524
+ maxPriorityFeePerGas?: bigint;
525
+ nonce?: number;
526
+ value?: bigint;
527
+ }): Promise<boolean>;
528
+ /**
529
+ * Simulate increaseAllowance
530
+ * Returns gas estimate and result without sending transaction
531
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
532
+ */
533
+ increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
534
+ accessList?: import("viem").AccessList;
535
+ authorizationList?: import("viem").AuthorizationList;
536
+ chain?: import("viem").Chain | null;
537
+ dataSuffix?: `0x${string}`;
538
+ gas?: bigint;
539
+ gasPrice?: bigint;
540
+ maxFeePerGas?: bigint;
541
+ maxPriorityFeePerGas?: bigint;
542
+ nonce?: number;
543
+ value?: bigint;
544
+ }): Promise<boolean>;
545
+ /**
546
+ * Simulate transfer
547
+ * Returns gas estimate and result without sending transaction
548
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
549
+ */
550
+ transfer(to: `0x${string}`, amount: bigint, options?: {
551
+ accessList?: import("viem").AccessList;
552
+ authorizationList?: import("viem").AuthorizationList;
553
+ chain?: import("viem").Chain | null;
554
+ dataSuffix?: `0x${string}`;
555
+ gas?: bigint;
556
+ gasPrice?: bigint;
557
+ maxFeePerGas?: bigint;
558
+ maxPriorityFeePerGas?: bigint;
559
+ nonce?: number;
560
+ value?: bigint;
561
+ }): Promise<boolean>;
562
+ /**
563
+ * Simulate transferFrom
564
+ * Returns gas estimate and result without sending transaction
565
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
566
+ */
567
+ transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
568
+ accessList?: import("viem").AccessList;
569
+ authorizationList?: import("viem").AuthorizationList;
570
+ chain?: import("viem").Chain | null;
571
+ dataSuffix?: `0x${string}`;
572
+ gas?: bigint;
573
+ gasPrice?: bigint;
574
+ maxFeePerGas?: bigint;
575
+ maxPriorityFeePerGas?: bigint;
576
+ nonce?: number;
577
+ value?: bigint;
578
+ }): Promise<boolean>;
579
+ };
580
+ /**
581
+ * Watch contract events
582
+ *
583
+ * @example
584
+ * // Watch all Transfer events
585
+ * const unwatch = contract.watch.Transfer((event) => {
586
+ * console.log('Transfer:', event);
587
+ * });
588
+ *
589
+ * // Stop watching
590
+ * unwatch();
591
+ */
592
+ get watch(): {
593
+ /**
594
+ * Watch Approval events
595
+ * @param callback Function to call when event is emitted
596
+ * @param filter Optional filter for indexed parameters
597
+ * @returns Unwatch function to stop listening
598
+ */
599
+ Approval: (callback: (event: {
600
+ owner: `0x${string}`;
601
+ spender: `0x${string}`;
602
+ value: bigint;
603
+ }) => void, filter?: {
604
+ owner: `0x${string}`;
605
+ spender: `0x${string}`;
606
+ }) => () => void;
607
+ /**
608
+ * Watch Transfer events
609
+ * @param callback Function to call when event is emitted
610
+ * @param filter Optional filter for indexed parameters
611
+ * @returns Unwatch function to stop listening
612
+ */
613
+ Transfer: (callback: (event: {
614
+ from: `0x${string}`;
615
+ to: `0x${string}`;
616
+ value: bigint;
617
+ }) => void, filter?: {
618
+ from: `0x${string}`;
619
+ to: `0x${string}`;
620
+ }) => () => void;
621
+ };
622
+ }