lnbot 1.0.0

Official Rust SDK for LnBot — Bitcoin for AI Agents. Send and receive sats over Lightning.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::client::LnBot;
use crate::errors::LnBotError;
use crate::types::*;

/// Operations on API keys.
pub struct KeysResource<'a> {
    pub(crate) client: &'a LnBot,
}

impl KeysResource<'_> {
    /// Rotates the API key in the given slot (1 = primary, 2 = secondary).
    pub async fn rotate(&self, slot: i32) -> Result<RotateApiKeyResponse, LnBotError> {
        self.client
            .post::<RotateApiKeyResponse>(&format!("/v1/keys/{}/rotate", slot), None::<&()>)
            .await
    }
}