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