use async_trait::async_trait;
use serde::Deserialize;
use serde::Serialize;
use typed_builder::TypedBuilder;
use crate::WalletResult;
pub const EXPERIMENTAL_ENCRYPT: &str = "experimental:encrypt";
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, TypedBuilder)]
#[serde(rename_all = "camelCase")]
pub struct ExperimentalEncryptProps {
#[builder(setter(into))]
pub cipher: String,
#[builder(setter(into))]
#[serde(with = "serde_bytes")]
pub public_key: Vec<u8>,
#[serde(with = "serde_bytes")]
pub cleartext: Vec<u8>,
#[builder(default, setter(into, strip_option))]
pub padding: Option<u8>,
}
pub trait ExperimentalEncryptOutput {
fn cipher_text(&self) -> Vec<u8>;
fn nonce(&self) -> Vec<u8>;
}
#[async_trait(?Send)]
pub trait WalletExperimentalEncrypt {
type Output: ExperimentalEncryptOutput;
async fn encrypt_many(
&self,
props: Vec<ExperimentalEncryptProps>,
) -> WalletResult<Vec<Self::Output>>;
async fn encrypt(&self, props: ExperimentalEncryptProps) -> WalletResult<Self::Output>;
}