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