nip46: stop supporting nip04-encrypted messages.

This commit is contained in:
fiatjaf 2025-04-02 10:25:19 -03:00
parent 2a11c9ec91
commit 4a738c93d0
3 changed files with 3 additions and 10 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@nostr/tools",
"version": "2.11.2",
"version": "2.12.0",
"exports": {
".": "./index.ts",
"./core": "./core.ts",

View File

@ -1,7 +1,6 @@
import { EventTemplate, NostrEvent, VerifiedEvent } from './core.ts'
import { generateSecretKey, finalizeEvent, getPublicKey, verifyEvent } from './pure.ts'
import { AbstractSimplePool, SubCloser } from './abstract-pool.ts'
import { decrypt as legacyDecrypt } from './nip04.ts'
import { getConversationKey, decrypt, encrypt } from './nip44.ts'
import { NIP05_REGEX } from './nip05.ts'
import { SimplePool } from './pool.ts'
@ -121,13 +120,7 @@ export class BunkerSigner {
[{ kinds: [NostrConnect], authors: [bp.pubkey], '#p': [getPublicKey(this.secretKey)] }],
{
async onevent(event: NostrEvent) {
let o
try {
o = JSON.parse(decrypt(event.content, convKey))
} catch (err) {
o = JSON.parse(await legacyDecrypt(clientSecretKey, event.pubkey, event.content))
}
const o = JSON.parse(decrypt(event.content, convKey))
const { id, result, error } = o
if (result === 'auth_url' && waitingForAuth[id]) {

View File

@ -1,7 +1,7 @@
{
"type": "module",
"name": "nostr-tools",
"version": "2.11.2",
"version": "2.12.0",
"description": "Tools for making a Nostr client.",
"repository": {
"type": "git",