mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-18 17:14:21 +01:00
@@ -1,4 +1,5 @@
|
||||
use enostr::Keypair;
|
||||
use tokenator::TokenSerializable;
|
||||
|
||||
pub struct UserAccount {
|
||||
pub key: Keypair,
|
||||
@@ -9,3 +10,15 @@ impl UserAccount {
|
||||
Self { key }
|
||||
}
|
||||
}
|
||||
|
||||
impl TokenSerializable for UserAccount {
|
||||
fn parse_from_tokens<'a>(
|
||||
parser: &mut tokenator::TokenParser<'a>,
|
||||
) -> Result<Self, tokenator::ParseError<'a>> {
|
||||
Ok(UserAccount::new(Keypair::parse_from_tokens(parser)?))
|
||||
}
|
||||
|
||||
fn serialize_tokens(&self, writer: &mut tokenator::TokenWriter) {
|
||||
self.key.serialize_tokens(writer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user