update noble secp256k1 and ensure we always return hex.

This commit is contained in:
fiatjaf
2022-02-11 16:20:30 -03:00
parent 4c785279bc
commit c47f091d9b
3 changed files with 6 additions and 4 deletions

View File

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

View File

@@ -5,5 +5,5 @@ export function generatePrivateKey() {
}
export function getPublicKey(privateKey) {
return secp256k1.schnorr.getPublicKey(privateKey)
return Buffer.from(secp256k1.schnorr.getPublicKey(privateKey)).toString('hex')
}

View File

@@ -1,6 +1,6 @@
{
"name": "nostr-tools",
"version": "0.21.4",
"version": "0.22.1",
"description": "Tools for making a Nostr client.",
"repository": {
"type": "git",
@@ -8,7 +8,7 @@
},
"dependencies": {
"@noble/hashes": "^0.5.7",
"@noble/secp256k1": "^1.3.0",
"@noble/secp256k1": "^1.5.2",
"browserify-cipher": ">=1",
"buffer": ">=5",
"create-hash": "^1.2.0",