123456#![warn(missing_docs)]78use std::sync::Arc;910use nft_runtime::{opaque::Block, AccountId, Balance, Index, BlockNumber};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;16use pallet_contracts_rpc::{Contracts, ContractsApi};171819pub 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 C::Api: pallet_contracts_rpc::ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber>,39 P: TransactionPool + 'static,40{41 use substrate_frame_rpc_system::{FullSystem, SystemApi};42 use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};4344 let mut io = jsonrpc_core::IoHandler::default();45 let FullDeps {46 client,47 pool,48 deny_unsafe,49 } = deps;5051 io.extend_with(52 SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe))53 );5455 io.extend_with(56 TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone()))57 );5859 io.extend_with(60 ContractsApi::to_delegate(Contracts::new(client.clone()))61 );62 63 64 65 66 6768 io69}