UNPKG

@junobuild/admin

Version:

A library for interfacing with admin features of Juno

20 lines (19 loc) 1.6 kB
import type { OrbiterParameters } from '../types/actor.types'; import type { UpgradeCodeParams } from '../types/upgrade.types'; /** * Upgrades the Orbiter with the provided WASM module. * @param {Object} params - The parameters for upgrading the Orbiter. * @param {OrbiterParameters} params.orbiter - The Orbiter parameters, including the actor and orbiter ID. * @param {Principal} [params.missionControlId] - Optional. The Mission Control ID to potentially store WASM chunks, enabling reuse across installations. * @param {Uint8Array} params.wasmModule - The WASM module to be installed during the upgrade. * @param {boolean} [params.reset=false] - Optional. Indicates whether to reset the Orbiter (reinstall) instead of performing an upgrade. Defaults to `false`. * @param {boolean} [params.preClearChunks] - Optional. Forces clearing existing chunks before uploading a chunked WASM module. Recommended if the WASM exceeds 2MB. * @param {boolean} [params.takeSnapshot=true] - Optional. Whether to take a snapshot before performing the upgrade. Defaults to true. * @param {function} [params.onProgress] - Optional. Callback function to track progress during the upgrade process. * @throws {Error} Will throw an error if the Orbiter principal is not defined. * @returns {Promise<void>} Resolves when the upgrade process is complete. */ export declare const upgradeOrbiter: ({ orbiter, reset, ...rest }: { orbiter: OrbiterParameters; reset?: boolean; } & Pick<UpgradeCodeParams, "wasmModule" | "missionControlId" | "preClearChunks" | "takeSnapshot" | "onProgress">) => Promise<void>;