pub struct WatchedBunkerSigner { /* private fields */ }Expand description
NostrSigner wrapper that emits BunkerConnectionState transitions on
every signing outcome. The inner NostrConnect is cheaply clonable
(internally Arc’d), so this is also Clone.
Captures a SessionGuard at construction; state flips after reset_session
are no-ops to avoid leaking signer-state events across an account swap (an
in-flight signing call resolving after the new account is installed would
otherwise emit bunker_state: offline against a local-account session).
Implementations§
Source§impl WatchedBunkerSigner
impl WatchedBunkerSigner
pub fn new(inner: NostrConnect) -> Self
Trait Implementations§
Source§impl Clone for WatchedBunkerSigner
impl Clone for WatchedBunkerSigner
Source§fn clone(&self) -> WatchedBunkerSigner
fn clone(&self) -> WatchedBunkerSigner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 WatchedBunkerSigner
impl Debug for WatchedBunkerSigner
Source§impl NostrSigner for WatchedBunkerSigner
impl NostrSigner for WatchedBunkerSigner
Source§fn backend(&self) -> SignerBackend<'_>
fn backend(&self) -> SignerBackend<'_>
Signer backend
Source§fn get_public_key<'a>(
&'a self,
) -> BoxedFuture<'a, Result<PublicKey, SignerError>>
fn get_public_key<'a>( &'a self, ) -> BoxedFuture<'a, Result<PublicKey, SignerError>>
Get signer public key
Source§fn sign_event<'a>(
&'a self,
unsigned: UnsignedEvent,
) -> BoxedFuture<'a, Result<Event, SignerError>>
fn sign_event<'a>( &'a self, unsigned: UnsignedEvent, ) -> BoxedFuture<'a, Result<Event, SignerError>>
Sign an unsigned event
Source§fn nip04_encrypt<'a>(
&'a self,
public_key: &'a PublicKey,
content: &'a str,
) -> BoxedFuture<'a, Result<String, SignerError>>
fn nip04_encrypt<'a>( &'a self, public_key: &'a PublicKey, content: &'a str, ) -> BoxedFuture<'a, Result<String, SignerError>>
NIP04 encrypt (deprecate and unsecure)
Source§fn nip04_decrypt<'a>(
&'a self,
public_key: &'a PublicKey,
content: &'a str,
) -> BoxedFuture<'a, Result<String, SignerError>>
fn nip04_decrypt<'a>( &'a self, public_key: &'a PublicKey, content: &'a str, ) -> BoxedFuture<'a, Result<String, SignerError>>
NIP04 decrypt
Source§fn nip44_encrypt<'a>(
&'a self,
public_key: &'a PublicKey,
content: &'a str,
) -> BoxedFuture<'a, Result<String, SignerError>>
fn nip44_encrypt<'a>( &'a self, public_key: &'a PublicKey, content: &'a str, ) -> BoxedFuture<'a, Result<String, SignerError>>
NIP44 encrypt
Source§fn nip44_decrypt<'a>(
&'a self,
public_key: &'a PublicKey,
content: &'a str,
) -> BoxedFuture<'a, Result<String, SignerError>>
fn nip44_decrypt<'a>( &'a self, public_key: &'a PublicKey, content: &'a str, ) -> BoxedFuture<'a, Result<String, SignerError>>
NIP44 decrypt
Auto Trait Implementations§
impl !Freeze for WatchedBunkerSigner
impl !RefUnwindSafe for WatchedBunkerSigner
impl !UnwindSafe for WatchedBunkerSigner
impl Send for WatchedBunkerSigner
impl Sync for WatchedBunkerSigner
impl Unpin for WatchedBunkerSigner
impl UnsafeUnpin for WatchedBunkerSigner
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more