pub fn address_get(
        // todo: rename to address_get_new?
        // todo: having to indicate the derivation path maybe is a much too low
        // level thing
        &self,
        account_id: &str,
        sub_account_index: usize,
        internal: bool,
        snapshot_password: &str,
    ) -> String {
        let mut account = self.account_get_by_id(account_id, snapshot_password);
        let sub_account = &mut account.get_sub_account(sub_account_index);
        let index = sub_account.addresses_increase_counter(internal);
        let address = account.get_address(format!(
            "m/44'/4218'/{}'/{}'/{}'",
            sub_account_index, !internal as u32, index
        ));
        self.account_update(&mut account, snapshot_password);
        address
    }
/// Get an address
///
/// Given an account id (`account_id`) and a derivation path (composed by `sub_account_index` and `internal`)
/// returns an address.
///
/// `account_id` id of the account to which the address has to belong
///
/// `sub_account_index` number of subaccount to which the address has to belong
///
/// `internal` chain to which the address has to belong (internal:false for receiving address and external:true
/// to change addresses)
///
/// `snapshot_password` password required to decrypt/encrypt the snapshot file
///
/// For additional check bip39 spec https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki (note: for practical purposes in this library we are calling "account" for a master seed and "subaccount" for a bip39 account)
///
/// # Example
/// ```no_run
/// use stronghold::Stronghold;
/// let stronghold = Stronghold::new("savings.snapshot");
/// let address = stronghold.address_get(
///     "7c1a5ce9cc8f57f8739634aefbafda9eba6a02f82e3a4ab825ed296274e3aca1",
///     1,
///     true,
///     "si/(3jfiudmeiKSie",
/// );
/// ```


`account_id` id of the account to which the address has to belong

`sub_account_index` number of subaccount to which the address has to belong

`internal` chain to which the address has to belong (internal:false for receiving address and external:true
to change addresses)

`snapshot_password` password required to decrypt/encrypt the snapshot file


` account_id ` id of the account to which the address has to belong ` sub_account_index ` number of subaccount to which the address has to belong ` internal ` chain to which the address has to belong ( internal : false for receiving address and external : true to change addresses ) ` snapshot_password ` password required to decrypt / encrypt the snapshot file
pub fn address_get(
        // todo: rename to address_get_new?
        // todo: having to indicate the derivation path maybe is a much too low
        // level thing
        &self,
        account_id: &str,
        sub_account_index: usize,
        internal: bool,
        snapshot_password: &str,
    ) -> String {
        let mut account = self.account_get_by_id(account_id, snapshot_password);
        let sub_account = &mut account.get_sub_account(sub_account_index);
        let index = sub_account.addresses_increase_counter(internal);
        let address = account.get_address(format!(
            "m/44'/4218'/{}'/{}'/{}'",
            sub_account_index, !internal as u32, index
        ));
        self.account_update(&mut account, snapshot_password);
        address
    }
pub fn address_get ( // todo: rename to address_get_new? // todo: having to indicate the derivation path maybe is a much too low // level thing & self , account_id : & str , sub_account_index : usize , internal : bool , snapshot_password : & str , ) -> String { let mut account = self . account_get_by_id ( account_id , snapshot_password ) ; let sub_account = & mut account . get_sub_account ( sub_account_index ) ; let index = sub_account . addresses_increase_counter ( internal ) ; let address = account . get_address ( format ! ( " " sub_account_index internal as u32 index ) ) ; self . account_update ( & mut account , snapshot_password ) ; address }
Get an address
Given an account id (`account_id`) and a derivation path (composed by `sub_account_index` and `internal`)
returns an address.
Get an address Given an account id ( ` account_id ` ) and a derivation path ( composed by ` sub_account_index ` and ` internal ` ) returns an address .
&self
account_id
&str
sub_account_index
usize
internal
bool
snapshot_password
&str
example
None