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