added metadata and test
This commit is contained in:
19
README.md
19
README.md
@@ -13,6 +13,7 @@
|
||||
* **Social Connectivity**: Follow users and manage contact lists.
|
||||
* **Rich Feeds**: Access follow-based timelines, global discovery, and hashtag-based searches.
|
||||
* **Encrypted Messaging**: Secure NIP-17 direct messages.
|
||||
* **Profile Management**: Update account metadata (Kind 0) with support for standard and custom fields.
|
||||
* **Extensible Architecture**: Clean separation between protocol logic (NIPs) and high-level functions.
|
||||
|
||||
---
|
||||
@@ -67,6 +68,24 @@ let event_id = en.post_text("Building with EasyNostr is awesome!").await?;
|
||||
println!("Successfully posted! Event ID: {}", event_id);
|
||||
```
|
||||
|
||||
### 👤 Profile & Metadata
|
||||
|
||||
Update account information (NIP-01) including support for custom fields (e.g., bot, birthday).
|
||||
|
||||
```rust
|
||||
en.set_metadata(
|
||||
Some("user_name".to_string()),
|
||||
Some("Display Name".to_string()),
|
||||
Some("About me...".to_string()),
|
||||
Some("user@domain.com".to_string()), // NIP-05
|
||||
Some("user@getalby.com".to_string()), // LUD-16
|
||||
Some("https://website.com".to_string()),
|
||||
Some("https://banner.com/img.png".to_string()),
|
||||
Some(false), // bot (custom field)
|
||||
Some("1990-01-01".to_string()), // birthday (custom field)
|
||||
).await?;
|
||||
```
|
||||
|
||||
### 📰 Social Feeds
|
||||
|
||||
#### Timeline (Followed Users)
|
||||
|
||||
Reference in New Issue
Block a user