iota_grpc_types/proto/generated/
iota.grpc.v1.coin.rs

1// Copyright (c) Mysten Labs, Inc.
2// Modifications Copyright (c) 2025 IOTA Stiftung
3// SPDX-License-Identifier: Apache-2.0
4
5// This file is @generated by prost-build.
6/// Metadata for a coin type
7#[non_exhaustive]
8#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9pub struct CoinMetadata {
10    /// ObjectId of the `0x2::coin::CoinMetadata` object or
11    /// 0x2::iota::coin_registry::Currency object (when registered with CoinRegistry).
12    #[prost(message, optional, tag = "1")]
13    pub id: ::core::option::Option<super::types::ObjectId>,
14    /// Number of decimal places the coin uses.
15    #[prost(uint32, optional, tag = "2")]
16    pub decimals: ::core::option::Option<u32>,
17    /// Name for the token
18    #[prost(string, optional, tag = "3")]
19    pub name: ::core::option::Option<::prost::alloc::string::String>,
20    /// Symbol for the token
21    #[prost(string, optional, tag = "4")]
22    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
23    /// Description of the token
24    #[prost(string, optional, tag = "5")]
25    pub description: ::core::option::Option<::prost::alloc::string::String>,
26    /// URL for the token logo
27    #[prost(string, optional, tag = "6")]
28    pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
29    /// The MetadataCap ID if it has been claimed for this coin type.
30    /// This capability allows updating the coin's metadata fields.
31    /// Only populated when metadata is from CoinRegistry.
32    #[prost(message, optional, tag = "7")]
33    pub metadata_cap_id: ::core::option::Option<super::types::ObjectId>,
34    /// State of the MetadataCap for this coin type.
35    #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
36    pub metadata_cap_state: ::core::option::Option<i32>,
37}
38/// Nested message and enum types in `CoinMetadata`.
39pub mod coin_metadata {
40    /// Information about the state of the coin's MetadataCap
41    #[non_exhaustive]
42    #[derive(
43        Clone,
44        Copy,
45        Debug,
46        PartialEq,
47        Eq,
48        Hash,
49        PartialOrd,
50        Ord,
51        ::prost::Enumeration
52    )]
53    #[repr(i32)]
54    pub enum MetadataCapState {
55        /// Indicates the state of the MetadataCap is unknown.
56        /// Set when the coin has not been migrated to the CoinRegistry.
57        Unknown = 0,
58        /// Indicates the MetadataCap has been claimed.
59        Claimed = 1,
60        /// Indicates the MetadataCap has not been claimed.
61        Unclaimed = 2,
62        /// Indicates the MetadataCap has been deleted.
63        Deleted = 3,
64    }
65    impl MetadataCapState {
66        /// String value of the enum field names used in the ProtoBuf definition.
67        ///
68        /// The values are not transformed in any way and thus are considered stable
69        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
70        pub fn as_str_name(&self) -> &'static str {
71            match self {
72                Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
73                Self::Claimed => "CLAIMED",
74                Self::Unclaimed => "UNCLAIMED",
75                Self::Deleted => "DELETED",
76            }
77        }
78        /// Creates an enum from field names used in the ProtoBuf definition.
79        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
80            match value {
81                "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
82                "CLAIMED" => Some(Self::Claimed),
83                "UNCLAIMED" => Some(Self::Unclaimed),
84                "DELETED" => Some(Self::Deleted),
85                _ => None,
86            }
87        }
88    }
89}
90/// Information about a coin type's `0x2::coin::TreasuryCap` and its total available supply
91#[non_exhaustive]
92#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
93pub struct CoinTreasury {
94    /// ObjectId of the `0x2::coin::TreasuryCap` object.
95    #[prost(message, optional, tag = "1")]
96    pub id: ::core::option::Option<super::types::ObjectId>,
97    /// Total available supply for this coin type.
98    #[prost(uint64, optional, tag = "2")]
99    pub total_supply: ::core::option::Option<u64>,
100    /// Supply state indicating if the supply is fixed or can still be minted
101    #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
102    pub supply_state: ::core::option::Option<i32>,
103}
104/// Nested message and enum types in `CoinTreasury`.
105pub mod coin_treasury {
106    /// Supply state of a coin, matching the Move SupplyState enum
107    #[non_exhaustive]
108    #[derive(
109        Clone,
110        Copy,
111        Debug,
112        PartialEq,
113        Eq,
114        Hash,
115        PartialOrd,
116        Ord,
117        ::prost::Enumeration
118    )]
119    #[repr(i32)]
120    pub enum SupplyState {
121        /// Supply is unknown or TreasuryCap still exists (minting still possible)
122        Unknown = 0,
123        /// Supply is fixed (TreasuryCap consumed, no more minting possible)
124        Fixed = 1,
125        /// Supply can only decrease (burning allowed, minting not allowed)
126        BurnOnly = 2,
127    }
128    impl SupplyState {
129        /// String value of the enum field names used in the ProtoBuf definition.
130        ///
131        /// The values are not transformed in any way and thus are considered stable
132        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
133        pub fn as_str_name(&self) -> &'static str {
134            match self {
135                Self::Unknown => "SUPPLY_STATE_UNKNOWN",
136                Self::Fixed => "FIXED",
137                Self::BurnOnly => "BURN_ONLY",
138            }
139        }
140        /// Creates an enum from field names used in the ProtoBuf definition.
141        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
142            match value {
143                "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
144                "FIXED" => Some(Self::Fixed),
145                "BURN_ONLY" => Some(Self::BurnOnly),
146                _ => None,
147            }
148        }
149    }
150}
151/// Information about a regulated coin, which indicates that it makes use of the transfer deny list.
152#[non_exhaustive]
153#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
154pub struct RegulatedCoinMetadata {
155    /// ObjectId of the `0x2::coin::RegulatedCoinMetadata` object.
156    /// Only present for coins that have not been migrated to CoinRegistry.
157    #[prost(message, optional, tag = "1")]
158    pub id: ::core::option::Option<super::types::ObjectId>,
159    /// The ID of the coin's `CoinMetadata` or `CoinData` object.
160    #[prost(message, optional, tag = "2")]
161    pub coin_metadata_object: ::core::option::Option<super::types::ObjectId>,
162    /// The ID of the coin's `DenyCap` object.
163    #[prost(message, optional, tag = "3")]
164    pub deny_cap_object: ::core::option::Option<super::types::ObjectId>,
165    /// Whether the coin can be globally paused
166    #[prost(bool, optional, tag = "4")]
167    pub allow_global_pause: ::core::option::Option<bool>,
168    /// Variant of the regulated coin metadata
169    #[prost(uint32, optional, tag = "5")]
170    pub variant: ::core::option::Option<u32>,
171    /// Indicates the coin's regulated state.
172    #[prost(
173        enumeration = "regulated_coin_metadata::CoinRegulatedState",
174        optional,
175        tag = "6"
176    )]
177    pub coin_regulated_state: ::core::option::Option<i32>,
178}
179/// Nested message and enum types in `RegulatedCoinMetadata`.
180pub mod regulated_coin_metadata {
181    /// Indicates the state of the regulation of the coin.
182    #[non_exhaustive]
183    #[derive(
184        Clone,
185        Copy,
186        Debug,
187        PartialEq,
188        Eq,
189        Hash,
190        PartialOrd,
191        Ord,
192        ::prost::Enumeration
193    )]
194    #[repr(i32)]
195    pub enum CoinRegulatedState {
196        /// Indicates the regulation state of the coin is unknown.
197        /// This is set when a coin has not been migrated to the
198        /// coin registry and has no `0x2::coin::RegulatedCoinMetadata`
199        /// object.
200        Unknown = 0,
201        /// Indicates a coin is regulated. RegulatedCoinMetadata will be populated.
202        Regulated = 1,
203        /// Indicates a coin is unregulated.
204        Unregulated = 2,
205    }
206    impl CoinRegulatedState {
207        /// String value of the enum field names used in the ProtoBuf definition.
208        ///
209        /// The values are not transformed in any way and thus are considered stable
210        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
211        pub fn as_str_name(&self) -> &'static str {
212            match self {
213                Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
214                Self::Regulated => "REGULATED",
215                Self::Unregulated => "UNREGULATED",
216            }
217        }
218        /// Creates an enum from field names used in the ProtoBuf definition.
219        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
220            match value {
221                "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
222                "REGULATED" => Some(Self::Regulated),
223                "UNREGULATED" => Some(Self::Unregulated),
224                _ => None,
225            }
226        }
227    }
228}