penumbra_sdk_proto/gen/
penumbra.core.asset.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct BalanceCommitment {
4    #[prost(bytes = "vec", tag = "1")]
5    pub inner: ::prost::alloc::vec::Vec<u8>,
6}
7impl ::prost::Name for BalanceCommitment {
8    const NAME: &'static str = "BalanceCommitment";
9    const PACKAGE: &'static str = "penumbra.core.asset.v1";
10    fn full_name() -> ::prost::alloc::string::String {
11        "penumbra.core.asset.v1.BalanceCommitment".into()
12    }
13    fn type_url() -> ::prost::alloc::string::String {
14        "/penumbra.core.asset.v1.BalanceCommitment".into()
15    }
16}
17/// A Penumbra asset ID.
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct AssetId {
20    /// The bytes of the asset ID.
21    #[prost(bytes = "vec", tag = "1")]
22    pub inner: ::prost::alloc::vec::Vec<u8>,
23    /// Alternatively, a Bech32m-encoded string representation of the `inner`
24    /// bytes.
25    ///
26    /// NOTE: implementations are not required to support parsing this field.
27    /// Implementations should prefer to encode the `inner` bytes in all messages they
28    /// produce. Implementations must not accept messages with both `inner` and
29    /// `alt_bech32m` set.  This field exists for convenience of RPC users.
30    #[prost(string, tag = "2")]
31    pub alt_bech32m: ::prost::alloc::string::String,
32    /// Alternatively, a base denomination string which should be hashed to obtain the asset ID.
33    ///
34    /// NOTE: implementations are not required to support parsing this field.
35    /// Implementations should prefer to encode the bytes in all messages they
36    /// produce. Implementations must not accept messages with both `inner` and
37    /// `alt_base_denom` set.  This field exists for convenience of RPC users.
38    #[prost(string, tag = "3")]
39    pub alt_base_denom: ::prost::alloc::string::String,
40}
41impl ::prost::Name for AssetId {
42    const NAME: &'static str = "AssetId";
43    const PACKAGE: &'static str = "penumbra.core.asset.v1";
44    fn full_name() -> ::prost::alloc::string::String {
45        "penumbra.core.asset.v1.AssetId".into()
46    }
47    fn type_url() -> ::prost::alloc::string::String {
48        "/penumbra.core.asset.v1.AssetId".into()
49    }
50}
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct Denom {
53    #[prost(string, tag = "1")]
54    pub denom: ::prost::alloc::string::String,
55}
56impl ::prost::Name for Denom {
57    const NAME: &'static str = "Denom";
58    const PACKAGE: &'static str = "penumbra.core.asset.v1";
59    fn full_name() -> ::prost::alloc::string::String {
60        "penumbra.core.asset.v1.Denom".into()
61    }
62    fn type_url() -> ::prost::alloc::string::String {
63        "/penumbra.core.asset.v1.Denom".into()
64    }
65}
66/// Describes metadata about a given asset.
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct Metadata {
69    #[prost(string, tag = "1")]
70    pub description: ::prost::alloc::string::String,
71    /// denom_units represents the list of DenomUnit's for a given coin
72    #[prost(message, repeated, tag = "2")]
73    pub denom_units: ::prost::alloc::vec::Vec<DenomUnit>,
74    /// base represents the base denom (should be the DenomUnit with exponent = 0).
75    #[prost(string, tag = "3")]
76    pub base: ::prost::alloc::string::String,
77    /// display indicates the suggested denom that should be
78    /// displayed in clients.
79    #[prost(string, tag = "4")]
80    pub display: ::prost::alloc::string::String,
81    /// name defines the name of the token (eg: Cosmos Atom)
82    #[prost(string, tag = "5")]
83    pub name: ::prost::alloc::string::String,
84    /// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can
85    /// be the same as the display.
86    #[prost(string, tag = "6")]
87    pub symbol: ::prost::alloc::string::String,
88    /// the asset ID on Penumbra for this denomination.
89    #[prost(message, optional, tag = "1984")]
90    pub penumbra_asset_id: ::core::option::Option<AssetId>,
91    #[prost(message, repeated, tag = "1985")]
92    pub images: ::prost::alloc::vec::Vec<AssetImage>,
93    /// An optional "score" used to prioritize token lists.
94    ///
95    /// This is solely for use in client-side registries.
96    #[prost(uint64, tag = "1986")]
97    pub priority_score: u64,
98    /// Associated icons for asset.
99    /// For ibc assets, usually an image of the source chain.
100    #[prost(message, repeated, tag = "1987")]
101    pub badges: ::prost::alloc::vec::Vec<AssetImage>,
102    /// Coingecko ID for the asset.
103    #[prost(string, tag = "1988")]
104    pub coingecko_id: ::prost::alloc::string::String,
105}
106impl ::prost::Name for Metadata {
107    const NAME: &'static str = "Metadata";
108    const PACKAGE: &'static str = "penumbra.core.asset.v1";
109    fn full_name() -> ::prost::alloc::string::String {
110        "penumbra.core.asset.v1.Metadata".into()
111    }
112    fn type_url() -> ::prost::alloc::string::String {
113        "/penumbra.core.asset.v1.Metadata".into()
114    }
115}
116/// DenomUnit represents a struct that describes a given denomination unit of the basic token.
117#[derive(Clone, PartialEq, ::prost::Message)]
118pub struct DenomUnit {
119    /// denom represents the string name of the given denom unit (e.g uatom).
120    #[prost(string, tag = "1")]
121    pub denom: ::prost::alloc::string::String,
122    /// exponent represents power of 10 exponent that one must
123    /// raise the base_denom to in order to equal the given DenomUnit's denom
124    /// 1 denom = 10^exponent base_denom
125    /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with
126    /// exponent = 6, thus: 1 atom = 10^6 uatom).
127    #[prost(uint32, tag = "2")]
128    pub exponent: u32,
129    /// aliases is a list of string aliases for the given denom
130    #[prost(string, repeated, tag = "3")]
131    pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
132}
133impl ::prost::Name for DenomUnit {
134    const NAME: &'static str = "DenomUnit";
135    const PACKAGE: &'static str = "penumbra.core.asset.v1";
136    fn full_name() -> ::prost::alloc::string::String {
137        "penumbra.core.asset.v1.DenomUnit".into()
138    }
139    fn type_url() -> ::prost::alloc::string::String {
140        "/penumbra.core.asset.v1.DenomUnit".into()
141    }
142}
143#[derive(Clone, PartialEq, ::prost::Message)]
144pub struct Value {
145    #[prost(message, optional, tag = "1")]
146    pub amount: ::core::option::Option<super::super::num::v1::Amount>,
147    #[prost(message, optional, tag = "2")]
148    pub asset_id: ::core::option::Option<AssetId>,
149}
150impl ::prost::Name for Value {
151    const NAME: &'static str = "Value";
152    const PACKAGE: &'static str = "penumbra.core.asset.v1";
153    fn full_name() -> ::prost::alloc::string::String {
154        "penumbra.core.asset.v1.Value".into()
155    }
156    fn type_url() -> ::prost::alloc::string::String {
157        "/penumbra.core.asset.v1.Value".into()
158    }
159}
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct Balance {
162    /// Represents the vector of 'Value's in the balance.
163    #[prost(message, repeated, tag = "1")]
164    pub values: ::prost::alloc::vec::Vec<balance::SignedValue>,
165}
166/// Nested message and enum types in `Balance`.
167pub mod balance {
168    #[derive(Clone, PartialEq, ::prost::Message)]
169    pub struct SignedValue {
170        #[prost(message, optional, tag = "1")]
171        pub value: ::core::option::Option<super::Value>,
172        #[prost(bool, tag = "2")]
173        pub negated: bool,
174    }
175    impl ::prost::Name for SignedValue {
176        const NAME: &'static str = "SignedValue";
177        const PACKAGE: &'static str = "penumbra.core.asset.v1";
178        fn full_name() -> ::prost::alloc::string::String {
179            "penumbra.core.asset.v1.Balance.SignedValue".into()
180        }
181        fn type_url() -> ::prost::alloc::string::String {
182            "/penumbra.core.asset.v1.Balance.SignedValue".into()
183        }
184    }
185}
186impl ::prost::Name for Balance {
187    const NAME: &'static str = "Balance";
188    const PACKAGE: &'static str = "penumbra.core.asset.v1";
189    fn full_name() -> ::prost::alloc::string::String {
190        "penumbra.core.asset.v1.Balance".into()
191    }
192    fn type_url() -> ::prost::alloc::string::String {
193        "/penumbra.core.asset.v1.Balance".into()
194    }
195}
196/// Represents a value of a known or unknown denomination.
197#[derive(Clone, PartialEq, ::prost::Message)]
198pub struct ValueView {
199    #[prost(oneof = "value_view::ValueView", tags = "1, 2")]
200    pub value_view: ::core::option::Option<value_view::ValueView>,
201}
202/// Nested message and enum types in `ValueView`.
203pub mod value_view {
204    /// A value whose asset ID is known and has metadata.
205    #[derive(Clone, PartialEq, ::prost::Message)]
206    pub struct KnownAssetId {
207        /// The amount of the value.
208        #[prost(message, optional, tag = "1")]
209        pub amount: ::core::option::Option<super::super::super::num::v1::Amount>,
210        /// The asset metadata describing the asset of the value.
211        #[prost(message, optional, tag = "2")]
212        pub metadata: ::core::option::Option<super::Metadata>,
213        /// Optionally, a list of equivalent values in other numeraires.
214        #[prost(message, repeated, tag = "3")]
215        pub equivalent_values: ::prost::alloc::vec::Vec<super::EquivalentValue>,
216        /// Optionally, extended, dynamically-typed metadata about the object this
217        /// token represents.
218        ///
219        /// This is left flexible to allow future extensions. For instance, a view
220        /// server could augment an LPNFT with a message describing the current state
221        /// of the position and its reserves, allowing a frontend to render LPNFTs
222        /// with their position information (trading pair, etc). However, because
223        /// this is in an extension, a frontend that does not have special handling
224        /// logic would fall back on the ordinary asset metadata.
225        #[prost(message, optional, tag = "4")]
226        pub extended_metadata: ::core::option::Option<::pbjson_types::Any>,
227    }
228    impl ::prost::Name for KnownAssetId {
229        const NAME: &'static str = "KnownAssetId";
230        const PACKAGE: &'static str = "penumbra.core.asset.v1";
231        fn full_name() -> ::prost::alloc::string::String {
232            "penumbra.core.asset.v1.ValueView.KnownAssetId".into()
233        }
234        fn type_url() -> ::prost::alloc::string::String {
235            "/penumbra.core.asset.v1.ValueView.KnownAssetId".into()
236        }
237    }
238    /// A value whose asset ID is unknown, with no metadata.
239    #[derive(Clone, PartialEq, ::prost::Message)]
240    pub struct UnknownAssetId {
241        #[prost(message, optional, tag = "1")]
242        pub amount: ::core::option::Option<super::super::super::num::v1::Amount>,
243        #[prost(message, optional, tag = "2")]
244        pub asset_id: ::core::option::Option<super::AssetId>,
245    }
246    impl ::prost::Name for UnknownAssetId {
247        const NAME: &'static str = "UnknownAssetId";
248        const PACKAGE: &'static str = "penumbra.core.asset.v1";
249        fn full_name() -> ::prost::alloc::string::String {
250            "penumbra.core.asset.v1.ValueView.UnknownAssetId".into()
251        }
252        fn type_url() -> ::prost::alloc::string::String {
253            "/penumbra.core.asset.v1.ValueView.UnknownAssetId".into()
254        }
255    }
256    #[derive(Clone, PartialEq, ::prost::Oneof)]
257    pub enum ValueView {
258        #[prost(message, tag = "1")]
259        KnownAssetId(KnownAssetId),
260        #[prost(message, tag = "2")]
261        UnknownAssetId(UnknownAssetId),
262    }
263}
264impl ::prost::Name for ValueView {
265    const NAME: &'static str = "ValueView";
266    const PACKAGE: &'static str = "penumbra.core.asset.v1";
267    fn full_name() -> ::prost::alloc::string::String {
268        "penumbra.core.asset.v1.ValueView".into()
269    }
270    fn type_url() -> ::prost::alloc::string::String {
271        "/penumbra.core.asset.v1.ValueView".into()
272    }
273}
274/// An image related to an asset.
275#[derive(Clone, PartialEq, ::prost::Message)]
276pub struct AssetImage {
277    /// The URI of the image in PNG format.
278    #[prost(string, tag = "1")]
279    pub png: ::prost::alloc::string::String,
280    /// The URI of the image in SVG format.
281    #[prost(string, tag = "2")]
282    pub svg: ::prost::alloc::string::String,
283    #[prost(message, optional, tag = "3")]
284    pub theme: ::core::option::Option<asset_image::Theme>,
285}
286/// Nested message and enum types in `AssetImage`.
287pub mod asset_image {
288    #[derive(Clone, PartialEq, ::prost::Message)]
289    pub struct Theme {
290        /// Should be in hex format, `^#\[0-9a-fA-F\]{6}$`.
291        #[prost(string, tag = "1")]
292        pub primary_color_hex: ::prost::alloc::string::String,
293        #[prost(bool, tag = "2")]
294        pub circle: bool,
295        #[prost(bool, tag = "3")]
296        pub dark_mode: bool,
297    }
298    impl ::prost::Name for Theme {
299        const NAME: &'static str = "Theme";
300        const PACKAGE: &'static str = "penumbra.core.asset.v1";
301        fn full_name() -> ::prost::alloc::string::String {
302            "penumbra.core.asset.v1.AssetImage.Theme".into()
303        }
304        fn type_url() -> ::prost::alloc::string::String {
305            "/penumbra.core.asset.v1.AssetImage.Theme".into()
306        }
307    }
308}
309impl ::prost::Name for AssetImage {
310    const NAME: &'static str = "AssetImage";
311    const PACKAGE: &'static str = "penumbra.core.asset.v1";
312    fn full_name() -> ::prost::alloc::string::String {
313        "penumbra.core.asset.v1.AssetImage".into()
314    }
315    fn type_url() -> ::prost::alloc::string::String {
316        "/penumbra.core.asset.v1.AssetImage".into()
317    }
318}
319/// The estimated price of one asset in terms of a numeraire.
320///
321/// This is used for generating "equivalent values" in ValueViews.
322#[derive(Clone, PartialEq, ::prost::Message)]
323pub struct EstimatedPrice {
324    #[prost(message, optional, tag = "1")]
325    pub priced_asset: ::core::option::Option<AssetId>,
326    #[prost(message, optional, tag = "2")]
327    pub numeraire: ::core::option::Option<AssetId>,
328    /// Multiply units of the priced asset by this value to get the value in the numeraire.
329    ///
330    /// This is a floating-point number since the price is approximate.
331    #[prost(double, tag = "3")]
332    pub numeraire_per_unit: f64,
333    /// If set, gives some idea of when the price was estimated.
334    #[prost(uint64, tag = "4")]
335    pub as_of_height: u64,
336}
337impl ::prost::Name for EstimatedPrice {
338    const NAME: &'static str = "EstimatedPrice";
339    const PACKAGE: &'static str = "penumbra.core.asset.v1";
340    fn full_name() -> ::prost::alloc::string::String {
341        "penumbra.core.asset.v1.EstimatedPrice".into()
342    }
343    fn type_url() -> ::prost::alloc::string::String {
344        "/penumbra.core.asset.v1.EstimatedPrice".into()
345    }
346}
347/// An "equivalent" value to a given value, in terms of a numeraire.
348///
349/// For instance, this can provide a USD-equivalent value relative to a
350/// stablecoin, or an amount of the staking token, etc.  A view server can
351/// optionally include this information to assist a frontend in displaying
352/// information about the value in a user-friendly way.
353#[derive(Clone, PartialEq, ::prost::Message)]
354pub struct EquivalentValue {
355    /// The equivalent amount of the parent Value in terms of the numeraire.
356    #[prost(message, optional, tag = "1")]
357    pub equivalent_amount: ::core::option::Option<super::super::num::v1::Amount>,
358    /// Metadata describing the numeraire.
359    #[prost(message, optional, tag = "2")]
360    pub numeraire: ::core::option::Option<Metadata>,
361    /// If set, gives some idea of when the price/equivalence was estimated.
362    #[prost(uint64, tag = "3")]
363    pub as_of_height: u64,
364}
365impl ::prost::Name for EquivalentValue {
366    const NAME: &'static str = "EquivalentValue";
367    const PACKAGE: &'static str = "penumbra.core.asset.v1";
368    fn full_name() -> ::prost::alloc::string::String {
369        "penumbra.core.asset.v1.EquivalentValue".into()
370    }
371    fn type_url() -> ::prost::alloc::string::String {
372        "/penumbra.core.asset.v1.EquivalentValue".into()
373    }
374}