UNPKG

cache-typescript-sdk

Version:
84 lines (83 loc) 3.61 kB
import { PublicAccount } from "../account/PublicAccount"; import { MosaicId } from "./MosaicId"; import { MosaicLevy } from "./MosaicLevy"; /** * A mosaic definition describes an asset class. Some fields are mandatory while others are optional. * The properties of a mosaic definition always have a default value and only need to be supplied if they differ from the default value. */ export declare class MosaicDefinition { /** * The public key of the mosaic definition creator. */ readonly creator: PublicAccount; /** * The mosaic id */ readonly id: MosaicId; /** * The mosaic description. The description may have a length of up to 512 characters and cannot be empty. */ readonly description: string; /** * Mosaic properties */ readonly properties: MosaicProperties; /** * The optional levy for the mosaic. A creator can demand that each mosaic transfer induces an additional fee */ readonly levy?: MosaicLevy; /** * The id for the mosaic definition object. */ readonly metaId?: number; /** * constructor * @param creator * @param id * @param description * @param properties * @param levy * @param metaId */ constructor(creator: PublicAccount, id: MosaicId, description: string, properties: MosaicProperties, levy?: MosaicLevy, metaId?: number); } /** * Each mosaic definition comes with a set of properties. * Each property has a default value which will be applied in case it was not specified. * Future release may add additional properties to the set of available properties */ export declare class MosaicProperties { /** * initialSupply: The creator can specify an initial supply of mosaics when creating the definition. * The supply is given in entire units of the mosaic, not in smallest sub-units. * The initial supply must be in the range of 0 and 9,000,000,000. The default value is "1000". */ readonly initialSupply: number; /** * The creator can choose between a definition that allows a mosaic supply change at a later point or an immutable supply. * Allowed values for the property are "true" and "false". The default value is "false". */ readonly supplyMutable: boolean; /** * The creator can choose if the mosaic definition should allow for transfers of the mosaic among accounts other than the creator. * If the property 'transferable' is set to "false", only transfer transactions having the creator as sender or as recipient can transfer mosaics of that type. * If set to "true" the mosaics can be transferred to and from arbitrary accounts. * Allowed values for the property are thus "true" and "false". The default value is "true". */ readonly transferable: boolean; /** * The divisibility determines up to what decimal place the mosaic can be divided into. * Thus a divisibility of 3 means that a mosaic can be divided into smallest parts of 0.001 mosaics, i.e. milli mosaics is the smallest sub-unit. * When transferring mosaics via a transfer transaction the quantity transferred is given in multiples of those smallest parts. * The divisibility must be in the range of 0 and 6. The default value is "0". */ readonly divisibility: number; /** * constructor * @param divisibility * @param initialSupply * @param supplyMutable * @param transferable */ constructor(divisibility?: number, initialSupply?: number, transferable?: boolean, supplyMutable?: boolean); }