breez_sdk_liquid/payjoin/
mod.rs

1pub(crate) mod error;
2pub(crate) mod model;
3mod network_fee;
4mod pset;
5pub(crate) mod side_swap;
6mod utxo_select;
7
8use error::PayjoinResult;
9use lwk_wollet::elements::Transaction;
10use model::AcceptedAsset;
11
12#[sdk_macros::async_trait]
13pub trait PayjoinService: Send + Sync {
14    /// Get a list of accepted assets
15    async fn fetch_accepted_assets(&self) -> PayjoinResult<Vec<AcceptedAsset>>;
16
17    /// Estimate the fee for a payjoin transaction
18    async fn estimate_payjoin_tx_fee(&self, asset_id: &str, amount_sat: u64) -> PayjoinResult<f64>;
19
20    /// Build a payjoin transaction to send funds to a recipient using the asset to pay fees.
21    /// Returns the transaction and the service fee paid in satoshi units.
22    async fn build_payjoin_tx(
23        &self,
24        recipient_address: &str,
25        asset_id: &str,
26        amount_sat: u64,
27    ) -> PayjoinResult<(Transaction, u64)>;
28}