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