Skip to main content

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