/** * This module provides foundations to create aggregators in the system. * * Design rationale (V1) * ===================== * First, we encourage the reader to see rationale of `Aggregator` in * `aggregator.move`. * * Recall that the value of any aggregator can be identified in storage by * (handle, key) pair. How this pair can be generated? Short answer: with * `AggregatorFactory`! * * `AggregatorFactory` is a struct that can be stored as a resource on some * account and which contains a `phantom_table` field. When the factory is * initialized, we initialize this table. Importantly, table initialization * only generates a uniue table `handle` - something we can reuse. * * When the user wants to create a new aggregator, he/she calls a constructor * provided by the factory (`create_aggregator(..)`). This constructor generates * a unique key, which with the handle is used to initialize `Aggregator` struct. * * Use cases * ========= * We limit the usage of `AggregatorFactory` by only storing it on the core * account. * * When something whants to use an aggregator, the factory is queried and an * aggregator instance is created. Once aggregator is no longer in use, it * should be destroyed by the user. * * **Module ID:** `0x1::aggregator_factory` * * @module */ import type * as p from "@movingco/prelude"; /** * Struct that creates aggregators. * * Type name: `0x1::aggregator_factory::AggregatorFactory` */ export interface IAggregatorFactory { phantom_table: { handle: p.U128; }; } export { idl } from "./idl.js"; /** The address of the module. */ export declare const ADDRESS: "0x1"; /** The full module name. */ export declare const FULL_NAME: "0x1::aggregator_factory"; /** The name of the module. */ export declare const NAME: "aggregator_factory"; /** Module ID information. */ export declare const id: { readonly ADDRESS: "0x1"; readonly FULL_NAME: "0x1::aggregator_factory"; readonly NAME: "aggregator_factory"; }; export * as errors from "./errors.js"; /** Module error codes. */ export declare const errorCodes: { readonly "1": { readonly name: "EAGGREGATOR_FACTORY_EXISTS"; readonly doc: "When aggregator factory has already been published."; }; readonly "2": { readonly name: "ENOT_CORE_FRAMEWORK_ADDRESS"; readonly doc: "When aggregator factory is published to not core framework address."; }; readonly "3": { readonly name: "ENOT_SUPPORTED"; readonly doc: "When aggregator feature is not supported (raised by native code)."; }; }; /** All module function IDLs. */ export declare const functions: {}; /** All struct types with ability `key`. */ export declare const resources: { readonly AggregatorFactory: "0x1::aggregator_factory::AggregatorFactory"; }; /** All struct types. */ export declare const structs: { readonly AggregatorFactory: "0x1::aggregator_factory::AggregatorFactory"; }; /** * This module provides foundations to create aggregators in the system. * * Design rationale (V1) * ===================== * First, we encourage the reader to see rationale of `Aggregator` in * `aggregator.move`. * * Recall that the value of any aggregator can be identified in storage by * (handle, key) pair. How this pair can be generated? Short answer: with * `AggregatorFactory`! * * `AggregatorFactory` is a struct that can be stored as a resource on some * account and which contains a `phantom_table` field. When the factory is * initialized, we initialize this table. Importantly, table initialization * only generates a uniue table `handle` - something we can reuse. * * When the user wants to create a new aggregator, he/she calls a constructor * provided by the factory (`create_aggregator(..)`). This constructor generates * a unique key, which with the handle is used to initialize `Aggregator` struct. * * Use cases * ========= * We limit the usage of `AggregatorFactory` by only storing it on the core * account. * * When something whants to use an aggregator, the factory is queried and an * aggregator instance is created. Once aggregator is no longer in use, it * should be destroyed by the user. */ export declare const moduleDefinition: { readonly errorCodes: { readonly "1": { readonly name: "EAGGREGATOR_FACTORY_EXISTS"; readonly doc: "When aggregator factory has already been published."; }; readonly "2": { readonly name: "ENOT_CORE_FRAMEWORK_ADDRESS"; readonly doc: "When aggregator factory is published to not core framework address."; }; readonly "3": { readonly name: "ENOT_SUPPORTED"; readonly doc: "When aggregator feature is not supported (raised by native code)."; }; }; readonly functions: {}; readonly resources: { readonly AggregatorFactory: "0x1::aggregator_factory::AggregatorFactory"; }; readonly structs: { readonly AggregatorFactory: "0x1::aggregator_factory::AggregatorFactory"; }; readonly ADDRESS: "0x1"; readonly FULL_NAME: "0x1::aggregator_factory"; readonly NAME: "aggregator_factory"; }; //# sourceMappingURL=index.d.ts.map