1#[derive(serde::Serialize, serde::Deserialize)]
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct InfoRequest {}
6#[derive(serde::Serialize, serde::Deserialize)]
7#[allow(clippy::derive_partial_eq_without_eq)]
8#[derive(Clone, PartialEq, ::prost::Message)]
9pub struct InfoResponse {
10 #[prost(string, tag = "1")]
11 pub pubkey: ::prost::alloc::string::String,
12 #[prost(string, tag = "2")]
13 pub transport: ::prost::alloc::string::String,
14 #[prost(string, tag = "3")]
15 pub oracle: ::prost::alloc::string::String,
16}
17#[derive(serde::Serialize, serde::Deserialize)]
18#[allow(clippy::derive_partial_eq_without_eq)]
19#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct SendOfferRequest {
21 #[prost(bytes = "vec", tag = "1")]
22 pub contract_input: ::prost::alloc::vec::Vec<u8>,
23 #[prost(string, tag = "2")]
24 pub counter_party: ::prost::alloc::string::String,
25}
26#[derive(serde::Serialize, serde::Deserialize)]
27#[allow(clippy::derive_partial_eq_without_eq)]
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct SendOfferResponse {
30 #[prost(bytes = "vec", tag = "1")]
31 pub offer_dlc: ::prost::alloc::vec::Vec<u8>,
32}
33#[derive(serde::Serialize, serde::Deserialize)]
34#[allow(clippy::derive_partial_eq_without_eq)]
35#[derive(Clone, PartialEq, ::prost::Message)]
36pub struct ListOffersRequest {}
37#[derive(serde::Serialize, serde::Deserialize)]
38#[allow(clippy::derive_partial_eq_without_eq)]
39#[derive(Clone, PartialEq, ::prost::Message)]
40pub struct ListOffersResponse {
41 #[prost(bytes = "vec", repeated, tag = "1")]
42 pub offers: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
43}
44#[derive(serde::Serialize, serde::Deserialize)]
45#[allow(clippy::derive_partial_eq_without_eq)]
46#[derive(Clone, PartialEq, ::prost::Message)]
47pub struct AcceptOfferRequest {
48 #[prost(string, tag = "1")]
49 pub contract_id: ::prost::alloc::string::String,
50}
51#[derive(serde::Serialize, serde::Deserialize)]
52#[allow(clippy::derive_partial_eq_without_eq)]
53#[derive(Clone, PartialEq, ::prost::Message)]
54pub struct AcceptOfferResponse {
55 #[prost(string, tag = "1")]
56 pub contract_id: ::prost::alloc::string::String,
57 #[prost(string, tag = "2")]
58 pub counter_party: ::prost::alloc::string::String,
59 #[prost(bytes = "vec", tag = "3")]
60 pub accept_dlc: ::prost::alloc::vec::Vec<u8>,
61}
62#[derive(serde::Serialize, serde::Deserialize)]
63#[allow(clippy::derive_partial_eq_without_eq)]
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct NewAddressRequest {}
66#[derive(serde::Serialize, serde::Deserialize)]
67#[allow(clippy::derive_partial_eq_without_eq)]
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct NewAddressResponse {
70 #[prost(string, tag = "1")]
71 pub address: ::prost::alloc::string::String,
72}
73#[derive(serde::Serialize, serde::Deserialize)]
74#[allow(clippy::derive_partial_eq_without_eq)]
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct WalletBalanceRequest {}
77#[derive(serde::Serialize, serde::Deserialize)]
78#[allow(clippy::derive_partial_eq_without_eq)]
79#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct WalletBalanceResponse {
81 #[prost(uint64, tag = "1")]
82 pub confirmed: u64,
83 #[prost(uint64, tag = "2")]
84 pub foreign_unconfirmed: u64,
85 #[prost(uint64, tag = "3")]
86 pub change_unconfirmed: u64,
87 #[prost(int64, tag = "4")]
88 pub contract_balance: i64,
89}
90#[derive(serde::Serialize, serde::Deserialize)]
91#[allow(clippy::derive_partial_eq_without_eq)]
92#[derive(Clone, PartialEq, ::prost::Message)]
93pub struct GetWalletTransactionsRequest {}
94#[derive(serde::Serialize, serde::Deserialize)]
95#[allow(clippy::derive_partial_eq_without_eq)]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct GetWalletTransactionsResponse {
98 #[prost(bytes = "vec", repeated, tag = "1")]
99 pub transactions: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
100}
101#[derive(serde::Serialize, serde::Deserialize)]
102#[allow(clippy::derive_partial_eq_without_eq)]
103#[derive(Clone, PartialEq, ::prost::Message)]
104pub struct ListUtxosRequest {}
105#[derive(serde::Serialize, serde::Deserialize)]
106#[allow(clippy::derive_partial_eq_without_eq)]
107#[derive(Clone, PartialEq, ::prost::Message)]
108pub struct ListUtxosResponse {
109 #[prost(bytes = "vec", repeated, tag = "1")]
110 pub utxos: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
111}
112#[derive(serde::Serialize, serde::Deserialize)]
113#[allow(clippy::derive_partial_eq_without_eq)]
114#[derive(Clone, PartialEq, ::prost::Message)]
115pub struct ListPeersRequest {}
116#[derive(serde::Serialize, serde::Deserialize)]
117#[allow(clippy::derive_partial_eq_without_eq)]
118#[derive(Clone, PartialEq, ::prost::Message)]
119pub struct ListPeersResponse {
120 #[prost(message, repeated, tag = "1")]
121 pub peers: ::prost::alloc::vec::Vec<Peer>,
122}
123#[derive(serde::Serialize, serde::Deserialize)]
124#[allow(clippy::derive_partial_eq_without_eq)]
125#[derive(Clone, PartialEq, ::prost::Message)]
126pub struct Peer {
127 #[prost(string, tag = "1")]
128 pub pubkey: ::prost::alloc::string::String,
129 #[prost(string, tag = "2")]
130 pub host: ::prost::alloc::string::String,
131}
132#[derive(serde::Serialize, serde::Deserialize)]
133#[allow(clippy::derive_partial_eq_without_eq)]
134#[derive(Clone, PartialEq, ::prost::Message)]
135pub struct ConnectRequest {
136 #[prost(string, tag = "1")]
137 pub pubkey: ::prost::alloc::string::String,
138 #[prost(string, tag = "2")]
139 pub host: ::prost::alloc::string::String,
140}
141#[derive(serde::Serialize, serde::Deserialize)]
142#[allow(clippy::derive_partial_eq_without_eq)]
143#[derive(Clone, PartialEq, ::prost::Message)]
144pub struct ConnectResponse {}
145#[derive(serde::Serialize, serde::Deserialize)]
146#[allow(clippy::derive_partial_eq_without_eq)]
147#[derive(Clone, PartialEq, ::prost::Message)]
148pub struct ListOraclesRequest {}
149#[derive(serde::Serialize, serde::Deserialize)]
150#[allow(clippy::derive_partial_eq_without_eq)]
151#[derive(Clone, PartialEq, ::prost::Message)]
152pub struct ListOraclesResponse {
153 #[prost(string, tag = "1")]
154 pub name: ::prost::alloc::string::String,
155 #[prost(string, tag = "2")]
156 pub pubkey: ::prost::alloc::string::String,
157}
158#[derive(serde::Serialize, serde::Deserialize)]
159#[allow(clippy::derive_partial_eq_without_eq)]
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct ListContractsRequest {}
162#[derive(serde::Serialize, serde::Deserialize)]
163#[allow(clippy::derive_partial_eq_without_eq)]
164#[derive(Clone, PartialEq, ::prost::Message)]
165pub struct ListContractsResponse {
166 #[prost(bytes = "vec", repeated, tag = "1")]
167 pub contracts: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
168}
169#[derive(serde::Serialize, serde::Deserialize)]
170#[allow(clippy::derive_partial_eq_without_eq)]
171#[derive(Clone, PartialEq, ::prost::Message)]
172pub struct SendRequest {
173 #[prost(string, tag = "1")]
174 pub address: ::prost::alloc::string::String,
175 #[prost(uint64, tag = "2")]
176 pub amount: u64,
177 #[prost(uint64, tag = "3")]
178 pub fee_rate: u64,
179}
180#[derive(serde::Serialize, serde::Deserialize)]
181#[allow(clippy::derive_partial_eq_without_eq)]
182#[derive(Clone, PartialEq, ::prost::Message)]
183pub struct SendResponse {
184 #[prost(string, tag = "1")]
185 pub txid: ::prost::alloc::string::String,
186}
187#[derive(serde::Serialize, serde::Deserialize)]
188#[allow(clippy::derive_partial_eq_without_eq)]
189#[derive(Clone, PartialEq, ::prost::Message)]
190pub struct OracleAnnouncementsRequest {
191 #[prost(string, tag = "1")]
192 pub event_id: ::prost::alloc::string::String,
193}
194#[derive(serde::Serialize, serde::Deserialize)]
195#[allow(clippy::derive_partial_eq_without_eq)]
196#[derive(Clone, PartialEq, ::prost::Message)]
197pub struct OracleAnnouncementsResponse {
198 #[prost(bytes = "vec", tag = "1")]
199 pub announcement: ::prost::alloc::vec::Vec<u8>,
200}
201#[derive(serde::Serialize, serde::Deserialize)]
202#[allow(clippy::derive_partial_eq_without_eq)]
203#[derive(Clone, PartialEq, ::prost::Message)]
204pub struct WalletSyncRequest {}
205#[derive(serde::Serialize, serde::Deserialize)]
206#[allow(clippy::derive_partial_eq_without_eq)]
207#[derive(Clone, PartialEq, ::prost::Message)]
208pub struct WalletSyncResponse {}
209#[derive(serde::Serialize, serde::Deserialize)]
210#[allow(clippy::derive_partial_eq_without_eq)]
211#[derive(Clone, PartialEq, ::prost::Message)]
212pub struct SyncRequest {}
213#[derive(serde::Serialize, serde::Deserialize)]
214#[allow(clippy::derive_partial_eq_without_eq)]
215#[derive(Clone, PartialEq, ::prost::Message)]
216pub struct SyncResponse {}
217#[derive(serde::Serialize, serde::Deserialize)]
218#[allow(clippy::derive_partial_eq_without_eq)]
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct CreateEnumRequest {
221 #[prost(uint32, tag = "1")]
222 pub maturity: u32,
223 #[prost(string, repeated, tag = "2")]
224 pub outcomes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
225}
226#[derive(serde::Serialize, serde::Deserialize)]
227#[allow(clippy::derive_partial_eq_without_eq)]
228#[derive(Clone, PartialEq, ::prost::Message)]
229pub struct CreateEnumResponse {
230 #[prost(bytes = "vec", tag = "1")]
231 pub announcement: ::prost::alloc::vec::Vec<u8>,
232}
233#[derive(serde::Serialize, serde::Deserialize)]
234#[allow(clippy::derive_partial_eq_without_eq)]
235#[derive(Clone, PartialEq, ::prost::Message)]
236pub struct CreateNumericRequest {
237 #[prost(uint32, tag = "1")]
238 pub maturity: u32,
239 #[prost(uint32, tag = "2")]
240 pub nb_digits: u32,
241}
242#[derive(serde::Serialize, serde::Deserialize)]
243#[allow(clippy::derive_partial_eq_without_eq)]
244#[derive(Clone, PartialEq, ::prost::Message)]
245pub struct CreateNumericResponse {
246 #[prost(bytes = "vec", tag = "1")]
247 pub announcement: ::prost::alloc::vec::Vec<u8>,
248}
249#[derive(serde::Serialize, serde::Deserialize)]
250#[allow(clippy::derive_partial_eq_without_eq)]
251#[derive(Clone, PartialEq, ::prost::Message)]
252pub struct SignRequest {
253 #[prost(string, tag = "1")]
254 pub event_id: ::prost::alloc::string::String,
255 #[prost(oneof = "sign_request::Outcome", tags = "2, 3")]
256 pub outcome: ::core::option::Option<sign_request::Outcome>,
257}
258pub mod sign_request {
260 #[derive(serde::Serialize, serde::Deserialize)]
261 #[allow(clippy::derive_partial_eq_without_eq)]
262 #[derive(Clone, PartialEq, ::prost::Oneof)]
263 pub enum Outcome {
264 #[prost(string, tag = "2")]
265 EnumOutcome(::prost::alloc::string::String),
266 #[prost(int64, tag = "3")]
267 NumericOutcome(i64),
268 }
269}
270#[derive(serde::Serialize, serde::Deserialize)]
271#[allow(clippy::derive_partial_eq_without_eq)]
272#[derive(Clone, PartialEq, ::prost::Message)]
273pub struct SignResponse {
274 #[prost(bytes = "vec", tag = "1")]
275 pub signature: ::prost::alloc::vec::Vec<u8>,
276}
277pub mod ddk_rpc_client {
279 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
280 use tonic::codegen::*;
281 use tonic::codegen::http::Uri;
282 #[derive(Debug, Clone)]
283 pub struct DdkRpcClient<T> {
284 inner: tonic::client::Grpc<T>,
285 }
286 impl DdkRpcClient<tonic::transport::Channel> {
287 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
289 where
290 D: TryInto<tonic::transport::Endpoint>,
291 D::Error: Into<StdError>,
292 {
293 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
294 Ok(Self::new(conn))
295 }
296 }
297 impl<T> DdkRpcClient<T>
298 where
299 T: tonic::client::GrpcService<tonic::body::BoxBody>,
300 T::Error: Into<StdError>,
301 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
302 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
303 {
304 pub fn new(inner: T) -> Self {
305 let inner = tonic::client::Grpc::new(inner);
306 Self { inner }
307 }
308 pub fn with_origin(inner: T, origin: Uri) -> Self {
309 let inner = tonic::client::Grpc::with_origin(inner, origin);
310 Self { inner }
311 }
312 pub fn with_interceptor<F>(
313 inner: T,
314 interceptor: F,
315 ) -> DdkRpcClient<InterceptedService<T, F>>
316 where
317 F: tonic::service::Interceptor,
318 T::ResponseBody: Default,
319 T: tonic::codegen::Service<
320 http::Request<tonic::body::BoxBody>,
321 Response = http::Response<
322 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
323 >,
324 >,
325 <T as tonic::codegen::Service<
326 http::Request<tonic::body::BoxBody>,
327 >>::Error: Into<StdError> + Send + Sync,
328 {
329 DdkRpcClient::new(InterceptedService::new(inner, interceptor))
330 }
331 #[must_use]
336 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
337 self.inner = self.inner.send_compressed(encoding);
338 self
339 }
340 #[must_use]
342 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
343 self.inner = self.inner.accept_compressed(encoding);
344 self
345 }
346 #[must_use]
350 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
351 self.inner = self.inner.max_decoding_message_size(limit);
352 self
353 }
354 #[must_use]
358 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
359 self.inner = self.inner.max_encoding_message_size(limit);
360 self
361 }
362 pub async fn info(
363 &mut self,
364 request: impl tonic::IntoRequest<super::InfoRequest>,
365 ) -> std::result::Result<tonic::Response<super::InfoResponse>, tonic::Status> {
366 self.inner
367 .ready()
368 .await
369 .map_err(|e| {
370 tonic::Status::new(
371 tonic::Code::Unknown,
372 format!("Service was not ready: {}", e.into()),
373 )
374 })?;
375 let codec = tonic::codec::ProstCodec::default();
376 let path = http::uri::PathAndQuery::from_static("/ddkrpc.DdkRpc/Info");
377 let mut req = request.into_request();
378 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "Info"));
379 self.inner.unary(req, path, codec).await
380 }
381 pub async fn send_offer(
382 &mut self,
383 request: impl tonic::IntoRequest<super::SendOfferRequest>,
384 ) -> std::result::Result<
385 tonic::Response<super::SendOfferResponse>,
386 tonic::Status,
387 > {
388 self.inner
389 .ready()
390 .await
391 .map_err(|e| {
392 tonic::Status::new(
393 tonic::Code::Unknown,
394 format!("Service was not ready: {}", e.into()),
395 )
396 })?;
397 let codec = tonic::codec::ProstCodec::default();
398 let path = http::uri::PathAndQuery::from_static("/ddkrpc.DdkRpc/SendOffer");
399 let mut req = request.into_request();
400 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "SendOffer"));
401 self.inner.unary(req, path, codec).await
402 }
403 pub async fn accept_offer(
404 &mut self,
405 request: impl tonic::IntoRequest<super::AcceptOfferRequest>,
406 ) -> std::result::Result<
407 tonic::Response<super::AcceptOfferResponse>,
408 tonic::Status,
409 > {
410 self.inner
411 .ready()
412 .await
413 .map_err(|e| {
414 tonic::Status::new(
415 tonic::Code::Unknown,
416 format!("Service was not ready: {}", e.into()),
417 )
418 })?;
419 let codec = tonic::codec::ProstCodec::default();
420 let path = http::uri::PathAndQuery::from_static(
421 "/ddkrpc.DdkRpc/AcceptOffer",
422 );
423 let mut req = request.into_request();
424 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "AcceptOffer"));
425 self.inner.unary(req, path, codec).await
426 }
427 pub async fn list_offers(
428 &mut self,
429 request: impl tonic::IntoRequest<super::ListOffersRequest>,
430 ) -> std::result::Result<
431 tonic::Response<super::ListOffersResponse>,
432 tonic::Status,
433 > {
434 self.inner
435 .ready()
436 .await
437 .map_err(|e| {
438 tonic::Status::new(
439 tonic::Code::Unknown,
440 format!("Service was not ready: {}", e.into()),
441 )
442 })?;
443 let codec = tonic::codec::ProstCodec::default();
444 let path = http::uri::PathAndQuery::from_static("/ddkrpc.DdkRpc/ListOffers");
445 let mut req = request.into_request();
446 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "ListOffers"));
447 self.inner.unary(req, path, codec).await
448 }
449 pub async fn new_address(
450 &mut self,
451 request: impl tonic::IntoRequest<super::NewAddressRequest>,
452 ) -> std::result::Result<
453 tonic::Response<super::NewAddressResponse>,
454 tonic::Status,
455 > {
456 self.inner
457 .ready()
458 .await
459 .map_err(|e| {
460 tonic::Status::new(
461 tonic::Code::Unknown,
462 format!("Service was not ready: {}", e.into()),
463 )
464 })?;
465 let codec = tonic::codec::ProstCodec::default();
466 let path = http::uri::PathAndQuery::from_static("/ddkrpc.DdkRpc/NewAddress");
467 let mut req = request.into_request();
468 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "NewAddress"));
469 self.inner.unary(req, path, codec).await
470 }
471 pub async fn wallet_balance(
472 &mut self,
473 request: impl tonic::IntoRequest<super::WalletBalanceRequest>,
474 ) -> std::result::Result<
475 tonic::Response<super::WalletBalanceResponse>,
476 tonic::Status,
477 > {
478 self.inner
479 .ready()
480 .await
481 .map_err(|e| {
482 tonic::Status::new(
483 tonic::Code::Unknown,
484 format!("Service was not ready: {}", e.into()),
485 )
486 })?;
487 let codec = tonic::codec::ProstCodec::default();
488 let path = http::uri::PathAndQuery::from_static(
489 "/ddkrpc.DdkRpc/WalletBalance",
490 );
491 let mut req = request.into_request();
492 req.extensions_mut()
493 .insert(GrpcMethod::new("ddkrpc.DdkRpc", "WalletBalance"));
494 self.inner.unary(req, path, codec).await
495 }
496 pub async fn wallet_sync(
497 &mut self,
498 request: impl tonic::IntoRequest<super::WalletSyncRequest>,
499 ) -> std::result::Result<
500 tonic::Response<super::WalletSyncResponse>,
501 tonic::Status,
502 > {
503 self.inner
504 .ready()
505 .await
506 .map_err(|e| {
507 tonic::Status::new(
508 tonic::Code::Unknown,
509 format!("Service was not ready: {}", e.into()),
510 )
511 })?;
512 let codec = tonic::codec::ProstCodec::default();
513 let path = http::uri::PathAndQuery::from_static("/ddkrpc.DdkRpc/WalletSync");
514 let mut req = request.into_request();
515 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "WalletSync"));
516 self.inner.unary(req, path, codec).await
517 }
518 pub async fn sync(
519 &mut self,
520 request: impl tonic::IntoRequest<super::SyncRequest>,
521 ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
522 self.inner
523 .ready()
524 .await
525 .map_err(|e| {
526 tonic::Status::new(
527 tonic::Code::Unknown,
528 format!("Service was not ready: {}", e.into()),
529 )
530 })?;
531 let codec = tonic::codec::ProstCodec::default();
532 let path = http::uri::PathAndQuery::from_static("/ddkrpc.DdkRpc/Sync");
533 let mut req = request.into_request();
534 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "Sync"));
535 self.inner.unary(req, path, codec).await
536 }
537 pub async fn get_wallet_transactions(
538 &mut self,
539 request: impl tonic::IntoRequest<super::GetWalletTransactionsRequest>,
540 ) -> std::result::Result<
541 tonic::Response<super::GetWalletTransactionsResponse>,
542 tonic::Status,
543 > {
544 self.inner
545 .ready()
546 .await
547 .map_err(|e| {
548 tonic::Status::new(
549 tonic::Code::Unknown,
550 format!("Service was not ready: {}", e.into()),
551 )
552 })?;
553 let codec = tonic::codec::ProstCodec::default();
554 let path = http::uri::PathAndQuery::from_static(
555 "/ddkrpc.DdkRpc/GetWalletTransactions",
556 );
557 let mut req = request.into_request();
558 req.extensions_mut()
559 .insert(GrpcMethod::new("ddkrpc.DdkRpc", "GetWalletTransactions"));
560 self.inner.unary(req, path, codec).await
561 }
562 pub async fn list_utxos(
563 &mut self,
564 request: impl tonic::IntoRequest<super::ListUtxosRequest>,
565 ) -> std::result::Result<
566 tonic::Response<super::ListUtxosResponse>,
567 tonic::Status,
568 > {
569 self.inner
570 .ready()
571 .await
572 .map_err(|e| {
573 tonic::Status::new(
574 tonic::Code::Unknown,
575 format!("Service was not ready: {}", e.into()),
576 )
577 })?;
578 let codec = tonic::codec::ProstCodec::default();
579 let path = http::uri::PathAndQuery::from_static("/ddkrpc.DdkRpc/ListUtxos");
580 let mut req = request.into_request();
581 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "ListUtxos"));
582 self.inner.unary(req, path, codec).await
583 }
584 pub async fn list_peers(
585 &mut self,
586 request: impl tonic::IntoRequest<super::ListPeersRequest>,
587 ) -> std::result::Result<
588 tonic::Response<super::ListPeersResponse>,
589 tonic::Status,
590 > {
591 self.inner
592 .ready()
593 .await
594 .map_err(|e| {
595 tonic::Status::new(
596 tonic::Code::Unknown,
597 format!("Service was not ready: {}", e.into()),
598 )
599 })?;
600 let codec = tonic::codec::ProstCodec::default();
601 let path = http::uri::PathAndQuery::from_static("/ddkrpc.DdkRpc/ListPeers");
602 let mut req = request.into_request();
603 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "ListPeers"));
604 self.inner.unary(req, path, codec).await
605 }
606 pub async fn connect_peer(
607 &mut self,
608 request: impl tonic::IntoRequest<super::ConnectRequest>,
609 ) -> std::result::Result<
610 tonic::Response<super::ConnectResponse>,
611 tonic::Status,
612 > {
613 self.inner
614 .ready()
615 .await
616 .map_err(|e| {
617 tonic::Status::new(
618 tonic::Code::Unknown,
619 format!("Service was not ready: {}", e.into()),
620 )
621 })?;
622 let codec = tonic::codec::ProstCodec::default();
623 let path = http::uri::PathAndQuery::from_static(
624 "/ddkrpc.DdkRpc/ConnectPeer",
625 );
626 let mut req = request.into_request();
627 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "ConnectPeer"));
628 self.inner.unary(req, path, codec).await
629 }
630 pub async fn list_oracles(
631 &mut self,
632 request: impl tonic::IntoRequest<super::ListOraclesRequest>,
633 ) -> std::result::Result<
634 tonic::Response<super::ListOraclesResponse>,
635 tonic::Status,
636 > {
637 self.inner
638 .ready()
639 .await
640 .map_err(|e| {
641 tonic::Status::new(
642 tonic::Code::Unknown,
643 format!("Service was not ready: {}", e.into()),
644 )
645 })?;
646 let codec = tonic::codec::ProstCodec::default();
647 let path = http::uri::PathAndQuery::from_static(
648 "/ddkrpc.DdkRpc/ListOracles",
649 );
650 let mut req = request.into_request();
651 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "ListOracles"));
652 self.inner.unary(req, path, codec).await
653 }
654 pub async fn list_contracts(
655 &mut self,
656 request: impl tonic::IntoRequest<super::ListContractsRequest>,
657 ) -> std::result::Result<
658 tonic::Response<super::ListContractsResponse>,
659 tonic::Status,
660 > {
661 self.inner
662 .ready()
663 .await
664 .map_err(|e| {
665 tonic::Status::new(
666 tonic::Code::Unknown,
667 format!("Service was not ready: {}", e.into()),
668 )
669 })?;
670 let codec = tonic::codec::ProstCodec::default();
671 let path = http::uri::PathAndQuery::from_static(
672 "/ddkrpc.DdkRpc/ListContracts",
673 );
674 let mut req = request.into_request();
675 req.extensions_mut()
676 .insert(GrpcMethod::new("ddkrpc.DdkRpc", "ListContracts"));
677 self.inner.unary(req, path, codec).await
678 }
679 pub async fn send(
680 &mut self,
681 request: impl tonic::IntoRequest<super::SendRequest>,
682 ) -> std::result::Result<tonic::Response<super::SendResponse>, tonic::Status> {
683 self.inner
684 .ready()
685 .await
686 .map_err(|e| {
687 tonic::Status::new(
688 tonic::Code::Unknown,
689 format!("Service was not ready: {}", e.into()),
690 )
691 })?;
692 let codec = tonic::codec::ProstCodec::default();
693 let path = http::uri::PathAndQuery::from_static("/ddkrpc.DdkRpc/Send");
694 let mut req = request.into_request();
695 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "Send"));
696 self.inner.unary(req, path, codec).await
697 }
698 pub async fn oracle_announcements(
699 &mut self,
700 request: impl tonic::IntoRequest<super::OracleAnnouncementsRequest>,
701 ) -> std::result::Result<
702 tonic::Response<super::OracleAnnouncementsResponse>,
703 tonic::Status,
704 > {
705 self.inner
706 .ready()
707 .await
708 .map_err(|e| {
709 tonic::Status::new(
710 tonic::Code::Unknown,
711 format!("Service was not ready: {}", e.into()),
712 )
713 })?;
714 let codec = tonic::codec::ProstCodec::default();
715 let path = http::uri::PathAndQuery::from_static(
716 "/ddkrpc.DdkRpc/OracleAnnouncements",
717 );
718 let mut req = request.into_request();
719 req.extensions_mut()
720 .insert(GrpcMethod::new("ddkrpc.DdkRpc", "OracleAnnouncements"));
721 self.inner.unary(req, path, codec).await
722 }
723 pub async fn create_enum(
724 &mut self,
725 request: impl tonic::IntoRequest<super::CreateEnumRequest>,
726 ) -> std::result::Result<
727 tonic::Response<super::CreateEnumResponse>,
728 tonic::Status,
729 > {
730 self.inner
731 .ready()
732 .await
733 .map_err(|e| {
734 tonic::Status::new(
735 tonic::Code::Unknown,
736 format!("Service was not ready: {}", e.into()),
737 )
738 })?;
739 let codec = tonic::codec::ProstCodec::default();
740 let path = http::uri::PathAndQuery::from_static("/ddkrpc.DdkRpc/CreateEnum");
741 let mut req = request.into_request();
742 req.extensions_mut().insert(GrpcMethod::new("ddkrpc.DdkRpc", "CreateEnum"));
743 self.inner.unary(req, path, codec).await
744 }
745 pub async fn create_numeric(
746 &mut self,
747 request: impl tonic::IntoRequest<super::CreateNumericRequest>,
748 ) -> std::result::Result<
749 tonic::Response<super::CreateNumericResponse>,
750 tonic::Status,
751 > {
752 self.inner
753 .ready()
754 .await
755 .map_err(|e| {
756 tonic::Status::new(
757 tonic::Code::Unknown,
758 format!("Service was not ready: {}", e.into()),
759 )
760 })?;
761 let codec = tonic::codec::ProstCodec::default();
762 let path = http::uri::PathAndQuery::from_static(
763 "/ddkrpc.DdkRpc/CreateNumeric",
764 );
765 let mut req = request.into_request();
766 req.extensions_mut()
767 .insert(GrpcMethod::new("ddkrpc.DdkRpc", "CreateNumeric"));
768 self.inner.unary(req, path, codec).await
769 }
770 pub async fn sign_announcement(
771 &mut self,
772 request: impl tonic::IntoRequest<super::SignRequest>,
773 ) -> std::result::Result<tonic::Response<super::SignResponse>, tonic::Status> {
774 self.inner
775 .ready()
776 .await
777 .map_err(|e| {
778 tonic::Status::new(
779 tonic::Code::Unknown,
780 format!("Service was not ready: {}", e.into()),
781 )
782 })?;
783 let codec = tonic::codec::ProstCodec::default();
784 let path = http::uri::PathAndQuery::from_static(
785 "/ddkrpc.DdkRpc/SignAnnouncement",
786 );
787 let mut req = request.into_request();
788 req.extensions_mut()
789 .insert(GrpcMethod::new("ddkrpc.DdkRpc", "SignAnnouncement"));
790 self.inner.unary(req, path, codec).await
791 }
792 }
793}
794pub mod ddk_rpc_server {
796 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
797 use tonic::codegen::*;
798 #[async_trait]
800 pub trait DdkRpc: Send + Sync + 'static {
801 async fn info(
802 &self,
803 request: tonic::Request<super::InfoRequest>,
804 ) -> std::result::Result<tonic::Response<super::InfoResponse>, tonic::Status>;
805 async fn send_offer(
806 &self,
807 request: tonic::Request<super::SendOfferRequest>,
808 ) -> std::result::Result<
809 tonic::Response<super::SendOfferResponse>,
810 tonic::Status,
811 >;
812 async fn accept_offer(
813 &self,
814 request: tonic::Request<super::AcceptOfferRequest>,
815 ) -> std::result::Result<
816 tonic::Response<super::AcceptOfferResponse>,
817 tonic::Status,
818 >;
819 async fn list_offers(
820 &self,
821 request: tonic::Request<super::ListOffersRequest>,
822 ) -> std::result::Result<
823 tonic::Response<super::ListOffersResponse>,
824 tonic::Status,
825 >;
826 async fn new_address(
827 &self,
828 request: tonic::Request<super::NewAddressRequest>,
829 ) -> std::result::Result<
830 tonic::Response<super::NewAddressResponse>,
831 tonic::Status,
832 >;
833 async fn wallet_balance(
834 &self,
835 request: tonic::Request<super::WalletBalanceRequest>,
836 ) -> std::result::Result<
837 tonic::Response<super::WalletBalanceResponse>,
838 tonic::Status,
839 >;
840 async fn wallet_sync(
841 &self,
842 request: tonic::Request<super::WalletSyncRequest>,
843 ) -> std::result::Result<
844 tonic::Response<super::WalletSyncResponse>,
845 tonic::Status,
846 >;
847 async fn sync(
848 &self,
849 request: tonic::Request<super::SyncRequest>,
850 ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>;
851 async fn get_wallet_transactions(
852 &self,
853 request: tonic::Request<super::GetWalletTransactionsRequest>,
854 ) -> std::result::Result<
855 tonic::Response<super::GetWalletTransactionsResponse>,
856 tonic::Status,
857 >;
858 async fn list_utxos(
859 &self,
860 request: tonic::Request<super::ListUtxosRequest>,
861 ) -> std::result::Result<
862 tonic::Response<super::ListUtxosResponse>,
863 tonic::Status,
864 >;
865 async fn list_peers(
866 &self,
867 request: tonic::Request<super::ListPeersRequest>,
868 ) -> std::result::Result<
869 tonic::Response<super::ListPeersResponse>,
870 tonic::Status,
871 >;
872 async fn connect_peer(
873 &self,
874 request: tonic::Request<super::ConnectRequest>,
875 ) -> std::result::Result<tonic::Response<super::ConnectResponse>, tonic::Status>;
876 async fn list_oracles(
877 &self,
878 request: tonic::Request<super::ListOraclesRequest>,
879 ) -> std::result::Result<
880 tonic::Response<super::ListOraclesResponse>,
881 tonic::Status,
882 >;
883 async fn list_contracts(
884 &self,
885 request: tonic::Request<super::ListContractsRequest>,
886 ) -> std::result::Result<
887 tonic::Response<super::ListContractsResponse>,
888 tonic::Status,
889 >;
890 async fn send(
891 &self,
892 request: tonic::Request<super::SendRequest>,
893 ) -> std::result::Result<tonic::Response<super::SendResponse>, tonic::Status>;
894 async fn oracle_announcements(
895 &self,
896 request: tonic::Request<super::OracleAnnouncementsRequest>,
897 ) -> std::result::Result<
898 tonic::Response<super::OracleAnnouncementsResponse>,
899 tonic::Status,
900 >;
901 async fn create_enum(
902 &self,
903 request: tonic::Request<super::CreateEnumRequest>,
904 ) -> std::result::Result<
905 tonic::Response<super::CreateEnumResponse>,
906 tonic::Status,
907 >;
908 async fn create_numeric(
909 &self,
910 request: tonic::Request<super::CreateNumericRequest>,
911 ) -> std::result::Result<
912 tonic::Response<super::CreateNumericResponse>,
913 tonic::Status,
914 >;
915 async fn sign_announcement(
916 &self,
917 request: tonic::Request<super::SignRequest>,
918 ) -> std::result::Result<tonic::Response<super::SignResponse>, tonic::Status>;
919 }
920 #[derive(Debug)]
921 pub struct DdkRpcServer<T: DdkRpc> {
922 inner: _Inner<T>,
923 accept_compression_encodings: EnabledCompressionEncodings,
924 send_compression_encodings: EnabledCompressionEncodings,
925 max_decoding_message_size: Option<usize>,
926 max_encoding_message_size: Option<usize>,
927 }
928 struct _Inner<T>(Arc<T>);
929 impl<T: DdkRpc> DdkRpcServer<T> {
930 pub fn new(inner: T) -> Self {
931 Self::from_arc(Arc::new(inner))
932 }
933 pub fn from_arc(inner: Arc<T>) -> Self {
934 let inner = _Inner(inner);
935 Self {
936 inner,
937 accept_compression_encodings: Default::default(),
938 send_compression_encodings: Default::default(),
939 max_decoding_message_size: None,
940 max_encoding_message_size: None,
941 }
942 }
943 pub fn with_interceptor<F>(
944 inner: T,
945 interceptor: F,
946 ) -> InterceptedService<Self, F>
947 where
948 F: tonic::service::Interceptor,
949 {
950 InterceptedService::new(Self::new(inner), interceptor)
951 }
952 #[must_use]
954 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
955 self.accept_compression_encodings.enable(encoding);
956 self
957 }
958 #[must_use]
960 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
961 self.send_compression_encodings.enable(encoding);
962 self
963 }
964 #[must_use]
968 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
969 self.max_decoding_message_size = Some(limit);
970 self
971 }
972 #[must_use]
976 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
977 self.max_encoding_message_size = Some(limit);
978 self
979 }
980 }
981 impl<T, B> tonic::codegen::Service<http::Request<B>> for DdkRpcServer<T>
982 where
983 T: DdkRpc,
984 B: Body + Send + 'static,
985 B::Error: Into<StdError> + Send + 'static,
986 {
987 type Response = http::Response<tonic::body::BoxBody>;
988 type Error = std::convert::Infallible;
989 type Future = BoxFuture<Self::Response, Self::Error>;
990 fn poll_ready(
991 &mut self,
992 _cx: &mut Context<'_>,
993 ) -> Poll<std::result::Result<(), Self::Error>> {
994 Poll::Ready(Ok(()))
995 }
996 fn call(&mut self, req: http::Request<B>) -> Self::Future {
997 let inner = self.inner.clone();
998 match req.uri().path() {
999 "/ddkrpc.DdkRpc/Info" => {
1000 #[allow(non_camel_case_types)]
1001 struct InfoSvc<T: DdkRpc>(pub Arc<T>);
1002 impl<T: DdkRpc> tonic::server::UnaryService<super::InfoRequest>
1003 for InfoSvc<T> {
1004 type Response = super::InfoResponse;
1005 type Future = BoxFuture<
1006 tonic::Response<Self::Response>,
1007 tonic::Status,
1008 >;
1009 fn call(
1010 &mut self,
1011 request: tonic::Request<super::InfoRequest>,
1012 ) -> Self::Future {
1013 let inner = Arc::clone(&self.0);
1014 let fut = async move {
1015 <T as DdkRpc>::info(&inner, request).await
1016 };
1017 Box::pin(fut)
1018 }
1019 }
1020 let accept_compression_encodings = self.accept_compression_encodings;
1021 let send_compression_encodings = self.send_compression_encodings;
1022 let max_decoding_message_size = self.max_decoding_message_size;
1023 let max_encoding_message_size = self.max_encoding_message_size;
1024 let inner = self.inner.clone();
1025 let fut = async move {
1026 let inner = inner.0;
1027 let method = InfoSvc(inner);
1028 let codec = tonic::codec::ProstCodec::default();
1029 let mut grpc = tonic::server::Grpc::new(codec)
1030 .apply_compression_config(
1031 accept_compression_encodings,
1032 send_compression_encodings,
1033 )
1034 .apply_max_message_size_config(
1035 max_decoding_message_size,
1036 max_encoding_message_size,
1037 );
1038 let res = grpc.unary(method, req).await;
1039 Ok(res)
1040 };
1041 Box::pin(fut)
1042 }
1043 "/ddkrpc.DdkRpc/SendOffer" => {
1044 #[allow(non_camel_case_types)]
1045 struct SendOfferSvc<T: DdkRpc>(pub Arc<T>);
1046 impl<T: DdkRpc> tonic::server::UnaryService<super::SendOfferRequest>
1047 for SendOfferSvc<T> {
1048 type Response = super::SendOfferResponse;
1049 type Future = BoxFuture<
1050 tonic::Response<Self::Response>,
1051 tonic::Status,
1052 >;
1053 fn call(
1054 &mut self,
1055 request: tonic::Request<super::SendOfferRequest>,
1056 ) -> Self::Future {
1057 let inner = Arc::clone(&self.0);
1058 let fut = async move {
1059 <T as DdkRpc>::send_offer(&inner, request).await
1060 };
1061 Box::pin(fut)
1062 }
1063 }
1064 let accept_compression_encodings = self.accept_compression_encodings;
1065 let send_compression_encodings = self.send_compression_encodings;
1066 let max_decoding_message_size = self.max_decoding_message_size;
1067 let max_encoding_message_size = self.max_encoding_message_size;
1068 let inner = self.inner.clone();
1069 let fut = async move {
1070 let inner = inner.0;
1071 let method = SendOfferSvc(inner);
1072 let codec = tonic::codec::ProstCodec::default();
1073 let mut grpc = tonic::server::Grpc::new(codec)
1074 .apply_compression_config(
1075 accept_compression_encodings,
1076 send_compression_encodings,
1077 )
1078 .apply_max_message_size_config(
1079 max_decoding_message_size,
1080 max_encoding_message_size,
1081 );
1082 let res = grpc.unary(method, req).await;
1083 Ok(res)
1084 };
1085 Box::pin(fut)
1086 }
1087 "/ddkrpc.DdkRpc/AcceptOffer" => {
1088 #[allow(non_camel_case_types)]
1089 struct AcceptOfferSvc<T: DdkRpc>(pub Arc<T>);
1090 impl<
1091 T: DdkRpc,
1092 > tonic::server::UnaryService<super::AcceptOfferRequest>
1093 for AcceptOfferSvc<T> {
1094 type Response = super::AcceptOfferResponse;
1095 type Future = BoxFuture<
1096 tonic::Response<Self::Response>,
1097 tonic::Status,
1098 >;
1099 fn call(
1100 &mut self,
1101 request: tonic::Request<super::AcceptOfferRequest>,
1102 ) -> Self::Future {
1103 let inner = Arc::clone(&self.0);
1104 let fut = async move {
1105 <T as DdkRpc>::accept_offer(&inner, request).await
1106 };
1107 Box::pin(fut)
1108 }
1109 }
1110 let accept_compression_encodings = self.accept_compression_encodings;
1111 let send_compression_encodings = self.send_compression_encodings;
1112 let max_decoding_message_size = self.max_decoding_message_size;
1113 let max_encoding_message_size = self.max_encoding_message_size;
1114 let inner = self.inner.clone();
1115 let fut = async move {
1116 let inner = inner.0;
1117 let method = AcceptOfferSvc(inner);
1118 let codec = tonic::codec::ProstCodec::default();
1119 let mut grpc = tonic::server::Grpc::new(codec)
1120 .apply_compression_config(
1121 accept_compression_encodings,
1122 send_compression_encodings,
1123 )
1124 .apply_max_message_size_config(
1125 max_decoding_message_size,
1126 max_encoding_message_size,
1127 );
1128 let res = grpc.unary(method, req).await;
1129 Ok(res)
1130 };
1131 Box::pin(fut)
1132 }
1133 "/ddkrpc.DdkRpc/ListOffers" => {
1134 #[allow(non_camel_case_types)]
1135 struct ListOffersSvc<T: DdkRpc>(pub Arc<T>);
1136 impl<T: DdkRpc> tonic::server::UnaryService<super::ListOffersRequest>
1137 for ListOffersSvc<T> {
1138 type Response = super::ListOffersResponse;
1139 type Future = BoxFuture<
1140 tonic::Response<Self::Response>,
1141 tonic::Status,
1142 >;
1143 fn call(
1144 &mut self,
1145 request: tonic::Request<super::ListOffersRequest>,
1146 ) -> Self::Future {
1147 let inner = Arc::clone(&self.0);
1148 let fut = async move {
1149 <T as DdkRpc>::list_offers(&inner, request).await
1150 };
1151 Box::pin(fut)
1152 }
1153 }
1154 let accept_compression_encodings = self.accept_compression_encodings;
1155 let send_compression_encodings = self.send_compression_encodings;
1156 let max_decoding_message_size = self.max_decoding_message_size;
1157 let max_encoding_message_size = self.max_encoding_message_size;
1158 let inner = self.inner.clone();
1159 let fut = async move {
1160 let inner = inner.0;
1161 let method = ListOffersSvc(inner);
1162 let codec = tonic::codec::ProstCodec::default();
1163 let mut grpc = tonic::server::Grpc::new(codec)
1164 .apply_compression_config(
1165 accept_compression_encodings,
1166 send_compression_encodings,
1167 )
1168 .apply_max_message_size_config(
1169 max_decoding_message_size,
1170 max_encoding_message_size,
1171 );
1172 let res = grpc.unary(method, req).await;
1173 Ok(res)
1174 };
1175 Box::pin(fut)
1176 }
1177 "/ddkrpc.DdkRpc/NewAddress" => {
1178 #[allow(non_camel_case_types)]
1179 struct NewAddressSvc<T: DdkRpc>(pub Arc<T>);
1180 impl<T: DdkRpc> tonic::server::UnaryService<super::NewAddressRequest>
1181 for NewAddressSvc<T> {
1182 type Response = super::NewAddressResponse;
1183 type Future = BoxFuture<
1184 tonic::Response<Self::Response>,
1185 tonic::Status,
1186 >;
1187 fn call(
1188 &mut self,
1189 request: tonic::Request<super::NewAddressRequest>,
1190 ) -> Self::Future {
1191 let inner = Arc::clone(&self.0);
1192 let fut = async move {
1193 <T as DdkRpc>::new_address(&inner, request).await
1194 };
1195 Box::pin(fut)
1196 }
1197 }
1198 let accept_compression_encodings = self.accept_compression_encodings;
1199 let send_compression_encodings = self.send_compression_encodings;
1200 let max_decoding_message_size = self.max_decoding_message_size;
1201 let max_encoding_message_size = self.max_encoding_message_size;
1202 let inner = self.inner.clone();
1203 let fut = async move {
1204 let inner = inner.0;
1205 let method = NewAddressSvc(inner);
1206 let codec = tonic::codec::ProstCodec::default();
1207 let mut grpc = tonic::server::Grpc::new(codec)
1208 .apply_compression_config(
1209 accept_compression_encodings,
1210 send_compression_encodings,
1211 )
1212 .apply_max_message_size_config(
1213 max_decoding_message_size,
1214 max_encoding_message_size,
1215 );
1216 let res = grpc.unary(method, req).await;
1217 Ok(res)
1218 };
1219 Box::pin(fut)
1220 }
1221 "/ddkrpc.DdkRpc/WalletBalance" => {
1222 #[allow(non_camel_case_types)]
1223 struct WalletBalanceSvc<T: DdkRpc>(pub Arc<T>);
1224 impl<
1225 T: DdkRpc,
1226 > tonic::server::UnaryService<super::WalletBalanceRequest>
1227 for WalletBalanceSvc<T> {
1228 type Response = super::WalletBalanceResponse;
1229 type Future = BoxFuture<
1230 tonic::Response<Self::Response>,
1231 tonic::Status,
1232 >;
1233 fn call(
1234 &mut self,
1235 request: tonic::Request<super::WalletBalanceRequest>,
1236 ) -> Self::Future {
1237 let inner = Arc::clone(&self.0);
1238 let fut = async move {
1239 <T as DdkRpc>::wallet_balance(&inner, request).await
1240 };
1241 Box::pin(fut)
1242 }
1243 }
1244 let accept_compression_encodings = self.accept_compression_encodings;
1245 let send_compression_encodings = self.send_compression_encodings;
1246 let max_decoding_message_size = self.max_decoding_message_size;
1247 let max_encoding_message_size = self.max_encoding_message_size;
1248 let inner = self.inner.clone();
1249 let fut = async move {
1250 let inner = inner.0;
1251 let method = WalletBalanceSvc(inner);
1252 let codec = tonic::codec::ProstCodec::default();
1253 let mut grpc = tonic::server::Grpc::new(codec)
1254 .apply_compression_config(
1255 accept_compression_encodings,
1256 send_compression_encodings,
1257 )
1258 .apply_max_message_size_config(
1259 max_decoding_message_size,
1260 max_encoding_message_size,
1261 );
1262 let res = grpc.unary(method, req).await;
1263 Ok(res)
1264 };
1265 Box::pin(fut)
1266 }
1267 "/ddkrpc.DdkRpc/WalletSync" => {
1268 #[allow(non_camel_case_types)]
1269 struct WalletSyncSvc<T: DdkRpc>(pub Arc<T>);
1270 impl<T: DdkRpc> tonic::server::UnaryService<super::WalletSyncRequest>
1271 for WalletSyncSvc<T> {
1272 type Response = super::WalletSyncResponse;
1273 type Future = BoxFuture<
1274 tonic::Response<Self::Response>,
1275 tonic::Status,
1276 >;
1277 fn call(
1278 &mut self,
1279 request: tonic::Request<super::WalletSyncRequest>,
1280 ) -> Self::Future {
1281 let inner = Arc::clone(&self.0);
1282 let fut = async move {
1283 <T as DdkRpc>::wallet_sync(&inner, request).await
1284 };
1285 Box::pin(fut)
1286 }
1287 }
1288 let accept_compression_encodings = self.accept_compression_encodings;
1289 let send_compression_encodings = self.send_compression_encodings;
1290 let max_decoding_message_size = self.max_decoding_message_size;
1291 let max_encoding_message_size = self.max_encoding_message_size;
1292 let inner = self.inner.clone();
1293 let fut = async move {
1294 let inner = inner.0;
1295 let method = WalletSyncSvc(inner);
1296 let codec = tonic::codec::ProstCodec::default();
1297 let mut grpc = tonic::server::Grpc::new(codec)
1298 .apply_compression_config(
1299 accept_compression_encodings,
1300 send_compression_encodings,
1301 )
1302 .apply_max_message_size_config(
1303 max_decoding_message_size,
1304 max_encoding_message_size,
1305 );
1306 let res = grpc.unary(method, req).await;
1307 Ok(res)
1308 };
1309 Box::pin(fut)
1310 }
1311 "/ddkrpc.DdkRpc/Sync" => {
1312 #[allow(non_camel_case_types)]
1313 struct SyncSvc<T: DdkRpc>(pub Arc<T>);
1314 impl<T: DdkRpc> tonic::server::UnaryService<super::SyncRequest>
1315 for SyncSvc<T> {
1316 type Response = super::SyncResponse;
1317 type Future = BoxFuture<
1318 tonic::Response<Self::Response>,
1319 tonic::Status,
1320 >;
1321 fn call(
1322 &mut self,
1323 request: tonic::Request<super::SyncRequest>,
1324 ) -> Self::Future {
1325 let inner = Arc::clone(&self.0);
1326 let fut = async move {
1327 <T as DdkRpc>::sync(&inner, request).await
1328 };
1329 Box::pin(fut)
1330 }
1331 }
1332 let accept_compression_encodings = self.accept_compression_encodings;
1333 let send_compression_encodings = self.send_compression_encodings;
1334 let max_decoding_message_size = self.max_decoding_message_size;
1335 let max_encoding_message_size = self.max_encoding_message_size;
1336 let inner = self.inner.clone();
1337 let fut = async move {
1338 let inner = inner.0;
1339 let method = SyncSvc(inner);
1340 let codec = tonic::codec::ProstCodec::default();
1341 let mut grpc = tonic::server::Grpc::new(codec)
1342 .apply_compression_config(
1343 accept_compression_encodings,
1344 send_compression_encodings,
1345 )
1346 .apply_max_message_size_config(
1347 max_decoding_message_size,
1348 max_encoding_message_size,
1349 );
1350 let res = grpc.unary(method, req).await;
1351 Ok(res)
1352 };
1353 Box::pin(fut)
1354 }
1355 "/ddkrpc.DdkRpc/GetWalletTransactions" => {
1356 #[allow(non_camel_case_types)]
1357 struct GetWalletTransactionsSvc<T: DdkRpc>(pub Arc<T>);
1358 impl<
1359 T: DdkRpc,
1360 > tonic::server::UnaryService<super::GetWalletTransactionsRequest>
1361 for GetWalletTransactionsSvc<T> {
1362 type Response = super::GetWalletTransactionsResponse;
1363 type Future = BoxFuture<
1364 tonic::Response<Self::Response>,
1365 tonic::Status,
1366 >;
1367 fn call(
1368 &mut self,
1369 request: tonic::Request<super::GetWalletTransactionsRequest>,
1370 ) -> Self::Future {
1371 let inner = Arc::clone(&self.0);
1372 let fut = async move {
1373 <T as DdkRpc>::get_wallet_transactions(&inner, request)
1374 .await
1375 };
1376 Box::pin(fut)
1377 }
1378 }
1379 let accept_compression_encodings = self.accept_compression_encodings;
1380 let send_compression_encodings = self.send_compression_encodings;
1381 let max_decoding_message_size = self.max_decoding_message_size;
1382 let max_encoding_message_size = self.max_encoding_message_size;
1383 let inner = self.inner.clone();
1384 let fut = async move {
1385 let inner = inner.0;
1386 let method = GetWalletTransactionsSvc(inner);
1387 let codec = tonic::codec::ProstCodec::default();
1388 let mut grpc = tonic::server::Grpc::new(codec)
1389 .apply_compression_config(
1390 accept_compression_encodings,
1391 send_compression_encodings,
1392 )
1393 .apply_max_message_size_config(
1394 max_decoding_message_size,
1395 max_encoding_message_size,
1396 );
1397 let res = grpc.unary(method, req).await;
1398 Ok(res)
1399 };
1400 Box::pin(fut)
1401 }
1402 "/ddkrpc.DdkRpc/ListUtxos" => {
1403 #[allow(non_camel_case_types)]
1404 struct ListUtxosSvc<T: DdkRpc>(pub Arc<T>);
1405 impl<T: DdkRpc> tonic::server::UnaryService<super::ListUtxosRequest>
1406 for ListUtxosSvc<T> {
1407 type Response = super::ListUtxosResponse;
1408 type Future = BoxFuture<
1409 tonic::Response<Self::Response>,
1410 tonic::Status,
1411 >;
1412 fn call(
1413 &mut self,
1414 request: tonic::Request<super::ListUtxosRequest>,
1415 ) -> Self::Future {
1416 let inner = Arc::clone(&self.0);
1417 let fut = async move {
1418 <T as DdkRpc>::list_utxos(&inner, request).await
1419 };
1420 Box::pin(fut)
1421 }
1422 }
1423 let accept_compression_encodings = self.accept_compression_encodings;
1424 let send_compression_encodings = self.send_compression_encodings;
1425 let max_decoding_message_size = self.max_decoding_message_size;
1426 let max_encoding_message_size = self.max_encoding_message_size;
1427 let inner = self.inner.clone();
1428 let fut = async move {
1429 let inner = inner.0;
1430 let method = ListUtxosSvc(inner);
1431 let codec = tonic::codec::ProstCodec::default();
1432 let mut grpc = tonic::server::Grpc::new(codec)
1433 .apply_compression_config(
1434 accept_compression_encodings,
1435 send_compression_encodings,
1436 )
1437 .apply_max_message_size_config(
1438 max_decoding_message_size,
1439 max_encoding_message_size,
1440 );
1441 let res = grpc.unary(method, req).await;
1442 Ok(res)
1443 };
1444 Box::pin(fut)
1445 }
1446 "/ddkrpc.DdkRpc/ListPeers" => {
1447 #[allow(non_camel_case_types)]
1448 struct ListPeersSvc<T: DdkRpc>(pub Arc<T>);
1449 impl<T: DdkRpc> tonic::server::UnaryService<super::ListPeersRequest>
1450 for ListPeersSvc<T> {
1451 type Response = super::ListPeersResponse;
1452 type Future = BoxFuture<
1453 tonic::Response<Self::Response>,
1454 tonic::Status,
1455 >;
1456 fn call(
1457 &mut self,
1458 request: tonic::Request<super::ListPeersRequest>,
1459 ) -> Self::Future {
1460 let inner = Arc::clone(&self.0);
1461 let fut = async move {
1462 <T as DdkRpc>::list_peers(&inner, request).await
1463 };
1464 Box::pin(fut)
1465 }
1466 }
1467 let accept_compression_encodings = self.accept_compression_encodings;
1468 let send_compression_encodings = self.send_compression_encodings;
1469 let max_decoding_message_size = self.max_decoding_message_size;
1470 let max_encoding_message_size = self.max_encoding_message_size;
1471 let inner = self.inner.clone();
1472 let fut = async move {
1473 let inner = inner.0;
1474 let method = ListPeersSvc(inner);
1475 let codec = tonic::codec::ProstCodec::default();
1476 let mut grpc = tonic::server::Grpc::new(codec)
1477 .apply_compression_config(
1478 accept_compression_encodings,
1479 send_compression_encodings,
1480 )
1481 .apply_max_message_size_config(
1482 max_decoding_message_size,
1483 max_encoding_message_size,
1484 );
1485 let res = grpc.unary(method, req).await;
1486 Ok(res)
1487 };
1488 Box::pin(fut)
1489 }
1490 "/ddkrpc.DdkRpc/ConnectPeer" => {
1491 #[allow(non_camel_case_types)]
1492 struct ConnectPeerSvc<T: DdkRpc>(pub Arc<T>);
1493 impl<T: DdkRpc> tonic::server::UnaryService<super::ConnectRequest>
1494 for ConnectPeerSvc<T> {
1495 type Response = super::ConnectResponse;
1496 type Future = BoxFuture<
1497 tonic::Response<Self::Response>,
1498 tonic::Status,
1499 >;
1500 fn call(
1501 &mut self,
1502 request: tonic::Request<super::ConnectRequest>,
1503 ) -> Self::Future {
1504 let inner = Arc::clone(&self.0);
1505 let fut = async move {
1506 <T as DdkRpc>::connect_peer(&inner, request).await
1507 };
1508 Box::pin(fut)
1509 }
1510 }
1511 let accept_compression_encodings = self.accept_compression_encodings;
1512 let send_compression_encodings = self.send_compression_encodings;
1513 let max_decoding_message_size = self.max_decoding_message_size;
1514 let max_encoding_message_size = self.max_encoding_message_size;
1515 let inner = self.inner.clone();
1516 let fut = async move {
1517 let inner = inner.0;
1518 let method = ConnectPeerSvc(inner);
1519 let codec = tonic::codec::ProstCodec::default();
1520 let mut grpc = tonic::server::Grpc::new(codec)
1521 .apply_compression_config(
1522 accept_compression_encodings,
1523 send_compression_encodings,
1524 )
1525 .apply_max_message_size_config(
1526 max_decoding_message_size,
1527 max_encoding_message_size,
1528 );
1529 let res = grpc.unary(method, req).await;
1530 Ok(res)
1531 };
1532 Box::pin(fut)
1533 }
1534 "/ddkrpc.DdkRpc/ListOracles" => {
1535 #[allow(non_camel_case_types)]
1536 struct ListOraclesSvc<T: DdkRpc>(pub Arc<T>);
1537 impl<
1538 T: DdkRpc,
1539 > tonic::server::UnaryService<super::ListOraclesRequest>
1540 for ListOraclesSvc<T> {
1541 type Response = super::ListOraclesResponse;
1542 type Future = BoxFuture<
1543 tonic::Response<Self::Response>,
1544 tonic::Status,
1545 >;
1546 fn call(
1547 &mut self,
1548 request: tonic::Request<super::ListOraclesRequest>,
1549 ) -> Self::Future {
1550 let inner = Arc::clone(&self.0);
1551 let fut = async move {
1552 <T as DdkRpc>::list_oracles(&inner, request).await
1553 };
1554 Box::pin(fut)
1555 }
1556 }
1557 let accept_compression_encodings = self.accept_compression_encodings;
1558 let send_compression_encodings = self.send_compression_encodings;
1559 let max_decoding_message_size = self.max_decoding_message_size;
1560 let max_encoding_message_size = self.max_encoding_message_size;
1561 let inner = self.inner.clone();
1562 let fut = async move {
1563 let inner = inner.0;
1564 let method = ListOraclesSvc(inner);
1565 let codec = tonic::codec::ProstCodec::default();
1566 let mut grpc = tonic::server::Grpc::new(codec)
1567 .apply_compression_config(
1568 accept_compression_encodings,
1569 send_compression_encodings,
1570 )
1571 .apply_max_message_size_config(
1572 max_decoding_message_size,
1573 max_encoding_message_size,
1574 );
1575 let res = grpc.unary(method, req).await;
1576 Ok(res)
1577 };
1578 Box::pin(fut)
1579 }
1580 "/ddkrpc.DdkRpc/ListContracts" => {
1581 #[allow(non_camel_case_types)]
1582 struct ListContractsSvc<T: DdkRpc>(pub Arc<T>);
1583 impl<
1584 T: DdkRpc,
1585 > tonic::server::UnaryService<super::ListContractsRequest>
1586 for ListContractsSvc<T> {
1587 type Response = super::ListContractsResponse;
1588 type Future = BoxFuture<
1589 tonic::Response<Self::Response>,
1590 tonic::Status,
1591 >;
1592 fn call(
1593 &mut self,
1594 request: tonic::Request<super::ListContractsRequest>,
1595 ) -> Self::Future {
1596 let inner = Arc::clone(&self.0);
1597 let fut = async move {
1598 <T as DdkRpc>::list_contracts(&inner, request).await
1599 };
1600 Box::pin(fut)
1601 }
1602 }
1603 let accept_compression_encodings = self.accept_compression_encodings;
1604 let send_compression_encodings = self.send_compression_encodings;
1605 let max_decoding_message_size = self.max_decoding_message_size;
1606 let max_encoding_message_size = self.max_encoding_message_size;
1607 let inner = self.inner.clone();
1608 let fut = async move {
1609 let inner = inner.0;
1610 let method = ListContractsSvc(inner);
1611 let codec = tonic::codec::ProstCodec::default();
1612 let mut grpc = tonic::server::Grpc::new(codec)
1613 .apply_compression_config(
1614 accept_compression_encodings,
1615 send_compression_encodings,
1616 )
1617 .apply_max_message_size_config(
1618 max_decoding_message_size,
1619 max_encoding_message_size,
1620 );
1621 let res = grpc.unary(method, req).await;
1622 Ok(res)
1623 };
1624 Box::pin(fut)
1625 }
1626 "/ddkrpc.DdkRpc/Send" => {
1627 #[allow(non_camel_case_types)]
1628 struct SendSvc<T: DdkRpc>(pub Arc<T>);
1629 impl<T: DdkRpc> tonic::server::UnaryService<super::SendRequest>
1630 for SendSvc<T> {
1631 type Response = super::SendResponse;
1632 type Future = BoxFuture<
1633 tonic::Response<Self::Response>,
1634 tonic::Status,
1635 >;
1636 fn call(
1637 &mut self,
1638 request: tonic::Request<super::SendRequest>,
1639 ) -> Self::Future {
1640 let inner = Arc::clone(&self.0);
1641 let fut = async move {
1642 <T as DdkRpc>::send(&inner, request).await
1643 };
1644 Box::pin(fut)
1645 }
1646 }
1647 let accept_compression_encodings = self.accept_compression_encodings;
1648 let send_compression_encodings = self.send_compression_encodings;
1649 let max_decoding_message_size = self.max_decoding_message_size;
1650 let max_encoding_message_size = self.max_encoding_message_size;
1651 let inner = self.inner.clone();
1652 let fut = async move {
1653 let inner = inner.0;
1654 let method = SendSvc(inner);
1655 let codec = tonic::codec::ProstCodec::default();
1656 let mut grpc = tonic::server::Grpc::new(codec)
1657 .apply_compression_config(
1658 accept_compression_encodings,
1659 send_compression_encodings,
1660 )
1661 .apply_max_message_size_config(
1662 max_decoding_message_size,
1663 max_encoding_message_size,
1664 );
1665 let res = grpc.unary(method, req).await;
1666 Ok(res)
1667 };
1668 Box::pin(fut)
1669 }
1670 "/ddkrpc.DdkRpc/OracleAnnouncements" => {
1671 #[allow(non_camel_case_types)]
1672 struct OracleAnnouncementsSvc<T: DdkRpc>(pub Arc<T>);
1673 impl<
1674 T: DdkRpc,
1675 > tonic::server::UnaryService<super::OracleAnnouncementsRequest>
1676 for OracleAnnouncementsSvc<T> {
1677 type Response = super::OracleAnnouncementsResponse;
1678 type Future = BoxFuture<
1679 tonic::Response<Self::Response>,
1680 tonic::Status,
1681 >;
1682 fn call(
1683 &mut self,
1684 request: tonic::Request<super::OracleAnnouncementsRequest>,
1685 ) -> Self::Future {
1686 let inner = Arc::clone(&self.0);
1687 let fut = async move {
1688 <T as DdkRpc>::oracle_announcements(&inner, request).await
1689 };
1690 Box::pin(fut)
1691 }
1692 }
1693 let accept_compression_encodings = self.accept_compression_encodings;
1694 let send_compression_encodings = self.send_compression_encodings;
1695 let max_decoding_message_size = self.max_decoding_message_size;
1696 let max_encoding_message_size = self.max_encoding_message_size;
1697 let inner = self.inner.clone();
1698 let fut = async move {
1699 let inner = inner.0;
1700 let method = OracleAnnouncementsSvc(inner);
1701 let codec = tonic::codec::ProstCodec::default();
1702 let mut grpc = tonic::server::Grpc::new(codec)
1703 .apply_compression_config(
1704 accept_compression_encodings,
1705 send_compression_encodings,
1706 )
1707 .apply_max_message_size_config(
1708 max_decoding_message_size,
1709 max_encoding_message_size,
1710 );
1711 let res = grpc.unary(method, req).await;
1712 Ok(res)
1713 };
1714 Box::pin(fut)
1715 }
1716 "/ddkrpc.DdkRpc/CreateEnum" => {
1717 #[allow(non_camel_case_types)]
1718 struct CreateEnumSvc<T: DdkRpc>(pub Arc<T>);
1719 impl<T: DdkRpc> tonic::server::UnaryService<super::CreateEnumRequest>
1720 for CreateEnumSvc<T> {
1721 type Response = super::CreateEnumResponse;
1722 type Future = BoxFuture<
1723 tonic::Response<Self::Response>,
1724 tonic::Status,
1725 >;
1726 fn call(
1727 &mut self,
1728 request: tonic::Request<super::CreateEnumRequest>,
1729 ) -> Self::Future {
1730 let inner = Arc::clone(&self.0);
1731 let fut = async move {
1732 <T as DdkRpc>::create_enum(&inner, request).await
1733 };
1734 Box::pin(fut)
1735 }
1736 }
1737 let accept_compression_encodings = self.accept_compression_encodings;
1738 let send_compression_encodings = self.send_compression_encodings;
1739 let max_decoding_message_size = self.max_decoding_message_size;
1740 let max_encoding_message_size = self.max_encoding_message_size;
1741 let inner = self.inner.clone();
1742 let fut = async move {
1743 let inner = inner.0;
1744 let method = CreateEnumSvc(inner);
1745 let codec = tonic::codec::ProstCodec::default();
1746 let mut grpc = tonic::server::Grpc::new(codec)
1747 .apply_compression_config(
1748 accept_compression_encodings,
1749 send_compression_encodings,
1750 )
1751 .apply_max_message_size_config(
1752 max_decoding_message_size,
1753 max_encoding_message_size,
1754 );
1755 let res = grpc.unary(method, req).await;
1756 Ok(res)
1757 };
1758 Box::pin(fut)
1759 }
1760 "/ddkrpc.DdkRpc/CreateNumeric" => {
1761 #[allow(non_camel_case_types)]
1762 struct CreateNumericSvc<T: DdkRpc>(pub Arc<T>);
1763 impl<
1764 T: DdkRpc,
1765 > tonic::server::UnaryService<super::CreateNumericRequest>
1766 for CreateNumericSvc<T> {
1767 type Response = super::CreateNumericResponse;
1768 type Future = BoxFuture<
1769 tonic::Response<Self::Response>,
1770 tonic::Status,
1771 >;
1772 fn call(
1773 &mut self,
1774 request: tonic::Request<super::CreateNumericRequest>,
1775 ) -> Self::Future {
1776 let inner = Arc::clone(&self.0);
1777 let fut = async move {
1778 <T as DdkRpc>::create_numeric(&inner, request).await
1779 };
1780 Box::pin(fut)
1781 }
1782 }
1783 let accept_compression_encodings = self.accept_compression_encodings;
1784 let send_compression_encodings = self.send_compression_encodings;
1785 let max_decoding_message_size = self.max_decoding_message_size;
1786 let max_encoding_message_size = self.max_encoding_message_size;
1787 let inner = self.inner.clone();
1788 let fut = async move {
1789 let inner = inner.0;
1790 let method = CreateNumericSvc(inner);
1791 let codec = tonic::codec::ProstCodec::default();
1792 let mut grpc = tonic::server::Grpc::new(codec)
1793 .apply_compression_config(
1794 accept_compression_encodings,
1795 send_compression_encodings,
1796 )
1797 .apply_max_message_size_config(
1798 max_decoding_message_size,
1799 max_encoding_message_size,
1800 );
1801 let res = grpc.unary(method, req).await;
1802 Ok(res)
1803 };
1804 Box::pin(fut)
1805 }
1806 "/ddkrpc.DdkRpc/SignAnnouncement" => {
1807 #[allow(non_camel_case_types)]
1808 struct SignAnnouncementSvc<T: DdkRpc>(pub Arc<T>);
1809 impl<T: DdkRpc> tonic::server::UnaryService<super::SignRequest>
1810 for SignAnnouncementSvc<T> {
1811 type Response = super::SignResponse;
1812 type Future = BoxFuture<
1813 tonic::Response<Self::Response>,
1814 tonic::Status,
1815 >;
1816 fn call(
1817 &mut self,
1818 request: tonic::Request<super::SignRequest>,
1819 ) -> Self::Future {
1820 let inner = Arc::clone(&self.0);
1821 let fut = async move {
1822 <T as DdkRpc>::sign_announcement(&inner, request).await
1823 };
1824 Box::pin(fut)
1825 }
1826 }
1827 let accept_compression_encodings = self.accept_compression_encodings;
1828 let send_compression_encodings = self.send_compression_encodings;
1829 let max_decoding_message_size = self.max_decoding_message_size;
1830 let max_encoding_message_size = self.max_encoding_message_size;
1831 let inner = self.inner.clone();
1832 let fut = async move {
1833 let inner = inner.0;
1834 let method = SignAnnouncementSvc(inner);
1835 let codec = tonic::codec::ProstCodec::default();
1836 let mut grpc = tonic::server::Grpc::new(codec)
1837 .apply_compression_config(
1838 accept_compression_encodings,
1839 send_compression_encodings,
1840 )
1841 .apply_max_message_size_config(
1842 max_decoding_message_size,
1843 max_encoding_message_size,
1844 );
1845 let res = grpc.unary(method, req).await;
1846 Ok(res)
1847 };
1848 Box::pin(fut)
1849 }
1850 _ => {
1851 Box::pin(async move {
1852 Ok(
1853 http::Response::builder()
1854 .status(200)
1855 .header("grpc-status", "12")
1856 .header("content-type", "application/grpc")
1857 .body(empty_body())
1858 .unwrap(),
1859 )
1860 })
1861 }
1862 }
1863 }
1864 }
1865 impl<T: DdkRpc> Clone for DdkRpcServer<T> {
1866 fn clone(&self) -> Self {
1867 let inner = self.inner.clone();
1868 Self {
1869 inner,
1870 accept_compression_encodings: self.accept_compression_encodings,
1871 send_compression_encodings: self.send_compression_encodings,
1872 max_decoding_message_size: self.max_decoding_message_size,
1873 max_encoding_message_size: self.max_encoding_message_size,
1874 }
1875 }
1876 }
1877 impl<T: DdkRpc> Clone for _Inner<T> {
1878 fn clone(&self) -> Self {
1879 Self(Arc::clone(&self.0))
1880 }
1881 }
1882 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
1883 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1884 write!(f, "{:?}", self.0)
1885 }
1886 }
1887 impl<T: DdkRpc> tonic::server::NamedService for DdkRpcServer<T> {
1888 const NAME: &'static str = "ddkrpc.DdkRpc";
1889 }
1890}