diff --git a/packages/types-augment/src/registry/interfaces.ts b/packages/types-augment/src/registry/interfaces.ts index 9c622c931497..42bd21864989 100644 --- a/packages/types-augment/src/registry/interfaces.ts +++ b/packages/types-augment/src/registry/interfaces.ts @@ -32,7 +32,7 @@ import type { BlockStats } from '@polkadot/types/interfaces/dev'; import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections'; import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine'; import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFeeHistory, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthReceiptV0, EthReceiptV3, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth'; -import type { EvmAccount, EvmCallInfo, EvmCreateInfo, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm'; +import type { EvmAccount, EvmCallInfo, EvmCallInfoV2, EvmCreateInfo, EvmCreateInfoV2, EvmLog, EvmVicinity, EvmWeightInfo, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm'; import type { AnySignature, EcdsaSignature, Ed25519Signature, Era, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics'; import type { FungiblesAccessError } from '@polkadot/types/interfaces/fungibles'; import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset'; @@ -441,9 +441,12 @@ declare module '@polkadot/types/types/registry' { EventRecord: EventRecord; EvmAccount: EvmAccount; EvmCallInfo: EvmCallInfo; + EvmCallInfoV2: EvmCallInfoV2; EvmCreateInfo: EvmCreateInfo; + EvmCreateInfoV2: EvmCreateInfoV2; EvmLog: EvmLog; EvmVicinity: EvmVicinity; + EvmWeightInfo: EvmWeightInfo; ExecReturnValue: ExecReturnValue; ExecutorParam: ExecutorParam; ExecutorParams: ExecutorParams; diff --git a/packages/types/src/interfaces/eth/runtime.ts b/packages/types/src/interfaces/eth/runtime.ts index 8dd0e977e42c..12032dc28f11 100644 --- a/packages/types/src/interfaces/eth/runtime.ts +++ b/packages/types/src/interfaces/eth/runtime.ts @@ -1,7 +1,273 @@ // Copyright 2017-2023 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionsCall } from '../../types/index.js'; +import type { DefinitionsCall, DefinitionsCallEntry } from '../../types/index.js'; + +const ethMethodsV4: DefinitionsCallEntry['methods'] = { + account_basic: { + description: 'Returns pallet_evm::Accounts by address.', + params: [ + { + name: 'address', + type: 'H160' + } + ], + type: 'EvmAccount' + }, + account_code_at: { + description: 'For a given account address, returns pallet_evm::AccountCodes.', + params: [ + { + name: 'address', + type: 'H160' + } + ], + type: 'Bytes' + }, + author: { + description: 'Returns the converted FindAuthor::find_author authority id.', + params: [], + type: 'H160' + }, + call: { + description: 'Returns a frame_ethereum::call response. If `estimate` is true,', + params: [ + { + name: 'from', + type: 'H160' + }, + { + name: 'to', + type: 'H160' + }, + { + name: 'data', + type: 'Vec' + }, + { + name: 'value', + type: 'U256' + }, + { + name: 'gasLimit', + type: 'U256' + }, + { + name: 'maxFeePerGas', + type: 'Option' + }, + { + name: 'maxPriorityFeePerGas', + type: 'Option' + }, + { + name: 'nonce', + type: 'Option' + }, + { + name: 'estimate', + type: 'bool' + }, + { + name: 'accessList', + type: 'Option)>>' + } + ], + type: 'Result' + }, + chain_id: { + description: 'Returns runtime defined pallet_evm::ChainId.', + params: [], + type: 'u64' + }, + create: { + description: 'Returns a frame_ethereum::call response. If `estimate` is true,', + params: [ + { + name: 'from', + type: 'H160' + }, + { + name: 'data', + type: 'Vec' + }, + { + name: 'value', + type: 'U256' + }, + { + name: 'gasLimit', + type: 'U256' + }, + { + name: 'maxFeePerGas', + type: 'Option' + }, + { + name: 'maxPriorityFeePerGas', + type: 'Option' + }, + { + name: 'nonce', + type: 'Option' + }, + { + name: 'estimate', + type: 'bool' + }, + { + name: 'accessList', + type: 'Option)>>' + } + ], + type: 'Result' + }, + current_all: { + description: 'Return all the current data for a block in a single runtime call.', + params: [], + type: '(Option, Option>, Option>)' + }, + current_block: { + description: 'Return the current block.', + params: [], + type: 'BlockV2' + }, + current_receipts: { + description: 'Return the current receipt.', + params: [], + type: 'Option>' + }, + current_transaction_statuses: { + description: 'Return the current transaction status.', + params: [], + type: 'Option>' + }, + elasticity: { + description: 'Return the elasticity multiplier.', + params: [], + type: 'Option' + }, + extrinsic_filter: { + description: 'Receives a `Vec` and filters all the ethereum transactions.', + params: [ + { + name: 'xts', + type: 'Vec' + } + ], + type: 'Vec' + }, + gas_price: { + description: 'Returns FixedGasPrice::min_gas_price', + params: [], + type: 'u256' + }, + storage_at: { + description: 'For a given account address and index, returns pallet_evm::AccountStorages.', + params: [ + { + name: 'address', + type: 'H160' + }, + { + name: 'index', + type: 'u256' + } + ], + type: 'H256' + } +}; + +const ethMethodsV5: DefinitionsCallEntry['methods'] = { + call: { + description: 'Returns a frame_ethereum::call response. If `estimate` is true,', + params: [ + { + name: 'from', + type: 'H160' + }, + { + name: 'to', + type: 'H160' + }, + { + name: 'data', + type: 'Vec' + }, + { + name: 'value', + type: 'U256' + }, + { + name: 'gasLimit', + type: 'U256' + }, + { + name: 'maxFeePerGas', + type: 'Option' + }, + { + name: 'maxPriorityFeePerGas', + type: 'Option' + }, + { + name: 'nonce', + type: 'Option' + }, + { + name: 'estimate', + type: 'bool' + }, + { + name: 'accessList', + type: 'Option)>>' + } + ], + type: 'Result' + }, + create: { + description: 'Returns a frame_ethereum::call response. If `estimate` is true,', + params: [ + { + name: 'from', + type: 'H160' + }, + { + name: 'data', + type: 'Vec' + }, + { + name: 'value', + type: 'U256' + }, + { + name: 'gasLimit', + type: 'U256' + }, + { + name: 'maxFeePerGas', + type: 'Option' + }, + { + name: 'maxPriorityFeePerGas', + type: 'Option' + }, + { + name: 'nonce', + type: 'Option' + }, + { + name: 'estimate', + type: 'bool' + }, + { + name: 'accessList', + type: 'Option)>>' + } + ], + type: 'Result' + } +}; export const runtime: DefinitionsCall = { ConvertTransactionRuntimeApi: [ @@ -59,180 +325,16 @@ export const runtime: DefinitionsCall = { EthereumRuntimeRPCApi: [ { methods: { - account_basic: { - description: 'Returns pallet_evm::Accounts by address.', - params: [ - { - name: 'address', - type: 'H160' - } - ], - type: 'EvmAccount' - }, - account_code_at: { - description: 'For a given account address, returns pallet_evm::AccountCodes.', - params: [ - { - name: 'address', - type: 'H160' - } - ], - type: 'Bytes' - }, - author: { - description: 'Returns the converted FindAuthor::find_author authority id.', - params: [], - type: 'H160' - }, - call: { - description: 'Returns a frame_ethereum::call response. If `estimate` is true,', - params: [ - { - name: 'from', - type: 'H160' - }, - { - name: 'to', - type: 'H160' - }, - { - name: 'data', - type: 'Vec' - }, - { - name: 'value', - type: 'U256' - }, - { - name: 'gasLimit', - type: 'U256' - }, - { - name: 'maxFeePerGas', - type: 'Option' - }, - { - name: 'maxPriorityFeePerGas', - type: 'Option' - }, - { - name: 'nonce', - type: 'Option' - }, - { - name: 'estimate', - type: 'bool' - }, - { - name: 'accessList', - type: 'Option)>>' - } - ], - type: 'Result' - }, - chain_id: { - description: 'Returns runtime defined pallet_evm::ChainId.', - params: [], - type: 'u64' - }, - create: { - description: 'Returns a frame_ethereum::call response. If `estimate` is true,', - params: [ - { - name: 'from', - type: 'H160' - }, - { - name: 'data', - type: 'Vec' - }, - { - name: 'value', - type: 'U256' - }, - { - name: 'gasLimit', - type: 'U256' - }, - { - name: 'maxFeePerGas', - type: 'Option' - }, - { - name: 'maxPriorityFeePerGas', - type: 'Option' - }, - { - name: 'nonce', - type: 'Option' - }, - { - name: 'estimate', - type: 'bool' - }, - { - name: 'accessList', - type: 'Option)>>' - } - ], - type: 'Result' - }, - current_all: { - description: 'Return all the current data for a block in a single runtime call.', - params: [], - type: '(Option, Option>, Option>)' - }, - current_block: { - description: 'Return the current block.', - params: [], - type: 'BlockV2' - }, - current_receipts: { - description: 'Return the current receipt.', - params: [], - type: 'Option>' - }, - current_transaction_statuses: { - description: 'Return the current transaction status.', - params: [], - type: 'Option>' - }, - elasticity: { - description: 'Return the elasticity multiplier.', - params: [], - type: 'Option' - }, - extrinsic_filter: { - description: 'Receives a `Vec` and filters all the ethereum transactions.', - params: [ - { - name: 'xts', - type: 'Vec' - } - ], - type: 'Vec' - }, - gas_price: { - description: 'Returns FixedGasPrice::min_gas_price', - params: [], - type: 'u256' - }, - storage_at: { - description: 'For a given account address and index, returns pallet_evm::AccountStorages.', - params: [ - { - name: 'address', - type: 'H160' - }, - { - name: 'index', - type: 'u256' - } - ], - type: 'H256' - } + ...ethMethodsV4 }, version: 4 + }, + { + methods: { + ...ethMethodsV4, + ...ethMethodsV5 + }, + version: 5 } ] }; diff --git a/packages/types/src/interfaces/evm/definitions.ts b/packages/types/src/interfaces/evm/definitions.ts index 7858e38bd74d..cffabab69d61 100644 --- a/packages/types/src/interfaces/evm/definitions.ts +++ b/packages/types/src/interfaces/evm/definitions.ts @@ -25,6 +25,20 @@ export default { usedGas: 'U256', logs: 'Vec' }, + EvmCallInfoV2: { + exitReason: 'ExitReason', + value: 'Bytes', + usedGas: 'U256', + weightInfo: 'Option', + logs: 'Vec' + }, + EvmCreateInfoV2: { + exitReason: 'ExitReason', + value: 'H160', + usedGas: 'U256', + weightInfo: 'Option', + logs: 'Vec' + }, EvmLog: { address: 'H160', topics: 'Vec', @@ -34,6 +48,13 @@ export default { gasPrice: 'u256', origin: 'H160' }, + EvmWeightInfo: { + refTimeLimit: 'Option', + proofSizeLimit: 'Option', + refTimeUsage: 'Option', + proofSizeUsage: 'Option' + + }, ExitError: { _enum: { StackUnderflow: 'Null', diff --git a/packages/types/src/interfaces/evm/types.ts b/packages/types/src/interfaces/evm/types.ts index e612bece942d..62da05508544 100644 --- a/packages/types/src/interfaces/evm/types.ts +++ b/packages/types/src/interfaces/evm/types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { Bytes, Enum, Struct, Text, U256, Vec, u256 } from '@polkadot/types-codec'; +import type { Bytes, Enum, Option, Struct, Text, U256, Vec, u256, u64 } from '@polkadot/types-codec'; import type { H160, H256 } from '@polkadot/types/interfaces/runtime'; /** @name EvmAccount */ @@ -18,6 +18,15 @@ export interface EvmCallInfo extends Struct { readonly logs: Vec; } +/** @name EvmCallInfoV2 */ +export interface EvmCallInfoV2 extends Struct { + readonly exitReason: ExitReason; + readonly value: Bytes; + readonly usedGas: U256; + readonly weightInfo: Option; + readonly logs: Vec; +} + /** @name EvmCreateInfo */ export interface EvmCreateInfo extends Struct { readonly exitReason: ExitReason; @@ -26,6 +35,15 @@ export interface EvmCreateInfo extends Struct { readonly logs: Vec; } +/** @name EvmCreateInfoV2 */ +export interface EvmCreateInfoV2 extends Struct { + readonly exitReason: ExitReason; + readonly value: H160; + readonly usedGas: U256; + readonly weightInfo: Option; + readonly logs: Vec; +} + /** @name EvmLog */ export interface EvmLog extends Struct { readonly address: H160; @@ -39,6 +57,14 @@ export interface EvmVicinity extends Struct { readonly origin: H160; } +/** @name EvmWeightInfo */ +export interface EvmWeightInfo extends Struct { + readonly refTimeLimit: Option; + readonly proofSizeLimit: Option; + readonly refTimeUsage: Option; + readonly proofSizeUsage: Option; +} + /** @name ExitError */ export interface ExitError extends Enum { readonly isStackUnderflow: boolean;