diff --git a/src/api/whoami.rs b/src/api/whoami.rs index 156a5a2..8e29871 100644 --- a/src/api/whoami.rs +++ b/src/api/whoami.rs @@ -7,7 +7,23 @@ use crate::{error::GolgiError, sbot::Sbot, utils}; impl Sbot { - /// Call the `whoami` RPC method and return an `id`. + /// Get the public key of the local identity. + /// + /// # Example + /// + /// ```rust + /// use golgi::{Sbot, GolgiError}; + /// + /// async fn fetch_id() -> Result<(), GolgiError> { + /// let mut sbot_client = Sbot::init(None, None).await?; + /// + /// let pub_key = sbot_client.whoami().await?; + /// + /// println!("local ssb id: {}", pub_key); + /// + /// Ok(()) + /// } + /// ``` pub async fn whoami(&mut self) -> Result { let mut sbot_connection = self.get_sbot_connection().await?; let req_id = sbot_connection.client.whoami_req_send().await?;