@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.
package/westend/tx.d.ts CHANGED
@@ -1236,7 +1236,7 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
1236
1236
 
1237
1237
  /**
1238
1238
  * Increments the ideal number of validators up to maximum of
1239
- * `ElectionProviderBase::MaxWinners`.
1239
+ * `T::MaxValidatorSet`.
1240
1240
  *
1241
1241
  * The dispatch origin must be Root.
1242
1242
  *
@@ -1261,7 +1261,7 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
1261
1261
 
1262
1262
  /**
1263
1263
  * Scale up the ideal number of validators by a factor up to maximum of
1264
- * `ElectionProviderBase::MaxWinners`.
1264
+ * `T::MaxValidatorSet`.
1265
1265
  *
1266
1266
  * The dispatch origin must be Root.
1267
1267
  *
@@ -1420,27 +1420,31 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
1420
1420
  >;
1421
1421
 
1422
1422
  /**
1423
- * Cancel enactment of a deferred slash.
1423
+ * Cancels scheduled slashes for a given era before they are applied.
1424
1424
  *
1425
- * Can be called by the `T::AdminOrigin`.
1425
+ * This function allows `T::AdminOrigin` to selectively remove pending slashes from
1426
+ * the `UnappliedSlashes` storage, preventing their enactment.
1426
1427
  *
1427
- * Parameters: era and indices of the slashes for that era to kill.
1428
+ * ## Parameters
1429
+ * - `era`: The staking era for which slashes were deferred.
1430
+ * - `slash_keys`: A list of slash keys identifying the slashes to remove. This is a tuple
1431
+ * of `(stash, slash_fraction, page_index)`.
1428
1432
  *
1429
1433
  * @param {number} era
1430
- * @param {Array<number>} slashIndices
1434
+ * @param {Array<[AccountId32Like, Perbill, number]>} slashKeys
1431
1435
  **/
1432
1436
  cancelDeferredSlash: GenericTxCall<
1433
1437
  Rv,
1434
1438
  (
1435
1439
  era: number,
1436
- slashIndices: Array<number>,
1440
+ slashKeys: Array<[AccountId32Like, Perbill, number]>,
1437
1441
  ) => ChainSubmittableExtrinsic<
1438
1442
  Rv,
1439
1443
  {
1440
1444
  pallet: 'Staking';
1441
1445
  palletCall: {
1442
1446
  name: 'CancelDeferredSlash';
1443
- params: { era: number; slashIndices: Array<number> };
1447
+ params: { era: number; slashKeys: Array<[AccountId32Like, Perbill, number]> };
1444
1448
  };
1445
1449
  }
1446
1450
  >
@@ -1851,6 +1855,99 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
1851
1855
  >
1852
1856
  >;
1853
1857
 
