Positions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::{collections::HashMap, str::FromStr};
|
||||
|
||||
use hypersdk::{U160, hypercore::PrivateKeySigner};
|
||||
use hypersdk::{Address, hypercore::PrivateKeySigner};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PrivateKey(pub PrivateKeySigner, pub String);
|
||||
@@ -40,7 +40,7 @@ impl serde::Serialize for PrivateKey {
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
||||
pub struct Account {
|
||||
pub address: U160,
|
||||
pub address: Address,
|
||||
pub private_key: PrivateKey,
|
||||
}
|
||||
|
||||
@@ -79,6 +79,10 @@ impl AccountList {
|
||||
toml::to_string(self)
|
||||
.map_err(|v| tokio::io::Error::new(std::io::ErrorKind::Other, v.to_string()))
|
||||
}
|
||||
|
||||
pub fn get_active<'a>(&'a self) -> Option<&'a Account> {
|
||||
self.accounts.get(&self.active)
|
||||
}
|
||||
}
|
||||
|
||||
impl Account {
|
||||
|
||||
Reference in New Issue
Block a user