package_manager_backend/battery

Battery canister or battery module is a canister that holds cycles and delivers them to other canisters.

actor class Battery({ packageManager : Principal; mainIndirect : Principal; simpleIndirect : Principal; user : Principal; installationId : Common.InstallationId; userArg : Blob })

public func setOwners(newOwners : [Principal]) : async ()

public func addOwner(newOwner : Principal) : async ()

public func removeOwner(oldOwner : Principal) : async ()

public func getOwners() : async [Principal]

public func init() : async ()

public func b44c4a9beec74e1c8a7acbe46256f92f_isInitialized() : async ()

type ModuleLocation = { package : { packageName : Text; guid : Blob }; moduleName : Text }

type CanisterKind = Text

type CanisterMap = Map.Map<ModuleLocation, CanisterKind>

type CanisterKindsMap = Map.Map<CanisterKind, Common.CanisterFulfillment>

type Battery = { canisterInitialCycles : Nat; defaultFulfillment : Common.CanisterFulfillment; canisterMap : CanisterMap; canisterKindsMap : CanisterKindsMap; var activatedCycles : Nat }

public func getCanisterInitialCycles() : async Nat

public func withdrawCycles(amount : Nat, payee : Principal) : async ()

public func withdrawCycles3(amount : Nat, payee : Principal) : async ()

TODO@P3: Unused function.

public func withdrawCycles4(amount : Nat) : async ()

public func topUpCycles()

public func topUpWithICP() : async { balance : Nat }

public func balance() : async Nat