spark_sdk/wallet/internal_handlers/traits/
timelock.rs

1use bitcoin::{secp256k1::PublicKey, Transaction};
2use frost_secp256k1_tr::round1::SigningCommitments;
3use spark_protos::spark::{SigningJob, TreeNode};
4use tonic::async_trait;
5
6use crate::error::SparkSdkError;
7
8#[async_trait]
9pub(crate) trait TimelockInternalHandlers {
10    async fn refresh_timelock_refund_tx(
11        &self,
12        leaf: &TreeNode,
13        signing_public_key: &PublicKey,
14    ) -> Result<(), SparkSdkError>;
15
16    async fn refresh_timelock_nodes(
17        &self,
18        nodes: &Vec<TreeNode>,
19        parent_nodes: &Vec<TreeNode>,
20        signing_public_key: &PublicKey,
21    ) -> Result<(), SparkSdkError>;
22
23    fn signing_job_from_tx(
24        &self,
25        new_tx: &Transaction,
26        signing_public_key: &PublicKey,
27    ) -> Result<(SigningJob, SigningCommitments), SparkSdkError>;
28}