@dedot/chaintypes 0.239.0 → 0.240.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.
@@ -181,11 +181,13 @@ export interface ChainStorage extends GenericChainStorage {
181
181
  blockWeight: GenericStorageQuery<() => FrameSupportDispatchPerDispatchClass>;
182
182
 
183
183
  /**
184
- * Total length (in bytes) for all extrinsics put together, for the current block.
184
+ * Total size (in bytes) of the current block.
185
+ *
186
+ * Tracks the size of the header and all extrinsics.
185
187
  *
186
188
  * @param {Callback<number | undefined> =} callback
187
189
  **/
188
- allExtrinsicsLen: GenericStorageQuery<() => number | undefined>;
190
+ blockSize: GenericStorageQuery<() => number | undefined>;
189
191
 
190
192
  /**
191
193
  * Map of block numbers to block hashes.
@@ -2324,15 +2326,6 @@ export interface ChainStorage extends GenericChainStorage {
2324
2326
  **/
2325
2327
  validatorCount: GenericStorageQuery<() => number>;
2326
2328
 
2327
- /**
2328
- * Any validators that may never be slashed or forcibly kicked. It's a Vec since they're
2329
- * easy to initialize and the performance hit is minimal (we expect no more than four
2330
- * invulnerables) and restricted to testnets.
2331
- *
2332
- * @param {Callback<Array<AccountId32>> =} callback
2333
- **/
2334
- invulnerables: GenericStorageQuery<() => Array<AccountId32>>;
2335
-
2336
2329
  /**
2337
2330
  * Map from all locked "stash" accounts to the controller account.
2338
2331
  *
@@ -9,8 +9,8 @@ import type {
9
9
  Result,
10
10
  UncheckedExtrinsicLike,
11
11
  UncheckedExtrinsic,
12
- Bytes,
13
12
  BytesLike,
13
+ Bytes,
14
14
  AccountId32Like,
15
15
  AccountId32,
16
16
  U256,
@@ -30,6 +30,7 @@ import type {
30
30
  SpInherentsCheckInherentsResult,
31
31
  SpRuntimeTransactionValidityValidTransaction,
32
32
  SpRuntimeTransactionValidityTransactionSource,
33
+ SpSessionRuntimeApiOpaqueGeneratedSessionKeys,
33
34
  SpCoreCryptoKeyTypeId,
34
35
  StagingXcmV5Location,
35
36
  PalletTransactionPaymentRuntimeDispatchInfo,
@@ -358,9 +359,12 @@ export interface RuntimeApis extends GenericRuntimeApis {
358
359
  * Returns the concatenated SCALE encoded public keys.
359
360
  *
360
361
  * @callname: SessionKeys_generate_session_keys
362
+ * @param {BytesLike} owner
361
363
  * @param {BytesLike | undefined} seed
362
364
  **/
363
- generateSessionKeys: GenericRuntimeApiMethod<(seed?: BytesLike | undefined) => Promise<Bytes>>;
365
+ generateSessionKeys: GenericRuntimeApiMethod<
366
+ (owner: BytesLike, seed?: BytesLike | undefined) => Promise<SpSessionRuntimeApiOpaqueGeneratedSessionKeys>
367
+ >;
364
368
 
365
369
  /**
366
370
  * Decode the given public session keys.
@@ -712,7 +712,10 @@ export interface ChainTx<
712
712
  >;
713
713
 
714
714
  /**
715
- * Cancel an anonymously scheduled task.
715
+ * Cancel a scheduled task (named or anonymous), by providing the block it is scheduled for
716
+ * execution in, as well as the index of the task in that block's agenda.
717
+ *
718
+ * In the case of a named task, it will remove it from the lookup table as well.
716
719
  *
717
720
  * @param {number} when
718
721
  * @param {number} index
@@ -864,6 +867,8 @@ export interface ChainTx<
864
867
  * original task's configuration, but will have a lower value for `remaining` than the
865
868
  * original `total_retries`.
866
869
  *
870
+ * This call **cannot** be used to set a retry configuration for a named task.
871
+ *
867
872
  * @param {[number, number]} task
868
873
  * @param {number} retries
869
874
  * @param {number} period
@@ -899,6 +904,8 @@ export interface ChainTx<
899
904
  * original task's configuration, but will have a lower value for `remaining` than the
900
905
  * original `total_retries`.
901
906
  *
907
+ * This is the only way to set a retry configuration for a named task.
908
+ *
902
909
  * @param {FixedBytes<32>} id
903
910
  * @param {number} retries
904
911
  * @param {number} period
@@ -1753,14 +1760,16 @@ export interface ChainTx<
1753
1760
  session: {
1754
1761
  /**
1755
1762
  * Sets the session key(s) of the function caller to `keys`.
1763
+ *
1756
1764
  * Allows an account to set its session key prior to becoming a validator.
1757
1765
  * This doesn't take effect until the next session.
1758
1766
  *
1759
- * The dispatch origin of this function must be signed.
1760
- *
1761
- * ## Complexity
1762
- * - `O(1)`. Actual cost depends on the number of length of `T::Keys::key_ids()` which is
1763
- * fixed.
1767
+ * - `origin`: The dispatch origin of this function must be signed.
1768
+ * - `keys`: The new session keys to set. These are the public keys of all sessions keys
1769
+ * setup in the runtime.
1770
+ * - `proof`: The proof that `origin` has access to the private keys of `keys`. See
1771
+ * [`impl_opaque_keys`](sp_runtime::impl_opaque_keys) for more information about the
1772
+ * proof format.
1764
1773
  *
1765
1774
  * @param {AssetHubWestendRuntimeSessionKeys} keys
1766
1775
  * @param {BytesLike} proof
@@ -1791,10 +1800,6 @@ export interface ChainTx<
1791
1800
  * means being a controller account) or directly convertible into a validator ID (which
1792
1801
  * usually means being a stash account).
1793
1802
  *
1794
- * ## Complexity
1795
- * - `O(1)` in number of key types. Actual cost depends on the number of length of
1796
- * `T::Keys::key_ids()` which is fixed.
1797
- *
1798
1803
  **/
1799
1804
  purgeKeys: GenericTxCall<
1800
1805
  () => ChainSubmittableExtrinsic<
@@ -3074,7 +3079,9 @@ export interface ChainTx<
3074
3079
  * Register approval for a dispatch to be made from a deterministic composite account if
3075
3080
  * approved by a total of `threshold - 1` of `other_signatories`.
3076
3081
  *
3077
- * If there are enough, then dispatch the call.
3082
+ * **If the approval threshold is met (including the sender's approval), this will
3083
+ * immediately execute the call.** This is the only way to execute a multisig call -
3084
+ * `approve_as_multi` will never trigger execution.
3078
3085
  *
3079
3086
  * Payment: `DepositBase` will be reserved if this is the first approval, plus
3080
3087
  * `threshold` times `DepositFactor`. It is returned once this dispatch happens or
@@ -3090,8 +3097,9 @@ export interface ChainTx<
3090
3097
  * transaction index) of the first approval transaction.
3091
3098
  * - `call`: The call to be executed.
3092
3099
  *
3093
- * NOTE: Unless this is the final approval, you will generally want to use
3094
- * `approve_as_multi` instead, since it only requires a hash of the call.
3100
+ * NOTE: For intermediate approvals (not the final approval), you should generally use
3101
+ * `approve_as_multi` instead, since it only requires a hash of the call and is more
3102
+ * efficient.
3095
3103
  *
3096
3104
  * Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise
3097
3105
  * on success, result is `Ok` and the result from the interior call, if it was executed,
@@ -3146,6 +3154,13 @@ export interface ChainTx<
3146
3154
  * Register approval for a dispatch to be made from a deterministic composite account if
3147
3155
  * approved by a total of `threshold - 1` of `other_signatories`.
3148
3156
  *
3157
+ * **This function will NEVER execute the call, even if the approval threshold is
3158
+ * reached.** It only registers approval. To actually execute the call, `as_multi` must
3159
+ * be called with the full call data by any of the signatories.
3160
+ *
3161
+ * This function is more efficient than `as_multi` for intermediate approvals since it
3162
+ * only requires the call hash, not the full call data.
3163
+ *
3149
3164
  * Payment: `DepositBase` will be reserved if this is the first approval, plus
3150
3165
  * `threshold` times `DepositFactor`. It is returned once this dispatch happens or
3151
3166
  * is cancelled.
@@ -3160,7 +3175,8 @@ export interface ChainTx<
3160
3175
  * transaction index) of the first approval transaction.
