use crate::error::Result;
use async_trait::async_trait;
use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize)]
pub struct Did {
pub did: Option<String>,
pub key_type: Option<String>,
pub method: Option<String>,
pub posture: Option<String>,
pub verkey: Option<String>,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct DidList(Vec<Did>);
#[derive(Debug, Deserialize, Serialize)]
pub struct DidResult(Did);
#[derive(Debug, Deserialize, Serialize)]
pub struct KeyType {
pub key_type: String,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct CreateLocalDidOptions {
pub method: String,
pub options: KeyType,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct DidEndpoint {
pub did: String,
pub endpoint: String,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct SetDidEndpointOptions {
pub did: String,
pub endpoint: String,
pub endpoint_type: String,
}
#[async_trait]
pub trait WalletModule {
async fn get_wallet_dids(&self, options: Did) -> Result<DidList>;
async fn create_local_did(&self, options: CreateLocalDidOptions) -> Result<Did>;
async fn rotate_keypair(&self, did: String) -> Result<()>;
async fn fetch_public_did(&self) -> Result<Did>;
async fn assign_public_did(&self, did: String) -> Result<Did>;
async fn fetch_did_endpoint(&self, did: String) -> Result<DidEndpoint>;
async fn set_did_endpoint(&self, options: SetDidEndpointOptions) -> Result<()>;
}