1858
+ /**
1859
+ * Migrates permissionlessly a stash from locks to holds.
1860
+ *
1861
+ * This removes the old lock on the stake and creates a hold on it atomically. If all
1862
+ * stake cannot be held, the best effort is made to hold as much as possible. The remaining
1863
+ * stake is removed from the ledger.
1864
+ *
1865
+ * The fee is waived if the migration is successful.
1866
+ *
1867
+ * @param {AccountId32Like} stash
1868
+ **/
1869
+ migrateCurrency: GenericTxCall<
1870
+ Rv,
1871
+ (stash: AccountId32Like) => ChainSubmittableExtrinsic<
1872
+ Rv,
1873
+ {
1874
+ pallet: 'Staking';
1875
+ palletCall: {
1876
+ name: 'MigrateCurrency';
1877
+ params: { stash: AccountId32Like };
1878
+ };
1879
+ }
1880
+ >
1881
+ >;
1882
+
1883
+ /**
1884
+ * Manually applies a deferred slash for a given era.
1885
+ *
1886
+ * Normally, slashes are automatically applied shortly after the start of the `slash_era`.
1887
+ * This function exists as a **fallback mechanism** in case slashes were not applied due to
1888
+ * unexpected reasons. It allows anyone to manually apply an unapplied slash.
1889
+ *
1890
+ * ## Parameters
1891
+ * - `slash_era`: The staking era in which the slash was originally scheduled.
1892
+ * - `slash_key`: A unique identifier for the slash, represented as a tuple:
1893
+ * - `stash`: The stash account of the validator being slashed.
1894
+ * - `slash_fraction`: The fraction of the stake that was slashed.
1895
+ * - `page_index`: The index of the exposure page being processed.
1896
+ *
1897
+ * ## Behavior
1898
+ * - The function is **permissionless**—anyone can call it.
1899
+ * - The `slash_era` **must be the current era or a past era**. If it is in the future, the
1900
+ * call fails with `EraNotStarted`.
1901
+ * - The fee is waived if the slash is successfully applied.
1902
+ *
1903
+ * ## TODO: Future Improvement
1904
+ * - Implement an **off-chain worker (OCW) task** to automatically apply slashes when there
1905
+ * is unused block space, improving efficiency.
1906
+ *
1907
+ * @param {number} slashEra
1908
+ * @param {[AccountId32Like, Perbill, number]} slashKey
1909
+ **/
1910
+ applySlash: GenericTxCall<
1911
+ Rv,
1912
+ (
1913
+ slashEra: number,
1914
+ slashKey: [AccountId32Like, Perbill, number],
1915
+ ) => ChainSubmittableExtrinsic<
1916
+ Rv,
1917
+ {
1918
+ pallet: 'Staking';
1919
+ palletCall: {
1920
+ name: 'ApplySlash';
1921
+ params: { slashEra: number; slashKey: [AccountId32Like, Perbill, number] };
1922
+ };
1923
+ }
1924
+ >
1925
+ >;
1926
+
1927
+ /**
1928
+ * Adjusts the staking ledger by withdrawing any excess staked amount.
1929
+ *
1930
+ * This function corrects cases where a user's recorded stake in the ledger
1931
+ * exceeds their actual staked funds. This situation can arise due to cases such as
1932
+ * external slashing by another pallet, leading to an inconsistency between the ledger
1933
+ * and the actual stake.
1934
+ *
1935
+ * @param {AccountId32Like} stash
1936
+ **/
1937
+ withdrawOverstake: GenericTxCall<
1938
+ Rv,
1939
+ (stash: AccountId32Like) => ChainSubmittableExtrinsic<
1940
+ Rv,
1941
+ {
1942
+ pallet: 'Staking';
1943
+ palletCall: {
1944
+ name: 'WithdrawOverstake';
1945
+ params: { stash: AccountId32Like };
1946
+ };
1947
+ }
1948
+ >
1949
+ >;
1950
+
1854
1951
  /**
1855
1952
  * Generic pallet tx call
1856
1953
  **/
@@ -2248,6 +2345,78 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
2248
2345
  >
2249
2346
  >;
2250
2347
 
