diff --git a/src/rpc.rs b/src/rpc.rs index 69e546f99..29b23ba34 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -37,6 +37,9 @@ build_rpc_trait! { #[rpc(meta, name = "solana_getBalance")] fn get_balance(&self, Self::Metadata, String) -> Result; + #[rpc(meta, name = "solana_getLastId")] + fn get_last_id(&self, Self::Metadata) -> Result; + #[rpc(meta, name = "solana_getTransactionCount")] fn get_transaction_count(&self, Self::Metadata) -> Result; @@ -92,6 +95,11 @@ impl RpcSol for RpcSolImpl { } } } + fn get_last_id(&self, meta: Self::Metadata) -> Result { + let mut client = mk_client(&meta.leader.unwrap()); + let last_id = client.get_last_id(); + Ok(bs58::encode(last_id).into_string()) + } fn get_transaction_count(&self, meta: Self::Metadata) -> Result { let mut client = mk_client(&meta.leader.unwrap()); let tx_count = client.transaction_count();