Positions

This commit is contained in:
2026-07-25 01:57:27 +02:00
parent 2cbcdc7108
commit e61dd25e72
5 changed files with 54 additions and 7 deletions
+6 -2
View File
@@ -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 {