aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/nip17.ts
Commit message (Collapse)AuthorAgeFilesLines
* lintAdam Soltys2026-02-241-10/+35
|
* Merge remote-tracking branch 'origin/nip17dm' into ark2Adam Soltys2026-02-241-74/+6
|\ | | | | | | | | | | | | | | | | # Conflicts: # src/lib/nip07.ts # src/lib/nip17.ts # src/locales/en.json # src/locales/fr.json # src/routes/(app)/dm/+page.svelte
| * Always use ensureSigner for nostr signingAdrien Hopkins2026-02-241-61/+1
| | | | | | | | This fixes a problem that occurs with muting users using secret keys.
| * Fix bug that prevented sending nostr DMs with skAdrien Hopkins2026-02-241-2/+1
| |
| * Create only one event when sending DM to selfAdrien Hopkins2026-02-141-14/+21
| | | | | | | | | | | | | | | | | | | | | | Normally, the system creates two identical events: one encrypted to the sender and one to the recipient. If those are the same (i.e. you send a message to yourself), this creates two identical messages. The gift-wraps already give the two different events different pubkeys, created_at times, IDs and tags, so there should be no way to associate them with each other. Therefore, this change should not allow attackers to see that a message is sent to oneself by looking for a matching one.
| * Increase DM fetch limit to 2^16Adrien Hopkins2026-02-141-1/+1
| | | | | | | | | | Given that this is for all recipients combined, 2^16 is much more reasonable than 2^8.
* | Create only one event when sending DM to selfAdrien Hopkins2026-02-141-23/+18
| | | | | | | | | | | | | | | | | | | | | | Normally, the system creates two identical events: one encrypted to the sender and one to the recipient. If those are the same (i.e. you send a message to yourself), this creates two identical messages. The gift-wraps already give the two different events different pubkeys, created_at times, IDs and tags, so there should be no way to associate them with each other. Therefore, this change should not allow attackers to see that a message is sent to oneself by looking for a matching one.
* | Increase DM fetch limit to 2^16Adrien Hopkins2026-02-141-1/+1
| | | | | | | | | | Given that this is for all recipients combined, 2^16 is much more reasonable than 2^8.
* | formatAdam Soltys2026-02-111-64/+13
| |
* | lintingAdam Soltys2026-02-111-248/+346
| |
* | fix ts errorsAdam Soltys2026-02-111-35/+34
| |
* | fix importsAdam Soltys2026-02-111-1/+1
|/
* Fix NIP-17 DM signer integration and relay authAdam Soltys2026-01-281-21/+139
| | | | | | | | | | | | | - Add ensureSigner() to trigger signer modal when no valid key available - Add NIP-42 relay auth support for publishing DMs via publishWithAuth() - Validate signer sk length (64 hex chars) before use - Clear invalid signer state to ensure modal shows correctly - Include default relays when fetching messages for better coverage - Add try/catch around decrypt to handle failures gracefully - Fix variable declaration in for loop (const event) - Fall back to default DM relays when user has no 10050 event Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Add doc comments to my exported $lib methodsAdrien Hopkins2026-01-281-0/+2
|
* Unexport decryptNIP17MessageNIP07Adrien Hopkins2026-01-281-1/+1
| | | | | This is a helper method & isn't used anywhere else. It should have never been exported.
* Add button to mute/unmute accountAdrien Hopkins2026-01-091-1/+1
|
* Move some DM code to $libAdrien Hopkins2025-12-051-0/+105
| | | | I will be using some of this elsewhere, so it really should be there.
* Add expiration timestamps to kind 13 sealsAdrien Hopkins2025-11-131-12/+24
| | | | | | In case these leak, they will expire automatically. Currently, they use the same method as the gift wrap expirations: expiration + 2 days after the creation timestamp.
* Add DM expiration functionalityAdrien Hopkins2025-10-181-7/+16
|
* Send copy of messages to senderAdrien Hopkins2025-10-021-6/+12
|
* Fetch & display received DMs from relaysAdrien Hopkins2025-10-011-4/+2
|
* Add message decryptionAdrien Hopkins2025-09-131-0/+11
| | | | | | | | | Currently, this just takes a message from the text box and returns its decrypted version, but next I will make it decrypt messages it gets from relays. This code works with both NIP-07 (window.nostr) and getPrivateKey(). If both are available, it chooses NIP-07 like the encryption code.
* Remove need for explicit key entryAdrien Hopkins2025-09-051-14/+16
| | | | | | | | | If window.nostr is available, I don't need the sender's SK, I can do everything with its functions. Otherwise, I'll ask for the SK using getPrivateKey(). The override public key was only for testing, but I still don't need it because I can get the users' private keys from the settings tab.
* Seal with NIP-07 if availableAdrien Hopkins2025-09-051-2/+21
| | | | This makes the system work with any nostr extensions you might be using.
* Add improved NIP-17 codeAdrien Hopkins2025-08-261-0/+59
This is based on an audited NIP-44 implementation.