Compare commits

..

1 Commits

Author SHA1 Message Date
fiatjaf
84e4fb1f92 update noble secp256k1 and ensure we always return hex. 2022-02-11 16:20:47 -03:00
4 changed files with 10 additions and 6 deletions

View File

@@ -52,7 +52,7 @@ export function verifySignature(event) {
}
export async function signEvent(event, key) {
return Buffer.from(
await secp256k1.schnorr.sign(getEventHash(event), key)
).toString('hex')
return Buffer.from(secp256k1.schnorr.sign(getEventHash(event), key)).toString(
'hex'
)
}

View File

@@ -15,7 +15,11 @@ export async function searchDomain(domain, query = '') {
export async function queryName(fullname) {
try {
let [name, domain] = fullname.split('@')
if (!domain) return null
if (!domain) {
domain = name
name = '_'
}
let res = await (
await fetch(`https://${domain}/.well-known/nostr.json?name=${name}`)

View File

@@ -1,6 +1,6 @@
{
"name": "nostr-tools",
"version": "0.22.2",
"version": "0.22.0",
"description": "Tools for making a Nostr client.",
"repository": {
"type": "git",

View File

@@ -160,7 +160,7 @@ export function relayConnect(url, onNotice = () => {}, onError = () => {}) {
unsub()
clearTimeout(willUnsub)
},
filter: {ids: [event.id]}
filter: {id: event.id}
},
`monitor-${event.id.slice(0, 5)}`
)