pub async fn wrap_chat_message(
sender_trade_keys: &Keys,
shared_pubkey: &PublicKey,
message: &str,
) -> Result<Event, MostroError>Expand description
Wrap a plain-text chat message into a Mostro P2P gift wrap (kind 1059).
sender_trade_keys— the sender’s per-trade keys; sign the inner kind 1 so the receiver can verify authorship.shared_pubkey— public key of theSharedKeyshared by the two chat parties; used as the NIP-44 recipient and as the value of the outerptag.message— the chat content to deliver.
The outer created_at is randomized within
nip59::RANGE_RANDOM_TIMESTAMP_TWEAK to defeat timing correlation.