Skip to main content

polyester/gen/connect/
chain.withdraw.v1.rs

1// @generated by connectrpc-codegen. DO NOT EDIT.
2
3///Shorthand for `OwnedView<ValidateWithdrawDestinationRequestView<'static>>`.
4pub type OwnedValidateWithdrawDestinationRequestView = ::buffa::view::OwnedView<
5    crate::proto::chain::withdraw::v1::__buffa::view::ValidateWithdrawDestinationRequestView<
6        'static,
7    >,
8>;
9///Shorthand for `OwnedView<ValidateWithdrawDestinationResponseView<'static>>`.
10pub type OwnedValidateWithdrawDestinationResponseView = ::buffa::view::OwnedView<
11    crate::proto::chain::withdraw::v1::__buffa::view::ValidateWithdrawDestinationResponseView<
12        'static,
13    >,
14>;
15///Shorthand for `OwnedView<CreateTradingWithdrawRequestView<'static>>`.
16pub type OwnedCreateTradingWithdrawRequestView = ::buffa::view::OwnedView<
17    crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawRequestView<
18        'static,
19    >,
20>;
21///Shorthand for `OwnedView<CreateTradingWithdrawResponseView<'static>>`.
22pub type OwnedCreateTradingWithdrawResponseView = ::buffa::view::OwnedView<
23    crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawResponseView<
24        'static,
25    >,
26>;
27///Shorthand for `OwnedView<CreateWalletTradingWithdrawRequestView<'static>>`.
28pub type OwnedCreateWalletTradingWithdrawRequestView = ::buffa::view::OwnedView<
29    crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawRequestView<
30        'static,
31    >,
32>;
33///Shorthand for `OwnedView<CreateWalletTradingWithdrawResponseView<'static>>`.
34pub type OwnedCreateWalletTradingWithdrawResponseView = ::buffa::view::OwnedView<
35    crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawResponseView<
36        'static,
37    >,
38>;
39impl ::connectrpc::Encodable<
40    crate::proto::chain::withdraw::v1::ValidateWithdrawDestinationResponse,
41>
42for crate::proto::chain::withdraw::v1::__buffa::view::ValidateWithdrawDestinationResponseView<
43    '_,
44> {
45    fn encode(
46        &self,
47        codec: ::connectrpc::CodecFormat,
48    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
49        ::connectrpc::__codegen::encode_view_body(self, codec)
50    }
51}
52impl ::connectrpc::Encodable<
53    crate::proto::chain::withdraw::v1::ValidateWithdrawDestinationResponse,
54>
55for ::buffa::view::OwnedView<
56    crate::proto::chain::withdraw::v1::__buffa::view::ValidateWithdrawDestinationResponseView<
57        'static,
58    >,
59> {
60    fn encode(
61        &self,
62        codec: ::connectrpc::CodecFormat,
63    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
64        ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
65    }
66}
67impl ::connectrpc::Encodable<
68    crate::proto::chain::withdraw::v1::CreateTradingWithdrawResponse,
69>
70for crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawResponseView<
71    '_,
72> {
73    fn encode(
74        &self,
75        codec: ::connectrpc::CodecFormat,
76    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
77        ::connectrpc::__codegen::encode_view_body(self, codec)
78    }
79}
80impl ::connectrpc::Encodable<
81    crate::proto::chain::withdraw::v1::CreateTradingWithdrawResponse,
82>
83for ::buffa::view::OwnedView<
84    crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawResponseView<
85        'static,
86    >,
87> {
88    fn encode(
89        &self,
90        codec: ::connectrpc::CodecFormat,
91    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
92        ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
93    }
94}
95impl ::connectrpc::Encodable<
96    crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
97>
98for crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawResponseView<
99    '_,
100> {
101    fn encode(
102        &self,
103        codec: ::connectrpc::CodecFormat,
104    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
105        ::connectrpc::__codegen::encode_view_body(self, codec)
106    }
107}
108impl ::connectrpc::Encodable<
109    crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
110>
111for ::buffa::view::OwnedView<
112    crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawResponseView<
113        'static,
114    >,
115> {
116    fn encode(
117        &self,
118        codec: ::connectrpc::CodecFormat,
119    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
120        ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
121    }
122}
123/// Full service name for this service.
124pub const WITHDRAW_SERVICE_SERVICE_NAME: &str = "chain.withdraw.v1.WithdrawService";
125/// Static [`Spec`](::connectrpc::Spec) for the server-side `ValidateWithdrawDestination` RPC.
126///
127/// The dispatcher surfaces this on
128/// [`RequestContext::spec`](::connectrpc::RequestContext::spec).
129pub const WITHDRAW_SERVICE_VALIDATE_WITHDRAW_DESTINATION_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
130        "/chain.withdraw.v1.WithdrawService/ValidateWithdrawDestination",
131        ::connectrpc::StreamType::Unary,
132    )
133    .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
134/// Static [`Spec`](::connectrpc::Spec) for the server-side `CreateTradingWithdraw` RPC.
135///
136/// The dispatcher surfaces this on
137/// [`RequestContext::spec`](::connectrpc::RequestContext::spec).
138pub const WITHDRAW_SERVICE_CREATE_TRADING_WITHDRAW_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
139        "/chain.withdraw.v1.WithdrawService/CreateTradingWithdraw",
140        ::connectrpc::StreamType::Unary,
141    )
142    .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
143/// Static [`Spec`](::connectrpc::Spec) for the server-side `CreateWalletTradingWithdraw` RPC.
144///
145/// The dispatcher surfaces this on
146/// [`RequestContext::spec`](::connectrpc::RequestContext::spec).
147pub const WITHDRAW_SERVICE_CREATE_WALLET_TRADING_WITHDRAW_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
148        "/chain.withdraw.v1.WithdrawService/CreateWalletTradingWithdraw",
149        ::connectrpc::StreamType::Unary,
150    )
151    .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
152/// WithdrawService manages authenticated chain-facing withdraw request intake.
153///
154/// # Implementing handlers
155///
156/// Implement methods with plain `async fn`; the returned future satisfies
157/// the `Send` bound automatically.
158///
159/// **Unary and server-streaming requests** arrive as
160/// [`ServiceRequest<'_, Req>`](::connectrpc::ServiceRequest): a zero-copy
161/// view of the request plus its body, valid for the duration of the call.
162/// Fields are read directly (`request.name` is a `&str` into the decoded
163/// buffer) and the borrow may be held across `.await` points. Anything
164/// that must outlive the call — `tokio::spawn`, channels, server state,
165/// or data captured by a returned response stream — takes owned data:
166/// call `request.to_owned_message()` (or copy the specific fields)
167/// first.
168///
169/// **Client-streaming and bidi requests** arrive as
170/// [`InboundStream<Req>`](::connectrpc::InboundStream) — a
171/// `ServiceStream` of [`StreamMessage`](::connectrpc::StreamMessage)s.
172/// Each item owns its decoded buffer and is `Send + 'static`, so items
173/// can be buffered or moved into spawned tasks; read fields zero-copy
174/// through the generated accessor methods (`item.name()`) or `.view()`,
175/// convert with `.to_owned_message()`, or yield an item back unchanged —
176/// `StreamMessage<M>` implements `Encodable<M>`.
177///
178/// Request types resolved through `extern_path` (e.g. well-known types
179/// from another crate) use the same wrappers; the crate that owns the
180/// type must be generated with buffa ≥ 0.8.0 and views enabled so the
181/// backing `HasMessageView` impl exists.
182///
183/// The `impl Encodable<Out>` return bound accepts the owned `Out`, the
184/// generated `OutView<'_>` / `OwnedOutView`,
185/// [`MaybeBorrowed`](::connectrpc::MaybeBorrowed), or
186/// [`PreEncoded`](::connectrpc::PreEncoded) for handlers that encode a
187/// non-`'static` view internally and pass the bytes across the handler
188/// boundary. View bodies are not emitted for output types mapped via
189/// `extern_path` (the impl would be an orphan); return owned for
190/// WKT/extern outputs.
191///
192/// Server-streaming and bidi-streaming methods return
193/// `ServiceStream<impl Encodable<Out> + Send + use<Self>>`. The
194/// `use<Self>` precise-capturing clause excludes `&self`'s lifetime and
195/// the request's lifetime (unary methods use `use<'a, Self>` and may
196/// borrow from `&self`), so stream items must be `'static` and cannot
197/// borrow from the request. To stream view-encoded data, encode each
198/// item inside the stream body and yield
199/// [`PreEncoded`](::connectrpc::PreEncoded) — see its `# Streaming
200/// example` doc.
201#[allow(clippy::type_complexity)]
202pub trait WithdrawService: Send + Sync + 'static {
203    /// Validate an external-chain withdraw destination for an authenticated
204    /// caller without creating, signing, or reserving a withdraw.
205    ///
206    /// `'a` lets the response body borrow from `&self` (e.g. server-resident state).
207    ///
208    /// `request` is borrowed from the request body and is valid for the
209    /// duration of the call; message fields are read directly on it
210    /// (zero-copy). The response cannot borrow from `request` — use
211    /// `.to_owned_message()` (or copy the specific fields) for anything
212    /// returned, stored, or moved into `tokio::spawn`.
213    fn validate_withdraw_destination<'a>(
214        &'a self,
215        ctx: ::connectrpc::RequestContext,
216        request: ::connectrpc::ServiceRequest<
217            '_,
218            crate::proto::chain::withdraw::v1::ValidateWithdrawDestinationRequest,
219        >,
220    ) -> impl ::std::future::Future<
221        Output = ::connectrpc::ServiceResult<
222            impl ::connectrpc::Encodable<
223                crate::proto::chain::withdraw::v1::ValidateWithdrawDestinationResponse,
224            > + Send + use<'a, Self>,
225        >,
226    > + Send;
227    /// Create or return one durable withdraw from Trading.
228    ///
229    /// `'a` lets the response body borrow from `&self` (e.g. server-resident state).
230    ///
231    /// `request` is borrowed from the request body and is valid for the
232    /// duration of the call; message fields are read directly on it
233    /// (zero-copy). The response cannot borrow from `request` — use
234    /// `.to_owned_message()` (or copy the specific fields) for anything
235    /// returned, stored, or moved into `tokio::spawn`.
236    fn create_trading_withdraw<'a>(
237        &'a self,
238        ctx: ::connectrpc::RequestContext,
239        request: ::connectrpc::ServiceRequest<
240            '_,
241            crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
242        >,
243    ) -> impl ::std::future::Future<
244        Output = ::connectrpc::ServiceResult<
245            impl ::connectrpc::Encodable<
246                crate::proto::chain::withdraw::v1::CreateTradingWithdrawResponse,
247            > + Send + use<'a, Self>,
248        >,
249    > + Send;
250    /// Create or return one wallet/JWT withdraw from Trading.
251    /// Own-account Trading to Funding accepts recent MFA; external, cross-owner,
252    /// and delegated movements require a fresh single-use step-up.
253    ///
254    /// `'a` lets the response body borrow from `&self` (e.g. server-resident state).
255    ///
256    /// `request` is borrowed from the request body and is valid for the
257    /// duration of the call; message fields are read directly on it
258    /// (zero-copy). The response cannot borrow from `request` — use
259    /// `.to_owned_message()` (or copy the specific fields) for anything
260    /// returned, stored, or moved into `tokio::spawn`.
261    fn create_wallet_trading_withdraw<'a>(
262        &'a self,
263        ctx: ::connectrpc::RequestContext,
264        request: ::connectrpc::ServiceRequest<
265            '_,
266            crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
267        >,
268    ) -> impl ::std::future::Future<
269        Output = ::connectrpc::ServiceResult<
270            impl ::connectrpc::Encodable<
271                crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
272            > + Send + use<'a, Self>,
273        >,
274    > + Send;
275}
276/// Extension trait for registering a service implementation with a Router.
277///
278/// This trait is automatically implemented for all types that implement the service trait.
279/// Prefer [`Router::add_service`](::connectrpc::Router::add_service) for
280/// top-down registration; `register` remains available for compatibility
281/// and cases where the service-first call shape is more convenient.
282///
283/// # Example
284///
285/// ```rust,ignore
286/// use std::sync::Arc;
287///
288/// let service = Arc::new(MyServiceImpl);
289/// let router = service.register(Router::new());
290/// ```
291pub trait WithdrawServiceExt: WithdrawService {
292    /// Register this service implementation with a Router.
293    ///
294    /// Takes ownership of the `Arc<Self>` and returns a new Router with
295    /// this service's methods registered.
296    fn register(
297        self: ::std::sync::Arc<Self>,
298        router: ::connectrpc::Router,
299    ) -> ::connectrpc::Router;
300}
301impl<S: WithdrawService> WithdrawServiceExt for S {
302    fn register(
303        self: ::std::sync::Arc<Self>,
304        router: ::connectrpc::Router,
305    ) -> ::connectrpc::Router {
306        router
307            .route_view(
308                WITHDRAW_SERVICE_SERVICE_NAME,
309                "ValidateWithdrawDestination",
310                {
311                    let svc = ::std::sync::Arc::clone(&self);
312                    ::connectrpc::view_handler_fn(move |
313                        ctx,
314                        req: ::buffa::view::OwnedView<
315                            crate::proto::chain::withdraw::v1::__buffa::view::ValidateWithdrawDestinationRequestView<
316                                'static,
317                            >,
318                        >,
319                        format|
320                    {
321                        let svc = ::std::sync::Arc::clone(&svc);
322                        async move {
323                            let sreq = ::connectrpc::ServiceRequest::<
324                                crate::proto::chain::withdraw::v1::ValidateWithdrawDestinationRequest,
325                            >::from_parts(req.reborrow(), req.bytes());
326                            svc.validate_withdraw_destination(ctx, sreq)
327                                .await?
328                                .encode::<
329                                    crate::proto::chain::withdraw::v1::ValidateWithdrawDestinationResponse,
330                                >(format)
331                        }
332                    })
333                },
334            )
335            .with_spec(WITHDRAW_SERVICE_VALIDATE_WITHDRAW_DESTINATION_SPEC)
336            .route_view(
337                WITHDRAW_SERVICE_SERVICE_NAME,
338                "CreateTradingWithdraw",
339                {
340                    let svc = ::std::sync::Arc::clone(&self);
341                    ::connectrpc::view_handler_fn(move |
342                        ctx,
343                        req: ::buffa::view::OwnedView<
344                            crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawRequestView<
345                                'static,
346                            >,
347                        >,
348                        format|
349                    {
350                        let svc = ::std::sync::Arc::clone(&svc);
351                        async move {
352                            let sreq = ::connectrpc::ServiceRequest::<
353                                crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
354                            >::from_parts(req.reborrow(), req.bytes());
355                            svc.create_trading_withdraw(ctx, sreq)
356                                .await?
357                                .encode::<
358                                    crate::proto::chain::withdraw::v1::CreateTradingWithdrawResponse,
359                                >(format)
360                        }
361                    })
362                },
363            )
364            .with_spec(WITHDRAW_SERVICE_CREATE_TRADING_WITHDRAW_SPEC)
365            .route_view(
366                WITHDRAW_SERVICE_SERVICE_NAME,
367                "CreateWalletTradingWithdraw",
368                {
369                    let svc = ::std::sync::Arc::clone(&self);
370                    ::connectrpc::view_handler_fn(move |
371                        ctx,
372                        req: ::buffa::view::OwnedView<
373                            crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawRequestView<
374                                'static,
375                            >,
376                        >,
377                        format|
378                    {
379                        let svc = ::std::sync::Arc::clone(&svc);
380                        async move {
381                            let sreq = ::connectrpc::ServiceRequest::<
382                                crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
383                            >::from_parts(req.reborrow(), req.bytes());
384                            svc.create_wallet_trading_withdraw(ctx, sreq)
385                                .await?
386                                .encode::<
387                                    crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
388                                >(format)
389                        }
390                    })
391                },
392            )
393            .with_spec(WITHDRAW_SERVICE_CREATE_WALLET_TRADING_WITHDRAW_SPEC)
394    }
395}
396/// Type-inference marker used by [`Router::add_service`](::connectrpc::Router::add_service).
397#[doc(hidden)]
398pub struct WithdrawServiceRegisterMarker;
399impl<S: WithdrawService> ::connectrpc::ServiceRegister<WithdrawServiceRegisterMarker>
400for ::std::sync::Arc<S> {
401    fn register_service(self, router: ::connectrpc::Router) -> ::connectrpc::Router {
402        <S as WithdrawServiceExt>::register(self, router)
403    }
404}
405/// Monomorphic dispatcher for `WithdrawService`.
406///
407/// Unlike `.register(Router)` which type-erases each method into an `Arc<dyn ErasedHandler>` stored in a `HashMap`, this struct dispatches via a compile-time `match` on method name: no vtable, no hash lookup.
408///
409/// # Example
410///
411/// ```rust,ignore
412/// use connectrpc::ConnectRpcService;
413///
414/// let server = WithdrawServiceServer::new(MyImpl);
415/// let service = ConnectRpcService::new(server);
416/// // hand `service` to axum/hyper as a fallback_service
417/// ```
418pub struct WithdrawServiceServer<T> {
419    inner: ::std::sync::Arc<T>,
420}
421impl<T: WithdrawService> WithdrawServiceServer<T> {
422    /// Wrap a service implementation in a monomorphic dispatcher.
423    pub fn new(service: T) -> Self {
424        Self {
425            inner: ::std::sync::Arc::new(service),
426        }
427    }
428    /// Wrap an already-`Arc`'d service implementation.
429    pub fn from_arc(inner: ::std::sync::Arc<T>) -> Self {
430        Self { inner }
431    }
432}
433impl<T> Clone for WithdrawServiceServer<T> {
434    fn clone(&self) -> Self {
435        Self {
436            inner: ::std::sync::Arc::clone(&self.inner),
437        }
438    }
439}
440impl<T: WithdrawService> ::connectrpc::Dispatcher for WithdrawServiceServer<T> {
441    #[inline]
442    fn lookup(
443        &self,
444        path: &str,
445    ) -> Option<::connectrpc::dispatcher::codegen::MethodDescriptor> {
446        let method = path.strip_prefix("chain.withdraw.v1.WithdrawService/")?;
447        match method {
448            "ValidateWithdrawDestination" => {
449                Some(
450                    ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
451                        .with_spec(WITHDRAW_SERVICE_VALIDATE_WITHDRAW_DESTINATION_SPEC),
452                )
453            }
454            "CreateTradingWithdraw" => {
455                Some(
456                    ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
457                        .with_spec(WITHDRAW_SERVICE_CREATE_TRADING_WITHDRAW_SPEC),
458                )
459            }
460            "CreateWalletTradingWithdraw" => {
461                Some(
462                    ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
463                        .with_spec(WITHDRAW_SERVICE_CREATE_WALLET_TRADING_WITHDRAW_SPEC),
464                )
465            }
466            _ => None,
467        }
468    }
469    fn call_unary(
470        &self,
471        path: &str,
472        ctx: ::connectrpc::RequestContext,
473        request: ::connectrpc::Payload,
474        format: ::connectrpc::CodecFormat,
475    ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
476        let Some(method) = path.strip_prefix("chain.withdraw.v1.WithdrawService/") else {
477            return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
478        };
479        let _ = (&ctx, &request, &format);
480        match method {
481            "ValidateWithdrawDestination" => {
482                let svc = ::std::sync::Arc::clone(&self.inner);
483                Box::pin(async move {
484                    let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
485                        crate::proto::chain::withdraw::v1::ValidateWithdrawDestinationRequest,
486                    >(request.encoded()?, format)?;
487                    let req: crate::proto::chain::withdraw::v1::__buffa::view::ValidateWithdrawDestinationRequestView<
488                        '_,
489                    > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
490                        &body,
491                    )?;
492                    let req = ::connectrpc::ServiceRequest::<
493                        crate::proto::chain::withdraw::v1::ValidateWithdrawDestinationRequest,
494                    >::from_parts(&req, &body);
495                    svc.validate_withdraw_destination(ctx, req)
496                        .await?
497                        .encode::<
498                            crate::proto::chain::withdraw::v1::ValidateWithdrawDestinationResponse,
499                        >(format)
500                })
501            }
502            "CreateTradingWithdraw" => {
503                let svc = ::std::sync::Arc::clone(&self.inner);
504                Box::pin(async move {
505                    let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
506                        crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
507                    >(request.encoded()?, format)?;
508                    let req: crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawRequestView<
509                        '_,
510                    > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
511                        &body,
512                    )?;
513                    let req = ::connectrpc::ServiceRequest::<
514                        crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
515                    >::from_parts(&req, &body);
516                    svc.create_trading_withdraw(ctx, req)
517                        .await?
518                        .encode::<
519                            crate::proto::chain::withdraw::v1::CreateTradingWithdrawResponse,
520                        >(format)
521                })
522            }
523            "CreateWalletTradingWithdraw" => {
524                let svc = ::std::sync::Arc::clone(&self.inner);
525                Box::pin(async move {
526                    let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
527                        crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
528                    >(request.encoded()?, format)?;
529                    let req: crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawRequestView<
530                        '_,
531                    > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
532                        &body,
533                    )?;
534                    let req = ::connectrpc::ServiceRequest::<
535                        crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
536                    >::from_parts(&req, &body);
537                    svc.create_wallet_trading_withdraw(ctx, req)
538                        .await?
539                        .encode::<
540                            crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawResponse,
541                        >(format)
542                })
543            }
544            _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
545        }
546    }
547    fn call_server_streaming(
548        &self,
549        path: &str,
550        ctx: ::connectrpc::RequestContext,
551        request: ::buffa::bytes::Bytes,
552        format: ::connectrpc::CodecFormat,
553    ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
554        let Some(method) = path.strip_prefix("chain.withdraw.v1.WithdrawService/") else {
555            return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
556        };
557        let _ = (&ctx, &request, &format);
558        match method {
559            _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
560        }
561    }
562    fn call_client_streaming(
563        &self,
564        path: &str,
565        ctx: ::connectrpc::RequestContext,
566        requests: ::connectrpc::dispatcher::codegen::RequestStream,
567        format: ::connectrpc::CodecFormat,
568    ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
569        let Some(method) = path.strip_prefix("chain.withdraw.v1.WithdrawService/") else {
570            return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
571        };
572        let _ = (&ctx, &requests, &format);
573        match method {
574            _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
575        }
576    }
577    fn call_bidi_streaming(
578        &self,
579        path: &str,
580        ctx: ::connectrpc::RequestContext,
581        requests: ::connectrpc::dispatcher::codegen::RequestStream,
582        format: ::connectrpc::CodecFormat,
583    ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
584        let Some(method) = path.strip_prefix("chain.withdraw.v1.WithdrawService/") else {
585            return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
586        };
587        let _ = (&ctx, &requests, &format);
588        match method {
589            _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
590        }
591    }
592}
593/// Client for this service.
594///
595/// Generic over `T: ClientTransport`. For **gRPC** (HTTP/2), use
596/// `Http2Connection` — it has honest `poll_ready` and composes with
597/// `tower::balance` for multi-connection load balancing. For **Connect
598/// over HTTP/1.1** (or unknown protocol), use `HttpClient`.
599///
600/// # Working with the response
601///
602/// Unary calls return [`UnaryResponse<OwnedView<FooView>>`](::connectrpc::client::UnaryResponse).
603/// [`view()`](::connectrpc::client::UnaryResponse::view) borrows the response
604/// message, so field access is zero-copy:
605///
606/// ```rust,ignore
607/// let resp = client.validate_withdraw_destination(request).await?;
608/// let name: &str = resp.view().name;  // borrow into the response buffer
609/// ```
610///
611/// If you need the owned struct (e.g. to store or pass by value), use
612/// [`into_owned()`](::connectrpc::client::UnaryResponse::into_owned):
613///
614/// ```rust,ignore
615/// let owned = client.validate_withdraw_destination(request).await?.into_owned();
616/// ```
617///
618/// [`into_view()`](::connectrpc::client::UnaryResponse::into_view) keeps the
619/// zero-copy decoded body (an `OwnedView`) without copying; field access on it
620/// goes through `.reborrow()`. Streaming responses yield one
621/// [`StreamMessage`](::connectrpc::StreamMessage) per received message from
622/// `.message().await` — read fields zero-copy through the generated accessor
623/// methods (`msg.name()`) or `.view()`, or convert with `.to_owned_message()`.
624#[derive(Clone)]
625pub struct WithdrawServiceClient<T> {
626    transport: T,
627    config: ::connectrpc::client::ClientConfig,
628}
629impl<T> WithdrawServiceClient<T>
630where
631    T: ::connectrpc::client::ClientTransport,
632    <T::ResponseBody as ::connectrpc::http_body::Body>::Error: ::std::fmt::Display,
633{
634    /// Create a new client with the given transport and configuration.
635    pub fn new(transport: T, config: ::connectrpc::client::ClientConfig) -> Self {
636        Self { transport, config }
637    }
638    /// Get the client configuration.
639    pub fn config(&self) -> &::connectrpc::client::ClientConfig {
640        &self.config
641    }
642    /// Get a mutable reference to the client configuration.
643    pub fn config_mut(&mut self) -> &mut ::connectrpc::client::ClientConfig {
644        &mut self.config
645    }
646    /// Call the ValidateWithdrawDestination RPC. Sends a request to /chain.withdraw.v1.WithdrawService/ValidateWithdrawDestination.
647    pub async fn validate_withdraw_destination(
648        &self,
649        request: crate::proto::chain::withdraw::v1::ValidateWithdrawDestinationRequest,
650    ) -> Result<
651        ::connectrpc::client::UnaryResponse<
652            ::buffa::view::OwnedView<
653                crate::proto::chain::withdraw::v1::__buffa::view::ValidateWithdrawDestinationResponseView<
654                    'static,
655                >,
656            >,
657        >,
658        ::connectrpc::ConnectError,
659    > {
660        self.validate_withdraw_destination_with_options(
661                request,
662                ::connectrpc::client::CallOptions::default(),
663            )
664            .await
665    }
666    /// Call the ValidateWithdrawDestination RPC with explicit per-call options. Options override [`ClientConfig`](::connectrpc::client::ClientConfig) defaults.
667    pub async fn validate_withdraw_destination_with_options(
668        &self,
669        request: crate::proto::chain::withdraw::v1::ValidateWithdrawDestinationRequest,
670        options: ::connectrpc::client::CallOptions,
671    ) -> Result<
672        ::connectrpc::client::UnaryResponse<
673            ::buffa::view::OwnedView<
674                crate::proto::chain::withdraw::v1::__buffa::view::ValidateWithdrawDestinationResponseView<
675                    'static,
676                >,
677            >,
678        >,
679        ::connectrpc::ConnectError,
680    > {
681        ::connectrpc::client::call_unary(
682                &self.transport,
683                &self.config,
684                WITHDRAW_SERVICE_SERVICE_NAME,
685                "ValidateWithdrawDestination",
686                request,
687                options,
688            )
689            .await
690    }
691    /// Call the CreateTradingWithdraw RPC. Sends a request to /chain.withdraw.v1.WithdrawService/CreateTradingWithdraw.
692    pub async fn create_trading_withdraw(
693        &self,
694        request: crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
695    ) -> Result<
696        ::connectrpc::client::UnaryResponse<
697            ::buffa::view::OwnedView<
698                crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawResponseView<
699                    'static,
700                >,
701            >,
702        >,
703        ::connectrpc::ConnectError,
704    > {
705        self.create_trading_withdraw_with_options(
706                request,
707                ::connectrpc::client::CallOptions::default(),
708            )
709            .await
710    }
711    /// Call the CreateTradingWithdraw RPC with explicit per-call options. Options override [`ClientConfig`](::connectrpc::client::ClientConfig) defaults.
712    pub async fn create_trading_withdraw_with_options(
713        &self,
714        request: crate::proto::chain::withdraw::v1::CreateTradingWithdrawRequest,
715        options: ::connectrpc::client::CallOptions,
716    ) -> Result<
717        ::connectrpc::client::UnaryResponse<
718            ::buffa::view::OwnedView<
719                crate::proto::chain::withdraw::v1::__buffa::view::CreateTradingWithdrawResponseView<
720                    'static,
721                >,
722            >,
723        >,
724        ::connectrpc::ConnectError,
725    > {
726        ::connectrpc::client::call_unary(
727                &self.transport,
728                &self.config,
729                WITHDRAW_SERVICE_SERVICE_NAME,
730                "CreateTradingWithdraw",
731                request,
732                options,
733            )
734            .await
735    }
736    /// Call the CreateWalletTradingWithdraw RPC. Sends a request to /chain.withdraw.v1.WithdrawService/CreateWalletTradingWithdraw.
737    pub async fn create_wallet_trading_withdraw(
738        &self,
739        request: crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
740    ) -> Result<
741        ::connectrpc::client::UnaryResponse<
742            ::buffa::view::OwnedView<
743                crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawResponseView<
744                    'static,
745                >,
746            >,
747        >,
748        ::connectrpc::ConnectError,
749    > {
750        self.create_wallet_trading_withdraw_with_options(
751                request,
752                ::connectrpc::client::CallOptions::default(),
753            )
754            .await
755    }
756    /// Call the CreateWalletTradingWithdraw RPC with explicit per-call options. Options override [`ClientConfig`](::connectrpc::client::ClientConfig) defaults.
757    pub async fn create_wallet_trading_withdraw_with_options(
758        &self,
759        request: crate::proto::chain::withdraw::v1::CreateWalletTradingWithdrawRequest,
760        options: ::connectrpc::client::CallOptions,
761    ) -> Result<
762        ::connectrpc::client::UnaryResponse<
763            ::buffa::view::OwnedView<
764                crate::proto::chain::withdraw::v1::__buffa::view::CreateWalletTradingWithdrawResponseView<
765                    'static,
766                >,
767            >,
768        >,
769        ::connectrpc::ConnectError,
770    > {
771        ::connectrpc::client::call_unary(
772                &self.transport,
773                &self.config,
774                WITHDRAW_SERVICE_SERVICE_NAME,
775                "CreateWalletTradingWithdraw",
776                request,
777                options,
778            )
779            .await
780    }
781}