Expand description
Message sending — NIP-17 gift-wrapped DMs (text and file attachments).
This is the core send pipeline used by all Vector interfaces (GUI, CLI, SDK).
Clients provide a SendCallback for status notifications (pending/sent/failed/progress)
and a SendConfig for retry/cancel behavior.
Structs§
- NoOp
Send Callback - No-op callback for headless/CLI/test use.
- Send
Config - Configuration for a send operation.
- Send
Result - Result of sending a message.
- Temp
File - Removes a file when dropped: the ciphertext of an upload that ended either way.
Enums§
- File
Source - Where an outgoing file’s bytes come from.
- Sealed
- An outgoing attachment, ready for the upload.
Constants§
- NIP59_
RANDOM_ TIMESTAMP_ TWEAK - NIP-59’s gift-wrap backdating window (0 to 2 days).
Traits§
- Send
Callback - Callbacks invoked during the DM send pipeline.
Functions§
- note_
relay_ ok - Feed a relay
OKfor an outbound event back into the send pipeline. - resend_
failed_ dm - Manually retry a failed DM by republishing the EXACT retained recipient wrap. Same outer event id → relays no-op the duplicate, so a first send that silently landed can never double-post, regardless of the recipient’s client.
- seal_
or_ reuse - Reuse a live blob of the plaintext
hash, or sealplainunderkey/nonce, reporting each stage againstpending_id. A file seals file to file, costing no memory. - send_dm
- Send a NIP-17 gift-wrapped text DM.
- send_
file_ dm - Send a NIP-17 gift-wrapped file attachment DM.
- send_
file_ dm_ from send_file_dm_with_metafrom either source.- send_
file_ dm_ with_ meta send_file_dmfor a caller that already holds the image’s preview metadata, sparing a second full decode before the bubble can appear.Nonederives it.- send_
rumor_ dm - Send a pre-built rumor via NIP-17 gift-wrap.
- tweaked_
timestamp Timestamp::now()backdated by a random offset inside the NIP-59 window.