chore: refactor NIP-4E implementation
This commit is contained in:
@@ -19,6 +19,7 @@ pub const BOOTSTRAP_RELAYS: [&str; 3] = [
|
||||
/// Subscriptions
|
||||
pub const NEW_MESSAGE_SUB_ID: &str = "listen_new_giftwraps";
|
||||
pub const ALL_MESSAGES_SUB_ID: &str = "listen_all_giftwraps";
|
||||
pub const DEVICE_SUB_ID: &str = "listen_device_announcement";
|
||||
|
||||
/// Image Resizer Service
|
||||
pub const IMAGE_SERVICE: &str = "https://wsrv.nl";
|
||||
|
||||
@@ -63,11 +63,11 @@ pub async fn get_device_keys() -> Option<Arc<dyn NostrSigner>> {
|
||||
}
|
||||
|
||||
/// Set device keys
|
||||
pub async fn set_device_keys<T>(signer: T)
|
||||
pub async fn set_device_keys<T>(signer: Arc<T>)
|
||||
where
|
||||
T: NostrSigner + 'static,
|
||||
{
|
||||
DEVICE_KEYS.lock().await.replace(Arc::new(signer));
|
||||
DEVICE_KEYS.lock().await.replace(signer);
|
||||
|
||||
// Re-subscribe to all messages
|
||||
smol::spawn(async move {
|
||||
|
||||
Reference in New Issue
Block a user