@dedot/chaintypes 0.98.0 → 0.99.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.
@@ -23,6 +23,7 @@ import type {
23
23
  FrameSystemEventRecord,
24
24
  FrameSystemLastRuntimeUpgradeInfo,
25
25
  FrameSystemCodeUpgradeAuthorization,
26
+ SpWeightsWeightV2Weight,
26
27
  SpConsensusBabeAppPublic,
27
28
  SpConsensusSlotsSlot,
28
29
  SpConsensusBabeDigestsNextConfigDescriptor,
@@ -54,6 +55,7 @@ import type {
54
55
  PalletStakingSlashingSlashingSpans,
55
56
  PalletStakingSlashingSpanRecord,
56
57
  KitchensinkRuntimeSessionKeys,
58
+ SpStakingOffenceOffenceSeverity,
57
59
  SpCoreCryptoKeyTypeId,
58
60
  FrameSupportPreimagesBounded,
59
61
  PalletDemocracyReferendumInfo,
@@ -177,6 +179,10 @@ import type {
177
179
  PalletReviveWasmCodeInfo,
178
180
  PalletReviveStorageContractInfo,
179
181
  PalletReviveStorageDeletionQueueManager,
182
+ PalletDelegatedStakingDelegation,
183
+ PalletDelegatedStakingAgentLedger,
184
+ PalletAssetRewardsPoolStakerInfo,
185
+ PalletAssetRewardsPoolInfo,
180
186
  } from './types.js';
181
187
 
182
188
  export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage<Rv> {
@@ -330,6 +336,19 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
330
336
  **/
331
337
  authorizedUpgrade: GenericStorageQuery<Rv, () => FrameSystemCodeUpgradeAuthorization | undefined>;
332
338
 
339
+ /**
340
+ * The weight reclaimed for the extrinsic.
341
+ *
342
+ * This information is available until the end of the extrinsic execution.
343
+ * More precisely this information is removed in `note_applied_extrinsic`.
344
+ *
345
+ * Logic doing some post dispatch weight reduction must update this storage to avoid duplicate
346
+ * reduction.
347
+ *
348
+ * @param {Callback<SpWeightsWeightV2Weight> =} callback
349
+ **/
350
+ extrinsicWeightReclaimed: GenericStorageQuery<Rv, () => SpWeightsWeightV2Weight>;
351
+
333
352
  /**
334
353
  * Generic pallet storage query
335
354
  **/
@@ -1256,19 +1275,6 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1256
1275
  **/
1257
1276
  currentPlannedSession: GenericStorageQuery<Rv, () => number>;
1258
1277
 
1259
- /**
1260
- * Indices of validators that have offended in the active era. The offenders are disabled for a
1261
- * whole era. For this reason they are kept here - only staking pallet knows about eras. The
1262
- * implementor of [`DisablingStrategy`] defines if a validator should be disabled which
1263
- * implicitly means that the implementor also controls the max number of disabled validators.
1264
- *
1265
- * The vec is always kept sorted so that we can find whether a given validator has previously
1266
- * offended using binary search.
1267
- *
1268
- * @param {Callback<Array<number>> =} callback
1269
- **/
1270
- disabledValidators: GenericStorageQuery<Rv, () => Array<number>>;
1271
-
1272
1278
  /**
1273
1279
  * The threshold for when users can start calling `chill_other` for other validators /
1274
1280
  * nominators. The threshold is compared to the actual number of validators / nominators
@@ -1324,9 +1330,9 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1324
1330
  * disabled using binary search. It gets cleared when `on_session_ending` returns
1325
1331
  * a new set of identities.
1326
1332
  *
1327
- * @param {Callback<Array<number>> =} callback
1333
+ * @param {Callback<Array<[number, SpStakingOffenceOffenceSeverity]>> =} callback
1328
1334
  **/
1329
- disabledValidators: GenericStorageQuery<Rv, () => Array<number>>;
1335
+ disabledValidators: GenericStorageQuery<Rv, () => Array<[number, SpStakingOffenceOffenceSeverity]>>;
1330
1336
 
1331
1337
  /**
1332
1338
  * The next session keys for a validator.
@@ -2465,6 +2471,7 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
2465
2471
  **/
2466
2472
  scheduler: {
2467
2473
  /**
2474
+ * Block number at which the agenda began incomplete execution.
2468
2475
  *
2469
2476
  * @param {Callback<number | undefined> =} callback
2470
2477
  **/
@@ -4777,14 +4784,151 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
4777
4784
  /**
4778
4785
  * Map a Ethereum address to its original `AccountId32`.
4779
4786
  *
4780
- * Stores the last 12 byte for addresses that were originally an `AccountId32` instead
4781
- * of an `H160`. Register your `AccountId32` using [`Pallet::map_account`] in order to
4787
+ * When deriving a `H160` from an `AccountId32` we use a hash function. In order to
4788
+ * reconstruct the original account we need to store the reverse mapping here.
4789
+ * Register your `AccountId32` using [`Pallet::map_account`] in order to
4782
4790
  * use it with this pallet.
4783
4791
  *
4784
4792
  * @param {H160} arg
4785
- * @param {Callback<FixedBytes<12> | undefined> =} callback
4793
+ * @param {Callback<AccountId32 | undefined> =} callback
4786
4794
  **/
4787
- addressSuffix: GenericStorageQuery<Rv, (arg: H160) => FixedBytes<12> | undefined, H160>;
4795
+ originalAccount: GenericStorageQuery<Rv, (arg: H160) => AccountId32 | undefined, H160>;
4796
+
4797
+ /**
4798
+ * Generic pallet storage query
4799
+ **/
4800
+ [storage: string]: GenericStorageQuery<Rv>;
4801
+ };
4802
+ /**
4803
+ * Pallet `DelegatedStaking`'s storage queries
4804
+ **/
4805
+ delegatedStaking: {
4806
+ /**
4807
+ * Map of Delegators to their `Delegation`.
4808
+ *
4809
+ * Implementation note: We are not using a double map with `delegator` and `agent` account
4810
+ * as keys since we want to restrict delegators to delegate only to one account at a time.
4811
+ *
4812
+ * @param {AccountId32Like} arg
4813
+ * @param {Callback<PalletDelegatedStakingDelegation | undefined> =} callback
4814
+ **/
4815
+ delegators: GenericStorageQuery<
4816
+ Rv,
4817
+ (arg: AccountId32Like) => PalletDelegatedStakingDelegation | undefined,
4818
+ AccountId32
4819
+ >;
4820
+
4821
+ /**
4822
+ * Counter for the related counted storage map
4823
+ *
4824
+ * @param {Callback<number> =} callback
4825
+ **/
4826
+ counterForDelegators: GenericStorageQuery<Rv, () => number>;
4827
+
4828
+ /**
4829
+ * Map of `Agent` to their `Ledger`.
4830
+ *
4831
+ * @param {AccountId32Like} arg
4832
+ * @param {Callback<PalletDelegatedStakingAgentLedger | undefined> =} callback
4833
+ **/
4834
+ agents: GenericStorageQuery<
4835
+ Rv,
4836
+ (arg: AccountId32Like) => PalletDelegatedStakingAgentLedger | undefined,
4837
+ AccountId32
4838
+ >;
4839
+
4840
+ /**
4841
+ * Counter for the related counted storage map
4842
+ *
4843
+ * @param {Callback<number> =} callback
4844
+ **/
4845
+ counterForAgents: GenericStorageQuery<Rv, () => number>;
4846
+
4847
+ /**
4848
+ * Generic pallet storage query
4849
+ **/
4850
+ [storage: string]: GenericStorageQuery<Rv>;
4851
+ };
4852
+ /**
4853
+ * Pallet `AssetRewards`'s storage queries
4854
+ **/
4855
+ assetRewards: {
4856
+ /**
4857
+ * State of pool stakers.
4858
+ *
4859
+ * @param {[number, AccountId32Like]} arg
4860
+ * @param {Callback<PalletAssetRewardsPoolStakerInfo | undefined> =} callback
4861
+ **/
4862
+ poolStakers: GenericStorageQuery<
4863
+ Rv,
4864
+ (arg: [number, AccountId32Like]) => PalletAssetRewardsPoolStakerInfo | undefined,
4865
+ [number, AccountId32]
4866
+ >;
4867
+
4868
+ /**
4869
+ * State and configuration of each staking pool.
4870
+ *
4871
+ * @param {number} arg
4872
+ * @param {Callback<PalletAssetRewardsPoolInfo | undefined> =} callback
4873
+ **/
4874
+ pools: GenericStorageQuery<Rv, (arg: number) => PalletAssetRewardsPoolInfo | undefined, number>;
4875
+
4876
+ /**
4877
+ * The cost associated with storing pool information on-chain which was incurred by the pool
4878
+ * creator.
4879
+ *
4880
+ * This cost may be [`None`], as determined by [`Config::Consideration`].
4881
+ *
4882
+ * @param {number} arg
4883
+ * @param {Callback<[AccountId32, FrameSupportTokensFungibleHoldConsideration] | undefined> =} callback
4884
+ **/
4885
+ poolCost: GenericStorageQuery<
4886
+ Rv,
4887
+ (arg: number) => [AccountId32, FrameSupportTokensFungibleHoldConsideration] | undefined,
4888
+ number
4889
+ >;
4890
+
4891
+ /**
4892
+ * Stores the [`PoolId`] to use for the next pool.
4893
+ *
4894
+ * Incremented when a new pool is created.
4895
+ *
4896
+ * @param {Callback<number> =} callback
4897
+ **/
4898
+ nextPoolId: GenericStorageQuery<Rv, () => number>;
4899
+
4900
+ /**
4901
+ * Generic pallet storage query
4902
+ **/
4903
+ [storage: string]: GenericStorageQuery<Rv>;
4904
+ };
4905
+ /**
4906
+ * Pallet `AssetsFreezer`'s storage queries
4907
+ **/
4908
+ assetsFreezer: {
4909
+ /**
4910
+ * A map that stores freezes applied on an account for a given AssetId.
4911
+ *
4912
+ * @param {[number, AccountId32Like]} arg
4913
+ * @param {Callback<Array<FrameSupportTokensMiscIdAmountRuntimeFreezeReason>> =} callback
4914
+ **/
4915
+ freezes: GenericStorageQuery<
4916
+ Rv,
4917
+ (arg: [number, AccountId32Like]) => Array<FrameSupportTokensMiscIdAmountRuntimeFreezeReason>,
4918
+ [number, AccountId32]
4919
+ >;
4920
+
4921
+ /**
4922
+ * A map that stores the current total frozen balance for every account on a given AssetId.
4923
+ *
4924
+ * @param {[number, AccountId32Like]} arg
4925
+ * @param {Callback<bigint | undefined> =} callback
4926
+ **/
4927
+ frozenBalances: GenericStorageQuery<
4928
+ Rv,
4929
+ (arg: [number, AccountId32Like]) => bigint | undefined,
4930
+ [number, AccountId32]
4931
+ >;
4788
4932
 
4789
4933
  /**
4790
4934
  * Generic pallet storage query
@@ -4,15 +4,16 @@ 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
  AccountId32Like,
13
15
  AccountId32,
14
- BytesLike,
15
- Bytes,
16
+ U256,
16
17
  H160,
17
18
  FixedBytes,
18
19
  } from 'dedot/codecs';
@@ -20,6 +21,8 @@ import type {
20
21
  SpRuntimeBlock,
21
22
  SpRuntimeExtrinsicInclusionMode,
22
23
  SpCoreOpaqueMetadata,
24
+ FrameSupportViewFunctionsViewFunctionDispatchError,
25
+ FrameSupportViewFunctionsViewFunctionId,
23
26
  SpRuntimeTransactionValidityTransactionValidityError,
24
27
  SpInherentsInherentData,
25
28
  SpInherentsCheckInherentsResult,
@@ -49,9 +52,13 @@ import type {
49
52
  PalletRevivePrimitivesContractResult,
50
53
  PalletRevivePrimitivesContractResultInstantiateReturnValue,
51
54
  PalletRevivePrimitivesCode,
52
- PalletRevivePrimitivesEthContractResult,
55
+ PalletRevivePrimitivesEthTransactInfo,
56
+ PalletRevivePrimitivesEthTransactError,
57
+ PalletReviveEvmApiRpcTypesGenGenericTransaction,
53
58
  PalletRevivePrimitivesCodeUploadReturnValue,
54
59
  PalletRevivePrimitivesContractAccessError,
60
+ PalletReviveEvmApiDebugRpcTypesCallTrace,
61
+ PalletReviveEvmApiDebugRpcTypesTracerConfig,
55
62
  PalletTransactionPaymentRuntimeDispatchInfo,
56
63
  PalletTransactionPaymentFeeDetails,
57
64
  FrameSupportTokensFungibleUnionOfNativeOrWithId,
@@ -139,6 +146,30 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
139
146
  **/
140
147
  [method: string]: GenericRuntimeApiMethod<Rv>;
141
148
  };
149
+ /**
150
+ * @runtimeapi: RuntimeViewFunction - 0xccd9de6396c899ca
151
+ **/
152
+ runtimeViewFunction: {
153
+ /**
154
+ * Execute a view function query.
155
+ *
156
+ * @callname: RuntimeViewFunction_execute_view_function
157
+ * @param {FrameSupportViewFunctionsViewFunctionId} query_id
158
+ * @param {BytesLike} input
159
+ **/
160
+ executeViewFunction: GenericRuntimeApiMethod<
161
+ Rv,
162
+ (
163
+ queryId: FrameSupportViewFunctionsViewFunctionId,
164
+ input: BytesLike,
165
+ ) => Promise<Result<Bytes, FrameSupportViewFunctionsViewFunctionDispatchError>>
166
+ >;
167
+
168
+ /**
169
+ * Generic runtime api call
170
+ **/
171
+ [method: string]: GenericRuntimeApiMethod<Rv>;
172
+ };
142
173
  /**
143
174
  * @runtimeapi: BlockBuilder - 0x40fe3ad401f8959a
144
175
  **/
@@ -384,6 +415,9 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
384
415
  /**
385
416
  * Returns the pending slash for a given pool member.
386
417
  *
418
+ * If pending slash of the member exceeds `ExistentialDeposit`, it can be reported on
419
+ * chain.
420
+ *
387
421
  * @callname: NominationPoolsApi_member_pending_slash
388
422
  * @param {AccountId32Like} member
389
423
  **/
@@ -723,12 +757,26 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
723
757
  **/
724
758
  reviveApi: {
725
759
  /**
726
- * Returns the free balance of the given `[H160]` address.
760
+ * Returns the block gas limit.
761
+ *
762
+ * @callname: ReviveApi_block_gas_limit
763
+ **/
764
+ blockGasLimit: GenericRuntimeApiMethod<Rv, () => Promise<U256>>;
765
+
766
+ /**
767
+ * Returns the free balance of the given `[H160]` address, using EVM decimals.
727
768
  *
728
769
  * @callname: ReviveApi_balance
729
770
  * @param {H160} address
730
771
  **/
731
- balance: GenericRuntimeApiMethod<Rv, (address: H160) => Promise<bigint>>;
772
+ balance: GenericRuntimeApiMethod<Rv, (address: H160) => Promise<U256>>;
773
+
774
+ /**
775
+ * Returns the gas price.
776
+ *
777
+ * @callname: ReviveApi_gas_price
778
+ **/
779
+ gasPrice: GenericRuntimeApiMethod<Rv, () => Promise<U256>>;
732
780
 
733
781
  /**
734
782
  * Returns the nonce of the given `[H160]` address.
@@ -796,23 +844,13 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
796
844
  * See [`crate::Pallet::bare_eth_transact`]
797
845
  *
798
846
  * @callname: ReviveApi_eth_transact
799
- * @param {H160} origin
800
- * @param {H160 | undefined} dest
801
- * @param {bigint} value
802
- * @param {BytesLike} input
803
- * @param {SpWeightsWeightV2Weight | undefined} gas_limit
804
- * @param {bigint | undefined} storage_deposit_limit
847
+ * @param {PalletReviveEvmApiRpcTypesGenGenericTransaction} tx
805
848
  **/
806
849
  ethTransact: GenericRuntimeApiMethod<
807
850
  Rv,
808
851
  (
809
- origin: H160,
810
- dest: H160 | undefined,
811
- value: bigint,
812
- input: BytesLike,
813
- gasLimit?: SpWeightsWeightV2Weight | undefined,
814
- storageDepositLimit?: bigint | undefined,
815
- ) => Promise<PalletRevivePrimitivesEthContractResult>
852
+ tx: PalletReviveEvmApiRpcTypesGenGenericTransaction,
853
+ ) => Promise<Result<PalletRevivePrimitivesEthTransactInfo, PalletRevivePrimitivesEthTransactError>>
816
854
  >;
817
855
 
818
856
  /**
@@ -853,6 +891,65 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
853
891
  ) => Promise<Result<Bytes | undefined, PalletRevivePrimitivesContractAccessError>>
854
892
  >;
855
893
 
894
+ /**
895
+ * Traces the execution of an entire block and returns call traces.
896
+ *
897
+ * This is intended to be called through `state_call` to replay the block from the
898
+ * parent block.
899
+ *
900
+ * See eth-rpc `debug_traceBlockByNumber` for usage.
901
+ *
902
+ * @callname: ReviveApi_trace_block
903
+ * @param {SpRuntimeBlock} block
904
+ * @param {PalletReviveEvmApiDebugRpcTypesTracerConfig} config
905
+ **/
906
+ traceBlock: GenericRuntimeApiMethod<
907
+ Rv,
908
+ (
909
+ block: SpRuntimeBlock,
910
+ config: PalletReviveEvmApiDebugRpcTypesTracerConfig,
911
+ ) => Promise<Array<[number, PalletReviveEvmApiDebugRpcTypesCallTrace]>>
912
+ >;
913
+
914
+ /**
915
+ * Traces the execution of a specific transaction within a block.
916
+ *
917
+ * This is intended to be called through `state_call` to replay the block from the
918
+ * parent hash up to the transaction.
919
+ *
920
+ * See eth-rpc `debug_traceTransaction` for usage.
921
+ *
922
+ * @callname: ReviveApi_trace_tx
923
+ * @param {SpRuntimeBlock} block
924
+ * @param {number} tx_index
925
+ * @param {PalletReviveEvmApiDebugRpcTypesTracerConfig} config
926
+ **/
927
+ traceTx: GenericRuntimeApiMethod<
928
+ Rv,
929
+ (
930
+ block: SpRuntimeBlock,
931
+ txIndex: number,
932
+ config: PalletReviveEvmApiDebugRpcTypesTracerConfig,
933
+ ) => Promise<PalletReviveEvmApiDebugRpcTypesCallTrace | undefined>
934
+ >;
935
+
936
+ /**
937
+ * Dry run and return the trace of the given call.
938
+ *
939
+ * See eth-rpc `debug_traceCall` for usage.
940
+ *
941
+ * @callname: ReviveApi_trace_call
942
+ * @param {PalletReviveEvmApiRpcTypesGenGenericTransaction} tx
943
+ * @param {PalletReviveEvmApiDebugRpcTypesTracerConfig} config
944
+ **/
945
+ traceCall: GenericRuntimeApiMethod<
946
+ Rv,
947
+ (
948
+ tx: PalletReviveEvmApiRpcTypesGenGenericTransaction,
949
+ config: PalletReviveEvmApiDebugRpcTypesTracerConfig,
950
+ ) => Promise<Result<PalletReviveEvmApiDebugRpcTypesCallTrace, PalletRevivePrimitivesEthTransactError>>
951
+ >;
952
+
856
953
  /**
857
954
  * Generic runtime api call
858
955
  **/
@@ -1386,6 +1483,24 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
1386
1483
  **/
1387
1484
  [method: string]: GenericRuntimeApiMethod<Rv>;
1388
1485
  };
1486
+ /**
1487
+ * @runtimeapi: AssetRewards - 0x65f855d6e093c2f1
1488
+ **/
1489
+ assetRewards: {
1490
+ /**
1491
+ * Get the cost of creating a pool.
1492
+ *
1493
+ * This is especially useful when the cost is dynamic.
1494
+ *
1495
+ * @callname: AssetRewards_pool_creation_cost
1496
+ **/
1497
+ poolCreationCost: GenericRuntimeApiMethod<Rv, () => Promise<bigint>>;
1498
+
1499
+ /**
1500
+ * Generic runtime api call
1501
+ **/
1502
+ [method: string]: GenericRuntimeApiMethod<Rv>;
1503
+ };
1389
1504
  /**
1390
1505
  * @runtimeapi: GenesisBuilder - 0xfbc577b9d747efd6
1391
1506
  **/