concordium_rust_sdk/v2/generated/
concordium.v2.plt.rs

1// This file is @generated by prost-build.
2/// A Cbor encoded bytestring
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct CBor {
5    /// A CBOR encoded byte string.
6    #[prost(bytes = "vec", tag = "1")]
7    pub value: ::prost::alloc::vec::Vec<u8>,
8}
9/// The unique symbol and identifier of a protocol level token.
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct TokenId {
12    /// Unique identifier for the token, guaranteed to be distinct across the
13    /// entire concordium blockchain.
14    #[prost(string, tag = "1")]
15    pub value: ::prost::alloc::string::String,
16}
17/// A token module reference. This is always 32 bytes long.
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct TokenModuleRef {
20    #[prost(bytes = "vec", tag = "1")]
21    pub value: ::prost::alloc::vec::Vec<u8>,
22}
23/// PLT amount representation. The actual amount is computed as
24/// `value * 10^(-decimals)`.
25#[derive(Clone, Copy, PartialEq, ::prost::Message)]
26pub struct TokenAmount {
27    /// The digits of the amount.
28    #[prost(uint64, tag = "1")]
29    pub value: u64,
30    /// Number of decimals in the representation
31    #[prost(uint32, tag = "2")]
32    pub decimals: u32,
33}
34/// Token state at the block level
35#[derive(Clone, PartialEq, ::prost::Message)]
36pub struct TokenState {
37    /// The reference of the module implementing this token.
38    #[prost(message, optional, tag = "1")]
39    pub token_module_ref: ::core::option::Option<TokenModuleRef>,
40    /// Number of decimals in the decimal number representation of amounts.
41    #[prost(uint32, tag = "3")]
42    pub decimals: u32,
43    /// The total available token supply.
44    #[prost(message, optional, tag = "4")]
45    pub total_supply: ::core::option::Option<TokenAmount>,
46    /// Token module specific state, such as token name, feature flags, meta data.
47    #[prost(message, optional, tag = "5")]
48    pub module_state: ::core::option::Option<CBor>,
49}
50/// Token state at the account level
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct TokenAccountState {
53    /// The available balance.
54    #[prost(message, optional, tag = "1")]
55    pub balance: ::core::option::Option<TokenAmount>,
56    /// Token module specific account state, such as whether the account is on
57    /// the allow or deny list.
58    #[prost(message, optional, tag = "4")]
59    pub module_state: ::core::option::Option<CBor>,
60}
61/// Single token event originating from a token module as part of a token
62/// transaction.
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct TokenModuleEvent {
65    /// The type of the event.
66    #[prost(string, tag = "1")]
67    pub r#type: ::prost::alloc::string::String,
68    /// The CBOR encoded event details.
69    #[prost(message, optional, tag = "2")]
70    pub details: ::core::option::Option<CBor>,
71}
72/// A token holder is an entity that can hold tokens. Currently, this is limited
73/// to accounts, but in the future it may be extended to other entities.
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct TokenHolder {
76    /// The holder address
77    #[prost(oneof = "token_holder::Address", tags = "1")]
78    pub address: ::core::option::Option<token_holder::Address>,
79}
80/// Nested message and enum types in `TokenHolder`.
81pub mod token_holder {
82    /// The holder address
83    #[derive(Clone, PartialEq, ::prost::Oneof)]
84    pub enum Address {
85        /// The account address of the holder.
86        #[prost(message, tag = "1")]
87        Account(super::super::AccountAddress),
88    }
89}
90/// An event emitted when a transfer of tokens from `from` to `to` is performed.
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct TokenTransferEvent {
93    /// The token holder from which the tokens are transferred.
94    #[prost(message, optional, tag = "1")]
95    pub from: ::core::option::Option<TokenHolder>,
96    /// The token holder to which the tokens are transferred.
97    #[prost(message, optional, tag = "2")]
98    pub to: ::core::option::Option<TokenHolder>,
99    /// The amount of tokens transferred.
100    #[prost(message, optional, tag = "3")]
101    pub amount: ::core::option::Option<TokenAmount>,
102    /// An optional memo field that can be used to attach a message to the token
103    /// transfer.
104    #[prost(message, optional, tag = "4")]
105    pub memo: ::core::option::Option<super::Memo>,
106}
107/// An event emitted when the token supply is updated, i.e. by minting/burning
108/// tokens to/from the balance of the `target`.
109#[derive(Clone, PartialEq, ::prost::Message)]
110pub struct TokenSupplyUpdateEvent {
111    /// The token holder the balance update is performed on.
112    #[prost(message, optional, tag = "1")]
113    pub target: ::core::option::Option<TokenHolder>,
114    /// The balance difference to be applied to the target.
115    #[prost(message, optional, tag = "2")]
116    pub amount: ::core::option::Option<TokenAmount>,
117}
118/// Token event originating from token transactions.
119#[derive(Clone, PartialEq, ::prost::Message)]
120pub struct TokenEvent {
121    /// The unique token symbol.
122    #[prost(message, optional, tag = "1")]
123    pub token_id: ::core::option::Option<TokenId>,
124    /// The type of the event.
125    #[prost(oneof = "token_event::Event", tags = "2, 3, 4, 5")]
126    pub event: ::core::option::Option<token_event::Event>,
127}
128/// Nested message and enum types in `TokenEvent`.
129pub mod token_event {
130    /// The type of the event.
131    #[derive(Clone, PartialEq, ::prost::Oneof)]
132    pub enum Event {
133        /// An event emitted by the token module.
134        #[prost(message, tag = "2")]
135        ModuleEvent(super::TokenModuleEvent),
136        /// An event emitted when a transfer of tokens is performed.
137        #[prost(message, tag = "3")]
138        TransferEvent(super::TokenTransferEvent),
139        /// An event emitted when the token supply is updated by minting tokens to a
140        /// token holder.
141        #[prost(message, tag = "4")]
142        MintEvent(super::TokenSupplyUpdateEvent),
143        /// An event emitted when the token supply is updated by burning tokens from
144        /// the balance of a token holder.
145        #[prost(message, tag = "5")]
146        BurnEvent(super::TokenSupplyUpdateEvent),
147    }
148}
149/// Token events originating from token transactions.
150#[derive(Clone, PartialEq, ::prost::Message)]
151pub struct TokenEffect {
152    /// Events emitted by the token.
153    #[prost(message, repeated, tag = "1")]
154    pub events: ::prost::alloc::vec::Vec<TokenEvent>,
155}
156/// Details provided by the token module in the event of rejecting a transaction.
157#[derive(Clone, PartialEq, ::prost::Message)]
158pub struct TokenModuleRejectReason {
159    /// The identifier of the protocol-level token.
160    #[prost(message, optional, tag = "1")]
161    pub token_id: ::core::option::Option<TokenId>,
162    /// The type of the reject reason.
163    #[prost(string, tag = "2")]
164    pub r#type: ::prost::alloc::string::String,
165    /// (Optional) CBOR-encoded details.
166    #[prost(message, optional, tag = "3")]
167    pub details: ::core::option::Option<CBor>,
168}
169/// Update payload for creating a new protocol-level token
170#[derive(Clone, PartialEq, ::prost::Message)]
171pub struct CreatePlt {
172    /// The identifier of the protocol-level token.
173    #[prost(message, optional, tag = "1")]
174    pub token_id: ::core::option::Option<TokenId>,
175    /// The hash that identifies the token module implementation.
176    #[prost(message, optional, tag = "2")]
177    pub token_module: ::core::option::Option<TokenModuleRef>,
178    /// The number of decimal places used in the representation of amounts of this
179    /// token. This determines the smallest representable fraction of the token.
180    /// This can be at most 255.
181    #[prost(uint32, tag = "4")]
182    pub decimals: u32,
183    /// The initialization parameters of the token, encoded in CBOR.
184    #[prost(message, optional, tag = "5")]
185    pub initialization_parameters: ::core::option::Option<CBor>,
186}
187/// Details about the creation of a protocol-level token.
188#[derive(Clone, PartialEq, ::prost::Message)]
189pub struct TokenCreationDetails {
190    /// The update payload used to create the token.
191    #[prost(message, optional, tag = "1")]
192    pub create_plt: ::core::option::Option<CreatePlt>,
193    /// The events generated by the token module during the creation of the token.
194    #[prost(message, repeated, tag = "2")]
195    pub events: ::prost::alloc::vec::Vec<TokenEvent>,
196}