bdk-ffi/src/lib.rs

38 lines
719 B
Rust
Raw Normal View History

2021-10-11 23:04:18 -07:00
use bdk::Wallet;
use bdk::database::MemoryDatabase;
use bdk::bitcoin::Network;
// use crate::error::FfiError;
use std::sync::RwLock;
use std::vec::Vec;
//mod error;
//mod types;
//mod wallet;
uniffi_macros::include_scaffolding!("bdk");
struct OfflineWallet {
wallet: Wallet<(), MemoryDatabase>,
//wallet: RwLock<Vec<String>>
}
impl OfflineWallet {
fn new(descriptor: String) -> Self {
let wallet = Wallet::new_offline(
&descriptor,
None,
Network::Regtest,
MemoryDatabase::new(),
).unwrap();
OfflineWallet {
wallet
}
// OfflineWallet {
// wallet: RwLock::new(Vec::new())
// }
}
2021-06-03 17:51:07 -07:00
}
2021-10-11 23:04:18 -07:00