@dashevo/dapi-grpc 2.1.0-dev.8 → 2.1.0-pr.2716.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +1 -1
- package/clients/drive/v0/nodejs/drive_pbjs.js +3454 -0
- package/clients/platform/v0/nodejs/platform_pbjs.js +3454 -0
- package/clients/platform/v0/nodejs/platform_protoc.js +4491 -1179
- package/clients/platform/v0/web/platform_pb.d.ts +442 -0
- package/clients/platform/v0/web/platform_pb.js +4491 -1179
- package/clients/platform/v0/web/platform_pb_service.d.ts +11 -0
- package/clients/platform/v0/web/platform_pb_service.js +54 -0
- package/package.json +2 -2
- package/protos/platform/v0/platform.proto +89 -0
- package/src/drive/client/org.dash.platform.dapi.v0.rs +250 -0
- package/src/drive/wasm/org.dash.platform.dapi.v0.rs +250 -0
- package/src/platform/client/org.dash.platform.dapi.v0.rs +250 -0
- package/src/platform/wasm/org.dash.platform.dapi.v0.rs +250 -0
|
@@ -1,4 +1,222 @@
|
|
|
1
1
|
// This file is @generated by prost-build.
|
|
2
|
+
/// Platform events streaming (v0)
|
|
3
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
4
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
5
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
6
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
7
|
+
pub struct PlatformEventsCommand {
|
|
8
|
+
#[prost(oneof = "platform_events_command::Version", tags = "1")]
|
|
9
|
+
pub version: ::core::option::Option<platform_events_command::Version>,
|
|
10
|
+
}
|
|
11
|
+
/// Nested message and enum types in `PlatformEventsCommand`.
|
|
12
|
+
pub mod platform_events_command {
|
|
13
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
14
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
15
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
16
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
17
|
+
pub struct PlatformEventsCommandV0 {
|
|
18
|
+
#[prost(oneof = "platform_events_command_v0::Command", tags = "1, 2")]
|
|
19
|
+
pub command: ::core::option::Option<platform_events_command_v0::Command>,
|
|
20
|
+
}
|
|
21
|
+
/// Nested message and enum types in `PlatformEventsCommandV0`.
|
|
22
|
+
pub mod platform_events_command_v0 {
|
|
23
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
24
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
25
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
|
|
26
|
+
pub enum Command {
|
|
27
|
+
#[prost(message, tag = "1")]
|
|
28
|
+
Add(super::super::AddSubscriptionV0),
|
|
29
|
+
#[prost(message, tag = "2")]
|
|
30
|
+
Remove(super::super::RemoveSubscriptionV0),
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
34
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
35
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
|
|
36
|
+
pub enum Version {
|
|
37
|
+
#[prost(message, tag = "1")]
|
|
38
|
+
V0(PlatformEventsCommandV0),
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
42
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
43
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
44
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
45
|
+
pub struct PlatformEventsResponse {
|
|
46
|
+
#[prost(oneof = "platform_events_response::Version", tags = "1")]
|
|
47
|
+
pub version: ::core::option::Option<platform_events_response::Version>,
|
|
48
|
+
}
|
|
49
|
+
/// Nested message and enum types in `PlatformEventsResponse`.
|
|
50
|
+
pub mod platform_events_response {
|
|
51
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
52
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
53
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
54
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
55
|
+
pub struct PlatformEventsResponseV0 {
|
|
56
|
+
#[prost(oneof = "platform_events_response_v0::Response", tags = "1, 2, 3")]
|
|
57
|
+
pub response: ::core::option::Option<platform_events_response_v0::Response>,
|
|
58
|
+
}
|
|
59
|
+
/// Nested message and enum types in `PlatformEventsResponseV0`.
|
|
60
|
+
pub mod platform_events_response_v0 {
|
|
61
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
62
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
63
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
|
|
64
|
+
pub enum Response {
|
|
65
|
+
#[prost(message, tag = "1")]
|
|
66
|
+
Event(super::super::PlatformEventMessageV0),
|
|
67
|
+
#[prost(message, tag = "2")]
|
|
68
|
+
Ack(super::super::AckV0),
|
|
69
|
+
#[prost(message, tag = "3")]
|
|
70
|
+
Error(super::super::PlatformErrorV0),
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
74
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
75
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
|
|
76
|
+
pub enum Version {
|
|
77
|
+
#[prost(message, tag = "1")]
|
|
78
|
+
V0(PlatformEventsResponseV0),
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
82
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
83
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
84
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
85
|
+
pub struct AddSubscriptionV0 {
|
|
86
|
+
#[prost(string, tag = "1")]
|
|
87
|
+
pub client_subscription_id: ::prost::alloc::string::String,
|
|
88
|
+
#[prost(message, optional, tag = "2")]
|
|
89
|
+
pub filter: ::core::option::Option<PlatformFilterV0>,
|
|
90
|
+
}
|
|
91
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
92
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
93
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
94
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
95
|
+
pub struct RemoveSubscriptionV0 {
|
|
96
|
+
#[prost(string, tag = "1")]
|
|
97
|
+
pub client_subscription_id: ::prost::alloc::string::String,
|
|
98
|
+
}
|
|
99
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
100
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
101
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
102
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
103
|
+
pub struct AckV0 {
|
|
104
|
+
#[prost(string, tag = "1")]
|
|
105
|
+
pub client_subscription_id: ::prost::alloc::string::String,
|
|
106
|
+
/// "add" | "remove"
|
|
107
|
+
#[prost(string, tag = "2")]
|
|
108
|
+
pub op: ::prost::alloc::string::String,
|
|
109
|
+
}
|
|
110
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
111
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
112
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
113
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
114
|
+
pub struct PlatformErrorV0 {
|
|
115
|
+
#[prost(string, tag = "1")]
|
|
116
|
+
pub client_subscription_id: ::prost::alloc::string::String,
|
|
117
|
+
#[prost(uint32, tag = "2")]
|
|
118
|
+
pub code: u32,
|
|
119
|
+
#[prost(string, tag = "3")]
|
|
120
|
+
pub message: ::prost::alloc::string::String,
|
|
121
|
+
}
|
|
122
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
123
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
124
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
125
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
126
|
+
pub struct PlatformEventMessageV0 {
|
|
127
|
+
#[prost(string, tag = "1")]
|
|
128
|
+
pub client_subscription_id: ::prost::alloc::string::String,
|
|
129
|
+
#[prost(message, optional, tag = "2")]
|
|
130
|
+
pub event: ::core::option::Option<PlatformEventV0>,
|
|
131
|
+
}
|
|
132
|
+
/// Initial placeholder filter and event to be refined during integration
|
|
133
|
+
/// Filter for StateTransitionResult events
|
|
134
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
135
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
136
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
137
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
138
|
+
pub struct StateTransitionResultFilter {
|
|
139
|
+
/// When set, only match StateTransitionResult events for this tx hash.
|
|
140
|
+
#[prost(bytes = "vec", optional, tag = "1")]
|
|
141
|
+
pub tx_hash: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
|
|
142
|
+
}
|
|
143
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
144
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
145
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
146
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
147
|
+
pub struct PlatformFilterV0 {
|
|
148
|
+
#[prost(oneof = "platform_filter_v0::Kind", tags = "1, 2, 3")]
|
|
149
|
+
pub kind: ::core::option::Option<platform_filter_v0::Kind>,
|
|
150
|
+
}
|
|
151
|
+
/// Nested message and enum types in `PlatformFilterV0`.
|
|
152
|
+
pub mod platform_filter_v0 {
|
|
153
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
154
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
155
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
|
|
156
|
+
pub enum Kind {
|
|
157
|
+
/// subscribe to all platform events
|
|
158
|
+
#[prost(bool, tag = "1")]
|
|
159
|
+
All(bool),
|
|
160
|
+
/// subscribe to BlockCommitted events only
|
|
161
|
+
#[prost(bool, tag = "2")]
|
|
162
|
+
BlockCommitted(bool),
|
|
163
|
+
/// subscribe to StateTransitionResult events (optionally filtered by tx_hash)
|
|
164
|
+
#[prost(message, tag = "3")]
|
|
165
|
+
StateTransitionResult(super::StateTransitionResultFilter),
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
169
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
170
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
171
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
172
|
+
pub struct PlatformEventV0 {
|
|
173
|
+
#[prost(oneof = "platform_event_v0::Event", tags = "1, 2")]
|
|
174
|
+
pub event: ::core::option::Option<platform_event_v0::Event>,
|
|
175
|
+
}
|
|
176
|
+
/// Nested message and enum types in `PlatformEventV0`.
|
|
177
|
+
pub mod platform_event_v0 {
|
|
178
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
179
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
180
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
181
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
182
|
+
pub struct BlockMetadata {
|
|
183
|
+
#[prost(uint64, tag = "1")]
|
|
184
|
+
pub height: u64,
|
|
185
|
+
#[prost(uint64, tag = "2")]
|
|
186
|
+
pub time_ms: u64,
|
|
187
|
+
#[prost(bytes = "vec", tag = "3")]
|
|
188
|
+
pub block_id_hash: ::prost::alloc::vec::Vec<u8>,
|
|
189
|
+
}
|
|
190
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
191
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
192
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
193
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
194
|
+
pub struct BlockCommitted {
|
|
195
|
+
#[prost(message, optional, tag = "1")]
|
|
196
|
+
pub meta: ::core::option::Option<BlockMetadata>,
|
|
197
|
+
#[prost(uint32, tag = "2")]
|
|
198
|
+
pub tx_count: u32,
|
|
199
|
+
}
|
|
200
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
201
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
202
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
203
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
204
|
+
pub struct StateTransitionFinalized {
|
|
205
|
+
#[prost(message, optional, tag = "1")]
|
|
206
|
+
pub meta: ::core::option::Option<BlockMetadata>,
|
|
207
|
+
#[prost(bytes = "vec", tag = "2")]
|
|
208
|
+
pub tx_hash: ::prost::alloc::vec::Vec<u8>,
|
|
209
|
+
}
|
|
210
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
211
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
212
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
|
|
213
|
+
pub enum Event {
|
|
214
|
+
#[prost(message, tag = "1")]
|
|
215
|
+
BlockCommitted(BlockCommitted),
|
|
216
|
+
#[prost(message, tag = "2")]
|
|
217
|
+
StateTransitionFinalized(StateTransitionFinalized),
|
|
218
|
+
}
|
|
219
|
+
}
|
|
2
220
|
/// Proof message includes cryptographic proofs for validating responses
|
|
3
221
|
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
4
222
|
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
@@ -7013,5 +7231,37 @@ pub mod platform_client {
|
|
|
7013
7231
|
);
|
|
7014
7232
|
self.inner.unary(req, path, codec).await
|
|
7015
7233
|
}
|
|
7234
|
+
/// Bi-directional stream for multiplexed platform events subscriptions
|
|
7235
|
+
pub async fn subscribe_platform_events(
|
|
7236
|
+
&mut self,
|
|
7237
|
+
request: impl tonic::IntoStreamingRequest<
|
|
7238
|
+
Message = super::PlatformEventsCommand,
|
|
7239
|
+
>,
|
|
7240
|
+
) -> std::result::Result<
|
|
7241
|
+
tonic::Response<tonic::codec::Streaming<super::PlatformEventsResponse>>,
|
|
7242
|
+
tonic::Status,
|
|
7243
|
+
> {
|
|
7244
|
+
self.inner
|
|
7245
|
+
.ready()
|
|
7246
|
+
.await
|
|
7247
|
+
.map_err(|e| {
|
|
7248
|
+
tonic::Status::unknown(
|
|
7249
|
+
format!("Service was not ready: {}", e.into()),
|
|
7250
|
+
)
|
|
7251
|
+
})?;
|
|
7252
|
+
let codec = tonic_prost::ProstCodec::default();
|
|
7253
|
+
let path = http::uri::PathAndQuery::from_static(
|
|
7254
|
+
"/org.dash.platform.dapi.v0.Platform/SubscribePlatformEvents",
|
|
7255
|
+
);
|
|
7256
|
+
let mut req = request.into_streaming_request();
|
|
7257
|
+
req.extensions_mut()
|
|
7258
|
+
.insert(
|
|
7259
|
+
GrpcMethod::new(
|
|
7260
|
+
"org.dash.platform.dapi.v0.Platform",
|
|
7261
|
+
"SubscribePlatformEvents",
|
|
7262
|
+
),
|
|
7263
|
+
);
|
|
7264
|
+
self.inner.streaming(req, path, codec).await
|
|
7265
|
+
}
|
|
7016
7266
|
}
|
|
7017
7267
|
}
|
|
@@ -1,4 +1,222 @@
|
|
|
1
1
|
// This file is @generated by prost-build.
|
|
2
|
+
/// Platform events streaming (v0)
|
|
3
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
4
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
5
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
6
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
7
|
+
pub struct PlatformEventsCommand {
|
|
8
|
+
#[prost(oneof = "platform_events_command::Version", tags = "1")]
|
|
9
|
+
pub version: ::core::option::Option<platform_events_command::Version>,
|
|
10
|
+
}
|
|
11
|
+
/// Nested message and enum types in `PlatformEventsCommand`.
|
|
12
|
+
pub mod platform_events_command {
|
|
13
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
14
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
15
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
16
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
17
|
+
pub struct PlatformEventsCommandV0 {
|
|
18
|
+
#[prost(oneof = "platform_events_command_v0::Command", tags = "1, 2")]
|
|
19
|
+
pub command: ::core::option::Option<platform_events_command_v0::Command>,
|
|
20
|
+
}
|
|
21
|
+
/// Nested message and enum types in `PlatformEventsCommandV0`.
|
|
22
|
+
pub mod platform_events_command_v0 {
|
|
23
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
24
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
25
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
|
|
26
|
+
pub enum Command {
|
|
27
|
+
#[prost(message, tag = "1")]
|
|
28
|
+
Add(super::super::AddSubscriptionV0),
|
|
29
|
+
#[prost(message, tag = "2")]
|
|
30
|
+
Remove(super::super::RemoveSubscriptionV0),
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
34
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
35
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
|
|
36
|
+
pub enum Version {
|
|
37
|
+
#[prost(message, tag = "1")]
|
|
38
|
+
V0(PlatformEventsCommandV0),
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
42
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
43
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
44
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
45
|
+
pub struct PlatformEventsResponse {
|
|
46
|
+
#[prost(oneof = "platform_events_response::Version", tags = "1")]
|
|
47
|
+
pub version: ::core::option::Option<platform_events_response::Version>,
|
|
48
|
+
}
|
|
49
|
+
/// Nested message and enum types in `PlatformEventsResponse`.
|
|
50
|
+
pub mod platform_events_response {
|
|
51
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
52
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
53
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
54
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
55
|
+
pub struct PlatformEventsResponseV0 {
|
|
56
|
+
#[prost(oneof = "platform_events_response_v0::Response", tags = "1, 2, 3")]
|
|
57
|
+
pub response: ::core::option::Option<platform_events_response_v0::Response>,
|
|
58
|
+
}
|
|
59
|
+
/// Nested message and enum types in `PlatformEventsResponseV0`.
|
|
60
|
+
pub mod platform_events_response_v0 {
|
|
61
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
62
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
63
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
|
|
64
|
+
pub enum Response {
|
|
65
|
+
#[prost(message, tag = "1")]
|
|
66
|
+
Event(super::super::PlatformEventMessageV0),
|
|
67
|
+
#[prost(message, tag = "2")]
|
|
68
|
+
Ack(super::super::AckV0),
|
|
69
|
+
#[prost(message, tag = "3")]
|
|
70
|
+
Error(super::super::PlatformErrorV0),
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
74
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
75
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
|
|
76
|
+
pub enum Version {
|
|
77
|
+
#[prost(message, tag = "1")]
|
|
78
|
+
V0(PlatformEventsResponseV0),
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
82
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
83
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
84
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
85
|
+
pub struct AddSubscriptionV0 {
|
|
86
|
+
#[prost(string, tag = "1")]
|
|
87
|
+
pub client_subscription_id: ::prost::alloc::string::String,
|
|
88
|
+
#[prost(message, optional, tag = "2")]
|
|
89
|
+
pub filter: ::core::option::Option<PlatformFilterV0>,
|
|
90
|
+
}
|
|
91
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
92
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
93
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
94
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
95
|
+
pub struct RemoveSubscriptionV0 {
|
|
96
|
+
#[prost(string, tag = "1")]
|
|
97
|
+
pub client_subscription_id: ::prost::alloc::string::String,
|
|
98
|
+
}
|
|
99
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
100
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
101
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
102
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
103
|
+
pub struct AckV0 {
|
|
104
|
+
#[prost(string, tag = "1")]
|
|
105
|
+
pub client_subscription_id: ::prost::alloc::string::String,
|
|
106
|
+
/// "add" | "remove"
|
|
107
|
+
#[prost(string, tag = "2")]
|
|
108
|
+
pub op: ::prost::alloc::string::String,
|
|
109
|
+
}
|
|
110
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
111
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
112
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
113
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
114
|
+
pub struct PlatformErrorV0 {
|
|
115
|
+
#[prost(string, tag = "1")]
|
|
116
|
+
pub client_subscription_id: ::prost::alloc::string::String,
|
|
117
|
+
#[prost(uint32, tag = "2")]
|
|
118
|
+
pub code: u32,
|
|
119
|
+
#[prost(string, tag = "3")]
|
|
120
|
+
pub message: ::prost::alloc::string::String,
|
|
121
|
+
}
|
|
122
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
123
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
124
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
125
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
126
|
+
pub struct PlatformEventMessageV0 {
|
|
127
|
+
#[prost(string, tag = "1")]
|
|
128
|
+
pub client_subscription_id: ::prost::alloc::string::String,
|
|
129
|
+
#[prost(message, optional, tag = "2")]
|
|
130
|
+
pub event: ::core::option::Option<PlatformEventV0>,
|
|
131
|
+
}
|
|
132
|
+
/// Initial placeholder filter and event to be refined during integration
|
|
133
|
+
/// Filter for StateTransitionResult events
|
|
134
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
135
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
136
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
137
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
138
|
+
pub struct StateTransitionResultFilter {
|
|
139
|
+
/// When set, only match StateTransitionResult events for this tx hash.
|
|
140
|
+
#[prost(bytes = "vec", optional, tag = "1")]
|
|
141
|
+
pub tx_hash: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
|
|
142
|
+
}
|
|
143
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
144
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
145
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
146
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
147
|
+
pub struct PlatformFilterV0 {
|
|
148
|
+
#[prost(oneof = "platform_filter_v0::Kind", tags = "1, 2, 3")]
|
|
149
|
+
pub kind: ::core::option::Option<platform_filter_v0::Kind>,
|
|
150
|
+
}
|
|
151
|
+
/// Nested message and enum types in `PlatformFilterV0`.
|
|
152
|
+
pub mod platform_filter_v0 {
|
|
153
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
154
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
155
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
|
|
156
|
+
pub enum Kind {
|
|
157
|
+
/// subscribe to all platform events
|
|
158
|
+
#[prost(bool, tag = "1")]
|
|
159
|
+
All(bool),
|
|
160
|
+
/// subscribe to BlockCommitted events only
|
|
161
|
+
#[prost(bool, tag = "2")]
|
|
162
|
+
BlockCommitted(bool),
|
|
163
|
+
/// subscribe to StateTransitionResult events (optionally filtered by tx_hash)
|
|
164
|
+
#[prost(message, tag = "3")]
|
|
165
|
+
StateTransitionResult(super::StateTransitionResultFilter),
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
169
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
170
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
171
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
172
|
+
pub struct PlatformEventV0 {
|
|
173
|
+
#[prost(oneof = "platform_event_v0::Event", tags = "1, 2")]
|
|
174
|
+
pub event: ::core::option::Option<platform_event_v0::Event>,
|
|
175
|
+
}
|
|
176
|
+
/// Nested message and enum types in `PlatformEventV0`.
|
|
177
|
+
pub mod platform_event_v0 {
|
|
178
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
179
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
180
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
181
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
182
|
+
pub struct BlockMetadata {
|
|
183
|
+
#[prost(uint64, tag = "1")]
|
|
184
|
+
pub height: u64,
|
|
185
|
+
#[prost(uint64, tag = "2")]
|
|
186
|
+
pub time_ms: u64,
|
|
187
|
+
#[prost(bytes = "vec", tag = "3")]
|
|
188
|
+
pub block_id_hash: ::prost::alloc::vec::Vec<u8>,
|
|
189
|
+
}
|
|
190
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
191
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
192
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
193
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
194
|
+
pub struct BlockCommitted {
|
|
195
|
+
#[prost(message, optional, tag = "1")]
|
|
196
|
+
pub meta: ::core::option::Option<BlockMetadata>,
|
|
197
|
+
#[prost(uint32, tag = "2")]
|
|
198
|
+
pub tx_count: u32,
|
|
199
|
+
}
|
|
200
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
201
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
202
|
+
#[derive(::dapi_grpc_macros::Mockable)]
|
|
203
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
204
|
+
pub struct StateTransitionFinalized {
|
|
205
|
+
#[prost(message, optional, tag = "1")]
|
|
206
|
+
pub meta: ::core::option::Option<BlockMetadata>,
|
|
207
|
+
#[prost(bytes = "vec", tag = "2")]
|
|
208
|
+
pub tx_hash: ::prost::alloc::vec::Vec<u8>,
|
|
209
|
+
}
|
|
210
|
+
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
211
|
+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
212
|
+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
|
|
213
|
+
pub enum Event {
|
|
214
|
+
#[prost(message, tag = "1")]
|
|
215
|
+
BlockCommitted(BlockCommitted),
|
|
216
|
+
#[prost(message, tag = "2")]
|
|
217
|
+
StateTransitionFinalized(StateTransitionFinalized),
|
|
218
|
+
}
|
|
219
|
+
}
|
|
2
220
|
/// Proof message includes cryptographic proofs for validating responses
|
|
3
221
|
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
|
4
222
|
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
|
@@ -7360,5 +7578,37 @@ pub mod platform_client {
|
|
|
7360
7578
|
);
|
|
7361
7579
|
self.inner.unary(req, path, codec).await
|
|
7362
7580
|
}
|
|
7581
|
+
/// Bi-directional stream for multiplexed platform events subscriptions
|
|
7582
|
+
pub async fn subscribe_platform_events(
|
|
7583
|
+
&mut self,
|
|
7584
|
+
request: impl tonic::IntoStreamingRequest<
|
|
7585
|
+
Message = super::PlatformEventsCommand,
|
|
7586
|
+
>,
|
|
7587
|
+
) -> std::result::Result<
|
|
7588
|
+
tonic::Response<tonic::codec::Streaming<super::PlatformEventsResponse>>,
|
|
7589
|
+
tonic::Status,
|
|
7590
|
+
> {
|
|
7591
|
+
self.inner
|
|
7592
|
+
.ready()
|
|
7593
|
+
.await
|
|
7594
|
+
.map_err(|e| {
|
|
7595
|
+
tonic::Status::unknown(
|
|
7596
|
+
format!("Service was not ready: {}", e.into()),
|
|
7597
|
+
)
|
|
7598
|
+
})?;
|
|
7599
|
+
let codec = tonic_prost::ProstCodec::default();
|
|
7600
|
+
let path = http::uri::PathAndQuery::from_static(
|
|
7601
|
+
"/org.dash.platform.dapi.v0.Platform/SubscribePlatformEvents",
|
|
7602
|
+
);
|
|
7603
|
+
let mut req = request.into_streaming_request();
|
|
7604
|
+
req.extensions_mut()
|
|
7605
|
+
.insert(
|
|
7606
|
+
GrpcMethod::new(
|
|
7607
|
+
"org.dash.platform.dapi.v0.Platform",
|
|
7608
|
+
"SubscribePlatformEvents",
|
|
7609
|
+
),
|
|
7610
|
+
);
|
|
7611
|
+
self.inner.streaming(req, path, codec).await
|
|
7612
|
+
}
|
|
7363
7613
|
}
|
|
7364
7614
|
}
|