diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index 2a46291f3a..d88374f836 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -19,7 +19,7 @@ import type { ContractConstructorSpec, ContractContractSpec, ContractCryptoHashe import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy'; 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 { EthAccount, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionCondition, EthTransactionRequest, EthTransactionStatus, EthWork, EthereumAccountId, EthereumLookupSource, EthereumSignature } from '@polkadot/types/interfaces/eth'; +import type { EthAccount, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionStatus, EthWork, EthereumAccountId, EthereumLookupSource, EthereumSignature } from '@polkadot/types/interfaces/eth'; import type { EvmAccount, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm'; import type { AnySignature, EcdsaSignature, Ed25519Signature, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics'; import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset'; @@ -1931,6 +1931,9 @@ declare module '@polkadot/types/types/registry' { EthTransaction: EthTransaction; 'Option': Option; 'Vec': Vec; + EthTransactionAction: EthTransactionAction; + 'Option': Option; + 'Vec': Vec; EthTransactionCondition: EthTransactionCondition; 'Option': Option; 'Vec': Vec; diff --git a/packages/types/src/interfaces/eth/definitions.ts b/packages/types/src/interfaces/eth/definitions.ts index 67fe58a43c..72a6bbed63 100644 --- a/packages/types/src/interfaces/eth/definitions.ts +++ b/packages/types/src/interfaces/eth/definitions.ts @@ -176,26 +176,46 @@ const types: DefinitionsTypes = { } }, EthTransaction: { - blockHash: 'Option', - blockNumber: 'Option', - chainId: 'Option', - condition: 'Option', - creates: 'Option', - from: 'H160', - gas: 'U256', - gasPrice: 'U256', - hash: 'H256', - input: 'Bytes', nonce: 'U256', - publicKey: 'Option', - r: 'U256', - raw: 'Bytes', - s: 'U256', - standardV: 'U256', - to: 'Option', - transactionIndex: 'Option', - v: 'U256', - value: 'U256' + gasPrice: 'U256', + gasLimit: 'U256', + action: 'EthTransactionAction', + value: 'U256', + input: 'Bytes', + // TransactionSignature (embedded) + v: 'u64', + r: 'H256', + s: 'H256' + }, + // as per the RPC definition + // TODO: Check these, re-add + // EthTransaction: { + // // hash in Rust + // transactionHash: 'H256', + // nonce: 'U256', + // blockHash: 'Option', + // blockNumber: 'Option', + // transactionIndex: 'Option', + // from: 'H160', + // to: 'Option', + // value: 'U256', + // gasPrice: 'U256', + // gas: 'U256', + // input: 'Bytes', + // creates: 'Option', + // raw: 'Bytes', + // publicKey: 'Option', + // chainId: 'Option', + // standardV: 'U256', + // v: 'U256', + // r: 'U256', + // s: 'U256' + // }, + EthTransactionAction: { + _enum: { + Call: 'H160', + Create: 'Null' + } }, EthTransactionCondition: { _enum: { diff --git a/packages/types/src/interfaces/eth/types.ts b/packages/types/src/interfaces/eth/types.ts index 6ab6ed76d2..aced05bfef 100644 --- a/packages/types/src/interfaces/eth/types.ts +++ b/packages/types/src/interfaces/eth/types.ts @@ -2,7 +2,7 @@ /* eslint-disable */ import type { Bytes, Enum, GenericEthereumAccountId, GenericEthereumLookupSource, Option, Struct, U256, U64, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types'; -import type { BlockNumber, H160, H2048, H256, H512 } from '@polkadot/types/interfaces/runtime'; +import type { BlockNumber, H160, H2048, H256 } from '@polkadot/types/interfaces/runtime'; /** @name EthAccount */ export interface EthAccount extends Struct { @@ -211,26 +211,22 @@ export interface EthSyncStatus extends Enum { /** @name EthTransaction */ export interface EthTransaction extends Struct { - readonly blockHash: Option; - readonly blockNumber: Option; - readonly chainId: Option; - readonly condition: Option; - readonly creates: Option; - readonly from: H160; - readonly gas: U256; - readonly gasPrice: U256; - readonly hash: H256; - readonly input: Bytes; readonly nonce: U256; - readonly publicKey: Option; - readonly r: U256; - readonly raw: Bytes; - readonly s: U256; - readonly standardV: U256; - readonly to: Option; - readonly transactionIndex: Option; - readonly v: U256; + readonly gasPrice: U256; + readonly gasLimit: U256; + readonly action: EthTransactionAction; readonly value: U256; + readonly input: Bytes; + readonly v: u64; + readonly r: H256; + readonly s: H256; +} + +/** @name EthTransactionAction */ +export interface EthTransactionAction extends Enum { + readonly isCall: boolean; + readonly asCall: H160; + readonly isCreate: boolean; } /** @name EthTransactionCondition */