UNPKG

@junobuild/admin

Version:

A library for interfacing with admin features of Juno

24 lines (23 loc) 1.93 kB
import type { SatelliteParameters } from '../types/actor.types'; import type { UpgradeCodeParams } from '../types/upgrade.types'; /** * Upgrades a satellite with the provided WASM module. * @param {Object} params - The parameters for upgrading the satellite. * @param {SatelliteParameters} params.satellite - The satellite parameters, including the actor and satellite 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.deprecated - Indicates whether the upgrade is deprecated. * @param {boolean} params.deprecatedNoScope - Indicates whether the upgrade is deprecated and has no scope. * @param {boolean} [params.reset=false] - Optional. Specifies whether to reset the satellite (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 satellite parameters are invalid or missing required fields. * @returns {Promise<void>} Resolves when the upgrade process is complete. */ export declare const upgradeSatellite: ({ satellite, deprecated, deprecatedNoScope, reset, ...rest }: { satellite: SatelliteParameters; deprecated: boolean; deprecatedNoScope: boolean; reset?: boolean; } & Pick<UpgradeCodeParams, "wasmModule" | "missionControlId" | "preClearChunks" | "takeSnapshot" | "onProgress">) => Promise<void>;