1pub type OwnedCreateTradingWithdrawRequestView = ::buffa::view::OwnedView<
5 crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawRequestView<
6 'static,
7 >,
8>;
9pub type OwnedCreateTradingWithdrawResponseView = ::buffa::view::OwnedView<
11 crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawResponseView<
12 'static,
13 >,
14>;
15pub type OwnedCreateWalletTradingWithdrawRequestView = ::buffa::view::OwnedView<
17 crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawRequestView<
18 'static,
19 >,
20>;
21pub type OwnedCreateWalletTradingWithdrawResponseView = ::buffa::view::OwnedView<
23 crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawResponseView<
24 'static,
25 >,
26>;
27impl ::connectrpc::Encodable<
28 crate::proto::chain::withdraw::v1::CreateTradingWithdrawResponse,
29>
30for crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawResponseView<
31 '_,
32> {
33 fn encode(
34 &self,
35 codec: ::connectrpc::CodecFormat,
36 ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
37 ::connectrpc::__codegen::encode_view_body(self, codec)
38 }
39}
40impl ::connectrpc::Encodable<
41 crate::proto::chain::withdraw::v1::CreateTradingWithdrawResponse,
42>
43for ::buffa::view::OwnedView<
44 crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawResponseView<
45 'static,
46 >,
47> {
48 fn encode(
49 &self,
50 codec: ::connectrpc::CodecFormat,
51 ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
52 ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
53 }
54}
55impl ::connectrpc::Encodable<
56 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
57>
58for crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawResponseView<
59 '_,
60> {
61 fn encode(
62 &self,
63 codec: ::connectrpc::CodecFormat,
64 ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
65 ::connectrpc::__codegen::encode_view_body(self, codec)
66 }
67}
68impl ::connectrpc::Encodable<
69 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
70>
71for ::buffa::view::OwnedView<
72 crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawResponseView<
73 'static,
74 >,
75> {
76 fn encode(
77 &self,
78 codec: ::connectrpc::CodecFormat,
79 ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
80 ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
81 }
82}
83pub const WITHDRAW_SERVICE_SERVICE_NAME: &str = "chain.withdraw.v1.WithdrawService";
85pub const WITHDRAW_SERVICE_CREATE_TRADING_WITHDRAW_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
90 "/chain.withdraw.v1.WithdrawService/CreateTradingWithdraw",
91 ::connectrpc::StreamType::Unary,
92 )
93 .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
94pub const WITHDRAW_SERVICE_CREATE_WALLET_TRADING_WITHDRAW_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
99 "/chain.withdraw.v1.WithdrawService/CreateWalletTradingWithdraw",
100 ::connectrpc::StreamType::Unary,
101 )
102 .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
103#[allow(clippy::type_complexity)]
153pub trait WithdrawService: Send + Sync + 'static {
154 fn create_trading_withdraw<'a>(
164 &'a self,
165 ctx: ::connectrpc::RequestContext,
166 request: ::connectrpc::ServiceRequest<
167 '_,
168 crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
169 >,
170 ) -> impl ::std::future::Future<
171 Output = ::connectrpc::ServiceResult<
172 impl ::connectrpc::Encodable<
173 crate::proto::chain::withdraw::v1::CreateTradingWithdrawResponse,
174 > + Send + use<'a, Self>,
175 >,
176 > + Send;
177 fn create_wallet_trading_withdraw<'a>(
189 &'a self,
190 ctx: ::connectrpc::RequestContext,
191 request: ::connectrpc::ServiceRequest<
192 '_,
193 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
194 >,
195 ) -> impl ::std::future::Future<
196 Output = ::connectrpc::ServiceResult<
197 impl ::connectrpc::Encodable<
198 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
199 > + Send + use<'a, Self>,
200 >,
201 > + Send;
202}
203pub trait WithdrawServiceExt: WithdrawService {
219 fn register(
224 self: ::std::sync::Arc<Self>,
225 router: ::connectrpc::Router,
226 ) -> ::connectrpc::Router;
227}
228impl<S: WithdrawService> WithdrawServiceExt for S {
229 fn register(
230 self: ::std::sync::Arc<Self>,
231 router: ::connectrpc::Router,
232 ) -> ::connectrpc::Router {
233 router
234 .route_view(
235 WITHDRAW_SERVICE_SERVICE_NAME,
236 "CreateTradingWithdraw",
237 {
238 let svc = ::std::sync::Arc::clone(&self);
239 ::connectrpc::view_handler_fn(move |
240 ctx,
241 req: ::buffa::view::OwnedView<
242 crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawRequestView<
243 'static,
244 >,
245 >,
246 format|
247 {
248 let svc = ::std::sync::Arc::clone(&svc);
249 async move {
250 let sreq = ::connectrpc::ServiceRequest::<
251 crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
252 >::from_parts(req.reborrow(), req.bytes());
253 svc.create_trading_withdraw(ctx, sreq)
254 .await?
255 .encode::<
256 crate::proto::chain::withdraw::v1::CreateTradingWithdrawResponse,
257 >(format)
258 }
259 })
260 },
261 )
262 .with_spec(WITHDRAW_SERVICE_CREATE_TRADING_WITHDRAW_SPEC)
263 .route_view(
264 WITHDRAW_SERVICE_SERVICE_NAME,
265 "CreateWalletTradingWithdraw",
266 {
267 let svc = ::std::sync::Arc::clone(&self);
268 ::connectrpc::view_handler_fn(move |
269 ctx,
270 req: ::buffa::view::OwnedView<
271 crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawRequestView<
272 'static,
273 >,
274 >,
275 format|
276 {
277 let svc = ::std::sync::Arc::clone(&svc);
278 async move {
279 let sreq = ::connectrpc::ServiceRequest::<
280 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
281 >::from_parts(req.reborrow(), req.bytes());
282 svc.create_wallet_trading_withdraw(ctx, sreq)
283 .await?
284 .encode::<
285 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
286 >(format)
287 }
288 })
289 },
290 )
291 .with_spec(WITHDRAW_SERVICE_CREATE_WALLET_TRADING_WITHDRAW_SPEC)
292 }
293}
294#[doc(hidden)]
296pub struct WithdrawServiceRegisterMarker;
297impl<S: WithdrawService> ::connectrpc::ServiceRegister<WithdrawServiceRegisterMarker>
298for ::std::sync::Arc<S> {
299 fn register_service(self, router: ::connectrpc::Router) -> ::connectrpc::Router {
300 <S as WithdrawServiceExt>::register(self, router)
301 }
302}
303pub struct WithdrawServiceServer<T> {
317 inner: ::std::sync::Arc<T>,
318}
319impl<T: WithdrawService> WithdrawServiceServer<T> {
320 pub fn new(service: T) -> Self {
322 Self {
323 inner: ::std::sync::Arc::new(service),
324 }
325 }
326 pub fn from_arc(inner: ::std::sync::Arc<T>) -> Self {
328 Self { inner }
329 }
330}
331impl<T> Clone for WithdrawServiceServer<T> {
332 fn clone(&self) -> Self {
333 Self {
334 inner: ::std::sync::Arc::clone(&self.inner),
335 }
336 }
337}
338impl<T: WithdrawService> ::connectrpc::Dispatcher for WithdrawServiceServer<T> {
339 #[inline]
340 fn lookup(
341 &self,
342 path: &str,
343 ) -> Option<::connectrpc::dispatcher::codegen::MethodDescriptor> {
344 let method = path.strip_prefix("chain.withdraw.v1.WithdrawService/")?;
345 match method {
346 "CreateTradingWithdraw" => {
347 Some(
348 ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
349 .with_spec(WITHDRAW_SERVICE_CREATE_TRADING_WITHDRAW_SPEC),
350 )
351 }
352 "CreateWalletTradingWithdraw" => {
353 Some(
354 ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
355 .with_spec(WITHDRAW_SERVICE_CREATE_WALLET_TRADING_WITHDRAW_SPEC),
356 )
357 }
358 _ => None,
359 }
360 }
361 fn call_unary(
362 &self,
363 path: &str,
364 ctx: ::connectrpc::RequestContext,
365 request: ::connectrpc::Payload,
366 format: ::connectrpc::CodecFormat,
367 ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
368 let Some(method) = path.strip_prefix("chain.withdraw.v1.WithdrawService/") else {
369 return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
370 };
371 let _ = (&ctx, &request, &format);
372 match method {
373 "CreateTradingWithdraw" => {
374 let svc = ::std::sync::Arc::clone(&self.inner);
375 Box::pin(async move {
376 let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
377 crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
378 >(request.encoded()?, format)?;
379 let req: crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawRequestView<
380 '_,
381 > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
382 &body,
383 )?;
384 let req = ::connectrpc::ServiceRequest::<
385 crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
386 >::from_parts(&req, &body);
387 svc.create_trading_withdraw(ctx, req)
388 .await?
389 .encode::<
390 crate::proto::chain::withdraw::v1::CreateTradingWithdrawResponse,
391 >(format)
392 })
393 }
394 "CreateWalletTradingWithdraw" => {
395 let svc = ::std::sync::Arc::clone(&self.inner);
396 Box::pin(async move {
397 let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
398 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
399 >(request.encoded()?, format)?;
400 let req: crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawRequestView<
401 '_,
402 > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
403 &body,
404 )?;
405 let req = ::connectrpc::ServiceRequest::<
406 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
407 >::from_parts(&req, &body);
408 svc.create_wallet_trading_withdraw(ctx, req)
409 .await?
410 .encode::<
411 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
412 >(format)
413 })
414 }
415 _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
416 }
417 }
418 fn call_server_streaming(
419 &self,
420 path: &str,
421 ctx: ::connectrpc::RequestContext,
422 request: ::buffa::bytes::Bytes,
423 format: ::connectrpc::CodecFormat,
424 ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
425 let Some(method) = path.strip_prefix("chain.withdraw.v1.WithdrawService/") else {
426 return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
427 };
428 let _ = (&ctx, &request, &format);
429 match method {
430 _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
431 }
432 }
433 fn call_client_streaming(
434 &self,
435 path: &str,
436 ctx: ::connectrpc::RequestContext,
437 requests: ::connectrpc::dispatcher::codegen::RequestStream,
438 format: ::connectrpc::CodecFormat,
439 ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
440 let Some(method) = path.strip_prefix("chain.withdraw.v1.WithdrawService/") else {
441 return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
442 };
443 let _ = (&ctx, &requests, &format);
444 match method {
445 _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
446 }
447 }
448 fn call_bidi_streaming(
449 &self,
450 path: &str,
451 ctx: ::connectrpc::RequestContext,
452 requests: ::connectrpc::dispatcher::codegen::RequestStream,
453 format: ::connectrpc::CodecFormat,
454 ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
455 let Some(method) = path.strip_prefix("chain.withdraw.v1.WithdrawService/") else {
456 return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
457 };
458 let _ = (&ctx, &requests, &format);
459 match method {
460 _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
461 }
462 }
463}
464#[derive(Clone)]
496pub struct WithdrawServiceClient<T> {
497 transport: T,
498 config: ::connectrpc::client::ClientConfig,
499}
500impl<T> WithdrawServiceClient<T>
501where
502 T: ::connectrpc::client::ClientTransport,
503 <T::ResponseBody as ::connectrpc::http_body::Body>::Error: ::std::fmt::Display,
504{
505 pub fn new(transport: T, config: ::connectrpc::client::ClientConfig) -> Self {
507 Self { transport, config }
508 }
509 pub fn config(&self) -> &::connectrpc::client::ClientConfig {
511 &self.config
512 }
513 pub fn config_mut(&mut self) -> &mut ::connectrpc::client::ClientConfig {
515 &mut self.config
516 }
517 pub async fn create_trading_withdraw(
519 &self,
520 request: crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
521 ) -> Result<
522 ::connectrpc::client::UnaryResponse<
523 ::buffa::view::OwnedView<
524 crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawResponseView<
525 'static,
526 >,
527 >,
528 >,
529 ::connectrpc::ConnectError,
530 > {
531 self.create_trading_withdraw_with_options(
532 request,
533 ::connectrpc::client::CallOptions::default(),
534 )
535 .await
536 }
537 pub async fn create_trading_withdraw_with_options(
539 &self,
540 request: crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
541 options: ::connectrpc::client::CallOptions,
542 ) -> Result<
543 ::connectrpc::client::UnaryResponse<
544 ::buffa::view::OwnedView<
545 crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawResponseView<
546 'static,
547 >,
548 >,
549 >,
550 ::connectrpc::ConnectError,
551 > {
552 ::connectrpc::client::call_unary(
553 &self.transport,
554 &self.config,
555 WITHDRAW_SERVICE_SERVICE_NAME,
556 "CreateTradingWithdraw",
557 request,
558 options,
559 )
560 .await
561 }
562 pub async fn create_wallet_trading_withdraw(
564 &self,
565 request: crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
566 ) -> Result<
567 ::connectrpc::client::UnaryResponse<
568 ::buffa::view::OwnedView<
569 crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawResponseView<
570 'static,
571 >,
572 >,
573 >,
574 ::connectrpc::ConnectError,
575 > {
576 self.create_wallet_trading_withdraw_with_options(
577 request,
578 ::connectrpc::client::CallOptions::default(),
579 )
580 .await
581 }
582 pub async fn create_wallet_trading_withdraw_with_options(
584 &self,
585 request: crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
586 options: ::connectrpc::client::CallOptions,
587 ) -> Result<
588 ::connectrpc::client::UnaryResponse<
589 ::buffa::view::OwnedView<
590 crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawResponseView<
591 'static,
592 >,
593 >,
594 >,
595 ::connectrpc::ConnectError,
596 > {
597 ::connectrpc::client::call_unary(
598 &self.transport,
599 &self.config,
600 WITHDRAW_SERVICE_SERVICE_NAME,
601 "CreateWalletTradingWithdraw",
602 request,
603 options,
604 )
605 .await
606 }
607}