Skip to main content

cdk_bdk/storage/
types.rs

1use uuid::Uuid;
2
3/// Tombstone record for a failed pre-sign send attempt.
4#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
5pub struct FailedSendAttemptRecord {
6    /// Unique attempt identifier
7    pub attempt_id: Uuid,
8    /// Intent identifier used by this attempt
9    pub intent_id: Uuid,
10    /// Quote ID linking to the melt quote
11    pub quote_id: String,
12    /// Human-readable failure reason
13    pub reason: String,
14    /// When the attempt failed (unix timestamp seconds)
15    pub failed_at: u64,
16}
17
18/// Tombstone record for a finalized (confirmed) send intent.
19///
20/// Written when a confirmed intent is deleted, preserving the data needed
21/// by `check_outgoing_payment` to return accurate `total_spent`.
22#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
23pub struct FinalizedSendIntentRecord {
24    /// Unique intent identifier
25    pub intent_id: Uuid,
26    /// Quote ID linking to the melt quote
27    pub quote_id: String,
28    /// Total amount spent (payment + fee) in satoshis
29    pub total_spent_sat: u64,
30    /// Output point string (txid:vout)
31    pub outpoint: String,
32    /// When finalization occurred (unix timestamp seconds)
33    pub finalized_at: u64,
34}
35
36/// Tombstone record for a finalized (confirmed) receive intent.
37///
38/// Written when a confirmed receive intent is deleted, preserving the
39/// data needed by `check_incoming_payment_status` to return historical
40/// payment information.
41#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
42pub struct FinalizedReceiveIntentRecord {
43    /// Unique intent identifier
44    pub intent_id: Uuid,
45    /// Quote ID linking to the mint quote
46    pub quote_id: String,
47    /// Bitcoin address that received the payment
48    pub address: String,
49    /// Transaction ID of the payment
50    pub txid: String,
51    /// Output point string (txid:vout)
52    pub outpoint: String,
53    /// Payment amount in satoshis
54    pub amount_sat: u64,
55    /// When finalization occurred (unix timestamp seconds)
56    pub finalized_at: u64,
57}