123456#![warn(missing_docs)]78use std::sync::Arc;910use nft_runtime::{opaque::Block, AccountId, Balance, Index};11use sp_api::ProvideRuntimeApi;12use sp_blockchain::{Error as BlockChainError, HeaderMetadata, HeaderBackend};13use sp_block_builder::BlockBuilder;14pub use sc_rpc_api::DenyUnsafe;15use sp_transaction_pool::TransactionPool;16171819pub struct FullDeps<C, P> {20 21 pub client: Arc<C>,22 23 pub pool: Arc<P>,24 25 pub deny_unsafe: DenyUnsafe,26}272829pub fn create_full<C, P>(30 deps: FullDeps<C, P>,31) -> jsonrpc_core::IoHandler<sc_rpc::Metadata> where32 C: ProvideRuntimeApi<Block>,33 C: HeaderBackend<Block> + HeaderMetadata<Block, Error=BlockChainError> + 'static,34 C: Send + Sync + 'static,35 C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,36 C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,37 C::Api: BlockBuilder<Block>,38 P: TransactionPool + 'static,39{40 use substrate_frame_rpc_system::{FullSystem, SystemApi};41 use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};4243 let mut io = jsonrpc_core::IoHandler::default();44 let FullDeps {45 client,46 pool,47 deny_unsafe,48 } = deps;4950 io.extend_with(51 SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe))52 );5354 io.extend_with(55 TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone()))56 );5758 59 60 61 6263 io64}