|
| 1 | +use candid::Principal; |
1 | 2 | use did::error::SignatureVerificationError; |
2 | 3 | use did::{Transaction, H160}; |
3 | 4 | use ic_canister_client::{CanisterClient, CanisterClientResult}; |
@@ -31,4 +32,33 @@ impl<C: CanisterClient> SignatureVerificationCanisterClient<C> { |
31 | 32 | ) -> CanisterClientResult<SignatureVerificationResult<H160>> { |
32 | 33 | self.client.query("verify_signature", (transaction,)).await |
33 | 34 | } |
| 35 | + |
| 36 | + /// Add principal to the access control list |
| 37 | + pub async fn add_principal_to_access_list( |
| 38 | + &self, |
| 39 | + principal: Principal, |
| 40 | + ) -> CanisterClientResult<SignatureVerificationResult<()>> { |
| 41 | + self.client.update("add_access", (principal,)).await |
| 42 | + } |
| 43 | + |
| 44 | + /// Remove principal from the access control list |
| 45 | + pub async fn remove_principal_from_access_list( |
| 46 | + &self, |
| 47 | + principal: Principal, |
| 48 | + ) -> CanisterClientResult<SignatureVerificationResult<()>> { |
| 49 | + self.client.update("remove_access", (principal,)).await |
| 50 | + } |
| 51 | + |
| 52 | + /// Get the owner of the canister |
| 53 | + pub async fn get_owner(&self) -> CanisterClientResult<Principal> { |
| 54 | + self.client.query("get_owner", ()).await |
| 55 | + } |
| 56 | + |
| 57 | + /// Set the owner of the canister |
| 58 | + pub async fn set_owner( |
| 59 | + &self, |
| 60 | + principal: Principal, |
| 61 | + ) -> CanisterClientResult<SignatureVerificationResult<()>> { |
| 62 | + self.client.update("set_owner", (principal,)).await |
| 63 | + } |
34 | 64 | } |
0 commit comments