generate_master

Function generate_master 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn generate_master( network: *const c_char, length: *const c_char, passphrase: *const c_char, ) -> *mut c_char
Expand description

Generates a mnemonic phrase of a given length. Defaults to 24 words. A master xprv is created from the mnemonic and passphrase.

  • OUTPUT
MasterKey {
  fingerprint: String,
  mnemonic: String,
  xprv: String,
}

ยงSafety

  • This function is unsafe because it dereferences and a returns raw pointer.
  • ENSURE that output is passed into cstring_free(ptr: *mut c_char) after use.