#[cfg(feature = "api-client")]
pub mod client;
use bitcoin::{ScriptBuf, TxOut, XOnlyPublicKey};
use cat_envelope::TaptreeElement;
use serde::{Deserialize, Serialize};
pub use cat_envelope;
#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
pub struct GetPubkeyResponse {
pub pubkey: XOnlyPublicKey,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValidateTxInputRequest {
pub tx: String,
pub index: usize,
pub prevouts: Vec<TxOut>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SignTxInputRequest {
pub tx: String,
pub index: usize,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SignTxInputResponse {
pub tx: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WrapScriptRequest {
#[serde(flatten)]
pub taptree_element: TaptreeElement,
pub internal_key: Option<XOnlyPublicKey>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WrapScriptResponse {
pub script: ScriptBuf,
pub output_script: ScriptBuf,
pub address: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WrapTaptreeRequest {
pub scripts: Vec<TaptreeElement>,
pub internal_key: Option<XOnlyPublicKey>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WrapTaptreeResponse {
pub output_script: ScriptBuf,
pub address: String,
}