mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 16:48:50 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f04bc0cee1 | ||
|
|
e63479ee7f | ||
|
|
c47f091d9b |
6
event.js
6
event.js
@@ -52,7 +52,7 @@ export function verifySignature(event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function signEvent(event, key) {
|
export async function signEvent(event, key) {
|
||||||
return Buffer.from(secp256k1.schnorr.sign(getEventHash(event), key)).toString(
|
return Buffer.from(
|
||||||
'hex'
|
await secp256k1.schnorr.sign(getEventHash(event), key)
|
||||||
)
|
).toString('hex')
|
||||||
}
|
}
|
||||||
|
|||||||
6
nip05.js
6
nip05.js
@@ -15,11 +15,7 @@ export async function searchDomain(domain, query = '') {
|
|||||||
export async function queryName(fullname) {
|
export async function queryName(fullname) {
|
||||||
try {
|
try {
|
||||||
let [name, domain] = fullname.split('@')
|
let [name, domain] = fullname.split('@')
|
||||||
|
if (!domain) return null
|
||||||
if (!domain) {
|
|
||||||
domain = name
|
|
||||||
name = '_'
|
|
||||||
}
|
|
||||||
|
|
||||||
let res = await (
|
let res = await (
|
||||||
await fetch(`https://${domain}/.well-known/nostr.json?name=${name}`)
|
await fetch(`https://${domain}/.well-known/nostr.json?name=${name}`)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nostr-tools",
|
"name": "nostr-tools",
|
||||||
"version": "0.22.0",
|
"version": "0.22.2",
|
||||||
"description": "Tools for making a Nostr client.",
|
"description": "Tools for making a Nostr client.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
2
relay.js
2
relay.js
@@ -160,7 +160,7 @@ export function relayConnect(url, onNotice = () => {}, onError = () => {}) {
|
|||||||
unsub()
|
unsub()
|
||||||
clearTimeout(willUnsub)
|
clearTimeout(willUnsub)
|
||||||
},
|
},
|
||||||
filter: {id: event.id}
|
filter: {ids: [event.id]}
|
||||||
},
|
},
|
||||||
`monitor-${event.id.slice(0, 5)}`
|
`monitor-${event.id.slice(0, 5)}`
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user