fedimint_wallet_client/
events.rs

1use bitcoin::Txid;
2use fedimint_core::Amount;
3use fedimint_core::core::ModuleKind;
4use fedimint_eventlog::{Event, EventKind};
5use serde::{Deserialize, Serialize};
6
7/// Event that is emitted when the client pegs-out ecash onchain
8#[derive(Serialize, Deserialize)]
9pub struct WithdrawRequest {
10    /// The bitcoin transaction ID
11    pub txid: Txid,
12}
13
14impl Event for WithdrawRequest {
15    const MODULE: Option<ModuleKind> = Some(fedimint_wallet_common::KIND);
16
17    const KIND: EventKind = EventKind::from_static("withdraw-request");
18}
19
20/// Event that is emitted when the client confirms an onchain deposit.
21#[derive(Serialize, Deserialize)]
22pub struct DepositConfirmed {
23    /// The bitcoin transaction ID
24    pub txid: Txid,
25
26    /// The out index of the deposit transaction
27    pub out_idx: u32,
28
29    /// The amount being deposited
30    pub amount: Amount,
31}
32
33impl Event for DepositConfirmed {
34    const MODULE: Option<ModuleKind> = Some(fedimint_wallet_common::KIND);
35
36    const KIND: EventKind = EventKind::from_static("deposit-confirmed");
37}