Created
December 28, 2023 21:38
-
-
Save RGGH/e6c8a87eb67eb1578275fc4c86ce2ce3 to your computer and use it in GitHub Desktop.
Struct for Nostr in Rust
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![allow(unused)] | |
use chrono::Utc; | |
use dotenv::dotenv; | |
use regex::Regex; | |
use serde::{Deserialize, Serialize}; | |
use std::fmt; | |
use std::collections::HashSet; | |
use std::env; | |
use std::fs::File; | |
use std::io::Write; | |
use std::time::Duration; | |
use nostr_sdk::prelude::*; | |
use tokio::time; | |
type Tags = Vec<Vec<String>>; | |
#[derive(Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] | |
struct NosContent { | |
content: String, | |
pubkey: XOnlyPublicKey, | |
created_at: i32, | |
sig: String, | |
#[serde(rename = "tags")] | |
tags: Tags, | |
id: EventId | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment