QuotesTransaction

Trait QuotesTransaction 

Source
pub trait QuotesTransaction<'a> {
    type Err: Into<Error> + From<Error>;

    // Required methods
    fn get_mint_quote<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        quote_id: &'life1 Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<MintMintQuote>, Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_mint_quote<'life0, 'async_trait>(
        &'life0 mut self,
        quote: MintMintQuote,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn increment_mint_quote_amount_paid<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        quote_id: &'life1 Uuid,
        amount_paid: Amount,
        payment_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn increment_mint_quote_amount_issued<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        quote_id: &'life1 Uuid,
        amount_issued: Amount,
    ) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove_mint_quote<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        quote_id: &'life1 Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_melt_quote<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        quote_id: &'life1 Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<MeltQuote>, Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_melt_quote<'life0, 'async_trait>(
        &'life0 mut self,
        quote: MeltQuote,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_melt_quote_request_lookup_id<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        quote_id: &'life1 Uuid,
        new_request_lookup_id: &'life2 PaymentIdentifier,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn update_melt_quote_state<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        quote_id: &'life1 Uuid,
        new_state: MeltQuoteState,
        payment_proof: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<(MeltQuoteState, MeltQuote), Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove_melt_quote<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        quote_id: &'life1 Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_mint_quote_by_request<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        request: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<MintMintQuote>, Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_mint_quote_by_request_lookup_id<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        request_lookup_id: &'life1 PaymentIdentifier,
    ) -> Pin<Box<dyn Future<Output = Result<Option<MintMintQuote>, Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Mint Quote Database writer trait

Required Associated Types§

Source

type Err: Into<Error> + From<Error>

Mint Quotes Database Error

Required Methods§

Source

fn get_mint_quote<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<MintMintQuote>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get MintMintQuote and lock it for update in this transaction

Source

fn add_mint_quote<'life0, 'async_trait>( &'life0 mut self, quote: MintMintQuote, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn increment_mint_quote_amount_paid<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 Uuid, amount_paid: Amount, payment_id: String, ) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Increment amount paid MintMintQuote

Source

fn increment_mint_quote_amount_issued<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 Uuid, amount_issued: Amount, ) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Increment amount paid MintMintQuote

Source

fn remove_mint_quote<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_melt_quote<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<MeltQuote>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get mint::MeltQuote and lock it for update in this transaction

Source

fn add_melt_quote<'life0, 'async_trait>( &'life0 mut self, quote: MeltQuote, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn update_melt_quote_request_lookup_id<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, quote_id: &'life1 Uuid, new_request_lookup_id: &'life2 PaymentIdentifier, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Updates the request lookup id for a melt quote

Source

fn update_melt_quote_state<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 Uuid, new_state: MeltQuoteState, payment_proof: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<(MeltQuoteState, MeltQuote), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update mint::MeltQuote state

It is expected for this function to fail if the state is already set to the new state

Source

fn remove_melt_quote<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_mint_quote_by_request<'life0, 'life1, 'async_trait>( &'life0 mut self, request: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<MintMintQuote>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all MintMintQuotes and lock it for update in this transaction

Source

fn get_mint_quote_by_request_lookup_id<'life0, 'life1, 'async_trait>( &'life0 mut self, request_lookup_id: &'life1 PaymentIdentifier, ) -> Pin<Box<dyn Future<Output = Result<Option<MintMintQuote>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all MintMintQuotes

Implementors§