diff --git a/README.md b/README.md index 39fb724..33e6dd4 100644 --- a/README.md +++ b/README.md @@ -30,10 +30,9 @@ println!("Current height: {}", node.current_block_height()); Furthermore a number of helper methods are implemented as well, such as: ```rust -/// A CLI interactive interface for prompting a user to select an address -pub fn select_wallet_address(&self) -> Result - +/// Get the current state context of the blockchain +pub fn get_state_context(&self) -> Result /// Returns a sorted list of unspent boxes which cover at least the /// provided value `total` of nanoErgs. /// Note: This box selection strategy simply uses the largest @@ -99,4 +98,4 @@ cargo doc --open Contributing ============ -See [CONTRIBUTING](CONTRIBUTING.md) \ No newline at end of file +See [CONTRIBUTING](CONTRIBUTING.md) diff --git a/src/wallet.rs b/src/wallet.rs index c559a18..42ac21e 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -30,32 +30,6 @@ impl NodeInterface { Ok(addresses) } - /// A CLI interactive interface for prompting a user to select an address - pub fn select_wallet_address(&self) -> Result { - let address_list = self.wallet_addresses()?; - if address_list.len() == 1 { - return Ok(address_list[0].clone()); - } - - let mut n = 0; - for address in &address_list { - n += 1; - println!("{n}. {address}"); - } - println!("Which address would you like to select?"); - let mut input = String::new(); - if std::io::stdin().read_line(&mut input).is_ok() { - if let Ok(input_n) = input.trim().parse::() { - if input_n > address_list.len() || input_n < 1 { - println!("Please select an address within the range."); - return self.select_wallet_address(); - } - return Ok(address_list[input_n - 1].clone()); - } - } - self.select_wallet_address() - } - /// Acquires unspent boxes from the node wallet pub fn unspent_boxes(&self) -> Result> { let endpoint = "/wallet/boxes/unspent?minConfirmations=0&minInclusionHeight=0";