1#[cfg(feature = "api-client")]
2pub mod client;
3
4use bitcoin::{ScriptBuf, TxOut, XOnlyPublicKey};
5use cat_envelope::TaptreeElement;
6use serde::{Deserialize, Serialize};
7
8pub use cat_envelope;
9
10#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
11pub struct GetPubkeyResponse {
12 pub pubkey: XOnlyPublicKey,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct ValidateTxInputRequest {
17 pub tx: String,
19 pub index: usize,
21 pub prevouts: Vec<TxOut>,
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
26pub struct SignTxInputRequest {
27 pub tx: String,
29 pub index: usize,
31}
32
33#[derive(Debug, Clone, Serialize, Deserialize)]
34pub struct SignTxInputResponse {
35 pub tx: String,
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
40pub struct WrapScriptRequest {
41 #[serde(flatten)]
42 pub taptree_element: TaptreeElement,
43 pub internal_key: Option<XOnlyPublicKey>,
46}
47
48#[derive(Debug, Clone, Serialize, Deserialize)]
49pub struct WrapScriptResponse {
50 pub script: ScriptBuf,
52 pub output_script: ScriptBuf,
54 pub address: String,
56}
57
58#[derive(Debug, Clone, Serialize, Deserialize)]
59pub struct WrapTaptreeRequest {
60 pub scripts: Vec<TaptreeElement>,
62 pub internal_key: Option<XOnlyPublicKey>,
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
68pub struct WrapTaptreeResponse {
69 pub output_script: ScriptBuf,
71 pub address: String,
73}