pub struct BunkerClient {
pub remote_signer_pubkey: PublicKey,
pub relay_url: RelayUrl,
pub local_signer: Arc<KeySigner>,
pub public_key: PublicKey,
pub timeout: Duration,
pub client: Client,
}
Expand description
This is a NIP-46 Bunker client
Fields§
§remote_signer_pubkey: PublicKey
The pubkey of the bunker
relay_url: RelayUrl
The relay the bunker is listening at
local_signer: Arc<KeySigner>
Our local identity
public_key: PublicKey
User Public Key
timeout: Duration
Timeout
client: Client
Client
Implementations§
Source§impl BunkerClient
impl BunkerClient
Sourcepub async fn from_stored_data(
remote_signer_pubkey: PublicKey,
relay_url: RelayUrl,
keysigner: KeySigner,
public_key: PublicKey,
timeout: Duration,
) -> BunkerClient
pub async fn from_stored_data( remote_signer_pubkey: PublicKey, relay_url: RelayUrl, keysigner: KeySigner, public_key: PublicKey, timeout: Duration, ) -> BunkerClient
Create a new BunkerClient from stored data. This will be in the locked state.
Sourcepub fn change_passphrase(
&self,
old: &str,
new: &str,
log_n: u8,
) -> Result<(), Error>
pub fn change_passphrase( &self, old: &str, new: &str, log_n: u8, ) -> Result<(), Error>
Change passphrase
Sourcepub async fn call(&self, request: Nip46Request) -> Result<Nip46Response, Error>
pub async fn call(&self, request: Nip46Request) -> Result<Nip46Response, Error>
Send a Nip46Request
and wait for a Nip46Response
(up to our timeout)
Sourcepub async fn disconnect(&self) -> Result<(), Error>
pub async fn disconnect(&self) -> Result<(), Error>
Disconnect from the relay
Sourcepub async fn disconnect_and_lock(&self) -> Result<(), Error>
pub async fn disconnect_and_lock(&self) -> Result<(), Error>
Disconnect from the relay and lock
Trait Implementations§
Source§impl Debug for BunkerClient
impl Debug for BunkerClient
Source§impl<'de> Deserialize<'de> for BunkerClient
impl<'de> Deserialize<'de> for BunkerClient
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for BunkerClient
impl Serialize for BunkerClient
Source§impl Signer for BunkerClient
impl Signer for BunkerClient
Source§fn public_key(&self) -> PublicKey
fn public_key(&self) -> PublicKey
What is the signer’s public key?
Source§fn encrypted_private_key(&self) -> Option<EncryptedPrivateKey>
fn encrypted_private_key(&self) -> Option<EncryptedPrivateKey>
What is the signer’s encrypted private key?
Source§fn sign_event<'life0, 'async_trait>(
&'life0 self,
pre_event: PreEvent,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sign_event<'life0, 'async_trait>(
&'life0 self,
pre_event: PreEvent,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sign an event
Source§fn encrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
other: &'life1 PublicKey,
plaintext: &'life2 str,
algo: ContentEncryptionAlgorithm,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn encrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
other: &'life1 PublicKey,
plaintext: &'life2 str,
algo: ContentEncryptionAlgorithm,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Encrypt
Source§fn decrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
other: &'life1 PublicKey,
ciphertext: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn decrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
other: &'life1 PublicKey,
ciphertext: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Decrypt NIP-04 or NIP-44
Source§fn key_security(&self) -> Result<KeySecurity, Error>
fn key_security(&self) -> Result<KeySecurity, Error>
Get the security level of the private key
Source§fn giftwrap<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
pubkey: PublicKey,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn giftwrap<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
pubkey: PublicKey,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Giftwrap an event
Source§fn create_metadata_event<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
metadata: Metadata,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_metadata_event<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
metadata: Metadata,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create an event that sets Metadata
Source§fn create_zap_request_event<'life0, 'async_trait>(
&'life0 self,
recipient_pubkey: PublicKey,
zapped_event: Option<Id>,
millisatoshis: u64,
relays: Vec<String>,
content: String,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_zap_request_event<'life0, 'async_trait>(
&'life0 self,
recipient_pubkey: PublicKey,
zapped_event: Option<Id>,
millisatoshis: u64,
relays: Vec<String>,
content: String,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a ZapRequest event
These events are not published to nostr, they are sent to a lnurl.
Auto Trait Implementations§
impl !Freeze for BunkerClient
impl !RefUnwindSafe for BunkerClient
impl Send for BunkerClient
impl Sync for BunkerClient
impl Unpin for BunkerClient
impl !UnwindSafe for BunkerClient
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