diff --git a/bdk-ffi/src/wallet.rs b/bdk-ffi/src/wallet.rs index 100e1bd0..df97de59 100644 --- a/bdk-ffi/src/wallet.rs +++ b/bdk-ffi/src/wallet.rs @@ -37,7 +37,7 @@ use bdk::Error as BdkError; #[derive(Debug)] pub(crate) struct Wallet { - // TODO 8: Do we really need the mutex on the wallet? + // TODO 8: Do we really need the mutex on the wallet? Could this be an Arc? pub inner_mutex: Mutex, } @@ -74,7 +74,7 @@ impl Wallet { } // TODO 10: Do we need this mutex - pub(crate) fn get_wallet(&self) -> MutexGuard { + fn get_wallet(&self) -> MutexGuard { self.inner_mutex.lock().expect("wallet") } @@ -86,6 +86,22 @@ impl Wallet { // self.get_wallet().get_address(address_index.into()) // ) } + + pub fn network(&self) -> Network { + self.get_wallet().network().into() + } + + fn get_internal_address(&mut self, address_index: AddressIndex) -> AddressInfo { + self.get_wallet().get_internal_address(address_index.into()).into() + } + + // fn get_balance(&self) -> Balance { + // Balance::from(self.inner.get_balance()) + // } + + // fn is_mine(&self, script: Arc