neutron_std/types/neutron/
revenue.rs

1use neutron_std_derive::CosmwasmExt;
2/// Defines the parameters for the module.
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(
5    Clone,
6    PartialEq,
7    Eq,
8    ::prost::Message,
9    ::serde::Serialize,
10    ::serde::Deserialize,
11    ::schemars::JsonSchema,
12    CosmwasmExt,
13)]
14#[proto_message(type_url = "/neutron.revenue.Params")]
15pub struct Params {
16    /// The asset used in revenue payments to validators. Expected to be a native token of the chain
17    /// with its denom metadata registered in the bank module. The denom metadata must have a defined
18    /// symbol field and contain a denom unit with an alias equal to the symbol and a specified
19    /// exponent.
20    #[prost(string, tag = "1")]
21    pub reward_asset: ::prost::alloc::string::String,
22    /// Quotation of the reward asset.
23    #[prost(message, optional, tag = "2")]
24    pub reward_quote: ::core::option::Option<RewardQuote>,
25    /// Specifies performance requirements for validators in scope of blocks signing and creation. If
26    /// not met, the validator is not rewarded.
27    #[prost(message, optional, tag = "3")]
28    pub blocks_performance_requirement: ::core::option::Option<PerformanceRequirement>,
29    /// Specifies performance requirements for validators in scope of the oracle price votes. If not
30    /// met, the validator is not rewarded.
31    #[prost(message, optional, tag = "4")]
32    pub oracle_votes_performance_requirement: ::core::option::Option<PerformanceRequirement>,
33    /// Indicates the currently active type of payment schedule.
34    #[prost(message, optional, tag = "5")]
35    pub payment_schedule_type: ::core::option::Option<PaymentScheduleType>,
36    /// The time window, in seconds, used to calculate the TWAP of the reward asset.
37    #[prost(int64, tag = "6")]
38    #[serde(
39        serialize_with = "crate::serde::as_str::serialize",
40        deserialize_with = "crate::serde::as_str::deserialize"
41    )]
42    pub twap_window: i64,
43}
44/// Defines information about the reward quote.
45#[allow(clippy::derive_partial_eq_without_eq)]
46#[derive(
47    Clone,
48    PartialEq,
49    Eq,
50    ::prost::Message,
51    ::serde::Serialize,
52    ::serde::Deserialize,
53    ::schemars::JsonSchema,
54    CosmwasmExt,
55)]
56#[proto_message(type_url = "/neutron.revenue.RewardQuote")]
57pub struct RewardQuote {
58    /// The compensation amount measured in the quote asset. The amount is divided by the price of
59    /// the reward asset to determine the base revenue amount.
60    #[prost(uint64, tag = "1")]
61    #[serde(
62        serialize_with = "crate::serde::as_str::serialize",
63        deserialize_with = "crate::serde::as_str::deserialize"
64    )]
65    pub amount: u64,
66    /// The name of the quote asset. It is used as a quote in price queries to the slinky oracle
67    /// module to determine the price of the reward asset.
68    #[prost(string, tag = "2")]
69    pub asset: ::prost::alloc::string::String,
70}
71/// A model that contains information specific to the currently active payment schedule type. The
72/// oneof implementations define the payment schedule that must be used currently.
73/// This is a module's parameter. It's not updated automatically in runtime in contrast to the
74/// payment schedule which is a state variable, but is updated via MsgUpdateParams.
75#[allow(clippy::derive_partial_eq_without_eq)]
76#[derive(
77    Clone,
78    PartialEq,
79    Eq,
80    ::prost::Message,
81    ::serde::Serialize,
82    ::serde::Deserialize,
83    ::schemars::JsonSchema,
84    CosmwasmExt,
85)]
86#[proto_message(type_url = "/neutron.revenue.PaymentScheduleType")]
87pub struct PaymentScheduleType {
88    #[prost(oneof = "payment_schedule_type::PaymentScheduleType", tags = "4, 5, 6")]
89    pub payment_schedule_type: ::core::option::Option<payment_schedule_type::PaymentScheduleType>,
90}
91/// Nested message and enum types in `PaymentScheduleType`.
92pub mod payment_schedule_type {
93    #[allow(clippy::derive_partial_eq_without_eq)]
94    #[derive(
95        Clone,
96        PartialEq,
97        Eq,
98        ::prost::Oneof,
99        ::serde::Serialize,
100        ::serde::Deserialize,
101        ::schemars::JsonSchema,
102    )]
103    pub enum PaymentScheduleType {
104        #[prost(message, tag = "4")]
105        MonthlyPaymentScheduleType(super::MonthlyPaymentScheduleType),
106        #[prost(message, tag = "5")]
107        BlockBasedPaymentScheduleType(super::BlockBasedPaymentScheduleType),
108        #[prost(message, tag = "6")]
109        EmptyPaymentScheduleType(super::EmptyPaymentScheduleType),
110    }
111}
112/// Monthly periods with payments made at the end of each month.
113#[allow(clippy::derive_partial_eq_without_eq)]
114#[derive(
115    Clone,
116    PartialEq,
117    Eq,
118    ::prost::Message,
119    ::serde::Serialize,
120    ::serde::Deserialize,
121    ::schemars::JsonSchema,
122    CosmwasmExt,
123)]
124#[proto_message(type_url = "/neutron.revenue.MonthlyPaymentScheduleType")]
125pub struct MonthlyPaymentScheduleType {}
126/// Periods defined by a specific number of blocks, with payments made when the required block
127/// count is reached.
128#[allow(clippy::derive_partial_eq_without_eq)]
129#[derive(
130    Clone,
131    PartialEq,
132    Eq,
133    ::prost::Message,
134    ::serde::Serialize,
135    ::serde::Deserialize,
136    ::schemars::JsonSchema,
137    CosmwasmExt,
138)]
139#[proto_message(type_url = "/neutron.revenue.BlockBasedPaymentScheduleType")]
140pub struct BlockBasedPaymentScheduleType {
141    /// The number of blocks in a payment period.
142    #[prost(uint64, tag = "1")]
143    #[serde(
144        serialize_with = "crate::serde::as_str::serialize",
145        deserialize_with = "crate::serde::as_str::deserialize"
146    )]
147    pub blocks_per_period: u64,
148}
149/// Endless periods with payments never made.
150#[allow(clippy::derive_partial_eq_without_eq)]
151#[derive(
152    Clone,
153    PartialEq,
154    Eq,
155    ::prost::Message,
156    ::serde::Serialize,
157    ::serde::Deserialize,
158    ::schemars::JsonSchema,
159    CosmwasmExt,
160)]
161#[proto_message(type_url = "/neutron.revenue.EmptyPaymentScheduleType")]
162pub struct EmptyPaymentScheduleType {}
163/// Specifies a performance criteria that validators must meet to qualify for network rewards.
164#[allow(clippy::derive_partial_eq_without_eq)]
165#[derive(
166    Clone,
167    PartialEq,
168    Eq,
169    ::prost::Message,
170    ::serde::Serialize,
171    ::serde::Deserialize,
172    ::schemars::JsonSchema,
173    CosmwasmExt,
174)]
175#[proto_message(type_url = "/neutron.revenue.PerformanceRequirement")]
176pub struct PerformanceRequirement {
177    /// The fraction of the total performance a validator can miss without affecting their reward.
178    /// Represented as a decimal value in the range [0.0, 1.0], where 1.0 corresponds to 100%.
179    #[prost(string, tag = "1")]
180    pub allowed_to_miss: ::prost::alloc::string::String,
181    /// The minimum fraction of the total performance a validator must achieve to be eligible for
182    /// network rewards. Validators falling below this threshold will not receive any rewards.
183    /// Represented as a decimal value in the range [0.0, 1.0], where 1.0 corresponds to 100%.
184    #[prost(string, tag = "2")]
185    pub required_at_least: ::prost::alloc::string::String,
186}
187/// Defines the revenue module's genesis state.
188#[allow(clippy::derive_partial_eq_without_eq)]
189#[derive(
190    Clone,
191    PartialEq,
192    Eq,
193    ::prost::Message,
194    ::serde::Serialize,
195    ::serde::Deserialize,
196    ::schemars::JsonSchema,
197    CosmwasmExt,
198)]
199#[proto_message(type_url = "/neutron.revenue.GenesisState")]
200pub struct GenesisState {
201    /// Revenue module parameters.
202    #[prost(message, optional, tag = "1")]
203    pub params: ::core::option::Option<Params>,
204    /// The current payment schedule. If nil, the module will use the respective payment schedule for
205    /// the payment schedule type specified in the params.
206    #[prost(message, optional, tag = "2")]
207    pub payment_schedule: ::core::option::Option<PaymentSchedule>,
208    /// Revenue module list of validators.
209    #[prost(message, repeated, tag = "3")]
210    pub validators: ::prost::alloc::vec::Vec<ValidatorInfo>,
211}
212/// A model that contains information specific to the currently active payment schedule. The oneof
213/// implementations define conditions for payment periods ending and track the progress of the
214/// current payment period. This is a module's state variable.
215/// The inner oneof must correspond with the respective payment schedule type defined in the module
216/// params. In runtime, on a mismatch due to e.g. MsgUpdateParams execution, the module will switch
217/// to the payment schedule that corresponds to the payment schedule type automatically.
218#[allow(clippy::derive_partial_eq_without_eq)]
219#[derive(
220    Clone,
221    PartialEq,
222    Eq,
223    ::prost::Message,
224    ::serde::Serialize,
225    ::serde::Deserialize,
226    ::schemars::JsonSchema,
227    CosmwasmExt,
228)]
229#[proto_message(type_url = "/neutron.revenue.PaymentSchedule")]
230pub struct PaymentSchedule {
231    #[prost(oneof = "payment_schedule::PaymentSchedule", tags = "1, 2, 3")]
232    pub payment_schedule: ::core::option::Option<payment_schedule::PaymentSchedule>,
233}
234/// Nested message and enum types in `PaymentSchedule`.
235pub mod payment_schedule {
236    #[allow(clippy::derive_partial_eq_without_eq)]
237    #[derive(
238        Clone,
239        PartialEq,
240        Eq,
241        ::prost::Oneof,
242        ::serde::Serialize,
243        ::serde::Deserialize,
244        ::schemars::JsonSchema,
245    )]
246    pub enum PaymentSchedule {
247        #[prost(message, tag = "1")]
248        MonthlyPaymentSchedule(super::MonthlyPaymentSchedule),
249        #[prost(message, tag = "2")]
250        BlockBasedPaymentSchedule(super::BlockBasedPaymentSchedule),
251        #[prost(message, tag = "3")]
252        EmptyPaymentSchedule(super::EmptyPaymentSchedule),
253    }
254}
255/// Contains information about a validator.
256#[allow(clippy::derive_partial_eq_without_eq)]
257#[derive(
258    Clone,
259    PartialEq,
260    Eq,
261    ::prost::Message,
262    ::serde::Serialize,
263    ::serde::Deserialize,
264    ::schemars::JsonSchema,
265    CosmwasmExt,
266)]
267#[proto_message(type_url = "/neutron.revenue.ValidatorInfo")]
268pub struct ValidatorInfo {
269    /// The validator's node operator address.
270    #[prost(string, tag = "1")]
271    pub val_oper_address: ::prost::alloc::string::String,
272    /// The number of blocks the validator has committed in the current payment period.
273    #[prost(uint64, tag = "2")]
274    #[serde(
275        serialize_with = "crate::serde::as_str::serialize",
276        deserialize_with = "crate::serde::as_str::deserialize"
277    )]
278    pub commited_blocks_in_period: u64,
279    /// The number of oracle votes the validator has submitted in the current payment period.
280    #[prost(uint64, tag = "3")]
281    #[serde(
282        serialize_with = "crate::serde::as_str::serialize",
283        deserialize_with = "crate::serde::as_str::deserialize"
284    )]
285    pub commited_oracle_votes_in_period: u64,
286    /// The number of blocks the validator has remained in the active validator set for in the
287    /// current payment period.
288    #[prost(uint64, tag = "4")]
289    #[serde(
290        serialize_with = "crate::serde::as_str::serialize",
291        deserialize_with = "crate::serde::as_str::deserialize"
292    )]
293    pub in_active_valset_for_blocks_in_period: u64,
294}
295/// Represents a payment schedule where revenue payments are processed once a month.
296#[allow(clippy::derive_partial_eq_without_eq)]
297#[derive(
298    Clone,
299    PartialEq,
300    Eq,
301    ::prost::Message,
302    ::serde::Serialize,
303    ::serde::Deserialize,
304    ::schemars::JsonSchema,
305    CosmwasmExt,
306)]
307#[proto_message(type_url = "/neutron.revenue.MonthlyPaymentSchedule")]
308pub struct MonthlyPaymentSchedule {
309    /// The block height at which the current month started.
310    #[prost(uint64, tag = "1")]
311    #[serde(
312        serialize_with = "crate::serde::as_str::serialize",
313        deserialize_with = "crate::serde::as_str::deserialize"
314    )]
315    pub current_month_start_block: u64,
316    /// The timestamp of the block at which the current month started.
317    #[prost(uint64, tag = "2")]
318    #[serde(
319        serialize_with = "crate::serde::as_str::serialize",
320        deserialize_with = "crate::serde::as_str::deserialize"
321    )]
322    pub current_month_start_block_ts: u64,
323}
324/// Represents a payment schedule where revenue payments are processed after a specified number
325/// of blocks.
326#[allow(clippy::derive_partial_eq_without_eq)]
327#[derive(
328    Clone,
329    PartialEq,
330    Eq,
331    ::prost::Message,
332    ::serde::Serialize,
333    ::serde::Deserialize,
334    ::schemars::JsonSchema,
335    CosmwasmExt,
336)]
337#[proto_message(type_url = "/neutron.revenue.BlockBasedPaymentSchedule")]
338pub struct BlockBasedPaymentSchedule {
339    /// The number of blocks in each payment period.
340    #[prost(uint64, tag = "1")]
341    #[serde(
342        serialize_with = "crate::serde::as_str::serialize",
343        deserialize_with = "crate::serde::as_str::deserialize"
344    )]
345    pub blocks_per_period: u64,
346    /// The block height at which the current payment period started.
347    #[prost(uint64, tag = "2")]
348    #[serde(
349        serialize_with = "crate::serde::as_str::serialize",
350        deserialize_with = "crate::serde::as_str::deserialize"
351    )]
352    pub current_period_start_block: u64,
353}
354/// Represents a payment schedule where revenue is never distributed.
355#[allow(clippy::derive_partial_eq_without_eq)]
356#[derive(
357    Clone,
358    PartialEq,
359    Eq,
360    ::prost::Message,
361    ::serde::Serialize,
362    ::serde::Deserialize,
363    ::schemars::JsonSchema,
364    CosmwasmExt,
365)]
366#[proto_message(type_url = "/neutron.revenue.EmptyPaymentSchedule")]
367pub struct EmptyPaymentSchedule {}
368/// Represents a data structure that tracks the cumulative price of an asset over the entire
369/// observation period, along with the last absolute asset price and the timestamp when this
370/// price was last recorded.
371#[allow(clippy::derive_partial_eq_without_eq)]
372#[derive(
373    Clone,
374    PartialEq,
375    Eq,
376    ::prost::Message,
377    ::serde::Serialize,
378    ::serde::Deserialize,
379    ::schemars::JsonSchema,
380    CosmwasmExt,
381)]
382#[proto_message(type_url = "/neutron.revenue.RewardAssetPrice")]
383pub struct RewardAssetPrice {
384    /// The cumulative price of the reward asset within the TWAP window. It is calculated as:
385    /// `cumulative_price_at_timestamp_t(n)` = `last_price_at_t(n-1)` * (t(n) - t(n-1)) + `cumulative_price_at_timestamp_t(n-1)`
386    #[prost(string, tag = "1")]
387    pub cumulative_price: ::prost::alloc::string::String,
388    /// The price of the reward asset in reward quote asset that corresponds to the timestamp.
389    #[prost(string, tag = "2")]
390    pub absolute_price: ::prost::alloc::string::String,
391    /// The timestamp of the last update of the absolute and cumulative price.
392    #[prost(int64, tag = "3")]
393    #[serde(
394        serialize_with = "crate::serde::as_str::serialize",
395        deserialize_with = "crate::serde::as_str::deserialize"
396    )]
397    pub timestamp: i64,
398}
399/// Request type for the Msg/UpdateParams RPC method.
400#[allow(clippy::derive_partial_eq_without_eq)]
401#[derive(
402    Clone,
403    PartialEq,
404    Eq,
405    ::prost::Message,
406    ::serde::Serialize,
407    ::serde::Deserialize,
408    ::schemars::JsonSchema,
409    CosmwasmExt,
410)]
411#[proto_message(type_url = "/neutron.revenue.MsgUpdateParams")]
412pub struct MsgUpdateParams {
413    /// The address of the authority of the module.
414    #[prost(string, tag = "1")]
415    pub authority: ::prost::alloc::string::String,
416    /// The new parameters of the module. All parameters must be supplied.
417    #[prost(message, optional, tag = "2")]
418    pub params: ::core::option::Option<Params>,
419}
420/// Response type for the Msg/UpdateParams RPC method.
421#[allow(clippy::derive_partial_eq_without_eq)]
422#[derive(
423    Clone,
424    PartialEq,
425    Eq,
426    ::prost::Message,
427    ::serde::Serialize,
428    ::serde::Deserialize,
429    ::schemars::JsonSchema,
430    CosmwasmExt,
431)]
432#[proto_message(type_url = "/neutron.revenue.MsgUpdateParamsResponse")]
433pub struct MsgUpdateParamsResponse {}
434/// Request type for the Msg/FundTreasury RPC method.
435#[allow(clippy::derive_partial_eq_without_eq)]
436#[derive(
437    Clone,
438    PartialEq,
439    Eq,
440    ::prost::Message,
441    ::serde::Serialize,
442    ::serde::Deserialize,
443    ::schemars::JsonSchema,
444    CosmwasmExt,
445)]
446#[proto_message(type_url = "/neutron.revenue.MsgFundTreasury")]
447pub struct MsgFundTreasury {
448    /// The signer of the message.
449    #[prost(string, tag = "1")]
450    pub sender: ::prost::alloc::string::String,
451    /// The amount of coins to fund the revenue treasury pool with. Must match the reward asset denom.
452    #[prost(message, repeated, tag = "2")]
453    pub amount: ::prost::alloc::vec::Vec<super::super::cosmos::base::v1beta1::Coin>,
454}
455/// Response type for the Msg/FundTreasury RPC method.
456#[allow(clippy::derive_partial_eq_without_eq)]
457#[derive(
458    Clone,
459    PartialEq,
460    Eq,
461    ::prost::Message,
462    ::serde::Serialize,
463    ::serde::Deserialize,
464    ::schemars::JsonSchema,
465    CosmwasmExt,
466)]
467#[proto_message(type_url = "/neutron.revenue.MsgFundTreasuryResponse")]
468pub struct MsgFundTreasuryResponse {}
469/// Request type for the Query/Params RPC method.
470#[allow(clippy::derive_partial_eq_without_eq)]
471#[derive(
472    Clone,
473    PartialEq,
474    Eq,
475    ::prost::Message,
476    ::serde::Serialize,
477    ::serde::Deserialize,
478    ::schemars::JsonSchema,
479    CosmwasmExt,
480)]
481#[proto_message(type_url = "/neutron.revenue.QueryParamsRequest")]
482#[proto_query(
483    path = "/neutron.revenue.Query/Params",
484    response_type = QueryParamsResponse
485)]
486pub struct QueryParamsRequest {}
487/// Response type for the Query/Params RPC method.
488#[allow(clippy::derive_partial_eq_without_eq)]
489#[derive(
490    Clone,
491    PartialEq,
492    Eq,
493    ::prost::Message,
494    ::serde::Serialize,
495    ::serde::Deserialize,
496    ::schemars::JsonSchema,
497    CosmwasmExt,
498)]
499#[proto_message(type_url = "/neutron.revenue.QueryParamsResponse")]
500pub struct QueryParamsResponse {
501    /// Contains all parameters of the module.
502    #[prost(message, optional, tag = "1")]
503    pub params: ::core::option::Option<Params>,
504}
505/// Request type for the Query/PaymentInfo RPC method.
506#[allow(clippy::derive_partial_eq_without_eq)]
507#[derive(
508    Clone,
509    PartialEq,
510    Eq,
511    ::prost::Message,
512    ::serde::Serialize,
513    ::serde::Deserialize,
514    ::schemars::JsonSchema,
515    CosmwasmExt,
516)]
517#[proto_message(type_url = "/neutron.revenue.QueryPaymentInfoRequest")]
518#[proto_query(
519    path = "/neutron.revenue.Query/PaymentInfo",
520    response_type = QueryPaymentInfoResponse
521)]
522pub struct QueryPaymentInfoRequest {}
523/// Response type for the Query/PaymentInfo RPC method.
524#[allow(clippy::derive_partial_eq_without_eq)]
525#[derive(
526    Clone,
527    PartialEq,
528    Eq,
529    ::prost::Message,
530    ::serde::Serialize,
531    ::serde::Deserialize,
532    ::schemars::JsonSchema,
533    CosmwasmExt,
534)]
535#[proto_message(type_url = "/neutron.revenue.QueryPaymentInfoResponse")]
536pub struct QueryPaymentInfoResponse {
537    /// The current payment schedule.
538    #[prost(message, optional, tag = "1")]
539    pub payment_schedule: ::core::option::Option<PaymentSchedule>,
540    /// Revenue amount multiplier value that corresponds to the effective payment period progress.
541    #[prost(string, tag = "2")]
542    pub effective_period_progress: ::prost::alloc::string::String,
543    /// The current TWAP of the reward asset in quote asset. Is calculated as:
544    /// twap_from_time_t(n)_to_time_t(m) = (cumulative_price_at_t(n) - cumulative_price_at_t(m)) / (t(n) - t(m))
545    #[prost(string, tag = "3")]
546    pub reward_asset_twap: ::prost::alloc::string::String,
547    /// The current evaluation of the base revenue amount. This is the maximum amount a validator can
548    /// receive in the current price condition if not affected with reducing factors (e.g. imperfect
549    /// performance, incomplete payment period, partial validator set presence).
550    #[prost(message, optional, tag = "4")]
551    pub base_revenue_amount: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
552}
553/// Request type for the Query/ValidatorStats RPC method.
554#[allow(clippy::derive_partial_eq_without_eq)]
555#[derive(
556    Clone,
557    PartialEq,
558    Eq,
559    ::prost::Message,
560    ::serde::Serialize,
561    ::serde::Deserialize,
562    ::schemars::JsonSchema,
563    CosmwasmExt,
564)]
565#[proto_message(type_url = "/neutron.revenue.QueryValidatorStatsRequest")]
566#[proto_query(
567    path = "/neutron.revenue.Query/ValidatorStats",
568    response_type = QueryValidatorStatsResponse
569)]
570pub struct QueryValidatorStatsRequest {
571    /// The validator's node operator address.
572    #[prost(string, tag = "1")]
573    pub val_oper_address: ::prost::alloc::string::String,
574}
575/// Response type for the Query/ValidatorStats RPC method.
576#[allow(clippy::derive_partial_eq_without_eq)]
577#[derive(
578    Clone,
579    PartialEq,
580    Eq,
581    ::prost::Message,
582    ::serde::Serialize,
583    ::serde::Deserialize,
584    ::schemars::JsonSchema,
585    CosmwasmExt,
586)]
587#[proto_message(type_url = "/neutron.revenue.QueryValidatorStatsResponse")]
588pub struct QueryValidatorStatsResponse {
589    /// Contains the validator's information.
590    #[prost(message, optional, tag = "1")]
591    pub stats: ::core::option::Option<ValidatorStats>,
592}
593/// Request type for the Query/ValidatorsStats RPC method.
594#[allow(clippy::derive_partial_eq_without_eq)]
595#[derive(
596    Clone,
597    PartialEq,
598    Eq,
599    ::prost::Message,
600    ::serde::Serialize,
601    ::serde::Deserialize,
602    ::schemars::JsonSchema,
603    CosmwasmExt,
604)]
605#[proto_message(type_url = "/neutron.revenue.QueryValidatorsStatsRequest")]
606#[proto_query(
607    path = "/neutron.revenue.Query/ValidatorsStats",
608    response_type = QueryValidatorsStatsResponse
609)]
610pub struct QueryValidatorsStatsRequest {}
611/// Response type for the Query/ValidatorsStats RPC method.
612#[allow(clippy::derive_partial_eq_without_eq)]
613#[derive(
614    Clone,
615    PartialEq,
616    Eq,
617    ::prost::Message,
618    ::serde::Serialize,
619    ::serde::Deserialize,
620    ::schemars::JsonSchema,
621    CosmwasmExt,
622)]
623#[proto_message(type_url = "/neutron.revenue.QueryValidatorsStatsResponse")]
624pub struct QueryValidatorsStatsResponse {
625    /// Contains the validators' information.
626    #[prost(message, repeated, tag = "1")]
627    pub stats: ::prost::alloc::vec::Vec<ValidatorStats>,
628}
629/// Contains validator's info and their performance rating.
630#[allow(clippy::derive_partial_eq_without_eq)]
631#[derive(
632    Clone,
633    PartialEq,
634    Eq,
635    ::prost::Message,
636    ::serde::Serialize,
637    ::serde::Deserialize,
638    ::schemars::JsonSchema,
639    CosmwasmExt,
640)]
641#[proto_message(type_url = "/neutron.revenue.ValidatorStats")]
642pub struct ValidatorStats {
643    /// Contains the validator's information.
644    #[prost(message, optional, tag = "1")]
645    pub validator_info: ::core::option::Option<ValidatorInfo>,
646    /// The total number of blocks produced by the chain in the current payment period.
647    #[prost(uint64, tag = "2")]
648    #[serde(
649        serialize_with = "crate::serde::as_str::serialize",
650        deserialize_with = "crate::serde::as_str::deserialize"
651    )]
652    pub total_produced_blocks_in_period: u64,
653    /// The validator's performance rating. Represented as a decimal value.
654    #[prost(string, tag = "3")]
655    pub performance_rating: ::prost::alloc::string::String,
656    /// Contains expected revenue for the validator based on their performance rating in the current
657    /// payment period, current reward asset TWAP, and duration of validator's presence in the active
658    /// validator set. Does not take into account effective payment period progress.
659    #[prost(message, optional, tag = "4")]
660    pub expected_revenue: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
661}
662pub struct RevenueQuerier<'a, Q: cosmwasm_std::CustomQuery> {
663    querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>,
664}
665impl<'a, Q: cosmwasm_std::CustomQuery> RevenueQuerier<'a, Q> {
666    pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self {
667        Self { querier }
668    }
669    pub fn params(&self) -> Result<QueryParamsResponse, cosmwasm_std::StdError> {
670        QueryParamsRequest {}.query(self.querier)
671    }
672    pub fn payment_info(&self) -> Result<QueryPaymentInfoResponse, cosmwasm_std::StdError> {
673        QueryPaymentInfoRequest {}.query(self.querier)
674    }
675    pub fn validator_stats(
676        &self,
677        val_oper_address: ::prost::alloc::string::String,
678    ) -> Result<QueryValidatorStatsResponse, cosmwasm_std::StdError> {
679        QueryValidatorStatsRequest { val_oper_address }.query(self.querier)
680    }
681    pub fn validators_stats(&self) -> Result<QueryValidatorsStatsResponse, cosmwasm_std::StdError> {
682        QueryValidatorsStatsRequest {}.query(self.querier)
683    }
684}