fedimint_mintv2_client/
event.rs1use fedimint_core::Amount;
2use fedimint_core::core::{ModuleKind, OperationId};
3use fedimint_eventlog::{Event, EventKind, EventPersistence};
4use fedimint_mintv2_common::KIND;
5use serde::{Deserialize, Serialize};
6
7#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
10pub struct SendPaymentEvent {
11 pub operation_id: OperationId,
12 pub amount: Amount,
13 pub ecash: String,
14}
15
16impl Event for SendPaymentEvent {
17 const MODULE: Option<ModuleKind> = Some(KIND);
18 const KIND: EventKind = EventKind::from_static("payment-send");
19 const PERSISTENCE: EventPersistence = EventPersistence::Persistent;
20}
21
22#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
24pub struct ReceivePaymentEvent {
25 pub operation_id: OperationId,
26 pub amount: Amount,
27}
28
29impl Event for ReceivePaymentEvent {
30 const MODULE: Option<ModuleKind> = Some(KIND);
31 const KIND: EventKind = EventKind::from_static("payment-receive");
32 const PERSISTENCE: EventPersistence = EventPersistence::Persistent;
33}
34
35#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)]
37pub enum ReceivePaymentStatus {
38 Success,
40 Rejected,
42}
43
44#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
46pub struct ReceivePaymentUpdateEvent {
47 pub operation_id: OperationId,
48 pub status: ReceivePaymentStatus,
49}
50
51impl Event for ReceivePaymentUpdateEvent {
52 const MODULE: Option<ModuleKind> = Some(KIND);
53 const KIND: EventKind = EventKind::from_static("payment-receive-update");
54 const PERSISTENCE: EventPersistence = EventPersistence::Persistent;
55}