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>(
187 &'a self,
188 ctx: ::connectrpc::RequestContext,
189 request: ::connectrpc::ServiceRequest<
190 '_,
191 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
192 >,
193 ) -> impl ::std::future::Future<
194 Output = ::connectrpc::ServiceResult<
195 impl ::connectrpc::Encodable<
196 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
197 > + Send + use<'a, Self>,
198 >,
199 > + Send;
200}
201pub trait WithdrawServiceExt: WithdrawService {
217 fn register(
222 self: ::std::sync::Arc<Self>,
223 router: ::connectrpc::Router,
224 ) -> ::connectrpc::Router;
225}
226impl<S: WithdrawService> WithdrawServiceExt for S {
227 fn register(
228 self: ::std::sync::Arc<Self>,
229 router: ::connectrpc::Router,
230 ) -> ::connectrpc::Router {
231 router
232 .route_view(
233 WITHDRAW_SERVICE_SERVICE_NAME,
234 "CreateTradingWithdraw",
235 {
236 let svc = ::std::sync::Arc::clone(&self);
237 ::connectrpc::view_handler_fn(move |
238 ctx,
239 req: ::buffa::view::OwnedView<
240 crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawRequestView<
241 'static,
242 >,
243 >,
244 format|
245 {
246 let svc = ::std::sync::Arc::clone(&svc);
247 async move {
248 let sreq = ::connectrpc::ServiceRequest::<
249 crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
250 >::from_parts(req.reborrow(), req.bytes());
251 svc.create_trading_withdraw(ctx, sreq)
252 .await?
253 .encode::<
254 crate::proto::chain::withdraw::v1::CreateTradingWithdrawResponse,
255 >(format)
256 }
257 })
258 },
259 )
260 .with_spec(WITHDRAW_SERVICE_CREATE_TRADING_WITHDRAW_SPEC)
261 .route_view(
262 WITHDRAW_SERVICE_SERVICE_NAME,
263 "CreateWalletTradingWithdraw",
264 {
265 let svc = ::std::sync::Arc::clone(&self);
266 ::connectrpc::view_handler_fn(move |
267 ctx,
268 req: ::buffa::view::OwnedView<
269 crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawRequestView<
270 'static,
271 >,
272 >,
273 format|
274 {
275 let svc = ::std::sync::Arc::clone(&svc);
276 async move {
277 let sreq = ::connectrpc::ServiceRequest::<
278 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
279 >::from_parts(req.reborrow(), req.bytes());
280 svc.create_wallet_trading_withdraw(ctx, sreq)
281 .await?
282 .encode::<
283 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
284 >(format)
285 }
286 })
287 },
288 )
289 .with_spec(WITHDRAW_SERVICE_CREATE_WALLET_TRADING_WITHDRAW_SPEC)
290 }
291}
292#[doc(hidden)]
294pub struct WithdrawServiceRegisterMarker;
295impl<S: WithdrawService> ::connectrpc::ServiceRegister<WithdrawServiceRegisterMarker>
296for ::std::sync::Arc<S> {
297 fn register_service(self, router: ::connectrpc::Router) -> ::connectrpc::Router {
298 <S as WithdrawServiceExt>::register(self, router)
299 }
300}
301pub struct WithdrawServiceServer<T> {
315 inner: ::std::sync::Arc<T>,
316}
317impl<T: WithdrawService> WithdrawServiceServer<T> {
318 pub fn new(service: T) -> Self {
320 Self {
321 inner: ::std::sync::Arc::new(service),
322 }
323 }
324 pub fn from_arc(inner: ::std::sync::Arc<T>) -> Self {
326 Self { inner }
327 }
328}
329impl<T> Clone for WithdrawServiceServer<T> {
330 fn clone(&self) -> Self {
331 Self {
332 inner: ::std::sync::Arc::clone(&self.inner),
333 }
334 }
335}
336impl<T: WithdrawService> ::connectrpc::Dispatcher for WithdrawServiceServer<T> {
337 #[inline]
338 fn lookup(
339 &self,
340 path: &str,
341 ) -> Option<::connectrpc::dispatcher::codegen::MethodDescriptor> {
342 let method = path.strip_prefix("chain.withdraw.v1.WithdrawService/")?;
343 match method {
344 "CreateTradingWithdraw" => {
345 Some(
346 ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
347 .with_spec(WITHDRAW_SERVICE_CREATE_TRADING_WITHDRAW_SPEC),
348 )
349 }
350 "CreateWalletTradingWithdraw" => {
351 Some(
352 ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
353 .with_spec(WITHDRAW_SERVICE_CREATE_WALLET_TRADING_WITHDRAW_SPEC),
354 )
355 }
356 _ => None,
357 }
358 }
359 fn call_unary(
360 &self,
361 path: &str,
362 ctx: ::connectrpc::RequestContext,
363 request: ::connectrpc::Payload,
364 format: ::connectrpc::CodecFormat,
365 ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
366 let Some(method) = path.strip_prefix("chain.withdraw.v1.WithdrawService/") else {
367 return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
368 };
369 let _ = (&ctx, &request, &format);
370 match method {
371 "CreateTradingWithdraw" => {
372 let svc = ::std::sync::Arc::clone(&self.inner);
373 Box::pin(async move {
374 let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
375 crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
376 >(request.encoded()?, format)?;
377 let req: crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawRequestView<
378 '_,
379 > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
380 &body,
381 )?;
382 let req = ::connectrpc::ServiceRequest::<
383 crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
384 >::from_parts(&req, &body);
385 svc.create_trading_withdraw(ctx, req)
386 .await?
387 .encode::<
388 crate::proto::chain::withdraw::v1::CreateTradingWithdrawResponse,
389 >(format)
390 })
391 }
392 "CreateWalletTradingWithdraw" => {
393 let svc = ::std::sync::Arc::clone(&self.inner);
394 Box::pin(async move {
395 let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
396 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
397 >(request.encoded()?, format)?;
398 let req: crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawRequestView<
399 '_,
400 > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
401 &body,
402 )?;
403 let req = ::connectrpc::ServiceRequest::<
404 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
405 >::from_parts(&req, &body);
406 svc.create_wallet_trading_withdraw(ctx, req)
407 .await?
408 .encode::<
409 crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
410 >(format)
411 })
412 }
413 _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
414 }
415 }
416 fn call_server_streaming(
417 &self,
418 path: &str,
419 ctx: ::connectrpc::RequestContext,
420 request: ::buffa::bytes::Bytes,
421 format: ::connectrpc::CodecFormat,
422 ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
423 let Some(method) = path.strip_prefix("chain.withdraw.v1.WithdrawService/") else {
424 return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
425 };
426 let _ = (&ctx, &request, &format);
427 match method {
428 _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
429 }
430 }
431 fn call_client_streaming(
432 &self,
433 path: &str,
434 ctx: ::connectrpc::RequestContext,
435 requests: ::connectrpc::dispatcher::codegen::RequestStream,
436 format: ::connectrpc::CodecFormat,
437 ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
438 let Some(method) = path.strip_prefix("chain.withdraw.v1.WithdrawService/") else {
439 return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
440 };
441 let _ = (&ctx, &requests, &format);
442 match method {
443 _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
444 }
445 }
446 fn call_bidi_streaming(
447 &self,
448 path: &str,
449 ctx: ::connectrpc::RequestContext,
450 requests: ::connectrpc::dispatcher::codegen::RequestStream,
451 format: ::connectrpc::CodecFormat,
452 ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
453 let Some(method) = path.strip_prefix("chain.withdraw.v1.WithdrawService/") else {
454 return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
455 };
456 let _ = (&ctx, &requests, &format);
457 match method {
458 _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
459 }
460 }
461}
462#[derive(Clone)]
494pub struct WithdrawServiceClient<T> {
495 transport: T,
496 config: ::connectrpc::client::ClientConfig,
497}
498impl<T> WithdrawServiceClient<T>
499where
500 T: ::connectrpc::client::ClientTransport,
501 <T::ResponseBody as ::connectrpc::http_body::Body>::Error: ::std::fmt::Display,
502{
503 pub fn new(transport: T, config: ::connectrpc::client::ClientConfig) -> Self {
505 Self { transport, config }
506 }
507 pub fn config(&self) -> &::connectrpc::client::ClientConfig {
509 &self.config
510 }
511 pub fn config_mut(&mut self) -> &mut ::connectrpc::client::ClientConfig {
513 &mut self.config
514 }
515 pub async fn create_trading_withdraw(
517 &self,
518 request: crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
519 ) -> Result<
520 ::connectrpc::client::UnaryResponse<
521 ::buffa::view::OwnedView<
522 crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawResponseView<
523 'static,
524 >,
525 >,
526 >,
527 ::connectrpc::ConnectError,
528 > {
529 self.create_trading_withdraw_with_options(
530 request,
531 ::connectrpc::client::CallOptions::default(),
532 )
533 .await
534 }
535 pub async fn create_trading_withdraw_with_options(
537 &self,
538 request: crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
539 options: ::connectrpc::client::CallOptions,
540 ) -> Result<
541 ::connectrpc::client::UnaryResponse<
542 ::buffa::view::OwnedView<
543 crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawResponseView<
544 'static,
545 >,
546 >,
547 >,
548 ::connectrpc::ConnectError,
549 > {
550 ::connectrpc::client::call_unary(
551 &self.transport,
552 &self.config,
553 WITHDRAW_SERVICE_SERVICE_NAME,
554 "CreateTradingWithdraw",
555 request,
556 options,
557 )
558 .await
559 }
560 pub async fn create_wallet_trading_withdraw(
562 &self,
563 request: crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
564 ) -> Result<
565 ::connectrpc::client::UnaryResponse<
566 ::buffa::view::OwnedView<
567 crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawResponseView<
568 'static,
569 >,
570 >,
571 >,
572 ::connectrpc::ConnectError,
573 > {
574 self.create_wallet_trading_withdraw_with_options(
575 request,
576 ::connectrpc::client::CallOptions::default(),
577 )
578 .await
579 }
580 pub async fn create_wallet_trading_withdraw_with_options(
582 &self,
583 request: crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
584 options: ::connectrpc::client::CallOptions,
585 ) -> Result<
586 ::connectrpc::client::UnaryResponse<
587 ::buffa::view::OwnedView<
588 crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawResponseView<
589 'static,
590 >,
591 >,
592 >,
593 ::connectrpc::ConnectError,
594 > {
595 ::connectrpc::client::call_unary(
596 &self.transport,
597 &self.config,
598 WITHDRAW_SERVICE_SERVICE_NAME,
599 "CreateWalletTradingWithdraw",
600 request,
601 options,
602 )
603 .await
604 }
605}