1#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Params {
5 #[prost(message, repeated, tag = "1")]
6 pub send_enabled: ::prost::alloc::vec::Vec<SendEnabled>,
7 #[prost(bool, tag = "2")]
8 pub default_send_enabled: bool,
9}
10#[allow(clippy::derive_partial_eq_without_eq)]
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct SendEnabled {
15 #[prost(string, tag = "1")]
16 pub denom: ::prost::alloc::string::String,
17 #[prost(bool, tag = "2")]
18 pub enabled: bool,
19}
20#[allow(clippy::derive_partial_eq_without_eq)]
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct Input {
24 #[prost(string, tag = "1")]
25 pub address: ::prost::alloc::string::String,
26 #[prost(message, repeated, tag = "2")]
27 pub coins: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
28}
29#[allow(clippy::derive_partial_eq_without_eq)]
31#[derive(Clone, PartialEq, ::prost::Message)]
32pub struct Output {
33 #[prost(string, tag = "1")]
34 pub address: ::prost::alloc::string::String,
35 #[prost(message, repeated, tag = "2")]
36 pub coins: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
37}
38#[allow(clippy::derive_partial_eq_without_eq)]
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct Supply {
44 #[prost(message, repeated, tag = "1")]
45 pub total: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
46}
47#[allow(clippy::derive_partial_eq_without_eq)]
50#[derive(Clone, PartialEq, ::prost::Message)]
51pub struct DenomUnit {
52 #[prost(string, tag = "1")]
54 pub denom: ::prost::alloc::string::String,
55 #[prost(uint32, tag = "2")]
61 pub exponent: u32,
62 #[prost(string, repeated, tag = "3")]
64 pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
65}
66#[allow(clippy::derive_partial_eq_without_eq)]
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct Metadata {
71 #[prost(string, tag = "1")]
72 pub description: ::prost::alloc::string::String,
73 #[prost(message, repeated, tag = "2")]
75 pub denom_units: ::prost::alloc::vec::Vec<DenomUnit>,
76 #[prost(string, tag = "3")]
78 pub base: ::prost::alloc::string::String,
79 #[prost(string, tag = "4")]
82 pub display: ::prost::alloc::string::String,
83 #[prost(string, tag = "5")]
87 pub name: ::prost::alloc::string::String,
88 #[prost(string, tag = "6")]
93 pub symbol: ::prost::alloc::string::String,
94}
95#[allow(clippy::derive_partial_eq_without_eq)]
97#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct MsgSend {
99 #[prost(string, tag = "1")]
100 pub from_address: ::prost::alloc::string::String,
101 #[prost(string, tag = "2")]
102 pub to_address: ::prost::alloc::string::String,
103 #[prost(message, repeated, tag = "3")]
104 pub amount: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
105}
106#[allow(clippy::derive_partial_eq_without_eq)]
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct MsgSendResponse {}
110#[allow(clippy::derive_partial_eq_without_eq)]
112#[derive(Clone, PartialEq, ::prost::Message)]
113pub struct MsgMultiSend {
114 #[prost(message, repeated, tag = "1")]
115 pub inputs: ::prost::alloc::vec::Vec<Input>,
116 #[prost(message, repeated, tag = "2")]
117 pub outputs: ::prost::alloc::vec::Vec<Output>,
118}
119#[allow(clippy::derive_partial_eq_without_eq)]
121#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct MsgMultiSendResponse {}
123#[cfg(feature = "grpc")]
125#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
126pub mod msg_client {
127 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
128 use tonic::codegen::http::Uri;
129 use tonic::codegen::*;
130 #[derive(Debug, Clone)]
132 pub struct MsgClient<T> {
133 inner: tonic::client::Grpc<T>,
134 }
135 #[cfg(feature = "grpc-transport")]
136 #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
137 impl MsgClient<tonic::transport::Channel> {
138 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
140 where
141 D: std::convert::TryInto<tonic::transport::Endpoint>,
142 D::Error: Into<StdError>,
143 {
144 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
145 Ok(Self::new(conn))
146 }
147 }
148 impl<T> MsgClient<T>
149 where
150 T: tonic::client::GrpcService<tonic::body::BoxBody>,
151 T::Error: Into<StdError>,
152 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
153 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
154 {
155 pub fn new(inner: T) -> Self {
156 let inner = tonic::client::Grpc::new(inner);
157 Self { inner }
158 }
159 pub fn with_origin(inner: T, origin: Uri) -> Self {
160 let inner = tonic::client::Grpc::with_origin(inner, origin);
161 Self { inner }
162 }
163 pub fn with_interceptor<F>(inner: T, interceptor: F) -> MsgClient<InterceptedService<T, F>>
164 where
165 F: tonic::service::Interceptor,
166 T::ResponseBody: Default,
167 T: tonic::codegen::Service<
168 http::Request<tonic::body::BoxBody>,
169 Response = http::Response<
170 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
171 >,
172 >,
173 <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
174 Into<StdError> + Send + Sync,
175 {
176 MsgClient::new(InterceptedService::new(inner, interceptor))
177 }
178 #[must_use]
183 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
184 self.inner = self.inner.send_compressed(encoding);
185 self
186 }
187 #[must_use]
189 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
190 self.inner = self.inner.accept_compressed(encoding);
191 self
192 }
193 pub async fn send(
195 &mut self,
196 request: impl tonic::IntoRequest<super::MsgSend>,
197 ) -> Result<tonic::Response<super::MsgSendResponse>, tonic::Status> {
198 self.inner.ready().await.map_err(|e| {
199 tonic::Status::new(
200 tonic::Code::Unknown,
201 format!("Service was not ready: {}", e.into()),
202 )
203 })?;
204 let codec = tonic::codec::ProstCodec::default();
205 let path = http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Msg/Send");
206 self.inner.unary(request.into_request(), path, codec).await
207 }
208 pub async fn multi_send(
210 &mut self,
211 request: impl tonic::IntoRequest<super::MsgMultiSend>,
212 ) -> Result<tonic::Response<super::MsgMultiSendResponse>, tonic::Status> {
213 self.inner.ready().await.map_err(|e| {
214 tonic::Status::new(
215 tonic::Code::Unknown,
216 format!("Service was not ready: {}", e.into()),
217 )
218 })?;
219 let codec = tonic::codec::ProstCodec::default();
220 let path = http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Msg/MultiSend");
221 self.inner.unary(request.into_request(), path, codec).await
222 }
223 }
224}
225#[cfg(feature = "grpc")]
227#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
228pub mod msg_server {
229 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
230 use tonic::codegen::*;
231 #[async_trait]
233 pub trait Msg: Send + Sync + 'static {
234 async fn send(
236 &self,
237 request: tonic::Request<super::MsgSend>,
238 ) -> Result<tonic::Response<super::MsgSendResponse>, tonic::Status>;
239 async fn multi_send(
241 &self,
242 request: tonic::Request<super::MsgMultiSend>,
243 ) -> Result<tonic::Response<super::MsgMultiSendResponse>, tonic::Status>;
244 }
245 #[derive(Debug)]
247 pub struct MsgServer<T: Msg> {
248 inner: _Inner<T>,
249 accept_compression_encodings: EnabledCompressionEncodings,
250 send_compression_encodings: EnabledCompressionEncodings,
251 }
252 struct _Inner<T>(Arc<T>);
253 impl<T: Msg> MsgServer<T> {
254 pub fn new(inner: T) -> Self {
255 Self::from_arc(Arc::new(inner))
256 }
257 pub fn from_arc(inner: Arc<T>) -> Self {
258 let inner = _Inner(inner);
259 Self {
260 inner,
261 accept_compression_encodings: Default::default(),
262 send_compression_encodings: Default::default(),
263 }
264 }
265 pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
266 where
267 F: tonic::service::Interceptor,
268 {
269 InterceptedService::new(Self::new(inner), interceptor)
270 }
271 #[must_use]
273 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
274 self.accept_compression_encodings.enable(encoding);
275 self
276 }
277 #[must_use]
279 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
280 self.send_compression_encodings.enable(encoding);
281 self
282 }
283 }
284 impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
285 where
286 T: Msg,
287 B: Body + Send + 'static,
288 B::Error: Into<StdError> + Send + 'static,
289 {
290 type Response = http::Response<tonic::body::BoxBody>;
291 type Error = std::convert::Infallible;
292 type Future = BoxFuture<Self::Response, Self::Error>;
293 fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
294 Poll::Ready(Ok(()))
295 }
296 fn call(&mut self, req: http::Request<B>) -> Self::Future {
297 let inner = self.inner.clone();
298 match req.uri().path() {
299 "/cosmos.bank.v1beta1.Msg/Send" => {
300 #[allow(non_camel_case_types)]
301 struct SendSvc<T: Msg>(pub Arc<T>);
302 impl<T: Msg> tonic::server::UnaryService<super::MsgSend> for SendSvc<T> {
303 type Response = super::MsgSendResponse;
304 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
305 fn call(
306 &mut self,
307 request: tonic::Request<super::MsgSend>,
308 ) -> Self::Future {
309 let inner = self.0.clone();
310 let fut = async move { (*inner).send(request).await };
311 Box::pin(fut)
312 }
313 }
314 let accept_compression_encodings = self.accept_compression_encodings;
315 let send_compression_encodings = self.send_compression_encodings;
316 let inner = self.inner.clone();
317 let fut = async move {
318 let inner = inner.0;
319 let method = SendSvc(inner);
320 let codec = tonic::codec::ProstCodec::default();
321 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
322 accept_compression_encodings,
323 send_compression_encodings,
324 );
325 let res = grpc.unary(method, req).await;
326 Ok(res)
327 };
328 Box::pin(fut)
329 }
330 "/cosmos.bank.v1beta1.Msg/MultiSend" => {
331 #[allow(non_camel_case_types)]
332 struct MultiSendSvc<T: Msg>(pub Arc<T>);
333 impl<T: Msg> tonic::server::UnaryService<super::MsgMultiSend> for MultiSendSvc<T> {
334 type Response = super::MsgMultiSendResponse;
335 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
336 fn call(
337 &mut self,
338 request: tonic::Request<super::MsgMultiSend>,
339 ) -> Self::Future {
340 let inner = self.0.clone();
341 let fut = async move { (*inner).multi_send(request).await };
342 Box::pin(fut)
343 }
344 }
345 let accept_compression_encodings = self.accept_compression_encodings;
346 let send_compression_encodings = self.send_compression_encodings;
347 let inner = self.inner.clone();
348 let fut = async move {
349 let inner = inner.0;
350 let method = MultiSendSvc(inner);
351 let codec = tonic::codec::ProstCodec::default();
352 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
353 accept_compression_encodings,
354 send_compression_encodings,
355 );
356 let res = grpc.unary(method, req).await;
357 Ok(res)
358 };
359 Box::pin(fut)
360 }
361 _ => Box::pin(async move {
362 Ok(http::Response::builder()
363 .status(200)
364 .header("grpc-status", "12")
365 .header("content-type", "application/grpc")
366 .body(empty_body())
367 .unwrap())
368 }),
369 }
370 }
371 }
372 impl<T: Msg> Clone for MsgServer<T> {
373 fn clone(&self) -> Self {
374 let inner = self.inner.clone();
375 Self {
376 inner,
377 accept_compression_encodings: self.accept_compression_encodings,
378 send_compression_encodings: self.send_compression_encodings,
379 }
380 }
381 }
382 impl<T: Msg> Clone for _Inner<T> {
383 fn clone(&self) -> Self {
384 Self(self.0.clone())
385 }
386 }
387 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
388 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
389 write!(f, "{:?}", self.0)
390 }
391 }
392 impl<T: Msg> tonic::server::NamedService for MsgServer<T> {
393 const NAME: &'static str = "cosmos.bank.v1beta1.Msg";
394 }
395}
396#[allow(clippy::derive_partial_eq_without_eq)]
398#[derive(Clone, PartialEq, ::prost::Message)]
399pub struct QueryBalanceRequest {
400 #[prost(string, tag = "1")]
402 pub address: ::prost::alloc::string::String,
403 #[prost(string, tag = "2")]
405 pub denom: ::prost::alloc::string::String,
406}
407#[allow(clippy::derive_partial_eq_without_eq)]
409#[derive(Clone, PartialEq, ::prost::Message)]
410pub struct QueryBalanceResponse {
411 #[prost(message, optional, tag = "1")]
413 pub balance: ::core::option::Option<super::super::base::v1beta1::Coin>,
414}
415#[allow(clippy::derive_partial_eq_without_eq)]
417#[derive(Clone, PartialEq, ::prost::Message)]
418pub struct QueryAllBalancesRequest {
419 #[prost(string, tag = "1")]
421 pub address: ::prost::alloc::string::String,
422 #[prost(message, optional, tag = "2")]
424 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
425}
426#[allow(clippy::derive_partial_eq_without_eq)]
429#[derive(Clone, PartialEq, ::prost::Message)]
430pub struct QueryAllBalancesResponse {
431 #[prost(message, repeated, tag = "1")]
433 pub balances: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
434 #[prost(message, optional, tag = "2")]
436 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
437}
438#[allow(clippy::derive_partial_eq_without_eq)]
441#[derive(Clone, PartialEq, ::prost::Message)]
442pub struct QuerySpendableBalancesRequest {
443 #[prost(string, tag = "1")]
445 pub address: ::prost::alloc::string::String,
446 #[prost(message, optional, tag = "2")]
448 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
449}
450#[allow(clippy::derive_partial_eq_without_eq)]
453#[derive(Clone, PartialEq, ::prost::Message)]
454pub struct QuerySpendableBalancesResponse {
455 #[prost(message, repeated, tag = "1")]
457 pub balances: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
458 #[prost(message, optional, tag = "2")]
460 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
461}
462#[allow(clippy::derive_partial_eq_without_eq)]
465#[derive(Clone, PartialEq, ::prost::Message)]
466pub struct QueryTotalSupplyRequest {
467 #[prost(message, optional, tag = "1")]
471 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
472}
473#[allow(clippy::derive_partial_eq_without_eq)]
476#[derive(Clone, PartialEq, ::prost::Message)]
477pub struct QueryTotalSupplyResponse {
478 #[prost(message, repeated, tag = "1")]
480 pub supply: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
481 #[prost(message, optional, tag = "2")]
485 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
486}
487#[allow(clippy::derive_partial_eq_without_eq)]
489#[derive(Clone, PartialEq, ::prost::Message)]
490pub struct QuerySupplyOfRequest {
491 #[prost(string, tag = "1")]
493 pub denom: ::prost::alloc::string::String,
494}
495#[allow(clippy::derive_partial_eq_without_eq)]
497#[derive(Clone, PartialEq, ::prost::Message)]
498pub struct QuerySupplyOfResponse {
499 #[prost(message, optional, tag = "1")]
501 pub amount: ::core::option::Option<super::super::base::v1beta1::Coin>,
502}
503#[allow(clippy::derive_partial_eq_without_eq)]
505#[derive(Clone, PartialEq, ::prost::Message)]
506pub struct QueryParamsRequest {}
507#[allow(clippy::derive_partial_eq_without_eq)]
509#[derive(Clone, PartialEq, ::prost::Message)]
510pub struct QueryParamsResponse {
511 #[prost(message, optional, tag = "1")]
512 pub params: ::core::option::Option<Params>,
513}
514#[allow(clippy::derive_partial_eq_without_eq)]
516#[derive(Clone, PartialEq, ::prost::Message)]
517pub struct QueryDenomsMetadataRequest {
518 #[prost(message, optional, tag = "1")]
520 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
521}
522#[allow(clippy::derive_partial_eq_without_eq)]
525#[derive(Clone, PartialEq, ::prost::Message)]
526pub struct QueryDenomsMetadataResponse {
527 #[prost(message, repeated, tag = "1")]
529 pub metadatas: ::prost::alloc::vec::Vec<Metadata>,
530 #[prost(message, optional, tag = "2")]
532 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
533}
534#[allow(clippy::derive_partial_eq_without_eq)]
536#[derive(Clone, PartialEq, ::prost::Message)]
537pub struct QueryDenomMetadataRequest {
538 #[prost(string, tag = "1")]
540 pub denom: ::prost::alloc::string::String,
541}
542#[allow(clippy::derive_partial_eq_without_eq)]
545#[derive(Clone, PartialEq, ::prost::Message)]
546pub struct QueryDenomMetadataResponse {
547 #[prost(message, optional, tag = "1")]
549 pub metadata: ::core::option::Option<Metadata>,
550}
551#[cfg(feature = "grpc")]
553#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
554pub mod query_client {
555 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
556 use tonic::codegen::http::Uri;
557 use tonic::codegen::*;
558 #[derive(Debug, Clone)]
560 pub struct QueryClient<T> {
561 inner: tonic::client::Grpc<T>,
562 }
563 #[cfg(feature = "grpc-transport")]
564 #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
565 impl QueryClient<tonic::transport::Channel> {
566 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
568 where
569 D: std::convert::TryInto<tonic::transport::Endpoint>,
570 D::Error: Into<StdError>,
571 {
572 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
573 Ok(Self::new(conn))
574 }
575 }
576 impl<T> QueryClient<T>
577 where
578 T: tonic::client::GrpcService<tonic::body::BoxBody>,
579 T::Error: Into<StdError>,
580 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
581 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
582 {
583 pub fn new(inner: T) -> Self {
584 let inner = tonic::client::Grpc::new(inner);
585 Self { inner }
586 }
587 pub fn with_origin(inner: T, origin: Uri) -> Self {
588 let inner = tonic::client::Grpc::with_origin(inner, origin);
589 Self { inner }
590 }
591 pub fn with_interceptor<F>(
592 inner: T,
593 interceptor: F,
594 ) -> QueryClient<InterceptedService<T, F>>
595 where
596 F: tonic::service::Interceptor,
597 T::ResponseBody: Default,
598 T: tonic::codegen::Service<
599 http::Request<tonic::body::BoxBody>,
600 Response = http::Response<
601 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
602 >,
603 >,
604 <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
605 Into<StdError> + Send + Sync,
606 {
607 QueryClient::new(InterceptedService::new(inner, interceptor))
608 }
609 #[must_use]
614 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
615 self.inner = self.inner.send_compressed(encoding);
616 self
617 }
618 #[must_use]
620 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
621 self.inner = self.inner.accept_compressed(encoding);
622 self
623 }
624 pub async fn balance(
626 &mut self,
627 request: impl tonic::IntoRequest<super::QueryBalanceRequest>,
628 ) -> Result<tonic::Response<super::QueryBalanceResponse>, tonic::Status> {
629 self.inner.ready().await.map_err(|e| {
630 tonic::Status::new(
631 tonic::Code::Unknown,
632 format!("Service was not ready: {}", e.into()),
633 )
634 })?;
635 let codec = tonic::codec::ProstCodec::default();
636 let path = http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/Balance");
637 self.inner.unary(request.into_request(), path, codec).await
638 }
639 pub async fn all_balances(
641 &mut self,
642 request: impl tonic::IntoRequest<super::QueryAllBalancesRequest>,
643 ) -> Result<tonic::Response<super::QueryAllBalancesResponse>, tonic::Status> {
644 self.inner.ready().await.map_err(|e| {
645 tonic::Status::new(
646 tonic::Code::Unknown,
647 format!("Service was not ready: {}", e.into()),
648 )
649 })?;
650 let codec = tonic::codec::ProstCodec::default();
651 let path =
652 http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/AllBalances");
653 self.inner.unary(request.into_request(), path, codec).await
654 }
655 pub async fn spendable_balances(
658 &mut self,
659 request: impl tonic::IntoRequest<super::QuerySpendableBalancesRequest>,
660 ) -> Result<tonic::Response<super::QuerySpendableBalancesResponse>, tonic::Status> {
661 self.inner.ready().await.map_err(|e| {
662 tonic::Status::new(
663 tonic::Code::Unknown,
664 format!("Service was not ready: {}", e.into()),
665 )
666 })?;
667 let codec = tonic::codec::ProstCodec::default();
668 let path = http::uri::PathAndQuery::from_static(
669 "/cosmos.bank.v1beta1.Query/SpendableBalances",
670 );
671 self.inner.unary(request.into_request(), path, codec).await
672 }
673 pub async fn total_supply(
675 &mut self,
676 request: impl tonic::IntoRequest<super::QueryTotalSupplyRequest>,
677 ) -> Result<tonic::Response<super::QueryTotalSupplyResponse>, tonic::Status> {
678 self.inner.ready().await.map_err(|e| {
679 tonic::Status::new(
680 tonic::Code::Unknown,
681 format!("Service was not ready: {}", e.into()),
682 )
683 })?;
684 let codec = tonic::codec::ProstCodec::default();
685 let path =
686 http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/TotalSupply");
687 self.inner.unary(request.into_request(), path, codec).await
688 }
689 pub async fn supply_of(
691 &mut self,
692 request: impl tonic::IntoRequest<super::QuerySupplyOfRequest>,
693 ) -> Result<tonic::Response<super::QuerySupplyOfResponse>, tonic::Status> {
694 self.inner.ready().await.map_err(|e| {
695 tonic::Status::new(
696 tonic::Code::Unknown,
697 format!("Service was not ready: {}", e.into()),
698 )
699 })?;
700 let codec = tonic::codec::ProstCodec::default();
701 let path = http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/SupplyOf");
702 self.inner.unary(request.into_request(), path, codec).await
703 }
704 pub async fn params(
706 &mut self,
707 request: impl tonic::IntoRequest<super::QueryParamsRequest>,
708 ) -> Result<tonic::Response<super::QueryParamsResponse>, tonic::Status> {
709 self.inner.ready().await.map_err(|e| {
710 tonic::Status::new(
711 tonic::Code::Unknown,
712 format!("Service was not ready: {}", e.into()),
713 )
714 })?;
715 let codec = tonic::codec::ProstCodec::default();
716 let path = http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/Params");
717 self.inner.unary(request.into_request(), path, codec).await
718 }
719 pub async fn denom_metadata(
721 &mut self,
722 request: impl tonic::IntoRequest<super::QueryDenomMetadataRequest>,
723 ) -> Result<tonic::Response<super::QueryDenomMetadataResponse>, tonic::Status> {
724 self.inner.ready().await.map_err(|e| {
725 tonic::Status::new(
726 tonic::Code::Unknown,
727 format!("Service was not ready: {}", e.into()),
728 )
729 })?;
730 let codec = tonic::codec::ProstCodec::default();
731 let path =
732 http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/DenomMetadata");
733 self.inner.unary(request.into_request(), path, codec).await
734 }
735 pub async fn denoms_metadata(
737 &mut self,
738 request: impl tonic::IntoRequest<super::QueryDenomsMetadataRequest>,
739 ) -> Result<tonic::Response<super::QueryDenomsMetadataResponse>, tonic::Status> {
740 self.inner.ready().await.map_err(|e| {
741 tonic::Status::new(
742 tonic::Code::Unknown,
743 format!("Service was not ready: {}", e.into()),
744 )
745 })?;
746 let codec = tonic::codec::ProstCodec::default();
747 let path =
748 http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/DenomsMetadata");
749 self.inner.unary(request.into_request(), path, codec).await
750 }
751 }
752}
753#[cfg(feature = "grpc")]
755#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
756pub mod query_server {
757 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
758 use tonic::codegen::*;
759 #[async_trait]
761 pub trait Query: Send + Sync + 'static {
762 async fn balance(
764 &self,
765 request: tonic::Request<super::QueryBalanceRequest>,
766 ) -> Result<tonic::Response<super::QueryBalanceResponse>, tonic::Status>;
767 async fn all_balances(
769 &self,
770 request: tonic::Request<super::QueryAllBalancesRequest>,
771 ) -> Result<tonic::Response<super::QueryAllBalancesResponse>, tonic::Status>;
772 async fn spendable_balances(
775 &self,
776 request: tonic::Request<super::QuerySpendableBalancesRequest>,
777 ) -> Result<tonic::Response<super::QuerySpendableBalancesResponse>, tonic::Status>;
778 async fn total_supply(
780 &self,
781 request: tonic::Request<super::QueryTotalSupplyRequest>,
782 ) -> Result<tonic::Response<super::QueryTotalSupplyResponse>, tonic::Status>;
783 async fn supply_of(
785 &self,
786 request: tonic::Request<super::QuerySupplyOfRequest>,
787 ) -> Result<tonic::Response<super::QuerySupplyOfResponse>, tonic::Status>;
788 async fn params(
790 &self,
791 request: tonic::Request<super::QueryParamsRequest>,
792 ) -> Result<tonic::Response<super::QueryParamsResponse>, tonic::Status>;
793 async fn denom_metadata(
795 &self,
796 request: tonic::Request<super::QueryDenomMetadataRequest>,
797 ) -> Result<tonic::Response<super::QueryDenomMetadataResponse>, tonic::Status>;
798 async fn denoms_metadata(
800 &self,
801 request: tonic::Request<super::QueryDenomsMetadataRequest>,
802 ) -> Result<tonic::Response<super::QueryDenomsMetadataResponse>, tonic::Status>;
803 }
804 #[derive(Debug)]
806 pub struct QueryServer<T: Query> {
807 inner: _Inner<T>,
808 accept_compression_encodings: EnabledCompressionEncodings,
809 send_compression_encodings: EnabledCompressionEncodings,
810 }
811 struct _Inner<T>(Arc<T>);
812 impl<T: Query> QueryServer<T> {
813 pub fn new(inner: T) -> Self {
814 Self::from_arc(Arc::new(inner))
815 }
816 pub fn from_arc(inner: Arc<T>) -> Self {
817 let inner = _Inner(inner);
818 Self {
819 inner,
820 accept_compression_encodings: Default::default(),
821 send_compression_encodings: Default::default(),
822 }
823 }
824 pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
825 where
826 F: tonic::service::Interceptor,
827 {
828 InterceptedService::new(Self::new(inner), interceptor)
829 }
830 #[must_use]
832 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
833 self.accept_compression_encodings.enable(encoding);
834 self
835 }
836 #[must_use]
838 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
839 self.send_compression_encodings.enable(encoding);
840 self
841 }
842 }
843 impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
844 where
845 T: Query,
846 B: Body + Send + 'static,
847 B::Error: Into<StdError> + Send + 'static,
848 {
849 type Response = http::Response<tonic::body::BoxBody>;
850 type Error = std::convert::Infallible;
851 type Future = BoxFuture<Self::Response, Self::Error>;
852 fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
853 Poll::Ready(Ok(()))
854 }
855 fn call(&mut self, req: http::Request<B>) -> Self::Future {
856 let inner = self.inner.clone();
857 match req.uri().path() {
858 "/cosmos.bank.v1beta1.Query/Balance" => {
859 #[allow(non_camel_case_types)]
860 struct BalanceSvc<T: Query>(pub Arc<T>);
861 impl<T: Query> tonic::server::UnaryService<super::QueryBalanceRequest> for BalanceSvc<T> {
862 type Response = super::QueryBalanceResponse;
863 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
864 fn call(
865 &mut self,
866 request: tonic::Request<super::QueryBalanceRequest>,
867 ) -> Self::Future {
868 let inner = self.0.clone();
869 let fut = async move { (*inner).balance(request).await };
870 Box::pin(fut)
871 }
872 }
873 let accept_compression_encodings = self.accept_compression_encodings;
874 let send_compression_encodings = self.send_compression_encodings;
875 let inner = self.inner.clone();
876 let fut = async move {
877 let inner = inner.0;
878 let method = BalanceSvc(inner);
879 let codec = tonic::codec::ProstCodec::default();
880 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
881 accept_compression_encodings,
882 send_compression_encodings,
883 );
884 let res = grpc.unary(method, req).await;
885 Ok(res)
886 };
887 Box::pin(fut)
888 }
889 "/cosmos.bank.v1beta1.Query/AllBalances" => {
890 #[allow(non_camel_case_types)]
891 struct AllBalancesSvc<T: Query>(pub Arc<T>);
892 impl<T: Query> tonic::server::UnaryService<super::QueryAllBalancesRequest> for AllBalancesSvc<T> {
893 type Response = super::QueryAllBalancesResponse;
894 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
895 fn call(
896 &mut self,
897 request: tonic::Request<super::QueryAllBalancesRequest>,
898 ) -> Self::Future {
899 let inner = self.0.clone();
900 let fut = async move { (*inner).all_balances(request).await };
901 Box::pin(fut)
902 }
903 }
904 let accept_compression_encodings = self.accept_compression_encodings;
905 let send_compression_encodings = self.send_compression_encodings;
906 let inner = self.inner.clone();
907 let fut = async move {
908 let inner = inner.0;
909 let method = AllBalancesSvc(inner);
910 let codec = tonic::codec::ProstCodec::default();
911 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
912 accept_compression_encodings,
913 send_compression_encodings,
914 );
915 let res = grpc.unary(method, req).await;
916 Ok(res)
917 };
918 Box::pin(fut)
919 }
920 "/cosmos.bank.v1beta1.Query/SpendableBalances" => {
921 #[allow(non_camel_case_types)]
922 struct SpendableBalancesSvc<T: Query>(pub Arc<T>);
923 impl<T: Query> tonic::server::UnaryService<super::QuerySpendableBalancesRequest>
924 for SpendableBalancesSvc<T>
925 {
926 type Response = super::QuerySpendableBalancesResponse;
927 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
928 fn call(
929 &mut self,
930 request: tonic::Request<super::QuerySpendableBalancesRequest>,
931 ) -> Self::Future {
932 let inner = self.0.clone();
933 let fut = async move { (*inner).spendable_balances(request).await };
934 Box::pin(fut)
935 }
936 }
937 let accept_compression_encodings = self.accept_compression_encodings;
938 let send_compression_encodings = self.send_compression_encodings;
939 let inner = self.inner.clone();
940 let fut = async move {
941 let inner = inner.0;
942 let method = SpendableBalancesSvc(inner);
943 let codec = tonic::codec::ProstCodec::default();
944 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
945 accept_compression_encodings,
946 send_compression_encodings,
947 );
948 let res = grpc.unary(method, req).await;
949 Ok(res)
950 };
951 Box::pin(fut)
952 }
953 "/cosmos.bank.v1beta1.Query/TotalSupply" => {
954 #[allow(non_camel_case_types)]
955 struct TotalSupplySvc<T: Query>(pub Arc<T>);
956 impl<T: Query> tonic::server::UnaryService<super::QueryTotalSupplyRequest> for TotalSupplySvc<T> {
957 type Response = super::QueryTotalSupplyResponse;
958 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
959 fn call(
960 &mut self,
961 request: tonic::Request<super::QueryTotalSupplyRequest>,
962 ) -> Self::Future {
963 let inner = self.0.clone();
964 let fut = async move { (*inner).total_supply(request).await };
965 Box::pin(fut)
966 }
967 }
968 let accept_compression_encodings = self.accept_compression_encodings;
969 let send_compression_encodings = self.send_compression_encodings;
970 let inner = self.inner.clone();
971 let fut = async move {
972 let inner = inner.0;
973 let method = TotalSupplySvc(inner);
974 let codec = tonic::codec::ProstCodec::default();
975 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
976 accept_compression_encodings,
977 send_compression_encodings,
978 );
979 let res = grpc.unary(method, req).await;
980 Ok(res)
981 };
982 Box::pin(fut)
983 }
984 "/cosmos.bank.v1beta1.Query/SupplyOf" => {
985 #[allow(non_camel_case_types)]
986 struct SupplyOfSvc<T: Query>(pub Arc<T>);
987 impl<T: Query> tonic::server::UnaryService<super::QuerySupplyOfRequest> for SupplyOfSvc<T> {
988 type Response = super::QuerySupplyOfResponse;
989 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
990 fn call(
991 &mut self,
992 request: tonic::Request<super::QuerySupplyOfRequest>,
993 ) -> Self::Future {
994 let inner = self.0.clone();
995 let fut = async move { (*inner).supply_of(request).await };
996 Box::pin(fut)
997 }
998 }
999 let accept_compression_encodings = self.accept_compression_encodings;
1000 let send_compression_encodings = self.send_compression_encodings;
1001 let inner = self.inner.clone();
1002 let fut = async move {
1003 let inner = inner.0;
1004 let method = SupplyOfSvc(inner);
1005 let codec = tonic::codec::ProstCodec::default();
1006 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1007 accept_compression_encodings,
1008 send_compression_encodings,
1009 );
1010 let res = grpc.unary(method, req).await;
1011 Ok(res)
1012 };
1013 Box::pin(fut)
1014 }
1015 "/cosmos.bank.v1beta1.Query/Params" => {
1016 #[allow(non_camel_case_types)]
1017 struct ParamsSvc<T: Query>(pub Arc<T>);
1018 impl<T: Query> tonic::server::UnaryService<super::QueryParamsRequest> for ParamsSvc<T> {
1019 type Response = super::QueryParamsResponse;
1020 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1021 fn call(
1022 &mut self,
1023 request: tonic::Request<super::QueryParamsRequest>,
1024 ) -> Self::Future {
1025 let inner = self.0.clone();
1026 let fut = async move { (*inner).params(request).await };
1027 Box::pin(fut)
1028 }
1029 }
1030 let accept_compression_encodings = self.accept_compression_encodings;
1031 let send_compression_encodings = self.send_compression_encodings;
1032 let inner = self.inner.clone();
1033 let fut = async move {
1034 let inner = inner.0;
1035 let method = ParamsSvc(inner);
1036 let codec = tonic::codec::ProstCodec::default();
1037 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1038 accept_compression_encodings,
1039 send_compression_encodings,
1040 );
1041 let res = grpc.unary(method, req).await;
1042 Ok(res)
1043 };
1044 Box::pin(fut)
1045 }
1046 "/cosmos.bank.v1beta1.Query/DenomMetadata" => {
1047 #[allow(non_camel_case_types)]
1048 struct DenomMetadataSvc<T: Query>(pub Arc<T>);
1049 impl<T: Query> tonic::server::UnaryService<super::QueryDenomMetadataRequest>
1050 for DenomMetadataSvc<T>
1051 {
1052 type Response = super::QueryDenomMetadataResponse;
1053 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1054 fn call(
1055 &mut self,
1056 request: tonic::Request<super::QueryDenomMetadataRequest>,
1057 ) -> Self::Future {
1058 let inner = self.0.clone();
1059 let fut = async move { (*inner).denom_metadata(request).await };
1060 Box::pin(fut)
1061 }
1062 }
1063 let accept_compression_encodings = self.accept_compression_encodings;
1064 let send_compression_encodings = self.send_compression_encodings;
1065 let inner = self.inner.clone();
1066 let fut = async move {
1067 let inner = inner.0;
1068 let method = DenomMetadataSvc(inner);
1069 let codec = tonic::codec::ProstCodec::default();
1070 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1071 accept_compression_encodings,
1072 send_compression_encodings,
1073 );
1074 let res = grpc.unary(method, req).await;
1075 Ok(res)
1076 };
1077 Box::pin(fut)
1078 }
1079 "/cosmos.bank.v1beta1.Query/DenomsMetadata" => {
1080 #[allow(non_camel_case_types)]
1081 struct DenomsMetadataSvc<T: Query>(pub Arc<T>);
1082 impl<T: Query> tonic::server::UnaryService<super::QueryDenomsMetadataRequest>
1083 for DenomsMetadataSvc<T>
1084 {
1085 type Response = super::QueryDenomsMetadataResponse;
1086 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1087 fn call(
1088 &mut self,
1089 request: tonic::Request<super::QueryDenomsMetadataRequest>,
1090 ) -> Self::Future {
1091 let inner = self.0.clone();
1092 let fut = async move { (*inner).denoms_metadata(request).await };
1093 Box::pin(fut)
1094 }
1095 }
1096 let accept_compression_encodings = self.accept_compression_encodings;
1097 let send_compression_encodings = self.send_compression_encodings;
1098 let inner = self.inner.clone();
1099 let fut = async move {
1100 let inner = inner.0;
1101 let method = DenomsMetadataSvc(inner);
1102 let codec = tonic::codec::ProstCodec::default();
1103 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1104 accept_compression_encodings,
1105 send_compression_encodings,
1106 );
1107 let res = grpc.unary(method, req).await;
1108 Ok(res)
1109 };
1110 Box::pin(fut)
1111 }
1112 _ => Box::pin(async move {
1113 Ok(http::Response::builder()
1114 .status(200)
1115 .header("grpc-status", "12")
1116 .header("content-type", "application/grpc")
1117 .body(empty_body())
1118 .unwrap())
1119 }),
1120 }
1121 }
1122 }
1123 impl<T: Query> Clone for QueryServer<T> {
1124 fn clone(&self) -> Self {
1125 let inner = self.inner.clone();
1126 Self {
1127 inner,
1128 accept_compression_encodings: self.accept_compression_encodings,
1129 send_compression_encodings: self.send_compression_encodings,
1130 }
1131 }
1132 }
1133 impl<T: Query> Clone for _Inner<T> {
1134 fn clone(&self) -> Self {
1135 Self(self.0.clone())
1136 }
1137 }
1138 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
1139 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1140 write!(f, "{:?}", self.0)
1141 }
1142 }
1143 impl<T: Query> tonic::server::NamedService for QueryServer<T> {
1144 const NAME: &'static str = "cosmos.bank.v1beta1.Query";
1145 }
1146}
1147#[allow(clippy::derive_partial_eq_without_eq)]
1152#[derive(Clone, PartialEq, ::prost::Message)]
1153pub struct SendAuthorization {
1154 #[prost(message, repeated, tag = "1")]
1155 pub spend_limit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
1156}
1157#[allow(clippy::derive_partial_eq_without_eq)]
1159#[derive(Clone, PartialEq, ::prost::Message)]
1160pub struct GenesisState {
1161 #[prost(message, optional, tag = "1")]
1163 pub params: ::core::option::Option<Params>,
1164 #[prost(message, repeated, tag = "2")]
1166 pub balances: ::prost::alloc::vec::Vec<Balance>,
1167 #[prost(message, repeated, tag = "3")]
1170 pub supply: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
1171 #[prost(message, repeated, tag = "4")]
1173 pub denom_metadata: ::prost::alloc::vec::Vec<Metadata>,
1174}
1175#[allow(clippy::derive_partial_eq_without_eq)]
1178#[derive(Clone, PartialEq, ::prost::Message)]
1179pub struct Balance {
1180 #[prost(string, tag = "1")]
1182 pub address: ::prost::alloc::string::String,
1183 #[prost(message, repeated, tag = "2")]
1185 pub coins: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
1186}