pub struct PaygressClient { /* private fields */ }Expand description
Builder for a Paygress consumer SDK client. Wraps the existing
DiscoveryClient with typed write-side operations.
Implementations§
Source§impl PaygressClient
impl PaygressClient
Sourcepub async fn new(relays: Vec<String>, private_key: String) -> Result<Self>
pub async fn new(relays: Vec<String>, private_key: String) -> Result<Self>
Construct against the given relays and a Nostr private key
(nsec1... or hex). The key is required for any operation
that sends a DM (spawn / topup / status); read-only queries
would also work without one but this constructor unifies the
path so callers don’t need two clients.
Sourcepub fn with_response_timeout_secs(self, secs: u64) -> Self
pub fn with_response_timeout_secs(self, secs: u64) -> Self
Override how long each round-trip waits for a provider response. Defaults to 60s.
Sourcepub fn with_message_type(self, message_type: impl Into<String>) -> Self
pub fn with_message_type(self, message_type: impl Into<String>) -> Self
Override the encryption mode used for outbound DMs
("nip04" or "nip17"). Defaults to nip04. NIP-17
gift-wrap is sender-anonymous but supported by fewer relays.
Sourcepub fn discovery(&self) -> &DiscoveryClient
pub fn discovery(&self) -> &DiscoveryClient
Underlying discovery client for read-only queries.
Sourcepub async fn list_offers(
&self,
filter: Option<ProviderFilter>,
) -> Result<Vec<ProviderInfo>>
pub async fn list_offers( &self, filter: Option<ProviderFilter>, ) -> Result<Vec<ProviderInfo>>
Discover providers matching an optional filter.
Sourcepub async fn spawn(
&self,
provider_npub: &str,
request: SpawnRequest,
) -> Result<SpawnOutcome>
pub async fn spawn( &self, provider_npub: &str, request: SpawnRequest, ) -> Result<SpawnOutcome>
Send a spawn request and wait for the provider’s response.
Sourcepub async fn topup(
&self,
provider_npub: &str,
request: TopupRequest,
) -> Result<TopupOutcome>
pub async fn topup( &self, provider_npub: &str, request: TopupRequest, ) -> Result<TopupOutcome>
Send a top-up request and wait for the provider’s response.
Auto Trait Implementations§
impl !Freeze for PaygressClient
impl !RefUnwindSafe for PaygressClient
impl Send for PaygressClient
impl Sync for PaygressClient
impl Unpin for PaygressClient
impl UnsafeUnpin for PaygressClient
impl !UnwindSafe for PaygressClient
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
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>
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>
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