fuels-rs
fuels-rs copied to clipboard
docs: Update wallet.rs in-line BIP doc
In wallet.rs:
/// Creates a new wallet from a mnemonic phrase.
/// It takes a path to a BIP32 derivation path.
pub fn new_from_mnemonic_phrase_with_path(
The in-line docs specify that the function takes a BIP32 derivation path, however it is not limited to only BIP32, and in the function new_from_mnemonic_phrase
a BIP44 path is used when internally calling new_from_mnemonic_phrase_with_path
:
pub const DEFAULT_DERIVATION_PATH_PREFIX: &str = "m/44'/1179993420'";
/// Creates a new wallet from a mnemonic phrase.
/// The default derivation path is used.
pub fn new_from_mnemonic_phrase(phrase: &str, provider: Option<Provider>) -> Result<Self> {
let path = format!("{DEFAULT_DERIVATION_PATH_PREFIX}/0'/0/0");
Self::new_from_mnemonic_phrase_with_path(phrase, provider, &path)
}
The in-line docs should clarify that the function is not only limited to BIP32 derivation paths.