pub output_values: &'a [u64],
pub outputs: usize,
}
#[derive(Clone, Debug, PartialEq)]
pub struct Sent {
pub amount: f64,
pub address: Address,
pub locked: Vec<OutPoint>,
}
#[derive(Serialize, Deserialize)]
pub struct JsonOutPoint {
txid: bitcoin::Txid,
vout: u32,
}
impl From<OutPoint> for JsonOutPoint {
fn from(outpoint: OutPoint) -> Self {
Self {
txid: outpoint.txid,
vout: outpoint.vout,
}
}
}
impl<'a> Default for TransactionTemplate<'a> {
fn default() -> Self {
Self {
fee: 0,
inputs: &[],
op_return: None,
op_return_index: None,
output_values: &[],
outputs: 1,
}
}
}
pub struct Handle {
close_handle: Option<CloseHandle>,
port: u16,
state: Arc<Mutex<State>>,
}
impl Handle {
pub fn url(&self) -> String {
format!("http://127.0.0.1:{}", self.port)
}
fn state(&self) -> MutexGuard<State> {
self.state.lock().unwrap()
}
pub fn wallets(&self) -> BTreeSet<String> {
self.state().wallets.clone()
}