diff --git a/crates/dscvr-canister-agent/src/lib.rs b/crates/dscvr-canister-agent/src/lib.rs index 447ed1a..ce179d0 100644 --- a/crates/dscvr-canister-agent/src/lib.rs +++ b/crates/dscvr-canister-agent/src/lib.rs @@ -94,6 +94,18 @@ impl CanisterAgent { } } + pub async fn new_replica( + caller: Arc, + replica: &str, + canister_id: &str, + ) -> Result { + let agent = Self { + agent: agent_impl::replica_impl::new(caller, replica).await?, + canister_id: Principal::from_text(canister_id)?, + }; + Ok(agent) + } + pub async fn clone_with_identity(&self, identity: Arc) -> Result { Ok(Self { agent: self.agent.clone_with_identity(identity).await?,