// @generated by protobuf-ts 2.9.1 with parameter optimize_code_size // @generated from protobuf file "v2/concordium/protocol-level-tokens.proto" (package "concordium.v2.plt", syntax proto3) // tslint:disable import { MessageType } from "@protobuf-ts/runtime"; import { Memo } from "./kernel.js"; import { AccountAddress } from "./kernel.js"; /** * A CBOR encoded bytestring * * @generated from protobuf message concordium.v2.plt.Cbor */ export interface Cbor { /** * A CBOR encoded byte string. * * @generated from protobuf field: bytes value = 1; */ value: Uint8Array; } /** * Token ID: a unique symbol and identifier of a protocol level token. * * @generated from protobuf message concordium.v2.plt.TokenId */ export interface 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 `-`. * * @generated from protobuf field: string value = 1; */ value: string; } /** * A token module reference. This is always 32 bytes long. * * @generated from protobuf message concordium.v2.plt.TokenModuleRef */ export interface TokenModuleRef { /** * @generated from protobuf field: bytes value = 1; */ value: Uint8Array; } /** * PLT amount representation. The actual amount is computed as * `value * 10^(-decimals)`. * * @generated from protobuf message concordium.v2.plt.TokenAmount */ export interface TokenAmount { /** * The digits of the amount. * * @generated from protobuf field: uint64 value = 1; */ value: bigint; /** * Number of decimals in the representation * * @generated from protobuf field: uint32 decimals = 2; */ decimals: number; } /** * Token state at the block level * * @generated from protobuf message concordium.v2.plt.TokenState */ export interface TokenState { /** * The reference of the module implementing this token. * * @generated from protobuf field: concordium.v2.plt.TokenModuleRef token_module_ref = 1; */ tokenModuleRef?: TokenModuleRef; /** * Number of decimals in the decimal number representation of amounts. * * @generated from protobuf field: uint32 decimals = 3; */ decimals: number; /** * The total available token supply. * * @generated from protobuf field: concordium.v2.plt.TokenAmount total_supply = 4; */ totalSupply?: TokenAmount; /** * Token module specific state, such as token name, feature flags, meta data. * * @generated from protobuf field: concordium.v2.plt.Cbor module_state = 5; */ moduleState?: Cbor; } /** * Token state at the account level * * @generated from protobuf message concordium.v2.plt.TokenAccountState */ export interface TokenAccountState { /** * The available balance. * * @generated from protobuf field: concordium.v2.plt.TokenAmount balance = 1; */ balance?: TokenAmount; /** * Token module specific account state, such as whether the account is on * the allow or deny list. * * @generated from protobuf field: optional concordium.v2.plt.Cbor module_state = 4; */ moduleState?: Cbor; } /** * Single token event originating from a token module as part of a token * transaction. * * @generated from protobuf message concordium.v2.plt.TokenModuleEvent */ export interface TokenModuleEvent { /** * The type of the event. * * @generated from protobuf field: string type = 1; */ type: string; /** * The CBOR encoded event details. * * @generated from protobuf field: concordium.v2.plt.Cbor details = 2; */ details?: 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. * * @generated from protobuf message concordium.v2.plt.TokenHolder */ export interface TokenHolder { /** * @generated from protobuf oneof: address */ address: { oneofKind: "account"; /** * The account address of the holder. * * @generated from protobuf field: concordium.v2.AccountAddress account = 1; */ account: AccountAddress; } | { oneofKind: undefined; }; } /** * An event emitted when a transfer of tokens from `from` to `to` is performed. * * @generated from protobuf message concordium.v2.plt.TokenTransferEvent */ export interface TokenTransferEvent { /** * The token holder from which the tokens are transferred. * * @generated from protobuf field: concordium.v2.plt.TokenHolder from = 1; */ from?: TokenHolder; /** * The token holder to which the tokens are transferred. * * @generated from protobuf field: concordium.v2.plt.TokenHolder to = 2; */ to?: TokenHolder; /** * The amount of tokens transferred. * * @generated from protobuf field: concordium.v2.plt.TokenAmount amount = 3; */ amount?: TokenAmount; /** * An optional memo field that can be used to attach a message to the token * transfer. * * @generated from protobuf field: optional concordium.v2.Memo memo = 4; */ memo?: Memo; } /** * An event emitted when the token supply is updated, i.e. by minting/burning * tokens to/from the balance of the `target`. * * @generated from protobuf message concordium.v2.plt.TokenSupplyUpdateEvent */ export interface TokenSupplyUpdateEvent { /** * The token holder the balance update is performed on. * * @generated from protobuf field: concordium.v2.plt.TokenHolder target = 1; */ target?: TokenHolder; /** * The balance difference to be applied to the target. * * @generated from protobuf field: concordium.v2.plt.TokenAmount amount = 2; */ amount?: TokenAmount; } /** * Token event originating from token transactions. * * @generated from protobuf message concordium.v2.plt.TokenEvent */ export interface TokenEvent { /** * The Token ID. * * @generated from protobuf field: concordium.v2.plt.TokenId token_id = 1; */ tokenId?: TokenId; /** * @generated from protobuf oneof: event */ event: { oneofKind: "moduleEvent"; /** * An event emitted by the token module. * * @generated from protobuf field: concordium.v2.plt.TokenModuleEvent module_event = 2; */ moduleEvent: TokenModuleEvent; } | { oneofKind: "transferEvent"; /** * An event emitted when a transfer of tokens is performed. * * @generated from protobuf field: concordium.v2.plt.TokenTransferEvent transfer_event = 3; */ transferEvent: TokenTransferEvent; } | { oneofKind: "mintEvent"; /** * An event emitted when the token supply is updated by minting tokens to a * token holder. * * @generated from protobuf field: concordium.v2.plt.TokenSupplyUpdateEvent mint_event = 4; */ mintEvent: TokenSupplyUpdateEvent; } | { oneofKind: "burnEvent"; /** * An event emitted when the token supply is updated by burning tokens from * the balance of a token holder. * * @generated from protobuf field: concordium.v2.plt.TokenSupplyUpdateEvent burn_event = 5; */ burnEvent: TokenSupplyUpdateEvent; } | { oneofKind: undefined; }; } /** * Token events originating from token transactions. * * @generated from protobuf message concordium.v2.plt.TokenEffect */ export interface TokenEffect { /** * Events emitted by the token. * * @generated from protobuf field: repeated concordium.v2.plt.TokenEvent events = 1; */ events: TokenEvent[]; } /** * Details provided by the token module in the event of rejecting a transaction. * * @generated from protobuf message concordium.v2.plt.TokenModuleRejectReason */ export interface TokenModuleRejectReason { /** * The Token ID of the protocol-level token. * * @generated from protobuf field: concordium.v2.plt.TokenId token_id = 1; */ tokenId?: TokenId; /** * The type of the reject reason. * * @generated from protobuf field: string type = 2; */ type: string; /** * (Optional) CBOR-encoded details. * * @generated from protobuf field: optional concordium.v2.plt.Cbor details = 3; */ details?: Cbor; } /** * Update payload for creating a new protocol-level token * * @generated from protobuf message concordium.v2.plt.CreatePLT */ export interface CreatePLT { /** * The Token ID of the protocol-level token. * * @generated from protobuf field: concordium.v2.plt.TokenId token_id = 1; */ tokenId?: TokenId; /** * The hash that identifies the token module implementation. * * @generated from protobuf field: concordium.v2.plt.TokenModuleRef token_module = 2; */ tokenModule?: 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. * * @generated from protobuf field: uint32 decimals = 4; */ decimals: number; /** * The initialization parameters of the token, encoded in CBOR. * * @generated from protobuf field: concordium.v2.plt.Cbor initialization_parameters = 5; */ initializationParameters?: Cbor; } /** * Details about the creation of a protocol-level token. * * @generated from protobuf message concordium.v2.plt.TokenCreationDetails */ export interface TokenCreationDetails { /** * The update payload used to create the token. * * @generated from protobuf field: concordium.v2.plt.CreatePLT create_plt = 1; */ createPlt?: CreatePLT; /** * The events generated by the token module during the creation of the token. * * @generated from protobuf field: repeated concordium.v2.plt.TokenEvent events = 2; */ events: TokenEvent[]; } // @generated message type with reflection information, may provide speed optimized methods class Cbor$Type extends MessageType { constructor() { super("concordium.v2.plt.Cbor", [ { no: 1, name: "value", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.Cbor */ export const Cbor = new Cbor$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenId$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenId", [ { no: 1, name: "value", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenId */ export const TokenId = new TokenId$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenModuleRef$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenModuleRef", [ { no: 1, name: "value", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenModuleRef */ export const TokenModuleRef = new TokenModuleRef$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenAmount$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenAmount", [ { no: 1, name: "value", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 2, name: "decimals", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenAmount */ export const TokenAmount = new TokenAmount$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenState$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenState", [ { no: 1, name: "token_module_ref", kind: "message", T: () => TokenModuleRef }, { no: 3, name: "decimals", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 4, name: "total_supply", kind: "message", T: () => TokenAmount }, { no: 5, name: "module_state", kind: "message", T: () => Cbor } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenState */ export const TokenState = new TokenState$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenAccountState$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenAccountState", [ { no: 1, name: "balance", kind: "message", T: () => TokenAmount }, { no: 4, name: "module_state", kind: "message", T: () => Cbor } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenAccountState */ export const TokenAccountState = new TokenAccountState$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenModuleEvent$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenModuleEvent", [ { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "details", kind: "message", T: () => Cbor } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenModuleEvent */ export const TokenModuleEvent = new TokenModuleEvent$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenHolder$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenHolder", [ { no: 1, name: "account", kind: "message", oneof: "address", T: () => AccountAddress } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenHolder */ export const TokenHolder = new TokenHolder$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenTransferEvent$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenTransferEvent", [ { no: 1, name: "from", kind: "message", T: () => TokenHolder }, { no: 2, name: "to", kind: "message", T: () => TokenHolder }, { no: 3, name: "amount", kind: "message", T: () => TokenAmount }, { no: 4, name: "memo", kind: "message", T: () => Memo } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenTransferEvent */ export const TokenTransferEvent = new TokenTransferEvent$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenSupplyUpdateEvent$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenSupplyUpdateEvent", [ { no: 1, name: "target", kind: "message", T: () => TokenHolder }, { no: 2, name: "amount", kind: "message", T: () => TokenAmount } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenSupplyUpdateEvent */ export const TokenSupplyUpdateEvent = new TokenSupplyUpdateEvent$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenEvent$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenEvent", [ { no: 1, name: "token_id", kind: "message", T: () => TokenId }, { no: 2, name: "module_event", kind: "message", oneof: "event", T: () => TokenModuleEvent }, { no: 3, name: "transfer_event", kind: "message", oneof: "event", T: () => TokenTransferEvent }, { no: 4, name: "mint_event", kind: "message", oneof: "event", T: () => TokenSupplyUpdateEvent }, { no: 5, name: "burn_event", kind: "message", oneof: "event", T: () => TokenSupplyUpdateEvent } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenEvent */ export const TokenEvent = new TokenEvent$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenEffect$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenEffect", [ { no: 1, name: "events", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => TokenEvent } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenEffect */ export const TokenEffect = new TokenEffect$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenModuleRejectReason$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenModuleRejectReason", [ { no: 1, name: "token_id", kind: "message", T: () => TokenId }, { no: 2, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "details", kind: "message", T: () => Cbor } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenModuleRejectReason */ export const TokenModuleRejectReason = new TokenModuleRejectReason$Type(); // @generated message type with reflection information, may provide speed optimized methods class CreatePLT$Type extends MessageType { constructor() { super("concordium.v2.plt.CreatePLT", [ { no: 1, name: "token_id", kind: "message", T: () => TokenId }, { no: 2, name: "token_module", kind: "message", T: () => TokenModuleRef }, { no: 4, name: "decimals", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 5, name: "initialization_parameters", kind: "message", T: () => Cbor } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.CreatePLT */ export const CreatePLT = new CreatePLT$Type(); // @generated message type with reflection information, may provide speed optimized methods class TokenCreationDetails$Type extends MessageType { constructor() { super("concordium.v2.plt.TokenCreationDetails", [ { no: 1, name: "create_plt", kind: "message", T: () => CreatePLT }, { no: 2, name: "events", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => TokenEvent } ]); } } /** * @generated MessageType for protobuf message concordium.v2.plt.TokenCreationDetails */ export const TokenCreationDetails = new TokenCreationDetails$Type();