generated from PolymeshAssociation/typescript-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 11
/
augment-api-tx.ts
6025 lines (6022 loc) · 222 KB
/
augment-api-tx.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
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { Bytes, Compact, Option, Vec, bool, u32, u64 } from '@polkadot/types';
import type { AnyNumber, ITuple } from '@polkadot/types/types';
import type { BabeEquivocationProof } from '@polkadot/types/interfaces/babe';
import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective';
import type { Proposal } from '@polkadot/types/interfaces/democracy';
import type { EcdsaSignature, Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
import type { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
import type { Heartbeat } from '@polkadot/types/interfaces/imOnline';
import type {
AccountId,
AccountIndex,
Balance,
BalanceOf,
BlockNumber,
Call,
ChangesTrieConfiguration,
Hash,
Header,
KeyValue,
LookupSource,
Moment,
Perbill,
Percent,
Weight,
} from '@polkadot/types/interfaces/runtime';
import type { Period, Priority } from '@polkadot/types/interfaces/scheduler';
import type { Keys } from '@polkadot/types/interfaces/session';
import type {
CompactAssignments,
ElectionScore,
ElectionSize,
EraIndex,
RewardDestination,
ValidatorIndex,
ValidatorPrefs,
} from '@polkadot/types/interfaces/staking';
import type { Key } from '@polkadot/types/interfaces/system';
import type {
AGId,
AgentGroup,
AssetIdentifier,
AssetName,
AssetType,
AuthorizationData,
BallotMeta,
BallotTimeRange,
BallotVote,
Beneficiary,
BridgeTx,
CADetails,
CAId,
CAKind,
Claim,
ClaimType,
ClassicTickerImport,
ComplianceRequirement,
Condition,
Document,
DocumentId,
ExtrinsicPermissions,
FundingRoundName,
FundraiserName,
IdentityId,
InvestorUid,
InvestorZKProofData,
ItnRewardStatus,
Leg,
LegacyPermissions,
MaybeBlock,
Memo,
MovePortfolioItem,
OffChainSignature,
Permissions,
PipDescription,
PipId,
PortfolioId,
PortfolioName,
PortfolioNumber,
PosRatio,
PriceTier,
ProtocolOp,
ReceiptDetails,
RecordDateSpec,
ScheduleId,
ScheduleSpec,
Scope,
ScopeClaimProof,
ScopeId,
SecondaryKey,
SecondaryKeyWithAuth,
SettlementType,
Signatory,
SkippedCount,
SlashingSwitch,
SnapshotResult,
TargetIdentities,
Tax,
Ticker,
TickerRegistrationConfig,
TransferManager,
TrustedIssuer,
UniqueCall,
Url,
VenueDetails,
VenueType,
} from 'polymesh-types/polymesh';
import type { ApiTypes, SubmittableExtrinsic } from '@polkadot/api/types';
declare module '@polkadot/api/types/submittable' {
export interface AugmentedSubmittables<ApiType> {
asset: {
/**
* This function is used to accept a token ownership transfer.
* NB: To reject the transfer, call remove auth function in identity module.
*
* # Arguments
* * `origin` It contains the secondary key of the caller (i.e. who signed the transaction to execute this function).
* * `auth_id` Authorization ID of the token ownership transfer authorization.
**/
acceptAssetOwnershipTransfer: AugmentedSubmittable<
(authId: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>,
[u64]
>;
/**
* Accepts a ticker transfer.
*
* Consumes the authorization `auth_id` (see `pallet_identity::consume_auth`).
* NB: To reject the transfer, call remove auth function in identity module.
*
* # Arguments
* * `origin` It contains the secondary key of the caller (i.e. who signed the transaction to execute this function).
* * `auth_id` Authorization ID of ticker transfer authorization.
*
* ## Errors
* - `AuthorizationError::BadType` if `auth_id` is not a valid ticket transfer authorization.
*
**/
acceptTickerTransfer: AugmentedSubmittable<
(authId: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>,
[u64]
>;
/**
* Add documents for a given token. To be called only by the token owner.
*
* # Arguments
* * `origin` Secondary key of the token owner.
* * `ticker` Ticker of the token.
* * `docs` Documents to be attached to `ticker`.
*
* # Permissions
* * Asset
**/
addDocuments: AugmentedSubmittable<
(
docs:
| Vec<Document>
| (
| Document
| { uri?: any; content_hash?: any; name?: any; doc_type?: any; filing_date?: any }
| string
| Uint8Array
)[],
ticker: Ticker | string | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[Vec<Document>, Ticker]
>;
/**
* Claim a systematically reserved Polymath Classic (PMC) `ticker`
* and transfer it to the `origin`'s identity.
*
* To verify that the `origin` is in control of the Ethereum account on the books,
* an `ethereum_signature` containing the `origin`'s DID as the message
* must be provided by that Ethereum account.
*
* # Errors
* - `NoSuchClassicTicker` if this is not a systematically reserved PMC ticker.
* - `TickerAlreadyRegistered` if the ticker was already registered, e.g., by `origin`.
* - `TickerRegistrationExpired` if the ticker's registration has expired.
* - `BadOrigin` if not signed.
* - `InvalidEthereumSignature` if the `ethereum_signature` is not valid.
* - `NotAnOwner` if the ethereum account is not the owner of the PMC ticker.
**/
claimClassicTicker: AugmentedSubmittable<
(
ticker: Ticker | string | Uint8Array,
ethereumSignature: EcdsaSignature | string | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[Ticker, EcdsaSignature]
>;
/**
* Forces a transfer of token from `from_portfolio` to the PIA's default portfolio.
* Only PIA is allowed to execute this.
*
* # Arguments
* * `origin` Must be a PIA for a given ticker.
* * `ticker` Ticker symbol of the asset.
* * `value` Amount of tokens need to force transfer.
* * `from_portfolio` From whom portfolio tokens gets transferred.
**/
controllerTransfer: AugmentedSubmittable<
(
ticker: Ticker | string | Uint8Array,
value: Balance | AnyNumber | Uint8Array,
fromPortfolio: PortfolioId | { did?: any; kind?: any } | string | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[Ticker, Balance, PortfolioId]
>;
/**
* Initializes a new security token, with the initiating account as its owner.
* The total supply will initially be zero. To mint tokens, use `issue`.
*
* # Arguments
* * `origin` - contains the secondary key of the caller (i.e. who signed the transaction to execute this function).
* * `name` - the name of the token.
* * `ticker` - the ticker symbol of the token.
* * `divisible` - a boolean to identify the divisibility status of the token.
* * `asset_type` - the asset type.
* * `identifiers` - a vector of asset identifiers.
* * `funding_round` - name of the funding round.
* * `disable_iu` - whether or not investor uniqueness enforcement should be disabled.
* This cannot be changed after creating the asset.
*
* ## Errors
* - `InvalidAssetIdentifier` if any of `identifiers` are invalid.
* - `MaxLengthOfAssetNameExceeded` if `name`'s length exceeds `T::AssetNameMaxLength`.
* - `FundingRoundNameMaxLengthExceeded` if the name of the funding round is longer that
* `T::FundingRoundNameMaxLength`.
* - `AssetAlreadyCreated` if asset was already created.
* - `TickerTooLong` if `ticker`'s length is greater than `config.max_ticker_length` chain
* parameter.
* - `TickerNotAscii` if `ticker` is not yet registered, and contains non-ascii printable characters (from code 32 to 126) or any character after first occurrence of `\0`.
*
* ## Permissions
* * Portfolio
**/
createAsset: AugmentedSubmittable<
(
name: AssetName | string,
ticker: Ticker | string | Uint8Array,
divisible: bool | boolean | Uint8Array,
assetType:
| AssetType
| { EquityCommon: any }
| { EquityPreferred: any }
| { Commodity: any }
| { FixedIncome: any }
| { REIT: any }
| { Fund: any }
| { RevenueShareAgreement: any }
| { StructuredProduct: any }
| { Derivative: any }
| { Custom: any }
| { StableCoin: any }
| string
| Uint8Array,
identifiers:
| Vec<AssetIdentifier>
| (
| AssetIdentifier
| { CUSIP: any }
| { CINS: any }
| { ISIN: any }
| { LEI: any }
| string
| Uint8Array
)[],
fundingRound: Option<FundingRoundName> | null | object | string | Uint8Array,
disableIu: bool | boolean | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[AssetName, Ticker, bool, AssetType, Vec<AssetIdentifier>, Option<FundingRoundName>, bool]
>;
/**
* Freezes transfers and minting of a given token.
*
* # Arguments
* * `origin` - the secondary key of the sender.
* * `ticker` - the ticker of the token.
*
* ## Errors
* - `AlreadyFrozen` if `ticker` is already frozen.
*
* # Permissions
* * Asset
**/
freeze: AugmentedSubmittable<
(ticker: Ticker | string | Uint8Array) => SubmittableExtrinsic<ApiType>,
[Ticker]
>;
/**
* Issue, or mint, new tokens to the caller,
* which must be an authorized agent, e.g., a primary issuance agent.
*
* # Arguments
* * `origin` must be the secondary key of token owner.
* * `ticker` of the token.
* * `amount` of tokens that get issued.
*
* # Permissions
* * Asset
* * Portfolio
**/
issue: AugmentedSubmittable<
(
ticker: Ticker | string | Uint8Array,
amount: Balance | AnyNumber | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[Ticker, Balance]
>;
/**
* Makes an indivisible token divisible. Only called by the token owner.
*
* # Arguments
* * `origin` Secondary key of the token owner.
* * `ticker` Ticker of the token.
*
* ## Errors
* - `AssetAlreadyDivisible` if `ticker` is already divisible.
*
* # Permissions
* * Asset
**/
makeDivisible: AugmentedSubmittable<
(ticker: Ticker | string | Uint8Array) => SubmittableExtrinsic<ApiType>,
[Ticker]
>;
/**
* Redeems existing tokens by reducing the balance of the PIA's default portfolio and the total supply of the token
*
* # Arguments
* * `origin` Secondary key of token owner.
* * `ticker` Ticker of the token.
* * `value` Amount of tokens to redeem.
*
* # Errors
* - `Unauthorized` If called by someone other than the token owner or the PIA
* - `InvalidGranularity` If the amount is not divisible by 10^6 for non-divisible tokens
* - `InsufficientPortfolioBalance` If the PIA's default portfolio doesn't have enough free balance
*
* # Permissions
* * Asset
* * Portfolio
**/
redeem: AugmentedSubmittable<
(
ticker: Ticker | string | Uint8Array,
value: Balance | AnyNumber | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[Ticker, Balance]
>;
/**
* Registers a custom asset type.
*
* The provided `ty` will be bound to an ID in storage.
* The ID can then be used in `AssetType::Custom`.
* Should the `ty` already exist in storage, no second ID is assigned to it.
*
* # Arguments
* * `origin` who called the extrinsic.
* * `ty` contains the string representation of the asset type.
**/
registerCustomAssetType: AugmentedSubmittable<
(ty: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>,
[Bytes]
>;
/**
* Registers a new ticker or extends validity of an existing ticker.
* NB: Ticker validity does not get carry forward when renewing ticker.
*
* # Arguments
* * `origin` It contains the secondary key of the caller (i.e. who signed the transaction to execute this function).
* * `ticker` ticker to register.
*
* # Permissions
* * Asset
**/
registerTicker: AugmentedSubmittable<
(ticker: Ticker | string | Uint8Array) => SubmittableExtrinsic<ApiType>,
[Ticker]
>;
/**
* Remove documents for a given token. To be called only by the token owner.
*
* # Arguments
* * `origin` Secondary key of the token owner.
* * `ticker` Ticker of the token.
* * `ids` Documents ids to be removed from `ticker`.
*
* # Permissions
* * Asset
**/
removeDocuments: AugmentedSubmittable<
(
ids: Vec<DocumentId> | (DocumentId | AnyNumber | Uint8Array)[],
ticker: Ticker | string | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[Vec<DocumentId>, Ticker]
>;
/**
* Renames a given token.
*
* # Arguments
* * `origin` - the secondary key of the sender.
* * `ticker` - the ticker of the token.
* * `name` - the new name of the token.
*
* ## Errors
* - `MaxLengthOfAssetNameExceeded` if length of `name` is greater than
* `T::AssetNameMaxLength`.
*
* # Permissions
* * Asset
**/
renameAsset: AugmentedSubmittable<
(
ticker: Ticker | string | Uint8Array,
name: AssetName | string
) => SubmittableExtrinsic<ApiType>,
[Ticker, AssetName]
>;
/**
* Reserve a Polymath Classic (PMC) ticker.
* Must be called by root, and assigns the ticker to a systematic DID.
*
* # Arguments
* * `origin` which must be root.
* * `classic_ticker_import` specification for the PMC ticker.
* * `contract_did` to reserve the ticker to if `classic_ticker_import.is_contract` holds.
* * `config` to use for expiry and ticker length.
*
* # Errors
* * `AssetAlreadyCreated` if `classic_ticker_import.ticker` was created as an asset.
* * `TickerTooLong` if the `config` considers the `classic_ticker_import.ticker` too long.
* * `TickerAlreadyRegistered` if `classic_ticker_import.ticker` was already registered.
**/
reserveClassicTicker: AugmentedSubmittable<
(
classicTickerImport:
| ClassicTickerImport
| { eth_owner?: any; ticker?: any; is_contract?: any; is_created?: any }
| string
| Uint8Array,
contractDid: IdentityId | string | Uint8Array,
config:
| TickerRegistrationConfig
| { max_ticker_length?: any; registration_length?: any }
| string
| Uint8Array
) => SubmittableExtrinsic<ApiType>,
[ClassicTickerImport, IdentityId, TickerRegistrationConfig]
>;
/**
* Sets the name of the current funding round.
*
* # Arguments
* * `origin` - the secondary key of the token owner DID.
* * `ticker` - the ticker of the token.
* * `name` - the desired name of the current funding round.
*
* ## Errors
* - `FundingRoundNameMaxLengthExceeded` if length of `name` is greater than
* `T::FundingRoundNameMaxLength`.
*
* # Permissions
* * Asset
**/
setFundingRound: AugmentedSubmittable<
(
ticker: Ticker | string | Uint8Array,
name: FundingRoundName | string
) => SubmittableExtrinsic<ApiType>,
[Ticker, FundingRoundName]
>;
/**
* Unfreezes transfers and minting of a given token.
*
* # Arguments
* * `origin` - the secondary key of the sender.
* * `ticker` - the ticker of the frozen token.
*
* ## Errors
* - `NotFrozen` if `ticker` is not frozen yet.
*
* # Permissions
* * Asset
**/
unfreeze: AugmentedSubmittable<
(ticker: Ticker | string | Uint8Array) => SubmittableExtrinsic<ApiType>,
[Ticker]
>;
/**
* Updates the asset identifiers. Can only be called by the token owner.
*
* # Arguments
* * `origin` - the secondary key of the token owner.
* * `ticker` - the ticker of the token.
* * `identifiers` - the asset identifiers to be updated in the form of a vector of pairs
* of `IdentifierType` and `AssetIdentifier` value.
*
* ## Errors
* - `InvalidAssetIdentifier` if `identifiers` contains any invalid identifier.
*
* # Permissions
* * Asset
**/
updateIdentifiers: AugmentedSubmittable<
(
ticker: Ticker | string | Uint8Array,
identifiers:
| Vec<AssetIdentifier>
| (
| AssetIdentifier
| { CUSIP: any }
| { CINS: any }
| { ISIN: any }
| { LEI: any }
| string
| Uint8Array
)[]
) => SubmittableExtrinsic<ApiType>,
[Ticker, Vec<AssetIdentifier>]
>;
};
authorship: {
/**
* Provide a set of uncles.
**/
setUncles: AugmentedSubmittable<
(
newUncles:
| Vec<Header>
| (
| Header
| {
parentHash?: any;
number?: any;
stateRoot?: any;
extrinsicsRoot?: any;
digest?: any;
}
| string
| Uint8Array
)[]
) => SubmittableExtrinsic<ApiType>,
[Vec<Header>]
>;
};
babe: {
/**
* Report authority equivocation/misbehavior. This method will verify
* the equivocation proof and validate the given key ownership proof
* against the extracted offender. If both are valid, the offence will
* be reported.
**/
reportEquivocation: AugmentedSubmittable<
(
equivocationProof:
| BabeEquivocationProof
| { offender?: any; slotNumber?: any; firstHeader?: any; secondHeader?: any }
| string
| Uint8Array,
keyOwnerProof:
| KeyOwnerProof
| { session?: any; trieNodes?: any; validatorCount?: any }
| string
| Uint8Array
) => SubmittableExtrinsic<ApiType>,
[BabeEquivocationProof, KeyOwnerProof]
>;
/**
* Report authority equivocation/misbehavior. This method will verify
* the equivocation proof and validate the given key ownership proof
* against the extracted offender. If both are valid, the offence will
* be reported.
* This extrinsic must be called unsigned and it is expected that only
* block authors will call it (validated in `ValidateUnsigned`), as such
* if the block author is defined it will be defined as the equivocation
* reporter.
**/
reportEquivocationUnsigned: AugmentedSubmittable<
(
equivocationProof:
| BabeEquivocationProof
| { offender?: any; slotNumber?: any; firstHeader?: any; secondHeader?: any }
| string
| Uint8Array,
keyOwnerProof:
| KeyOwnerProof
| { session?: any; trieNodes?: any; validatorCount?: any }
| string
| Uint8Array
) => SubmittableExtrinsic<ApiType>,
[BabeEquivocationProof, KeyOwnerProof]
>;
};
balances: {
/**
* Burns the given amount of tokens from the caller's free, unlocked balance.
**/
burnAccountBalance: AugmentedSubmittable<
(amount: Balance | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>,
[Balance]
>;
/**
* Move some POLYX from balance of self to balance of BRR.
**/
depositBlockRewardReserveBalance: AugmentedSubmittable<
(value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>,
[Compact<Balance>]
>;
/**
* Exactly as `transfer`, except the origin must be root and the source account may be
* specified.
*
* # <weight>
* - Same as transfer, but additional read and write because the source account is
* not assumed to be in the overlay.
* # </weight>
**/
forceTransfer: AugmentedSubmittable<
(
source:
| LookupSource
| { Id: any }
| { Index: any }
| { Raw: any }
| { Address32: any }
| { Address20: any }
| string
| Uint8Array,
dest:
| LookupSource
| { Id: any }
| { Index: any }
| { Raw: any }
| { Address32: any }
| { Address20: any }
| string
| Uint8Array,
value: Compact<Balance> | AnyNumber | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[LookupSource, LookupSource, Compact<Balance>]
>;
/**
* Set the balances of a given account.
*
* This will alter `FreeBalance` and `ReservedBalance` in storage. it will
* also decrease the total issuance of the system (`TotalIssuance`).
*
* The dispatch origin for this call is `root`.
**/
setBalance: AugmentedSubmittable<
(
who:
| LookupSource
| { Id: any }
| { Index: any }
| { Raw: any }
| { Address32: any }
| { Address20: any }
| string
| Uint8Array,
newFree: Compact<Balance> | AnyNumber | Uint8Array,
newReserved: Compact<Balance> | AnyNumber | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[LookupSource, Compact<Balance>, Compact<Balance>]
>;
/**
* Transfer some liquid free balance to another account.
*
* `transfer` will set the `FreeBalance` of the sender and receiver.
* It will decrease the total issuance of the system by the `TransferFee`.
*
* The dispatch origin for this call must be `Signed` by the transactor.
*
* # <weight>
* - Dependent on arguments but not critical, given proper implementations for
* input config types. See related functions below.
* - It contains a limited number of reads and writes internally and no complex computation.
*
* Related functions:
*
* - `ensure_can_withdraw` is always called internally but has a bounded complexity.
* - Transferring balances to accounts that did not exist before will cause
* `T::OnNewAccount::on_new_account` to be called.
* ---------------------------------
* - Base Weight: 73.64 µs, worst case scenario (account created, account removed)
* - DB Weight: 1 Read and 1 Write to destination account.
* - Origin account is already in memory, so no DB operations for them.
* # </weight>
**/
transfer: AugmentedSubmittable<
(
dest:
| LookupSource
| { Id: any }
| { Index: any }
| { Raw: any }
| { Address32: any }
| { Address20: any }
| string
| Uint8Array,
value: Compact<Balance> | AnyNumber | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[LookupSource, Compact<Balance>]
>;
/**
* Transfer the native currency with the help of identifier string
* this functionality can help to differentiate the transfers.
*
* # <weight>
* - Base Weight: 73.64 µs, worst case scenario (account created, account removed)
* - DB Weight: 1 Read and 1 Write to destination account.
* - Origin account is already in memory, so no DB operations for them.
* # </weight>
**/
transferWithMemo: AugmentedSubmittable<
(
dest:
| LookupSource
| { Id: any }
| { Index: any }
| { Raw: any }
| { Address32: any }
| { Address20: any }
| string
| Uint8Array,
value: Compact<Balance> | AnyNumber | Uint8Array,
memo: Option<Memo> | null | object | string | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[LookupSource, Compact<Balance>, Option<Memo>]
>;
};
bridge: {
/**
* Add a freeze admin.
*
* ## Errors
* - `BadAdmin` if `origin` is not `Self::admin()` account.
**/
addFreezeAdmin: AugmentedSubmittable<
(freezeAdmin: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>,
[AccountId]
>;
/**
* Proposes a vector of bridge transactions. The vector is processed until the first
* proposal which causes an error, in which case the error is returned and the rest of
* proposals are not processed.
*
* ## Errors
* - `ControllerNotSet` if `Controllers` was not set.
*
* # Weight
* `500_000_000 + 7_000_000 * bridge_txs.len()`
**/
batchProposeBridgeTx: AugmentedSubmittable<
(
bridgeTxs:
| Vec<BridgeTx>
| (
| BridgeTx
| { nonce?: any; recipient?: any; amount?: any; tx_hash?: any }
| string
| Uint8Array
)[]
) => SubmittableExtrinsic<ApiType>,
[Vec<BridgeTx>]
>;
/**
* Changes the bridge admin key.
*
* ## Errors
* - `BadAdmin` if `origin` is not `Self::admin()` account.
**/
changeAdmin: AugmentedSubmittable<
(admin: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>,
[AccountId]
>;
/**
* Changes the bridge limit exempted list.
*
* ## Errors
* - `BadAdmin` if `origin` is not `Self::admin()` account.
**/
changeBridgeExempted: AugmentedSubmittable<
(
exempted:
| Vec<ITuple<[IdentityId, bool]>>
| [IdentityId | string | Uint8Array, bool | boolean | Uint8Array][]
) => SubmittableExtrinsic<ApiType>,
[Vec<ITuple<[IdentityId, bool]>>]
>;
/**
* Changes the bridge limits.
*
* ## Errors
* - `BadAdmin` if `origin` is not `Self::admin()` account.
* - `DivisionByZero` if `duration` is zero.
**/
changeBridgeLimit: AugmentedSubmittable<
(
amount: Balance | AnyNumber | Uint8Array,
duration: BlockNumber | AnyNumber | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[Balance, BlockNumber]
>;
/**
* Changes the controller account as admin.
*
* ## Errors
* - `BadAdmin` if `origin` is not `Self::admin()` account.
**/
changeController: AugmentedSubmittable<
(controller: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>,
[AccountId]
>;
/**
* Changes the timelock period.
*
* ## Errors
* - `BadAdmin` if `origin` is not `Self::admin()` account.
**/
changeTimelock: AugmentedSubmittable<
(timelock: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>,
[BlockNumber]
>;
/**
* Forces handling a transaction by bypassing the bridge limit and timelock.
*
* ## Errors
* - `BadAdmin` if `origin` is not `Self::admin()` account.
* - `NoValidCdd` if `bridge_tx.recipient` does not have a valid CDD claim.
**/
forceHandleBridgeTx: AugmentedSubmittable<
(
bridgeTx:
| BridgeTx
| { nonce?: any; recipient?: any; amount?: any; tx_hash?: any }
| string
| Uint8Array
) => SubmittableExtrinsic<ApiType>,
[BridgeTx]
>;
/**
* Freezes transaction handling in the bridge module if it is not already frozen. When the
* bridge is frozen, attempted transactions get postponed instead of getting handled.
*
* ## Errors
* - `BadAdmin` if `origin` is not `Self::admin()` account.
**/
freeze: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
* Freezes given bridge transactions.
* If any bridge txn is already handled then this function will just ignore it and process next one.
*
* ## Errors
* - `BadAdmin` if `origin` is not `Self::admin()` account.
*
* # Weight
* `400_000_000 + 2_000_000 * bridge_txs.len()`
**/
freezeTxs: AugmentedSubmittable<
(
bridgeTxs:
| Vec<BridgeTx>
| (
| BridgeTx
| { nonce?: any; recipient?: any; amount?: any; tx_hash?: any }
| string
| Uint8Array
)[]
) => SubmittableExtrinsic<ApiType>,
[Vec<BridgeTx>]
>;
/**
* Handles an approved bridge transaction proposal.
*
* ## Errors
* - `BadCaller` if `origin` is not `Self::controller` or `Self::admin`.
* - `TimelockedTx` if the transaction status is `Timelocked`.
* - `ProposalAlreadyHandled` if the transaction status is `Handled`.
**/
handleBridgeTx: AugmentedSubmittable<
(
bridgeTx:
| BridgeTx
| { nonce?: any; recipient?: any; amount?: any; tx_hash?: any }
| string
| Uint8Array
) => SubmittableExtrinsic<ApiType>,
[BridgeTx]
>;
/**
* Root callable extrinsic, used as an internal call to handle a scheduled timelocked bridge transaction.
*
* # Errors
* - `BadOrigin` if `origin` is not root.
* - `ProposalAlreadyHandled` if transaction status is `Handled`.
* - `FrozenTx` if transaction status is `Frozen`.
**/
handleScheduledBridgeTx: AugmentedSubmittable<
(
bridgeTx:
| BridgeTx
| { nonce?: any; recipient?: any; amount?: any; tx_hash?: any }
| string
| Uint8Array
) => SubmittableExtrinsic<ApiType>,
[BridgeTx]
>;
/**
* Proposes a bridge transaction, which amounts to making a multisig proposal for the
* bridge transaction if the transaction is new or approving an existing proposal if the
* transaction has already been proposed.
*
* ## Errors
* - `ControllerNotSet` if `Controllers` was not set.
**/
proposeBridgeTx: AugmentedSubmittable<
(
bridgeTx:
| BridgeTx
| { nonce?: any; recipient?: any; amount?: any; tx_hash?: any }
| string
| Uint8Array
) => SubmittableExtrinsic<ApiType>,
[BridgeTx]
>;
/**
* Remove a freeze admin.
*
* ## Errors
* - `BadAdmin` if `origin` is not `Self::admin()` account.
**/
removeFreezeAdmin: AugmentedSubmittable<
(freezeAdmin: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>,
[AccountId]
>;
/**
* Unfreezes transaction handling in the bridge module if it is frozen.
*
* ## Errors
* - `BadAdmin` if `origin` is not `Self::admin()` account.
**/
unfreeze: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
* Unfreezes given bridge transactions.
* If any bridge txn is already handled then this function will just ignore it and process next one.
*
* ## Errors
* - `BadAdmin` if `origin` is not `Self::admin()` account.
*
* # Weight
* `400_000_000 + 7_000_000 * bridge_txs.len()`
**/
unfreezeTxs: AugmentedSubmittable<
(
bridgeTxs:
| Vec<BridgeTx>
| (
| BridgeTx
| { nonce?: any; recipient?: any; amount?: any; tx_hash?: any }
| string
| Uint8Array
)[]
) => SubmittableExtrinsic<ApiType>,
[Vec<BridgeTx>]
>;
};
capitalDistribution: {
/**
* Claim a benefit of the capital distribution attached to `ca_id`.
*
* Taxes are withheld as specified by the CA.
* Post-tax earnings are then transferred to the default portfolio of the `origin`'s DID.
*
* All benefits are rounded by truncation, down to first integer below.
* Moreover, before post-tax earnings, in indivisible currencies are transferred,
* they are rounded down to a whole unit.
*
* ## Arguments
* - `origin` which must be a holder of for a CAA of `ca_id`.
* - `ca_id` identifies the CA to start a capital distribution for.
*
* # Errors
* - `HolderAlreadyPaid` if `origin`'s DID has already received its benefit.
* - `NoSuchDistribution` if there's no capital distribution for `ca_id`.
* - `CannotClaimBeforeStart` if `now < payment_at`.
* - `CannotClaimAfterExpiry` if `now > expiry_at.unwrap()`.
* - `NoSuchCA` if `ca_id` does not identify an existing CA.
* - `NotTargetedByCA` if the CA does not target `origin`'s DID.
* - `BalanceAmountProductOverflowed` if `ba = balance * amount` would overflow.
* - `BalanceAmountProductSupplyDivisionFailed` if `ba * supply` would overflow.
* - Other errors can occur if the compliance manager rejects the transfer.
**/
claim: AugmentedSubmittable<
(
caId: CAId | { ticker?: any; local_id?: any } | string | Uint8Array