@gitmyabi/kernel 1.0.2 → 1.0.3

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