bark_json/
notifications.rs1
2use crate::movements::Movement;
3
4
5
6
7#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
9#[serde(tag = "type", rename_all = "kebab-case")]
10#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
11pub enum WalletNotification {
12 MovementCreated {
14 movement: Movement,
15 },
16 MovementUpdated {
18 movement: Movement,
19 },
20 ChannelLagging,
22}
23
24impl From<bark::WalletNotification> for WalletNotification {
25 fn from(v: bark::WalletNotification) -> Self {
26 match v {
27 bark::WalletNotification::MovementCreated { movement } => {
28 WalletNotification::MovementCreated { movement: movement.into() }
29 },
30 bark::WalletNotification::MovementUpdated { movement } => {
31 WalletNotification::MovementUpdated { movement: movement.into() }
32 },
33 bark::WalletNotification::ChannelLagging => WalletNotification::ChannelLagging,
34 }
35 }
36}