@dedot/chaintypes 0.49.0 → 0.51.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedot/chaintypes",
3
- "version": "0.49.0",
3
+ "version": "0.51.0",
4
4
  "description": "Types for substrate-based chains",
5
5
  "author": "Thang X. Vu <thang@coongcrafts.io>",
6
6
  "main": "",
@@ -19,7 +19,7 @@
19
19
  "directory": "dist"
20
20
  },
21
21
  "license": "Apache-2.0",
22
- "gitHead": "7b83d0358fcd250bd9cf98721f9e19eafc5eb2b7",
22
+ "gitHead": "a5936f055485c83f250a353901eef85c82ba572c",
23
23
  "module": "./index.js",
24
24
  "types": "./index.d.ts"
25
25
  }
@@ -99,6 +99,15 @@ export interface ChainConsts<Rv extends RpcVersion> extends GenericChainConsts<R
99
99
  **/
100
100
  [name: string]: any;
101
101
  };
102
+ /**
103
+ * Pallet `WeightReclaim`'s constants
104
+ **/
105
+ weightReclaim: {
106
+ /**
107
+ * Generic pallet constant
108
+ **/
109
+ [name: string]: any;
110
+ };
102
111
  /**
103
112
  * Pallet `Balances`'s constants
104
113
  **/
@@ -878,7 +887,22 @@ export interface ChainConsts<Rv extends RpcVersion> extends GenericChainConsts<R
878
887
  * The ratio between the decimal representation of the native token and the ETH token.
879
888
  **/
880
889
  nativeToEthRatio: number;
