@dedot/chaintypes 0.52.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/aleph/query.d.ts CHANGED
@@ -21,6 +21,7 @@ import type {
21
21
  FrameSupportDispatchPerDispatchClass,
22
22
  FrameSystemEventRecord,
23
23
  FrameSystemLastRuntimeUpgradeInfo,
24
+ FrameSystemCodeUpgradeAuthorization,
24
25
  PalletSchedulerScheduled,
25
26
  SpConsensusAuraSr25519AppSr25519Public,
26
27
  SpConsensusSlotsSlot,
@@ -28,20 +29,22 @@ import type {
28
29
  PalletBalancesBalanceLock,
29
30
  PalletBalancesReserveData,
30
31
  PalletBalancesIdAmount,
31
- PalletBalancesIdAmount002,
32
+ PalletBalancesIdAmountRuntimeFreezeReason,
32
33
  PalletTransactionPaymentReleases,
33
34
  PalletStakingStakingLedger,
34
35
  PalletStakingRewardDestination,
35
36
  PalletStakingValidatorPrefs,
36
37
  PalletStakingNominations,
37
38
  PalletStakingActiveEraInfo,
38
- PalletStakingExposure,
39
+ SpStakingExposure,
40
+ SpStakingPagedExposureMetadata,
41
+ SpStakingExposurePage,
39
42
  PalletStakingEraRewardPoints,
40
43
  PalletStakingForcing,
41
44
  PalletStakingUnappliedSlash,
42
45
  PalletStakingSlashingSlashingSpans,
43
46
  PalletStakingSlashingSpanRecord,
44
- AlephRuntimeSessionKeys,
47
+ PrimitivesAlephNodeSessionKeys,
45
48
  SpCoreCryptoKeyTypeId,
46
49
  PrimitivesAppPublic,
47
50
  PrimitivesVersionChange,
@@ -49,6 +52,7 @@ import type {
49
52
  PrimitivesEraValidators,
50
53
  PrimitivesElectionOpenness,
51
54
  PalletTreasuryProposal,
55
+ PalletTreasurySpendStatus,
52
56
  PalletVestingVestingInfo,
53
57
  PalletVestingReleases,
54
58
  PalletMultisigMultisig,
@@ -62,6 +66,7 @@ import type {
62
66
  PalletNominationPoolsClaimPermission,
63
67
  PalletIdentityRegistration,
64
68
  PalletIdentityRegistrarInfo,
69
+ PalletIdentityAuthorityProperties,
65
70
  PalletCommitteeManagementValidatorTotalRewards,
66
71
  PrimitivesBanConfig,
67
72
  PrimitivesBanInfo,
@@ -207,6 +212,13 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
207
212
  **/
208
213
  executionPhase: GenericStorageQuery<Rv, () => Phase | undefined>;
209
214
 
215
+ /**
216
+ * `Some` if a code upgrade has been authorized.
217
+ *
218
+ * @param {Callback<FrameSystemCodeUpgradeAuthorization | undefined> =} callback
219
+ **/
220
+ authorizedUpgrade: GenericStorageQuery<Rv, () => FrameSystemCodeUpgradeAuthorization | undefined>;
221
+
210
222
  /**
211
223
  * Generic pallet storage query
212
224
  **/
@@ -393,9 +405,13 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
393
405
  * Freeze locks on account balances.
394
406
  *
395
407
  * @param {AccountId32Like} arg
396
- * @param {Callback<Array<PalletBalancesIdAmount002>> =} callback
408
+ * @param {Callback<Array<PalletBalancesIdAmountRuntimeFreezeReason>> =} callback
397
409
  **/
398
- freezes: GenericStorageQuery<Rv, (arg: AccountId32Like) => Array<PalletBalancesIdAmount002>, AccountId32>;
410
+ freezes: GenericStorageQuery<
411
+ Rv,
412
+ (arg: AccountId32Like) => Array<PalletBalancesIdAmountRuntimeFreezeReason>,
413
+ AccountId32
414
+ >;
399
415
 
400
416
  /**
401
417
  * Generic pallet storage query
@@ -509,6 +525,9 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
509
525
  /**
510
526
  * Map from all (unlocked) "controller" accounts to the info regarding the staking.
511
527
  *
528
+ * Note: All the reads and mutations to this storage *MUST* be done through the methods exposed
529
+ * by [`StakingLedger`] to ensure data and lock consistency.
530
+ *
512
531
  * @param {AccountId32Like} arg
513
532
  * @param {Callback<PalletStakingStakingLedger | undefined> =} callback
514
533
  **/
@@ -613,7 +632,7 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
613
632
  activeEra: GenericStorageQuery<Rv, () => PalletStakingActiveEraInfo | undefined>;
614
633
 
615
634
  /**
616
- * The session index at which the era start for the last `HISTORY_DEPTH` eras.
635
+ * The session index at which the era start for the last [`Config::HistoryDepth`] eras.
617
636
  *
618
637
  * Note: This tracks the starting session (i.e. session index when era start being active)
619
638
  * for the eras in `[CurrentEra - HISTORY_DEPTH, CurrentEra]`.
@@ -628,46 +647,102 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
628
647
  *
629
648
  * This is keyed first by the era index to allow bulk deletion and then the stash account.
630
649
  *
631
- * Is it removed after `HISTORY_DEPTH` eras.
650
+ * Is it removed after [`Config::HistoryDepth`] eras.
632
651
  * If stakers hasn't been set or has been removed then empty exposure is returned.
633
652
  *
653
+ * Note: Deprecated since v14. Use `EraInfo` instead to work with exposures.
654
+ *
655
+ * @param {[number, AccountId32Like]} arg
656
+ * @param {Callback<SpStakingExposure> =} callback
657
+ **/
658
+ erasStakers: GenericStorageQuery<Rv, (arg: [number, AccountId32Like]) => SpStakingExposure, [number, AccountId32]>;
659
+
660
+ /**
661
+ * Summary of validator exposure at a given era.
662
+ *
663
+ * This contains the total stake in support of the validator and their own stake. In addition,
664
+ * it can also be used to get the number of nominators backing this validator and the number of
665
+ * exposure pages they are divided into. The page count is useful to determine the number of
666
+ * pages of rewards that needs to be claimed.
667
+ *
668
+ * This is keyed first by the era index to allow bulk deletion and then the stash account.
669
+ * Should only be accessed through `EraInfo`.
670
+ *
671
+ * Is it removed after [`Config::HistoryDepth`] eras.
672
+ * If stakers hasn't been set or has been removed then empty overview is returned.
673
+ *
634
674
  * @param {[number, AccountId32Like]} arg
635
- * @param {Callback<PalletStakingExposure> =} callback
675
+ * @param {Callback<SpStakingPagedExposureMetadata | undefined> =} callback
636
676
  **/
637
- erasStakers: GenericStorageQuery<
677
+ erasStakersOverview: GenericStorageQuery<
638
678
  Rv,
639
- (arg: [number, AccountId32Like]) => PalletStakingExposure,
679
+ (arg: [number, AccountId32Like]) => SpStakingPagedExposureMetadata | undefined,
640
680
  [number, AccountId32]
641
681
  >;
642
682
 
643
683
  /**
644
684
  * Clipped Exposure of validator at era.
645
685
  *
686
+ * Note: This is deprecated, should be used as read-only and will be removed in the future.
687
+ * New `Exposure`s are stored in a paged manner in `ErasStakersPaged` instead.
688
+ *
646
689
  * This is similar to [`ErasStakers`] but number of nominators exposed is reduced to the
647
- * `T::MaxNominatorRewardedPerValidator` biggest stakers.
690
+ * `T::MaxExposurePageSize` biggest stakers.
648
691
  * (Note: the field `total` and `own` of the exposure remains unchanged).
649
692
  * This is used to limit the i/o cost for the nominator payout.
650
693
  *
651
694
  * This is keyed fist by the era index to allow bulk deletion and then the stash account.
652
695
  *
653
- * Is it removed after `HISTORY_DEPTH` eras.
696
+ * It is removed after [`Config::HistoryDepth`] eras.
654
697
  * If stakers hasn't been set or has been removed then empty exposure is returned.
655
698
  *
699
+ * Note: Deprecated since v14. Use `EraInfo` instead to work with exposures.
700
+ *
656
701
  * @param {[number, AccountId32Like]} arg
657
- * @param {Callback<PalletStakingExposure> =} callback
702
+ * @param {Callback<SpStakingExposure> =} callback
658
703
  **/
659
704
  erasStakersClipped: GenericStorageQuery<
660
705
  Rv,
661
- (arg: [number, AccountId32Like]) => PalletStakingExposure,
706
+ (arg: [number, AccountId32Like]) => SpStakingExposure,
662
707
  [number, AccountId32]
663
708
  >;
664
709
 
710
+ /**
711
+ * Paginated exposure of a validator at given era.
712
+ *
713
+ * This is keyed first by the era index to allow bulk deletion, then stash account and finally
714
+ * the page. Should only be accessed through `EraInfo`.
715
+ *
716
+ * This is cleared after [`Config::HistoryDepth`] eras.
717
+ *
718
+ * @param {[number, AccountId32Like, number]} arg
719
+ * @param {Callback<SpStakingExposurePage | undefined> =} callback
720
+ **/
721
+ erasStakersPaged: GenericStorageQuery<
722
+ Rv,
723
+ (arg: [number, AccountId32Like, number]) => SpStakingExposurePage | undefined,
724
+ [number, AccountId32, number]
725
+ >;
726
+
727
+ /**
728
+ * History of claimed paged rewards by era and validator.
729
+ *
730
+ * This is keyed by era and validator stash which maps to the set of page indexes which have
731
+ * been claimed.
732
+ *
733
+ * It is removed after [`Config::HistoryDepth`] eras.
734
+ *
735
+ * @param {[number, AccountId32Like]} arg
736
+ * @param {Callback<Array<number>> =} callback
737
+ **/
738
+ claimedRewards: GenericStorageQuery<Rv, (arg: [number, AccountId32Like]) => Array<number>, [number, AccountId32]>;
739
+
665
740
  /**
666
741
  * Similar to `ErasStakers`, this holds the preferences of validators.
667
742
  *
668
743
  * This is keyed first by the era index to allow bulk deletion and then the stash account.
669
744
  *
670
- * Is it removed after `HISTORY_DEPTH` eras.
745
+ * Is it removed after [`Config::HistoryDepth`] eras.
671
746
  *
672
747
  * @param {[number, AccountId32Like]} arg
673
748
  * @param {Callback<PalletStakingValidatorPrefs> =} callback
@@ -679,7 +754,7 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
679
754
  >;
680
755
 
681
756
  /**
682
- * The total validator era payout for the last `HISTORY_DEPTH` eras.
757
+ * The total validator era payout for the last [`Config::HistoryDepth`] eras.
683
758
  *
684
759
  * Eras that haven't finished yet or has been removed doesn't have reward.
685
760
  *
@@ -689,7 +764,7 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
689
764
  erasValidatorReward: GenericStorageQuery<Rv, (arg: number) => bigint | undefined, number>;
690
765
 
691
766
  /**
692
- * Rewards for the last `HISTORY_DEPTH` eras.
767
+ * Rewards for the last [`Config::HistoryDepth`] eras.
693
768
  * If reward hasn't been set or has been removed then 0 reward is returned.
694
769
  *
695
770
  * @param {number} arg
@@ -698,7 +773,7 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
698
773
  erasRewardPoints: GenericStorageQuery<Rv, (arg: number) => PalletStakingEraRewardPoints, number>;
699
774
 
700
775
  /**
701
- * The total amount staked for the last `HISTORY_DEPTH` eras.
776
+ * The total amount staked for the last [`Config::HistoryDepth`] eras.
702
777
  * If total hasn't been set or has been removed then 0 stake is returned.
703
778
  *
704
779
  * @param {number} arg
@@ -890,9 +965,9 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
890
965
  * The queued keys for the next session. When the next session begins, these keys
891
966
  * will be used to determine the validator's session keys.
892
967
  *
893
- * @param {Callback<Array<[AccountId32, AlephRuntimeSessionKeys]>> =} callback
968
+ * @param {Callback<Array<[AccountId32, PrimitivesAlephNodeSessionKeys]>> =} callback
894
969
  **/
895
- queuedKeys: GenericStorageQuery<Rv, () => Array<[AccountId32, AlephRuntimeSessionKeys]>>;
970
+ queuedKeys: GenericStorageQuery<Rv, () => Array<[AccountId32, PrimitivesAlephNodeSessionKeys]>>;
896
971
 
897
972
  /**
898
973
  * Indices of disabled validators.
@@ -909,9 +984,13 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
909
984
  * The next session keys for a validator.
910
985
  *
911
986
  * @param {AccountId32Like} arg
912
- * @param {Callback<AlephRuntimeSessionKeys | undefined> =} callback
987
+ * @param {Callback<PrimitivesAlephNodeSessionKeys | undefined> =} callback
913
988
  **/
914
- nextKeys: GenericStorageQuery<Rv, (arg: AccountId32Like) => AlephRuntimeSessionKeys | undefined, AccountId32>;
989
+ nextKeys: GenericStorageQuery<
990
+ Rv,
991
+ (arg: AccountId32Like) => PrimitivesAlephNodeSessionKeys | undefined,
992
+ AccountId32
993
+ >;
915
994
 
916
995
  /**
917
996
  * The owner of a key. The key is the `KeyTypeId` + the encoded key.
@@ -1087,6 +1166,21 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1087
1166
  **/
1088
1167
  approvals: GenericStorageQuery<Rv, () => Array<number>>;
1089
1168
 
1169
+ /**
1170
+ * The count of spends that have been made.
1171
+ *
1172
+ * @param {Callback<number> =} callback
1173
+ **/
1174
+ spendCount: GenericStorageQuery<Rv, () => number>;
1175
+
1176
+ /**
1177
+ * Spends that have been approved and being processed.
1178
+ *
1179
+ * @param {number} arg
1180
+ * @param {Callback<PalletTreasurySpendStatus | undefined> =} callback
1181
+ **/
1182
+ spends: GenericStorageQuery<Rv, (arg: number) => PalletTreasurySpendStatus | undefined, number>;
1183
+
1090
1184
  /**
1091
1185
  * Generic pallet storage query
1092
1186
  **/
@@ -1257,6 +1351,17 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1257
1351
  * Pallet `NominationPools`'s storage queries
1258
1352
  **/
1259
1353
  nominationPools: {
1354
+ /**
1355
+ * The sum of funds across all pools.
1356
+ *
1357
+ * This might be lower but never higher than the sum of `total_balance` of all [`PoolMembers`]
1358
+ * because calling `pool_withdraw_unbonded` might decrease the total stake of the pool's
1359
+ * `bonded_account` without adjusting the pallet-internal `UnbondingPool`'s.
1360
+ *
1361
+ * @param {Callback<bigint> =} callback
1362
+ **/
1363
+ totalValueLocked: GenericStorageQuery<Rv, () => bigint>;
1364
+
1260
1365
  /**
1261
1366
  * Minimum amount to bond to join a pool.
1262
1367
  *
@@ -1440,14 +1545,19 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1440
1545
  **/
1441
1546
  identity: {
1442
1547
  /**
1443
- * Information that is pertinent to identify the entity behind an account.
1548
+ * Information that is pertinent to identify the entity behind an account. First item is the
1549
+ * registration, second is the account's primary username.
1444
1550
  *
1445
1551
  * TWOX-NOTE: OK ― `AccountId` is a secure hash.
1446
1552
  *
1447
1553
  * @param {AccountId32Like} arg
1448
- * @param {Callback<PalletIdentityRegistration | undefined> =} callback
1554
+ * @param {Callback<[PalletIdentityRegistration, Bytes | undefined] | undefined> =} callback
1449
1555
  **/
1450
- identityOf: GenericStorageQuery<Rv, (arg: AccountId32Like) => PalletIdentityRegistration | undefined, AccountId32>;
1556
+ identityOf: GenericStorageQuery<
1557
+ Rv,
1558
+ (arg: AccountId32Like) => [PalletIdentityRegistration, Bytes | undefined] | undefined,
1559
+ AccountId32
1560
+ >;
1451
1561
 
1452
1562
  /**
1453
1563
  * The super-identity of an alternative "sub" identity together with its name, within that
@@ -1480,6 +1590,43 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1480
1590
  **/
1481
1591
  registrars: GenericStorageQuery<Rv, () => Array<PalletIdentityRegistrarInfo | undefined>>;
1482
1592
 
1593
+ /**
1594
+ * A map of the accounts who are authorized to grant usernames.
1595
+ *
1596
+ * @param {AccountId32Like} arg
1597
+ * @param {Callback<PalletIdentityAuthorityProperties | undefined> =} callback
1598
+ **/
1599
+ usernameAuthorities: GenericStorageQuery<
1600
+ Rv,
1601
+ (arg: AccountId32Like) => PalletIdentityAuthorityProperties | undefined,
1602
+ AccountId32
1603
+ >;
1604
+
1605
+ /**
1606
+ * Reverse lookup from `username` to the `AccountId` that has registered it. The value should
1607
+ * be a key in the `IdentityOf` map, but it may not if the user has cleared their identity.
1608
+ *
1609
+ * Multiple usernames may map to the same `AccountId`, but `IdentityOf` will only map to one
1610
+ * primary username.
1611
+ *
1612
+ * @param {BytesLike} arg
1613
+ * @param {Callback<AccountId32 | undefined> =} callback
1614
+ **/
1615
+ accountOfUsername: GenericStorageQuery<Rv, (arg: BytesLike) => AccountId32 | undefined, Bytes>;
1616
+
1617
+ /**
1618
+ * Usernames that an authority has granted, but that the account controller has not confirmed
1619
+ * that they want it. Used primarily in cases where the `AccountId` cannot provide a signature
1620
+ * because they are a pure proxy, multisig, etc. In order to confirm it, they should call
1621
+ * [`Call::accept_username`].
1622
+ *
1623
+ * First tuple item is the account and second is the acceptance deadline.
1624
+ *
1625
+ * @param {BytesLike} arg
1626
+ * @param {Callback<[AccountId32, number] | undefined> =} callback
1627
+ **/
1628
+ pendingUsernames: GenericStorageQuery<Rv, (arg: BytesLike) => [AccountId32, number] | undefined, Bytes>;
1629
+
1483
1630
  /**
1484
1631
  * Generic pallet storage query
1485
1632
  **/
@@ -1577,6 +1724,54 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1577
1724
  AccountId32
1578
1725
  >;
1579
1726
 
1727
+ /**
1728
+ * Generic pallet storage query
1729
+ **/
1730
+ [storage: string]: GenericStorageQuery<Rv>;
1731
+ };
1732
+ /**
1733
+ * Pallet `SafeMode`'s storage queries
1734
+ **/
1735
+ safeMode: {
1736
+ /**
1737
+ * Contains the last block number that the safe-mode will remain entered in.
1738
+ *
1739
+ * Set to `None` when safe-mode is exited.
1740
+ *
1741
+ * Safe-mode is automatically exited when the current block number exceeds this value.
1742
+ *
1743
+ * @param {Callback<number | undefined> =} callback
1744
+ **/
1745
+ enteredUntil: GenericStorageQuery<Rv, () => number | undefined>;
1746
+
1747
+ /**
1748
+ * Holds the reserve that was taken from an account at a specific block number.
1749
+ *
1750
+ * This helps governance to have an overview of outstanding deposits that should be returned or
1751
+ * slashed.
1752
+ *
1753
+ * @param {[AccountId32Like, number]} arg
1754
+ * @param {Callback<bigint | undefined> =} callback
1755
+ **/
1756
+ deposits: GenericStorageQuery<Rv, (arg: [AccountId32Like, number]) => bigint | undefined, [AccountId32, number]>;
1757
+
1758
+ /**
1759
+ * Generic pallet storage query
1760
+ **/
1761
+ [storage: string]: GenericStorageQuery<Rv>;
1762
+ };
1763
+ /**
1764
+ * Pallet `TxPause`'s storage queries
1765
+ **/
1766
+ txPause: {
1767
+ /**
1768
+ * The set of calls that are explicitly paused.
1769
+ *
1770
+ * @param {[BytesLike, BytesLike]} arg
1771
+ * @param {Callback<[] | undefined> =} callback
1772
+ **/
1773
+ pausedCalls: GenericStorageQuery<Rv, (arg: [BytesLike, BytesLike]) => [] | undefined, [Bytes, Bytes]>;
1774
+
1580
1775
  /**
1581
1776
  * Generic pallet storage query
1582
1777
  **/
@@ -502,6 +502,15 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
502
502
  **/
503
503
  nominationsQuota: GenericRuntimeApiMethod<Rv, (balance: bigint) => Promise<number>>;
504
504
 
505
+ /**
506
+ * Returns the page count of exposures for a validator in a given era.
507
+ *
508
+ * @callname: StakingApi_eras_stakers_page_count
509
+ * @param {number} era
510
+ * @param {AccountId32Like} account
511
+ **/
512
+ erasStakersPageCount: GenericRuntimeApiMethod<Rv, (era: number, account: AccountId32Like) => Promise<number>>;
513
+
505
514
  /**
506
515
  * Generic runtime api call
507
516
  **/
@@ -603,6 +612,39 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
603
612
  ) => Promise<Result<Bytes | undefined, PalletContractsPrimitivesContractAccessError>>
604
613
  >;
605
614
 
615
+ /**
616
+ * Generic runtime api call
617
+ **/
618
+ [method: string]: GenericRuntimeApiMethod<Rv>;
619
+ };
620
+ /**
621
+ * @runtimeapi: GenesisBuilder - 0xfbc577b9d747efd6
622
+ **/
623
+ genesisBuilder: {
624
+ /**
625
+ * Creates the default `GenesisConfig` and returns it as a JSON blob.
626
+ *
627
+ * This function instantiates the default `GenesisConfig` struct for the runtime and serializes it into a JSON
628
+ * blob. It returns a `Vec<u8>` containing the JSON representation of the default `GenesisConfig`.
629
+ *
630
+ * @callname: GenesisBuilder_create_default_config
631
+ **/
632
+ createDefaultConfig: GenericRuntimeApiMethod<Rv, () => Promise<Bytes>>;
633
+
634
+ /**
635
+ * Build `GenesisConfig` from a JSON blob not using any defaults and store it in the storage.
636
+ *
637
+ * This function deserializes the full `GenesisConfig` from the given JSON blob and puts it into the storage.
638
+ * If the provided JSON blob is incorrect or incomplete or the deserialization fails, an error is returned.
639
+ * It is recommended to log any errors encountered during the process.
640
+ *
641
+ * Please note that provided json blob must contain all `GenesisConfig` fields, no defaults will be used.
642
+ *
643
+ * @callname: GenesisBuilder_build_config
644
+ * @param {BytesLike} json
645
+ **/
646
+ buildConfig: GenericRuntimeApiMethod<Rv, (json: BytesLike) => Promise<Result<[], string>>>;
647
+
606
648
  /**
607
649
  * Generic runtime api call
608
650
  **/