pub fn create_wallet(
		&self,
		name: Option<&str>,
		mnemonic: Option<ZeroingString>,
		mnemonic_length: u32,
		password: ZeroingString,
		wallet_data_dir: Option<&str>,
	) -> Result<(), Error> {
		let mut w_lock = self.wallet_inst.lock();
		let lc = w_lock.lc_provider()?;
		lc.create_wallet(
			name,
			mnemonic,
			mnemonic_length as usize,
			password,
			self.doctest_mode,
			wallet_data_dir,
		)
	}
/// Creates a new wallet seed and empty wallet database in the `wallet_data` directory of
/// the top level directory.
///
/// Paths in the configuration file will be updated to reflect the top level directory, so
/// path-related values in the optional configuration structs will be ignored.
///
/// The wallet files must not already exist, and ~The `mimble-wallet.toml` file must exist
/// in the top level directory (can be created via a call to
/// [`create_config`](struct.Owner.html#method.create_config))
///
/// # Arguments
///
/// * `name`: Reserved for future use, use `None` for the time being.
/// * `mnemonic`: If present, restore the wallet seed from the given mnemonic instead of creating
/// a new random seed.
/// * `mnemonic_length`: Desired length of mnemonic in bytes (16 or 32, either 12 or 24 words).
/// Use 0 if mnemonic isn't being used.
/// * `password`: The password used to encrypt/decrypt the `wallet.seed` file
///
/// # 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 result = api_owner.create_wallet(None, None, 0, pw, None);
///
/// if let Ok(r) = result {
///     //...
/// }
/// ```
Creates a new wallet seed and empty wallet database in the `wallet_data` directory of
the top level directory.

Paths in the configuration file will be updated to reflect the top level directory, so
path-related values in the optional configuration structs will be ignored.

The wallet files must not already exist, and ~The `mimble-wallet.toml` file must exist
in the top level directory (can be created via a call to
[`create_config`](struct.Owner.html#method.create_config))
Creates a new wallet seed and empty wallet database in the ` wallet_data ` directory of the top level directory . Paths in the configuration file will be updated to reflect the top level directory so path - related values in the optional configuration structs will be ignored . The wallet files must not already exist and ~The ` mimble - wallet . toml ` file must exist in the top level directory ( can be created via a call to [ ` create_config ` ] ( struct . Owner . html#method . create_config ))
pub fn create_wallet(
		&self,
		name: Option<&str>,
		mnemonic: Option<ZeroingString>,
		mnemonic_length: u32,
		password: ZeroingString,
		wallet_data_dir: Option<&str>,
	) -> Result<(), Error> {
		let mut w_lock = self.wallet_inst.lock();
		let lc = w_lock.lc_provider()?;
		lc.create_wallet(
			name,
			mnemonic,
			mnemonic_length as usize,
			password,
			self.doctest_mode,
			wallet_data_dir,
		)
	}
pub fn create_wallet ( & self , name : Option < & str > , mnemonic : Option < ZeroingString > , mnemonic_length : u32 , password : ZeroingString , wallet_data_dir : Option < & str > , ) -> Result < ( ) , Error > { let mut w_lock = self . wallet_inst . lock ( ) ; let lc = w_lock . lc_provider ( ) ? ; lc . create_wallet ( name , mnemonic , mnemonic_length as usize , password , self . doctest_mode , wallet_data_dir , ) }
Creates a new wallet seed and empty wallet database in the `wallet_data` directory of
the top level directory.
Creates a new wallet seed and empty wallet database in the ` wallet_data ` directory of the top level directory .
&self
name
Option<&str>
mnemonic
Option<ZeroingString>
mnemonic_length
u32
password
ZeroingString
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>
mnemonic
Option<ZeroingString>
mnemonic_length
u32
password
ZeroingString
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 result = api_owner.create_wallet(None, None, 0, pw, None).


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 result = api_owner . create_wallet ( None None 0 pw None ) .