1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#[deny(missing_docs)]
use sapio::contract::{Compilable, Context};
use schemars::JsonSchema;
use serde::{Deserialize, Deserializer, Serialize};
use std::ffi::CString;
use std::os::raw::c_char;
use std::sync::Arc;
fn json_wrapped_string<'de, D, T>(d: D) -> Result<T, D::Error>
where
D: Deserializer<'de>,
T: for<'t> Deserialize<'t>,
{
let s = String::deserialize(d)?;
serde_json::from_str(&s).map_err(serde::de::Error::custom)
}
#[derive(Serialize, Deserialize)]
pub struct CreateArgs<S: for<'t> Deserialize<'t>>(
#[serde(deserialize_with = "json_wrapped_string")]
pub S,
pub bitcoin::Network,
#[serde(with = "bitcoin::util::amount::serde::as_sat")] pub bitcoin::util::amount::Amount,
);
#[cfg(feature = "host")]
pub mod host;
#[cfg(feature = "client")]
pub mod client;