use crate::CurrentNetwork;
use snarkvm::{
console::program::Ciphertext,
prelude::{Address, PrivateKey, ViewKey},
};
use aleo_rust::TransferType;
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct AccountModel {
#[serde(skip_serializing_if = "Option::is_none")]
pub private_key_ciphertext: Option<Ciphertext<CurrentNetwork>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub private_key: Option<PrivateKey<CurrentNetwork>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub view_key: Option<ViewKey<CurrentNetwork>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<Address<CurrentNetwork>>,
}
#[derive(Debug, Clone, PartialEq, Eq, clap::ValueEnum)]
pub enum TransferTypeArg {
Private,
PrivateToPublic,
Public,
PublicToPrivate,
}
impl From<TransferTypeArg> for TransferType {
fn from(arg: TransferTypeArg) -> Self {
match arg {
TransferTypeArg::Public => TransferType::Public,
TransferTypeArg::Private => TransferType::Private,
TransferTypeArg::PublicToPrivate => TransferType::PublicToPrivate,
TransferTypeArg::PrivateToPublic => TransferType::PrivateToPublic,
}
}
}