Files
coop/crates/client/src/lib.rs
2024-11-24 15:17:35 +07:00

21 lines
340 B
Rust

use gpui::Global;
use nostr_sdk::prelude::*;
use state::get_client;
pub mod state;
pub struct NostrClient {
pub client: &'static Client,
}
impl Global for NostrClient {}
impl NostrClient {
pub async fn init() -> Self {
// Initialize nostr client
let client = get_client().await;
Self { client }
}
}