use jsonrpsee::proc_macros::rpc; use solana_client::rpc_config::{ RpcContextConfig, RpcRequestAirdropConfig, RpcSignatureStatusConfig, }; use solana_client::rpc_response::{Response as RpcResponse, RpcBlockhash, RpcVersionInfo}; use solana_sdk::commitment_config::CommitmentConfig; use solana_transaction_status::TransactionStatus; use crate::configs::{IsBlockHashValidConfig, SendTransactionConfig}; pub type Result = std::result::Result; #[rpc(server)] pub trait LiteRpc { #[method(name = "sendTransaction")] async fn send_transaction( &self, tx: String, send_transaction_config: Option, ) -> Result; #[method(name = "getLatestBlockhash")] async fn get_latest_blockhash( &self, config: Option, ) -> Result>; #[method(name = "isBlockhashValid")] async fn is_blockhash_valid( &self, blockhash: String, config: Option, ) -> Result>; #[method(name = "getSignatureStatuses")] async fn get_signature_statuses( &self, signature_strs: Vec, config: Option, ) -> Result>>>; #[method(name = "getVersion")] fn get_version(&self) -> Result; #[method(name = "requestAirdrop")] async fn request_airdrop( &self, pubkey_str: String, lamports: u64, config: Option, ) -> Result; #[subscription(name = "signatureSubscribe" => "signatureNotification", unsubscribe="signatureUnsubscribe", item=RpcResponse)] fn signature_subscribe(&self, signature: String, commitment_config: CommitmentConfig); }