@gitmyabi/gup 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,633 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * GUPToken ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const GUPTokenAbi: 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 type: "function";
17
+ readonly stateMutability: "view";
18
+ }, {
19
+ readonly constant: true;
20
+ readonly inputs: readonly [];
21
+ readonly name: "minter";
22
+ readonly outputs: readonly [{
23
+ readonly name: "";
24
+ readonly type: "address";
25
+ }];
26
+ readonly payable: false;
27
+ readonly type: "function";
28
+ readonly stateMutability: "view";
29
+ }, {
30
+ readonly constant: false;
31
+ readonly inputs: readonly [{
32
+ readonly name: "_spender";
33
+ readonly type: "address";
34
+ }, {
35
+ readonly name: "_value";
36
+ readonly type: "uint256";
37
+ }];
38
+ readonly name: "approve";
39
+ readonly outputs: readonly [{
40
+ readonly name: "o_success";
41
+ readonly type: "bool";
42
+ }];
43
+ readonly payable: false;
44
+ readonly type: "function";
45
+ readonly stateMutability: "nonpayable";
46
+ }, {
47
+ readonly constant: true;
48
+ readonly inputs: readonly [];
49
+ readonly name: "totalSupply";
50
+ readonly outputs: readonly [{
51
+ readonly name: "";
52
+ readonly type: "uint256";
53
+ }];
54
+ readonly payable: false;
55
+ readonly type: "function";
56
+ readonly stateMutability: "view";
57
+ }, {
58
+ readonly constant: false;
59
+ readonly inputs: readonly [{
60
+ readonly name: "_recipient";
61
+ readonly type: "address";
62
+ }, {
63
+ readonly name: "_value";
64
+ readonly type: "uint256";
65
+ }];
66
+ readonly name: "createIlliquidToken";
67
+ readonly outputs: readonly [{
68
+ readonly name: "o_success";
69
+ readonly type: "bool";
70
+ }];
71
+ readonly payable: false;
72
+ readonly type: "function";
73
+ readonly stateMutability: "nonpayable";
74
+ }, {
75
+ readonly constant: false;
76
+ readonly inputs: readonly [{
77
+ readonly name: "_from";
78
+ readonly type: "address";
79
+ }, {
80
+ readonly name: "_recipient";
81
+ readonly type: "address";
82
+ }, {
83
+ readonly name: "_amount";
84
+ readonly type: "uint256";
85
+ }];
86
+ readonly name: "transferFrom";
87
+ readonly outputs: readonly [{
88
+ readonly name: "o_success";
89
+ readonly type: "bool";
90
+ }];
91
+ readonly payable: false;
92
+ readonly type: "function";
93
+ readonly stateMutability: "nonpayable";
94
+ }, {
95
+ readonly constant: true;
96
+ readonly inputs: readonly [];
97
+ readonly name: "endMintingTime";
98
+ readonly outputs: readonly [{
99
+ readonly name: "";
100
+ readonly type: "uint256";
101
+ }];
102
+ readonly payable: false;
103
+ readonly type: "function";
104
+ readonly stateMutability: "view";
105
+ }, {
106
+ readonly constant: true;
107
+ readonly inputs: readonly [];
108
+ readonly name: "decimals";
109
+ readonly outputs: readonly [{
110
+ readonly name: "";
111
+ readonly type: "uint256";
112
+ }];
113
+ readonly payable: false;
114
+ readonly type: "function";
115
+ readonly stateMutability: "view";
116
+ }, {
117
+ readonly constant: false;
118
+ readonly inputs: readonly [{
119
+ readonly name: "_recipient";
120
+ readonly type: "address";
121
+ }, {
122
+ readonly name: "_value";
123
+ readonly type: "uint256";
124
+ }];
125
+ readonly name: "createToken";
126
+ readonly outputs: readonly [{
127
+ readonly name: "o_success";
128
+ readonly type: "bool";
129
+ }];
130
+ readonly payable: false;
131
+ readonly type: "function";
132
+ readonly stateMutability: "nonpayable";
133
+ }, {
134
+ readonly constant: true;
135
+ readonly inputs: readonly [{
136
+ readonly name: "_owner";
137
+ readonly type: "address";
138
+ }];
139
+ readonly name: "balanceOf";
140
+ readonly outputs: readonly [{
141
+ readonly name: "balance";
142
+ readonly type: "uint256";
143
+ }];
144
+ readonly payable: false;
145
+ readonly type: "function";
146
+ readonly stateMutability: "view";
147
+ }, {
148
+ readonly constant: true;
149
+ readonly inputs: readonly [{
150
+ readonly name: "";
151
+ readonly type: "address";
152
+ }];
153
+ readonly name: "illiquidBalance";
154
+ readonly outputs: readonly [{
155
+ readonly name: "";
156
+ readonly type: "uint256";
157
+ }];
158
+ readonly payable: false;
159
+ readonly type: "function";
160
+ readonly stateMutability: "view";
161
+ }, {
162
+ readonly constant: true;
163
+ readonly inputs: readonly [];
164
+ readonly name: "symbol";
165
+ readonly outputs: readonly [{
166
+ readonly name: "";
167
+ readonly type: "string";
168
+ }];
169
+ readonly payable: false;
170
+ readonly type: "function";
171
+ readonly stateMutability: "view";
172
+ }, {
173
+ readonly constant: false;
174
+ readonly inputs: readonly [{
175
+ readonly name: "_recipient";
176
+ readonly type: "address";
177
+ }, {
178
+ readonly name: "_amount";
179
+ readonly type: "uint256";
180
+ }];
181
+ readonly name: "transfer";
182
+ readonly outputs: readonly [{
183
+ readonly name: "o_success";
184
+ readonly type: "bool";
185
+ }];
186
+ readonly payable: false;
187
+ readonly type: "function";
188
+ readonly stateMutability: "nonpayable";
189
+ }, {
190
+ readonly constant: true;
191
+ readonly inputs: readonly [];
192
+ readonly name: "LOCKOUT_PERIOD";
193
+ readonly outputs: readonly [{
194
+ readonly name: "";
195
+ readonly type: "uint256";
196
+ }];
197
+ readonly payable: false;
198
+ readonly type: "function";
199
+ readonly stateMutability: "view";
200
+ }, {
201
+ readonly constant: true;
202
+ readonly inputs: readonly [{
203
+ readonly name: "_owner";
204
+ readonly type: "address";
205
+ }, {
206
+ readonly name: "_spender";
207
+ readonly type: "address";
208
+ }];
209
+ readonly name: "allowance";
210
+ readonly outputs: readonly [{
211
+ readonly name: "o_remaining";
212
+ readonly type: "uint256";
213
+ }];
214
+ readonly payable: false;
215
+ readonly type: "function";
216
+ readonly stateMutability: "view";
217
+ }, {
218
+ readonly constant: false;
219
+ readonly inputs: readonly [];
220
+ readonly name: "makeLiquid";
221
+ readonly outputs: readonly [];
222
+ readonly payable: false;
223
+ readonly type: "function";
224
+ readonly stateMutability: "nonpayable";
225
+ }, {
226
+ readonly inputs: readonly [{
227
+ readonly name: "_minter";
228
+ readonly type: "address";
229
+ }, {
230
+ readonly name: "_endMintingTime";
231
+ readonly type: "uint256";
232
+ }];
233
+ readonly payable: false;
234
+ readonly type: "constructor";
235
+ readonly stateMutability: "nonpayable";
236
+ }, {
237
+ readonly anonymous: false;
238
+ readonly inputs: readonly [{
239
+ readonly indexed: true;
240
+ readonly name: "_from";
241
+ readonly type: "address";
242
+ }, {
243
+ readonly indexed: true;
244
+ readonly name: "_recipient";
245
+ readonly type: "address";
246
+ }, {
247
+ readonly indexed: false;
248
+ readonly name: "_value";
249
+ readonly type: "uint256";
250
+ }];
251
+ readonly name: "Transfer";
252
+ readonly type: "event";
253
+ }, {
254
+ readonly anonymous: false;
255
+ readonly inputs: readonly [{
256
+ readonly indexed: true;
257
+ readonly name: "_owner";
258
+ readonly type: "address";
259
+ }, {
260
+ readonly indexed: true;
261
+ readonly name: "_spender";
262
+ readonly type: "address";
263
+ }, {
264
+ readonly indexed: false;
265
+ readonly name: "_value";
266
+ readonly type: "uint256";
267
+ }];
268
+ readonly name: "Approval";
269
+ readonly type: "event";
270
+ }];
271
+ /**
272
+ * Type-safe ABI for GUPToken
273
+ */
274
+ export type GUPTokenAbi = typeof GUPTokenAbi;
275
+ /**
276
+ * Contract instance type for GUPToken
277
+ */
278
+ export type GUPTokenContract = any;
279
+ /**
280
+ * GUPToken Contract Class
281
+ *
282
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
283
+ *
284
+ * @example
285
+ * ```typescript
286
+ * import { createPublicClient, createWalletClient, http } from 'viem';
287
+ * import { mainnet } from 'viem/chains';
288
+ * import { GUPToken } from 'GUPToken';
289
+ *
290
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
291
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
292
+ *
293
+ * const contract = new GUPToken('0x...', { publicClient, walletClient });
294
+ *
295
+ * // Read functions
296
+ * const result = await contract.balanceOf('0x...');
297
+ *
298
+ * // Write functions
299
+ * const hash = await contract.transfer('0x...', 1000n);
300
+ *
301
+ * // Simulate transactions (dry-run)
302
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
303
+ * console.log('Gas estimate:', simulation.request.gas);
304
+ *
305
+ * // Watch events
306
+ * const unwatch = contract.watch.Transfer((event) => {
307
+ * console.log('Transfer event:', event);
308
+ * });
309
+ * ```
310
+ */
311
+ export declare class GUPToken {
312
+ private contract;
313
+ private contractAddress;
314
+ private publicClient;
315
+ constructor(address: Address, clients: {
316
+ publicClient: PublicClient;
317
+ walletClient?: WalletClient;
318
+ });
319
+ /**
320
+ * Get the contract address
321
+ */
322
+ get address(): Address;
323
+ /**
324
+ * Get the underlying viem contract instance.
325
+ */
326
+ getContract(): GUPTokenContract;
327
+ /**
328
+ * name
329
+ * view
330
+ */
331
+ name(): Promise<string>;
332
+ /**
333
+ * minter
334
+ * view
335
+ */
336
+ minter(): Promise<`0x${string}`>;
337
+ /**
338
+ * totalSupply
339
+ * view
340
+ */
341
+ totalSupply(): Promise<bigint>;
342
+ /**
343
+ * endMintingTime
344
+ * view
345
+ */
346
+ endMintingTime(): Promise<bigint>;
347
+ /**
348
+ * decimals
349
+ * view
350
+ */
351
+ decimals(): Promise<bigint>;
352
+ /**
353
+ * balanceOf
354
+ * view
355
+ */
356
+ balanceOf(_owner: `0x${string}`): Promise<bigint>;
357
+ /**
358
+ * illiquidBalance
359
+ * view
360
+ */
361
+ illiquidBalance(arg0: `0x${string}`): Promise<bigint>;
362
+ /**
363
+ * symbol
364
+ * view
365
+ */
366
+ symbol(): Promise<string>;
367
+ /**
368
+ * LOCKOUT_PERIOD
369
+ * view
370
+ */
371
+ LOCKOUT_PERIOD(): Promise<bigint>;
372
+ /**
373
+ * allowance
374
+ * view
375
+ */
376
+ allowance(_owner: `0x${string}`, _spender: `0x${string}`): Promise<bigint>;
377
+ /**
378
+ * approve
379
+ * nonpayable
380
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
381
+ */
382
+ approve(_spender: `0x${string}`, _value: bigint, options?: {
383
+ accessList?: import('viem').AccessList;
384
+ authorizationList?: import('viem').AuthorizationList;
385
+ chain?: import('viem').Chain | null;
386
+ dataSuffix?: `0x${string}`;
387
+ gas?: bigint;
388
+ gasPrice?: bigint;
389
+ maxFeePerGas?: bigint;
390
+ maxPriorityFeePerGas?: bigint;
391
+ nonce?: number;
392
+ value?: bigint;
393
+ }): Promise<`0x${string}`>;
394
+ /**
395
+ * createIlliquidToken
396
+ * nonpayable
397
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
398
+ */
399
+ createIlliquidToken(_recipient: `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
+ * transferFrom
413
+ * nonpayable
414
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
415
+ */
416
+ transferFrom(_from: `0x${string}`, _recipient: `0x${string}`, _amount: bigint, 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
+ * createToken
430
+ * nonpayable
431
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
432
+ */
433
+ createToken(_recipient: `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
+ * transfer
447
+ * nonpayable
448
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
449
+ */
450
+ transfer(_recipient: `0x${string}`, _amount: 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
+ * makeLiquid
464
+ * nonpayable
465
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
466
+ */
467
+ makeLiquid(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 createIlliquidToken
507
+ * Returns gas estimate and result without sending transaction
508
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
509
+ */
510
+ createIlliquidToken(_recipient: `0x${string}`, _value: bigint, 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<boolean>;
522
+ /**
523
+ * Simulate transferFrom
524
+ * Returns gas estimate and result without sending transaction
525
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
526
+ */
527
+ transferFrom(_from: `0x${string}`, _recipient: `0x${string}`, _amount: 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 createToken
541
+ * Returns gas estimate and result without sending transaction
542
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
543
+ */
544
+ createToken(_recipient: `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 transfer
558
+ * Returns gas estimate and result without sending transaction
559
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
560
+ */
561
+ transfer(_recipient: `0x${string}`, _amount: bigint, 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<boolean>;
573
+ /**
574
+ * Simulate makeLiquid
575
+ * Returns gas estimate and result without sending transaction
576
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
577
+ */
578
+ makeLiquid(options?: {
579
+ accessList?: import("viem").AccessList;
580
+ authorizationList?: import("viem").AuthorizationList;
581
+ chain?: import("viem").Chain | null;
582
+ dataSuffix?: `0x${string}`;
583
+ gas?: bigint;
584
+ gasPrice?: bigint;
585
+ maxFeePerGas?: bigint;
586
+ maxPriorityFeePerGas?: bigint;
587
+ nonce?: number;
588
+ value?: bigint;
589
+ }): Promise<void>;
590
+ };
591
+ /**
592
+ * Watch contract events
593
+ *
594
+ * @example
595
+ * // Watch all Transfer events
596
+ * const unwatch = contract.watch.Transfer((event) => {
597
+ * console.log('Transfer:', event);
598
+ * });
599
+ *
600
+ * // Stop watching
601
+ * unwatch();
602
+ */
603
+ get watch(): {
604
+ /**
605
+ * Watch Transfer events
606
+ * @param callback Function to call when event is emitted
607
+ * @param filter Optional filter for indexed parameters
608
+ * @returns Unwatch function to stop listening
609
+ */
610
+ Transfer: (callback: (event: {
611
+ _from: `0x${string}`;
612
+ _recipient: `0x${string}`;
613
+ _value: bigint;
614
+ }) => void, filter?: {
615
+ _from?: `0x${string}` | `0x${string}`[] | null;
616
+ _recipient?: `0x${string}` | `0x${string}`[] | null;
617
+ }) => () => void;
618
+ /**
619
+ * Watch Approval events
620
+ * @param callback Function to call when event is emitted
621
+ * @param filter Optional filter for indexed parameters
622
+ * @returns Unwatch function to stop listening
623
+ */
624
+ Approval: (callback: (event: {
625
+ _owner: `0x${string}`;
626
+ _spender: `0x${string}`;
627
+ _value: bigint;
628
+ }) => void, filter?: {
629
+ _owner?: `0x${string}` | `0x${string}`[] | null;
630
+ _spender?: `0x${string}` | `0x${string}`[] | null;
631
+ }) => () => void;
632
+ };
633
+ }