@dedot/chaintypes 0.62.0 → 0.63.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.
@@ -22,6 +22,7 @@ import type {
22
22
  FrameSystemEventRecord,
23
23
  FrameSystemLastRuntimeUpgradeInfo,
24
24
  FrameSystemCodeUpgradeAuthorization,
25
+ SpWeightsWeightV2Weight,
25
26
  SpConsensusBabeAppPublic,
26
27
  SpConsensusSlotsSlot,
27
28
  SpConsensusBabeDigestsNextConfigDescriptor,
@@ -38,18 +39,20 @@ import type {
38
39
  PalletStakingValidatorPrefs,
39
40
  PalletStakingNominations,
40
41
  PalletStakingActiveEraInfo,
41
- SpStakingExposure,
42
42
  SpStakingPagedExposureMetadata,
43
43
  SpStakingExposurePage,
44
44
  PalletStakingEraRewardPoints,
45
45
  PalletStakingForcing,
46
+ PalletStakingSlashingOffenceRecord,
46
47
  PalletStakingUnappliedSlash,
47
48
  PalletStakingSlashingSlashingSpans,
48
49
  PalletStakingSlashingSpanRecord,
50
+ PalletStakingSnapshotStatus,
49
51
  SpStakingOffenceOffenceDetails,
50
52
  WestendRuntimeRuntimeParametersValue,
51
53
  WestendRuntimeRuntimeParametersKey,
52
54
  WestendRuntimeSessionKeys,
55
+ SpStakingOffenceOffenceSeverity,
53
56
  SpCoreCryptoKeyTypeId,
54
57
  PalletGrandpaStoredState,
55
58
  PalletGrandpaStoredPendingChange,
@@ -132,7 +135,6 @@ import type {
132
135
  PalletMigrationsMigrationCursor,
133
136
  PalletXcmQueryStatus,
134
137
  XcmVersionedLocation,
135
- SpWeightsWeightV2Weight,
136
138
  PalletXcmVersionMigrationStage,
137
139
  PalletXcmRemoteLockedFungibleRecord,
138
140
  XcmVersionedAssetId,
@@ -296,6 +298,19 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
296
298
  **/
297
299
  authorizedUpgrade: GenericStorageQuery<Rv, () => FrameSystemCodeUpgradeAuthorization | undefined>;
298
300
 
301
+ /**
302
+ * The weight reclaimed for the extrinsic.
303
+ *
304
+ * This information is available until the end of the extrinsic execution.
305
+ * More precisely this information is removed in `note_applied_extrinsic`.
306
+ *
307
+ * Logic doing some post dispatch weight reduction must update this storage to avoid duplicate
308
+ * reduction.
309
+ *
310
+ * @param {Callback<SpWeightsWeightV2Weight> =} callback
311
+ **/
312
+ extrinsicWeightReclaimed: GenericStorageQuery<Rv, () => SpWeightsWeightV2Weight>;
313
+
299
314
  /**
300
315
  * Generic pallet storage query
301
316
  **/
@@ -851,21 +866,6 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
851
866
  **/
852
867
  erasStartSessionIndex: GenericStorageQuery<Rv, (arg: number) => number | undefined, number>;
853
868
 
854
- /**
855
- * Exposure of validator at era.
856
- *
857
- * This is keyed first by the era index to allow bulk deletion and then the stash account.
858
- *
859
- * Is it removed after [`Config::HistoryDepth`] eras.
860
- * If stakers hasn't been set or has been removed then empty exposure is returned.
861
- *
862
- * Note: Deprecated since v14. Use `EraInfo` instead to work with exposures.
863
- *
864
- * @param {[number, AccountId32Like]} arg
865
- * @param {Callback<SpStakingExposure> =} callback
866
- **/
867
- erasStakers: GenericStorageQuery<Rv, (arg: [number, AccountId32Like]) => SpStakingExposure, [number, AccountId32]>;
868
-
869
869
  /**
870
870
  * Summary of validator exposure at a given era.
871
871
  *
@@ -889,33 +889,6 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
889
889
  [number, AccountId32]
890
890
  >;
891
891
 
892
- /**
893
- * Clipped Exposure of validator at era.
894
- *
895
- * Note: This is deprecated, should be used as read-only and will be removed in the future.
896
- * New `Exposure`s are stored in a paged manner in `ErasStakersPaged` instead.
897
- *
898
- * This is similar to [`ErasStakers`] but number of nominators exposed is reduced to the
899
- * `T::MaxExposurePageSize` biggest stakers.
900
- * (Note: the field `total` and `own` of the exposure remains unchanged).
901
- * This is used to limit the i/o cost for the nominator payout.
902
- *
903
- * This is keyed fist by the era index to allow bulk deletion and then the stash account.
904
- *
905
- * It is removed after [`Config::HistoryDepth`] eras.
906
- * If stakers hasn't been set or has been removed then empty exposure is returned.
907
- *
908
- * Note: Deprecated since v14. Use `EraInfo` instead to work with exposures.
909
- *
910
- * @param {[number, AccountId32Like]} arg
911
- * @param {Callback<SpStakingExposure> =} callback
912
- **/
913
- erasStakersClipped: GenericStorageQuery<
914
- Rv,
915
- (arg: [number, AccountId32Like]) => SpStakingExposure,
916
- [number, AccountId32]
917
- >;
918
-
919
892
  /**
920
893
  * Paginated exposure of a validator at given era.
921
894
  *
@@ -947,7 +920,7 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
947
920
  claimedRewards: GenericStorageQuery<Rv, (arg: [number, AccountId32Like]) => Array<number>, [number, AccountId32]>;
948
921
 
949
922
  /**
950
- * Similar to `ErasStakers`, this holds the preferences of validators.
923
+ * Exposure of validator at era with the preferences of validators.
951
924
  *
952
925
  * This is keyed first by the era index to allow bulk deletion and then the stash account.
953
926
  *
@@ -1023,13 +996,76 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1023
996
  **/
1024
997
  canceledSlashPayout: GenericStorageQuery<Rv, () => bigint>;
1025
998
 
999
+ /**
1000
+ * Stores reported offences in a queue until they are processed in subsequent blocks.
1001
+ *
1002
+ * Each offence is recorded under the corresponding era index and the offending validator's
1003
+ * account. If an offence spans multiple pages, only one page is processed at a time. Offences
1004
+ * are handled sequentially, with their associated slashes computed and stored in
1005
+ * `UnappliedSlashes`. These slashes are then applied in a future era as determined by
1006
+ * `SlashDeferDuration`.
1007
+ *
1008
+ * Any offences tied to an era older than `BondingDuration` are automatically dropped.
1009
+ * Processing always prioritizes the oldest era first.
1010
+ *
1011
+ * @param {[number, AccountId32Like]} arg
1012
+ * @param {Callback<PalletStakingSlashingOffenceRecord | undefined> =} callback
1013
+ **/
1014
+ offenceQueue: GenericStorageQuery<
1015
+ Rv,
1016
+ (arg: [number, AccountId32Like]) => PalletStakingSlashingOffenceRecord | undefined,
1017
+ [number, AccountId32]
1018
+ >;
1019
+
1020
+ /**
1021
+ * Tracks the eras that contain offences in `OffenceQueue`, sorted from **earliest to latest**.
1022
+ *
1023
+ * - This ensures efficient retrieval of the oldest offence without iterating through
1024
+ * `OffenceQueue`.
1025
+ * - When a new offence is added to `OffenceQueue`, its era is **inserted in sorted order**
1026
+ * if not already present.
1027
+ * - When all offences for an era are processed, it is **removed** from this list.
1028
+ * - The maximum length of this vector is bounded by `BondingDuration`.
1029
+ *
1030
+ * This eliminates the need for expensive iteration and sorting when fetching the next offence
1031
+ * to process.
1032
+ *
1033
+ * @param {Callback<Array<number> | undefined> =} callback
1034
+ **/
1035
+ offenceQueueEras: GenericStorageQuery<Rv, () => Array<number> | undefined>;
1036
+
1037
+ /**
1038
+ * Tracks the currently processed offence record from the `OffenceQueue`.
1039
+ *
1040
+ * - When processing offences, an offence record is **popped** from the oldest era in
1041
+ * `OffenceQueue` and stored here.
1042
+ * - The function `process_offence` reads from this storage, processing one page of exposure at
1043
+ * a time.
1044
+ * - After processing a page, the `exposure_page` count is **decremented** until it reaches
1045
+ * zero.
1046
+ * - Once fully processed, the offence record is removed from this storage.
1047
+ *
1048
+ * This ensures that offences are processed incrementally, preventing excessive computation
1049
+ * in a single block while maintaining correct slashing behavior.
1050
+ *
1051
+ * @param {Callback<[number, AccountId32, PalletStakingSlashingOffenceRecord] | undefined> =} callback
1052
+ **/
1053
+ processingOffence: GenericStorageQuery<
1054
+ Rv,
1055
+ () => [number, AccountId32, PalletStakingSlashingOffenceRecord] | undefined
1056
+ >;
1057
+
1026
1058
  /**
1027
1059
  * All unapplied slashes that are queued for later.
1028
1060
  *
1029
- * @param {number} arg
1030
- * @param {Callback<Array<PalletStakingUnappliedSlash>> =} callback
1061
+ * @param {[number, [AccountId32Like, Perbill, number]]} arg
1062
+ * @param {Callback<PalletStakingUnappliedSlash | undefined> =} callback
1031
1063
  **/
1032
- unappliedSlashes: GenericStorageQuery<Rv, (arg: number) => Array<PalletStakingUnappliedSlash>, number>;
1064
+ unappliedSlashes: GenericStorageQuery<
1065
+ Rv,
1066
+ (arg: [number, [AccountId32Like, Perbill, number]]) => PalletStakingUnappliedSlash | undefined,
1067
+ [number, [AccountId32, Perbill, number]]
1068
+ >;
1033
1069
 
1034
1070
  /**
1035
1071
  * A mapping from still-bonded eras to the first session index of that era.
@@ -1100,19 +1136,6 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1100
1136
  **/
1101
1137
  currentPlannedSession: GenericStorageQuery<Rv, () => number>;
1102
1138
 
1103
- /**
1104
- * Indices of validators that have offended in the active era. The offenders are disabled for a
1105
- * whole era. For this reason they are kept here - only staking pallet knows about eras. The
1106
- * implementor of [`DisablingStrategy`] defines if a validator should be disabled which
1107
- * implicitly means that the implementor also controls the max number of disabled validators.
1108
- *
1109
- * The vec is always kept sorted so that we can find whether a given validator has previously
1110
- * offended using binary search.
1111
- *
1112
- * @param {Callback<Array<number>> =} callback
1113
- **/
1114
- disabledValidators: GenericStorageQuery<Rv, () => Array<number>>;
1115
-
1116
1139
  /**
1117
1140
  * The threshold for when users can start calling `chill_other` for other validators /
1118
1141
  * nominators. The threshold is compared to the actual number of validators / nominators
@@ -1122,6 +1145,35 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1122
1145
  **/
1123
1146
  chillThreshold: GenericStorageQuery<Rv, () => Percent | undefined>;
1124
1147
 
1148
+ /**
1149
+ * Voter snapshot progress status.
1150
+ *
1151
+ * If the status is `Ongoing`, it keeps a cursor of the last voter retrieved to proceed when
1152
+ * creating the next snapshot page.
1153
+ *
1154
+ * @param {Callback<PalletStakingSnapshotStatus> =} callback
1155
+ **/
1156
+ voterSnapshotStatus: GenericStorageQuery<Rv, () => PalletStakingSnapshotStatus>;
1157
+
1158
+ /**
1159
+ * Keeps track of an ongoing multi-page election solution request.
1160
+ *
1161
+ * If `Some(_)``, it is the next page that we intend to elect. If `None`, we are not in the
1162
+ * election process.
1163
+ *
1164
+ * This is only set in multi-block elections. Should always be `None` otherwise.
1165
+ *
1166
+ * @param {Callback<number | undefined> =} callback
1167
+ **/
1168
+ nextElectionPage: GenericStorageQuery<Rv, () => number | undefined>;
1169
+
1170
+ /**
1171
+ * A bounded list of the "electable" stashes that resulted from a successful election.
1172
+ *
1173
+ * @param {Callback<Array<AccountId32>> =} callback
1174
+ **/
1175
+ electableStashes: GenericStorageQuery<Rv, () => Array<AccountId32>>;
1176
+
1125
1177
  /**
1126
1178
  * Generic pallet storage query
1127
1179
  **/
@@ -1242,9 +1294,9 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1242
1294
  * disabled using binary search. It gets cleared when `on_session_ending` returns
1243
1295
  * a new set of identities.
1244
1296
  *
1245
- * @param {Callback<Array<number>> =} callback
1297
+ * @param {Callback<Array<[number, SpStakingOffenceOffenceSeverity]>> =} callback
1246
1298
  **/
1247
- disabledValidators: GenericStorageQuery<Rv, () => Array<number>>;
1299
+ disabledValidators: GenericStorageQuery<Rv, () => Array<[number, SpStakingOffenceOffenceSeverity]>>;
1248
1300
 
1249
1301
  /**
1250
1302
  * The next session keys for a validator.
@@ -3274,6 +3326,14 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
3274
3326
  **/
3275
3327
  revenue: GenericStorageQuery<Rv, () => Array<bigint>>;
3276
3328
 
3329
+ /**
3330
+ * Keeps track of credits owned by each account.
3331
+ *
3332
+ * @param {AccountId32Like} arg
3333
+ * @param {Callback<bigint> =} callback
3334
+ **/
3335
+ credits: GenericStorageQuery<Rv, (arg: AccountId32Like) => bigint, AccountId32>;
3336
+
3277
3337
  /**
3278
3338
  * Generic pallet storage query
3279
3339
  **/
@@ -4,14 +4,14 @@ import type { GenericRuntimeApis, GenericRuntimeApiMethod, RpcVersion } from 'de
4
4
  import type {
5
5
  RuntimeVersion,
6
6
  Header,
7
- DispatchError,
7
+ Bytes,
8
8
  Result,
9
+ BytesLike,
10
+ DispatchError,
9
11
  UncheckedExtrinsicLike,
10
12
  UncheckedExtrinsic,
11
13
  H256,
12
14
  BitSequence,
13
- Bytes,
14
- BytesLike,
15
15
  AccountId32Like,
16
16
  AccountId32,
17
17
  } from 'dedot/codecs';
@@ -19,6 +19,8 @@ import type {
19
19
  SpRuntimeBlock,
20
20
  SpRuntimeExtrinsicInclusionMode,
21
21
  SpCoreOpaqueMetadata,
22
+ FrameSupportViewFunctionsViewFunctionDispatchError,
23
+ FrameSupportViewFunctionsViewFunctionId,
22
24
  SpRuntimeTransactionValidityTransactionValidityError,
23
25
  SpInherentsInherentData,
24
26
  SpInherentsCheckInherentsResult,
@@ -52,6 +54,7 @@ import type {
52
54
  PolkadotPrimitivesV8AsyncBackingAsyncBackingParams,
53
55
  PolkadotPrimitivesV8ApprovalVotingParams,
54
56
  PolkadotPrimitivesV8CoreIndex,
57
+ PolkadotPrimitivesVstagingAsyncBackingConstraints,
55
58
  SpConsensusBeefyValidatorSet,
56
59
  SpConsensusBeefyDoubleVotingProof,
57
60
  SpRuntimeOpaqueValue,
@@ -159,6 +162,30 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
159
162
  **/
160
163
  [method: string]: GenericRuntimeApiMethod<Rv>;
161
164
  };
165
+ /**
166
+ * @runtimeapi: RuntimeViewFunction - 0xccd9de6396c899ca
167
+ **/
168
+ runtimeViewFunction: {
169
+ /**
170
+ * Execute a view function query.
171
+ *
172
+ * @callname: RuntimeViewFunction_execute_view_function
173
+ * @param {FrameSupportViewFunctionsViewFunctionId} query_id
174
+ * @param {BytesLike} input
175
+ **/
176
+ executeViewFunction: GenericRuntimeApiMethod<
177
+ Rv,
178
+ (
179
+ queryId: FrameSupportViewFunctionsViewFunctionId,
180
+ input: BytesLike,
181
+ ) => Promise<Result<Bytes, FrameSupportViewFunctionsViewFunctionDispatchError>>
182
+ >;
183
+
184
+ /**
185
+ * Generic runtime api call
186
+ **/
187
+ [method: string]: GenericRuntimeApiMethod<Rv>;
188
+ };
162
189
  /**
163
190
  * @runtimeapi: BlockBuilder - 0x40fe3ad401f8959a
164
191
  **/
@@ -636,6 +663,27 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
636
663
  ) => Promise<Array<PolkadotPrimitivesVstagingCommittedCandidateReceiptV2>>
637
664
  >;
638
665
 
666
+ /**
667
+ * Returns the constraints on the actions that can be taken by a new parachain
668
+ * block.
669
+ *
670
+ * @callname: ParachainHost_backing_constraints
671
+ * @param {PolkadotParachainPrimitivesPrimitivesId} para_id
672
+ **/
673
+ backingConstraints: GenericRuntimeApiMethod<
674
+ Rv,
675
+ (
676
+ paraId: PolkadotParachainPrimitivesPrimitivesId,
677
+ ) => Promise<PolkadotPrimitivesVstagingAsyncBackingConstraints | undefined>
678
+ >;
679
+
680
+ /**
681
+ * Retrieve the scheduling lookahead
682
+ *
683
+ * @callname: ParachainHost_scheduling_lookahead
684
+ **/
685
+ schedulingLookahead: GenericRuntimeApiMethod<Rv, () => Promise<number>>;
686
+
639
687
  /**
640
688
  * Generic runtime api call
641
689
  **/
@@ -1272,17 +1320,19 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
1272
1320
  **/
1273
1321
  dryRunApi: {
1274
1322
  /**
1275
- * Dry run call.
1323
+ * Dry run call V2.
1276
1324
  *
1277
1325
  * @callname: DryRunApi_dry_run_call
1278
1326
  * @param {WestendRuntimeOriginCaller} origin
1279
1327
  * @param {WestendRuntimeRuntimeCallLike} call
1328
+ * @param {number} result_xcms_version
1280
1329
  **/
1281
1330
  dryRunCall: GenericRuntimeApiMethod<
1282
1331
  Rv,
1283
1332
  (
1284
1333
  origin: WestendRuntimeOriginCaller,
1285
1334
  call: WestendRuntimeRuntimeCallLike,
1335
+ resultXcmsVersion: number,
1286
1336
  ) => Promise<Result<XcmRuntimeApisDryRunCallDryRunEffects, XcmRuntimeApisDryRunError>>
1287
1337
  >;
1288
1338
 
@@ -1367,6 +1417,9 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
1367
1417
  /**
1368
1418
  * Returns the pending slash for a given pool member.
1369
1419
  *
1420
+ * If pending slash of the member exceeds `ExistentialDeposit`, it can be reported on
1421
+ * chain.
1422
+ *
1370
1423
  * @callname: NominationPoolsApi_member_pending_slash
1371
1424
  * @param {AccountId32Like} member
1372
1425
  **/