11import {
2- ICManagementCanister ,
3- type list_canister_snapshots_result ,
4- type read_canister_snapshot_data_response ,
2+ IcManagementCanister ,
3+ type IcManagementDid ,
54 type ReadCanisterSnapshotMetadataParams ,
65 type ReadCanisterSnapshotMetadataResponse ,
7- type snapshot_id ,
86 type SnapshotParams ,
9- type upload_canister_snapshot_metadata_response ,
107 type UploadCanisterSnapshotDataParams ,
118 type UploadCanisterSnapshotMetadataParams
129} from '@icp-sdk/canisters/ic-management' ;
@@ -16,7 +13,7 @@ import {initAgent} from './agent.api';
1613export const canisterStop = async ( { canisterId} : { canisterId : Principal } ) : Promise < void > => {
1714 const agent = await initAgent ( ) ;
1815
19- const { stopCanister} = ICManagementCanister . create ( {
16+ const { stopCanister} = IcManagementCanister . create ( {
2017 agent
2118 } ) ;
2219
@@ -26,7 +23,7 @@ export const canisterStop = async ({canisterId}: {canisterId: Principal}): Promi
2623export const canisterStart = async ( { canisterId} : { canisterId : Principal } ) : Promise < void > => {
2724 const agent = await initAgent ( ) ;
2825
29- const { startCanister} = ICManagementCanister . create ( {
26+ const { startCanister} = IcManagementCanister . create ( {
3027 agent
3128 } ) ;
3229
@@ -35,11 +32,11 @@ export const canisterStart = async ({canisterId}: {canisterId: Principal}): Prom
3532
3633export const takeCanisterSnapshot = async ( params : {
3734 canisterId : Principal ;
38- snapshotId ?: snapshot_id ;
35+ snapshotId ?: IcManagementDid . snapshot_id ;
3936} ) : Promise < void > => {
4037 const agent = await initAgent ( ) ;
4138
42- const { takeCanisterSnapshot} = ICManagementCanister . create ( {
39+ const { takeCanisterSnapshot} = IcManagementCanister . create ( {
4340 agent
4441 } ) ;
4542
@@ -48,10 +45,10 @@ export const takeCanisterSnapshot = async (params: {
4845
4946export const listCanisterSnapshots = async ( params : {
5047 canisterId : Principal ;
51- } ) : Promise < list_canister_snapshots_result > => {
48+ } ) : Promise < IcManagementDid . list_canister_snapshots_result > => {
5249 const agent = await initAgent ( ) ;
5350
54- const { listCanisterSnapshots} = ICManagementCanister . create ( {
51+ const { listCanisterSnapshots} = IcManagementCanister . create ( {
5552 agent
5653 } ) ;
5754
@@ -60,11 +57,11 @@ export const listCanisterSnapshots = async (params: {
6057
6158export const loadCanisterSnapshot = async ( params : {
6259 canisterId : Principal ;
63- snapshotId : snapshot_id ;
60+ snapshotId : IcManagementDid . snapshot_id ;
6461} ) : Promise < void > => {
6562 const agent = await initAgent ( ) ;
6663
67- const { loadCanisterSnapshot} = ICManagementCanister . create ( {
64+ const { loadCanisterSnapshot} = IcManagementCanister . create ( {
6865 agent
6966 } ) ;
7067
@@ -73,11 +70,11 @@ export const loadCanisterSnapshot = async (params: {
7370
7471export const deleteCanisterSnapshot = async ( params : {
7572 canisterId : Principal ;
76- snapshotId : snapshot_id ;
73+ snapshotId : IcManagementDid . snapshot_id ;
7774} ) : Promise < void > => {
7875 const agent = await initAgent ( ) ;
7976
80- const { deleteCanisterSnapshot} = ICManagementCanister . create ( {
77+ const { deleteCanisterSnapshot} = IcManagementCanister . create ( {
8178 agent
8279 } ) ;
8380
@@ -89,7 +86,7 @@ export const readCanisterSnapshotMetadata = async (
8986) : Promise < ReadCanisterSnapshotMetadataResponse > => {
9087 const agent = await initAgent ( ) ;
9188
92- const { readCanisterSnapshotMetadata} = ICManagementCanister . create ( {
89+ const { readCanisterSnapshotMetadata} = IcManagementCanister . create ( {
9390 agent
9491 } ) ;
9592
@@ -98,10 +95,10 @@ export const readCanisterSnapshotMetadata = async (
9895
9996export const readCanisterSnapshotData = async (
10097 params : ReadCanisterSnapshotMetadataParams
101- ) : Promise < read_canister_snapshot_data_response > => {
98+ ) : Promise < IcManagementDid . read_canister_snapshot_data_response > => {
10299 const agent = await initAgent ( ) ;
103100
104- const { readCanisterSnapshotData} = ICManagementCanister . create ( {
101+ const { readCanisterSnapshotData} = IcManagementCanister . create ( {
105102 agent
106103 } ) ;
107104
@@ -110,10 +107,10 @@ export const readCanisterSnapshotData = async (
110107
111108export const uploadCanisterSnapshotMetadata = async (
112109 params : UploadCanisterSnapshotMetadataParams
113- ) : Promise < upload_canister_snapshot_metadata_response > => {
110+ ) : Promise < IcManagementDid . upload_canister_snapshot_metadata_response > => {
114111 const agent = await initAgent ( ) ;
115112
116- const { uploadCanisterSnapshotMetadata} = ICManagementCanister . create ( {
113+ const { uploadCanisterSnapshotMetadata} = IcManagementCanister . create ( {
117114 agent
118115 } ) ;
119116
@@ -125,7 +122,7 @@ export const uploadCanisterSnapshotData = async (
125122) : Promise < void > => {
126123 const agent = await initAgent ( ) ;
127124
128- const { uploadCanisterSnapshotData} = ICManagementCanister . create ( {
125+ const { uploadCanisterSnapshotData} = IcManagementCanister . create ( {
129126 agent
130127 } ) ;
131128
0 commit comments