Skip to content

Commit 0fee204

Browse files
authored
fix on publish range orders on nostr (#517)
1 parent e3a81db commit 0fee204

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: bot/modules/nostr/events.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ const orderToTags = async order => {
1212
const expiration =
1313
Math.floor(Date.now() / 1000) +
1414
parseInt(process.env.ORDER_PUBLISHED_EXPIRATION_WINDOW);
15+
let fiat_amount = order.fiat_amount;
16+
if (order.amount === 0) {
17+
fiat_amount = `${order.min_amount}-${order.max_amount}`;
18+
}
1519
const tags = [];
1620
tags.push(['d', order.id]);
1721
tags.push(['k', order.type]);
1822
tags.push(['f', order.fiat_code]);
1923
tags.push(['s', toKebabCase(order.status)]);
2024
tags.push(['amt', order.amount.toString()]);
21-
tags.push(['fa', order.fiat_amount.toString()]);
25+
tags.push(['fa', fiat_amount.toString()]);
2226
tags.push(['pm', order.payment_method]);
2327
tags.push(['premium', order.price_margin.toString()]);
2428
tags.push(['y', 'lnp2pbot']);

0 commit comments

Comments
 (0)