@dfinity/ic-management
Version:
A library for interfacing with the IC management canister.
3 lines (2 loc) • 771 B
JavaScript
import{Principal as p}from"@dfinity/principal";import{isNullish as g,toNullable as e}from"@dfinity/utils";var u=(t=>(t[t.Controllers=0]="Controllers",t[t.Public=1]="Public",t))(u||{}),i=class extends Error{},P=({controllers:r,freezingThreshold:a,memoryAllocation:t,computeAllocation:s,reservedCyclesLimit:o,logVisibility:n,wasmMemoryLimit:l,wasmMemoryThreshold:c}={})=>{let m=()=>{switch(n){case 0:return{controllers:null};case 1:return{public:null};default:throw new i}};return{controllers:e(r?.map(d=>p.fromText(d))),freezing_threshold:e(a),memory_allocation:e(t),compute_allocation:e(s),reserved_cycles_limit:e(o),log_visibility:g(n)?[]:[m()],wasm_memory_limit:e(l),wasm_memory_threshold:e(c)}};export{u as a,i as b,P as c};
//# sourceMappingURL=chunk-NWTB4UMW.js.map