/// DenomAuthorityMetadata specifies metadata for addresses that have specific /// capabilities over a token factory denom. Right now there is only one Admin /// permission, but is planned to be extended to the future. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomAuthorityMetadata { /// Can be empty for no admin, or a valid osmosis address #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, } /// Params defines the parameters for the tokenfactory module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { /// DenomCreationFee defines the fee to be charged on the creation of a new /// denom. The fee is drawn from the MsgCreateDenom's sender account, and /// transferred to the community pool. #[prost(message, repeated, tag = "1")] pub denom_creation_fee: ::prost::alloc::vec::Vec, /// DenomCreationGasConsume defines the gas cost for creating a new denom. /// This is intended as a spam deterrence mechanism. /// /// See: #[prost(uint64, tag = "2")] pub denom_creation_gas_consume: u64, } /// GenesisState defines the tokenfactory module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// params defines the paramaters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, #[prost(message, repeated, tag = "2")] pub factory_denoms: ::prost::alloc::vec::Vec, } /// GenesisDenom defines a tokenfactory denom that is defined within genesis /// state. The structure contains DenomAuthorityMetadata which defines the /// denom's admin. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisDenom { #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] pub authority_metadata: ::core::option::Option, } /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} /// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } /// QueryDenomAuthorityMetadataRequest defines the request structure for the /// DenomAuthorityMetadata gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomAuthorityMetadataRequest { #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, } /// QueryDenomAuthorityMetadataResponse defines the response structure for the /// DenomAuthorityMetadata gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomAuthorityMetadataResponse { #[prost(message, optional, tag = "1")] pub authority_metadata: ::core::option::Option, } /// QueryDenomsFromCreatorRequest defines the request structure for the /// DenomsFromCreator gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomsFromCreatorRequest { #[prost(string, tag = "1")] pub creator: ::prost::alloc::string::String, } /// QueryDenomsFromCreatorRequest defines the response structure for the /// DenomsFromCreator gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomsFromCreatorResponse { #[prost(string, repeated, tag = "1")] pub denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBeforeSendHookAddressRequest { #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, } /// QueryBeforeSendHookAddressResponse defines the response structure for the /// DenomBeforeSendHook gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBeforeSendHookAddressResponse { #[prost(string, tag = "1")] pub cosmwasm_address: ::prost::alloc::string::String, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; /// Query defines the gRPC querier service. #[derive(Debug, Clone)] pub struct QueryClient { inner: tonic::client::Grpc, } #[cfg(feature = "grpc-transport")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: std::convert::TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + Send + 'static, ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); Self { inner } } pub fn with_origin(inner: T, origin: Uri) -> Self { let inner = tonic::client::Grpc::with_origin(inner, origin); Self { inner } } pub fn with_interceptor( inner: T, interceptor: F, ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, >>::Error: Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// /// This requires the server to support it otherwise it might respond with an /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); self } /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); self } /// Params defines a gRPC query method that returns the tokenfactory module's /// parameters. pub async fn params( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/osmosis.tokenfactory.v1beta1.Query/Params"); self.inner.unary(request.into_request(), path, codec).await } /// Given the denom, returns the authority metadata for the denom. /// This method can receive both the denom encoded to URL (for the LCD requests) /// and the denom not encoded: /// e.g. factory%2Fterra1v0eee20gjl68fuk0chyrkch2z7suw2mhg3wkxf%2Futoken931 pub async fn denom_authority_metadata( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/osmosis.tokenfactory.v1beta1.Query/DenomAuthorityMetadata", ); self.inner.unary(request.into_request(), path, codec).await } /// DenomsFromCreator defines a gRPC query method for fetching all /// denominations created by a specific admin/creator. pub async fn denoms_from_creator( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/osmosis.tokenfactory.v1beta1.Query/DenomsFromCreator", ); self.inner.unary(request.into_request(), path, codec).await } /// BeforeSendHookAddress defines a gRPC query method for /// getting the address registered for the before send hook. pub async fn before_send_hook_address( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/osmosis.tokenfactory.v1beta1.Query/BeforeSendHookAddress", ); self.inner.unary(request.into_request(), path, codec).await } } } /// Generated server implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod query_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] pub trait Query: Send + Sync + 'static { /// Params defines a gRPC query method that returns the tokenfactory module's /// parameters. async fn params( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Given the denom, returns the authority metadata for the denom. /// This method can receive both the denom encoded to URL (for the LCD requests) /// and the denom not encoded: /// e.g. factory%2Fterra1v0eee20gjl68fuk0chyrkch2z7suw2mhg3wkxf%2Futoken931 async fn denom_authority_metadata( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// DenomsFromCreator defines a gRPC query method for fetching all /// denominations created by a specific admin/creator. async fn denoms_from_creator( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// BeforeSendHookAddress defines a gRPC query method for /// getting the address registered for the before send hook. async fn before_send_hook_address( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Query defines the gRPC querier service. #[derive(Debug)] pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, } struct _Inner(Arc); impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } /// Enable decompressing requests with the given encoding. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.accept_compression_encodings.enable(encoding); self } /// Compress responses with the given encoding, if the client supports it. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.send_compression_encodings.enable(encoding); self } } impl tonic::codegen::Service> for QueryServer where T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { "/osmosis.tokenfactory.v1beta1.Query/Params" => { #[allow(non_camel_case_types)] struct ParamsSvc(pub Arc); impl tonic::server::UnaryService for ParamsSvc { type Response = super::QueryParamsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).params(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/osmosis.tokenfactory.v1beta1.Query/DenomAuthorityMetadata" => { #[allow(non_camel_case_types)] struct DenomAuthorityMetadataSvc(pub Arc); impl tonic::server::UnaryService for DenomAuthorityMetadataSvc { type Response = super::QueryDenomAuthorityMetadataResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).denom_authority_metadata(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = DenomAuthorityMetadataSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/osmosis.tokenfactory.v1beta1.Query/DenomsFromCreator" => { #[allow(non_camel_case_types)] struct DenomsFromCreatorSvc(pub Arc); impl tonic::server::UnaryService for DenomsFromCreatorSvc { type Response = super::QueryDenomsFromCreatorResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).denoms_from_creator(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = DenomsFromCreatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/osmosis.tokenfactory.v1beta1.Query/BeforeSendHookAddress" => { #[allow(non_camel_case_types)] struct BeforeSendHookAddressSvc(pub Arc); impl tonic::server::UnaryService for BeforeSendHookAddressSvc { type Response = super::QueryBeforeSendHookAddressResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).before_send_hook_address(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = BeforeSendHookAddressSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) .header("grpc-status", "12") .header("content-type", "application/grpc") .body(empty_body()) .unwrap()) }), } } } impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, } } } impl Clone for _Inner { fn clone(&self) -> Self { Self(self.0.clone()) } } impl std::fmt::Debug for _Inner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self.0) } } impl tonic::server::NamedService for QueryServer { const NAME: &'static str = "osmosis.tokenfactory.v1beta1.Query"; } } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} /// MsgCreateDenom defines the message structure for the CreateDenom gRPC service /// method. It allows an account to create a new denom. It requires a sender /// address and a sub denomination. The (sender_address, sub_denomination) tuple /// must be unique and cannot be re-used. /// /// The resulting denom created is defined as /// . The resulting denom's admin is /// originally set to be the creator, but this can be changed later. The token /// denom does not indicate the current admin. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateDenom { #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, /// subdenom can be up to 44 "alphanumeric" characters long. #[prost(string, tag = "2")] pub subdenom: ::prost::alloc::string::String, } /// MsgCreateDenomResponse is the return value of MsgCreateDenom /// It returns the full string of the newly created denom #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateDenomResponse { #[prost(string, tag = "1")] pub new_token_denom: ::prost::alloc::string::String, } /// MsgMint is the sdk.Msg type for allowing an admin account to mint /// more of a token. For now, we only support minting to the sender account #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMint { #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] pub amount: ::core::option::Option, #[prost(string, tag = "3")] pub mint_to_address: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMintResponse {} /// MsgBurn is the sdk.Msg type for allowing an admin account to burn /// a token. For now, we only support burning from the sender account. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgBurn { #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] pub amount: ::core::option::Option, #[prost(string, tag = "3")] pub burn_from_address: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgBurnResponse {} /// MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign /// adminship of a denom to a new account #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChangeAdmin { #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub denom: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub new_admin: ::prost::alloc::string::String, } /// MsgChangeAdminResponse defines the response structure for an executed /// MsgChangeAdmin message. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChangeAdminResponse {} /// MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to /// assign a CosmWasm contract to call with a BeforeSend hook #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetBeforeSendHook { #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub denom: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub cosmwasm_address: ::prost::alloc::string::String, } /// MsgSetBeforeSendHookResponse defines the response structure for an executed /// MsgSetBeforeSendHook message. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetBeforeSendHookResponse {} /// MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set /// the denom's bank metadata #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetDenomMetadata { #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] pub metadata: ::core::option::Option, } /// MsgSetDenomMetadataResponse defines the response structure for an executed /// MsgSetDenomMetadata message. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetDenomMetadataResponse {} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgForceTransfer { #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] pub amount: ::core::option::Option, #[prost(string, tag = "3")] pub transfer_from_address: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub transfer_to_address: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgForceTransferResponse {} /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; /// Msg defines the tokefactory module's gRPC message service. #[derive(Debug, Clone)] pub struct MsgClient { inner: tonic::client::Grpc, } #[cfg(feature = "grpc-transport")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: std::convert::TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + Send + 'static, ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); Self { inner } } pub fn with_origin(inner: T, origin: Uri) -> Self { let inner = tonic::client::Grpc::with_origin(inner, origin); Self { inner } } pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, >>::Error: Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// /// This requires the server to support it otherwise it might respond with an /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); self } /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); self } pub async fn update_params( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/osmosis.tokenfactory.v1beta1.Msg/UpdateParams", ); self.inner.unary(request.into_request(), path, codec).await } pub async fn create_denom( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/osmosis.tokenfactory.v1beta1.Msg/CreateDenom", ); self.inner.unary(request.into_request(), path, codec).await } pub async fn mint( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/osmosis.tokenfactory.v1beta1.Msg/Mint"); self.inner.unary(request.into_request(), path, codec).await } pub async fn burn( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/osmosis.tokenfactory.v1beta1.Msg/Burn"); self.inner.unary(request.into_request(), path, codec).await } pub async fn change_admin( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/osmosis.tokenfactory.v1beta1.Msg/ChangeAdmin", ); self.inner.unary(request.into_request(), path, codec).await } pub async fn set_denom_metadata( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/osmosis.tokenfactory.v1beta1.Msg/SetDenomMetadata", ); self.inner.unary(request.into_request(), path, codec).await } pub async fn set_before_send_hook( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/osmosis.tokenfactory.v1beta1.Msg/SetBeforeSendHook", ); self.inner.unary(request.into_request(), path, codec).await } pub async fn force_transfer( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/osmosis.tokenfactory.v1beta1.Msg/ForceTransfer", ); self.inner.unary(request.into_request(), path, codec).await } } } /// Generated server implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod msg_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] pub trait Msg: Send + Sync + 'static { async fn update_params( &self, request: tonic::Request, ) -> Result, tonic::Status>; async fn create_denom( &self, request: tonic::Request, ) -> Result, tonic::Status>; async fn mint( &self, request: tonic::Request, ) -> Result, tonic::Status>; async fn burn( &self, request: tonic::Request, ) -> Result, tonic::Status>; async fn change_admin( &self, request: tonic::Request, ) -> Result, tonic::Status>; async fn set_denom_metadata( &self, request: tonic::Request, ) -> Result, tonic::Status>; async fn set_before_send_hook( &self, request: tonic::Request, ) -> Result, tonic::Status>; async fn force_transfer( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Msg defines the tokefactory module's gRPC message service. #[derive(Debug)] pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, } struct _Inner(Arc); impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } /// Enable decompressing requests with the given encoding. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.accept_compression_encodings.enable(encoding); self } /// Compress responses with the given encoding, if the client supports it. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.send_compression_encodings.enable(encoding); self } } impl tonic::codegen::Service> for MsgServer where T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { "/osmosis.tokenfactory.v1beta1.Msg/UpdateParams" => { #[allow(non_camel_case_types)] struct UpdateParamsSvc(pub Arc); impl tonic::server::UnaryService for UpdateParamsSvc { type Response = super::MsgUpdateParamsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).update_params(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/osmosis.tokenfactory.v1beta1.Msg/CreateDenom" => { #[allow(non_camel_case_types)] struct CreateDenomSvc(pub Arc); impl tonic::server::UnaryService for CreateDenomSvc { type Response = super::MsgCreateDenomResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).create_denom(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = CreateDenomSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/osmosis.tokenfactory.v1beta1.Msg/Mint" => { #[allow(non_camel_case_types)] struct MintSvc(pub Arc); impl tonic::server::UnaryService for MintSvc { type Response = super::MsgMintResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).mint(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = MintSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/osmosis.tokenfactory.v1beta1.Msg/Burn" => { #[allow(non_camel_case_types)] struct BurnSvc(pub Arc); impl tonic::server::UnaryService for BurnSvc { type Response = super::MsgBurnResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).burn(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = BurnSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/osmosis.tokenfactory.v1beta1.Msg/ChangeAdmin" => { #[allow(non_camel_case_types)] struct ChangeAdminSvc(pub Arc); impl tonic::server::UnaryService for ChangeAdminSvc { type Response = super::MsgChangeAdminResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).change_admin(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ChangeAdminSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/osmosis.tokenfactory.v1beta1.Msg/SetDenomMetadata" => { #[allow(non_camel_case_types)] struct SetDenomMetadataSvc(pub Arc); impl tonic::server::UnaryService for SetDenomMetadataSvc { type Response = super::MsgSetDenomMetadataResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).set_denom_metadata(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = SetDenomMetadataSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/osmosis.tokenfactory.v1beta1.Msg/SetBeforeSendHook" => { #[allow(non_camel_case_types)] struct SetBeforeSendHookSvc(pub Arc); impl tonic::server::UnaryService for SetBeforeSendHookSvc { type Response = super::MsgSetBeforeSendHookResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).set_before_send_hook(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = SetBeforeSendHookSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/osmosis.tokenfactory.v1beta1.Msg/ForceTransfer" => { #[allow(non_camel_case_types)] struct ForceTransferSvc(pub Arc); impl tonic::server::UnaryService for ForceTransferSvc { type Response = super::MsgForceTransferResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).force_transfer(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ForceTransferSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) .header("grpc-status", "12") .header("content-type", "application/grpc") .body(empty_body()) .unwrap()) }), } } } impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, } } } impl Clone for _Inner { fn clone(&self) -> Self { Self(self.0.clone()) } } impl std::fmt::Debug for _Inner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self.0) } } impl tonic::server::NamedService for MsgServer { const NAME: &'static str = "osmosis.tokenfactory.v1beta1.Msg"; } }