Add getHealth RPC method

This commit is contained in:
Michael Vines
2021-01-14 21:45:11 -08:00
parent 4d12cf61cc
commit dacb95083d
9 changed files with 148 additions and 23 deletions

View File

@@ -928,6 +928,11 @@ impl RpcClient {
Ok(hash)
}
pub fn get_health(&self) -> ClientResult<()> {
self.send::<String>(RpcRequest::GetHealth, Value::Null)
.map(|_| ())
}
pub fn get_token_account(&self, pubkey: &Pubkey) -> ClientResult<Option<UiTokenAccount>> {
Ok(self
.get_token_account_with_commitment(pubkey, self.commitment_config)?