generated from PolymeshAssociation/typescript-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 11
/
types.ts
936 lines (838 loc) · 25.8 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
import BigNumber from 'bignumber.js';
import {
Account,
Asset,
CheckpointSchedule,
CorporateActionBase,
CustomPermissionGroup,
DefaultPortfolio,
Identity,
KnownPermissionGroup,
MultiSig,
NumberedPortfolio,
Venue,
} from '~/internal';
import {
ActiveTransferRestrictions,
AddCountStatInput,
AssetDocument,
CalendarPeriod,
ClaimCountStatInput,
ClaimCountTransferRestriction,
ClaimPercentageTransferRestriction,
ClaimTarget,
CountTransferRestriction,
InputCaCheckpoint,
InputCondition,
InputCorporateActionTargets,
InputCorporateActionTaxWithholdings,
InputStatClaim,
InputStatType,
InputTargets,
InputTaxWithholding,
InputTrustedClaimIssuer,
OfferingTier,
PercentageTransferRestriction,
PermissionedAccount,
PermissionsLike,
PortfolioLike,
PortfolioMovement,
Requirement,
Scope,
SecurityIdentifier,
Signer,
StatClaimIssuer,
TransactionArray,
TransactionPermissions,
TxGroup,
VenueType,
} from '~/types';
import { StatType } from '~/types/internal';
import { Modify } from '~/types/utils';
export type AddRestrictionParams<T> = Omit<
T extends TransferRestrictionType.Count
? AddCountTransferRestrictionParams
: T extends TransferRestrictionType.Percentage
? AddPercentageTransferRestrictionParams
: T extends TransferRestrictionType.ClaimCount
? AddClaimCountTransferRestrictionParams
: AddClaimPercentageTransferRestrictionParams,
'type'
>;
export type SetRestrictionsParams<T> = Omit<
T extends TransferRestrictionType.Count
? SetCountTransferRestrictionsParams
: T extends TransferRestrictionType.Percentage
? SetPercentageTransferRestrictionsParams
: T extends TransferRestrictionType.ClaimCount
? SetClaimCountTransferRestrictionsParams
: SetClaimPercentageTransferRestrictionsParams,
'type'
>;
export type GetTransferRestrictionReturnType<T> = ActiveTransferRestrictions<
T extends TransferRestrictionType.Count
? CountTransferRestriction
: T extends TransferRestrictionType.Percentage
? PercentageTransferRestriction
: T extends TransferRestrictionType.ClaimCount
? ClaimCountTransferRestriction
: ClaimPercentageTransferRestriction
>;
export type RemoveAssetStatParams = { ticker: string } & (
| RemoveCountStatParams
| RemoveBalanceStatParams
| RemoveScopedCountParams
| RemoveScopedBalanceParams
);
export type AddCountStatParams = AddCountStatInput & {
type: StatType.Count;
};
export type AddPercentageStatParams = {
type: StatType.Balance;
};
export type AddClaimCountStatParams = ClaimCountStatInput & {
type: StatType.ScopedCount;
};
export type AddClaimPercentageStatParams = StatClaimIssuer & {
type: StatType.ScopedBalance;
};
export type AddAssetStatParams = { ticker: string } & (
| AddCountStatParams
| AddPercentageStatParams
| AddClaimCountStatParams
| AddClaimPercentageStatParams
);
export type RemoveCountStatParams = {
type: StatType.Count;
};
export type RemoveBalanceStatParams = {
type: StatType.Balance;
};
export type RemoveScopedCountParams = StatClaimIssuer & {
type: StatType.ScopedCount;
};
export type RemoveScopedBalanceParams = StatClaimIssuer & {
type: StatType.ScopedBalance;
};
export type SetAssetStatParams<T> = Omit<
T extends TransferRestrictionType.Count
? AddCountStatParams
: T extends TransferRestrictionType.Percentage
? AddPercentageStatParams
: T extends TransferRestrictionType.ClaimCount
? AddClaimCountStatParams
: AddClaimPercentageStatParams,
'type'
>;
export enum TransferRestrictionType {
Count = 'Count',
Percentage = 'Percentage',
ClaimCount = 'ClaimCount',
ClaimPercentage = 'ClaimPercentage',
}
export interface TransferRestriction {
type: TransferRestrictionType;
value: BigNumber;
}
interface TransferRestrictionInputBase {
/**
* array of Identities (or DIDs) that are exempted from the Restriction
*/
exemptedIdentities?: (Identity | string)[];
}
export interface CountTransferRestrictionInput extends TransferRestrictionInputBase {
/**
* limit on the amount of different (unique) investors that can hold the Asset at once
*/
count: BigNumber;
}
export interface PercentageTransferRestrictionInput extends TransferRestrictionInputBase {
/**
* maximum percentage (0-100) of the total supply of the Asset that can be held by a single investor at once
*/
percentage: BigNumber;
}
export interface ClaimCountTransferRestrictionInput extends TransferRestrictionInputBase {
min: BigNumber;
max?: BigNumber;
issuer: Identity;
claim: InputStatClaim;
}
export interface ClaimPercentageTransferRestrictionInput extends TransferRestrictionInputBase {
min: BigNumber;
max: BigNumber;
issuer: Identity;
claim: InputStatClaim;
}
export type AddCountTransferRestrictionParams = CountTransferRestrictionInput & {
type: TransferRestrictionType.Count;
};
export type AddPercentageTransferRestrictionParams = PercentageTransferRestrictionInput & {
type: TransferRestrictionType.Percentage;
};
export type AddClaimCountTransferRestrictionParams = ClaimCountTransferRestrictionInput & {
type: TransferRestrictionType.ClaimCount;
};
export type AddClaimPercentageTransferRestrictionParams =
ClaimPercentageTransferRestrictionInput & {
type: TransferRestrictionType.ClaimPercentage;
};
export interface SetCountTransferRestrictionsParams {
/**
* array of Count Transfer Restrictions with their corresponding exemptions (if applicable)
*/
restrictions: CountTransferRestrictionInput[];
type: TransferRestrictionType.Count;
}
export interface SetPercentageTransferRestrictionsParams {
/**
* array of Percentage Transfer Restrictions with their corresponding exemptions (if applicable)
*/
restrictions: PercentageTransferRestrictionInput[];
type: TransferRestrictionType.Percentage;
}
export interface SetClaimCountTransferRestrictionsParams {
restrictions: ClaimCountTransferRestrictionInput[];
type: TransferRestrictionType.ClaimCount;
}
export interface SetClaimPercentageTransferRestrictionsParams {
restrictions: ClaimPercentageTransferRestrictionInput[];
type: TransferRestrictionType.ClaimPercentage;
}
export interface InviteAccountParams {
targetAccount: string | Account;
permissions?: PermissionsLike;
expiry?: Date;
}
export interface ModifySignerPermissionsParams {
/**
* list of secondary Accounts
*/
secondaryAccounts: Modify<PermissionedAccount, { permissions: PermissionsLike }>[];
}
export interface RemoveSecondaryAccountsParams {
accounts: Account[];
}
export interface SubsidizeAccountParams {
/**
* Account to subsidize
*/
beneficiary: string | Account;
/**
* amount of POLYX to be subsidized. This can be increased/decreased later on
*/
allowance: BigNumber;
}
export interface ClaimClassicTickerParams {
/**
* signature generated by signing a message formed by the DID (hex without the leading 0x),
* prefixed by `classic_claim`. Example: if the DID is `0x1230000000000000000000000000000000000000000000000000000000000000`,
* the message would be `classic_claim1230000000000000000000000000000000000000000000000000000000000000`
*/
ethereumSignature: string;
/**
* ticker symbol to claim
*/
ticker: string;
}
export interface CreateAssetParams {
name: string;
/**
* amount of Asset tokens that will be minted on creation (optional, default doesn't mint)
*/
initialSupply?: BigNumber;
/**
* whether a single Asset token can be divided into decimal parts
*/
isDivisible: boolean;
/**
* type of security that the Asset represents (e.g. Equity, Debt, Commodity). Common values are included in the
* {@link types!KnownAssetType} enum, but custom values can be used as well. Custom values must be registered on-chain the first time
* they're used, requiring an additional transaction. They aren't tied to a specific Asset
*/
assetType: string;
/**
* array of domestic or international alphanumeric security identifiers for the Asset (e.g. ISIN, CUSIP, FIGI)
*/
securityIdentifiers?: SecurityIdentifier[];
/**
* (optional) funding round in which the Asset currently is (e.g. Series A, Series B)
*/
fundingRound?: string;
documents?: AssetDocument[];
/**
* whether this asset requires investors to have a Investor Uniqueness Claim in order
* to hold it. More information about Investor Uniqueness and PUIS [here](https://developers.polymesh.live/introduction/identity#polymesh-unique-identity-system-puis)
*/
requireInvestorUniqueness: boolean;
/**
* (optional) type of statistics that should be enabled for the Asset
*
* Enabling statistics allows for TransferRestrictions to be made. For example the SEC requires registration for a company that
* has either more than 2000 investors, or more than 500 non accredited investors. To prevent crossing this limit two restrictions are
* needed, a `Count` of 2000, and a `ScopedCount` of non accredited with a maximum of 500. [source](https://www.sec.gov/info/smallbus/secg/jobs-act-section-12g-small-business-compliance-guide.htm)
*
* These restrictions require a `Count` and `ScopedCount` statistic to be created. Although they an be created after the Asset is made, it is recommended to create statistics
* before the Asset is circulated. Count statistics made after Asset creation need their initial value set, so it is simpler to create them before investors hold the Asset.
* If you do need to create a stat for an Asset after creation, you can use the { @link api/entities/Asset/TransferRestrictions/TransferRestrictionBase!TransferRestrictionBase.enableStat | enableStat } method in
* the appropriate namespace
*/
initialStatistics?: InputStatType[];
}
export interface CreateAssetWithTickerParams extends CreateAssetParams {
ticker: string;
}
export interface ReserveTickerParams {
/**
* ticker symbol to reserve
*/
ticker: string;
extendPeriod?: boolean;
}
export enum ClaimOperation {
Revoke = 'Revoke',
Add = 'Add',
Edit = 'Edit',
}
export interface AddClaimsParams {
/**
* array of claims to be added
*/
claims: ClaimTarget[];
operation: ClaimOperation.Add;
}
export interface EditClaimsParams {
/**
* array of claims to be edited
*/
claims: ClaimTarget[];
operation: ClaimOperation.Edit;
}
export interface RevokeClaimsParams {
/**
* array of claims to be revoked
*/
claims: Omit<ClaimTarget, 'expiry'>[];
operation: ClaimOperation.Revoke;
}
export type ModifyClaimsParams = AddClaimsParams | EditClaimsParams | RevokeClaimsParams;
export interface ScopeClaimProof {
proofScopeIdWellFormed: string;
proofScopeIdCddIdMatch: {
challengeResponses: [string, string];
subtractExpressionsRes: string;
blindedScopeDidHash: string;
};
}
export interface AddInvestorUniquenessClaimParams {
scope: Scope;
cddId: string;
proof: string | ScopeClaimProof;
scopeId: string;
expiry?: Date;
}
export interface RegisterIdentityParams {
targetAccount: string | Account;
secondaryAccounts?: Modify<PermissionedAccount, { permissions: PermissionsLike }>[];
}
export interface TransferPolyxParams {
/**
* Account that will receive the POLYX
*/
to: string | Account;
/**
* amount of POLYX to be transferred
*/
amount: BigNumber;
/**
* identifier string to help differentiate transfers
*/
memo?: string;
}
export interface AddInstructionParams {
/**
* array of Asset movements (amount, from, to, asset)
*/
legs: {
amount: BigNumber;
from: PortfolioLike;
to: PortfolioLike;
asset: string | Asset;
}[];
/**
* date at which the trade was agreed upon (optional, for off chain trades)
*/
tradeDate?: Date;
/**
* date at which the trade was executed (optional, for off chain trades)
*/
valueDate?: Date;
/**
* block at which the Instruction will be executed automatically (optional, the Instruction will be executed when all participants have authorized it if not supplied)
*/
endBlock?: BigNumber;
}
export interface AddInstructionsParams {
/**
* array of Instructions to be added in the Venue
*/
instructions: AddInstructionParams[];
}
export interface AddInstructionWithVenueIdParams extends AddInstructionParams {
venueId: BigNumber;
}
export interface AffirmInstructionParams {
id: BigNumber;
}
export enum InstructionAffirmationOperation {
Affirm = 'Affirm',
Withdraw = 'Withdraw',
Reject = 'Reject',
}
export interface ModifyInstructionAffirmationParams {
id: BigNumber;
operation: InstructionAffirmationOperation;
}
export interface CreateVenueParams {
description: string;
type: VenueType;
}
export interface ControllerTransferParams {
/**
* portfolio (or portfolio ID) from which Assets will be transferred
*/
originPortfolio: PortfolioLike;
/**
* amount of Asset tokens to transfer
*/
amount: BigNumber;
}
export type ModifyAssetParams =
| {
/**
* makes an indivisible Asset divisible
*/
makeDivisible?: true;
name: string;
fundingRound?: string;
identifiers?: SecurityIdentifier[];
}
| {
makeDivisible: true;
name?: string;
fundingRound?: string;
identifiers?: SecurityIdentifier[];
}
| {
makeDivisible?: true;
name?: string;
fundingRound: string;
identifiers?: SecurityIdentifier[];
}
| {
makeDivisible?: true;
name?: string;
fundingRound?: string;
identifiers: SecurityIdentifier[];
};
export interface ModifyPrimaryIssuanceAgentParams {
/**
* Identity to be set as primary issuance agent
*/
target: string | Identity;
/**
* date at which the authorization request to modify the primary issuance agent expires (optional, never expires if a date is not provided)
*/
requestExpiry?: Date;
}
export interface RedeemTokensParams {
amount: BigNumber;
}
export interface TransferAssetOwnershipParams {
target: string | Identity;
/**
* date at which the authorization request for transfer expires (optional)
*/
expiry?: Date;
}
export interface CreateCheckpointScheduleParams {
/**
* The date from which to begin creating snapshots. A null value indicates immediately
*/
start: Date | null;
/**
* The cadence with which to make Checkpoints.
* @note A null value indicates to create only one Checkpoint, regardless of repetitions specified. This can be used to schedule the creation of a Checkpoint in the future
*/
period: CalendarPeriod | null;
/**
* The number of snapshots to take. A null value indicates snapshots should be made indefinitely
*/
repetitions: BigNumber | null;
}
export interface RemoveCheckpointScheduleParams {
/**
* schedule (or ID) of the schedule to be removed
*/
schedule: CheckpointSchedule | BigNumber;
}
export interface AddAssetRequirementParams {
/**
* array of conditions that form the requirement that must be added.
* Conditions within a requirement are *AND* between them. This means that in order
* for a transfer to comply with this requirement, it must fulfill *ALL* conditions
*/
conditions: InputCondition[];
}
export type ModifyComplianceRequirementParams = {
/**
* ID of the Compliance Requirement
*/
id: BigNumber;
/**
* array of conditions to replace the existing array of conditions for the requirement (identified by `id`).
* Conditions within a requirement are *AND* between them. This means that in order
* for a transfer to comply with this requirement, it must fulfill *ALL* conditions
*/
conditions: InputCondition[];
};
export interface RemoveAssetRequirementParams {
requirement: BigNumber | Requirement;
}
export interface SetAssetRequirementsParams {
/**
* array of array of conditions. For a transfer to be successful, it must comply with all the conditions of at least one of the arrays.
* In other words, higher level arrays are *OR* between them, while conditions inside each array are *AND* between them
*/
requirements: InputCondition[][];
}
export interface ModifyAssetTrustedClaimIssuersAddSetParams {
claimIssuers: InputTrustedClaimIssuer[];
}
export interface ModifyAssetTrustedClaimIssuersRemoveParams {
/**
* array of Identities (or DIDs) of the default claim issuers
*/
claimIssuers: (string | Identity)[];
}
export interface RemoveCorporateActionParams {
corporateAction: CorporateActionBase | BigNumber;
}
export interface ModifyCorporateActionsAgentParams {
/**
* Identity to be set as Corporate Actions Agent
*/
target: string | Identity;
/**
* date at which the authorization request to modify the Corporate Actions Agent expires (optional, never expires if a date is not provided)
*/
requestExpiry?: Date;
}
export type ModifyCaDefaultConfigParams =
| {
targets?: InputTargets;
defaultTaxWithholding: BigNumber;
taxWithholdings?: InputTaxWithholding[];
}
| {
targets: InputTargets;
defaultTaxWithholding?: BigNumber;
taxWithholdings?: InputTaxWithholding[];
}
| {
targets?: InputTargets;
defaultTaxWithholding?: BigNumber;
taxWithholdings: InputTaxWithholding[];
};
export interface ConfigureDividendDistributionParams {
/**
* date at which the issuer publicly declared the Dividend Distribution. Optional, defaults to the current date
*/
declarationDate?: Date;
description: string;
/**
* Asset Holder Identities to be included (or excluded) from the Dividend Distribution. Inclusion/exclusion is controlled by the `treatment`
* property. When the value is `Include`, all Asset Holders not present in the array are excluded, and vice-versa. If no value is passed,
* the default value for the Asset is used. If there is no default value, all Asset Holders will be part of the Dividend Distribution
*/
targets?: InputCorporateActionTargets;
/**
* default percentage (0-100) of the Benefits to be held for tax purposes
*/
defaultTaxWithholding?: BigNumber;
/**
* percentage (0-100) of the Benefits to be held for tax purposes from individual Asset Holder Identities.
* This overrides the value of `defaultTaxWithholding`
*/
taxWithholdings?: InputCorporateActionTaxWithholdings;
/**
* checkpoint to be used to calculate Dividends. If a Schedule is passed, the next Checkpoint it creates will be used.
* If a Date is passed, a Checkpoint will be created at that date and used
*/
checkpoint: InputCaCheckpoint;
/**
* portfolio from which the Dividends will be distributed. Optional, defaults to the Dividend Distributions Agent's Default Portfolio
*/
originPortfolio?: NumberedPortfolio | BigNumber;
/**
* ticker of the currency in which Dividends will be distributed
*/
currency: string;
/**
* amount of `currency` to distribute per each share of the Asset that a target holds
*/
perShare: BigNumber;
/**
* maximum amount of `currency` to distribute in total
*/
maxAmount: BigNumber;
/**
* date from which Asset Holders can claim their Dividends
*/
paymentDate: Date;
/**
* optional, defaults to never expiring
*/
expiryDate?: Date;
}
export interface SetAssetDocumentsParams {
/**
* list of documents
*/
documents: AssetDocument[];
}
export interface LaunchOfferingParams {
/**
* portfolio in which the Asset tokens to be sold are stored
*/
offeringPortfolio: PortfolioLike;
/**
* portfolio in which the raised funds will be stored
*/
raisingPortfolio: PortfolioLike;
/**
* ticker symbol of the currency in which the funds are being raised (e.g. 'USD' or 'CAD').
* Other Assets can be used as currency as well
*/
raisingCurrency: string;
/**
* venue through which all offering related trades will be settled
* (optional, defaults to the first `Sto` type Venue owned by the owner of the Offering Portfolio.
* If passed, it must be of type `Sto`)
*/
venue?: Venue;
name: string;
/**
* start date of the Offering (optional, defaults to right now)
*/
start?: Date;
/**
* end date of the Offering (optional, defaults to never)
*/
end?: Date;
/**
* array of sale tiers. Each tier consists of an amount of Assets to be sold at a certain price.
* Tokens in a tier can only be bought when all tokens in previous tiers have been bought
*/
tiers: OfferingTier[];
/**
* minimum amount that can be spent on this offering
*/
minInvestment: BigNumber;
}
export interface CreateGroupParams {
permissions:
| {
transactions: TransactionPermissions;
}
| {
transactionGroups: TxGroup[];
};
}
export interface InviteExternalAgentParams {
target: string | Identity;
permissions:
| KnownPermissionGroup
| CustomPermissionGroup
| {
transactions: TransactionPermissions | null;
}
| {
transactionGroups: TxGroup[];
};
/**
* date at which the authorization request for invitation expires (optional)
*
* @note if expiry date is not set, the invitation will never expire
* @note due to chain limitations, the expiry will be ignored if the passed `permissions` don't correspond to an existing Permission Group
*/
expiry?: Date;
}
export interface RemoveExternalAgentParams {
target: string | Identity;
}
export interface LinkCaDocsParams {
/**
* list of documents
*/
documents: AssetDocument[];
}
export interface ModifyCaCheckpointParams {
checkpoint: InputCaCheckpoint | null;
}
export interface SetGroupPermissionsParams {
permissions:
| {
transactions: TransactionPermissions;
}
| {
transactionGroups: TxGroup[];
};
}
export type ModifyVenueParams =
| {
description?: string;
type: VenueType;
}
| {
description: string;
type?: VenueType;
}
| {
description: string;
type: VenueType;
};
export interface TransferTickerOwnershipParams {
target: string | Identity;
/**
* date at which the authorization request for transfer expires (optional)
*/
expiry?: Date;
}
export enum AllowanceOperation {
Set = 'Set',
Increase = 'Increase',
Decrease = 'Decrease',
}
export interface IncreaseAllowanceParams {
/**
* amount of POLYX to increase the allowance by
*/
allowance: BigNumber;
operation: AllowanceOperation.Increase;
}
export interface DecreaseAllowanceParams {
/**
* amount of POLYX to decrease the allowance by
*/
allowance: BigNumber;
operation: AllowanceOperation.Decrease;
}
export interface SetAllowanceParams {
/**
* amount of POLYX to set the allowance to
*/
allowance: BigNumber;
operation: AllowanceOperation.Set;
}
export type ModifyOfferingTimesParams =
| {
/**
* new start time (optional, will be left the same if not passed)
*/
start?: Date;
/**
* new end time (optional, will be left th same if not passed). A null value means the Offering doesn't end
*/
end: Date | null;
}
| {
start: Date;
end?: Date | null;
}
| { start: Date; end: Date | null };
export interface InvestInOfferingParams {
/**
* portfolio in which the purchased Asset tokens will be stored
*/
purchasePortfolio: PortfolioLike;
/**
* portfolio from which funds will be withdrawn to pay for the Asset tokens
*/
fundingPortfolio: PortfolioLike;
/**
* amount of Asset tokens to purchase
*/
purchaseAmount: BigNumber;
/**
* maximum average price to pay per Asset token (optional)
*/
maxPrice?: BigNumber;
}
export interface RenamePortfolioParams {
name: string;
}
export interface WaivePermissionsParams {
asset: string | Asset;
}
export interface AssetBase {
/**
* Asset over which the Identity will be granted permissions
*/
asset: string | Asset;
}
export interface TransactionsParams extends AssetBase {
/**
* a null value means full permissions
*/
transactions: TransactionPermissions | null;
}
export interface TxGroupParams extends AssetBase {
transactionGroups: TxGroup[];
}
/**
* This procedure can be called with:
* - An Asset's existing Custom Permission Group. The Identity will be assigned as an Agent of that Group for that Asset
* - A Known Permission Group and an Asset. The Identity will be assigned as an Agent of that Group for that Asset
* - A set of Transaction Permissions and an Asset. If there is no Custom Permission Group with those permissions, a Custom Permission Group will be created for that Asset with those permissions, and
* the Identity will be assigned as an Agent of that Group for that Asset. Otherwise, the existing Group will be used
* - An array of {@link types!TxGroup | Transaction Groups} that represent a set of permissions. If there is no Custom Permission Group with those permissions, a Custom Permission Group will be created with those permissions, and
* the Identity will be assigned as an Agent of that Group for that Asset. Otherwise, the existing Group will be used
*/
export interface SetPermissionGroupParams {
group: KnownPermissionGroup | CustomPermissionGroup | TransactionsParams | TxGroupParams;
}
export interface PayDividendsParams {
targets: (string | Identity)[];
}
export interface SetCustodianParams {
targetIdentity: string | Identity;
expiry?: Date;
}
export interface MoveFundsParams {
/**
* portfolio (or portfolio ID) that will receive the funds. Optional, if no value is passed, the funds will be moved to the default Portfolio of this Portfolio's owner
*/
to?: BigNumber | DefaultPortfolio | NumberedPortfolio;
/**
* list of Assets (and the corresponding token amounts) that will be moved
*/
items: PortfolioMovement[];
}
export interface CreateTransactionBatchParams<ReturnValues extends readonly [...unknown[]]> {
transactions: Readonly<TransactionArray<ReturnValues>>;
}
export interface CreateMultiSigParams {
signers: Signer[];
requiredSignatures: BigNumber;
}
export interface ModifyMultiSigParams {
/**
* The MultiSig to be modified
*/
multiSig: MultiSig;
/**
* The signers to set for the MultiSig
*/
signers: Signer[];
}