Enum nostr_signer::NostrSigner
source · pub enum NostrSigner {
Keys(Keys),
NIP46(Box<Nip46Signer>),
}
Expand description
Nostr signer
Variants§
Implementations§
source§impl NostrSigner
impl NostrSigner
sourcepub fn nip46(signer: Nip46Signer) -> Self
pub fn nip46(signer: Nip46Signer) -> Self
Compose NostrSigner with Nip46Signer
sourcepub fn type(&self) -> NostrSignerType
pub fn type(&self) -> NostrSignerType
Get Nostr Signer Type
sourcepub async fn public_key(&self) -> Result<PublicKey, Error>
pub async fn public_key(&self) -> Result<PublicKey, Error>
Get signer public key
sourcepub async fn sign_event_builder(
&self,
builder: EventBuilder
) -> Result<Event, Error>
pub async fn sign_event_builder( &self, builder: EventBuilder ) -> Result<Event, Error>
Sign an EventBuilder
sourcepub async fn sign_event(&self, unsigned: UnsignedEvent) -> Result<Event, Error>
pub async fn sign_event(&self, unsigned: UnsignedEvent) -> Result<Event, Error>
Sign an UnsignedEvent
sourcepub async fn nip04_encrypt<T>(
&self,
public_key: PublicKey,
content: T
) -> Result<String, Error>
pub async fn nip04_encrypt<T>( &self, public_key: PublicKey, content: T ) -> Result<String, Error>
NIP04 encrypt
sourcepub async fn nip04_decrypt<T>(
&self,
public_key: PublicKey,
encrypted_content: T
) -> Result<String, Error>
pub async fn nip04_decrypt<T>( &self, public_key: PublicKey, encrypted_content: T ) -> Result<String, Error>
NIP04 decrypt
sourcepub async fn nip44_encrypt<T>(
&self,
public_key: PublicKey,
content: T
) -> Result<String, Error>
pub async fn nip44_encrypt<T>( &self, public_key: PublicKey, content: T ) -> Result<String, Error>
NIP44 encryption with NostrSigner
sourcepub async fn nip44_decrypt<T>(
&self,
public_key: PublicKey,
payload: T
) -> Result<String, Error>
pub async fn nip44_decrypt<T>( &self, public_key: PublicKey, payload: T ) -> Result<String, Error>
NIP44 decryption with NostrSigner
Trait Implementations§
source§impl Clone for NostrSigner
impl Clone for NostrSigner
source§fn clone(&self) -> NostrSigner
fn clone(&self) -> NostrSigner
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for NostrSigner
impl Debug for NostrSigner
source§impl From<&Keys> for NostrSigner
impl From<&Keys> for NostrSigner
source§impl From<Keys> for NostrSigner
impl From<Keys> for NostrSigner
source§impl From<Nip46Signer> for NostrSigner
impl From<Nip46Signer> for NostrSigner
source§fn from(nip46: Nip46Signer) -> Self
fn from(nip46: Nip46Signer) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NostrSigner
impl !RefUnwindSafe for NostrSigner
impl Send for NostrSigner
impl Sync for NostrSigner
impl Unpin for NostrSigner
impl !UnwindSafe for NostrSigner
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more