881
- apiVersion: number;
890
+
891
+ /**
892
+ * Generic pallet constant
893
+ **/
894
+ [name: string]: any;
895
+ };
896
+ /**
897
+ * Pallet `AssetRewards`'s constants
898
+ **/
899
+ assetRewards: {
900
+ /**
901
+ * The pallet's unique identifier, used to derive the pool's account ID.
902
+ *
903
+ * The account ID is derived once during pool creation and stored in the storage.
904
+ **/
905
+ palletId: FrameSupportPalletId;
882
906
 
883
907
  /**
884
908
  * Generic pallet constant
@@ -1776,6 +1776,11 @@ export interface ChainErrors<Rv extends RpcVersion> extends GenericChainErrors<R
1776
1776
  **/
1777
1777
  BalanceConversionFailed: GenericPalletError<Rv>;
1778
1778
 
1779
+ /**
1780
+ * Failed to convert an EVM balance to a native balance.
1781
+ **/
1782
+ DecimalPrecisionLoss: GenericPalletError<Rv>;
1783
+
1779
1784
  /**
1780
1785
  * Immutable data can only be set during deploys and only be read during calls.
1781
1786
  * Additionally, it is only valid to set the data once and it must not be empty.
@@ -1794,6 +1799,70 @@ export interface ChainErrors<Rv extends RpcVersion> extends GenericChainErrors<R
1794
1799
  **/
1795
1800
  AccountAlreadyMapped: GenericPalletError<Rv>;
1796
1801
 
1802
+ /**
1803
+ * The transaction used to dry-run a contract is invalid.
1804
+ **/
1805
+ InvalidGenericTransaction: GenericPalletError<Rv>;
1806
+
1807
+ /**
1808
+ * Generic pallet error
1809
+ **/
1810
+ [error: string]: GenericPalletError<Rv>;
1811
+ };
1812
+ /**
1813
+ * Pallet `AssetRewards`'s errors
1814
+ **/
1815
+ assetRewards: {
1816
+ /**
1817
+ * The staker does not have enough tokens to perform the operation.
1818
+ **/
1819
+ NotEnoughTokens: GenericPalletError<Rv>;
1820
+
1821
+ /**
1822
+ * An operation was attempted on a non-existent pool.
1823
+ **/
1824
+ NonExistentPool: GenericPalletError<Rv>;
1825
+
1826
+ /**
1827
+ * An operation was attempted for a non-existent staker.
1828
+ **/
1829
+ NonExistentStaker: GenericPalletError<Rv>;
1830
+
1831
+ /**
1832
+ * An operation was attempted with a non-existent asset.
1833
+ **/
1834
+ NonExistentAsset: GenericPalletError<Rv>;
1835
+
1836
+ /**
1837
+ * There was an error converting a block number.
1838
+ **/
1839
+ BlockNumberConversionError: GenericPalletError<Rv>;
1840
+
1841
+ /**
1842
+ * The expiry block must be in the future.
1843
+ **/
1844
+ ExpiryBlockMustBeInTheFuture: GenericPalletError<Rv>;
1845
+
1846
+ /**
1847
+ * Insufficient funds to create the freeze.
1848
+ **/
1849
+ InsufficientFunds: GenericPalletError<Rv>;
1850
+
1851
+ /**
1852
+ * The expiry block can be only extended.
1853
+ **/
1854
+ ExpiryCut: GenericPalletError<Rv>;
1855
+
1856
+ /**
1857
+ * The reward rate per block can be only increased.
1858
+ **/
1859
+ RewardRateCut: GenericPalletError<Rv>;
1860
+
1861
+ /**
1862
+ * The pool still has staked tokens or rewards.
1863
+ **/
1864
+ NonEmptyPool: GenericPalletError<Rv>;
1865
+
1797
1866
  /**
1798
1867
  * Generic pallet error
1799
1868
  **/
@@ -31,7 +31,6 @@ import type {
31
31
  PalletNftsAttributeNamespace,
32
32
  PalletNftsPriceWithDirection,
33
33
  PalletNftsPalletAttributes,
34
- PalletReviveExecOrigin,
35
34
  PalletStateTrieMigrationMigrationCompute,
36
35
  PalletStateTrieMigrationError,
37
36
  } from './types';
@@ -2557,173 +2556,244 @@ export interface ChainEvents<Rv extends RpcVersion> extends GenericChainEvents<R
2557
2556
  **/
2558
2557
  revive: {
2559
2558
  /**
2560
- * Contract deployed by address at the specified address.
2561
- **/
2562
- Instantiated: GenericPalletEvent<Rv, 'Revive', 'Instantiated', { deployer: H160; contract: H160 }>;
2563
-
2564
- /**
2565
- * Contract has been removed.
2566
- *
2567
- * # Note
2568
- *
2569
- * The only way for a contract to be removed and emitting this event is by calling
2570
- * `seal_terminate`.
2559
+ * A custom event emitted by the contract.
2571
2560
  **/
2572
- Terminated: GenericPalletEvent<
2561
+ ContractEmitted: GenericPalletEvent<
2573
2562
  Rv,
2574
2563
  'Revive',
2575
- 'Terminated',
2564
+ 'ContractEmitted',
2576
2565
  {
2577
2566
  /**
2578
- * The contract that was terminated.
2567
+ * The contract that emitted the event.
2579
2568
  **/
2580
2569
  contract: H160;
2581
2570
 
2582
2571
  /**
2583
- * The account that received the contracts remaining balance
2572
+ * Data supplied by the contract. Metadata generated during contract compilation
2573
+ * is needed to decode it.
2584
2574
  **/
2585
- beneficiary: H160;
2575
+ data: Bytes;
2576
+
2577
+ /**
2578
+ * A list of topics used to index the event.
2579
+ * Number of topics is capped by [`limits::NUM_EVENT_TOPICS`].
2580
+ **/
2581
+ topics: Array<H256>;
2586
2582
  }
2587
2583
  >;
2588
2584
 
2589
2585
  /**
2590
- * Code with the specified hash has been stored.
2586
+ * Generic pallet event
2591
2587
  **/
2592
- CodeStored: GenericPalletEvent<Rv, 'Revive', 'CodeStored', { codeHash: H256; depositHeld: bigint; uploader: H160 }>;
2588
+ [prop: string]: GenericPalletEvent<Rv>;
2589
+ };
2590
+ /**
2591
+ * Pallet `AssetRewards`'s events
2592
+ **/
2593
+ assetRewards: {
2594
+ /**
2595
+ * An account staked some tokens in a pool.
2596
+ **/
2597
+ Staked: GenericPalletEvent<
2598
+ Rv,
2599
+ 'AssetRewards',
2600
+ 'Staked',
2601
+ {
2602
+ /**
2603
+ * The account that staked assets.
2604
+ **/
2605
+ staker: AccountId32;
2606
+
2607
+ /**
2608
+ * The pool.
2609
+ **/
2610
+ poolId: number;
2611
+
2612
+ /**
2613
+ * The staked asset amount.
2614
+ **/
2615
+ amount: bigint;
2616
+ }
2617
+ >;
2593
2618
 
2594
2619
  /**
2595
- * A custom event emitted by the contract.
2620
+ * An account unstaked some tokens from a pool.
2596
2621
  **/
2597
- ContractEmitted: GenericPalletEvent<
2622
+ Unstaked: GenericPalletEvent<
2598
2623
  Rv,
2599
- 'Revive',
2600
- 'ContractEmitted',
2624
+ 'AssetRewards',
2625
+ 'Unstaked',
2601
2626
  {
2602
2627
  /**
2603
- * The contract that emitted the event.
2628
+ * The account that signed transaction.
2604
2629
  **/
2605
- contract: H160;
2630
+ caller: AccountId32;
2606
2631
 
2607
2632
  /**
2608
- * Data supplied by the contract. Metadata generated during contract compilation
2609
- * is needed to decode it.
2633
+ * The account that unstaked assets.
2610
2634
  **/
2611
- data: Bytes;
2635
+ staker: AccountId32;
2612
2636
 
2613
2637
  /**
2614
- * A list of topics used to index the event.
2615
- * Number of topics is capped by [`limits::NUM_EVENT_TOPICS`].
2638
+ * The pool.
2616
2639
  **/
2617
- topics: Array<H256>;
2640
+ poolId: number;
2641
+
2642
+ /**
2643
+ * The unstaked asset amount.
2644
+ **/
2645
+ amount: bigint;
2618
2646
  }
2619
2647
  >;
2620
2648
 
2621
2649
  /**
2622
- * A code with the specified hash was removed.
2650
+ * An account harvested some rewards.
2623
2651
  **/
2624
- CodeRemoved: GenericPalletEvent<
2652
+ RewardsHarvested: GenericPalletEvent<
2625
2653
  Rv,
2626
- 'Revive',
2627
- 'CodeRemoved',
2628
- { codeHash: H256; depositReleased: bigint; remover: H160 }
2654
+ 'AssetRewards',
2655
+ 'RewardsHarvested',
2656
+ {
2657
+ /**
2658
+ * The account that signed transaction.
2659
+ **/
2660
+ caller: AccountId32;
2661
+
2662
+ /**
2663
+ * The staker whos rewards were harvested.
2664
+ **/
2665
+ staker: AccountId32;
2666
+
2667
+ /**
2668
+ * The pool.
2669
+ **/
2670
+ poolId: number;
2671
+
2672
+ /**
2673
+ * The amount of harvested tokens.
2674
+ **/
2675
+ amount: bigint;
2676
+ }
2629
2677
  >;
2630
2678
 
2631
2679
  /**
2632
- * A contract's code was updated.
2680
+ * A new reward pool was created.
2633
2681
  **/
2634
- ContractCodeUpdated: GenericPalletEvent<
2682
+ PoolCreated: GenericPalletEvent<
2635
2683
  Rv,
2636
- 'Revive',
2637
- 'ContractCodeUpdated',
2684
+ 'AssetRewards',
2685
+ 'PoolCreated',
2638
2686
  {
2639
2687
  /**
2640
- * The contract that has been updated.
2688
+ * The account that created the pool.
2641
2689
  **/
2642
- contract: H160;
2690
+ creator: AccountId32;
2691
+
2692
+ /**
2693
+ * The unique ID for the new pool.
2694
+ **/
2695
+ poolId: number;
2696
+
2697
+ /**
2698
+ * The staking asset.
2699
+ **/
2700
+ stakedAssetId: StagingXcmV5Location;
2643
2701
 
2644
2702
  /**
2645
- * New code hash that was set for the contract.
2703
+ * The reward asset.
2646
2704
  **/
2647
- newCodeHash: H256;
2705
+ rewardAssetId: StagingXcmV5Location;
2648
2706
 
2649
2707
  /**
2650
- * Previous code hash of the contract.
2708
+ * The initial reward rate per block.
2651
2709
  **/
2652
- oldCodeHash: H256;
2710
+ rewardRatePerBlock: bigint;
2711
+
2712
+ /**
2713
+ * The block the pool will cease to accumulate rewards.
2714
+ **/
2715
+ expiryBlock: number;
2716
+
2717
+ /**
2718
+ * The account allowed to modify the pool.
2719
+ **/
2720
+ admin: AccountId32;
2653
2721
  }
2654
2722
  >;
2655
2723
 
2656
2724
  /**
2657
- * A contract was called either by a plain account or another contract.
2658
- *
2659
- * # Note
2660
- *
2661
- * Please keep in mind that like all events this is only emitted for successful
2662
- * calls. This is because on failure all storage changes including events are
2663
- * rolled back.
2725
+ * A pool reward rate was modified by the admin.
2664
2726
  **/
2665
- Called: GenericPalletEvent<
2727
+ PoolRewardRateModified: GenericPalletEvent<
2666
2728
  Rv,
2667
- 'Revive',
2668
- 'Called',
2729
+ 'AssetRewards',
2730
+ 'PoolRewardRateModified',
2669
2731
  {
2670
2732
  /**
2671
- * The caller of the `contract`.
2733
+ * The modified pool.
2672
2734
  **/
2673
- caller: PalletReviveExecOrigin;
2735
+ poolId: number;
2674
2736
 
2675
2737
  /**
2676
- * The contract that was called.
2738
+ * The new reward rate per block.
2677
2739
  **/
2678
- contract: H160;
2740
+ newRewardRatePerBlock: bigint;
2679
2741
  }
2680
2742
  >;
2681
2743
 
2682
2744
  /**
2683
- * A contract delegate called a code hash.
2684
- *
2685
- * # Note
2686
- *
2687
- * Please keep in mind that like all events this is only emitted for successful
2688
- * calls. This is because on failure all storage changes including events are
2689
- * rolled back.
2745
+ * A pool admin was modified.
2690
2746
  **/
2691
- DelegateCalled: GenericPalletEvent<
2747
+ PoolAdminModified: GenericPalletEvent<
2692
2748
  Rv,
2693
- 'Revive',
2694
- 'DelegateCalled',
2749
+ 'AssetRewards',
2750
+ 'PoolAdminModified',
2695
2751
  {
2696
2752
  /**
2697
- * The contract that performed the delegate call and hence in whose context
2698
- * the `code_hash` is executed.
2753
+ * The modified pool.
2699
2754
  **/
2700
- contract: H160;
2755
+ poolId: number;
2701
2756
 
2702
2757
  /**
2703
- * The code hash that was delegate called.
2758
+ * The new admin.
2704
2759
  **/
2705
- codeHash: H256;
2760
+ newAdmin: AccountId32;
2706
2761
  }
2707
2762
  >;
2708
2763
 
2709
2764
  /**
2710
- * Some funds have been transferred and held as storage deposit.
2765
+ * A pool expiry block was modified by the admin.
2711
2766
  **/
2712
- StorageDepositTransferredAndHeld: GenericPalletEvent<
2767
+ PoolExpiryBlockModified: GenericPalletEvent<
2713
2768
  Rv,
2714
- 'Revive',
2715
- 'StorageDepositTransferredAndHeld',
2716
- { from: H160; to: H160; amount: bigint }
2769
+ 'AssetRewards',
2770
+ 'PoolExpiryBlockModified',
2771
+ {
2772
+ /**
2773
+ * The modified pool.
2774
+ **/
2775
+ poolId: number;
2776
+
2777
+ /**
2778
+ * The new expiry block.
2779
+ **/
2780
+ newExpiryBlock: number;
2781
+ }
2717
2782
  >;
2718
2783
 
2719
2784
  /**
2720
- * Some storage deposit funds have been transferred and released.
2785
+ * A pool information was cleared after it's completion.
2721
2786
  **/
2722
- StorageDepositTransferredAndReleased: GenericPalletEvent<
2787
+ PoolCleanedUp: GenericPalletEvent<
2723
2788
  Rv,
2724
- 'Revive',
2725
- 'StorageDepositTransferredAndReleased',
2726
- { from: H160; to: H160; amount: bigint }
2789
+ 'AssetRewards',
2790
+ 'PoolCleanedUp',
2791
+ {
2792
+ /**
2793
+ * The cleared pool.
2794
+ **/
2795
+ poolId: number;
2796
+ }
2727
2797
  >;
2728
2798
 
2729
2799
  /**
@@ -23,7 +23,7 @@ export interface VersionedWestendAssetHubApi<Rv extends RpcVersion> extends Gene
23
23
 
24
24
  /**
25
25
  * @name: WestendAssetHubApi
26
- * @specVersion: 1017003
26
+ * @specVersion: 1017005
27
27
  **/
28
28
  export interface WestendAssetHubApi {
29
29
  legacy: VersionedWestendAssetHubApi<RpcLegacy>;
@@ -19,6 +19,7 @@ import type {
19
19
  FrameSystemEventRecord,
20
20
  FrameSystemLastRuntimeUpgradeInfo,
21
21
  FrameSystemCodeUpgradeAuthorization,
22
+ SpWeightsWeightV2Weight,
22
23
  CumulusPalletParachainSystemUnincludedSegmentAncestor,
23
24
  CumulusPalletParachainSystemUnincludedSegmentSegmentTracker,
24
25
  PolkadotPrimitivesV8PersistedValidationData,
@@ -30,12 +31,11 @@ import type {
30
31
  CumulusPrimitivesParachainInherentMessageQueueChain,
31
32
  PolkadotParachainPrimitivesPrimitivesId,
32
33
  PolkadotCorePrimitivesOutboundHrmpMessage,
33
- SpWeightsWeightV2Weight,
34
34
  PalletBalancesAccountData,
35
35
  PalletBalancesBalanceLock,
36
36
  PalletBalancesReserveData,
37
37
  FrameSupportTokensMiscIdAmount,
38
- FrameSupportTokensMiscIdAmount002,
38
+ FrameSupportTokensMiscIdAmountRuntimeFreezeReason,
39
39
  PalletTransactionPaymentReleases,
40
40
  PalletCollatorSelectionCandidateInfo,
41
41
  AssetHubWestendRuntimeSessionKeys,
@@ -78,10 +78,12 @@ import type {
78
78
  StagingXcmV5Location,
79
79
  PalletNftFractionalizationDetails,
80
80
  PalletAssetConversionPoolInfo,
81
- FrameSupportTokensMiscIdAmountRuntimeFreezeReason,
82
81
  PalletReviveWasmCodeInfo,
83
82
  PalletReviveStorageContractInfo,
84
83
  PalletReviveStorageDeletionQueueManager,
84
+ PalletAssetRewardsPoolStakerInfo,
85
+ PalletAssetRewardsPoolInfo,
86
+ FrameSupportTokensFungibleHoldConsideration,
85
87
  PalletStateTrieMigrationMigrationTask,
86
88
  PalletStateTrieMigrationMigrationLimits,
87
89
  } from './types';
@@ -237,6 +239,19 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
237
239
  **/
238
240
  authorizedUpgrade: GenericStorageQuery<Rv, () => FrameSystemCodeUpgradeAuthorization | undefined>;
239
241
 
242
+ /**
243
+ * The weight reclaimed for the extrinsic.
244
+ *
245
+ * This information is available until the end of the extrinsic execution.
246
+ * More precisely this information is removed in `note_applied_extrinsic`.
247
+ *
248
+ * Logic doing some post dispatch weight reduction must update this storage to avoid duplicate
249
+ * reduction.
250
+ *
251
+ * @param {Callback<SpWeightsWeightV2Weight> =} callback
252
+ **/
253
+ extrinsicWeightReclaimed: GenericStorageQuery<Rv, () => SpWeightsWeightV2Weight>;
254
+
240
255
  /**
241
256
  * Generic pallet storage query
242
257
  **/
@@ -616,9 +631,13 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
616
631
  * Freeze locks on account balances.
617
632
  *
618
633
  * @param {AccountId32Like} arg
619
- * @param {Callback<Array<FrameSupportTokensMiscIdAmount002>> =} callback
634
+ * @param {Callback<Array<FrameSupportTokensMiscIdAmountRuntimeFreezeReason>> =} callback
620
635
  **/
621
- freezes: GenericStorageQuery<Rv, (arg: AccountId32Like) => Array<FrameSupportTokensMiscIdAmount002>, AccountId32>;
636
+ freezes: GenericStorageQuery<
637
+ Rv,
638
+ (arg: AccountId32Like) => Array<FrameSupportTokensMiscIdAmountRuntimeFreezeReason>,
639
+ AccountId32
640
+ >;
622
641
 
623
642
  /**
624
643
  * Generic pallet storage query
@@ -830,13 +849,14 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
830
849
  authorities: GenericStorageQuery<Rv, () => Array<SpConsensusAuraSr25519AppSr25519Public>>;
831
850
 
832
851
  /**
833
- * Current slot paired with a number of authored blocks.
852
+ * Current relay chain slot paired with a number of authored blocks.
834
853
  *
835
- * Updated on each block initialization.
854
+ * This is updated in [`FixedVelocityConsensusHook::on_state_proof`] with the current relay
855
+ * chain slot as provided by the relay chain state proof.
836
856
  *
837
857
  * @param {Callback<[SpConsensusSlotsSlot, number] | undefined> =} callback
838
858
  **/
839
- slotInfo: GenericStorageQuery<Rv, () => [SpConsensusSlotsSlot, number] | undefined>;
859
+ relaySlotInfo: GenericStorageQuery<Rv, () => [SpConsensusSlotsSlot, number] | undefined>;
840
860
 
841
861
  /**
842
862
  * Generic pallet storage query
@@ -1894,6 +1914,59 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1894
1914
  **/
1895
1915
  [storage: string]: GenericStorageQuery<Rv>;
1896
1916
  };
1917
+ /**
1918
+ * Pallet `AssetRewards`'s storage queries
1919
+ **/
1920
+ assetRewards: {
1921
+ /**
1922
+ * State of pool stakers.
1923
+ *
1924
+ * @param {[number, AccountId32Like]} arg
1925
+ * @param {Callback<PalletAssetRewardsPoolStakerInfo | undefined> =} callback
1926
+ **/
1927
+ poolStakers: GenericStorageQuery<
1928
+ Rv,
1929
+ (arg: [number, AccountId32Like]) => PalletAssetRewardsPoolStakerInfo | undefined,
1930
+ [number, AccountId32]
1931
+ >;
1932
+
1933
+ /**
1934
+ * State and configuration of each staking pool.
1935
+ *
1936
+ * @param {number} arg
1937
+ * @param {Callback<PalletAssetRewardsPoolInfo | undefined> =} callback
1938
+ **/
1939
+ pools: GenericStorageQuery<Rv, (arg: number) => PalletAssetRewardsPoolInfo | undefined, number>;
1940
+
1941
+ /**
1942
+ * The cost associated with storing pool information on-chain which was incurred by the pool
1943
+ * creator.
1944
+ *
1945
+ * This cost may be [`None`], as determined by [`Config::Consideration`].
1946
+ *
1947
+ * @param {number} arg
1948
+ * @param {Callback<[AccountId32, FrameSupportTokensFungibleHoldConsideration] | undefined> =} callback
1949
+ **/
1950
+ poolCost: GenericStorageQuery<
1951
+ Rv,
1952
+ (arg: number) => [AccountId32, FrameSupportTokensFungibleHoldConsideration] | undefined,
1953
+ number
1954
+ >;
1955
+
1956
+ /**
1957
+ * Stores the [`PoolId`] to use for the next pool.
1958
+ *
1959
+ * Incremented when a new pool is created.
1960
+ *
1961
+ * @param {Callback<number> =} callback
1962
+ **/
1963
+ nextPoolId: GenericStorageQuery<Rv, () => number>;
1964
+
1965
+ /**
1966
+ * Generic pallet storage query
1967
+ **/
1968
+ [storage: string]: GenericStorageQuery<Rv>;
1969
+ };
1897
1970
  /**
1898
1971
  * Pallet `StateTrieMigration`'s storage queries
1899
1972
  **/