@@ -185,15 +185,25 @@ interface GetVestingEscrowWalletLogsAsyncParams extends GetLogs {
185
185
( params : GetUnpauseLogsAsyncParams ) : Promise < LogWithDecodedArgs < VestingEscrowWalletUnpauseEventArgs > [ ] > ;
186
186
}
187
187
188
+ /**
189
+ * @param beneficiary Beneficiary
190
+ * @param index Index of schedule
191
+ */
188
192
interface SchedulesParams {
189
193
beneficiary : string ;
190
194
index : number ;
191
195
}
192
196
197
+ /**
198
+ * @param index Index of template
199
+ */
193
200
interface TemplateNamesParams {
194
201
index : number ;
195
202
}
196
203
204
+ /**
205
+ * @param index Index of beneficiary
206
+ */
197
207
interface BeneficiariesParams {
198
208
index : number ;
199
209
}
@@ -385,6 +395,8 @@ enum StateStatus {
385
395
Completed ,
386
396
}
387
397
398
+ // RETURN TYPES
399
+
388
400
interface Schedule {
389
401
templateName : string ;
390
402
claimedTokens : number ;
@@ -421,33 +433,57 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
421
433
this . contract = contract ;
422
434
}
423
435
436
+ /**
437
+ * Unpause the module
438
+ */
424
439
public unpause = async ( params : TxParams ) => {
425
440
assert . assert ( await this . paused ( ) , 'Controller not currently paused' ) ;
426
441
assert . assert ( await this . isCallerTheSecurityTokenOwner ( params . txData ) , 'Sender is not owner' ) ;
427
442
return ( await this . contract ) . unpause . sendTransactionAsync ( params . txData , params . safetyFactor ) ;
428
443
} ;
429
444
430
- public paused = async ( ) => {
445
+ /**
446
+ * Check if module paused
447
+ * @return boolean is paused
448
+ */
449
+ public paused = async ( ) : Promise < boolean > => {
431
450
return ( await this . contract ) . paused . callAsync ( ) ;
432
451
} ;
433
452
453
+ /**
454
+ * Pause the module
455
+ */
434
456
public pause = async ( params : TxParams ) => {
435
457
assert . assert ( ! ( await this . paused ( ) ) , 'Controller currently paused' ) ;
436
458
assert . assert ( await this . isCallerTheSecurityTokenOwner ( params . txData ) , 'Sender is not owner' ) ;
437
459
return ( await this . contract ) . pause . sendTransactionAsync ( params . txData , params . safetyFactor ) ;
438
460
} ;
439
461
440
- public treasuryWallet = async ( ) => {
462
+ /**
463
+ * Address of the Treasury wallet. All of the unassigned token will transfer to that address.
464
+ * @return address
465
+ */
466
+ public treasuryWallet = async ( ) : Promise < string > => {
441
467
return ( await this . contract ) . treasuryWallet . callAsync ( ) ;
442
468
} ;
443
469
444
- public unassignedTokens = async ( ) => {
470
+ /**
471
+ * Number of tokens that are hold by the `this` contract but are unassigned to any schedule
472
+ * @return unassigned token value
473
+ */
474
+ public unassignedTokens = async ( ) : Promise < BigNumber > => {
445
475
const result = await ( await this . contract ) . unassignedTokens . callAsync ( ) ;
446
476
const decimals = await ( await this . securityTokenContract ( ) ) . decimals . callAsync ( ) ;
447
477
return weiToValue ( result , decimals ) ;
448
478
} ;
449
479
450
- public schedules = async ( params : SchedulesParams ) => {
480
+ /**
481
+ * Holds schedules array corresponds to the affiliate/employee address
482
+ * @return templateName
483
+ * @return claimedTokens amount
484
+ * @return startTime date
485
+ */
486
+ public schedules = async ( params : SchedulesParams ) : Promise < Schedule > => {
451
487
const result = await ( await this . contract ) . schedules . callAsync ( params . beneficiary , numberToBigNumber ( params . index ) ) ;
452
488
const decimals = await ( await this . securityTokenContract ( ) ) . decimals . callAsync ( ) ;
453
489
const schedule : Schedule = {
@@ -458,12 +494,20 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
458
494
return schedule ;
459
495
} ;
460
496
461
- public templateNames = async ( params : TemplateNamesParams ) => {
497
+ /**
498
+ * List of all template names
499
+ * @return name string
500
+ */
501
+ public templateNames = async ( params : TemplateNamesParams ) : Promise < string > => {
462
502
const result = await ( await this . contract ) . templateNames . callAsync ( numberToBigNumber ( params . index ) ) ;
463
503
return bytes32ToString ( result ) ;
464
504
} ;
465
505
466
- public beneficiaries = async ( params : BeneficiariesParams ) => {
506
+ /**
507
+ * List of all beneficiaries who have the schedules running/completed/created
508
+ * @return beneficiary address
509
+ */
510
+ public beneficiaries = async ( params : BeneficiariesParams ) : Promise < string > => {
467
511
return ( await this . contract ) . beneficiaries . callAsync ( numberToBigNumber ( params . index ) ) ;
468
512
} ;
469
513
@@ -532,8 +576,9 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
532
576
533
577
/**
534
578
* Returns the treasury wallet address
579
+ * @return treasury wallet address
535
580
*/
536
- public getTreasuryWallet = async ( ) => {
581
+ public getTreasuryWallet = async ( ) : Promise < string > => {
537
582
return ( await this . contract ) . getTreasuryWallet . callAsync ( ) ;
538
583
} ;
539
584
@@ -596,7 +641,7 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
596
641
* Returns the amount of templates that can be used for creating schedules
597
642
* @return Amount of templates
598
643
*/
599
- public getTemplateCount = async ( ) => {
644
+ public getTemplateCount = async ( ) : Promise < number > => {
600
645
const result = await ( await this . contract ) . getTemplateCount . callAsync ( ) ;
601
646
return result . toNumber ( ) ;
602
647
} ;
@@ -605,7 +650,7 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
605
650
* Gets the list of template names that can be used for creating schedules
606
651
* @return Array of all template names
607
652
*/
608
- public getAllTemplateNames = async ( ) => {
653
+ public getAllTemplateNames = async ( ) : Promise < string [ ] > => {
609
654
const results = await ( await this . contract ) . getAllTemplateNames . callAsync ( ) ;
610
655
return bytes32ArrayToStringArray ( results ) ;
611
656
} ;
@@ -696,7 +741,7 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
696
741
* Returns a schedule with a given template name for a given beneficiary address
697
742
* @return beneficiary's schedule data (numberOfTokens, duration, frequency, startTime, claimedTokens, state)
698
743
*/
699
- public getSchedule = async ( params : GetScheduleParams ) => {
744
+ public getSchedule = async ( params : GetScheduleParams ) : Promise < BeneficiarySchedule > => {
700
745
this . checkSchedule ( params . beneficiary ) ;
701
746
const result = await ( await this . contract ) . getSchedule . callAsync (
702
747
params . beneficiary ,
@@ -736,7 +781,7 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
736
781
* Returns a list of the template names for a given beneficiary address
737
782
* @return List of template names used for the beneficiary address' schedules
738
783
*/
739
- public getTemplateNames = async ( params : GetTemplateNamesParams ) => {
784
+ public getTemplateNames = async ( params : GetTemplateNamesParams ) : Promise < string [ ] > => {
740
785
assert . isNonZeroETHAddressHex ( 'beneficiary' , params . beneficiary ) ;
741
786
const result = await ( await this . contract ) . getTemplateNames . callAsync ( params . beneficiary ) ;
742
787
return bytes32ArrayToStringArray ( result ) ;
@@ -746,7 +791,7 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
746
791
* Returns amount of schedules for a given beneficiary address
747
792
* @return Amount of schedules
748
793
*/
749
- public getScheduleCount = async ( params : GetScheduleCountParams ) => {
794
+ public getScheduleCount = async ( params : GetScheduleCountParams ) : Promise < number > => {
750
795
assert . isNonZeroETHAddressHex ( 'beneficiary' , params . beneficiary ) ;
751
796
const result = await ( await this . contract ) . getScheduleCount . callAsync ( params . beneficiary ) ;
752
797
return result . toNumber ( ) ;
0 commit comments