spark_sdk/wallet/internal_handlers/traits/
swap.rs1use super::transfer::LeafKeyTweak;
2use super::transfer::LeafRefundSigningData;
3use crate::error::SparkSdkError;
4use crate::signer::traits::SparkSigner;
5use spark_protos::spark::LeafRefundTxSigningResult;
6use spark_protos::spark::Transfer;
7use std::collections::HashMap;
8use tonic::async_trait;
9
10pub(crate) struct SendSwapSignRefundsResponse {
11 pub(crate) transfer: Transfer,
12 pub(crate) refund_signature_map: HashMap<String, Vec<u8>>,
13 pub(crate) leaf_refund_signing_data: HashMap<String, LeafRefundSigningData>,
14 pub(crate) leaf_refund_tx_signing_result: Vec<LeafRefundTxSigningResult>,
15}
16
17#[async_trait]
18pub(crate) trait SwapInternalHandlers<S: SparkSigner + Send + Sync> {
19 async fn send_swap_sign_refunds(
20 &self,
21 leaves: &Vec<LeafKeyTweak>,
22 receiver_identity_pubkey: Vec<u8>,
23 expiry_time: u64,
24 adaptor_public_key: &Vec<u8>,
25 ) -> Result<SendSwapSignRefundsResponse, SparkSdkError>;
26}