timeline: initial contact queries
This implements initial local contact queries. For testing you can create contact list columns via: Examples -------- Make a contacts column from a specific npub: $ notedeck --column contacts:npub... Use the current user's contacts: $ notedeck --column contacts --pub npub... We also introduce a new ColumnKind enum which is used to describe the column type. Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -23,6 +23,13 @@ impl Pubkey {
|
||||
&self.0
|
||||
}
|
||||
|
||||
pub fn parse(s: &str) -> Result<Self, Error> {
|
||||
match Pubkey::from_hex(s) {
|
||||
Ok(pk) => Ok(pk),
|
||||
Err(_) => Pubkey::try_from_bech32_string(s, false),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_hex(hex_str: &str) -> Result<Self, Error> {
|
||||
Ok(Pubkey(hex::decode(hex_str)?.as_slice().try_into()?))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user