desmos_bindings/proto/cosmos/feegrant/
v1beta1.rs

1/// BasicAllowance implements Allowance with a one-time grant of coins
2/// that optionally expires. The grantee can use up to SpendLimit to cover fees.
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(
5    Clone,
6    PartialEq,
7    ::prost::Message,
8    schemars::JsonSchema,
9    serde::Serialize,
10    serde::Deserialize,
11    desmos_std_derive::CosmwasmExt,
12)]
13#[proto_message(type_url = "/cosmos.feegrant.v1beta1.BasicAllowance")]
14#[serde(rename_all = "snake_case")]
15pub struct BasicAllowance {
16    /// spend_limit specifies the maximum amount of coins that can be spent
17    /// by this allowance and will be updated as coins are spent. If it is
18    /// empty, there is no spend limit and any amount of coins can be spent.
19    #[prost(message, repeated, tag = "1")]
20    pub spend_limit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
21    /// expiration specifies an optional time when this allowance expires
22    #[prost(message, optional, tag = "2")]
23    pub expiration: ::core::option::Option<crate::shim::Timestamp>,
24}
25/// PeriodicAllowance extends Allowance to allow for both a maximum cap,
26/// as well as a limit per time period.
27#[allow(clippy::derive_partial_eq_without_eq)]
28#[derive(
29    Clone,
30    PartialEq,
31    ::prost::Message,
32    schemars::JsonSchema,
33    serde::Serialize,
34    serde::Deserialize,
35    desmos_std_derive::CosmwasmExt,
36)]
37#[proto_message(type_url = "/cosmos.feegrant.v1beta1.PeriodicAllowance")]
38#[serde(rename_all = "snake_case")]
39pub struct PeriodicAllowance {
40    /// basic specifies a struct of `BasicAllowance`
41    #[prost(message, optional, tag = "1")]
42    pub basic: ::core::option::Option<BasicAllowance>,
43    /// period specifies the time duration in which period_spend_limit coins can
44    /// be spent before that allowance is reset
45    #[prost(message, optional, tag = "2")]
46    pub period: ::core::option::Option<crate::shim::Duration>,
47    /// period_spend_limit specifies the maximum number of coins that can be spent
48    /// in the period
49    #[prost(message, repeated, tag = "3")]
50    pub period_spend_limit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
51    /// period_can_spend is the number of coins left to be spent before the period_reset time
52    #[prost(message, repeated, tag = "4")]
53    pub period_can_spend: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
54    /// period_reset is the time at which this period resets and a new one begins,
55    /// it is calculated from the start time of the first transaction after the
56    /// last period ended
57    #[prost(message, optional, tag = "5")]
58    pub period_reset: ::core::option::Option<crate::shim::Timestamp>,
59}
60/// AllowedMsgAllowance creates allowance only for specified message types.
61#[allow(clippy::derive_partial_eq_without_eq)]
62#[derive(
63    Clone,
64    PartialEq,
65    ::prost::Message,
66    schemars::JsonSchema,
67    serde::Serialize,
68    serde::Deserialize,
69    desmos_std_derive::CosmwasmExt,
70)]
71#[proto_message(type_url = "/cosmos.feegrant.v1beta1.AllowedMsgAllowance")]
72#[serde(rename_all = "snake_case")]
73pub struct AllowedMsgAllowance {
74    /// allowance can be any of basic and periodic fee allowance.
75    #[prost(message, optional, tag = "1")]
76    pub allowance: ::core::option::Option<crate::shim::Any>,
77    /// allowed_messages are the messages for which the grantee has the access.
78    #[prost(string, repeated, tag = "2")]
79    pub allowed_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
80}
81/// Grant is stored in the KVStore to record a grant with full context
82#[allow(clippy::derive_partial_eq_without_eq)]
83#[derive(
84    Clone,
85    PartialEq,
86    ::prost::Message,
87    schemars::JsonSchema,
88    serde::Serialize,
89    serde::Deserialize,
90    desmos_std_derive::CosmwasmExt,
91)]
92#[proto_message(type_url = "/cosmos.feegrant.v1beta1.Grant")]
93#[serde(rename_all = "snake_case")]
94pub struct Grant {
95    /// granter is the address of the user granting an allowance of their funds.
96    #[prost(string, tag = "1")]
97    pub granter: ::prost::alloc::string::String,
98    /// grantee is the address of the user being granted an allowance of another user's funds.
99    #[prost(string, tag = "2")]
100    pub grantee: ::prost::alloc::string::String,
101    /// allowance can be any of basic, periodic, allowed fee allowance.
102    #[prost(message, optional, tag = "3")]
103    pub allowance: ::core::option::Option<crate::shim::Any>,
104}