FuelLabs / fuels-rs

Fuel Network Rust SDK
https://fuellabs.github.io/fuels-rs
Apache License 2.0
44.35k stars 1.33k forks source link

docs: Update wallet.rs in-line BIP doc #1369

Closed K1-R1 closed 2 months ago

K1-R1 commented 2 months ago

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_phrasea 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.