#[cfg(not(feature = "std"))]
extern crate alloc;
use crate::{BlockFees, DomainAllowlistUpdates, Transfers};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use domain_runtime_primitives::{
opaque, Balance, CheckExtrinsicsValidityError, DecodeExtrinsicError,
};
use sp_runtime::generic::Era;
use sp_runtime::traits::{Block as BlockT, NumberFor};
use sp_runtime::Digest;
use sp_weights::Weight;
use subspace_core_primitives::U256;
use subspace_runtime_primitives::Moment;
sp_api::decl_runtime_apis! {
#[api_version(2)]
pub trait DomainCoreApi {
fn extract_signer(
extrinsics: Vec<<Block as BlockT>::Extrinsic>,
) -> Vec<(Option<opaque::AccountId>, <Block as BlockT>::Extrinsic)>;
fn is_within_tx_range(
extrinsic: &<Block as BlockT>::Extrinsic,
bundle_vrf_hash: &U256,
tx_range: &U256,
) -> bool;
fn intermediate_roots() -> Vec<[u8; 32]>;
fn initialize_block_with_post_state_root(header: &<Block as BlockT>::Header) -> Vec<u8>;
fn apply_extrinsic_with_post_state_root(extrinsic: <Block as BlockT>::Extrinsic) -> Vec<u8>;
fn construct_set_code_extrinsic(code: Vec<u8>) -> Vec<u8>;
fn construct_timestamp_extrinsic(moment: Moment) -> Block::Extrinsic;
fn construct_consensus_chain_byte_fee_extrinsic(consensus_chain_byte_fee: Balance) -> Block::Extrinsic;
fn construct_domain_update_chain_allowlist_extrinsic(updates: DomainAllowlistUpdates) -> Block::Extrinsic;
fn is_inherent_extrinsic(extrinsic: &<Block as BlockT>::Extrinsic) -> bool;
fn check_extrinsics_and_do_pre_dispatch(uxts: Vec<<Block as BlockT>::Extrinsic>, block_number: NumberFor<Block>,
block_hash: <Block as BlockT>::Hash) -> Result<(), CheckExtrinsicsValidityError>;
fn decode_extrinsic(
opaque_extrinsic: sp_runtime::OpaqueExtrinsic,
) -> Result<<Block as BlockT>::Extrinsic, DecodeExtrinsicError>;
fn extrinsic_era(
extrinsic: &<Block as BlockT>::Extrinsic
) -> Option<Era>;
fn extrinsic_weight(ext: &Block::Extrinsic) -> Weight;
fn block_fees() -> BlockFees<Balance>;
fn block_digest() -> Digest;
fn block_weight() -> Weight;
fn transfers() -> Transfers<Balance>;
fn transfers_storage_key() -> Vec<u8>;
fn block_fees_storage_key() -> Vec<u8>;
}
}