Skip to main content

ActiveSigner

Enum ActiveSigner 

Source
pub enum ActiveSigner {
    Local(GuardedSigner),
    Bunker(WatchedBunkerSigner),
    Nip55(Nip55Signer),
    Keys(Keys),
}
Expand description

The signer for the active session.

nostr 0.45 removed ClientBuilder::signer / Client::signer: events are built and signed outside the client now, so Vector owns this dispatch.

A concrete enum rather than Arc<dyn ...> on purpose. 0.45 ships no blanket capability impls for Arc<T>, and the orphan rule forbids adding them, so a trait object would force every call site to deref. This also keeps dispatch static.

Deliberately NOT cached in a static: active_signer rebuilds it per call from state that is already swap-managed (SIGNER_KIND, BUNKER_SIGNER, MY_PUBLIC_KEY). A cached signer would be one more per-account global to invalidate on reset_session, and a stale one signs the new account’s events under the old identity.

Variants§

§

Local(GuardedSigner)

Local key from the GuardedKey vault.

§

Bunker(WatchedBunkerSigner)

Remote NIP-46 bunker, with reachability reporting.

§

Nip55(Nip55Signer)

On-device NIP-55 signer app reached over Android IPC.

§

Keys(Keys)

Raw keys — headless/CLI consumers and tests, which have a vault key but no notion of signer modes.

Trait Implementations§

Source§

impl AsyncGetPublicKey for ActiveSigner

Source§

type Error = SignerError

Error type
Source§

fn get_public_key_async( &self, ) -> BoxedFuture<'_, Result<PublicKey, Self::Error>>

Get public key
Source§

impl AsyncNip04 for ActiveSigner

Source§

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>>

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>>

Decrypts asynchronously a NIP-04 payload.
Source§

impl AsyncNip44 for ActiveSigner

Source§

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>>

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>>

Decrypts asynchronously a NIP-44 payload.
Source§

impl AsyncSignEvent for ActiveSigner

Source§

type Error = SignerError

Error type
Source§

fn sign_event_async( &self, unsigned: UnsignedEvent, ) -> BoxedFuture<'_, Result<Event, Self::Error>>

Sign an unsigned event
Source§

impl Clone for ActiveSigner

Source§

fn clone(&self) -> ActiveSigner

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActiveSigner

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> VectorSigner for T

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more