fn derive_address()

in projects/web3/eth_wallet/ta/src/main.rs [95:109]


fn derive_address(input: &proto::DeriveAddressInput) -> Result<proto::DeriveAddressOutput> {
    let secure_object = load_from_secure_storage(input.wallet_id.as_bytes())
        .map_err(|e| anyhow!("[+] Deriving address: error: wallet not found: {:?}", e))?;
    dbg_println!("[+] Deriving address: secure object loaded");

    let wallet: Wallet = secure_object.try_into()?;
    let (address, public_key) = wallet.derive_address(&input.hd_path)?;
    dbg_println!("[+] Deriving address: address: {:?}", address);
    dbg_println!("[+] Deriving address: public key: {:?}", public_key);

    Ok(proto::DeriveAddressOutput {
        address,
        public_key,
    })
}