pub struct WatchedBunkerSigner { /* private fields */ }Expand description
VectorSigner 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 AsyncGetPublicKey for WatchedBunkerSigner
impl AsyncGetPublicKey for WatchedBunkerSigner
Source§type Error = SignerError
type Error = SignerError
Error type
Source§fn get_public_key_async(
&self,
) -> BoxedFuture<'_, Result<PublicKey, Self::Error>>
fn get_public_key_async( &self, ) -> BoxedFuture<'_, Result<PublicKey, Self::Error>>
Get public key
Source§impl AsyncNip04 for WatchedBunkerSigner
impl AsyncNip04 for WatchedBunkerSigner
Source§type Error = SignerError
type Error = SignerError
NIP-04 error
Source§fn nip04_encrypt_async<'a>(
&'a self,
public_key: &'a PublicKey,
content: &'a str,
) -> BoxedFuture<'a, Result<String, Self::Error>>
fn nip04_encrypt_async<'a>( &'a self, public_key: &'a PublicKey, content: &'a str, ) -> BoxedFuture<'a, Result<String, Self::Error>>
Encrypts asynchronously using NIP-04. Read more
Source§fn nip04_decrypt_async<'a>(
&'a self,
public_key: &'a PublicKey,
encrypted_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>>
Decrypts asynchronously a NIP-04 payload.
Source§impl AsyncNip44 for WatchedBunkerSigner
impl AsyncNip44 for WatchedBunkerSigner
Source§type Error = SignerError
type Error = SignerError
NIP-44 error
Source§fn nip44_encrypt_async<'a>(
&'a self,
public_key: &'a PublicKey,
content: &'a str,
) -> BoxedFuture<'a, Result<String, Self::Error>>
fn nip44_encrypt_async<'a>( &'a self, public_key: &'a PublicKey, content: &'a str, ) -> BoxedFuture<'a, Result<String, Self::Error>>
Encrypts asynchronously using NIP-44. Read more
Source§fn nip44_decrypt_async<'a>(
&'a self,
public_key: &'a PublicKey,
payload: &'a str,
) -> BoxedFuture<'a, Result<String, Self::Error>>
fn nip44_decrypt_async<'a>( &'a self, public_key: &'a PublicKey, payload: &'a str, ) -> BoxedFuture<'a, Result<String, Self::Error>>
Decrypts asynchronously a NIP-44 payload.
Source§impl AsyncSignEvent for WatchedBunkerSigner
impl AsyncSignEvent for WatchedBunkerSigner
Source§type Error = SignerError
type Error = SignerError
Error type
Source§fn sign_event_async(
&self,
unsigned: UnsignedEvent,
) -> BoxedFuture<'_, Result<Event, Self::Error>>
fn sign_event_async( &self, unsigned: UnsignedEvent, ) -> BoxedFuture<'_, Result<Event, Self::Error>>
Sign an unsigned event
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 moreAuto 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