Add back deprecated signEvent function with a warning

This commit is contained in:
Alex Gleason
2023-04-24 00:11:05 -05:00
parent 9a3e05ce5f
commit 552530fa3f

View File

@@ -111,6 +111,14 @@ export function verifySignature(event: Event): boolean {
)
}
/** @deprecated Use `getSignature` instead. */
export function signEvent(event: UnsignedEvent, key: string): string {
console.warn(
'nostr-tools: `signEvent` is deprecated and will be removed or changed in the future. Please use `getSignature` instead.'
)
return getSignature(event, key)
}
/** Calculate the signature for an event. */
export function getSignature(event: UnsignedEvent, key: string): string {
return secp256k1.utils.bytesToHex(