spark_sdk/wallet/internal_handlers/traits/lightning.rs
1use crate::error::SparkSdkError;
2use crate::signer::traits::SparkSigner;
3use crate::wallet::internal_handlers::traits::transfer::LeafKeyTweak;
4use spark_protos::spark::InitiatePreimageSwapResponse;
5use tonic::async_trait;
6
7#[async_trait]
8pub(crate) trait LightningInternalHandlers<S: SparkSigner + Send + Sync> {
9 async fn swap_nodes_for_preimage(
10 &self,
11 leaves: Vec<LeafKeyTweak>,
12 receiver_identity_pubkey_bytes: Vec<u8>,
13 payment_hash: Vec<u8>,
14 invoice_string: Option<String>,
15 fee_sats: u64,
16 is_inbound_payment: bool,
17 ) -> Result<InitiatePreimageSwapResponse, SparkSdkError>;
18}