3161
3176
  * - `call_hash`: The hash of the call to be executed.
3162
3177
  *
3163
- * NOTE: If this is the final approval, you will want to use `as_multi` instead.
3178
+ * NOTE: To execute the call after approvals are gathered, any signatory must call
3179
+ * `as_multi` with the full call data. This function cannot execute the call.
3164
3180
  *
3165
3181
  * ## Complexity
3166
3182
  * - `O(S)`.
@@ -11536,26 +11552,6 @@ export interface ChainTx<
11536
11552
  >
11537
11553
  >;
11538
11554
 
11539
- /**
11540
- * Set the validators who cannot be slashed (if any).
11541
- *
11542
- * The dispatch origin must be Root.
11543
- *
11544
- * @param {Array<AccountId32Like>} invulnerables
11545
- **/
11546
- setInvulnerables: GenericTxCall<
11547
- (invulnerables: Array<AccountId32Like>) => ChainSubmittableExtrinsic<
11548
- {
11549
- pallet: 'Staking';
11550
- palletCall: {
11551
- name: 'SetInvulnerables';
11552
- params: { invulnerables: Array<AccountId32Like> };
11553
- };
11554
- },
11555
- ChainKnownTypes
11556
- >
11557
- >;
11558
-
11559
11555
  /**
11560
11556
  * Force a current staker to become completely unstaked, immediately.
11561
11557
  *
@@ -13089,16 +13085,17 @@ export interface ChainTx<
13089
13085
  * Set session keys for a validator. Keys are validated on AssetHub and forwarded to RC.
13090
13086
  *
13091
13087
  * **Validation on AssetHub:**
13092
- * Keys are decoded as `T::RelayChainSessionKeys` to ensure they match RC's expected
13093
- * format. This prevents malicious validators from bloating the XCM queue with garbage
13094
- * data.
13088
+ * - Keys are decoded as `T::RelayChainSessionKeys` to ensure they match RC's expected
13089
+ * format.
13090
+ * - Ownership proof is validated using `OpaqueKeys::ownership_proof_is_valid`.
13091
+ *
13092
+ * If validation passes, only the validated keys are sent to RC (with empty proof),
13093
+ * since RC trusts AH's validation. This prevents malicious validators from bloating
13094
+ * the XCM queue with garbage data.
13095
13095
  *
13096
13096
  * This, combined with the enforcement of a high minimum validator bond, makes it
13097
13097
  * reasonable not to require a deposit.
13098
13098
  *
13099
- * Note: Ownership proof validation requires PR #1739 which is not backported to
13100
- * stable2512. The proof parameter will be added when that PR is backported.
13101
- *
13102
13099
  * **Fees:**
13103
13100
  * The actual cost of this call is higher than what the weight-based fee estimate shows.
13104
13101
  * In addition to the local transaction weight fee, the stash account is charged an XCM
@@ -13119,18 +13116,20 @@ export interface ChainTx<
13119
13116
  * set keys before declaring intent to validate will fail with NotValidator.
13120
13117
  *
13121
13118
  * @param {BytesLike} keys
13119
+ * @param {BytesLike} proof
13122
13120
  * @param {bigint | undefined} maxDeliveryAndRemoteExecutionFee
13123
13121
  **/
13124
13122
  setKeys: GenericTxCall<
13125
13123
  (
13126
13124
  keys: BytesLike,
13125
+ proof: BytesLike,
13127
13126
  maxDeliveryAndRemoteExecutionFee: bigint | undefined,
13128
13127
  ) => ChainSubmittableExtrinsic<
13129
13128
  {
13130
13129
  pallet: 'StakingRcClient';
13131
13130
  palletCall: {
13132
13131
  name: 'SetKeys';
13133
- params: { keys: BytesLike; maxDeliveryAndRemoteExecutionFee: bigint | undefined };
13132
+ params: { keys: BytesLike; proof: BytesLike; maxDeliveryAndRemoteExecutionFee: bigint | undefined };
13134
13133
  };
13135
13134
  },
13136
13135
  ChainKnownTypes