use alloc::string::String;
use core::any::Any;
use core::fmt::Debug;
use crate::key::PublicKey;
use crate::util::BoxedFuture;
pub trait Nip04: Any + Debug + Send + Sync {
type Error: core::error::Error;
fn nip04_encrypt(&self, public_key: &PublicKey, content: &str) -> Result<String, Self::Error>;
fn nip04_decrypt(
&self,
public_key: &PublicKey,
encrypted_content: &str,
) -> Result<String, Self::Error>;
}
pub trait AsyncNip04: Any + Debug + Send + Sync {
type Error: core::error::Error;
fn nip04_encrypt_async<'a>(
&'a self,
public_key: &'a PublicKey,
content: &'a str,
) -> BoxedFuture<'a, Result<String, Self::Error>>;
fn nip04_decrypt_async<'a>(
&'a self,
public_key: &'a PublicKey,
encrypted_content: &'a str,
) -> BoxedFuture<'a, Result<String, Self::Error>>;
}