2348
+ /**
2349
+ * Dispatch a fallback call in the event the main call fails to execute.
2350
+ * May be called from any origin except `None`.
2351
+ *
2352
+ * This function first attempts to dispatch the `main` call.
2353
+ * If the `main` call fails, the `fallback` is attemted.
2354
+ * if the fallback is successfully dispatched, the weights of both calls
2355
+ * are accumulated and an event containing the main call error is deposited.
2356
+ *
2357
+ * In the event of a fallback failure the whole call fails
2358
+ * with the weights returned.
2359
+ *
2360
+ * - `main`: The main call to be dispatched. This is the primary action to execute.
2361
+ * - `fallback`: The fallback call to be dispatched in case the `main` call fails.
2362
+ *
2363
+ * ## Dispatch Logic
2364
+ * - If the origin is `root`, both the main and fallback calls are executed without
2365
+ * applying any origin filters.
2366
+ * - If the origin is not `root`, the origin filter is applied to both the `main` and
2367
+ * `fallback` calls.
2368
+ *
2369
+ * ## Use Case
2370
+ * - Some use cases might involve submitting a `batch` type call in either main, fallback
2371
+ * or both.
2372
+ *
2373
+ * @param {WestendRuntimeRuntimeCallLike} main
2374
+ * @param {WestendRuntimeRuntimeCallLike} fallback
2375
+ **/
2376
+ ifElse: GenericTxCall<
2377
+ Rv,
2378
+ (
2379
+ main: WestendRuntimeRuntimeCallLike,
2380
+ fallback: WestendRuntimeRuntimeCallLike,
2381
+ ) => ChainSubmittableExtrinsic<
2382
+ Rv,
2383
+ {
2384
+ pallet: 'Utility';
2385
+ palletCall: {
2386
+ name: 'IfElse';
2387
+ params: { main: WestendRuntimeRuntimeCallLike; fallback: WestendRuntimeRuntimeCallLike };
2388
+ };
2389
+ }
2390
+ >
2391
+ >;
2392
+
2393
+ /**
2394
+ * Dispatches a function call with a provided origin.
2395
+ *
2396
+ * Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call.
2397
+ *
2398
+ * The dispatch origin for this call must be _Root_.
2399
+ *
2400
+ * @param {WestendRuntimeOriginCaller} asOrigin
2401
+ * @param {WestendRuntimeRuntimeCallLike} call
2402
+ **/
2403
+ dispatchAsFallible: GenericTxCall<
2404
+ Rv,
2405
+ (
2406
+ asOrigin: WestendRuntimeOriginCaller,
2407
+ call: WestendRuntimeRuntimeCallLike,
2408
+ ) => ChainSubmittableExtrinsic<
2409
+ Rv,
2410
+ {
2411
+ pallet: 'Utility';
2412
+ palletCall: {
2413
+ name: 'DispatchAsFallible';
2414
+ params: { asOrigin: WestendRuntimeOriginCaller; call: WestendRuntimeRuntimeCallLike };
2415
+ };
2416
+ }
2417
+ >
2418
+ >;
2419
+
2251
2420
  /**
2252
2421
  * Generic pallet tx call
2253
2422
  **/
@@ -2948,7 +3117,7 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
2948
3117
  >;
2949
3118
 
2950
3119
  /**
2951
- * Allow ROOT to bypass the recovery process and set an a rescuer account
3120
+ * Allow ROOT to bypass the recovery process and set a rescuer account
2952
3121
  * for a lost account directly.
2953
3122
  *
2954
3123
  * The dispatch origin for this call must be _ROOT_.
@@ -3789,7 +3958,7 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
3789
3958
  >;
3790
3959
 
3791
3960
  /**
3792
- * Ensure that the a bulk of pre-images is upgraded.
3961
+ * Ensure that the bulk of pre-images is upgraded.
3793
3962
  *
3794
3963
  * The caller pays no fee if at least 90% of pre-images were successfully updated.
3795
3964
  *
@@ -4658,21 +4827,15 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
4658
4827
  * This can only be called when [`Phase::Emergency`] is enabled, as an alternative to
4659
4828
  * calling [`Call::set_emergency_election_result`].
4660
4829
  *
4661
- * @param {number | undefined} maybeMaxVoters
4662
- * @param {number | undefined} maybeMaxTargets
4663
4830
  **/
4664
4831
  governanceFallback: GenericTxCall<
4665
4832
  Rv,
4666
- (
4667
- maybeMaxVoters: number | undefined,
4668
- maybeMaxTargets: number | undefined,
4669
- ) => ChainSubmittableExtrinsic<
4833
+ () => ChainSubmittableExtrinsic<
4670
4834
  Rv,
