@dfinity/ic-management
Advanced tools
Comparing version 6.0.0 to 6.0.1-next-2024-12-04
@@ -326,2 +326,4 @@ /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ic-management/candid/ic-management.did */ | ||
const stored_chunks_result = IDL.Vec(chunk_hash); | ||
const subnet_info_args = IDL.Record({ 'subnet_id' : IDL.Principal }); | ||
const subnet_info_result = IDL.Record({ 'replica_version' : IDL.Text }); | ||
const take_canister_snapshot_args = IDL.Record({ | ||
@@ -452,2 +454,3 @@ 'replace_snapshot' : IDL.Opt(snapshot_id), | ||
), | ||
'subnet_info' : IDL.Func([subnet_info_args], [subnet_info_result], []), | ||
'take_canister_snapshot' : IDL.Func( | ||
@@ -454,0 +457,0 @@ [take_canister_snapshot_args], |
@@ -310,2 +310,8 @@ import type { ActorMethod } from "@dfinity/agent"; | ||
export type stored_chunks_result = Array<chunk_hash>; | ||
export interface subnet_info_args { | ||
subnet_id: Principal; | ||
} | ||
export interface subnet_info_result { | ||
replica_version: string; | ||
} | ||
export interface take_canister_snapshot_args { | ||
@@ -408,2 +414,3 @@ replace_snapshot: [] | [snapshot_id]; | ||
stored_chunks: ActorMethod<[stored_chunks_args], stored_chunks_result>; | ||
subnet_info: ActorMethod<[subnet_info_args], subnet_info_result>; | ||
take_canister_snapshot: ActorMethod< | ||
@@ -410,0 +417,0 @@ [take_canister_snapshot_args], |
@@ -326,2 +326,4 @@ /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ic-management/candid/ic-management.did */ | ||
const stored_chunks_result = IDL.Vec(chunk_hash); | ||
const subnet_info_args = IDL.Record({ 'subnet_id' : IDL.Principal }); | ||
const subnet_info_result = IDL.Record({ 'replica_version' : IDL.Text }); | ||
const take_canister_snapshot_args = IDL.Record({ | ||
@@ -452,2 +454,3 @@ 'replace_snapshot' : IDL.Opt(snapshot_id), | ||
), | ||
'subnet_info' : IDL.Func([subnet_info_args], [subnet_info_result], []), | ||
'take_canister_snapshot' : IDL.Func( | ||
@@ -454,0 +457,0 @@ [take_canister_snapshot_args], |
@@ -1,2 +0,2 @@ | ||
"use strict";var qt=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var Ht=Object.getOwnPropertyNames;var Bt=Object.prototype.hasOwnProperty;var jt=(t,e)=>{for(var s in e)qt(t,s,{get:e[s],enumerable:!0})},Gt=(t,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ht(e))!Bt.call(t,r)&&r!==s&&qt(t,r,{get:()=>e[r],enumerable:!(a=Et(e,r))||a.enumerable});return t};var Jt=t=>Gt(qt({},"__esModule",{value:!0}),t);var Qt={};jt(Qt,{ICManagementCanister:()=>x,LogVisibility:()=>Mt,UnsupportedLogVisibility:()=>f,decodeSnapshotId:()=>Wt,encodeSnapshotId:()=>Kt,mapSnapshotId:()=>v,toCanisterSettings:()=>b});module.exports=Jt(Qt);var C=require("@dfinity/principal"),c=require("@dfinity/utils");var Ut=({IDL:t})=>{let e=t.Variant({mainnet:t.Null,testnet:t.Null}),s=t.Text,a=t.Record({network:e,address:s,min_confirmations:t.Opt(t.Nat32)}),r=t.Nat64,i=r,o=t.Nat32,_=t.Record({start_height:o,end_height:t.Opt(o),network:e}),p=t.Vec(t.Nat8),F=t.Record({tip_height:o,block_headers:t.Vec(p)}),O=t.Record({network:e}),w=t.Nat64,S=t.Vec(w),T=t.Record({network:e,filter:t.Opt(t.Variant({page:t.Vec(t.Nat8),min_confirmations:t.Nat32})),address:s}),q=t.Vec(t.Nat8),U=t.Record({txid:t.Vec(t.Nat8),vout:t.Nat32}),z=t.Record({height:t.Nat32,value:r,outpoint:U}),A=t.Record({next_page:t.Opt(t.Vec(t.Nat8)),tip_height:o,tip_block_hash:q,utxos:t.Vec(z)}),M=t.Record({transaction:t.Vec(t.Nat8),network:e}),n=t.Principal,W=t.Record({canister_id:n,num_requested_changes:t.Opt(t.Nat64)}),E=t.Variant({from_user:t.Record({user_id:t.Principal}),from_canister:t.Record({canister_version:t.Opt(t.Nat64),canister_id:t.Principal})}),l=t.Vec(t.Nat8),H=t.Variant({creation:t.Record({controllers:t.Vec(t.Principal)}),code_deployment:t.Record({mode:t.Variant({reinstall:t.Null,upgrade:t.Null,install:t.Null}),module_hash:t.Vec(t.Nat8)}),load_snapshot:t.Record({canister_version:t.Nat64,taken_at_timestamp:t.Nat64,snapshot_id:l}),controllers_change:t.Record({controllers:t.Vec(t.Principal)}),code_uninstall:t.Null}),B=t.Record({timestamp_nanos:t.Nat64,canister_version:t.Nat64,origin:E,details:H}),j=t.Record({controllers:t.Vec(t.Principal),module_hash:t.Opt(t.Vec(t.Nat8)),recent_changes:t.Vec(B),total_num_changes:t.Nat64}),G=t.Record({canister_id:n}),g=t.Variant({controllers:t.Null,public:t.Null,allowed_viewers:t.Vec(t.Principal)}),J=t.Record({freezing_threshold:t.Nat,controllers:t.Vec(t.Principal),reserved_cycles_limit:t.Nat,log_visibility:g,wasm_memory_limit:t.Nat,memory_allocation:t.Nat,compute_allocation:t.Nat}),K=t.Record({status:t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),memory_size:t.Nat,cycles:t.Nat,settings:J,query_stats:t.Record({response_payload_bytes_total:t.Nat,num_instructions_total:t.Nat,num_calls_total:t.Nat,request_payload_bytes_total:t.Nat}),idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8)),reserved_cycles:t.Nat}),Q=t.Record({canister_id:n}),u=t.Record({freezing_threshold:t.Opt(t.Nat),controllers:t.Opt(t.Vec(t.Principal)),reserved_cycles_limit:t.Opt(t.Nat),log_visibility:t.Opt(g),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Opt(t.Nat),compute_allocation:t.Opt(t.Nat)}),X=t.Record({settings:t.Opt(u),sender_canister_version:t.Opt(t.Nat64)}),Y=t.Record({canister_id:n}),Z=t.Record({canister_id:n}),$=t.Record({canister_id:n,snapshot_id:l}),I=t.Record({canister_id:n}),N=t.Variant({secp256k1:t.Null}),L=t.Record({key_id:t.Record({name:t.Text,curve:N}),canister_id:t.Opt(n),derivation_path:t.Vec(t.Vec(t.Nat8))}),D=t.Record({public_key:t.Vec(t.Nat8),chain_code:t.Vec(t.Nat8)}),tt=t.Record({canister_id:n}),et=t.Record({idx:t.Nat64,timestamp_nanos:t.Nat64,content:t.Vec(t.Nat8)}),st=t.Record({canister_log_records:t.Vec(et)}),y=t.Record({value:t.Text,name:t.Text}),h=t.Record({status:t.Nat,body:t.Vec(t.Nat8),headers:t.Vec(y)}),nt=t.Record({url:t.Text,method:t.Variant({get:t.Null,head:t.Null,post:t.Null}),max_response_bytes:t.Opt(t.Nat64),body:t.Opt(t.Vec(t.Nat8)),transform:t.Opt(t.Record({function:t.Func([t.Record({context:t.Vec(t.Nat8),response:h})],[h],[]),context:t.Vec(t.Nat8)})),headers:t.Vec(y)}),R=t.Variant({reinstall:t.Null,upgrade:t.Opt(t.Record({wasm_memory_persistence:t.Opt(t.Variant({keep:t.Null,replace:t.Null})),skip_pre_upgrade:t.Opt(t.Bool)})),install:t.Null}),m=t.Record({hash:t.Vec(t.Nat8)}),at=t.Record({arg:t.Vec(t.Nat8),wasm_module_hash:t.Vec(t.Nat8),mode:R,chunk_hashes_list:t.Vec(m),target_canister:n,store_canister:t.Opt(n),sender_canister_version:t.Opt(t.Nat64)}),rt=t.Vec(t.Nat8),ct=t.Record({arg:t.Vec(t.Nat8),wasm_module:rt,mode:R,canister_id:n,sender_canister_version:t.Opt(t.Nat64)}),it=t.Record({canister_id:n}),V=t.Record({id:l,total_size:t.Nat64,taken_at_timestamp:t.Nat64}),ot=t.Vec(V),_t=t.Record({canister_id:n,sender_canister_version:t.Opt(t.Nat64),snapshot_id:l}),lt=t.Record({start_at_timestamp_nanos:t.Nat64,subnet_id:t.Principal}),dt=t.Record({num_block_failures_total:t.Nat64,node_id:t.Principal,num_blocks_proposed_total:t.Nat64}),pt=t.Vec(t.Record({timestamp_nanos:t.Nat64,node_metrics:t.Vec(dt)})),ut=t.Record({settings:t.Opt(u),specified_id:t.Opt(n),amount:t.Opt(t.Nat),sender_canister_version:t.Opt(t.Nat64)}),ht=t.Record({canister_id:n}),mt=t.Record({canister_id:n,amount:t.Nat}),gt=t.Vec(t.Nat8),k=t.Variant({ed25519:t.Null,bip340secp256k1:t.Null}),Nt=t.Record({key_id:t.Record({algorithm:k,name:t.Text}),canister_id:t.Opt(n),derivation_path:t.Vec(t.Vec(t.Nat8))}),yt=t.Record({public_key:t.Vec(t.Nat8),chain_code:t.Vec(t.Nat8)}),Rt=t.Record({key_id:t.Record({name:t.Text,curve:N}),derivation_path:t.Vec(t.Vec(t.Nat8)),message_hash:t.Vec(t.Nat8)}),Vt=t.Record({signature:t.Vec(t.Nat8)}),kt=t.Record({key_id:t.Record({algorithm:k,name:t.Text}),derivation_path:t.Vec(t.Vec(t.Nat8)),message:t.Vec(t.Nat8)}),bt=t.Record({signature:t.Vec(t.Nat8)}),vt=t.Record({canister_id:n}),ft=t.Record({canister_id:n}),Pt=t.Record({canister_id:n}),Ct=t.Vec(m),xt=t.Record({replace_snapshot:t.Opt(l),canister_id:n}),Ft=V,Ot=t.Record({canister_id:n,sender_canister_version:t.Opt(t.Nat64)}),wt=t.Record({canister_id:t.Principal,settings:u,sender_canister_version:t.Opt(t.Nat64)}),St=t.Record({chunk:t.Vec(t.Nat8),canister_id:t.Principal}),Tt=m;return t.Service({bitcoin_get_balance:t.Func([a],[i],[]),bitcoin_get_block_headers:t.Func([_],[F],[]),bitcoin_get_current_fee_percentiles:t.Func([O],[S],[]),bitcoin_get_utxos:t.Func([T],[A],[]),bitcoin_send_transaction:t.Func([M],[],[]),canister_info:t.Func([W],[j],[]),canister_status:t.Func([G],[K],[]),clear_chunk_store:t.Func([Q],[],[]),create_canister:t.Func([X],[Y],[]),delete_canister:t.Func([Z],[],[]),delete_canister_snapshot:t.Func([$],[],[]),deposit_cycles:t.Func([I],[],[]),ecdsa_public_key:t.Func([L],[D],[]),fetch_canister_logs:t.Func([tt],[st],[]),http_request:t.Func([nt],[h],[]),install_chunked_code:t.Func([at],[],[]),install_code:t.Func([ct],[],[]),list_canister_snapshots:t.Func([it],[ot],[]),load_canister_snapshot:t.Func([_t],[],[]),node_metrics_history:t.Func([lt],[pt],[]),provisional_create_canister_with_cycles:t.Func([ut],[ht],[]),provisional_top_up_canister:t.Func([mt],[],[]),raw_rand:t.Func([],[gt],[]),schnorr_public_key:t.Func([Nt],[yt],[]),sign_with_ecdsa:t.Func([Rt],[Vt],[]),sign_with_schnorr:t.Func([kt],[bt],[]),start_canister:t.Func([vt],[],[]),stop_canister:t.Func([ft],[],[]),stored_chunks:t.Func([Pt],[Ct],[]),take_canister_snapshot:t.Func([xt],[Ft],[]),uninstall_code:t.Func([Ot],[],[]),update_settings:t.Func([wt],[],[]),upload_chunk:t.Func([St],[Tt],[])})};var zt=({IDL:t})=>{let e=t.Variant({mainnet:t.Null,testnet:t.Null}),s=t.Text,a=t.Record({network:e,address:s,min_confirmations:t.Opt(t.Nat32)}),r=t.Nat64,i=r,o=t.Nat32,_=t.Record({start_height:o,end_height:t.Opt(o),network:e}),p=t.Vec(t.Nat8),F=t.Record({tip_height:o,block_headers:t.Vec(p)}),O=t.Record({network:e}),w=t.Nat64,S=t.Vec(w),T=t.Record({network:e,filter:t.Opt(t.Variant({page:t.Vec(t.Nat8),min_confirmations:t.Nat32})),address:s}),q=t.Vec(t.Nat8),U=t.Record({txid:t.Vec(t.Nat8),vout:t.Nat32}),z=t.Record({height:t.Nat32,value:r,outpoint:U}),A=t.Record({next_page:t.Opt(t.Vec(t.Nat8)),tip_height:o,tip_block_hash:q,utxos:t.Vec(z)}),M=t.Record({transaction:t.Vec(t.Nat8),network:e}),n=t.Principal,W=t.Record({canister_id:n,num_requested_changes:t.Opt(t.Nat64)}),E=t.Variant({from_user:t.Record({user_id:t.Principal}),from_canister:t.Record({canister_version:t.Opt(t.Nat64),canister_id:t.Principal})}),l=t.Vec(t.Nat8),H=t.Variant({creation:t.Record({controllers:t.Vec(t.Principal)}),code_deployment:t.Record({mode:t.Variant({reinstall:t.Null,upgrade:t.Null,install:t.Null}),module_hash:t.Vec(t.Nat8)}),load_snapshot:t.Record({canister_version:t.Nat64,taken_at_timestamp:t.Nat64,snapshot_id:l}),controllers_change:t.Record({controllers:t.Vec(t.Principal)}),code_uninstall:t.Null}),B=t.Record({timestamp_nanos:t.Nat64,canister_version:t.Nat64,origin:E,details:H}),j=t.Record({controllers:t.Vec(t.Principal),module_hash:t.Opt(t.Vec(t.Nat8)),recent_changes:t.Vec(B),total_num_changes:t.Nat64}),G=t.Record({canister_id:n}),g=t.Variant({controllers:t.Null,public:t.Null,allowed_viewers:t.Vec(t.Principal)}),J=t.Record({freezing_threshold:t.Nat,controllers:t.Vec(t.Principal),reserved_cycles_limit:t.Nat,log_visibility:g,wasm_memory_limit:t.Nat,memory_allocation:t.Nat,compute_allocation:t.Nat}),K=t.Record({status:t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),memory_size:t.Nat,cycles:t.Nat,settings:J,query_stats:t.Record({response_payload_bytes_total:t.Nat,num_instructions_total:t.Nat,num_calls_total:t.Nat,request_payload_bytes_total:t.Nat}),idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8)),reserved_cycles:t.Nat}),Q=t.Record({canister_id:n}),u=t.Record({freezing_threshold:t.Opt(t.Nat),controllers:t.Opt(t.Vec(t.Principal)),reserved_cycles_limit:t.Opt(t.Nat),log_visibility:t.Opt(g),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Opt(t.Nat),compute_allocation:t.Opt(t.Nat)}),X=t.Record({settings:t.Opt(u),sender_canister_version:t.Opt(t.Nat64)}),Y=t.Record({canister_id:n}),Z=t.Record({canister_id:n}),$=t.Record({canister_id:n,snapshot_id:l}),I=t.Record({canister_id:n}),N=t.Variant({secp256k1:t.Null}),L=t.Record({key_id:t.Record({name:t.Text,curve:N}),canister_id:t.Opt(n),derivation_path:t.Vec(t.Vec(t.Nat8))}),D=t.Record({public_key:t.Vec(t.Nat8),chain_code:t.Vec(t.Nat8)}),tt=t.Record({canister_id:n}),et=t.Record({idx:t.Nat64,timestamp_nanos:t.Nat64,content:t.Vec(t.Nat8)}),st=t.Record({canister_log_records:t.Vec(et)}),y=t.Record({value:t.Text,name:t.Text}),h=t.Record({status:t.Nat,body:t.Vec(t.Nat8),headers:t.Vec(y)}),nt=t.Record({url:t.Text,method:t.Variant({get:t.Null,head:t.Null,post:t.Null}),max_response_bytes:t.Opt(t.Nat64),body:t.Opt(t.Vec(t.Nat8)),transform:t.Opt(t.Record({function:t.Func([t.Record({context:t.Vec(t.Nat8),response:h})],[h],["query"]),context:t.Vec(t.Nat8)})),headers:t.Vec(y)}),R=t.Variant({reinstall:t.Null,upgrade:t.Opt(t.Record({wasm_memory_persistence:t.Opt(t.Variant({keep:t.Null,replace:t.Null})),skip_pre_upgrade:t.Opt(t.Bool)})),install:t.Null}),m=t.Record({hash:t.Vec(t.Nat8)}),at=t.Record({arg:t.Vec(t.Nat8),wasm_module_hash:t.Vec(t.Nat8),mode:R,chunk_hashes_list:t.Vec(m),target_canister:n,store_canister:t.Opt(n),sender_canister_version:t.Opt(t.Nat64)}),rt=t.Vec(t.Nat8),ct=t.Record({arg:t.Vec(t.Nat8),wasm_module:rt,mode:R,canister_id:n,sender_canister_version:t.Opt(t.Nat64)}),it=t.Record({canister_id:n}),V=t.Record({id:l,total_size:t.Nat64,taken_at_timestamp:t.Nat64}),ot=t.Vec(V),_t=t.Record({canister_id:n,sender_canister_version:t.Opt(t.Nat64),snapshot_id:l}),lt=t.Record({start_at_timestamp_nanos:t.Nat64,subnet_id:t.Principal}),dt=t.Record({num_block_failures_total:t.Nat64,node_id:t.Principal,num_blocks_proposed_total:t.Nat64}),pt=t.Vec(t.Record({timestamp_nanos:t.Nat64,node_metrics:t.Vec(dt)})),ut=t.Record({settings:t.Opt(u),specified_id:t.Opt(n),amount:t.Opt(t.Nat),sender_canister_version:t.Opt(t.Nat64)}),ht=t.Record({canister_id:n}),mt=t.Record({canister_id:n,amount:t.Nat}),gt=t.Vec(t.Nat8),k=t.Variant({ed25519:t.Null,bip340secp256k1:t.Null}),Nt=t.Record({key_id:t.Record({algorithm:k,name:t.Text}),canister_id:t.Opt(n),derivation_path:t.Vec(t.Vec(t.Nat8))}),yt=t.Record({public_key:t.Vec(t.Nat8),chain_code:t.Vec(t.Nat8)}),Rt=t.Record({key_id:t.Record({name:t.Text,curve:N}),derivation_path:t.Vec(t.Vec(t.Nat8)),message_hash:t.Vec(t.Nat8)}),Vt=t.Record({signature:t.Vec(t.Nat8)}),kt=t.Record({key_id:t.Record({algorithm:k,name:t.Text}),derivation_path:t.Vec(t.Vec(t.Nat8)),message:t.Vec(t.Nat8)}),bt=t.Record({signature:t.Vec(t.Nat8)}),vt=t.Record({canister_id:n}),ft=t.Record({canister_id:n}),Pt=t.Record({canister_id:n}),Ct=t.Vec(m),xt=t.Record({replace_snapshot:t.Opt(l),canister_id:n}),Ft=V,Ot=t.Record({canister_id:n,sender_canister_version:t.Opt(t.Nat64)}),wt=t.Record({canister_id:t.Principal,settings:u,sender_canister_version:t.Opt(t.Nat64)}),St=t.Record({chunk:t.Vec(t.Nat8),canister_id:t.Principal}),Tt=m;return t.Service({bitcoin_get_balance:t.Func([a],[i],[]),bitcoin_get_block_headers:t.Func([_],[F],[]),bitcoin_get_current_fee_percentiles:t.Func([O],[S],[]),bitcoin_get_utxos:t.Func([T],[A],[]),bitcoin_send_transaction:t.Func([M],[],[]),canister_info:t.Func([W],[j],[]),canister_status:t.Func([G],[K],[]),clear_chunk_store:t.Func([Q],[],[]),create_canister:t.Func([X],[Y],[]),delete_canister:t.Func([Z],[],[]),delete_canister_snapshot:t.Func([$],[],[]),deposit_cycles:t.Func([I],[],[]),ecdsa_public_key:t.Func([L],[D],[]),fetch_canister_logs:t.Func([tt],[st],["query"]),http_request:t.Func([nt],[h],[]),install_chunked_code:t.Func([at],[],[]),install_code:t.Func([ct],[],[]),list_canister_snapshots:t.Func([it],[ot],[]),load_canister_snapshot:t.Func([_t],[],[]),node_metrics_history:t.Func([lt],[pt],[]),provisional_create_canister_with_cycles:t.Func([ut],[ht],[]),provisional_top_up_canister:t.Func([mt],[],[]),raw_rand:t.Func([],[gt],[]),schnorr_public_key:t.Func([Nt],[yt],[]),sign_with_ecdsa:t.Func([Rt],[Vt],[]),sign_with_schnorr:t.Func([kt],[bt],[]),start_canister:t.Func([vt],[],[]),stop_canister:t.Func([ft],[],[]),stored_chunks:t.Func([Pt],[Ct],[]),take_canister_snapshot:t.Func([xt],[Ft],[]),uninstall_code:t.Func([Ot],[],[]),update_settings:t.Func([wt],[],[]),upload_chunk:t.Func([St],[Tt],[])})};var At=require("@dfinity/principal"),d=require("@dfinity/utils"),Mt=(s=>(s[s.Controllers=0]="Controllers",s[s.Public=1]="Public",s))(Mt||{}),f=class extends Error{},b=({controllers:t,freezingThreshold:e,memoryAllocation:s,computeAllocation:a,reservedCyclesLimit:r,logVisibility:i,wasmMemoryLimit:o}={})=>{let _=()=>{switch(i){case 0:return{controllers:null};case 1:return{public:null};default:throw new f}};return{controllers:(0,d.toNullable)(t==null?void 0:t.map(p=>At.Principal.fromText(p))),freezing_threshold:(0,d.toNullable)(e),memory_allocation:(0,d.toNullable)(s),compute_allocation:(0,d.toNullable)(a),reserved_cycles_limit:(0,d.toNullable)(r),log_visibility:(0,d.isNullish)(i)?[]:[_()],wasm_memory_limit:(0,d.toNullable)(o)}};var P=require("@dfinity/utils"),Kt=t=>(0,P.uint8ArrayToHexString)(t),Wt=t=>(0,P.hexStringToUint8Array)(t),v=t=>typeof t=="string"?Wt(t):t;var x=class t{constructor(e){this.service=e;this.createCanister=async({settings:e,senderCanisterVersion:s}={})=>{let{create_canister:a}=this.service,{canister_id:r}=await a({settings:(0,c.toNullable)(b(e)),sender_canister_version:(0,c.toNullable)(s)});return r};this.updateSettings=({canisterId:e,senderCanisterVersion:s,settings:a})=>{let{update_settings:r}=this.service;return r({canister_id:e,sender_canister_version:(0,c.toNullable)(s),settings:b(a)})};this.installCode=({canisterId:e,wasmModule:s,senderCanisterVersion:a,...r})=>{let{install_code:i}=this.service;return i({...r,canister_id:e,wasm_module:s,sender_canister_version:(0,c.toNullable)(a)})};this.uploadChunk=({canisterId:e,...s})=>{let{upload_chunk:a}=this.service;return a({canister_id:e,...s})};this.clearChunkStore=async({canisterId:e})=>{let{clear_chunk_store:s}=this.service;await s({canister_id:e})};this.storedChunks=async({canisterId:e})=>{let{stored_chunks:s}=this.service;return s({canister_id:e})};this.installChunkedCode=async({senderCanisterVersion:e,chunkHashesList:s,targetCanisterId:a,storeCanisterId:r,wasmModuleHash:i,...o})=>{let{install_chunked_code:_}=this.service;await _({...o,target_canister:a,store_canister:(0,c.toNullable)(r),sender_canister_version:(0,c.toNullable)(e),chunk_hashes_list:s,wasm_module_hash:typeof i=="string"?(0,c.hexStringToUint8Array)(i):i})};this.uninstallCode=({canisterId:e,senderCanisterVersion:s})=>{let{uninstall_code:a}=this.service;return a({canister_id:e,sender_canister_version:(0,c.toNullable)(s)})};this.startCanister=e=>{let{start_canister:s}=this.service;return s({canister_id:e})};this.stopCanister=e=>{let{stop_canister:s}=this.service;return s({canister_id:e})};this.canisterStatus=e=>{let{canister_status:s}=this.service;return s({canister_id:e})};this.deleteCanister=e=>{let{delete_canister:s}=this.service;return s({canister_id:e})};this.provisionalCreateCanisterWithCycles=async({settings:e,amount:s,canisterId:a}={})=>{let{provisional_create_canister_with_cycles:r}=this.service,{canister_id:i}=await r({settings:(0,c.toNullable)(b(e)),amount:(0,c.toNullable)(s),specified_id:(0,c.toNullable)(a),sender_canister_version:[]});return i};this.fetchCanisterLogs=e=>{let{fetch_canister_logs:s}=this.service;return s({canister_id:e})};this.takeCanisterSnapshot=({canisterId:e,snapshotId:s})=>{let{take_canister_snapshot:a}=this.service;return a({canister_id:e,replace_snapshot:(0,c.toNullable)((0,c.nonNullish)(s)?v(s):void 0)})};this.listCanisterSnapshots=async({canisterId:e})=>{let{list_canister_snapshots:s}=this.service;return s({canister_id:e})};this.loadCanisterSnapshot=async({canisterId:e,snapshotId:s,senderCanisterVersion:a})=>{let{load_canister_snapshot:r}=this.service;await r({canister_id:e,snapshot_id:v(s),sender_canister_version:(0,c.toNullable)(a)})};this.deleteCanisterSnapshot=async({canisterId:e,snapshotId:s})=>{let{delete_canister_snapshot:a}=this.service;await a({canister_id:e,snapshot_id:v(s)})};this.service=e}static create(e){let s=(r,i,o)=>{let _=i[0],p=C.Principal.fromHex("");return _&&typeof _=="object"&&_.canister_id&&(p=C.Principal.from(_.canister_id)),{effectiveCanisterId:p}},{service:a}=(0,c.createServices)({options:{...e,canisterId:C.Principal.fromHex(""),callTransform:s,queryTransform:s},idlFactory:zt,certifiedIdlFactory:Ut});return new t(a)}};0&&(module.exports={ICManagementCanister,LogVisibility,UnsupportedLogVisibility,decodeSnapshotId,encodeSnapshotId,mapSnapshotId,toCanisterSettings}); | ||
"use strict";var zt=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Jt=Object.getOwnPropertyNames;var Kt=Object.prototype.hasOwnProperty;var Xt=(t,e)=>{for(var s in e)zt(t,s,{get:e[s],enumerable:!0})},Yt=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Jt(e))!Kt.call(t,a)&&a!==s&&zt(t,a,{get:()=>e[a],enumerable:!(r=Gt(e,a))||r.enumerable});return t};var Zt=t=>Yt(zt({},"__esModule",{value:!0}),t);var It={};Xt(It,{ICManagementCanister:()=>F,LogVisibility:()=>Bt,UnsupportedLogVisibility:()=>v,decodeSnapshotId:()=>Qt,encodeSnapshotId:()=>$t,mapSnapshotId:()=>f,toCanisterSettings:()=>b});module.exports=Zt(It);var jt=require("@dfinity/principal"),c=require("@dfinity/utils");var Wt=({IDL:t})=>{let e=t.Variant({mainnet:t.Null,testnet:t.Null}),s=t.Text,r=t.Record({network:e,address:s,min_confirmations:t.Opt(t.Nat32)}),a=t.Nat64,i=a,o=t.Nat32,d=t.Record({start_height:o,end_height:t.Opt(o),network:e}),m=t.Vec(t.Nat8),O=t.Record({tip_height:o,block_headers:t.Vec(m)}),w=t.Record({network:e}),S=t.Nat64,T=t.Vec(S),q=t.Record({network:e,filter:t.Opt(t.Variant({page:t.Vec(t.Nat8),min_confirmations:t.Nat32})),address:s}),U=t.Vec(t.Nat8),A=t.Record({txid:t.Vec(t.Nat8),vout:t.Nat32}),z=t.Record({height:t.Nat32,value:a,outpoint:A}),M=t.Record({next_page:t.Opt(t.Vec(t.Nat8)),tip_height:o,tip_block_hash:U,utxos:t.Vec(z)}),W=t.Record({transaction:t.Vec(t.Nat8),network:e}),n=t.Principal,E=t.Record({canister_id:n,num_requested_changes:t.Opt(t.Nat64)}),H=t.Variant({from_user:t.Record({user_id:t.Principal}),from_canister:t.Record({canister_version:t.Opt(t.Nat64),canister_id:t.Principal})}),_=t.Vec(t.Nat8),B=t.Variant({creation:t.Record({controllers:t.Vec(t.Principal)}),code_deployment:t.Record({mode:t.Variant({reinstall:t.Null,upgrade:t.Null,install:t.Null}),module_hash:t.Vec(t.Nat8)}),load_snapshot:t.Record({canister_version:t.Nat64,taken_at_timestamp:t.Nat64,snapshot_id:_}),controllers_change:t.Record({controllers:t.Vec(t.Principal)}),code_uninstall:t.Null}),Q=t.Record({timestamp_nanos:t.Nat64,canister_version:t.Nat64,origin:H,details:B}),j=t.Record({controllers:t.Vec(t.Principal),module_hash:t.Opt(t.Vec(t.Nat8)),recent_changes:t.Vec(Q),total_num_changes:t.Nat64}),G=t.Record({canister_id:n}),g=t.Variant({controllers:t.Null,public:t.Null,allowed_viewers:t.Vec(t.Principal)}),J=t.Record({freezing_threshold:t.Nat,controllers:t.Vec(t.Principal),reserved_cycles_limit:t.Nat,log_visibility:g,wasm_memory_limit:t.Nat,memory_allocation:t.Nat,compute_allocation:t.Nat}),K=t.Record({status:t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),memory_size:t.Nat,cycles:t.Nat,settings:J,query_stats:t.Record({response_payload_bytes_total:t.Nat,num_instructions_total:t.Nat,num_calls_total:t.Nat,request_payload_bytes_total:t.Nat}),idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8)),reserved_cycles:t.Nat}),X=t.Record({canister_id:n}),p=t.Record({freezing_threshold:t.Opt(t.Nat),controllers:t.Opt(t.Vec(t.Principal)),reserved_cycles_limit:t.Opt(t.Nat),log_visibility:t.Opt(g),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Opt(t.Nat),compute_allocation:t.Opt(t.Nat)}),Y=t.Record({settings:t.Opt(p),sender_canister_version:t.Opt(t.Nat64)}),Z=t.Record({canister_id:n}),$=t.Record({canister_id:n}),I=t.Record({canister_id:n,snapshot_id:_}),L=t.Record({canister_id:n}),N=t.Variant({secp256k1:t.Null}),D=t.Record({key_id:t.Record({name:t.Text,curve:N}),canister_id:t.Opt(n),derivation_path:t.Vec(t.Vec(t.Nat8))}),tt=t.Record({public_key:t.Vec(t.Nat8),chain_code:t.Vec(t.Nat8)}),et=t.Record({canister_id:n}),st=t.Record({idx:t.Nat64,timestamp_nanos:t.Nat64,content:t.Vec(t.Nat8)}),nt=t.Record({canister_log_records:t.Vec(st)}),y=t.Record({value:t.Text,name:t.Text}),u=t.Record({status:t.Nat,body:t.Vec(t.Nat8),headers:t.Vec(y)}),rt=t.Record({url:t.Text,method:t.Variant({get:t.Null,head:t.Null,post:t.Null}),max_response_bytes:t.Opt(t.Nat64),body:t.Opt(t.Vec(t.Nat8)),transform:t.Opt(t.Record({function:t.Func([t.Record({context:t.Vec(t.Nat8),response:u})],[u],[]),context:t.Vec(t.Nat8)})),headers:t.Vec(y)}),R=t.Variant({reinstall:t.Null,upgrade:t.Opt(t.Record({wasm_memory_persistence:t.Opt(t.Variant({keep:t.Null,replace:t.Null})),skip_pre_upgrade:t.Opt(t.Bool)})),install:t.Null}),h=t.Record({hash:t.Vec(t.Nat8)}),at=t.Record({arg:t.Vec(t.Nat8),wasm_module_hash:t.Vec(t.Nat8),mode:R,chunk_hashes_list:t.Vec(h),target_canister:n,store_canister:t.Opt(n),sender_canister_version:t.Opt(t.Nat64)}),ct=t.Vec(t.Nat8),it=t.Record({arg:t.Vec(t.Nat8),wasm_module:ct,mode:R,canister_id:n,sender_canister_version:t.Opt(t.Nat64)}),ot=t.Record({canister_id:n}),k=t.Record({id:_,total_size:t.Nat64,taken_at_timestamp:t.Nat64}),_t=t.Vec(k),lt=t.Record({canister_id:n,sender_canister_version:t.Opt(t.Nat64),snapshot_id:_}),dt=t.Record({start_at_timestamp_nanos:t.Nat64,subnet_id:t.Principal}),pt=t.Record({num_block_failures_total:t.Nat64,node_id:t.Principal,num_blocks_proposed_total:t.Nat64}),ut=t.Vec(t.Record({timestamp_nanos:t.Nat64,node_metrics:t.Vec(pt)})),ht=t.Record({settings:t.Opt(p),specified_id:t.Opt(n),amount:t.Opt(t.Nat),sender_canister_version:t.Opt(t.Nat64)}),mt=t.Record({canister_id:n}),gt=t.Record({canister_id:n,amount:t.Nat}),Nt=t.Vec(t.Nat8),V=t.Variant({ed25519:t.Null,bip340secp256k1:t.Null}),yt=t.Record({key_id:t.Record({algorithm:V,name:t.Text}),canister_id:t.Opt(n),derivation_path:t.Vec(t.Vec(t.Nat8))}),Rt=t.Record({public_key:t.Vec(t.Nat8),chain_code:t.Vec(t.Nat8)}),kt=t.Record({key_id:t.Record({name:t.Text,curve:N}),derivation_path:t.Vec(t.Vec(t.Nat8)),message_hash:t.Vec(t.Nat8)}),Vt=t.Record({signature:t.Vec(t.Nat8)}),bt=t.Record({key_id:t.Record({algorithm:V,name:t.Text}),derivation_path:t.Vec(t.Vec(t.Nat8)),message:t.Vec(t.Nat8)}),ft=t.Record({signature:t.Vec(t.Nat8)}),vt=t.Record({canister_id:n}),Pt=t.Record({canister_id:n}),Ct=t.Record({canister_id:n}),xt=t.Vec(h),Ft=t.Record({subnet_id:t.Principal}),Ot=t.Record({replica_version:t.Text}),wt=t.Record({replace_snapshot:t.Opt(_),canister_id:n}),St=k,Tt=t.Record({canister_id:n,sender_canister_version:t.Opt(t.Nat64)}),qt=t.Record({canister_id:t.Principal,settings:p,sender_canister_version:t.Opt(t.Nat64)}),Ut=t.Record({chunk:t.Vec(t.Nat8),canister_id:t.Principal}),At=h;return t.Service({bitcoin_get_balance:t.Func([r],[i],[]),bitcoin_get_block_headers:t.Func([d],[O],[]),bitcoin_get_current_fee_percentiles:t.Func([w],[T],[]),bitcoin_get_utxos:t.Func([q],[M],[]),bitcoin_send_transaction:t.Func([W],[],[]),canister_info:t.Func([E],[j],[]),canister_status:t.Func([G],[K],[]),clear_chunk_store:t.Func([X],[],[]),create_canister:t.Func([Y],[Z],[]),delete_canister:t.Func([$],[],[]),delete_canister_snapshot:t.Func([I],[],[]),deposit_cycles:t.Func([L],[],[]),ecdsa_public_key:t.Func([D],[tt],[]),fetch_canister_logs:t.Func([et],[nt],[]),http_request:t.Func([rt],[u],[]),install_chunked_code:t.Func([at],[],[]),install_code:t.Func([it],[],[]),list_canister_snapshots:t.Func([ot],[_t],[]),load_canister_snapshot:t.Func([lt],[],[]),node_metrics_history:t.Func([dt],[ut],[]),provisional_create_canister_with_cycles:t.Func([ht],[mt],[]),provisional_top_up_canister:t.Func([gt],[],[]),raw_rand:t.Func([],[Nt],[]),schnorr_public_key:t.Func([yt],[Rt],[]),sign_with_ecdsa:t.Func([kt],[Vt],[]),sign_with_schnorr:t.Func([bt],[ft],[]),start_canister:t.Func([vt],[],[]),stop_canister:t.Func([Pt],[],[]),stored_chunks:t.Func([Ct],[xt],[]),subnet_info:t.Func([Ft],[Ot],[]),take_canister_snapshot:t.Func([wt],[St],[]),uninstall_code:t.Func([Tt],[],[]),update_settings:t.Func([qt],[],[]),upload_chunk:t.Func([Ut],[At],[])})};var Et=({IDL:t})=>{let e=t.Variant({mainnet:t.Null,testnet:t.Null}),s=t.Text,r=t.Record({network:e,address:s,min_confirmations:t.Opt(t.Nat32)}),a=t.Nat64,i=a,o=t.Nat32,d=t.Record({start_height:o,end_height:t.Opt(o),network:e}),m=t.Vec(t.Nat8),O=t.Record({tip_height:o,block_headers:t.Vec(m)}),w=t.Record({network:e}),S=t.Nat64,T=t.Vec(S),q=t.Record({network:e,filter:t.Opt(t.Variant({page:t.Vec(t.Nat8),min_confirmations:t.Nat32})),address:s}),U=t.Vec(t.Nat8),A=t.Record({txid:t.Vec(t.Nat8),vout:t.Nat32}),z=t.Record({height:t.Nat32,value:a,outpoint:A}),M=t.Record({next_page:t.Opt(t.Vec(t.Nat8)),tip_height:o,tip_block_hash:U,utxos:t.Vec(z)}),W=t.Record({transaction:t.Vec(t.Nat8),network:e}),n=t.Principal,E=t.Record({canister_id:n,num_requested_changes:t.Opt(t.Nat64)}),H=t.Variant({from_user:t.Record({user_id:t.Principal}),from_canister:t.Record({canister_version:t.Opt(t.Nat64),canister_id:t.Principal})}),_=t.Vec(t.Nat8),B=t.Variant({creation:t.Record({controllers:t.Vec(t.Principal)}),code_deployment:t.Record({mode:t.Variant({reinstall:t.Null,upgrade:t.Null,install:t.Null}),module_hash:t.Vec(t.Nat8)}),load_snapshot:t.Record({canister_version:t.Nat64,taken_at_timestamp:t.Nat64,snapshot_id:_}),controllers_change:t.Record({controllers:t.Vec(t.Principal)}),code_uninstall:t.Null}),Q=t.Record({timestamp_nanos:t.Nat64,canister_version:t.Nat64,origin:H,details:B}),j=t.Record({controllers:t.Vec(t.Principal),module_hash:t.Opt(t.Vec(t.Nat8)),recent_changes:t.Vec(Q),total_num_changes:t.Nat64}),G=t.Record({canister_id:n}),g=t.Variant({controllers:t.Null,public:t.Null,allowed_viewers:t.Vec(t.Principal)}),J=t.Record({freezing_threshold:t.Nat,controllers:t.Vec(t.Principal),reserved_cycles_limit:t.Nat,log_visibility:g,wasm_memory_limit:t.Nat,memory_allocation:t.Nat,compute_allocation:t.Nat}),K=t.Record({status:t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),memory_size:t.Nat,cycles:t.Nat,settings:J,query_stats:t.Record({response_payload_bytes_total:t.Nat,num_instructions_total:t.Nat,num_calls_total:t.Nat,request_payload_bytes_total:t.Nat}),idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8)),reserved_cycles:t.Nat}),X=t.Record({canister_id:n}),p=t.Record({freezing_threshold:t.Opt(t.Nat),controllers:t.Opt(t.Vec(t.Principal)),reserved_cycles_limit:t.Opt(t.Nat),log_visibility:t.Opt(g),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Opt(t.Nat),compute_allocation:t.Opt(t.Nat)}),Y=t.Record({settings:t.Opt(p),sender_canister_version:t.Opt(t.Nat64)}),Z=t.Record({canister_id:n}),$=t.Record({canister_id:n}),I=t.Record({canister_id:n,snapshot_id:_}),L=t.Record({canister_id:n}),N=t.Variant({secp256k1:t.Null}),D=t.Record({key_id:t.Record({name:t.Text,curve:N}),canister_id:t.Opt(n),derivation_path:t.Vec(t.Vec(t.Nat8))}),tt=t.Record({public_key:t.Vec(t.Nat8),chain_code:t.Vec(t.Nat8)}),et=t.Record({canister_id:n}),st=t.Record({idx:t.Nat64,timestamp_nanos:t.Nat64,content:t.Vec(t.Nat8)}),nt=t.Record({canister_log_records:t.Vec(st)}),y=t.Record({value:t.Text,name:t.Text}),u=t.Record({status:t.Nat,body:t.Vec(t.Nat8),headers:t.Vec(y)}),rt=t.Record({url:t.Text,method:t.Variant({get:t.Null,head:t.Null,post:t.Null}),max_response_bytes:t.Opt(t.Nat64),body:t.Opt(t.Vec(t.Nat8)),transform:t.Opt(t.Record({function:t.Func([t.Record({context:t.Vec(t.Nat8),response:u})],[u],["query"]),context:t.Vec(t.Nat8)})),headers:t.Vec(y)}),R=t.Variant({reinstall:t.Null,upgrade:t.Opt(t.Record({wasm_memory_persistence:t.Opt(t.Variant({keep:t.Null,replace:t.Null})),skip_pre_upgrade:t.Opt(t.Bool)})),install:t.Null}),h=t.Record({hash:t.Vec(t.Nat8)}),at=t.Record({arg:t.Vec(t.Nat8),wasm_module_hash:t.Vec(t.Nat8),mode:R,chunk_hashes_list:t.Vec(h),target_canister:n,store_canister:t.Opt(n),sender_canister_version:t.Opt(t.Nat64)}),ct=t.Vec(t.Nat8),it=t.Record({arg:t.Vec(t.Nat8),wasm_module:ct,mode:R,canister_id:n,sender_canister_version:t.Opt(t.Nat64)}),ot=t.Record({canister_id:n}),k=t.Record({id:_,total_size:t.Nat64,taken_at_timestamp:t.Nat64}),_t=t.Vec(k),lt=t.Record({canister_id:n,sender_canister_version:t.Opt(t.Nat64),snapshot_id:_}),dt=t.Record({start_at_timestamp_nanos:t.Nat64,subnet_id:t.Principal}),pt=t.Record({num_block_failures_total:t.Nat64,node_id:t.Principal,num_blocks_proposed_total:t.Nat64}),ut=t.Vec(t.Record({timestamp_nanos:t.Nat64,node_metrics:t.Vec(pt)})),ht=t.Record({settings:t.Opt(p),specified_id:t.Opt(n),amount:t.Opt(t.Nat),sender_canister_version:t.Opt(t.Nat64)}),mt=t.Record({canister_id:n}),gt=t.Record({canister_id:n,amount:t.Nat}),Nt=t.Vec(t.Nat8),V=t.Variant({ed25519:t.Null,bip340secp256k1:t.Null}),yt=t.Record({key_id:t.Record({algorithm:V,name:t.Text}),canister_id:t.Opt(n),derivation_path:t.Vec(t.Vec(t.Nat8))}),Rt=t.Record({public_key:t.Vec(t.Nat8),chain_code:t.Vec(t.Nat8)}),kt=t.Record({key_id:t.Record({name:t.Text,curve:N}),derivation_path:t.Vec(t.Vec(t.Nat8)),message_hash:t.Vec(t.Nat8)}),Vt=t.Record({signature:t.Vec(t.Nat8)}),bt=t.Record({key_id:t.Record({algorithm:V,name:t.Text}),derivation_path:t.Vec(t.Vec(t.Nat8)),message:t.Vec(t.Nat8)}),ft=t.Record({signature:t.Vec(t.Nat8)}),vt=t.Record({canister_id:n}),Pt=t.Record({canister_id:n}),Ct=t.Record({canister_id:n}),xt=t.Vec(h),Ft=t.Record({subnet_id:t.Principal}),Ot=t.Record({replica_version:t.Text}),wt=t.Record({replace_snapshot:t.Opt(_),canister_id:n}),St=k,Tt=t.Record({canister_id:n,sender_canister_version:t.Opt(t.Nat64)}),qt=t.Record({canister_id:t.Principal,settings:p,sender_canister_version:t.Opt(t.Nat64)}),Ut=t.Record({chunk:t.Vec(t.Nat8),canister_id:t.Principal}),At=h;return t.Service({bitcoin_get_balance:t.Func([r],[i],[]),bitcoin_get_block_headers:t.Func([d],[O],[]),bitcoin_get_current_fee_percentiles:t.Func([w],[T],[]),bitcoin_get_utxos:t.Func([q],[M],[]),bitcoin_send_transaction:t.Func([W],[],[]),canister_info:t.Func([E],[j],[]),canister_status:t.Func([G],[K],[]),clear_chunk_store:t.Func([X],[],[]),create_canister:t.Func([Y],[Z],[]),delete_canister:t.Func([$],[],[]),delete_canister_snapshot:t.Func([I],[],[]),deposit_cycles:t.Func([L],[],[]),ecdsa_public_key:t.Func([D],[tt],[]),fetch_canister_logs:t.Func([et],[nt],["query"]),http_request:t.Func([rt],[u],[]),install_chunked_code:t.Func([at],[],[]),install_code:t.Func([it],[],[]),list_canister_snapshots:t.Func([ot],[_t],[]),load_canister_snapshot:t.Func([lt],[],[]),node_metrics_history:t.Func([dt],[ut],[]),provisional_create_canister_with_cycles:t.Func([ht],[mt],[]),provisional_top_up_canister:t.Func([gt],[],[]),raw_rand:t.Func([],[Nt],[]),schnorr_public_key:t.Func([yt],[Rt],[]),sign_with_ecdsa:t.Func([kt],[Vt],[]),sign_with_schnorr:t.Func([bt],[ft],[]),start_canister:t.Func([vt],[],[]),stop_canister:t.Func([Pt],[],[]),stored_chunks:t.Func([Ct],[xt],[]),subnet_info:t.Func([Ft],[Ot],[]),take_canister_snapshot:t.Func([wt],[St],[]),uninstall_code:t.Func([Tt],[],[]),update_settings:t.Func([qt],[],[]),upload_chunk:t.Func([Ut],[At],[])})};var Ht=require("@dfinity/principal"),l=require("@dfinity/utils"),Bt=(s=>(s[s.Controllers=0]="Controllers",s[s.Public=1]="Public",s))(Bt||{}),v=class extends Error{},b=({controllers:t,freezingThreshold:e,memoryAllocation:s,computeAllocation:r,reservedCyclesLimit:a,logVisibility:i,wasmMemoryLimit:o}={})=>{let d=()=>{switch(i){case 0:return{controllers:null};case 1:return{public:null};default:throw new v}};return{controllers:(0,l.toNullable)(t==null?void 0:t.map(m=>Ht.Principal.fromText(m))),freezing_threshold:(0,l.toNullable)(e),memory_allocation:(0,l.toNullable)(s),compute_allocation:(0,l.toNullable)(r),reserved_cycles_limit:(0,l.toNullable)(a),log_visibility:(0,l.isNullish)(i)?[]:[d()],wasm_memory_limit:(0,l.toNullable)(o)}};var P=require("@dfinity/utils"),$t=t=>(0,P.uint8ArrayToHexString)(t),Qt=t=>(0,P.hexStringToUint8Array)(t),f=t=>typeof t=="string"?Qt(t):t;var C=require("@dfinity/principal"),x=require("@dfinity/utils"),Mt=(t,e,s)=>{let r=e[0];if((0,x.nonNullish)(r)&&typeof r=="object"){if(t==="install_chunked_code"&&(0,x.nonNullish)(r.target_canister))return{effectiveCanisterId:C.Principal.from(r.target_canister)};if((0,x.nonNullish)(r.canister_id))return{effectiveCanisterId:C.Principal.from(r.canister_id)}}return{effectiveCanisterId:C.Principal.fromHex("")}};var F=class t{constructor(e){this.service=e;this.createCanister=async({settings:e,senderCanisterVersion:s}={})=>{let{create_canister:r}=this.service,{canister_id:a}=await r({settings:(0,c.toNullable)(b(e)),sender_canister_version:(0,c.toNullable)(s)});return a};this.updateSettings=({canisterId:e,senderCanisterVersion:s,settings:r})=>{let{update_settings:a}=this.service;return a({canister_id:e,sender_canister_version:(0,c.toNullable)(s),settings:b(r)})};this.installCode=({canisterId:e,wasmModule:s,senderCanisterVersion:r,...a})=>{let{install_code:i}=this.service;return i({...a,canister_id:e,wasm_module:s,sender_canister_version:(0,c.toNullable)(r)})};this.uploadChunk=({canisterId:e,...s})=>{let{upload_chunk:r}=this.service;return r({canister_id:e,...s})};this.clearChunkStore=async({canisterId:e})=>{let{clear_chunk_store:s}=this.service;await s({canister_id:e})};this.storedChunks=async({canisterId:e})=>{let{stored_chunks:s}=this.service;return s({canister_id:e})};this.installChunkedCode=async({senderCanisterVersion:e,chunkHashesList:s,targetCanisterId:r,storeCanisterId:a,wasmModuleHash:i,...o})=>{let{install_chunked_code:d}=this.service;await d({...o,target_canister:r,store_canister:(0,c.toNullable)(a),sender_canister_version:(0,c.toNullable)(e),chunk_hashes_list:s,wasm_module_hash:typeof i=="string"?(0,c.hexStringToUint8Array)(i):i})};this.uninstallCode=({canisterId:e,senderCanisterVersion:s})=>{let{uninstall_code:r}=this.service;return r({canister_id:e,sender_canister_version:(0,c.toNullable)(s)})};this.startCanister=e=>{let{start_canister:s}=this.service;return s({canister_id:e})};this.stopCanister=e=>{let{stop_canister:s}=this.service;return s({canister_id:e})};this.canisterStatus=e=>{let{canister_status:s}=this.service;return s({canister_id:e})};this.deleteCanister=e=>{let{delete_canister:s}=this.service;return s({canister_id:e})};this.provisionalCreateCanisterWithCycles=async({settings:e,amount:s,canisterId:r}={})=>{let{provisional_create_canister_with_cycles:a}=this.service,{canister_id:i}=await a({settings:(0,c.toNullable)(b(e)),amount:(0,c.toNullable)(s),specified_id:(0,c.toNullable)(r),sender_canister_version:[]});return i};this.fetchCanisterLogs=e=>{let{fetch_canister_logs:s}=this.service;return s({canister_id:e})};this.takeCanisterSnapshot=({canisterId:e,snapshotId:s})=>{let{take_canister_snapshot:r}=this.service;return r({canister_id:e,replace_snapshot:(0,c.toNullable)((0,c.nonNullish)(s)?f(s):void 0)})};this.listCanisterSnapshots=async({canisterId:e})=>{let{list_canister_snapshots:s}=this.service;return s({canister_id:e})};this.loadCanisterSnapshot=async({canisterId:e,snapshotId:s,senderCanisterVersion:r})=>{let{load_canister_snapshot:a}=this.service;await a({canister_id:e,snapshot_id:f(s),sender_canister_version:(0,c.toNullable)(r)})};this.deleteCanisterSnapshot=async({canisterId:e,snapshotId:s})=>{let{delete_canister_snapshot:r}=this.service;await r({canister_id:e,snapshot_id:f(s)})};this.service=e}static create(e){let{service:s}=(0,c.createServices)({options:{...e,canisterId:jt.Principal.fromHex(""),callTransform:Mt,queryTransform:Mt},idlFactory:Et,certifiedIdlFactory:Wt});return new t(s)}};0&&(module.exports={ICManagementCanister,LogVisibility,UnsupportedLogVisibility,decodeSnapshotId,encodeSnapshotId,mapSnapshotId,toCanisterSettings}); | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -1,2 +0,2 @@ | ||
import{d as a}from"./chunk-2WCRRND2.js";import"./chunk-6BULIJU3.js";export{a as ICManagementCanister}; | ||
import{d as a}from"./chunk-ZGNNWD3E.js";import"./chunk-6BULIJU3.js";export{a as ICManagementCanister}; | ||
//# sourceMappingURL=ic-management.canister.js.map |
@@ -1,2 +0,2 @@ | ||
import{a as i,b as o,c as n,d as t}from"./chunk-2WCRRND2.js";import{a as e,b as r,c as s}from"./chunk-6BULIJU3.js";export{t as ICManagementCanister,e as LogVisibility,r as UnsupportedLogVisibility,o as decodeSnapshotId,i as encodeSnapshotId,n as mapSnapshotId,s as toCanisterSettings}; | ||
import{a,b as n,c as o,d as t}from"./chunk-ZGNNWD3E.js";import{a as e,b as s,c as r}from"./chunk-6BULIJU3.js";export{t as ICManagementCanister,e as LogVisibility,s as UnsupportedLogVisibility,n as decodeSnapshotId,a as encodeSnapshotId,o as mapSnapshotId,r as toCanisterSettings}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
export type { canister_install_mode, canister_log_record, canister_status_result, chunk_hash, definite_canister_settings, fetch_canister_logs_result, list_canister_snapshots_result, log_visibility, snapshot_id, } from "../candid/ic-management"; | ||
export type { canister_install_mode, canister_log_record, canister_status_result, chunk_hash, definite_canister_settings, fetch_canister_logs_result, list_canister_snapshots_result, log_visibility, snapshot, snapshot_id, take_canister_snapshot_result, } from "../candid/ic-management"; | ||
export { ICManagementCanister } from "./ic-management.canister"; | ||
@@ -3,0 +3,0 @@ export * from "./types/canister.options"; |
{ | ||
"name": "@dfinity/ic-management", | ||
"version": "6.0.0", | ||
"version": "6.0.1-next-2024-12-04", | ||
"description": "A library for interfacing with the IC management canister.", | ||
@@ -37,7 +37,7 @@ "license": "Apache-2.0", | ||
"peerDependencies": { | ||
"@dfinity/agent": "^2.0.0", | ||
"@dfinity/candid": "^2.0.0", | ||
"@dfinity/principal": "^2.0.0", | ||
"@dfinity/utils": "^2.7.0" | ||
"@dfinity/agent": "*", | ||
"@dfinity/candid": "*", | ||
"@dfinity/principal": "*", | ||
"@dfinity/utils": "*" | ||
} | ||
} | ||
} |
@@ -97,3 +97,3 @@ # ic-management-js | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L83) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L67) | ||
@@ -108,3 +108,3 @@ ##### :gear: updateSettings | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L106) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L90) | ||
@@ -119,3 +119,3 @@ ##### :gear: installCode | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L131) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L115) | ||
@@ -135,3 +135,3 @@ ##### :gear: uploadChunk | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L157) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L141) | ||
@@ -150,3 +150,3 @@ ##### :gear: clearChunkStore | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L177) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L161) | ||
@@ -165,3 +165,3 @@ ##### :gear: storedChunks | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L196) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L180) | ||
@@ -186,3 +186,3 @@ ##### :gear: installChunkedCode | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L221) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L205) | ||
@@ -197,3 +197,3 @@ ##### :gear: uninstallCode | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L252) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L236) | ||
@@ -208,3 +208,3 @@ ##### :gear: startCanister | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L270) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L254) | ||
@@ -219,3 +219,3 @@ ##### :gear: stopCanister | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L282) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L266) | ||
@@ -230,3 +230,3 @@ ##### :gear: canisterStatus | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L293) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L277) | ||
@@ -241,3 +241,3 @@ ##### :gear: deleteCanister | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L307) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L291) | ||
@@ -252,3 +252,3 @@ ##### :gear: provisionalCreateCanisterWithCycles | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L322) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L306) | ||
@@ -263,3 +263,3 @@ ##### :gear: fetchCanisterLogs | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L345) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L329) | ||
@@ -282,3 +282,3 @@ ##### :gear: takeCanisterSnapshot | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L371) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L355) | ||
@@ -298,3 +298,3 @@ ##### :gear: listCanisterSnapshots | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L400) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L384) | ||
@@ -316,3 +316,3 @@ ##### :gear: loadCanisterSnapshot | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L426) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L410) | ||
@@ -333,3 +333,3 @@ ##### :gear: deleteCanisterSnapshot | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L457) | ||
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L441) | ||
@@ -336,0 +336,0 @@ <!-- TSDOC_END --> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
310990
30
1851
2