Trait fp_rpc::EthereumRuntimeRPCApi
source · pub trait EthereumRuntimeRPCApi<Block: BlockT>: Core<Block> {
Show 28 methods
// Provided methods
fn chain_id(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u64, ApiError> { ... }
fn account_basic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
address: Address,
) -> Result<Account, ApiError> { ... }
fn gas_price(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<U256, ApiError> { ... }
fn account_code_at(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
address: Address,
) -> Result<Vec<u8>, ApiError> { ... }
fn author(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Address, ApiError> { ... }
fn storage_at(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
address: Address,
index: U256,
) -> Result<H256, ApiError> { ... }
fn call_before_version_2(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
from: Address,
to: Address,
data: Vec<u8>,
value: U256,
gas_limit: U256,
gas_price: Option<U256>,
nonce: Option<U256>,
estimate: bool,
) -> Result<Result<ExecutionInfo<Vec<u8>>, DispatchError>, ApiError> { ... }
fn call_before_version_4(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
from: Address,
to: Address,
data: Vec<u8>,
value: U256,
gas_limit: U256,
max_fee_per_gas: Option<U256>,
max_priority_fee_per_gas: Option<U256>,
nonce: Option<U256>,
estimate: bool,
) -> Result<Result<ExecutionInfo<Vec<u8>>, DispatchError>, ApiError> { ... }
fn call_before_version_5(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
from: Address,
to: Address,
data: Vec<u8>,
value: U256,
gas_limit: U256,
max_fee_per_gas: Option<U256>,
max_priority_fee_per_gas: Option<U256>,
nonce: Option<U256>,
estimate: bool,
access_list: Option<Vec<(Address, Vec<H256>)>>,
) -> Result<Result<ExecutionInfo<Vec<u8>>, DispatchError>, ApiError> { ... }
fn call(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
from: Address,
to: Address,
data: Vec<u8>,
value: U256,
gas_limit: U256,
max_fee_per_gas: Option<U256>,
max_priority_fee_per_gas: Option<U256>,
nonce: Option<U256>,
estimate: bool,
access_list: Option<Vec<(Address, Vec<H256>)>>,
) -> Result<Result<ExecutionInfoV2<Vec<u8>>, DispatchError>, ApiError> { ... }
fn create_before_version_2(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
from: Address,
data: Vec<u8>,
value: U256,
gas_limit: U256,
gas_price: Option<U256>,
nonce: Option<U256>,
estimate: bool,
) -> Result<Result<ExecutionInfo<Address>, DispatchError>, ApiError> { ... }
fn create_before_version_4(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
from: Address,
data: Vec<u8>,
value: U256,
gas_limit: U256,
max_fee_per_gas: Option<U256>,
max_priority_fee_per_gas: Option<U256>,
nonce: Option<U256>,
estimate: bool,
) -> Result<Result<ExecutionInfo<Address>, DispatchError>, ApiError> { ... }
fn create_before_version_5(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
from: Address,
data: Vec<u8>,
value: U256,
gas_limit: U256,
max_fee_per_gas: Option<U256>,
max_priority_fee_per_gas: Option<U256>,
nonce: Option<U256>,
estimate: bool,
access_list: Option<Vec<(Address, Vec<H256>)>>,
) -> Result<Result<ExecutionInfo<Address>, DispatchError>, ApiError> { ... }
fn create(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
from: Address,
data: Vec<u8>,
value: U256,
gas_limit: U256,
max_fee_per_gas: Option<U256>,
max_priority_fee_per_gas: Option<U256>,
nonce: Option<U256>,
estimate: bool,
access_list: Option<Vec<(Address, Vec<H256>)>>,
) -> Result<Result<ExecutionInfoV2<Address>, DispatchError>, ApiError> { ... }
fn current_block_before_version_2(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<BlockV0>, ApiError> { ... }
fn current_block(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<BlockV2>, ApiError> { ... }
fn current_receipts_before_version_4(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<Vec<ReceiptV0>>, ApiError> { ... }
fn current_receipts(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<Vec<ReceiptV3>>, ApiError> { ... }
fn current_transaction_statuses(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<Vec<TransactionStatus>>, ApiError> { ... }
fn current_all_before_version_2(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(Option<BlockV0>, Option<Vec<ReceiptV0>>, Option<Vec<TransactionStatus>>), ApiError> { ... }
fn current_all_before_version_4(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(Option<BlockV2>, Option<Vec<ReceiptV0>>, Option<Vec<TransactionStatus>>), ApiError> { ... }
fn current_all(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(Option<BlockV2>, Option<Vec<ReceiptV3>>, Option<Vec<TransactionStatus>>), ApiError> { ... }
fn extrinsic_filter_before_version_2(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
xts: Vec<<Block as BlockT>::Extrinsic>,
) -> Result<Vec<TransactionV0>, ApiError> { ... }
fn extrinsic_filter(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
xts: Vec<<Block as BlockT>::Extrinsic>,
) -> Result<Vec<TransactionV2>, ApiError> { ... }
fn elasticity(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<Permill>, ApiError> { ... }
fn gas_limit_multiplier_support(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(), ApiError> { ... }
fn pending_block(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
xts: Vec<<Block as BlockT>::Extrinsic>,
) -> Result<(Option<BlockV2>, Option<Vec<TransactionStatus>>), ApiError> { ... }
fn initialize_pending_block(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
header: &<Block as BlockT>::Header,
) -> Result<(), ApiError> { ... }
}
Expand description
API necessary for Ethereum-compatibility layer.
Provided Methods§
sourcefn chain_id(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u64, ApiError>
fn chain_id( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<u64, ApiError>
Returns runtime defined pallet_evm::ChainId.
sourcefn account_basic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
address: Address,
) -> Result<Account, ApiError>
fn account_basic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: Address, ) -> Result<Account, ApiError>
Returns pallet_evm::Accounts by address.
sourcefn gas_price(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<U256, ApiError>
fn gas_price( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<U256, ApiError>
Returns FixedGasPrice::min_gas_price
sourcefn account_code_at(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
address: Address,
) -> Result<Vec<u8>, ApiError>
fn account_code_at( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: Address, ) -> Result<Vec<u8>, ApiError>
For a given account address, returns pallet_evm::AccountCodes.
Returns the converted FindAuthor::find_author authority id.
sourcefn storage_at(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
address: Address,
index: U256,
) -> Result<H256, ApiError>
fn storage_at( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: Address, index: U256, ) -> Result<H256, ApiError>
For a given account address and index, returns pallet_evm::AccountStorages.
sourcefn call_before_version_2(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
from: Address,
to: Address,
data: Vec<u8>,
value: U256,
gas_limit: U256,
gas_price: Option<U256>,
nonce: Option<U256>,
estimate: bool,
) -> Result<Result<ExecutionInfo<Vec<u8>>, DispatchError>, ApiError>
👎Deprecated
fn call_before_version_2( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, from: Address, to: Address, data: Vec<u8>, value: U256, gas_limit: U256, gas_price: Option<U256>, nonce: Option<U256>, estimate: bool, ) -> Result<Result<ExecutionInfo<Vec<u8>>, DispatchError>, ApiError>
Returns a frame_ethereum::call response. If estimate
is true,
fn call_before_version_4( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, from: Address, to: Address, data: Vec<u8>, value: U256, gas_limit: U256, max_fee_per_gas: Option<U256>, max_priority_fee_per_gas: Option<U256>, nonce: Option<U256>, estimate: bool, ) -> Result<Result<ExecutionInfo<Vec<u8>>, DispatchError>, ApiError>
fn call_before_version_5( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, from: Address, to: Address, data: Vec<u8>, value: U256, gas_limit: U256, max_fee_per_gas: Option<U256>, max_priority_fee_per_gas: Option<U256>, nonce: Option<U256>, estimate: bool, access_list: Option<Vec<(Address, Vec<H256>)>>, ) -> Result<Result<ExecutionInfo<Vec<u8>>, DispatchError>, ApiError>
fn call( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, from: Address, to: Address, data: Vec<u8>, value: U256, gas_limit: U256, max_fee_per_gas: Option<U256>, max_priority_fee_per_gas: Option<U256>, nonce: Option<U256>, estimate: bool, access_list: Option<Vec<(Address, Vec<H256>)>>, ) -> Result<Result<ExecutionInfoV2<Vec<u8>>, DispatchError>, ApiError>
sourcefn create_before_version_2(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
from: Address,
data: Vec<u8>,
value: U256,
gas_limit: U256,
gas_price: Option<U256>,
nonce: Option<U256>,
estimate: bool,
) -> Result<Result<ExecutionInfo<Address>, DispatchError>, ApiError>
👎Deprecated
fn create_before_version_2( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, from: Address, data: Vec<u8>, value: U256, gas_limit: U256, gas_price: Option<U256>, nonce: Option<U256>, estimate: bool, ) -> Result<Result<ExecutionInfo<Address>, DispatchError>, ApiError>
Returns a frame_ethereum::create response.
fn create_before_version_4( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, from: Address, data: Vec<u8>, value: U256, gas_limit: U256, max_fee_per_gas: Option<U256>, max_priority_fee_per_gas: Option<U256>, nonce: Option<U256>, estimate: bool, ) -> Result<Result<ExecutionInfo<Address>, DispatchError>, ApiError>
fn create_before_version_5( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, from: Address, data: Vec<u8>, value: U256, gas_limit: U256, max_fee_per_gas: Option<U256>, max_priority_fee_per_gas: Option<U256>, nonce: Option<U256>, estimate: bool, access_list: Option<Vec<(Address, Vec<H256>)>>, ) -> Result<Result<ExecutionInfo<Address>, DispatchError>, ApiError>
fn create( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, from: Address, data: Vec<u8>, value: U256, gas_limit: U256, max_fee_per_gas: Option<U256>, max_priority_fee_per_gas: Option<U256>, nonce: Option<U256>, estimate: bool, access_list: Option<Vec<(Address, Vec<H256>)>>, ) -> Result<Result<ExecutionInfoV2<Address>, DispatchError>, ApiError>
sourcefn current_block_before_version_2(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<BlockV0>, ApiError>
👎Deprecated
fn current_block_before_version_2( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Option<BlockV0>, ApiError>
Return the current block. Legacy.
sourcefn current_block(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<BlockV2>, ApiError>
fn current_block( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Option<BlockV2>, ApiError>
Return the current block.
sourcefn current_receipts_before_version_4(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<Vec<ReceiptV0>>, ApiError>
👎Deprecated
fn current_receipts_before_version_4( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Option<Vec<ReceiptV0>>, ApiError>
Return the current receipt.
sourcefn current_receipts(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<Vec<ReceiptV3>>, ApiError>
fn current_receipts( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Option<Vec<ReceiptV3>>, ApiError>
Return the current receipt.
sourcefn current_transaction_statuses(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<Vec<TransactionStatus>>, ApiError>
fn current_transaction_statuses( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Option<Vec<TransactionStatus>>, ApiError>
Return the current transaction status.
sourcefn current_all_before_version_2(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(Option<BlockV0>, Option<Vec<ReceiptV0>>, Option<Vec<TransactionStatus>>), ApiError>
👎Deprecated
fn current_all_before_version_2( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<(Option<BlockV0>, Option<Vec<ReceiptV0>>, Option<Vec<TransactionStatus>>), ApiError>
Return all the current data for a block in a single runtime call. Legacy.
sourcefn current_all_before_version_4(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(Option<BlockV2>, Option<Vec<ReceiptV0>>, Option<Vec<TransactionStatus>>), ApiError>
👎Deprecated
fn current_all_before_version_4( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<(Option<BlockV2>, Option<Vec<ReceiptV0>>, Option<Vec<TransactionStatus>>), ApiError>
Return all the current data for a block in a single runtime call.
fn current_all( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<(Option<BlockV2>, Option<Vec<ReceiptV3>>, Option<Vec<TransactionStatus>>), ApiError>
sourcefn extrinsic_filter_before_version_2(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
xts: Vec<<Block as BlockT>::Extrinsic>,
) -> Result<Vec<TransactionV0>, ApiError>
👎Deprecated
fn extrinsic_filter_before_version_2( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, xts: Vec<<Block as BlockT>::Extrinsic>, ) -> Result<Vec<TransactionV0>, ApiError>
Receives a Vec<OpaqueExtrinsic>
and filters all the ethereum transactions. Legacy.
sourcefn extrinsic_filter(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
xts: Vec<<Block as BlockT>::Extrinsic>,
) -> Result<Vec<TransactionV2>, ApiError>
fn extrinsic_filter( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, xts: Vec<<Block as BlockT>::Extrinsic>, ) -> Result<Vec<TransactionV2>, ApiError>
Receives a Vec<OpaqueExtrinsic>
and filters all the ethereum transactions.
sourcefn elasticity(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<Permill>, ApiError>
fn elasticity( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Option<Permill>, ApiError>
Return the elasticity multiplier.
sourcefn gas_limit_multiplier_support(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<(), ApiError>
fn gas_limit_multiplier_support( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<(), ApiError>
Used to determine if gas limit multiplier for non-transactional calls (eth_call/estimateGas) is supported.
sourcefn pending_block(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
xts: Vec<<Block as BlockT>::Extrinsic>,
) -> Result<(Option<BlockV2>, Option<Vec<TransactionStatus>>), ApiError>
fn pending_block( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, xts: Vec<<Block as BlockT>::Extrinsic>, ) -> Result<(Option<BlockV2>, Option<Vec<TransactionStatus>>), ApiError>
Return the pending block.
sourcefn initialize_pending_block(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
header: &<Block as BlockT>::Header,
) -> Result<(), ApiError>
fn initialize_pending_block( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, header: &<Block as BlockT>::Header, ) -> Result<(), ApiError>
Initialize the pending block. The behavior should be the same as the runtime api Core_initialize_block but for a “pending” block. If your project don’t need to have a different behavior to initialize “pending” blocks, you can copy your Core_initialize_block implementation.