pub struct CdkBdk { /* private fields */ }Expand description
CDK onchain payment backend using BDK (Bitcoin Development Kit)
Implementations§
Source§impl CdkBdk
impl CdkBdk
Sourcepub fn new(
mnemonic: Mnemonic,
network: Network,
chain_source: ChainSource,
storage_dir_path: String,
fee_reserve: FeeReserve,
kv_store: Arc<dyn KVStore<Err = Error> + Send + Sync>,
batch_config: Option<BatchConfig>,
num_confs: u32,
min_receive_amount_sat: u64,
min_send_amount_sat: u64,
sync_interval_secs: u64,
shutdown_timeout_secs: Option<u64>,
sync_config: Option<SyncConfig>,
) -> Result<Self, Error>
pub fn new( mnemonic: Mnemonic, network: Network, chain_source: ChainSource, storage_dir_path: String, fee_reserve: FeeReserve, kv_store: Arc<dyn KVStore<Err = Error> + Send + Sync>, batch_config: Option<BatchConfig>, num_confs: u32, min_receive_amount_sat: u64, min_send_amount_sat: u64, sync_interval_secs: u64, shutdown_timeout_secs: Option<u64>, sync_config: Option<SyncConfig>, ) -> Result<Self, Error>
Create a new CdkBdk instance
Trait Implementations§
Source§impl MintPayment for CdkBdk
impl MintPayment for CdkBdk
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the payment processor
Called when the mint starts up to initialize the payment processor
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the payment processor
Called when the mint shuts down to gracefully stop the payment processor
Source§fn get_settings<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SettingsResponse, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_settings<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SettingsResponse, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Base Settings
Source§fn get_payment_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
_unit: &'life1 CurrencyUnit,
options: OutgoingPaymentOptions,
) -> Pin<Box<dyn Future<Output = Result<PaymentQuoteResponse, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_payment_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
_unit: &'life1 CurrencyUnit,
options: OutgoingPaymentOptions,
) -> Pin<Box<dyn Future<Output = Result<PaymentQuoteResponse, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get payment quote
Used to get fee and amount required for a payment request
Source§fn make_payment<'life0, 'life1, 'async_trait>(
&'life0 self,
_unit: &'life1 CurrencyUnit,
options: OutgoingPaymentOptions,
) -> Pin<Box<dyn Future<Output = Result<MakePaymentResponse, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn make_payment<'life0, 'life1, 'async_trait>(
&'life0 self,
_unit: &'life1 CurrencyUnit,
options: OutgoingPaymentOptions,
) -> Pin<Box<dyn Future<Output = Result<MakePaymentResponse, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Pay request
Source§fn create_incoming_payment_request<'life0, 'async_trait>(
&'life0 self,
options: IncomingPaymentOptions,
) -> Pin<Box<dyn Future<Output = Result<CreateIncomingPaymentResponse, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_incoming_payment_request<'life0, 'async_trait>(
&'life0 self,
options: IncomingPaymentOptions,
) -> Pin<Box<dyn Future<Output = Result<CreateIncomingPaymentResponse, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new invoice
Source§fn wait_payment_event<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Event> + Send>>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn wait_payment_event<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Event> + Send>>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Listen for invoices to be paid to the mint
Returns a stream of request_lookup_id once invoices are paid
Source§fn check_incoming_payment_status<'life0, 'life1, 'async_trait>(
&'life0 self,
payment_identifier: &'life1 PaymentIdentifier,
) -> Pin<Box<dyn Future<Output = Result<Vec<WaitPaymentResponse>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check_incoming_payment_status<'life0, 'life1, 'async_trait>(
&'life0 self,
payment_identifier: &'life1 PaymentIdentifier,
) -> Pin<Box<dyn Future<Output = Result<Vec<WaitPaymentResponse>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check the status of an incoming payment
Source§fn check_outgoing_payment<'life0, 'life1, 'async_trait>(
&'life0 self,
payment_identifier: &'life1 PaymentIdentifier,
) -> Pin<Box<dyn Future<Output = Result<MakePaymentResponse, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check_outgoing_payment<'life0, 'life1, 'async_trait>(
&'life0 self,
payment_identifier: &'life1 PaymentIdentifier,
) -> Pin<Box<dyn Future<Output = Result<MakePaymentResponse, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check the status of an outgoing payment
Source§fn is_payment_event_stream_active(&self) -> bool
fn is_payment_event_stream_active(&self) -> bool
Is the payment event stream active
Source§fn cancel_payment_event_stream(&self)
fn cancel_payment_event_stream(&self)
Cancel the payment event stream
Auto Trait Implementations§
impl !RefUnwindSafe for CdkBdk
impl !UnwindSafe for CdkBdk
impl Freeze for CdkBdk
impl Send for CdkBdk
impl Sync for CdkBdk
impl Unpin for CdkBdk
impl UnsafeUnpin for CdkBdk
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