nautilus_common/messages/defi/
unsubscribe.rs1use indexmap::IndexMap;
17use nautilus_core::{UUID4, UnixNanos};
18use nautilus_model::{
19 defi::chain::Blockchain,
20 identifiers::{ClientId, InstrumentId},
21};
22
23#[derive(Debug, Clone)]
24pub struct UnsubscribeBlocks {
25 pub chain: Blockchain,
26 pub client_id: Option<ClientId>,
27 pub command_id: UUID4,
28 pub ts_init: UnixNanos,
29 pub params: Option<IndexMap<String, String>>,
30}
31
32impl UnsubscribeBlocks {
33 #[must_use]
35 pub const fn new(
36 chain: Blockchain,
37 client_id: Option<ClientId>,
38 command_id: UUID4,
39 ts_init: UnixNanos,
40 params: Option<IndexMap<String, String>>,
41 ) -> Self {
42 Self {
43 chain,
44 client_id,
45 command_id,
46 ts_init,
47 params,
48 }
49 }
50}
51
52#[derive(Debug, Clone)]
54pub struct UnsubscribePool {
55 pub instrument_id: InstrumentId,
56 pub client_id: Option<ClientId>,
57 pub command_id: UUID4,
58 pub ts_init: UnixNanos,
59 pub params: Option<IndexMap<String, String>>,
60}
61
62impl UnsubscribePool {
63 #[must_use]
65 pub const fn new(
66 instrument_id: InstrumentId,
67 client_id: Option<ClientId>,
68 command_id: UUID4,
69 ts_init: UnixNanos,
70 params: Option<IndexMap<String, String>>,
71 ) -> Self {
72 Self {
73 instrument_id,
74 client_id,
75 command_id,
76 ts_init,
77 params,
78 }
79 }
80}
81
82#[derive(Debug, Clone)]
83pub struct UnsubscribePoolSwaps {
84 pub instrument_id: InstrumentId,
85 pub client_id: Option<ClientId>,
86 pub command_id: UUID4,
87 pub ts_init: UnixNanos,
88 pub params: Option<IndexMap<String, String>>,
89}
90
91impl UnsubscribePoolSwaps {
92 #[must_use]
94 pub const fn new(
95 instrument_id: InstrumentId,
96 client_id: Option<ClientId>,
97 command_id: UUID4,
98 ts_init: UnixNanos,
99 params: Option<IndexMap<String, String>>,
100 ) -> Self {
101 Self {
102 instrument_id,
103 client_id,
104 command_id,
105 ts_init,
106 params,
107 }
108 }
109}
110
111#[derive(Debug, Clone)]
113pub struct UnsubscribePoolLiquidityUpdates {
114 pub instrument_id: InstrumentId,
115 pub client_id: Option<ClientId>,
116 pub command_id: UUID4,
117 pub ts_init: UnixNanos,
118 pub params: Option<IndexMap<String, String>>,
119}
120
121impl UnsubscribePoolLiquidityUpdates {
122 #[must_use]
124 pub const fn new(
125 instrument_id: InstrumentId,
126 client_id: Option<ClientId>,
127 command_id: UUID4,
128 ts_init: UnixNanos,
129 params: Option<IndexMap<String, String>>,
130 ) -> Self {
131 Self {
132 instrument_id,
133 client_id,
134 command_id,
135 ts_init,
136 params,
137 }
138 }
139}