@dedot/chaintypes 0.204.0 → 0.205.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.
@@ -1,7 +1,7 @@
1
1
  // Generated by dedot cli
2
2
 
3
3
  import type { GenericChainConsts } from 'dedot/types';
4
- import type { RuntimeVersion, Bytes, AccountId32, Permill, Perbill } from 'dedot/codecs';
4
+ import type { RuntimeVersion, Bytes, AccountId32, Permill, Perbill, FixedU128 } from 'dedot/codecs';
5
5
  import type {
6
6
  FrameSystemLimitsBlockWeights,
7
7
  FrameSystemLimitsBlockLength,
@@ -167,6 +167,15 @@ export interface ChainConsts extends GenericChainConsts {
167
167
  **/
168
168
  [name: string]: any;
169
169
  };
170
+ /**
171
+ * Pallet `WeightReclaim`'s constants
172
+ **/
173
+ weightReclaim: {
174
+ /**
175
+ * Generic pallet constant
176
+ **/
177
+ [name: string]: any;
178
+ };
170
179
  /**
171
180
  * Pallet `Balances`'s constants
172
181
  **/
@@ -1095,6 +1104,19 @@ export interface ChainConsts extends GenericChainConsts {
1095
1104
  **/
1096
1105
  depositPerItem: bigint;
1097
1106
 
1107
+ /**
1108
+ * The amount of balance a caller has to pay for each child trie storage item.
1109
+ *
1110
+ * Those are the items created by a contract. In Solidity each value is a single
1111
+ * storage item. This is why we need to set a lower value here than for the main
1112
+ * trie items. Otherwise the storage deposit is too high.
1113
+ *
1114
+ * # Note
1115
+ *
1116
+ * It is safe to change this value on a live chain as all refunds are pro rata.
1117
+ **/
1118
+ depositPerChildTrieItem: bigint;
1119
+
1098
1120
  /**
1099
1121
  * The percentage of the storage deposit that should be held for using a code hash.
1100
1122
  * Instantiating a contract, protects the code from being removed. In order to prevent
@@ -1115,6 +1137,11 @@ export interface ChainConsts extends GenericChainConsts {
1115
1137
  **/
1116
1138
  unsafeUnstableInterface: boolean;
1117
1139
 
1140
+ /**
1141
+ * Allow EVM bytecode to be uploaded and instantiated.
1142
+ **/
1143
+ allowEVMBytecode: boolean;
1144
+
1118
1145
  /**
1119
1146
  * The [EIP-155](https://eips.ethereum.org/EIPS/eip-155) chain ID.
1120
1147
  *
@@ -1128,6 +1155,48 @@ export interface ChainConsts extends GenericChainConsts {
1128
1155
  **/
1129
1156
  nativeToEthRatio: number;
1130
1157
 
1158
+ /**
1159
+ * The fraction the maximum extrinsic weight `eth_transact` extrinsics are capped to.
1160
+ *
1161
+ * This is not a security measure but a requirement due to how we map gas to `(Weight,
1162
+ * StorageDeposit)`. The mapping might derive a `Weight` that is too large to fit into an
1163
+ * extrinsic. In this case we cap it to the limit specified here.
1164
+ *
1165
+ * `eth_transact` transactions that use more weight than specified will fail with an out of
1166
+ * gas error during execution. Larger fractions will allow more transactions to run.
1167
+ * Smaller values waste less block space: Choose as small as possible and as large as
1168
+ * necessary.
1169
+ *
1170
+ * Default: `0.5`.
1171
+ **/
1172
+ maxEthExtrinsicWeight: FixedU128;
1173
+
1174
+ /**
1175
+ * Allows debug-mode configuration, such as enabling unlimited contract size.
1176
+ **/
1177
+ debugEnabled: boolean;
1178
+
1179
+ /**
1180
+ * This determines the relative scale of our gas price and gas estimates.
1181
+ *
1182
+ * By default, the gas price (in wei) is `FeeInfo::next_fee_multiplier()` multiplied by
1183
+ * `NativeToEthRatio`. `GasScale` allows to scale this value: the actual gas price is the
1184
+ * default gas price multiplied by `GasScale`.
1185
+ *
1186
+ * As a consequence, gas cost (gas estimates and actual gas usage during transaction) is
1187
+ * scaled down by the same factor. Thus, the total transaction cost is not affected by
1188
+ * `GasScale` – apart from rounding differences: the transaction cost is always a multiple
1189
+ * of the gas price and is derived by rounded up, so that with higher `GasScales` this can
1190
+ * lead to higher gas cost as the rounding difference would be larger.
1191
+ *
1192
+ * The main purpose of changing the `GasScale` is to tune the gas cost so that it is closer
1193
+ * to standard EVM gas cost and contracts will not run out of gas when tools or code
1194
+ * assume hard coded gas limits.
1195
+ *
1196
+ * Requirement: `GasScale` must not be 0
1197
+ **/
1198
+ gasScale: number;
1199
+
1131
1200
  /**
1132
1201
  * Generic pallet constant
1133
1202
  **/
@@ -2165,7 +2165,7 @@ export interface ChainErrors extends GenericChainErrors {
2165
2165
  ContractTrapped: GenericPalletError;
2166
2166
 
2167
2167
  /**
2168
- * Event body or storage item exceeds [`limits::PAYLOAD_BYTES`].
2168
+ * Event body or storage item exceeds [`limits::STORAGE_BYTES`].
2169
2169
  **/
2170
2170
  ValueTooLarge: GenericPalletError;
2171
2171
 
@@ -2351,6 +2351,66 @@ export interface ChainErrors extends GenericChainErrors {
2351
2351
  **/
2352
2352
  ReturnDataTooLarge: GenericPalletError;
2353
2353
 
2354
+ /**
2355
+ * Invalid jump destination. Dynamic jumps points to invalid not jumpdest opcode.
2356
+ **/
2357
+ InvalidJump: GenericPalletError;
2358
+
2359
+ /**
2360
+ * Attempting to pop a value from an empty stack.
2361
+ **/
2362
+ StackUnderflow: GenericPalletError;
2363
+
2364
+ /**
2365
+ * Attempting to push a value onto a full stack.
2366
+ **/
2367
+ StackOverflow: GenericPalletError;
2368
+
2369
+ /**
2370
+ * Too much deposit was drawn from the shared txfee and deposit credit.
2371
+ *
2372
+ * This happens if the passed `gas` inside the ethereum transaction is too low.
2373
+ **/
2374
+ TxFeeOverdraw: GenericPalletError;
2375
+
2376
+ /**
2377
+ * When calling an EVM constructor `data` has to be empty.
2378
+ *
2379
+ * EVM constructors do not accept data. Their input data is part of the code blob itself.
2380
+ **/
2381
+ EvmConstructorNonEmptyData: GenericPalletError;
2382
+
2383
+ /**
2384
+ * Tried to construct an EVM contract via code hash.
2385
+ *
2386
+ * EVM contracts can only be instantiated via code upload as no initcode is
2387
+ * stored on-chain.
2388
+ **/
2389
+ EvmConstructedFromHash: GenericPalletError;
2390
+
2391
+ /**
2392
+ * The contract does not have enough balance to refund the storage deposit.
2393
+ *
2394
+ * This is a bug and should never happen. It means the accounting got out of sync.
2395
+ **/
2396
+ StorageRefundNotEnoughFunds: GenericPalletError;
2397
+
2398
+ /**
2399
+ * This means there are locks on the contracts storage deposit that prevents refunding it.
2400
+ *
2401
+ * This would be the case if the contract used its storage deposits for governance
2402
+ * or other pallets that allow creating locks over held balance.
2403
+ **/
2404
+ StorageRefundLocked: GenericPalletError;
2405
+
2406
+ /**
2407
+ * Called a pre-compile that is not allowed to be delegate called.
2408
+ *
2409
+ * Some pre-compile functions will trap the caller context if being delegate
2410
+ * called or if their caller was being delegate called.
2411
+ **/
2412
+ PrecompileDelegateDenied: GenericPalletError;
2413
+
2354
2414
  /**
2355
2415
  * Generic pallet error
2356
2416
  **/
@@ -3053,6 +3053,16 @@ export interface ChainEvents extends GenericChainEvents {
3053
3053
  **/
3054
3054
  Instantiated: GenericPalletEvent<'Revive', 'Instantiated', { deployer: H160; contract: H160 }>;
3055
3055
 
3056
+ /**
3057
+ * Emitted when an Ethereum transaction reverts.
3058
+ *
3059
+ * Ethereum transactions always complete successfully at the extrinsic level,
3060
+ * as even reverted calls must store their `ReceiptInfo`.
3061
+ * To distinguish reverted calls from successful ones, this event is emitted
3062
+ * for failed Ethereum transactions.
3063
+ **/
3064
+ EthExtrinsicRevert: GenericPalletEvent<'Revive', 'EthExtrinsicRevert', { dispatchError: DispatchError }>;
3065
+
3056
3066
  /**
3057
3067
  * Generic pallet event
3058
3068
  **/
@@ -15,6 +15,7 @@ import type {
15
15
  FrameSystemExtensionsCheckWeight,
16
16
  PalletAssetConversionTxPaymentChargeAssetTxPayment,
17
17
  FrameMetadataHashExtensionCheckMetadataHash,
18
+ PalletReviveEvmTxExtensionSetOrigin,
18
19
  StagingXcmV5Location,
19
20
  } from './types.js';
20
21
  import { ChainConsts } from './consts.js';
@@ -42,6 +43,8 @@ interface ChainKnownTypes extends GenericChainKnownTypes {
42
43
  FrameSystemExtensionsCheckWeight,
43
44
  PalletAssetConversionTxPaymentChargeAssetTxPayment,
44
45
  FrameMetadataHashExtensionCheckMetadataHash,
46
+ PalletReviveEvmTxExtensionSetOrigin,
47
+ [],
45
48
  ];
46
49
  AssetId: StagingXcmV5Location;
47
50
  EventRecord: FrameSystemEventRecord;
@@ -49,7 +52,7 @@ interface ChainKnownTypes extends GenericChainKnownTypes {
49
52
 
50
53
  /**
51
54
  * @name: KusamaAssetHubApi
52
- * @specVersion: 2000003
55
+ * @specVersion: 2000004
53
56
  **/
54
57
  export interface KusamaAssetHubApi extends GenericSubstrateApi {
55
58
  rpc: ChainJsonRpcApis;
@@ -49,6 +49,7 @@ import type {
49
49
  FrameSupportTokensMiscIdAmountRuntimeHoldReason,
50
50
  FrameSupportTokensMiscIdAmountRuntimeFreezeReason,
51
51
  PalletTransactionPaymentReleases,
52
+ FrameSupportStorageNoDrop,
52
53
  PalletVestingVestingInfo,
53
54
  PalletVestingReleases,
54
55
  PolkadotRuntimeCommonClaimsStatementKind,
@@ -108,6 +109,10 @@ import type {
108
109
  PalletReviveVmCodeInfo,
109
110
  PalletReviveStorageAccountInfo,
110
111
  PalletReviveStorageDeletionQueueManager,
112
+ PalletReviveEvmApiRpcTypesGenBlock,
113
+ PalletReviveEvmBlockHashReceiptGasInfo,
114
+ PalletReviveEvmBlockHashBlockBuilderEthereumBlockBuilderIR,
115
+ PalletReviveDebugDebugSettings,
111
116
  PalletStateTrieMigrationMigrationTask,
112
117
  PalletStateTrieMigrationMigrationLimits,
113
118
  PalletNominationPoolsPoolMember,
@@ -872,6 +877,15 @@ export interface ChainStorage extends GenericChainStorage {
872
877
  **/
873
878
  storageVersion: GenericStorageQuery<() => PalletTransactionPaymentReleases>;
874
879
 
880
+ /**
881
+ * The `OnChargeTransaction` stores the withdrawn tx fee here.
882
+ *
883
+ * Use `withdraw_txfee` and `remaining_txfee` to access from outside the crate.
884
+ *
885
+ * @param {Callback<FrameSupportStorageNoDrop | undefined> =} callback
886
+ **/
887
+ txPaymentCredit: GenericStorageQuery<() => FrameSupportStorageNoDrop | undefined>;
888
+
875
889
  /**
876
890
  * Generic pallet storage query
877
891
  **/
@@ -2256,6 +2270,8 @@ export interface ChainStorage extends GenericChainStorage {
2256
2270
  revive: {
2257
2271
  /**
2258
2272
  * A mapping from a contract's code hash to its code.
2273
+ * The code's size is bounded by [`crate::limits::BLOB_BYTES`] for PVM and
2274
+ * [`revm::primitives::eip170::MAX_CODE_SIZE`] for EVM bytecode.
2259
2275
  *
2260
2276
  * @param {H256} arg
2261
2277
  * @param {Callback<Bytes | undefined> =} callback
@@ -2318,6 +2334,67 @@ export interface ChainStorage extends GenericChainStorage {
2318
2334
  **/
2319
2335
  originalAccount: GenericStorageQuery<(arg: H160) => AccountId32 | undefined, H160>;
2320
2336
 
2337
+ /**
2338
+ * The current Ethereum block that is stored in the `on_finalize` method.
2339
+ *
2340
+ * # Note
2341
+ *
2342
+ * This could be further optimized into the future to store only the minimum
2343
+ * information needed to reconstruct the Ethereum block at the RPC level.
2344
+ *
2345
+ * Since the block is convenient to have around, and the extra details are capped
2346
+ * by a few hashes and the vector of transaction hashes, we store the block here.
2347
+ *
2348
+ * @param {Callback<PalletReviveEvmApiRpcTypesGenBlock> =} callback
2349
+ **/
2350
+ ethereumBlock: GenericStorageQuery<() => PalletReviveEvmApiRpcTypesGenBlock>;
2351
+
2352
+ /**
2353
+ * Mapping for block number and hashes.
2354
+ *
2355
+ * The maximum number of elements stored is capped by the block hash count `BLOCK_HASH_COUNT`.
2356
+ *
2357
+ * @param {number} arg
2358
+ * @param {Callback<H256> =} callback
2359
+ **/
2360
+ blockHash: GenericStorageQuery<(arg: number) => H256, number>;
2361
+
2362
+ /**
2363
+ * The details needed to reconstruct the receipt info offchain.
2364
+ *
2365
+ * This contains valuable information about the gas used by the transaction.
2366
+ *
2367
+ * NOTE: The item is unbound and should therefore never be read on chain.
2368
+ * It could otherwise inflate the PoV size of a block.
2369
+ *
2370
+ * @param {Callback<Array<PalletReviveEvmBlockHashReceiptGasInfo>> =} callback
2371
+ **/
2372
+ receiptInfoData: GenericStorageQuery<() => Array<PalletReviveEvmBlockHashReceiptGasInfo>>;
2373
+
2374
+ /**
2375
+ * Incremental ethereum block builder.
2376
+ *
2377
+ * @param {Callback<PalletReviveEvmBlockHashBlockBuilderEthereumBlockBuilderIR> =} callback
2378
+ **/
2379
+ ethBlockBuilderIR: GenericStorageQuery<() => PalletReviveEvmBlockHashBlockBuilderEthereumBlockBuilderIR>;
2380
+
2381
+ /**
2382
+ * The first transaction and receipt of the ethereum block.
2383
+ *
2384
+ * These values are moved out of the `EthBlockBuilderIR` to avoid serializing and
2385
+ * deserializing them on every transaction. Instead, they are loaded when needed.
2386
+ *
2387
+ * @param {Callback<[Bytes, Bytes] | undefined> =} callback
2388
+ **/
2389
+ ethBlockBuilderFirstValues: GenericStorageQuery<() => [Bytes, Bytes] | undefined>;
2390
+
2391
+ /**
2392
+ * Debugging settings that can be configured when DebugEnabled config is true.
2393
+ *
2394
+ * @param {Callback<PalletReviveDebugDebugSettings> =} callback
2395
+ **/
2396
+ debugSettingsOf: GenericStorageQuery<() => PalletReviveDebugDebugSettings>;
2397
+
2321
2398
  /**
2322
2399
  * Generic pallet storage query
2323
2400
  **/
@@ -55,16 +55,20 @@ import type {
55
55
  CumulusPrimitivesCoreCollationInfo,
56
56
  PolkadotParachainPrimitivesPrimitivesId,
57
57
  SystemParachainsCommonApisInflationInfo,
58
+ PalletReviveEvmApiRpcTypesGenBlock,
59
+ PalletReviveEvmBlockHashReceiptGasInfo,
58
60
  PalletRevivePrimitivesContractResult,
59
61
  PalletRevivePrimitivesContractResultInstantiateReturnValue,
60
62
  PalletRevivePrimitivesCode,
61
63
  PalletRevivePrimitivesEthTransactInfo,
62
64
  PalletRevivePrimitivesEthTransactError,
63
65
  PalletReviveEvmApiRpcTypesGenGenericTransaction,
66
+ PalletReviveEvmApiRpcTypesDryRunConfig,
64
67
  PalletRevivePrimitivesCodeUploadReturnValue,
65
68
  PalletRevivePrimitivesContractAccessError,
66
69
  PalletReviveEvmApiDebugRpcTypesTrace,
67
70
  PalletReviveEvmApiDebugRpcTypesTracerType,
71
+ PalletRevivePrimitivesBalanceConversionError,
68
72
  } from './types.js';
69
73
 
70
74
  export interface RuntimeApis extends GenericRuntimeApis {
@@ -1024,6 +1028,34 @@ export interface RuntimeApis extends GenericRuntimeApis {
1024
1028
  * @runtimeapi: ReviveApi - 0x8c403e5c4a9fd442
1025
1029
  **/
1026
1030
  reviveApi: {
1031
+ /**
1032
+ * Returns the current ETH block.
1033
+ *
1034
+ * This is one block behind the substrate block.
1035
+ *
1036
+ * @callname: ReviveApi_eth_block
1037
+ **/
1038
+ ethBlock: GenericRuntimeApiMethod<() => Promise<PalletReviveEvmApiRpcTypesGenBlock>>;
1039
+
1040
+ /**
1041
+ * Returns the ETH block hash for the given block number.
1042
+ *
1043
+ * @callname: ReviveApi_eth_block_hash
1044
+ * @param {U256} number
1045
+ **/
1046
+ ethBlockHash: GenericRuntimeApiMethod<(number: U256) => Promise<H256 | undefined>>;
1047
+
1048
+ /**
1049
+ * The details needed to reconstruct the receipt information offchain.
1050
+ *
1051
+ * # Note
1052
+ *
1053
+ * Each entry corresponds to the appropriate Ethereum transaction in the current block.
1054
+ *
1055
+ * @callname: ReviveApi_eth_receipt_data
1056
+ **/
1057
+ ethReceiptData: GenericRuntimeApiMethod<() => Promise<Array<PalletReviveEvmBlockHashReceiptGasInfo>>>;
1058
+
1027
1059
  /**
1028
1060
  * Returns the block gas limit.
1029
1061
  *
@@ -1107,6 +1139,7 @@ export interface RuntimeApis extends GenericRuntimeApis {
1107
1139
  /**
1108
1140
  * Perform an Ethereum call.
1109
1141
  *
1142
+ * Deprecated use `v2` version instead.
1110
1143
  * See [`crate::Pallet::dry_run_eth_transact`]
1111
1144
  *
1112
1145
  * @callname: ReviveApi_eth_transact
@@ -1118,6 +1151,22 @@ export interface RuntimeApis extends GenericRuntimeApis {
1118
1151
  ) => Promise<Result<PalletRevivePrimitivesEthTransactInfo, PalletRevivePrimitivesEthTransactError>>
1119
1152
  >;
1120
1153
 
1154
+ /**
1155
+ * Perform an Ethereum call.
1156
+ *
1157
+ * See [`crate::Pallet::dry_run_eth_transact`]
1158
+ *
1159
+ * @callname: ReviveApi_eth_transact_with_config
1160
+ * @param {PalletReviveEvmApiRpcTypesGenGenericTransaction} tx
1161
+ * @param {PalletReviveEvmApiRpcTypesDryRunConfig} config
1162
+ **/
1163
+ ethTransactWithConfig: GenericRuntimeApiMethod<
1164
+ (
1165
+ tx: PalletReviveEvmApiRpcTypesGenGenericTransaction,
1166
+ config: PalletReviveEvmApiRpcTypesDryRunConfig,
1167
+ ) => Promise<Result<PalletRevivePrimitivesEthTransactInfo, PalletRevivePrimitivesEthTransactError>>
1168
+ >;
1169
+
1121
1170
  /**
1122
1171
  * Upload new code without instantiating a contract from it.
1123
1172
  *
@@ -1230,7 +1279,7 @@ export interface RuntimeApis extends GenericRuntimeApis {
1230
1279
  *
1231
1280
  * @callname: ReviveApi_block_author
1232
1281
  **/
1233
- blockAuthor: GenericRuntimeApiMethod<() => Promise<H160 | undefined>>;
1282
+ blockAuthor: GenericRuntimeApiMethod<() => Promise<H160>>;
1234
1283
 
1235
1284
  /**
1236
1285
  * Get the H160 address associated to this account id
@@ -1240,6 +1289,14 @@ export interface RuntimeApis extends GenericRuntimeApis {
1240
1289
  **/
1241
1290
  address: GenericRuntimeApiMethod<(accountId: AccountId32Like) => Promise<H160>>;
1242
1291
 
1292
+ /**
1293
+ * Get the account id associated to this H160 address.
1294
+ *
1295
+ * @callname: ReviveApi_account_id
1296
+ * @param {H160} address
1297
+ **/
1298
+ accountId: GenericRuntimeApiMethod<(address: H160) => Promise<AccountId32>>;
1299
+
1243
1300
  /**
1244
1301
  * The address used to call the runtime's pallets dispatchables
1245
1302
  *
@@ -1255,6 +1312,16 @@ export interface RuntimeApis extends GenericRuntimeApis {
1255
1312
  **/
1256
1313
  code: GenericRuntimeApiMethod<(address: H160) => Promise<Bytes>>;
1257
1314
 
1315
+ /**
1316
+ * Construct the new balance and dust components of this EVM balance.
1317
+ *
1318
+ * @callname: ReviveApi_new_balance_with_dust
1319
+ * @param {U256} balance
1320
+ **/
1321
+ newBalanceWithDust: GenericRuntimeApiMethod<
1322
+ (balance: U256) => Promise<Result<[bigint, number], PalletRevivePrimitivesBalanceConversionError>>
1323
+ >;
1324
+
1258
1325
  /**
1259
1326
  * Generic runtime api call
1260
1327
  **/