Skip to main content

CashuQuoteState

Struct CashuQuoteState 

Source
pub struct CashuQuoteState { /* private fields */ }

Implementations§

Source§

impl CashuQuoteState

Source

pub fn new( routing: CashuRoutingConfig, peer_selector: Arc<RwLock<PeerSelector>>, payment_client: Option<Arc<dyn CashuPaymentClient>>, ) -> Self

Source

pub fn new_with_mint_metadata( routing: CashuRoutingConfig, peer_selector: Arc<RwLock<PeerSelector>>, payment_client: Option<Arc<dyn CashuPaymentClient>>, mint_metadata: Arc<CashuMintMetadataStore>, ) -> Self

Source

pub fn payment_client_available(&self) -> bool

Source

pub async fn requester_quote_terms(&self) -> Option<(String, u64, u32)>

Source

pub fn settlement_timeout(&self) -> Duration

Source

pub async fn requested_quote_mint(&self, amount_sat: u64) -> Option<String>

Source

pub async fn choose_quote_mint( &self, requested_mint: Option<&str>, ) -> Option<String>

Source

pub async fn register_pending_quote( &self, hash_hex: String, preferred_mint_url: Option<String>, offered_payment_sat: u64, ) -> Receiver<Option<NegotiatedQuote>>

Source

pub async fn clear_pending_quote(&self, hash_hex: &str)

Source

pub async fn should_accept_quote_response( &self, from_peer: &str, preferred_mint_url: Option<&str>, offered_payment_sat: u64, res: &DataQuoteResponse, ) -> bool

Source

pub async fn handle_quote_response( &self, from_peer: &str, res: DataQuoteResponse, ) -> bool

Source

pub async fn build_quote_response( &self, from_peer: &str, req: &DataQuoteRequest, can_serve: bool, ) -> DataQuoteResponse

Source

pub async fn take_valid_quote( &self, from_peer: &str, hash: &[u8], quote_id: u64, ) -> Option<ExpectedSettlement>

Source

pub async fn register_expected_payment( self: &Arc<Self>, from_peer: String, hash_hex: String, quote_id: u64, settlement: ExpectedSettlement, )

Source

pub async fn claim_expected_payment( &self, from_peer: &str, hash: &[u8], quote_id: u64, chunk_index: u32, announced_payment_sat: u64, announced_mint: Option<&str>, ) -> Result<ExpectedSettlement>

Source

pub async fn prepare_quoted_transfer( &self, from_peer: &str, hash: &[u8], quote_id: u64, settlement: &ExpectedSettlement, data: Vec<u8>, ) -> Option<(DataChunk, ExpectedSettlement)>

Source

pub async fn next_outgoing_chunk( &self, from_peer: &str, hash: &[u8], quote_id: u64, ) -> Option<(DataChunk, ExpectedSettlement)>

Source

pub async fn create_payment_token( &self, mint_url: &str, amount_sat: u64, ) -> Result<CashuSentPayment>

Source

pub async fn receive_payment_token( &self, encoded_token: &str, ) -> Result<CashuReceivedPayment>

Source

pub async fn revoke_payment_token( &self, mint_url: &str, operation_id: &str, ) -> Result<()>

Source

pub async fn record_paid_peer(&self, peer_id: &str, amount_sat: u64)

Source

pub async fn record_receipt_from_peer( &self, peer_id: &str, mint_url: &str, amount_sat: u64, ) -> Result<()>

Source

pub async fn record_payment_default_from_peer(&self, peer_id: &str)

Source

pub async fn record_mint_receive_failure(&self, mint_url: &str) -> Result<()>

Source

pub async fn should_refuse_requests_from_peer(&self, peer_id: &str) -> bool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more