pub struct FiatTopup { /* private fields */ }
Implementations§
source§impl FiatTopup
impl FiatTopup
sourcepub fn accept_tc(&self, version: i64, fingerprint: String) -> Result<()>
pub fn accept_tc(&self, version: i64, fingerprint: String) -> Result<()>
Accepts Pocket’s T&C.
Parameters:
version
- the version number being accepted.fingerprint
- the fingerprint of the version being accepted.
Requires network: yes
sourcepub fn query_tc_status(&self) -> Result<TermsAndConditionsStatus>
pub fn query_tc_status(&self) -> Result<TermsAndConditionsStatus>
Query for the current T&C status.
Requires network: yes
sourcepub fn register(
&self,
email: Option<String>,
user_iban: String,
user_currency: String,
provider: String,
referral_code: Option<String>,
) -> Result<FiatTopupSetupInfo>
pub fn register( &self, email: Option<String>, user_iban: String, user_currency: String, provider: String, referral_code: Option<String>, ) -> Result<FiatTopupSetupInfo>
Register for fiat topups. Returns information that can be used by the user to transfer fiat to the 3rd party exchange service. Once the 3rd party exchange receives funds, the user will be able to withdraw sats using LNURL-w.
Parameters:
email
- this email will be used to send status information about different topupsuser_iban
- the user will send fiat from this ibanuser_currency
- the fiat currency (ISO 4217 currency code) that will be sent for exchange. Not all are supported. A consumer of this library should find out about available ones using other sources.provider
- a fiat topup provider id.referral_code
- a code to be provided by users in order to get benefits,
Requires network: yes
sourcepub fn reset(&self) -> Result<()>
pub fn reset(&self) -> Result<()>
Resets a previous fiat topup registration.
Requires network: no
sourcepub fn get_info(&self) -> Result<Option<FiatTopupSetupInfo>>
pub fn get_info(&self) -> Result<Option<FiatTopupSetupInfo>>
Returns the latest FiatTopupSetupInfo
if the user has registered for the fiat topup.
Requires network: no
sourcepub fn calculate_payout_fee(&self, offer: OfferInfo) -> Result<Amount>
pub fn calculate_payout_fee(&self, offer: OfferInfo) -> Result<Amount>
Calculates the payout fee for an uncompleted offer.
Parameters:
offer
- An uncompleted offer for which the lightning payout fee should get calculated.
Requires network: yes
sourcepub fn request_collection(&self, offer: OfferInfo) -> Result<String>
pub fn request_collection(&self, offer: OfferInfo) -> Result<String>
Request to collect the offer (e.g. a Pocket topup).
A payment hash will be returned to track incoming payment.
The offer collection might be considered successful once
EventsCallback::payment_received
is called,
or the PaymentState
of the respective payment becomes PaymentState::Succeeded
.
Parameters:
offer
- An offer that is still valid for collection. Must have itslnurlw
field filled in.
Requires network: yes
Auto Trait Implementations§
impl Freeze for FiatTopup
impl !RefUnwindSafe for FiatTopup
impl Send for FiatTopup
impl Sync for FiatTopup
impl Unpin for FiatTopup
impl !UnwindSafe for FiatTopup
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any
.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request