pub trait SignerExt: Signer {
// Required methods
fn sign_id<'life0, 'async_trait>(
&'life0 self,
id: Id,
) -> Pin<Box<dyn Future<Output = Result<Signature, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn nip44_conversation_key<'life0, 'life1, 'async_trait>(
&'life0 self,
other: &'life1 PublicKey,
) -> Pin<Box<dyn Future<Output = Result<[u8; 32], Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn generate_delegation_signature<'life0, 'life1, 'async_trait>(
&'life0 self,
delegated_pubkey: PublicKey,
delegation_conditions: &'life1 DelegationConditions,
) -> Pin<Box<dyn Future<Output = Result<Signature, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn verify_delegation_signature(
&self,
delegated_pubkey: PublicKey,
delegation_conditions: &DelegationConditions,
signature: &Signature,
) -> Result<(), Error> { ... }
fn sign_event_with_pow<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
zero_bits: u8,
work_sender: Option<Sender<u8>>,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
}
Expand description
Extended Signer operations
These enable NIP-26 delegation, signing an event with PoW, signing of anything (not just events) and access to the NIP44 conversation key. none of which is available using NIP-07 (browser) or NIP-46 (bunker) signers.
Required Methods§
Sourcefn sign_id<'life0, 'async_trait>(
&'life0 self,
id: Id,
) -> Pin<Box<dyn Future<Output = Result<Signature, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sign_id<'life0, 'async_trait>(
&'life0 self,
id: Id,
) -> Pin<Box<dyn Future<Output = Result<Signature, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sign a 32-bit hash asynchronously
Sourcefn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sign a message asynchronously (this hashes with SHA-256 first internally)
Provided Methods§
Sourcefn generate_delegation_signature<'life0, 'life1, 'async_trait>(
&'life0 self,
delegated_pubkey: PublicKey,
delegation_conditions: &'life1 DelegationConditions,
) -> Pin<Box<dyn Future<Output = Result<Signature, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_delegation_signature<'life0, 'life1, 'async_trait>(
&'life0 self,
delegated_pubkey: PublicKey,
delegation_conditions: &'life1 DelegationConditions,
) -> Pin<Box<dyn Future<Output = Result<Signature, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate delegation signature
Sourcefn verify_delegation_signature(
&self,
delegated_pubkey: PublicKey,
delegation_conditions: &DelegationConditions,
signature: &Signature,
) -> Result<(), Error>
fn verify_delegation_signature( &self, delegated_pubkey: PublicKey, delegation_conditions: &DelegationConditions, signature: &Signature, ) -> Result<(), Error>
Verify delegation signature