juno_rust_proto/prost/ibc-go/
ibc.applications.transfer.v1.rs

1/// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between
2/// ICS20 enabled chains. See ICS Spec here:
3/// <https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures>
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct MsgTransfer {
7    /// the port on which the packet will be sent
8    #[prost(string, tag = "1")]
9    pub source_port: ::prost::alloc::string::String,
10    /// the channel by which the packet will be sent
11    #[prost(string, tag = "2")]
12    pub source_channel: ::prost::alloc::string::String,
13    /// the tokens to be transferred
14    #[prost(message, optional, tag = "3")]
15    pub token: ::core::option::Option<super::super::super::super::cosmos::base::v1beta1::Coin>,
16    /// the sender address
17    #[prost(string, tag = "4")]
18    pub sender: ::prost::alloc::string::String,
19    /// the recipient address on the destination chain
20    #[prost(string, tag = "5")]
21    pub receiver: ::prost::alloc::string::String,
22    /// Timeout height relative to the current block height.
23    /// The timeout is disabled when set to 0.
24    #[prost(message, optional, tag = "6")]
25    pub timeout_height: ::core::option::Option<super::super::super::core::client::v1::Height>,
26    /// Timeout timestamp in absolute nanoseconds since unix epoch.
27    /// The timeout is disabled when set to 0.
28    #[prost(uint64, tag = "7")]
29    pub timeout_timestamp: u64,
30}
31/// MsgTransferResponse defines the Msg/Transfer response type.
32#[allow(clippy::derive_partial_eq_without_eq)]
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct MsgTransferResponse {}
35/// Generated client implementations.
36#[cfg(feature = "grpc")]
37#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
38pub mod msg_client {
39    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
40    use tonic::codegen::http::Uri;
41    use tonic::codegen::*;
42    /// Msg defines the ibc/transfer Msg service.
43    #[derive(Debug, Clone)]
44    pub struct MsgClient<T> {
45        inner: tonic::client::Grpc<T>,
46    }
47    #[cfg(feature = "grpc-transport")]
48    #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
49    impl MsgClient<tonic::transport::Channel> {
50        /// Attempt to create a new client by connecting to a given endpoint.
51        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
52        where
53            D: std::convert::TryInto<tonic::transport::Endpoint>,
54            D::Error: Into<StdError>,
55        {
56            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
57            Ok(Self::new(conn))
58        }
59    }
60    impl<T> MsgClient<T>
61    where
62        T: tonic::client::GrpcService<tonic::body::BoxBody>,
63        T::Error: Into<StdError>,
64        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
65        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
66    {
67        pub fn new(inner: T) -> Self {
68            let inner = tonic::client::Grpc::new(inner);
69            Self { inner }
70        }
71        pub fn with_origin(inner: T, origin: Uri) -> Self {
72            let inner = tonic::client::Grpc::with_origin(inner, origin);
73            Self { inner }
74        }
75        pub fn with_interceptor<F>(inner: T, interceptor: F) -> MsgClient<InterceptedService<T, F>>
76        where
77            F: tonic::service::Interceptor,
78            T::ResponseBody: Default,
79            T: tonic::codegen::Service<
80                http::Request<tonic::body::BoxBody>,
81                Response = http::Response<
82                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
83                >,
84            >,
85            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
86                Into<StdError> + Send + Sync,
87        {
88            MsgClient::new(InterceptedService::new(inner, interceptor))
89        }
90        /// Compress requests with the given encoding.
91        ///
92        /// This requires the server to support it otherwise it might respond with an
93        /// error.
94        #[must_use]
95        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
96            self.inner = self.inner.send_compressed(encoding);
97            self
98        }
99        /// Enable decompressing responses.
100        #[must_use]
101        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
102            self.inner = self.inner.accept_compressed(encoding);
103            self
104        }
105        /// Transfer defines a rpc handler method for MsgTransfer.
106        pub async fn transfer(
107            &mut self,
108            request: impl tonic::IntoRequest<super::MsgTransfer>,
109        ) -> Result<tonic::Response<super::MsgTransferResponse>, tonic::Status> {
110            self.inner.ready().await.map_err(|e| {
111                tonic::Status::new(
112                    tonic::Code::Unknown,
113                    format!("Service was not ready: {}", e.into()),
114                )
115            })?;
116            let codec = tonic::codec::ProstCodec::default();
117            let path =
118                http::uri::PathAndQuery::from_static("/ibc.applications.transfer.v1.Msg/Transfer");
119            self.inner.unary(request.into_request(), path, codec).await
120        }
121    }
122}
123/// DenomTrace contains the base denomination for ICS20 fungible tokens and the
124/// source tracing information path.
125#[allow(clippy::derive_partial_eq_without_eq)]
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct DenomTrace {
128    /// path defines the chain of port/channel identifiers used for tracing the
129    /// source of the fungible token.
130    #[prost(string, tag = "1")]
131    pub path: ::prost::alloc::string::String,
132    /// base denomination of the relayed fungible token.
133    #[prost(string, tag = "2")]
134    pub base_denom: ::prost::alloc::string::String,
135}
136/// Params defines the set of IBC transfer parameters.
137/// NOTE: To prevent a single token from being transferred, set the
138/// TransfersEnabled parameter to true and then set the bank module's SendEnabled
139/// parameter for the denomination to false.
140#[allow(clippy::derive_partial_eq_without_eq)]
141#[derive(Clone, PartialEq, ::prost::Message)]
142pub struct Params {
143    /// send_enabled enables or disables all cross-chain token transfers from this
144    /// chain.
145    #[prost(bool, tag = "1")]
146    pub send_enabled: bool,
147    /// receive_enabled enables or disables all cross-chain token transfers to this
148    /// chain.
149    #[prost(bool, tag = "2")]
150    pub receive_enabled: bool,
151}
152/// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC
153/// method
154#[allow(clippy::derive_partial_eq_without_eq)]
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct QueryDenomTraceRequest {
157    /// hash (in hex format) of the denomination trace information.
158    #[prost(string, tag = "1")]
159    pub hash: ::prost::alloc::string::String,
160}
161/// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC
162/// method.
163#[allow(clippy::derive_partial_eq_without_eq)]
164#[derive(Clone, PartialEq, ::prost::Message)]
165pub struct QueryDenomTraceResponse {
166    /// denom_trace returns the requested denomination trace information.
167    #[prost(message, optional, tag = "1")]
168    pub denom_trace: ::core::option::Option<DenomTrace>,
169}
170/// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC
171/// method
172#[allow(clippy::derive_partial_eq_without_eq)]
173#[derive(Clone, PartialEq, ::prost::Message)]
174pub struct QueryDenomTracesRequest {
175    /// pagination defines an optional pagination for the request.
176    #[prost(message, optional, tag = "1")]
177    pub pagination: ::core::option::Option<
178        super::super::super::super::cosmos::base::query::v1beta1::PageRequest,
179    >,
180}
181/// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC
182/// method.
183#[allow(clippy::derive_partial_eq_without_eq)]
184#[derive(Clone, PartialEq, ::prost::Message)]
185pub struct QueryDenomTracesResponse {
186    /// denom_traces returns all denominations trace information.
187    #[prost(message, repeated, tag = "1")]
188    pub denom_traces: ::prost::alloc::vec::Vec<DenomTrace>,
189    /// pagination defines the pagination in the response.
190    #[prost(message, optional, tag = "2")]
191    pub pagination: ::core::option::Option<
192        super::super::super::super::cosmos::base::query::v1beta1::PageResponse,
193    >,
194}
195/// QueryParamsRequest is the request type for the Query/Params RPC method.
196#[allow(clippy::derive_partial_eq_without_eq)]
197#[derive(Clone, PartialEq, ::prost::Message)]
198pub struct QueryParamsRequest {}
199/// QueryParamsResponse is the response type for the Query/Params RPC method.
200#[allow(clippy::derive_partial_eq_without_eq)]
201#[derive(Clone, PartialEq, ::prost::Message)]
202pub struct QueryParamsResponse {
203    /// params defines the parameters of the module.
204    #[prost(message, optional, tag = "1")]
205    pub params: ::core::option::Option<Params>,
206}
207/// QueryDenomHashRequest is the request type for the Query/DenomHash RPC
208/// method
209#[allow(clippy::derive_partial_eq_without_eq)]
210#[derive(Clone, PartialEq, ::prost::Message)]
211pub struct QueryDenomHashRequest {
212    /// The denomination trace (\[port_id]/[channel_id])+/[denom\]
213    #[prost(string, tag = "1")]
214    pub trace: ::prost::alloc::string::String,
215}
216/// QueryDenomHashResponse is the response type for the Query/DenomHash RPC
217/// method.
218#[allow(clippy::derive_partial_eq_without_eq)]
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct QueryDenomHashResponse {
221    /// hash (in hex format) of the denomination trace information.
222    #[prost(string, tag = "1")]
223    pub hash: ::prost::alloc::string::String,
224}
225/// Generated client implementations.
226#[cfg(feature = "grpc")]
227#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
228pub mod query_client {
229    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
230    use tonic::codegen::http::Uri;
231    use tonic::codegen::*;
232    /// Query provides defines the gRPC querier service.
233    #[derive(Debug, Clone)]
234    pub struct QueryClient<T> {
235        inner: tonic::client::Grpc<T>,
236    }
237    #[cfg(feature = "grpc-transport")]
238    #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
239    impl QueryClient<tonic::transport::Channel> {
240        /// Attempt to create a new client by connecting to a given endpoint.
241        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
242        where
243            D: std::convert::TryInto<tonic::transport::Endpoint>,
244            D::Error: Into<StdError>,
245        {
246            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
247            Ok(Self::new(conn))
248        }
249    }
250    impl<T> QueryClient<T>
251    where
252        T: tonic::client::GrpcService<tonic::body::BoxBody>,
253        T::Error: Into<StdError>,
254        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
255        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
256    {
257        pub fn new(inner: T) -> Self {
258            let inner = tonic::client::Grpc::new(inner);
259            Self { inner }
260        }
261        pub fn with_origin(inner: T, origin: Uri) -> Self {
262            let inner = tonic::client::Grpc::with_origin(inner, origin);
263            Self { inner }
264        }
265        pub fn with_interceptor<F>(
266            inner: T,
267            interceptor: F,
268        ) -> QueryClient<InterceptedService<T, F>>
269        where
270            F: tonic::service::Interceptor,
271            T::ResponseBody: Default,
272            T: tonic::codegen::Service<
273                http::Request<tonic::body::BoxBody>,
274                Response = http::Response<
275                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
276                >,
277            >,
278            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
279                Into<StdError> + Send + Sync,
280        {
281            QueryClient::new(InterceptedService::new(inner, interceptor))
282        }
283        /// Compress requests with the given encoding.
284        ///
285        /// This requires the server to support it otherwise it might respond with an
286        /// error.
287        #[must_use]
288        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
289            self.inner = self.inner.send_compressed(encoding);
290            self
291        }
292        /// Enable decompressing responses.
293        #[must_use]
294        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
295            self.inner = self.inner.accept_compressed(encoding);
296            self
297        }
298        /// DenomTrace queries a denomination trace information.
299        pub async fn denom_trace(
300            &mut self,
301            request: impl tonic::IntoRequest<super::QueryDenomTraceRequest>,
302        ) -> Result<tonic::Response<super::QueryDenomTraceResponse>, tonic::Status> {
303            self.inner.ready().await.map_err(|e| {
304                tonic::Status::new(
305                    tonic::Code::Unknown,
306                    format!("Service was not ready: {}", e.into()),
307                )
308            })?;
309            let codec = tonic::codec::ProstCodec::default();
310            let path = http::uri::PathAndQuery::from_static(
311                "/ibc.applications.transfer.v1.Query/DenomTrace",
312            );
313            self.inner.unary(request.into_request(), path, codec).await
314        }
315        /// DenomTraces queries all denomination traces.
316        pub async fn denom_traces(
317            &mut self,
318            request: impl tonic::IntoRequest<super::QueryDenomTracesRequest>,
319        ) -> Result<tonic::Response<super::QueryDenomTracesResponse>, tonic::Status> {
320            self.inner.ready().await.map_err(|e| {
321                tonic::Status::new(
322                    tonic::Code::Unknown,
323                    format!("Service was not ready: {}", e.into()),
324                )
325            })?;
326            let codec = tonic::codec::ProstCodec::default();
327            let path = http::uri::PathAndQuery::from_static(
328                "/ibc.applications.transfer.v1.Query/DenomTraces",
329            );
330            self.inner.unary(request.into_request(), path, codec).await
331        }
332        /// Params queries all parameters of the ibc-transfer module.
333        pub async fn params(
334            &mut self,
335            request: impl tonic::IntoRequest<super::QueryParamsRequest>,
336        ) -> Result<tonic::Response<super::QueryParamsResponse>, tonic::Status> {
337            self.inner.ready().await.map_err(|e| {
338                tonic::Status::new(
339                    tonic::Code::Unknown,
340                    format!("Service was not ready: {}", e.into()),
341                )
342            })?;
343            let codec = tonic::codec::ProstCodec::default();
344            let path =
345                http::uri::PathAndQuery::from_static("/ibc.applications.transfer.v1.Query/Params");
346            self.inner.unary(request.into_request(), path, codec).await
347        }
348        /// DenomHash queries a denomination hash information.
349        pub async fn denom_hash(
350            &mut self,
351            request: impl tonic::IntoRequest<super::QueryDenomHashRequest>,
352        ) -> Result<tonic::Response<super::QueryDenomHashResponse>, tonic::Status> {
353            self.inner.ready().await.map_err(|e| {
354                tonic::Status::new(
355                    tonic::Code::Unknown,
356                    format!("Service was not ready: {}", e.into()),
357                )
358            })?;
359            let codec = tonic::codec::ProstCodec::default();
360            let path = http::uri::PathAndQuery::from_static(
361                "/ibc.applications.transfer.v1.Query/DenomHash",
362            );
363            self.inner.unary(request.into_request(), path, codec).await
364        }
365    }
366}
367/// GenesisState defines the ibc-transfer genesis state
368#[allow(clippy::derive_partial_eq_without_eq)]
369#[derive(Clone, PartialEq, ::prost::Message)]
370pub struct GenesisState {
371    #[prost(string, tag = "1")]
372    pub port_id: ::prost::alloc::string::String,
373    #[prost(message, repeated, tag = "2")]
374    pub denom_traces: ::prost::alloc::vec::Vec<DenomTrace>,
375    #[prost(message, optional, tag = "3")]
376    pub params: ::core::option::Option<Params>,
377}