Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nip12 fiat name filter tag #90

Merged
merged 1 commit into from
Jun 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,22 @@ pub async fn publish_order(
let event_kind = 30000;
let d_tag = Tag::Generic(TagKind::Custom("d".to_string()), vec![order_id.to_string()]);
// This tag helps client to subscribe to sell/buy order type notifications
let k_tag = Tag::Generic(TagKind::Custom("k".to_string()), vec![order.kind.to_string()]);
let event = EventBuilder::new(Kind::Custom(event_kind as u64), &order_string, &[d_tag,k_tag])
.to_event(keys)
.unwrap();
let k_tag = Tag::Generic(
TagKind::Custom("k".to_string()),
vec![order.kind.to_string()],
);
// This tag helps client to subscribe to fiat(shit) coin name
let f_tag = Tag::Generic(
TagKind::Custom("f".to_string()),
vec![order.fiat_code.clone()],
);
let event = EventBuilder::new(
Kind::Custom(event_kind as u64),
&order_string,
&[d_tag, k_tag, f_tag],
)
.to_event(keys)
.unwrap();
let event_id = event.id.to_string();
info!("Publishing Event Id: {event_id} for Order Id: {order_id}");
// We update the order id with the new event_id
Expand Down