/** * This module supports functionality related to code management. * * **Module ID:** `0x1::code` * * @module */ import type * as p from "@movingco/prelude"; /** * Metadata about a module in a package. * * Type name: `0x1::code::ModuleMetadata` */ export interface IModuleMetadata { /** Name of the module. */ name: string; /** Source text, in compressed ascii. */ source: string; /** Source map, in compressed BCS. */ source_map: string; } /** * Metadata for a package. All byte blobs are represented as base64-of-gzipped-bytes * * Type name: `0x1::code::PackageMetadata` */ export interface IPackageMetadata { /** Name of this package. */ name: string; /** The upgrade policy of this package. */ upgrade_policy: { policy: number; }; /** * The numbers of times this module has been upgraded. Also serves as the on-chain version. * This field will be automatically assigned on successful upgrade. */ upgrade_number: p.U64; /** The BuildInfo, in the BuildInfo.yaml format. */ build_info: string; /** The package manifest, in the Move.toml format. */ manifest: string; /** The list of modules installed by this package. */ modules: ReadonlyArray<{ /** Name of the module. */ name: string; /** Source text, in compressed ascii. */ source: string; /** Source map, in compressed BCS. */ source_map: string; }>; /** Error map, in compressed BCS */ error_map: string; /** ABIs, in compressed BCS */ abis: ReadonlyArray; } /** * The package registry at the given address. * * Type name: `0x1::code::PackageRegistry` */ export interface IPackageRegistry { /** Packages installed at this address. */ packages: ReadonlyArray<{ /** Name of this package. */ name: string; /** The upgrade policy of this package. */ upgrade_policy: { policy: number; }; /** * The numbers of times this module has been upgraded. Also serves as the on-chain version. * This field will be automatically assigned on successful upgrade. */ upgrade_number: p.U64; /** The BuildInfo, in the BuildInfo.yaml format. */ build_info: string; /** The package manifest, in the Move.toml format. */ manifest: string; /** The list of modules installed by this package. */ modules: ReadonlyArray<{ /** Name of the module. */ name: string; /** Source text, in compressed ascii. */ source: string; /** Source map, in compressed BCS. */ source_map: string; }>; /** Error map, in compressed BCS */ error_map: string; /** ABIs, in compressed BCS */ abis: ReadonlyArray; }>; } /** * Describes an upgrade policy * * Type name: `0x1::code::UpgradePolicy` */ export interface IUpgradePolicy { policy: number; } /** Payload arguments for {@link entry.publish_package_txn}. */ export declare type PublishPackageTxnArgs = { args: { /** IDL type: `Vector(U8)` */ pack_serialized: p.ByteString; /** IDL type: `Vector(Vector(U8))` */ code: ReadonlyArray; }; }; export * as entry from "./entry.js"; export * as entryNames from "./entryNames.js"; export { idl } from "./idl.js"; export * as payloads from "./payloads.js"; /** The address of the module. */ export declare const ADDRESS: "0x1"; /** The full module name. */ export declare const FULL_NAME: "0x1::code"; /** The name of the module. */ export declare const NAME: "code"; /** Module ID information. */ export declare const id: { readonly ADDRESS: "0x1"; readonly FULL_NAME: "0x1::code"; readonly NAME: "code"; }; export * as errors from "./errors.js"; /** Module error codes. */ export declare const errorCodes: { readonly "1": { readonly name: "EMODULE_NAME_CLASH"; readonly doc: "Package contains duplicate module names with existing modules publised in other packages on this address"; }; readonly "2": { readonly name: "EUPGRADE_IMMUTABLE"; readonly doc: "Cannot upgrade an immutable package"; }; readonly "3": { readonly name: "EUPGRADE_WEAKER_POLICY"; readonly doc: "Cannot downgrade a package's upgradability policy"; }; readonly "4": { readonly name: "EMODULE_MISSING"; readonly doc: "Cannot delete a module that was published in the same package"; }; }; /** All module function IDLs. */ export declare const functions: { readonly publish_package_txn: { readonly name: "publish_package_txn"; readonly doc: "Same as `publish_package` but as an entry function which can be called as a transaction. Because\nof current restrictions for txn parameters, the metadata needs to be passed in serialized form."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "pack_serialized"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "code"; readonly ty: { readonly vector: { readonly vector: "u8"; }; }; }]; }; }; /** All struct types with ability `key`. */ export declare const resources: { readonly PackageRegistry: "0x1::code::PackageRegistry"; }; /** All struct types. */ export declare const structs: { readonly ModuleMetadata: "0x1::code::ModuleMetadata"; readonly PackageMetadata: "0x1::code::PackageMetadata"; readonly PackageRegistry: "0x1::code::PackageRegistry"; readonly UpgradePolicy: "0x1::code::UpgradePolicy"; }; /** This module supports functionality related to code management. */ export declare const moduleDefinition: { readonly errorCodes: { readonly "1": { readonly name: "EMODULE_NAME_CLASH"; readonly doc: "Package contains duplicate module names with existing modules publised in other packages on this address"; }; readonly "2": { readonly name: "EUPGRADE_IMMUTABLE"; readonly doc: "Cannot upgrade an immutable package"; }; readonly "3": { readonly name: "EUPGRADE_WEAKER_POLICY"; readonly doc: "Cannot downgrade a package's upgradability policy"; }; readonly "4": { readonly name: "EMODULE_MISSING"; readonly doc: "Cannot delete a module that was published in the same package"; }; }; readonly functions: { readonly publish_package_txn: { readonly name: "publish_package_txn"; readonly doc: "Same as `publish_package` but as an entry function which can be called as a transaction. Because\nof current restrictions for txn parameters, the metadata needs to be passed in serialized form."; readonly ty_args: readonly []; readonly args: readonly [{ readonly name: "pack_serialized"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "code"; readonly ty: { readonly vector: { readonly vector: "u8"; }; }; }]; }; }; readonly resources: { readonly PackageRegistry: "0x1::code::PackageRegistry"; }; readonly structs: { readonly ModuleMetadata: "0x1::code::ModuleMetadata"; readonly PackageMetadata: "0x1::code::PackageMetadata"; readonly PackageRegistry: "0x1::code::PackageRegistry"; readonly UpgradePolicy: "0x1::code::UpgradePolicy"; }; readonly ADDRESS: "0x1"; readonly FULL_NAME: "0x1::code"; readonly NAME: "code"; }; //# sourceMappingURL=index.d.ts.map