use crate::{
cdk::types::Principal,
dto::{
canister::{CanisterHistoryResponse, CanisterStatusResponse},
error::Error,
},
workflow::ic::mgmt::MgmtWorkflow,
};
pub struct MgmtApi;
impl MgmtApi {
pub async fn canister_history(pid: Principal) -> Result<CanisterHistoryResponse, Error> {
MgmtWorkflow::canister_history(pid)
.await
.map_err(Error::from)
}
pub async fn canister_status(pid: Principal) -> Result<CanisterStatusResponse, Error> {
MgmtWorkflow::canister_status(pid)
.await
.map_err(Error::from)
}
}