// Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 // order important in structs... :) /* eslint-disable sort-keys */ // As per frontier import type { DefinitionsTypes } from '../../types'; import { rpc } from './rpc'; const types: DefinitionsTypes = { EthereumAccountId: 'GenericEthereumAccountId', EthereumLookupSource: 'GenericEthereumLookupSource', EthereumSignature: '[u8; 65]', EthAccount: { address: 'H160', balance: 'U256', nonce: 'U256', codeHash: 'H256', storageHash: 'H256', accountProof: 'Vec', storageProof: 'Vec' }, EthBlock: { _alias: { blockHash: 'hash', blockSize: 'size' }, blockHash: 'Option', parentHash: 'H256', sha3Uncles: 'H256', author: 'H160', miner: 'H160', stateRoot: 'H256', transactionsRoot: 'H256', receiptsRoot: 'H256', number: 'Option', gasUsed: 'U256', gasLimit: 'U256', extraData: 'Bytes', logsBloom: 'H2048', timestamp: 'U256', difficulty: 'U256', totalDifficulty: 'Option', sealFields: 'Vec', uncles: 'Vec', transactions: 'Vec', blockSize: 'Option' }, EthBloom: 'H2048', EthCallRequest: { from: 'Option', to: 'Option', gasPrice: 'Option', gas: 'Option', value: 'Option', data: 'Option', nonce: 'Option' }, EthFilter: { fromBlock: 'Option', toBlock: 'Option', blockHash: 'Option', address: 'Option', topics: 'Option' }, EthFilterAddress: { _enum: { Single: 'H160', Multiple: 'Vec', Null: 'Null' } }, EthFilterChanges: { _enum: { Logs: 'Vec', Hashes: 'Vec', Empty: 'Null' } }, EthFilterTopic: { _enum: { Single: 'EthFilterTopicInner', Multiple: 'Vec', Null: 'Null' } }, EthFilterTopicEntry: 'Option', EthFilterTopicInner: { _enum: { Single: 'EthFilterTopicEntry', Multiple: 'Vec', Null: 'Null' } }, EthHeader: { _alias: { blockHash: 'hash', blockSize: 'size' }, blockHash: 'Option', parentHash: 'H256', sha3Uncles: 'H256', author: 'H160', miner: 'H160', stateRoot: 'H256', transactionsRoot: 'H256', receiptsRoot: 'H256', number: 'Option', gasUsed: 'U256', gasLimit: 'U256', extraData: 'Bytes', logsBloom: 'H2048', timestamp: 'U256', difficulty: 'U256', sealFields: 'Vec', blockSize: 'Option' }, EthLog: { address: 'H160', topics: 'Vec', data: 'Bytes', blockHash: 'Option', blockNumber: 'Option', transactionHash: 'Option', transactionIndex: 'Option', logIndex: 'Option', transactionLogIndex: 'Option', removed: 'bool' }, EthReceipt: { transactionHash: 'Option', transactionIndex: 'Option', blockHash: 'Option', from: 'Option', to: 'Option', blockNumber: 'Option', cumulativeGasUsed: 'U256', gasUsed: 'Option', contractAddress: 'Option', logs: 'Vec', root: 'Option', logsBloom: 'H2048', statusCode: 'Option' }, EthRichBlock: 'EthBlock', EthRichHeader: 'EthHeader', EthStorageProof: { key: 'U256', value: 'U256', proof: 'Vec' }, EthSubKind: { _enum: ['newHeads', 'logs', 'newPendingTransactions', 'syncing'] }, EthSubParams: { _enum: { None: 'Null', Logs: 'EthFilter' } }, EthSubResult: { _enum: { Header: 'EthRichHeader', Log: 'EthLog', TransactionHash: 'H256', SyncState: 'EthSyncStatus' } }, EthSyncInfo: { startingBlock: 'U256', currentBlock: 'U256', highestBlock: 'U256', warpChunksAmount: 'Option', warpChunksProcessed: 'Option' }, EthSyncStatus: { _enum: { Info: 'EthSyncInfo', None: 'Null' } }, EthTransaction: { nonce: '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: { block: 'u64', time: 'u64' } }, EthTransactionRequest: { from: 'Option', to: 'Option', gasPrice: 'Option', gas: 'Option', value: 'Option', data: 'Option', nonce: 'Option' }, EthTransactionStatus: { transactionHash: 'H256', transactionIndex: 'u32', from: 'H160', to: 'Option', contractAddress: 'Option', logs: 'Vec', logsBloom: 'EthBloom' }, EthWork: { powHash: 'H256', seedHash: 'H256', target: 'H256', number: 'Option' } }; export default { rpc, types };