Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 27 additions & 112 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ path = "src/main.rs"
[dependencies]
anyhow = "1.0.99"
clap = { version = "4.5.46", features = ["derive"] }
nostr-sdk = { version = "0.43.0", features = [
nostr-sdk = { version = "0.44.1", features = [
"nip06",
"nip44",
"nip59",
Expand All @@ -46,7 +46,7 @@ reqwest = { version = "0.12.23", default-features = false, features = [
"json",
"rustls-tls",
] }
mostro-core = "0.6.56"
mostro-core = "0.9.1"
lnurl-rs = { version = "0.9.0", default-features = false, features = ["ureq"] }
pretty_env_logger = "0.5.0"
sqlx = { version = "0.8.6", features = ["sqlite", "runtime-tokio-rustls"] }
Expand Down
1 change: 0 additions & 1 deletion src/cli/add_invoice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ pub async fn execute_add_invoice(order_id: &Uuid, invoice: &str, ctx: &Context)
// Send the DM
let sent_message = send_dm(
&ctx.client,
Some(&ctx.identity_keys),
&order_trade_keys,
&ctx.mostro_pubkey,
message_json,
Expand Down
4 changes: 2 additions & 2 deletions src/cli/adm_send_dm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::parser::common::{
create_emoji_field_row, create_field_value_header, create_standard_table,
};
use crate::util::messaging::get_admin_keys;
use crate::util::send_admin_gift_wrap_dm;
use crate::util::send_plain_text_dm;
use anyhow::Result;
use nostr_sdk::prelude::*;

Expand All @@ -29,7 +29,7 @@ pub async fn execute_adm_send_dm(receiver: PublicKey, ctx: &Context, message: &s
println!("{table}");
println!("💡 Sending admin gift wrap message...\n");

send_admin_gift_wrap_dm(&ctx.client, admin_keys, &receiver, message).await?;
send_plain_text_dm(&ctx.client, admin_keys, &receiver, message).await?;

println!(
"✅ Admin gift wrap message sent successfully to {}",
Expand Down
12 changes: 7 additions & 5 deletions src/cli/last_trade_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ pub async fn execute_last_trade_index(
.as_json()
.map_err(|_| anyhow::anyhow!("Failed to serialize message"))?;

// Send the last trade index message to Mostro server
// LastTradeIndex is account-scoped: the answer depends on which user
// is asking, and Mostro looks that up by the sender pubkey. Sign with
// `identity_keys` so the request resolves to the account, not to a
// (possibly unregistered) trade key.
let sent_message = send_dm(
&ctx.client,
Some(identity_keys),
&ctx.trade_keys,
identity_keys,
&mostro_key,
message_json,
None,
Expand All @@ -42,10 +44,10 @@ pub async fn execute_last_trade_index(
println!();

// Wait for incoming DM
let recv_event = wait_for_dm(ctx, Some(&ctx.trade_keys), sent_message).await?;
let recv_event = wait_for_dm(ctx, Some(identity_keys), sent_message).await?;

// Parse the incoming DM
let messages = parse_dm_events(recv_event, &ctx.trade_keys, None).await;
let messages = parse_dm_events(recv_event, identity_keys, None).await;
if let Some((message, _, _)) = messages.first() {
let message = message.get_inner_message_kind();
if message.action == Action::LastTradeIndex {
Expand Down
1 change: 0 additions & 1 deletion src/cli/new_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ pub async fn execute_new_order(
// Send the DM
let sent_message = send_dm(
&ctx.client,
Some(&ctx.identity_keys),
&ctx.trade_keys,
&ctx.mostro_pubkey,
message_json,
Expand Down
1 change: 0 additions & 1 deletion src/cli/orders_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ pub async fn execute_orders_info(order_ids: &[Uuid], ctx: &Context) -> Result<()
// Send the DM
let sent_message = send_dm(
&ctx.client,
Some(&ctx.identity_keys),
&ctx.trade_keys,
&ctx.mostro_pubkey,
message_json,
Expand Down
1 change: 0 additions & 1 deletion src/cli/rate_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pub async fn execute_rate_user(order_id: &Uuid, rating: &u8, ctx: &Context) -> R

let sent_message = send_dm(
&ctx.client,
Some(&ctx.identity_keys),
&trade_keys,
&ctx.mostro_pubkey,
rate_message,
Expand Down
Loading
Loading