concordium-rust-sdk 9.0.1

An SDK to use the Concordium blockchain.
Documentation
// This file is @generated by prost-build.
/// A CBOR encoded bytestring
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Cbor {
    /// A CBOR encoded byte string.
    #[prost(bytes = "vec", tag = "1")]
    pub value: ::prost::alloc::vec::Vec<u8>,
}
/// Token ID: a unique symbol and identifier of a protocol level token.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenId {
    /// Unique identifier for the token, guaranteed to be distinct across the
    /// entire concordium blockchain. The token id must be between 1 and 128 bytes long and consist of
    /// only a-z, A-Z, 0-9, `.`, `%` and `-`.
    #[prost(string, tag = "1")]
    pub value: ::prost::alloc::string::String,
}
/// A token module reference. This is always 32 bytes long.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenModuleRef {
    #[prost(bytes = "vec", tag = "1")]
    pub value: ::prost::alloc::vec::Vec<u8>,
}
/// PLT amount representation. The actual amount is computed as
/// `value * 10^(-decimals)`.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TokenAmount {
    /// The digits of the amount.
    #[prost(uint64, tag = "1")]
    pub value: u64,
    /// Number of decimals in the representation
    #[prost(uint32, tag = "2")]
    pub decimals: u32,
}
/// Token state at the block level
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenState {
    /// The reference of the module implementing this token.
    #[prost(message, optional, tag = "1")]
    pub token_module_ref: ::core::option::Option<TokenModuleRef>,
    /// Number of decimals in the decimal number representation of amounts.
    #[prost(uint32, tag = "3")]
    pub decimals: u32,
    /// The total available token supply.
    #[prost(message, optional, tag = "4")]
    pub total_supply: ::core::option::Option<TokenAmount>,
    /// Token module specific state, such as token name, feature flags, meta data.
    #[prost(message, optional, tag = "5")]
    pub module_state: ::core::option::Option<Cbor>,
}
/// Token state at the account level
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenAccountState {
    /// The available balance.
    #[prost(message, optional, tag = "1")]
    pub balance: ::core::option::Option<TokenAmount>,
    /// Token module specific account state, such as whether the account is on
    /// the allow or deny list.
    #[prost(message, optional, tag = "4")]
    pub module_state: ::core::option::Option<Cbor>,
}
/// Single token event originating from a token module as part of a token
/// transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenModuleEvent {
    /// The type of the event.
    #[prost(string, tag = "1")]
    pub r#type: ::prost::alloc::string::String,
    /// The CBOR encoded event details.
    #[prost(message, optional, tag = "2")]
    pub details: ::core::option::Option<Cbor>,
}
/// A token holder is an entity that can hold tokens. Currently, this is limited
/// to accounts, but in the future it may be extended to other entities.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenHolder {
    /// The holder address
    ///
    /// This field might be extended in future versions of the API.
    #[prost(oneof = "token_holder::Address", tags = "1")]
    pub address: ::core::option::Option<token_holder::Address>,
}
/// Nested message and enum types in `TokenHolder`.
pub mod token_holder {
    /// The holder address
    ///
    /// This field might be extended in future versions of the API.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Address {
        /// The account address of the holder.
        #[prost(message, tag = "1")]
        Account(super::super::AccountAddress),
    }
}
/// An event emitted when a transfer of tokens from `from` to `to` is performed.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenTransferEvent {
    /// The token holder from which the tokens are transferred.
    #[prost(message, optional, tag = "1")]
    pub from: ::core::option::Option<TokenHolder>,
    /// The token holder to which the tokens are transferred.
    #[prost(message, optional, tag = "2")]
    pub to: ::core::option::Option<TokenHolder>,
    /// The amount of tokens transferred.
    #[prost(message, optional, tag = "3")]
    pub amount: ::core::option::Option<TokenAmount>,
    /// An optional memo field that can be used to attach a message to the token
    /// transfer.
    #[prost(message, optional, tag = "4")]
    pub memo: ::core::option::Option<super::Memo>,
}
/// An event emitted when the token supply is updated, i.e. by minting/burning
/// tokens to/from the balance of the `target`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenSupplyUpdateEvent {
    /// The token holder the balance update is performed on.
    #[prost(message, optional, tag = "1")]
    pub target: ::core::option::Option<TokenHolder>,
    /// The balance difference to be applied to the target.
    #[prost(message, optional, tag = "2")]
    pub amount: ::core::option::Option<TokenAmount>,
}
/// Token event originating from token transactions.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenEvent {
    /// The Token ID.
    #[prost(message, optional, tag = "1")]
    pub token_id: ::core::option::Option<TokenId>,
    /// The type of the event.
    ///
    /// This field might be extended in future versions of the API.
    #[prost(oneof = "token_event::Event", tags = "2, 3, 4, 5")]
    pub event: ::core::option::Option<token_event::Event>,
}
/// Nested message and enum types in `TokenEvent`.
pub mod token_event {
    /// The type of the event.
    ///
    /// This field might be extended in future versions of the API.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Event {
        /// An event emitted by the token module.
        #[prost(message, tag = "2")]
        ModuleEvent(super::TokenModuleEvent),
        /// An event emitted when a transfer of tokens is performed.
        #[prost(message, tag = "3")]
        TransferEvent(super::TokenTransferEvent),
        /// An event emitted when the token supply is updated by minting tokens to a
        /// token holder.
        #[prost(message, tag = "4")]
        MintEvent(super::TokenSupplyUpdateEvent),
        /// An event emitted when the token supply is updated by burning tokens from
        /// the balance of a token holder.
        #[prost(message, tag = "5")]
        BurnEvent(super::TokenSupplyUpdateEvent),
    }
}
/// Token events originating from token transactions.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenEffect {
    /// Events emitted by the token.
    #[prost(message, repeated, tag = "1")]
    pub events: ::prost::alloc::vec::Vec<TokenEvent>,
}
/// Details provided by the token module in the event of rejecting a transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenModuleRejectReason {
    /// The Token ID of the protocol-level token.
    #[prost(message, optional, tag = "1")]
    pub token_id: ::core::option::Option<TokenId>,
    /// The type of the reject reason.
    #[prost(string, tag = "2")]
    pub r#type: ::prost::alloc::string::String,
    /// (Optional) CBOR-encoded details.
    #[prost(message, optional, tag = "3")]
    pub details: ::core::option::Option<Cbor>,
}
/// Update payload for creating a new protocol-level token
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreatePlt {
    /// The Token ID of the protocol-level token.
    #[prost(message, optional, tag = "1")]
    pub token_id: ::core::option::Option<TokenId>,
    /// The hash that identifies the token module implementation.
    #[prost(message, optional, tag = "2")]
    pub token_module: ::core::option::Option<TokenModuleRef>,
    /// The number of decimal places used in the representation of amounts of this
    /// token. This determines the smallest representable fraction of the token.
    /// This can be at most 255.
    #[prost(uint32, tag = "4")]
    pub decimals: u32,
    /// The initialization parameters of the token, encoded in CBOR.
    #[prost(message, optional, tag = "5")]
    pub initialization_parameters: ::core::option::Option<Cbor>,
}
/// Details about the creation of a protocol-level token.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenCreationDetails {
    /// The update payload used to create the token.
    #[prost(message, optional, tag = "1")]
    pub create_plt: ::core::option::Option<CreatePlt>,
    /// The events generated by the token module during the creation of the token.
    #[prost(message, repeated, tag = "2")]
    pub events: ::prost::alloc::vec::Vec<TokenEvent>,
}