Skip to content

Commit

Permalink
nip40 expiration event
Browse files Browse the repository at this point in the history
  • Loading branch information
arkanoider committed Apr 23, 2024
1 parent 93243aa commit e4faf9e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/nip33.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use chrono::Duration;
use mostro_core::order::Order;
use mostro_core::NOSTR_REPLACEABLE_EVENT_KIND;
use nostr::event::builder::Error;
Expand Down Expand Up @@ -58,6 +59,11 @@ pub fn order_to_tags(order: &Order) -> Vec<(String, String)> {
("y".to_string(), "mostrop2p".to_string()),
// Table name
("z".to_string(), "order".to_string()),
// Nip 40 expiration time - 12 hours over expiration user time
(
"expiration".to_string(),
(order.expires_at + Duration::hours(12).num_seconds()).to_string(),
),
];

tags
Expand Down

0 comments on commit e4faf9e

Please sign in to comment.