pub fn open_wallet(
		&self,
		name: Option<&str>,
		password: ZeroingString,
		use_mask: bool,
		wallet_data_dir: Option<&str>,
	) -> Result<Option<SecretKey>, Error> {
		// just return a representative string for doctest mode
		if self.doctest_mode {
			let secp_inst = static_secp_instance();
			let secp = secp_inst.lock();
			return Ok(Some(SecretKey::from_slice(
				&secp,
				&from_hex("d096b3cb75986b3b13f80b8f5243a9edf0af4c74ac37578c5a12cfb5b59b1868")
					.unwrap(),
			)?));
		}
		let mut w_lock = self.wallet_inst.lock();
		let lc = w_lock.lc_provider()?;
		lc.open_wallet(name, password, use_mask, self.doctest_mode, wallet_data_dir)
	}
/// `Opens` a wallet, populating the internal keychain with the encrypted seed, and optionally
/// returning a `keychain_mask` token to the caller to provide in all future calls.
/// If using a mask, the seed will be stored in-memory XORed against the `keychain_mask`, and
/// will not be useable if the mask is not provided.
///
/// # Arguments
///
/// * `name`: Reserved for future use, use `None` for the time being.
/// * `password`: The password to use to open the wallet
/// a new random seed.
/// * `use_mask`: Whether to create and return a mask which much be provided in all future
/// API calls.
///
/// # Returns
/// * Ok if successful
/// * or [`libwallet::Error`](../mimble_wallet_libwallet/struct.Error.html) if an error is encountered.
///
/// # Example
/// Set up as in [`new`](struct.Owner.html#method.new) method above.
/// ```
/// # mimble_wallet_api::doctest_helper_setup_doc_env!(wallet, wallet_config);
///
/// use mimble_core::global::ChainTypes;
///
/// // note that the WalletInst struct does not necessarily need to contain an
/// // instantiated wallet
/// let dir = "path/to/wallet/dir";
///
/// # let dir = tempdir().map_err(|e| format!("{:#?}", e)).unwrap();
/// # let dir = dir
/// #   .path()
/// #   .to_str()
/// #   .ok_or("Failed to convert tmpdir path to string.".to_owned())
/// #   .unwrap();
/// let api_owner = Owner::new(wallet.clone(), None, None);
/// let _ = api_owner.set_top_level_directory(dir);
///
/// // Create configuration
/// let result = api_owner.create_config(&ChainTypes::Mainnet, None,  None, None, None);
///
///	// create new wallet wirh random seed
///	let pw = ZeroingString::from("my_password");
/// let _ = api_owner.create_wallet(None, None, 0, pw.clone(), None);
///
/// let result = api_owner.open_wallet(None, pw, true, None);
///
/// if let Ok(m) = result {
///     // use this mask in all subsequent calls
///     let mask = m;
/// }
/// ```
`Opens` a wallet, populating the internal keychain with the encrypted seed, and optionally
returning a `keychain_mask` token to the caller to provide in all future calls.
If using a mask, the seed will be stored in-memory XORed against the `keychain_mask`, and
will not be useable if the mask is not provided.
` Opens ` a wallet populating the internal keychain with the encrypted seed and optionally returning a ` keychain_mask ` token to the caller to provide in all future calls . If using a mask the seed will be stored in - memory XORed against the ` keychain_mask ` and will not be useable if the mask is not provided .
pub fn open_wallet(
		&self,
		name: Option<&str>,
		password: ZeroingString,
		use_mask: bool,
		wallet_data_dir: Option<&str>,
	) -> Result<Option<SecretKey>, Error> {
		// just return a representative string for doctest mode
		if self.doctest_mode {
			let secp_inst = static_secp_instance();
			let secp = secp_inst.lock();
			return Ok(Some(SecretKey::from_slice(
				&secp,
				&from_hex("d096b3cb75986b3b13f80b8f5243a9edf0af4c74ac37578c5a12cfb5b59b1868")
					.unwrap(),
			)?));
		}
		let mut w_lock = self.wallet_inst.lock();
		let lc = w_lock.lc_provider()?;
		lc.open_wallet(name, password, use_mask, self.doctest_mode, wallet_data_dir)
	}
pub fn open_wallet ( & self , name : Option < & str > , password : ZeroingString , use_mask : bool , wallet_data_dir : Option < & str > , ) -> Result < Option < SecretKey > , Error > { // just return a representative string for doctest mode if self . doctest_mode { let secp_inst = static_secp_instance ( ) ; let secp = secp_inst . lock ( ) ; return Ok ( Some ( SecretKey :: from_slice ( & secp , & from_hex ( " " ) . unwrap ( ) , ) ? ) ) ; } let mut w_lock = self . wallet_inst . lock ( ) ; let lc = w_lock . lc_provider ( ) ? ; lc . open_wallet ( name , password , use_mask , self . doctest_mode , wallet_data_dir ) }
`Opens` a wallet, populating the internal keychain with the encrypted seed, and optionally
returning a `keychain_mask` token to the caller to provide in all future calls.
` Opens ` a wallet populating the internal keychain with the encrypted seed and optionally returning a ` keychain_mask ` token to the caller to provide in all future calls .
&self
name
Option<&str>
password
ZeroingString
use_mask
bool
wallet_data_dir
Option<&str>
Ok if successful
or [`libwallet::Error`](../mimble_wallet_libwallet/struct.Error.html) if an error is encountered.
Ok if successful or [ ` libwallet :: Error ` ] ( .. / mimble_wallet_libwallet / struct . Error . html ) if an error is encountered .
&self
name
Option<&str>
password
ZeroingString
use_mask
bool
wallet_data_dir
Option<&str>
example
Set up as in [`new`](struct.Owner.html#method.new) method above.
Set up as in [ ` new ` ] ( struct . Owner . html#method . new ) method above .
mimble_wallet_api::doctest_helper_setup_doc_env!(wallet, wallet_config);
use mimble_core::global::ChainTypes.

note that the WalletInst struct does not necessarily need to contain an
instantiated wallet
let dir = "path/to/wallet/dir".
use mimble_core :: global :: ChainTypes . note that the WalletInst struct does not necessarily need to contain an instantiated wallet let dir = " path / to / wallet / dir " .
let dir = tempdir().map_err(|e| format!("{:#?}", e)).unwrap();
None
let dir = dir
None
.path()
None
.to_str()
None
.ok_or("failed to convert tmpdir path to string.".to_owned())
None
.unwrap();
let api_owner = Owner::new(wallet.clone(), None, None);
let _ = api_owner.set_top_level_directory(dir).



create new wallet wirh random seed
let pw = ZeroingString::from("my_password");
let _ = api_owner.create_wallet(None, None, 0, pw.clone(), None).

let result = api_owner.open_wallet(None, pw, true, None).

if let Ok(m) = result {
use this mask in all subsequent calls
let mask = m;
}
```
let api_owner = Owner :: new ( wallet . clone () None None ) ; let _ = api_owner . set_top_level_directory ( dir ) . create new wallet wirh random seed let pw = ZeroingString :: from ( " my_password " ) ; let _ = api_owner . create_wallet ( None None 0 pw . clone () None ) . let result = api_owner . open_wallet ( None pw true None ) . if let Ok ( m ) = result { use this mask in all subsequent calls let mask = m ; } ` ` `