@gitmyabi-stg/tel 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 ADDED
@@ -0,0 +1,108 @@
1
+ # @gitmyabi-stg/tel
2
+
3
+ Auto-generated TypeScript type bindings for **TEL**
4
+
5
+ - **Build ID**: `etherscan-tel-467bccd9-1780061662283`
6
+ - **Build Number**: 1
7
+ - **Commit**: `262dbbb`
8
+ - **Branch**: `etherscan`
9
+ - **Target**: `ethers-v6`
10
+ - **Contracts**: 1
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @gitmyabi-stg/tel@0.0.1
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ### Class-based API (TypeChain-like)
21
+
22
+ ```typescript
23
+ import { createPublicClient, createWalletClient, http } from 'viem';
24
+ import { mainnet } from 'viem/chains';
25
+ import { YourContract } from '@gitmyabi-stg/tel';
26
+
27
+ const publicClient = createPublicClient({ chain: mainnet, transport: http() });
28
+ const walletClient = createWalletClient({ chain: mainnet, transport: http() });
29
+
30
+ // Create contract instance
31
+ const contract = new YourContract('0x...', { publicClient, walletClient });
32
+
33
+ // Read functions - call directly like TypeChain!
34
+ const result = await contract.yourMethod(param1, param2);
35
+
36
+ // Write functions - also call directly!
37
+ const hash = await contract.transfer('0x...', 1000n);
38
+ ```
39
+
40
+ ### With viem directly
41
+
42
+ ```typescript
43
+ import { createPublicClient, http } from 'viem';
44
+ import { mainnet } from 'viem/chains';
45
+ import { YourContractAbi } from '@gitmyabi-stg/tel';
46
+
47
+ const client = createPublicClient({
48
+ chain: mainnet,
49
+ transport: http(),
50
+ });
51
+
52
+ // Fully typed contract read
53
+ const result = await client.readContract({
54
+ address: '0x...',
55
+ abi: YourContractAbi,
56
+ functionName: 'yourMethod',
57
+ args: [param1, param2],
58
+ });
59
+
60
+ // Fully typed contract write
61
+ const hash = await client.writeContract({
62
+ address: '0x...',
63
+ abi: YourContractAbi,
64
+ functionName: 'yourMethod',
65
+ args: [param1, param2],
66
+ });
67
+ ```
68
+
69
+ ### With wagmi
70
+
71
+ ```typescript
72
+ import { useReadContract, useWriteContract } from 'wagmi';
73
+ import { YourContractAbi } from '@gitmyabi-stg/tel';
74
+
75
+ function MyComponent() {
76
+ const { data } = useReadContract({
77
+ address: '0x...',
78
+ abi: YourContractAbi,
79
+ functionName: 'yourMethod',
80
+ args: [param1, param2],
81
+ });
82
+
83
+ const { writeContract } = useWriteContract();
84
+
85
+ const handleWrite = () => {
86
+ writeContract({
87
+ address: '0x...',
88
+ abi: YourContractAbi,
89
+ functionName: 'yourMethod',
90
+ args: [param1, param2],
91
+ });
92
+ };
93
+
94
+ return <button onClick={handleWrite}>Call Contract</button>;
95
+ }
96
+ ```
97
+
98
+ ## Type Safety
99
+
100
+ This package provides full TypeScript type safety for all contract methods, events, and parameters using viem's type system. All ABIs are exported as `const` assertions for maximum type inference.
101
+
102
+ ## Generated Contracts
103
+
104
+ This package includes type bindings for 1 contract(s) generated from ABI artifacts.
105
+
106
+ ## License
107
+
108
+ Apache License 2.0
@@ -0,0 +1,521 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * Telcoin ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const TelcoinAbi: 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: "decimals";
70
+ readonly outputs: readonly [{
71
+ readonly name: "";
72
+ readonly type: "uint8";
73
+ }];
74
+ readonly payable: false;
75
+ readonly stateMutability: "view";
76
+ readonly type: "function";
77
+ }, {
78
+ readonly constant: false;
79
+ readonly inputs: readonly [{
80
+ readonly name: "_spender";
81
+ readonly type: "address";
82
+ }, {
83
+ readonly name: "_subtractedValue";
84
+ readonly type: "uint256";
85
+ }];
86
+ readonly name: "decreaseApproval";
87
+ readonly outputs: readonly [{
88
+ readonly name: "";
89
+ readonly type: "bool";
90
+ }];
91
+ readonly payable: false;
92
+ readonly stateMutability: "nonpayable";
93
+ readonly type: "function";
94
+ }, {
95
+ readonly constant: true;
96
+ readonly inputs: readonly [{
97
+ readonly name: "_owner";
98
+ readonly type: "address";
99
+ }];
100
+ readonly name: "balanceOf";
101
+ readonly outputs: readonly [{
102
+ readonly name: "";
103
+ readonly type: "uint256";
104
+ }];
105
+ readonly payable: false;
106
+ readonly stateMutability: "view";
107
+ readonly type: "function";
108
+ }, {
109
+ readonly constant: true;
110
+ readonly inputs: readonly [];
111
+ readonly name: "symbol";
112
+ readonly outputs: readonly [{
113
+ readonly name: "";
114
+ readonly type: "string";
115
+ }];
116
+ readonly payable: false;
117
+ readonly stateMutability: "view";
118
+ readonly type: "function";
119
+ }, {
120
+ readonly constant: false;
121
+ readonly inputs: readonly [{
122
+ readonly name: "_to";
123
+ readonly type: "address";
124
+ }, {
125
+ readonly name: "_value";
126
+ readonly type: "uint256";
127
+ }];
128
+ readonly name: "transfer";
129
+ readonly outputs: readonly [{
130
+ readonly name: "";
131
+ readonly type: "bool";
132
+ }];
133
+ readonly payable: false;
134
+ readonly stateMutability: "nonpayable";
135
+ readonly type: "function";
136
+ }, {
137
+ readonly constant: false;
138
+ readonly inputs: readonly [{
139
+ readonly name: "_spender";
140
+ readonly type: "address";
141
+ }, {
142
+ readonly name: "_addedValue";
143
+ readonly type: "uint256";
144
+ }];
145
+ readonly name: "increaseApproval";
146
+ readonly outputs: readonly [{
147
+ readonly name: "";
148
+ readonly type: "bool";
149
+ }];
150
+ readonly payable: false;
151
+ readonly stateMutability: "nonpayable";
152
+ readonly type: "function";
153
+ }, {
154
+ readonly constant: true;
155
+ readonly inputs: readonly [{
156
+ readonly name: "_owner";
157
+ readonly type: "address";
158
+ }, {
159
+ readonly name: "_spender";
160
+ readonly type: "address";
161
+ }];
162
+ readonly name: "allowance";
163
+ readonly outputs: readonly [{
164
+ readonly name: "";
165
+ readonly type: "uint256";
166
+ }];
167
+ readonly payable: false;
168
+ readonly stateMutability: "view";
169
+ readonly type: "function";
170
+ }, {
171
+ readonly inputs: readonly [{
172
+ readonly name: "_distributor";
173
+ readonly type: "address";
174
+ }];
175
+ readonly payable: false;
176
+ readonly stateMutability: "nonpayable";
177
+ readonly type: "constructor";
178
+ }, {
179
+ readonly anonymous: false;
180
+ readonly inputs: readonly [{
181
+ readonly indexed: true;
182
+ readonly name: "_from";
183
+ readonly type: "address";
184
+ }, {
185
+ readonly indexed: true;
186
+ readonly name: "_to";
187
+ readonly type: "address";
188
+ }, {
189
+ readonly indexed: false;
190
+ readonly name: "_value";
191
+ readonly type: "uint256";
192
+ }];
193
+ readonly name: "Transfer";
194
+ readonly type: "event";
195
+ }, {
196
+ readonly anonymous: false;
197
+ readonly inputs: readonly [{
198
+ readonly indexed: true;
199
+ readonly name: "_owner";
200
+ readonly type: "address";
201
+ }, {
202
+ readonly indexed: true;
203
+ readonly name: "_spender";
204
+ readonly type: "address";
205
+ }, {
206
+ readonly indexed: false;
207
+ readonly name: "_value";
208
+ readonly type: "uint256";
209
+ }];
210
+ readonly name: "Approval";
211
+ readonly type: "event";
212
+ }];
213
+ /**
214
+ * Type-safe ABI for Telcoin
215
+ */
216
+ export type TelcoinAbi = typeof TelcoinAbi;
217
+ /**
218
+ * Contract instance type for Telcoin
219
+ */
220
+ export type TelcoinContract = any;
221
+ /**
222
+ * Telcoin Contract Class
223
+ *
224
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
225
+ *
226
+ * @example
227
+ * ```typescript
228
+ * import { createPublicClient, createWalletClient, http } from 'viem';
229
+ * import { mainnet } from 'viem/chains';
230
+ * import { Telcoin } from 'Telcoin';
231
+ *
232
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
233
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
234
+ *
235
+ * const contract = new Telcoin('0x...', { publicClient, walletClient });
236
+ *
237
+ * // Read functions
238
+ * const result = await contract.balanceOf('0x...');
239
+ *
240
+ * // Write functions
241
+ * const hash = await contract.transfer('0x...', 1000n);
242
+ *
243
+ * // Simulate transactions (dry-run)
244
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
245
+ * console.log('Gas estimate:', simulation.request.gas);
246
+ *
247
+ * // Watch events
248
+ * const unwatch = contract.watch.Transfer((event) => {
249
+ * console.log('Transfer event:', event);
250
+ * });
251
+ * ```
252
+ */
253
+ export declare class Telcoin {
254
+ private contract;
255
+ private contractAddress;
256
+ private publicClient;
257
+ constructor(address: Address, clients: {
258
+ publicClient: PublicClient;
259
+ walletClient?: WalletClient;
260
+ });
261
+ /**
262
+ * Get the contract address
263
+ */
264
+ get address(): Address;
265
+ /**
266
+ * Get the underlying viem contract instance.
267
+ */
268
+ getContract(): TelcoinContract;
269
+ /**
270
+ * name
271
+ * view
272
+ */
273
+ name(): Promise<string>;
274
+ /**
275
+ * totalSupply
276
+ * view
277
+ */
278
+ totalSupply(): Promise<bigint>;
279
+ /**
280
+ * decimals
281
+ * view
282
+ */
283
+ decimals(): Promise<bigint>;
284
+ /**
285
+ * balanceOf
286
+ * view
287
+ */
288
+ balanceOf(_owner: `0x${string}`): Promise<bigint>;
289
+ /**
290
+ * symbol
291
+ * view
292
+ */
293
+ symbol(): Promise<string>;
294
+ /**
295
+ * allowance
296
+ * view
297
+ */
298
+ allowance(_owner: `0x${string}`, _spender: `0x${string}`): Promise<bigint>;
299
+ /**
300
+ * approve
301
+ * nonpayable
302
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
303
+ */
304
+ approve(_spender: `0x${string}`, _value: bigint, options?: {
305
+ accessList?: import('viem').AccessList;
306
+ authorizationList?: import('viem').AuthorizationList;
307
+ chain?: import('viem').Chain | null;
308
+ dataSuffix?: `0x${string}`;
309
+ gas?: bigint;
310
+ gasPrice?: bigint;
311
+ maxFeePerGas?: bigint;
312
+ maxPriorityFeePerGas?: bigint;
313
+ nonce?: number;
314
+ value?: bigint;
315
+ }): Promise<`0x${string}`>;
316
+ /**
317
+ * transferFrom
318
+ * nonpayable
319
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
320
+ */
321
+ transferFrom(_from: `0x${string}`, _to: `0x${string}`, _value: bigint, options?: {
322
+ accessList?: import('viem').AccessList;
323
+ authorizationList?: import('viem').AuthorizationList;
324
+ chain?: import('viem').Chain | null;
325
+ dataSuffix?: `0x${string}`;
326
+ gas?: bigint;
327
+ gasPrice?: bigint;
328
+ maxFeePerGas?: bigint;
329
+ maxPriorityFeePerGas?: bigint;
330
+ nonce?: number;
331
+ value?: bigint;
332
+ }): Promise<`0x${string}`>;
333
+ /**
334
+ * decreaseApproval
335
+ * nonpayable
336
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
337
+ */
338
+ decreaseApproval(_spender: `0x${string}`, _subtractedValue: bigint, options?: {
339
+ accessList?: import('viem').AccessList;
340
+ authorizationList?: import('viem').AuthorizationList;
341
+ chain?: import('viem').Chain | null;
342
+ dataSuffix?: `0x${string}`;
343
+ gas?: bigint;
344
+ gasPrice?: bigint;
345
+ maxFeePerGas?: bigint;
346
+ maxPriorityFeePerGas?: bigint;
347
+ nonce?: number;
348
+ value?: bigint;
349
+ }): Promise<`0x${string}`>;
350
+ /**
351
+ * transfer
352
+ * nonpayable
353
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
354
+ */
355
+ transfer(_to: `0x${string}`, _value: bigint, options?: {
356
+ accessList?: import('viem').AccessList;
357
+ authorizationList?: import('viem').AuthorizationList;
358
+ chain?: import('viem').Chain | null;
359
+ dataSuffix?: `0x${string}`;
360
+ gas?: bigint;
361
+ gasPrice?: bigint;
362
+ maxFeePerGas?: bigint;
363
+ maxPriorityFeePerGas?: bigint;
364
+ nonce?: number;
365
+ value?: bigint;
366
+ }): Promise<`0x${string}`>;
367
+ /**
368
+ * increaseApproval
369
+ * nonpayable
370
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
371
+ */
372
+ increaseApproval(_spender: `0x${string}`, _addedValue: bigint, options?: {
373
+ accessList?: import('viem').AccessList;
374
+ authorizationList?: import('viem').AuthorizationList;
375
+ chain?: import('viem').Chain | null;
376
+ dataSuffix?: `0x${string}`;
377
+ gas?: bigint;
378
+ gasPrice?: bigint;
379
+ maxFeePerGas?: bigint;
380
+ maxPriorityFeePerGas?: bigint;
381
+ nonce?: number;
382
+ value?: bigint;
383
+ }): Promise<`0x${string}`>;
384
+ /**
385
+ * Simulate contract write operations (dry-run without sending transaction)
386
+ *
387
+ * @example
388
+ * const result = await contract.simulate.transfer('0x...', 1000n);
389
+ * console.log('Gas estimate:', result.request.gas);
390
+ * console.log('Would succeed:', result.result);
391
+ */
392
+ get simulate(): {
393
+ /**
394
+ * Simulate approve
395
+ * Returns gas estimate and result without sending transaction
396
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
397
+ */
398
+ approve(_spender: `0x${string}`, _value: bigint, options?: {
399
+ accessList?: import("viem").AccessList;
400
+ authorizationList?: import("viem").AuthorizationList;
401
+ chain?: import("viem").Chain | null;
402
+ dataSuffix?: `0x${string}`;
403
+ gas?: bigint;
404
+ gasPrice?: bigint;
405
+ maxFeePerGas?: bigint;
406
+ maxPriorityFeePerGas?: bigint;
407
+ nonce?: number;
408
+ value?: bigint;
409
+ }): Promise<boolean>;
410
+ /**
411
+ * Simulate transferFrom
412
+ * Returns gas estimate and result without sending transaction
413
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
414
+ */
415
+ transferFrom(_from: `0x${string}`, _to: `0x${string}`, _value: bigint, options?: {
416
+ accessList?: import("viem").AccessList;
417
+ authorizationList?: import("viem").AuthorizationList;
418
+ chain?: import("viem").Chain | null;
419
+ dataSuffix?: `0x${string}`;
420
+ gas?: bigint;
421
+ gasPrice?: bigint;
422
+ maxFeePerGas?: bigint;
423
+ maxPriorityFeePerGas?: bigint;
424
+ nonce?: number;
425
+ value?: bigint;
426
+ }): Promise<boolean>;
427
+ /**
428
+ * Simulate decreaseApproval
429
+ * Returns gas estimate and result without sending transaction
430
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
431
+ */
432
+ decreaseApproval(_spender: `0x${string}`, _subtractedValue: bigint, options?: {
433
+ accessList?: import("viem").AccessList;
434
+ authorizationList?: import("viem").AuthorizationList;
435
+ chain?: import("viem").Chain | null;
436
+ dataSuffix?: `0x${string}`;
437
+ gas?: bigint;
438
+ gasPrice?: bigint;
439
+ maxFeePerGas?: bigint;
440
+ maxPriorityFeePerGas?: bigint;
441
+ nonce?: number;
442
+ value?: bigint;
443
+ }): Promise<boolean>;
444
+ /**
445
+ * Simulate transfer
446
+ * Returns gas estimate and result without sending transaction
447
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
448
+ */
449
+ transfer(_to: `0x${string}`, _value: bigint, options?: {
450
+ accessList?: import("viem").AccessList;
451
+ authorizationList?: import("viem").AuthorizationList;
452
+ chain?: import("viem").Chain | null;
453
+ dataSuffix?: `0x${string}`;
454
+ gas?: bigint;
455
+ gasPrice?: bigint;
456
+ maxFeePerGas?: bigint;
457
+ maxPriorityFeePerGas?: bigint;
458
+ nonce?: number;
459
+ value?: bigint;
460
+ }): Promise<boolean>;
461
+ /**
462
+ * Simulate increaseApproval
463
+ * Returns gas estimate and result without sending transaction
464
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
465
+ */
466
+ increaseApproval(_spender: `0x${string}`, _addedValue: bigint, options?: {
467
+ accessList?: import("viem").AccessList;
468
+ authorizationList?: import("viem").AuthorizationList;
469
+ chain?: import("viem").Chain | null;
470
+ dataSuffix?: `0x${string}`;
471
+ gas?: bigint;
472
+ gasPrice?: bigint;
473
+ maxFeePerGas?: bigint;
474
+ maxPriorityFeePerGas?: bigint;
475
+ nonce?: number;
476
+ value?: bigint;
477
+ }): Promise<boolean>;
478
+ };
479
+ /**
480
+ * Watch contract events
481
+ *
482
+ * @example
483
+ * // Watch all Transfer events
484
+ * const unwatch = contract.watch.Transfer((event) => {
485
+ * console.log('Transfer:', event);
486
+ * });
487
+ *
488
+ * // Stop watching
489
+ * unwatch();
490
+ */
491
+ get watch(): {
492
+ /**
493
+ * Watch Transfer events
494
+ * @param callback Function to call when event is emitted
495
+ * @param filter Optional filter for indexed parameters
496
+ * @returns Unwatch function to stop listening
497
+ */
498
+ Transfer: (callback: (event: {
499
+ _from: `0x${string}`;
500
+ _to: `0x${string}`;
501
+ _value: bigint;
502
+ }) => void, filter?: {
503
+ _from?: `0x${string}` | `0x${string}`[] | null;
504
+ _to?: `0x${string}` | `0x${string}`[] | null;
505
+ }) => () => void;
506
+ /**
507
+ * Watch Approval events
508
+ * @param callback Function to call when event is emitted
509
+ * @param filter Optional filter for indexed parameters
510
+ * @returns Unwatch function to stop listening
511
+ */
512
+ Approval: (callback: (event: {
513
+ _owner: `0x${string}`;
514
+ _spender: `0x${string}`;
515
+ _value: bigint;
516
+ }) => void, filter?: {
517
+ _owner?: `0x${string}` | `0x${string}`[] | null;
518
+ _spender?: `0x${string}` | `0x${string}`[] | null;
519
+ }) => () => void;
520
+ };
521
+ }