use clap::{command, Parser};
use crate::{commands::tx, tx::builder, xdr};
#[derive(Parser, Debug, Clone)]
#[group(skip)]
pub struct Cmd {
#[command(flatten)]
pub tx: tx::Args,
#[arg(long)]
pub destination: xdr::MuxedAccount,
#[arg(long, default_value = "native")]
pub asset: builder::Asset,
#[arg(long)]
pub amount: builder::Amount,
}
impl From<&Cmd> for xdr::OperationBody {
fn from(cmd: &Cmd) -> Self {
xdr::OperationBody::Payment(xdr::PaymentOp {
destination: cmd.destination.clone(),
asset: cmd.asset.clone().into(),
amount: cmd.amount.into(),
})
}
}