Skip to content

Instantly share code, notes, and snippets.

@RGGH
Created December 28, 2023 21:38
Show Gist options
  • Save RGGH/e6c8a87eb67eb1578275fc4c86ce2ce3 to your computer and use it in GitHub Desktop.
Save RGGH/e6c8a87eb67eb1578275fc4c86ce2ce3 to your computer and use it in GitHub Desktop.
Struct for Nostr in Rust
#![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