Struct nip_70::Nip70Client
source · pub struct Nip70Client { /* private fields */ }
Expand description
A client for the NIP-70 protocol.
Implementations§
source§impl Nip70Client
impl Nip70Client
pub fn new() -> Self
sourcepub async fn get_public_key(&self) -> Result<XOnlyPublicKey, Nip70ClientError>
pub async fn get_public_key(&self) -> Result<XOnlyPublicKey, Nip70ClientError>
Fetches the public key of the signed-in user from the NIP-70 server.
sourcepub async fn sign_event(
&self,
event: UnsignedEvent
) -> Result<Event, Nip70ClientError>
pub async fn sign_event( &self, event: UnsignedEvent ) -> Result<Event, Nip70ClientError>
Signs a Nostr event on behalf of the signed-in user using the NIP-70 server.
sourcepub async fn pay_invoice(
&self,
request: PayInvoiceRequest
) -> Result<PayInvoiceResponse, Nip70ClientError>
pub async fn pay_invoice( &self, request: PayInvoiceRequest ) -> Result<PayInvoiceResponse, Nip70ClientError>
Pays an invoice using the NIP-70 server.
sourcepub async fn get_relays(
&self
) -> Result<Option<HashMap<String, RelayPolicy>>, Nip70ClientError>
pub async fn get_relays( &self ) -> Result<Option<HashMap<String, RelayPolicy>>, Nip70ClientError>
Fetches the list of relays that the NIP-70 server is aware of.
If the server does not support this feature, returns Ok(None)
.
Trait Implementations§
source§impl Clone for Nip70Client
impl Clone for Nip70Client
source§fn clone(&self) -> Nip70Client
fn clone(&self) -> Nip70Client
Returns a copy of the value. Read more
1.0.0 · 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 RefUnwindSafe for Nip70Client
impl Send for Nip70Client
impl Sync for Nip70Client
impl Unpin for Nip70Client
impl UnwindSafe for Nip70Client
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