@@ -191,33 +191,62 @@ interface BeneficiariesParams {
191
191
index : number ;
192
192
}
193
193
194
+ /**
195
+ * @param newTreasuryWallet Address of the treasury wallet
196
+ */
194
197
interface ChangeTreasuryWalletParams extends TxParams {
195
198
newTreasuryWallet : string ;
196
199
}
197
200
201
+ /**
202
+ * @param numberOfTokens Number of tokens that should be deposited
203
+ */
198
204
interface DepositTokensParams extends TxParams {
199
205
numberOfTokens : number ;
200
206
}
201
207
208
+ /**
209
+ * @param amount Amount of tokens that should be send to the treasury wallet
210
+ */
202
211
interface SendToTreasuryParams extends TxParams {
203
212
amount : number ;
204
213
}
205
214
215
+ /**
216
+ * @param beneficiary Address of the beneficiary who will receive tokens
217
+ */
206
218
interface PushAvailableTokensParams extends TxParams {
207
219
beneficiary : string ;
208
220
}
209
221
222
+ /**
223
+ * @param name Name of the template will be created
224
+ * @param numberOfTokens Number of tokens that should be assigned to schedule
225
+ * @param duration Duration of the vesting schedule
226
+ * @param frequency Frequency of the vesting schedule
227
+ */
210
228
interface AddTemplateParams extends TxParams {
211
229
name : string ;
212
230
numberOfTokens : number ;
213
231
duration : number ;
214
232
frequency : number ;
215
233
}
216
234
235
+ /**
236
+ * @param name Name of the template that will be removed
237
+ */
217
238
interface RemoveTemplateParams extends TxParams {
218
239
name : string ;
219
240
}
220
241
242
+ /**
243
+ * @param beneficiary Address of the beneficiary for whom it is scheduled
244
+ * @param templateName Name of the template that will be created
245
+ * @param numberOfTokens Total number of tokens for created schedule
246
+ * @param duration Duration of the created vesting schedule
247
+ * @param frequency Frequency of the created vesting schedule
248
+ * @param startTime Start time of the created vesting schedule
249
+ */
221
250
interface AddScheduleParams extends TxParams {
222
251
beneficiary : string ;
223
252
templateName : string ;
@@ -227,45 +256,84 @@ interface AddScheduleParams extends TxParams {
227
256
startTime ?: Date ;
228
257
}
229
258
259
+ /**
260
+ * @param beneficiary Address of the beneficiary for whom it is scheduled
261
+ * @param templateName Name of the exists template
262
+ * @param startTime Start time of the created vesting schedule
263
+ */
230
264
interface AddScheduleFromTemplateParams extends TxParams {
231
265
beneficiary : string ;
232
266
templateName : string ;
233
267
startTime ?: Date ;
234
268
}
235
269
270
+ /**
271
+ * @param beneficiary Address of the beneficiary for whom it is modified
272
+ * @param templateName Name of the template was used for schedule creation
273
+ * @param startTime Start time of the created vesting schedule
274
+ */
236
275
interface ModifyScheduleParams extends TxParams {
237
276
beneficiary : string ;
238
277
templateName : string ;
239
278
startTime ?: Date ;
240
279
}
241
280
281
+ /**
282
+ * @param beneficiary Address of the beneficiary for whom it is revoked
283
+ * @param templateName Name of the template was used for schedule creation
284
+ */
242
285
interface RevokeScheduleParams extends TxParams {
243
286
beneficiary : string ;
244
287
templateName : string ;
245
288
}
246
289
290
+ /**
291
+ * @param beneficiary Address of the beneficiary for whom all schedules will be revoked
292
+ */
247
293
interface RevokeAllSchedulesParams extends TxParams {
248
294
beneficiary : string ;
249
295
}
250
296
297
+ /**
298
+ * @param beneficiary Address of the beneficiary who will receive tokens
299
+ * @param templateName Name of the template was used for schedule creation
300
+ */
251
301
interface GetScheduleParams {
252
302
beneficiary : string ;
253
303
templateName : string ;
254
304
}
255
305
306
+ /**
307
+ * @param beneficiary Address of the beneficiary
308
+ */
256
309
interface GetTemplateNamesParams {
257
310
beneficiary : string ;
258
311
}
259
312
313
+ /**
314
+ * @param beneficiary Address of the beneficiary
315
+ */
260
316
interface GetScheduleCountParams {
261
317
beneficiary : string ;
262
318
}
263
319
320
+ /**
321
+ * @param fromIndex Start index of array of beneficiary's addresses
322
+ * @param toIndex End index of array of beneficiary's addresses
323
+ */
264
324
interface PushAvailableTokensMultiParams extends TxParams {
265
325
fromIndex : number ;
266
326
toIndex : number ;
267
327
}
268
328
329
+ /**
330
+ * @param beneficiaries Array of the beneficiary's addresses
331
+ * @param templateNames Array of the template names
332
+ * @param numberOfTokens Array of number of tokens should be assigned to schedules
333
+ * @param durations Array of the vesting duration
334
+ * @param frequencies Array of the vesting frequency
335
+ * @param startTimes Array of the vesting start time
336
+ */
269
337
interface AddScheduleMultiParams extends TxParams {
270
338
beneficiaries : string [ ] ;
271
339
templateNames : string [ ] ;
@@ -275,16 +343,29 @@ interface AddScheduleMultiParams extends TxParams {
275
343
startTimes : Date [ ] ;
276
344
}
277
345
346
+ /**
347
+ * @param beneficiaries Array of beneficiary's addresses
348
+ * @param templateNames Array of the template names were used for schedule creation
349
+ * @param startTimes Array of the vesting start time
350
+ */
278
351
interface AddScheduleFromTemplateMultiParams extends TxParams {
279
352
beneficiaries : string [ ] ;
280
353
templateNames : string [ ] ;
281
354
startTimes : Date [ ] ;
282
355
}
283
356
357
+ /**
358
+ * @param beneficiaries Array of the beneficiary's addresses
359
+ */
284
360
interface RevokeSchedulesMultiParams extends TxParams {
285
361
beneficiaries : string [ ] ;
286
362
}
287
363
364
+ /**
365
+ * @param beneficiaries Array of the beneficiary's addresses
366
+ * @param templateNames Array of the template names
367
+ * @param startTimes Array of the vesting start time
368
+ */
288
369
interface ModifyScheduleMultiParams extends TxParams {
289
370
beneficiaries : string [ ] ;
290
371
templateNames : string [ ] ;
@@ -354,6 +435,9 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
354
435
return ( await this . contract ) . getDataStore . callAsync ( ) ;
355
436
} ;
356
437
438
+ /**
439
+ * Used to change the treasury wallet address
440
+ */
357
441
public changeTreasuryWallet = async ( params : ChangeTreasuryWalletParams ) => {
358
442
return ( await this . contract ) . changeTreasuryWallet . sendTransactionAsync (
359
443
params . newTreasuryWallet ,
@@ -362,6 +446,9 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
362
446
) ;
363
447
} ;
364
448
449
+ /**
450
+ * Used to deposit tokens from treasury wallet to the vesting escrow wallet
451
+ */
365
452
public depositTokens = async ( params : DepositTokensParams ) => {
366
453
return ( await this . contract ) . depositTokens . sendTransactionAsync (
367
454
numberToBigNumber ( params . numberOfTokens ) ,
@@ -370,6 +457,9 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
370
457
) ;
371
458
} ;
372
459
460
+ /**
461
+ * Sends unassigned tokens to the treasury wallet
462
+ */
373
463
public sendToTreasury = async ( params : SendToTreasuryParams ) => {
374
464
return ( await this . contract ) . sendToTreasury . sendTransactionAsync (
375
465
numberToBigNumber ( params . amount ) ,
@@ -378,10 +468,16 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
378
468
) ;
379
469
} ;
380
470
471
+ /**
472
+ * Returns the treasury wallet address
473
+ */
381
474
public getTreasuryWallet = async ( ) => {
382
475
return ( await this . contract ) . getTreasuryWallet . callAsync ( ) ;
383
476
} ;
384
477
478
+ /**
479
+ * Pushes available tokens to the beneficiary's address
480
+ */
385
481
public pushAvailableTokens = async ( params : PushAvailableTokensParams ) => {
386
482
return ( await this . contract ) . pushAvailableTokens . sendTransactionAsync (
387
483
params . beneficiary ,
@@ -390,10 +486,16 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
390
486
) ;
391
487
} ;
392
488
489
+ /**
490
+ * Used to withdraw available tokens by beneficiary
491
+ */
393
492
public pullAvailableTokens = async ( params : TxParams ) => {
394
493
return ( await this . contract ) . pullAvailableTokens . sendTransactionAsync ( params . txData , params . safetyFactor ) ;
395
494
} ;
396
495
496
+ /**
497
+ * Adds template that can be used for creating schedule
498
+ */
397
499
public addTemplate = async ( params : AddTemplateParams ) => {
398
500
return ( await this . contract ) . addTemplate . sendTransactionAsync (
399
501
params . name ,
@@ -405,18 +507,32 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
405
507
) ;
406
508
} ;
407
509
510
+ /**
511
+ * Removes template with a given name
512
+ */
408
513
public removeTemplate = async ( params : RemoveTemplateParams ) => {
409
514
return ( await this . contract ) . removeTemplate . sendTransactionAsync ( params . name , params . txData , params . safetyFactor ) ;
410
515
} ;
411
516
517
+ /**
518
+ * Returns count of the templates those can be used for creating schedule
519
+ * @return Count of the templates
520
+ */
412
521
public getTemplateCount = async ( ) => {
413
522
return ( await this . contract ) . getTreasuryWallet . callAsync ( ) ;
414
523
} ;
415
524
525
+ /**
526
+ * Gets the list of the template names those can be used for creating schedule
527
+ * @return bytes32 Array of all template names were created
528
+ */
416
529
public getAllTemplateNames = async ( ) => {
417
530
return ( await this . contract ) . getTreasuryWallet . callAsync ( ) ;
418
531
} ;
419
532
533
+ /**
534
+ * Adds vesting schedules for each of the beneficiary's address
535
+ */
420
536
public addSchedule = async ( params : AddScheduleParams ) => {
421
537
let startTime = new BigNumber ( 0 ) ;
422
538
if ( params . startTime ) {
@@ -435,6 +551,9 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
435
551
) ;
436
552
} ;
437
553
554
+ /**
555
+ * Adds vesting schedules from template for the beneficiary
556
+ */
438
557
public addScheduleFromTemplate = async ( params : AddScheduleFromTemplateParams ) => {
439
558
let startTime = new BigNumber ( 0 ) ;
440
559
if ( params . startTime ) {
@@ -449,6 +568,9 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
449
568
) ;
450
569
} ;
451
570
571
+ /**
572
+ * Modifies vesting schedules for each of the beneficiary
573
+ */
452
574
public modifySchedule = async ( params : ModifyScheduleParams ) => {
453
575
let startTime = new BigNumber ( 0 ) ;
454
576
if ( params . startTime ) {
@@ -463,6 +585,9 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
463
585
) ;
464
586
} ;
465
587
588
+ /**
589
+ * Revokes vesting schedule with given template name for given beneficiary
590
+ */
466
591
public revokeSchedule = async ( params : RevokeScheduleParams ) => {
467
592
return ( await this . contract ) . revokeSchedule . sendTransactionAsync (
468
593
params . beneficiary ,
@@ -472,6 +597,9 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
472
597
) ;
473
598
} ;
474
599
600
+ /**
601
+ * Revokes all vesting schedules for given beneficiary's address
602
+ */
475
603
public revokeAllSchedules = async ( params : RevokeAllSchedulesParams ) => {
476
604
return ( await this . contract ) . revokeAllSchedules . sendTransactionAsync (
477
605
params . beneficiary ,
@@ -480,18 +608,33 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
480
608
) ;
481
609
} ;
482
610
611
+ /**
612
+ * Returns beneficiary's schedule created using template name
613
+ * @return beneficiary's schedule data (numberOfTokens, duration, frequency, startTime, claimedTokens, State)
614
+ */
483
615
public getSchedule = async ( params : GetScheduleParams ) => {
484
616
return ( await this . contract ) . getSchedule . callAsync ( params . beneficiary , params . templateName ) ;
485
617
} ;
486
618
619
+ /**
620
+ * Returns list of the template names for given beneficiary's address
621
+ * @return List of the template names that were used for schedule creation
622
+ */
487
623
public getTemplateNames = async ( params : GetTemplateNamesParams ) => {
488
624
return ( await this . contract ) . getTemplateNames . callAsync ( params . beneficiary ) ;
489
625
} ;
490
626
627
+ /**
628
+ * Returns count of the schedules were created for given beneficiary
629
+ * @return Count of beneficiary's schedules
630
+ */
491
631
public getScheduleCount = async ( params : GetScheduleCountParams ) => {
492
632
return ( await this . contract ) . getScheduleCount . callAsync ( params . beneficiary ) ;
493
633
} ;
494
634
635
+ /**
636
+ * Used to bulk send available tokens for each of the beneficiaries
637
+ */
495
638
public pushAvailableTokensMulti = async ( params : PushAvailableTokensMultiParams ) => {
496
639
return ( await this . contract ) . pushAvailableTokensMulti . sendTransactionAsync (
497
640
numberToBigNumber ( params . fromIndex ) ,
@@ -501,6 +644,9 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
501
644
) ;
502
645
} ;
503
646
647
+ /**
648
+ * Used to bulk add vesting schedules for each of beneficiary
649
+ */
504
650
public addScheduleMulti = async ( params : AddScheduleMultiParams ) => {
505
651
return ( await this . contract ) . addScheduleMulti . sendTransactionAsync (
506
652
params . beneficiaries ,
@@ -522,6 +668,9 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
522
668
) ;
523
669
} ;
524
670
671
+ /**
672
+ * Used to bulk add vesting schedules from template for each of the beneficiary
673
+ */
525
674
public addScheduleFromTemplateMulti = async ( params : AddScheduleFromTemplateMultiParams ) => {
526
675
return ( await this . contract ) . addScheduleFromTemplateMulti . sendTransactionAsync (
527
676
params . beneficiaries ,
@@ -534,6 +683,9 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
534
683
) ;
535
684
} ;
536
685
686
+ /**
687
+ * Used to bulk revoke vesting schedules for each of the beneficiaries
688
+ */
537
689
public revokeSchedulesMulti = async ( params : RevokeSchedulesMultiParams ) => {
538
690
return ( await this . contract ) . revokeSchedulesMulti . sendTransactionAsync (
539
691
params . beneficiaries ,
@@ -542,6 +694,9 @@ export default class VestingEscrowWalletWrapper extends ModuleWrapper {
542
694
) ;
543
695
} ;
544
696
697
+ /**
698
+ * Used to bulk modify vesting schedules for each of the beneficiaries
699
+ */
545
700
public modifyScheduleMulti = async ( params : ModifyScheduleMultiParams ) => {
546
701
return ( await this . contract ) . modifyScheduleMulti . sendTransactionAsync (
547
702
params . beneficiaries ,
0 commit comments