4671
4835
  {
4672
4836
  pallet: 'ElectionProviderMultiPhase';
4673
4837
  palletCall: {
4674
4838
  name: 'GovernanceFallback';
4675
- params: { maybeMaxVoters: number | undefined; maybeMaxTargets: number | undefined };
4676
4839
  };
4677
4840
  }
4678
4841
  >
@@ -4778,8 +4941,9 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
4778
4941
  **/
4779
4942
  nominationPools: {
4780
4943
  /**
4781
- * Stake funds with a pool. The amount to bond is transferred from the member to the pool
4782
- * account and immediately increases the pools bond.
4944
+ * Stake funds with a pool. The amount to bond is delegated (or transferred based on
4945
+ * [`adapter::StakeStrategyType`]) from the member to the pool account and immediately
4946
+ * increases the pool's bond.
4783
4947
  *
4784
4948
  * The method of transferring the amount to the pool account is determined by
4785
4949
  * [`adapter::StakeStrategyType`]. If the pool is configured to use
@@ -5077,13 +5241,13 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
5077
5241
  * The dispatch origin of this call must be signed by the pool nominator or the pool
5078
5242
  * root role.
5079
5243
  *
5080
- * This directly forward the call to the staking pallet, on behalf of the pool bonded
5081
- * account.
5244
+ * This directly forwards the call to an implementation of `StakingInterface` (e.g.,
5245
+ * `pallet-staking`) through [`Config::StakeAdapter`], on behalf of the bonded pool.
5082
5246
  *
5083
5247
  * # Note
5084
5248
  *
5085
- * In addition to a `root` or `nominator` role of `origin`, pool's depositor needs to have
5086
- * at least `depositor_min_bond` in the pool to start nominating.
5249
+ * In addition to a `root` or `nominator` role of `origin`, the pool's depositor needs to
5250
+ * have at least `depositor_min_bond` in the pool to start nominating.
5087
5251
  *
5088
5252
  * @param {number} poolId
5089
5253
  * @param {Array<AccountId32Like>} validators
@@ -5255,6 +5419,9 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
5255
5419
  * The dispatch origin of this call can be signed by the pool nominator or the pool
5256
5420
  * root role, same as [`Pallet::nominate`].
5257
5421
  *
5422
+ * This directly forwards the call to an implementation of `StakingInterface` (e.g.,
5423
+ * `pallet-staking`) through [`Config::StakeAdapter`], on behalf of the bonded pool.
5424
+ *
5258
5425
  * Under certain conditions, this call can be dispatched permissionlessly (i.e. by any
5259
5426
  * account).
5260
5427
  *
@@ -5263,9 +5430,7 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
5263
5430
  * are unable to unbond.
5264
5431
  *
5265
5432
  * # Conditions for permissioned dispatch:
5266
- * * The caller has a nominator or root role of the pool.
5267
- * This directly forward the call to the staking pallet, on behalf of the pool bonded
5268
- * account.
5433
+ * * The caller is the pool's nominator or root.
5269
5434
  *
5270
5435
  * @param {number} poolId
5271
5436
  **/
@@ -5444,9 +5609,20 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
5444
5609
  /**
5445
5610
  * Claim pending commission.
5446
5611
  *
5447
- * The dispatch origin of this call must be signed by the `root` role of the pool. Pending
5448
- * commission is paid out and added to total claimed commission`. Total pending commission
5449
- * is reset to zero. the current.
5612
+ * The `root` role of the pool is _always_ allowed to claim the pool's commission.
5613
+ *
5614
+ * If the pool has set `CommissionClaimPermission::Permissionless`, then any account can
5615
+ * trigger the process of claiming the pool's commission.
5616
+ *
5617
+ * If the pool has set its `CommissionClaimPermission` to `Account(acc)`, then only
5618
+ * accounts
5619
+ * * `acc`, and
5620
+ * * the pool's root account
5621
+ *
5622
+ * may call this extrinsic on behalf of the pool.
5623
+ *
5624
+ * Pending commissions are paid out and added to the total claimed commission.
5625
+ * The total pending commission is reset to zero.
5450
5626
  *
5451
5627
  * @param {number} poolId
5452
5628
  **/
@@ -5521,8 +5697,10 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
5521
5697
  * Fails unless [`crate::pallet::Config::StakeAdapter`] is of strategy type:
5522
5698
  * [`adapter::StakeStrategyType::Delegate`].
5523
5699
  *
5524
- * This call can be dispatched permissionlessly (i.e. by any account). If the member has
5525
- * slash to be applied, caller may be rewarded with the part of the slash.
5700
+ * The pending slash amount of the member must be equal or more than `ExistentialDeposit`.
5701
+ * This call can be dispatched permissionlessly (i.e. by any account). If the execution
5702
+ * is successful, fee is refunded and caller may be rewarded with a part of the slash
5703
+ * based on the [`crate::pallet::Config::StakeAdapter`] configuration.
5526
5704
  *
5527
5705
  * @param {MultiAddressLike} memberAccount
5528
5706
  **/
@@ -8235,6 +8413,45 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
8235
8413
  >
8236
8414
  >;
8237
8415
 
8416
+ /**
8417
+ * Create a single on demand core order with credits.
8418
+ * Will charge the owner's on-demand credit account the spot price for the current block.
8419
+ *
8420
+ * Parameters:
8421
+ * - `origin`: The sender of the call, on-demand credits will be withdrawn from this
8422
+ * account.
8423
+ * - `max_amount`: The maximum number of credits to spend from the origin to place an
8424
+ * order.
8425
+ * - `para_id`: A `ParaId` the origin wants to provide blockspace for.
8426
+ *
8427
+ * Errors:
8428
+ * - `InsufficientCredits`
8429
+ * - `QueueFull`
8430
+ * - `SpotPriceHigherThanMaxAmount`
8431
+ *
8432
+ * Events:
8433
+ * - `OnDemandOrderPlaced`
8434
+ *
8435
+ * @param {bigint} maxAmount
8436
+ * @param {PolkadotParachainPrimitivesPrimitivesId} paraId
8437
+ **/
8438
+ placeOrderWithCredits: GenericTxCall<
8439
+ Rv,
8440
+ (
8441
+ maxAmount: bigint,
8442
+ paraId: PolkadotParachainPrimitivesPrimitivesId,
8443
+ ) => ChainSubmittableExtrinsic<
8444
+ Rv,
8445
+ {
8446
+ pallet: 'OnDemandAssignmentProvider';
8447
+ palletCall: {
8448
+ name: 'PlaceOrderWithCredits';
8449
+ params: { maxAmount: bigint; paraId: PolkadotParachainPrimitivesPrimitivesId };
8450
+ };
8451
+ }
8452
+ >
8453
+ >;
8454
+
8238
8455
  /**
8239
8456
  * Generic pallet tx call
8240
8457
  **/
@@ -9327,6 +9544,28 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
9327
9544
  >
9328
9545
  >;
9329
9546
 
9547
+ /**
9548
+ *
9549
+ * @param {AccountId32Like} who
9550
+ * @param {bigint} amount
9551
+ **/
9552
+ creditAccount: GenericTxCall<
9553
+ Rv,
9554
+ (
9555
+ who: AccountId32Like,
9556
+ amount: bigint,
9557
+ ) => ChainSubmittableExtrinsic<
9558
+ Rv,
9559
+ {
9560
+ pallet: 'Coretime';
9561
+ palletCall: {
9562
+ name: 'CreditAccount';
9563
+ params: { who: AccountId32Like; amount: bigint };
9564
+ };
9565
+ }
9566
+ >
9567
+ >;
9568
+
9330
9569
  /**
9331
9570
  * Receive instructions from the `ExternalBrokerOrigin`, detailing how a specific core is
9332
9571
  * to be used.