/// Params defines the parameters for the bank module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { /// Deprecated: Use of SendEnabled in params is deprecated. /// For genesis, use the newly added send_enabled field in the genesis object. /// Storage, lookup, and manipulation of this information is now in the keeper. /// /// As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. #[deprecated] #[prost(message, repeated, tag = "1")] pub send_enabled: ::prost::alloc::vec::Vec, #[prost(bool, tag = "2")] pub default_send_enabled: bool, } /// SendEnabled maps coin denom to a send_enabled status (whether a denom is /// sendable). #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendEnabled { #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, #[prost(bool, tag = "2")] pub enabled: bool, } /// Input models transaction input. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Input { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, #[prost(message, repeated, tag = "2")] pub coins: ::prost::alloc::vec::Vec, } /// Output models transaction outputs. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Output { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, #[prost(message, repeated, tag = "2")] pub coins: ::prost::alloc::vec::Vec, } /// Supply represents a struct that passively keeps track of the total supply /// amounts in the network. /// This message is deprecated now that supply is indexed by denom. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Supply { #[prost(message, repeated, tag = "1")] pub total: ::prost::alloc::vec::Vec, } /// DenomUnit represents a struct that describes a given /// denomination unit of the basic token. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomUnit { /// denom represents the string name of the given denom unit (e.g uatom). #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, /// exponent represents power of 10 exponent that one must /// raise the base_denom to in order to equal the given DenomUnit's denom /// 1 denom = 10^exponent base_denom /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with /// exponent = 6, thus: 1 atom = 10^6 uatom). #[prost(uint32, tag = "2")] pub exponent: u32, /// aliases is a list of string aliases for the given denom #[prost(string, repeated, tag = "3")] pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// Metadata represents a struct that describes /// a basic token. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { #[prost(string, tag = "1")] pub description: ::prost::alloc::string::String, /// denom_units represents the list of DenomUnit's for a given coin #[prost(message, repeated, tag = "2")] pub denom_units: ::prost::alloc::vec::Vec, /// base represents the base denom (should be the DenomUnit with exponent = 0). #[prost(string, tag = "3")] pub base: ::prost::alloc::string::String, /// display indicates the suggested denom that should be /// displayed in clients. #[prost(string, tag = "4")] pub display: ::prost::alloc::string::String, /// name defines the name of the token (eg: Cosmos Atom) /// /// Since: cosmos-sdk 0.43 #[prost(string, tag = "5")] pub name: ::prost::alloc::string::String, /// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can /// be the same as the display. /// /// Since: cosmos-sdk 0.43 #[prost(string, tag = "6")] pub symbol: ::prost::alloc::string::String, /// URI to a document (on or off-chain) that contains additional information. Optional. /// /// Since: cosmos-sdk 0.46 #[prost(string, tag = "7")] pub uri: ::prost::alloc::string::String, /// URIHash is a sha256 hash of a document pointed by URI. It's used to verify that /// the document didn't change. Optional. /// /// Since: cosmos-sdk 0.46 #[prost(string, tag = "8")] pub uri_hash: ::prost::alloc::string::String, } /// GenesisState defines the bank module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// params defines all the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, /// balances is an array containing the balances of all the accounts. #[prost(message, repeated, tag = "2")] pub balances: ::prost::alloc::vec::Vec, /// supply represents the total supply. If it is left empty, then supply will be calculated based on the provided /// balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. #[prost(message, repeated, tag = "3")] pub supply: ::prost::alloc::vec::Vec, /// denom_metadata defines the metadata of the different coins. #[prost(message, repeated, tag = "4")] pub denom_metadata: ::prost::alloc::vec::Vec, /// send_enabled defines the denoms where send is enabled or disabled. /// /// Since: cosmos-sdk 0.47 #[prost(message, repeated, tag = "5")] pub send_enabled: ::prost::alloc::vec::Vec, } /// Balance defines an account address and balance pair used in the bank module's /// genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Balance { /// address is the address of the balance holder. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, /// coins defines the different coins this balance holds. #[prost(message, repeated, tag = "2")] pub coins: ::prost::alloc::vec::Vec, } /// QueryBalanceRequest is the request type for the Query/Balance RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceRequest { /// address is the address to query balances for. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, /// denom is the coin denom to query balances for. #[prost(string, tag = "2")] pub denom: ::prost::alloc::string::String, } /// QueryBalanceResponse is the response type for the Query/Balance RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceResponse { /// balance is the balance of the coin. #[prost(message, optional, tag = "1")] pub balance: ::core::option::Option, } /// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllBalancesRequest { /// address is the address to query balances for. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllBalancesResponse { /// balances is the balances of all the coins. #[prost(message, repeated, tag = "1")] pub balances: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QuerySpendableBalancesRequest defines the gRPC request structure for querying /// an account's spendable balances. /// /// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesRequest { /// address is the address to query spendable balances for. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QuerySpendableBalancesResponse defines the gRPC response structure for querying /// an account's spendable balances. /// /// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesResponse { /// balances is the spendable balances of all the coins. #[prost(message, repeated, tag = "1")] pub balances: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for /// querying an account's spendable balance for a specific denom. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalanceByDenomRequest { /// address is the address to query balances for. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, /// denom is the coin denom to query balances for. #[prost(string, tag = "2")] pub denom: ::prost::alloc::string::String, } /// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for /// querying an account's spendable balance for a specific denom. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalanceByDenomResponse { /// balance is the balance of the coin. #[prost(message, optional, tag = "1")] pub balance: ::core::option::Option, } /// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalSupplyRequest { /// pagination defines an optional pagination for the request. /// /// Since: cosmos-sdk 0.43 #[prost(message, optional, tag = "1")] pub pagination: ::core::option::Option, } /// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC /// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalSupplyResponse { /// supply is the supply of the coins #[prost(message, repeated, tag = "1")] pub supply: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. /// /// Since: cosmos-sdk 0.43 #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyOfRequest { /// denom is the coin denom to query balances for. #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, } /// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyOfResponse { /// amount is the supply of the coin. #[prost(message, optional, tag = "1")] pub amount: ::core::option::Option, } /// QueryParamsRequest defines the request type for querying x/bank parameters. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} /// QueryParamsResponse defines the response type for querying x/bank parameters. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } /// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomsMetadataRequest { /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "1")] pub pagination: ::core::option::Option, } /// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomsMetadataResponse { /// metadata provides the client information for all the registered tokens. #[prost(message, repeated, tag = "1")] pub metadatas: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomMetadataRequest { /// denom is the coin denom to query the metadata for. #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, } /// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomMetadataResponse { /// metadata describes and provides all the client information for the requested token. #[prost(message, optional, tag = "1")] pub metadata: ::core::option::Option, } /// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, /// which queries for a paginated set of all account holders of a particular /// denomination. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersRequest { /// denom defines the coin denomination to query all account holders for. #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// DenomOwner defines structure representing an account that owns or holds a /// particular denominated token. It contains the account address and account /// balance of the denominated token. /// /// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomOwner { /// address defines the address that owns a particular denomination. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, /// balance is the balance of the denominated coin for an account. #[prost(message, optional, tag = "2")] pub balance: ::core::option::Option, } /// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. /// /// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersResponse { #[prost(message, repeated, tag = "1")] pub denom_owners: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySendEnabledRequest { /// denoms is the specific denoms you want look up. Leave empty to get all entries. #[prost(string, repeated, tag = "1")] pub denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// pagination defines an optional pagination for the request. This field is /// only read if the denoms field is empty. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } /// QuerySendEnabledResponse defines the RPC response of a SendEnable query. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySendEnabledResponse { #[prost(message, repeated, tag = "1")] pub send_enabled: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. This field is only /// populated if the denoms field in the request is empty. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } /// 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 } /// Balance queries the balance of a single coin for a single account. pub async fn balance( &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("/cosmos.bank.v1beta1.Query/Balance"); self.inner.unary(request.into_request(), path, codec).await } /// AllBalances queries the balance of all coins for a single account. /// /// When called from another module, this query might consume a high amount of /// gas if the pagination field is incorrectly set. pub async fn all_balances( &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("/cosmos.bank.v1beta1.Query/AllBalances"); self.inner.unary(request.into_request(), path, codec).await } /// SpendableBalances queries the spendable balance of all coins for a single /// account. /// /// When called from another module, this query might consume a high amount of /// gas if the pagination field is incorrectly set. /// /// Since: cosmos-sdk 0.46 pub async fn spendable_balances( &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( "/cosmos.bank.v1beta1.Query/SpendableBalances", ); self.inner.unary(request.into_request(), path, codec).await } /// SpendableBalanceByDenom queries the spendable balance of a single denom for /// a single account. /// /// When called from another module, this query might consume a high amount of /// gas if the pagination field is incorrectly set. /// /// Since: cosmos-sdk 0.47 pub async fn spendable_balance_by_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( "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom", ); self.inner.unary(request.into_request(), path, codec).await } /// TotalSupply queries the total supply of all coins. /// /// When called from another module, this query might consume a high amount of /// gas if the pagination field is incorrectly set. pub async fn total_supply( &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("/cosmos.bank.v1beta1.Query/TotalSupply"); self.inner.unary(request.into_request(), path, codec).await } /// SupplyOf queries the supply of a single coin. /// /// When called from another module, this query might consume a high amount of /// gas if the pagination field is incorrectly set. pub async fn supply_of( &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("/cosmos.bank.v1beta1.Query/SupplyOf"); self.inner.unary(request.into_request(), path, codec).await } /// Params queries the parameters of x/bank module. 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("/cosmos.bank.v1beta1.Query/Params"); self.inner.unary(request.into_request(), path, codec).await } /// DenomsMetadata queries the client metadata of a given coin denomination. pub async fn 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("/cosmos.bank.v1beta1.Query/DenomMetadata"); self.inner.unary(request.into_request(), path, codec).await } /// DenomsMetadata queries the client metadata for all registered coin /// denominations. pub async fn denoms_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("/cosmos.bank.v1beta1.Query/DenomsMetadata"); self.inner.unary(request.into_request(), path, codec).await } /// DenomOwners queries for all account addresses that own a particular token /// denomination. /// /// When called from another module, this query might consume a high amount of /// gas if the pagination field is incorrectly set. /// /// Since: cosmos-sdk 0.46 pub async fn denom_owners( &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("/cosmos.bank.v1beta1.Query/DenomOwners"); self.inner.unary(request.into_request(), path, codec).await } /// SendEnabled queries for SendEnabled entries. /// /// This query only returns denominations that have specific SendEnabled settings. /// Any denomination that does not have a specific setting will use the default /// params.default_send_enabled, and will not be returned by this query. /// /// Since: cosmos-sdk 0.47 pub async fn send_enabled( &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("/cosmos.bank.v1beta1.Query/SendEnabled"); 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 { /// Balance queries the balance of a single coin for a single account. async fn balance( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// AllBalances queries the balance of all coins for a single account. /// /// When called from another module, this query might consume a high amount of /// gas if the pagination field is incorrectly set. async fn all_balances( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// SpendableBalances queries the spendable balance of all coins for a single /// account. /// /// When called from another module, this query might consume a high amount of /// gas if the pagination field is incorrectly set. /// /// Since: cosmos-sdk 0.46 async fn spendable_balances( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// SpendableBalanceByDenom queries the spendable balance of a single denom for /// a single account. /// /// When called from another module, this query might consume a high amount of /// gas if the pagination field is incorrectly set. /// /// Since: cosmos-sdk 0.47 async fn spendable_balance_by_denom( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// TotalSupply queries the total supply of all coins. /// /// When called from another module, this query might consume a high amount of /// gas if the pagination field is incorrectly set. async fn total_supply( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// SupplyOf queries the supply of a single coin. /// /// When called from another module, this query might consume a high amount of /// gas if the pagination field is incorrectly set. async fn supply_of( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Params queries the parameters of x/bank module. async fn params( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// DenomsMetadata queries the client metadata of a given coin denomination. async fn denom_metadata( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// DenomsMetadata queries the client metadata for all registered coin /// denominations. async fn denoms_metadata( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// DenomOwners queries for all account addresses that own a particular token /// denomination. /// /// When called from another module, this query might consume a high amount of /// gas if the pagination field is incorrectly set. /// /// Since: cosmos-sdk 0.46 async fn denom_owners( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// SendEnabled queries for SendEnabled entries. /// /// This query only returns denominations that have specific SendEnabled settings. /// Any denomination that does not have a specific setting will use the default /// params.default_send_enabled, and will not be returned by this query. /// /// Since: cosmos-sdk 0.47 async fn send_enabled( &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() { "/cosmos.bank.v1beta1.Query/Balance" => { #[allow(non_camel_case_types)] struct BalanceSvc(pub Arc); impl tonic::server::UnaryService for BalanceSvc { type Response = super::QueryBalanceResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).balance(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 = BalanceSvc(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) } "/cosmos.bank.v1beta1.Query/AllBalances" => { #[allow(non_camel_case_types)] struct AllBalancesSvc(pub Arc); impl tonic::server::UnaryService for AllBalancesSvc { type Response = super::QueryAllBalancesResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).all_balances(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 = AllBalancesSvc(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) } "/cosmos.bank.v1beta1.Query/SpendableBalances" => { #[allow(non_camel_case_types)] struct SpendableBalancesSvc(pub Arc); impl tonic::server::UnaryService for SpendableBalancesSvc { type Response = super::QuerySpendableBalancesResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).spendable_balances(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 = SpendableBalancesSvc(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) } "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom" => { #[allow(non_camel_case_types)] struct SpendableBalanceByDenomSvc(pub Arc); impl tonic::server::UnaryService for SpendableBalanceByDenomSvc { type Response = super::QuerySpendableBalanceByDenomResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).spendable_balance_by_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 = SpendableBalanceByDenomSvc(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) } "/cosmos.bank.v1beta1.Query/TotalSupply" => { #[allow(non_camel_case_types)] struct TotalSupplySvc(pub Arc); impl tonic::server::UnaryService for TotalSupplySvc { type Response = super::QueryTotalSupplyResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).total_supply(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 = TotalSupplySvc(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) } "/cosmos.bank.v1beta1.Query/SupplyOf" => { #[allow(non_camel_case_types)] struct SupplyOfSvc(pub Arc); impl tonic::server::UnaryService for SupplyOfSvc { type Response = super::QuerySupplyOfResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).supply_of(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 = SupplyOfSvc(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) } "/cosmos.bank.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) } "/cosmos.bank.v1beta1.Query/DenomMetadata" => { #[allow(non_camel_case_types)] struct DenomMetadataSvc(pub Arc); impl tonic::server::UnaryService for DenomMetadataSvc { type Response = super::QueryDenomMetadataResponse; 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_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 = DenomMetadataSvc(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) } "/cosmos.bank.v1beta1.Query/DenomsMetadata" => { #[allow(non_camel_case_types)] struct DenomsMetadataSvc(pub Arc); impl tonic::server::UnaryService for DenomsMetadataSvc { type Response = super::QueryDenomsMetadataResponse; 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_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 = DenomsMetadataSvc(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) } "/cosmos.bank.v1beta1.Query/DenomOwners" => { #[allow(non_camel_case_types)] struct DenomOwnersSvc(pub Arc); impl tonic::server::UnaryService for DenomOwnersSvc { type Response = super::QueryDenomOwnersResponse; 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_owners(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 = DenomOwnersSvc(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) } "/cosmos.bank.v1beta1.Query/SendEnabled" => { #[allow(non_camel_case_types)] struct SendEnabledSvc(pub Arc); impl tonic::server::UnaryService for SendEnabledSvc { type Response = super::QuerySendEnabledResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).send_enabled(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 = SendEnabledSvc(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 = "cosmos.bank.v1beta1.Query"; } } /// MsgSend represents a message to send coins from one account to another. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSend { #[prost(string, tag = "1")] pub from_address: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub to_address: ::prost::alloc::string::String, #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } /// MsgSendResponse defines the Msg/Send response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendResponse {} /// MsgMultiSend represents an arbitrary multi-in, multi-out send message. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMultiSend { /// Inputs, despite being `repeated`, only allows one sender input. This is /// checked in MsgMultiSend's ValidateBasic. #[prost(message, repeated, tag = "1")] pub inputs: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "2")] pub outputs: ::prost::alloc::vec::Vec, } /// MsgMultiSendResponse defines the Msg/MultiSend response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMultiSendResponse {} /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { /// authority is the address that controls the module (defaults to x/gov unless overwritten). #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, /// params defines the x/bank parameters to update. /// /// NOTE: All parameters must be supplied. #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} /// MsgSetSendEnabled is the Msg/SetSendEnabled request type. /// /// Only entries to add/update/delete need to be included. /// Existing SendEnabled entries that are not included in this /// message are left unchanged. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetSendEnabled { #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, /// send_enabled is the list of entries to add or update. #[prost(message, repeated, tag = "2")] pub send_enabled: ::prost::alloc::vec::Vec, /// use_default_for is a list of denoms that should use the params.default_send_enabled value. /// Denoms listed here will have their SendEnabled entries deleted. /// If a denom is included that doesn't have a SendEnabled entry, /// it will be ignored. #[prost(string, repeated, tag = "3")] pub use_default_for: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetSendEnabledResponse {} /// 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 bank Msg 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 } /// Send defines a method for sending coins from one account to another account. pub async fn send( &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("/cosmos.bank.v1beta1.Msg/Send"); self.inner.unary(request.into_request(), path, codec).await } /// MultiSend defines a method for sending coins from some accounts to other accounts. pub async fn multi_send( &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("/cosmos.bank.v1beta1.Msg/MultiSend"); self.inner.unary(request.into_request(), path, codec).await } /// UpdateParams defines a governance operation for updating the x/bank module parameters. /// The authority is defined in the keeper. /// /// Since: cosmos-sdk 0.47 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("/cosmos.bank.v1beta1.Msg/UpdateParams"); self.inner.unary(request.into_request(), path, codec).await } /// SetSendEnabled is a governance operation for setting the SendEnabled flag /// on any number of Denoms. Only the entries to add or update should be /// included. Entries that already exist in the store, but that aren't /// included in this message, will be left unchanged. /// /// Since: cosmos-sdk 0.47 pub async fn set_send_enabled( &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("/cosmos.bank.v1beta1.Msg/SetSendEnabled"); 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 { /// Send defines a method for sending coins from one account to another account. async fn send( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// MultiSend defines a method for sending coins from some accounts to other accounts. async fn multi_send( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// UpdateParams defines a governance operation for updating the x/bank module parameters. /// The authority is defined in the keeper. /// /// Since: cosmos-sdk 0.47 async fn update_params( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// SetSendEnabled is a governance operation for setting the SendEnabled flag /// on any number of Denoms. Only the entries to add or update should be /// included. Entries that already exist in the store, but that aren't /// included in this message, will be left unchanged. /// /// Since: cosmos-sdk 0.47 async fn set_send_enabled( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Msg defines the bank Msg 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() { "/cosmos.bank.v1beta1.Msg/Send" => { #[allow(non_camel_case_types)] struct SendSvc(pub Arc); impl tonic::server::UnaryService for SendSvc { type Response = super::MsgSendResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).send(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 = SendSvc(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) } "/cosmos.bank.v1beta1.Msg/MultiSend" => { #[allow(non_camel_case_types)] struct MultiSendSvc(pub Arc); impl tonic::server::UnaryService for MultiSendSvc { type Response = super::MsgMultiSendResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).multi_send(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 = MultiSendSvc(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) } "/cosmos.bank.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) } "/cosmos.bank.v1beta1.Msg/SetSendEnabled" => { #[allow(non_camel_case_types)] struct SetSendEnabledSvc(pub Arc); impl tonic::server::UnaryService for SetSendEnabledSvc { type Response = super::MsgSetSendEnabledResponse; 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_send_enabled(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 = SetSendEnabledSvc(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 = "cosmos.bank.v1beta1.Msg"; } } /// SendAuthorization allows the grantee to spend up to spend_limit coins from /// the granter's account. /// /// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendAuthorization { #[prost(message, repeated, tag = "1")] pub spend_limit: ::prost::alloc::vec::Vec, /// allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the /// granter. If omitted, any recipient is allowed. /// /// Since: cosmos-sdk 0.47 #[prost(string, repeated, tag = "2")] pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, }