@@ -134,20 +134,37 @@ interface GetGeneralTransferManagerLogsAsyncParams extends GetLogs {
134
134
> ;
135
135
}
136
136
137
+ /**
138
+ * @param address Address noncemap related to
139
+ * @param nonce Nonce of the signature
140
+ */
137
141
interface NonceMapParams {
138
142
address : string ;
139
143
nonce : number ;
140
144
}
141
145
146
+ /**
147
+ * @param defaultCanSendAfter default for zero canSendAfter
148
+ * @param defaultCanReceiveAfter default for zero canReceiveAfter
149
+ */
142
150
interface ChangeDefaultsParams extends TxParams {
143
151
defaultFromTime : Date ;
144
152
defaultToTime : Date ;
145
153
}
146
154
155
+ /**
156
+ * @param issuanceAddress new address for the issuance
157
+ */
147
158
interface ChangeIssuanceAddressParams extends TxParams {
148
159
issuanceAddress : string ;
149
160
}
150
161
162
+ /**
163
+ * @param investor is the address to whitelist
164
+ * @param canSendAfter is the moment when the sale lockup period ends and the investor can freely sell or transfer their tokens
165
+ * @param canReceiveAfter is the moment when the purchase lockup period ends and the investor can freely purchase or receive tokens from others
166
+ * @param expiryTime is the moment till investors KYC will be validated. After that investor need to do re-KYC
167
+ */
151
168
interface ModifyKYCDataParams extends TxParams {
152
169
investor : string ;
153
170
canSendAfter : Date ;
@@ -176,15 +193,25 @@ interface ModifyKYCDataSignedParams extends TxParams {
176
193
signature : string ;
177
194
}
178
195
196
+ /**
197
+ * @param investor Address
198
+ * @param flag FlagsType
199
+ */
179
200
interface GetInvestorFlag {
180
201
investor : string ;
181
202
flag : FlagsType ;
182
203
}
183
204
205
+ /**
206
+ * @param investor Address
207
+ */
184
208
interface GetInvestorFlags {
185
209
investor : string ;
186
210
}
187
211
212
+ /**
213
+ * @param investors Address array
214
+ */
188
215
interface GetKYCDataParams {
189
216
investors : string [ ] ;
190
217
}
@@ -214,6 +241,7 @@ interface ModifyInvestorFlagMulti extends TxParams {
214
241
/**
215
242
* @param from Address of the sender
216
243
* @param to Address of the receiver
244
+ * @param data Data value
217
245
*/
218
246
interface ExecuteTransfer extends TxParams {
219
247
from : string ;
@@ -285,6 +313,10 @@ interface ModifyKYCDataSignedMulti extends TxParams {
285
313
signature : string ;
286
314
}
287
315
316
+ /**
317
+ * @param fromIndex From index in range
318
+ * @param toIndex To index in range
319
+ */
288
320
interface GetInvestors {
289
321
fromIndex : number ;
290
322
toIndex : number ;
@@ -339,32 +371,53 @@ export default class GeneralTransferManagerWrapper extends ModuleWrapper {
339
371
this . contract = contract ;
340
372
}
341
373
374
+ /**
375
+ * unpause the module
376
+ */
342
377
public unpause = async ( params : TxParams ) => {
343
378
assert . assert ( await this . paused ( ) , 'Controller not currently paused' ) ;
344
379
assert . assert ( await this . isCallerTheSecurityTokenOwner ( params . txData ) , 'Sender is not owner' ) ;
345
380
return ( await this . contract ) . unpause . sendTransactionAsync ( params . txData , params . safetyFactor ) ;
346
381
} ;
347
382
383
+ /**
384
+ * check if the module is paused
385
+ */
348
386
public paused = async ( ) : Promise < boolean > => {
349
387
return ( await this . contract ) . paused . callAsync ( ) ;
350
388
} ;
351
389
390
+ /**
391
+ * pause the module
392
+ */
352
393
public pause = async ( params : TxParams ) => {
353
394
assert . assert ( ! ( await this . paused ( ) ) , 'Controller currently paused' ) ;
354
395
assert . assert ( await this . isCallerTheSecurityTokenOwner ( params . txData ) , 'Sender is not owner' ) ;
355
396
return ( await this . contract ) . pause . sendTransactionAsync ( params . txData , params . safetyFactor ) ;
356
397
} ;
357
398
358
- public nonceMap = async ( params : NonceMapParams ) => {
399
+ /**
400
+ * Map of used nonces by customer
401
+ * @return boolean result
402
+ */
403
+ public nonceMap = async ( params : NonceMapParams ) : Promise < boolean > => {
359
404
assert . isETHAddressHex ( 'address' , params . address ) ;
360
405
return ( await this . contract ) . nonceMap . callAsync ( params . address , numberToBigNumber ( params . nonce ) ) ;
361
406
} ;
362
407
363
- public issuanceAddress = async ( ) => {
408
+ /**
409
+ * Address from which issuances arrive
410
+ */
411
+ public issuanceAddress = async ( ) : Promise < string > => {
364
412
return ( await this . contract ) . issuanceAddress . callAsync ( ) ;
365
413
} ;
366
414
367
- public defaults = async ( ) => {
415
+ /**
416
+ * Offset to be applied to all timings (except KYC expiry)
417
+ * @return canSendAfter
418
+ * @return canReceiveAfter
419
+ */
420
+ public defaults = async ( ) : Promise < Defaults > => {
368
421
const result = await ( await this . contract ) . defaults . callAsync ( ) ;
369
422
const typedResult : Defaults = {
370
423
canSendAfter : bigNumberToDate ( result [ 0 ] ) ,
@@ -373,6 +426,9 @@ export default class GeneralTransferManagerWrapper extends ModuleWrapper {
373
426
return typedResult ;
374
427
} ;
375
428
429
+ /**
430
+ * Used to change the default times used when canSendAfter / canReceiveAfter are zero
431
+ */
376
432
public changeDefaults = async ( params : ChangeDefaultsParams ) => {
377
433
assert . assert ( await this . isCallerAllowed ( params . txData , Perm . Admin ) , 'Caller is not allowed' ) ;
378
434
return ( await this . contract ) . changeDefaults . sendTransactionAsync (
@@ -383,6 +439,9 @@ export default class GeneralTransferManagerWrapper extends ModuleWrapper {
383
439
) ;
384
440
} ;
385
441
442
+ /**
443
+ * Used to change the Issuance Address
444
+ */
386
445
public changeIssuanceAddress = async ( params : ChangeIssuanceAddressParams ) => {
387
446
assert . isETHAddressHex ( 'issuanceAddress' , params . issuanceAddress ) ;
388
447
assert . assert ( await this . isCallerAllowed ( params . txData , Perm . Admin ) , 'Caller is not allowed' ) ;
@@ -393,6 +452,9 @@ export default class GeneralTransferManagerWrapper extends ModuleWrapper {
393
452
) ;
394
453
} ;
395
454
455
+ /**
456
+ * Add or remove KYC info of an investor.
457
+ */
396
458
public modifyKYCData = async ( params : ModifyKYCDataParams ) => {
397
459
assert . isNonZeroETHAddressHex ( 'investor' , params . investor ) ;
398
460
assert . assert ( await this . isCallerAllowed ( params . txData , Perm . Admin ) , 'Caller is not allowed' ) ;
@@ -409,7 +471,10 @@ export default class GeneralTransferManagerWrapper extends ModuleWrapper {
409
471
) ;
410
472
} ;
411
473
412
- public getInvestorFlag = async ( params : GetInvestorFlag ) => {
474
+ /**
475
+ * Gets the investor flag
476
+ */
477
+ public getInvestorFlag = async ( params : GetInvestorFlag ) : Promise < boolean > => {
413
478
const result = await ( await this . contract ) . getInvestorFlag . callAsync ( params . investor , params . flag ) ;
414
479
return result ;
415
480
} ;
@@ -462,6 +527,9 @@ export default class GeneralTransferManagerWrapper extends ModuleWrapper {
462
527
} ;
463
528
} ;
464
529
530
+ /**
531
+ * Get all investor flags
532
+ */
465
533
public getAllInvestorFlags = async ( ) => {
466
534
const result = await ( await this . contract ) . getAllInvestorFlags . callAsync ( ) ;
467
535
const [ investors , flags ] = result ;
@@ -472,13 +540,19 @@ export default class GeneralTransferManagerWrapper extends ModuleWrapper {
472
540
return investorFlags ;
473
541
} ;
474
542
543
+ /**
544
+ * Gets the investor flags
545
+ */
475
546
public getInvestorFlags = async ( params : GetInvestorFlags ) => {
476
547
const { investor } = params ;
477
548
const flags = await ( await this . contract ) . getInvestorFlags . callAsync ( investor ) ;
478
549
return this . unpackFlags ( investor , flags ) ;
479
550
} ;
480
551
481
- public getAllKYCData = async ( ) => {
552
+ /**
553
+ * Returns list of all investors data
554
+ */
555
+ public getAllKYCData = async ( ) : Promise < KYCDataWithInvestor [ ] > => {
482
556
const result = await ( await this . contract ) . getAllKYCData . callAsync ( ) ;
483
557
const typedResult : KYCDataWithInvestor [ ] = [ ] ;
484
558
for ( let i = 0 ; i < result [ 0 ] . length ; i += 1 ) {
@@ -493,7 +567,13 @@ export default class GeneralTransferManagerWrapper extends ModuleWrapper {
493
567
return typedResult ;
494
568
} ;
495
569
496
- public getKYCData = async ( params : GetKYCDataParams ) => {
570
+ /**
571
+ * Returns list of specified investors data
572
+ * @returns canSendAfter array
573
+ * @returns canReceiveAfter array
574
+ * @returns expiryTime array
575
+ */
576
+ public getKYCData = async ( params : GetKYCDataParams ) : Promise < KYCData [ ] > => {
497
577
const result = await ( await this . contract ) . getKYCData . callAsync ( params . investors ) ;
498
578
const typedResult : KYCData [ ] = [ ] ;
499
579
for ( let i = 0 ; i < result [ 0 ] . length ; i += 1 ) {
@@ -520,6 +600,9 @@ export default class GeneralTransferManagerWrapper extends ModuleWrapper {
520
600
return weiToValue ( result , decimals ) ;
521
601
} ;
522
602
603
+ /**
604
+ * Adds or removes addresses from the whitelist - can be called by anyone with a valid signature
605
+ */
523
606
public modifyKYCDataSigned = async ( params : ModifyKYCDataSignedParams ) => {
524
607
assert . isNonZeroETHAddressHex ( 'investor' , params . investor ) ;
525
608
assert . assert ( await this . isCallerAllowed ( params . txData , Perm . Admin ) , 'Caller is not allowed' ) ;
@@ -700,16 +783,18 @@ export default class GeneralTransferManagerWrapper extends ModuleWrapper {
700
783
701
784
/**
702
785
* Returns list of all investors
786
+ * @return investor array
703
787
*/
704
- public getAllInvestors = async ( ) => {
788
+ public getAllInvestors = async ( ) : Promise < string [ ] > => {
705
789
const result = await ( await this . contract ) . getAllInvestors . callAsync ( ) ;
706
790
return result ;
707
791
} ;
708
792
709
793
/**
710
794
* Returns list of investors in a range
795
+ * @return investor array
711
796
*/
712
- public getInvestors = async ( params : GetInvestors ) => {
797
+ public getInvestors = async ( params : GetInvestors ) : Promise < string [ ] > => {
713
798
const result = await ( await this . contract ) . getInvestors . callAsync (
714
799
new BigNumber ( params . fromIndex ) ,
715
800
new BigNumber ( params . toIndex ) ,
@@ -719,8 +804,9 @@ export default class GeneralTransferManagerWrapper extends ModuleWrapper {
719
804
720
805
/**
721
806
* Return the permissions flags that are associated with general transfer manager
807
+ * @return array of Perm type
722
808
*/
723
- public getPermissions = async ( ) => {
809
+ public getPermissions = async ( ) : Promise < Perm [ ] > => {
724
810
const call = await ( await this . contract ) . getPermissions . callAsync ( ) ;
725
811
const result : Perm [ ] = [ ] ;
726
812
for ( let i = 0 ; i < call . length ; i += 1 ) {
@@ -741,7 +827,11 @@ export default class GeneralTransferManagerWrapper extends ModuleWrapper {
741
827
return result ;
742
828
} ;
743
829
744
- public getAddressBytes32 = async ( ) => {
830
+ /**
831
+ * Get Address bytes32 string value
832
+ * @return bytes32 to string representation
833
+ */
834
+ public getAddressBytes32 = async ( ) : Promise < string > => {
745
835
const result = await ( await this . contract ) . getAddressBytes32 . callAsync ( ) ;
746
836
return bytes32ToString ( result ) ;
747
837
} ;
0 commit comments